Viewing File: <root>/src/mame/drivers/ms32.c

    1  /* Jaleco MegaSystem 32 (Preliminary Driver)
    2  
    3   - hardware tests are needed to establish how the mixing really works (and interrupt source etc.)
    4  
    5  Used by Jaleco in the Mid-90's this system, based on the V70 processor consisted
    6  of a two board set up, the first a standard mainboard and the second a 'cartridge'
    7  
    8  The actual Mega System 32 PCB mobo only outputs mono sound.  There is a connector on
    9  the PCB for a second speaker but it is still only in mono (no stereo effects in the music).
   10  
   11  -- Hardware Information (from Guru) --
   12  
   13  MS32 Motherboard
   14  ----------------
   15  
   16  PCB ID  : MB-93140A EB91022-20079-1
   17  CPU     : NEC D70632GD-20 (V70)
   18  SOUND   : Z80, YMF271, YAC513
   19  OSC     : 48.000MHz, 16.9344MHz, 40.000MHz
   20  RAM     : Cypress CY7C199-25 (x10)
   21            Sharp LH528256-70 (x5)
   22            Sharp LH5168D-10 (x1)
   23            OKI M511664-80 (x8)
   24  DIPs    : 8 position (x3)
   25  OTHER   : 5.5v battery
   26            Some PALs
   27            2 pin connector for right speaker (sound out is STEREO)
   28  
   29            Custom chips:
   30                         JALECO SS91022-01 (208 PIN PQFP)
   31                         JALECO SS91022-02 (100 PIN PQFP)
   32                         JALECO SS91022-03 (176 PIN PQFP) *
   33                         JALECO SS91022-05 (120 PIN PQFP) *
   34                         JALECO SS91022-07 (208 PIN PQFP)
   35                         JALECO GS91022-01 (120 PIN PQFP)
   36                         JALECO GS91022-02 (160 PIN PQFP)
   37                         JALECO GS91022-03 (100 PIN PQFP)
   38                         JALECO GS91022-04 (100 PIN PQFP) *
   39  
   40  ROMs:     None
   41  
   42  Chips marked * also appear on a non-megasystem 32 tetris 2 plus board
   43  
   44  MS32 Cartridge
   45  --------------
   46  
   47  Game Roms + Custom Chip
   48  
   49  The Custom chip provides the encryption
   50  
   51  Desert War     - Custom chip: JALECO SS91022-10 (144 pin PQFP) (located on small plug-in board with) (ID: SE93139 EB91022-30056)
   52  Game Paradise  - Custom chip: JALECO SS91022-10 9515EV 420201 06441
   53  Tetris Plus 2  - Custom chip: JALECO SS91022-10 9513EV 370121 06441
   54  Tetris Plus    - Custom chip: JALECO SS92046-01 9412EV 450891 06441
   55  kirarast       - Custom chip: JALECO SS92047-01 9425EV 367821 06441
   56  Gratia (set 1) - Custom chip: JALECO SS92047-01 9423EV 450891 06441
   57  Gratia (set 2) - Custom chip: JALECO SS91022-10
   58  P47-Aces       - Custom chip: JALECO SS92048-01 9410EV 436091 06441
   59  Angel Kiss     - Custom chip: Jaleco SS92047-01
   60  others are unknown
   61  
   62  Notes
   63  -----
   64  
   65  Some of the roms for each game are encrypted.
   66  
   67  The only difference between the two Gratia sets is in the encrypted ROMs (they use
   68  different custom chips). The program is the same.
   69  
   70  16x16x8 'Scroll' Tiles (Non-Roz BG Layer)
   71  8x8x8 'Ascii' Tiles (FG Layer)
   72  
   73  
   74  ToDo / Notes
   75  ------------
   76  
   77  Z80 + Sound Bits
   78  
   79  Priorities (code in tetrisp2.c doesn't use all of the priority ram.. and doesn't work here)
   80   - some games require completely reversed list processing!
   81  
   82  Dip switches/inputs in t2m32 and f1superb
   83  some games (hayaosi2) don't seeem to have service mode even if it's listed among the dips
   84  service mode is still accessible through F1 though
   85  
   86  Fix Anything Else (Palette etc.)
   87  
   88  
   89  Not sure about the main "global brightness" control register, I don't think it can make the palette
   90  completely black because of kirarast attract mode, so I'm making it cut by 50% at most.
   91   - brightness control also breaks other games in various places, eg gametngk everything going dark
   92     when bomb is used, p47 aces intro?
   93  
   94  gametngk seems to need some kind of shadow sprites but the only difference in the sprite attributes is one of the
   95      priority bits, forcing sprites of that priority to be shadows doesn't work
   96  tetrisp needs shadows as well, see the game selection screen.
   97  
   98  The above might be related to the second "global brightness" control register, which is 000000 in all games
   99  except gametngk, tetrisp, tp2m32 and gratia.
  100  
  101  horizontal position of tx and bg tilemaps is off by 1 pixel in some games
  102  
  103  bbbxing: some sprite/roz/bg alignment issues
  104  
  105  gratia: at the beginning of a level it shows the level name in the bottom right corner, scrolling it up
  106      and making the score display scroll out of the screen. Is this correct ar should there be a raster
  107      effect keeping the score on screen? And why didn't they just use sprites to do that?
  108  
  109  gratia: the 3d sky shown at the beginning of the game has a black gap near the end. It would not be visible
  110      if I made the "global brightness" register cut to 100% instead of 50%. Mmmm...
  111  
  112  gratia: the 3d sky seems to be the only place needed the "wrap" parameter to draw_roz to be set. All other
  113      games work fine with it not set, and there are many places where it definitely must not be set.
  114  
  115  gratia: at the beginning of the game, before the sky appears, the city background appears for
  116      an instant. Missing layer enable register?
  117  
  118  background color: pen 0 is correct for gametngk, but wrong for f1superb. Maybe it dpeends on the layer
  119      priority order?
  120  
  121  roz layer wrapping: currently it's always ON, breaking places where it gets very small so it gets
  122      repeated on the screen (p47aces, kirarast, bbbxing, gametngk need it OFF).
  123      gratia and desertwr need it ON.
  124  
  125  there are sprite lag issues - sprites should be framebuffered
  126  
  127  missing clipping window effect in gametngk intro
  128  
  129  
  130  Not Working Games
  131  -----------------
  132  
  133  f1superb - the road is always rendered as straight.
  134           - the game has a road layer and extra roms for it
  135           - there is an unknown maths DSP for protection
  136  
  137  Jaleco Megasystem 32 Game List - thanks to Yasuhiro
  138  ---------------------------------------------------
  139  
  140  P-47 Aces (p47aces)
  141  Game Tengoku / Game Paradise (gametngk)
  142  Tetris Plus (tetrisp)
  143  Tetris Plus 2 (tp2m32)
  144  Best Bout Boxing (bbbxing)
  145  Wangan Sensou / Desert War (desertwr)
  146  Second Earth Gratia (92047-01 version) (gratia)
  147  *Second Earth Gratia  (91022-10 version) (gratiaa) (redump needed)
  148  F-1 Super Battle (f1superb)
  149  
  150  Idol Janshi Su-Chi-Pi 2 (47pie2)
  151  Ryuusei Janshi Kirara Star (kirarast)
  152  Mahjong Angel Kiss
  153  Vs. Janshi Brand New Stars
  154  
  155  
  156  Hayaoshi Quiz Nettou Namahousou ( hayaosi3 )
  157  Hayaoshi Quiz Grand Champion Taikai (hayaosi2)
  158  
  159  Not Dumped:
  160  
  161  Super Strong Warriors
  162  
  163  
  164  
  165  */
  166  
  167  /********** BITS & PIECES **********/
  168  
  169  #include "emu.h"
  170  #include "cpu/z80/z80.h"
  171  #include "cpu/v60/v60.h"
  172  #include "sound/ymf271.h"
  173  #include "machine/jalcrpt.h"
  174  #include "includes/ms32.h"
  175  
  176  
  177  /********** READ INPUTS **********/
  178  
  179  CUSTOM_INPUT_MEMBER(ms32_state::mahjong_ctrl_r)
  180  {
  181      UINT32 mj_input;
  182  
  183      switch (m_mahjong_input_select[0])
  184      {
  185          case 0x01:
  186              mj_input = ioport("MJ0")->read();
  187              break;
  188          case 0x02:
  189              mj_input = ioport("MJ1")->read();
  190              break;
  191          case 0x04:
  192              mj_input = ioport("MJ2")->read();
  193              break;
  194          case 0x08:
  195              mj_input = ioport("MJ3")->read();
  196              break;
  197          case 0x10:
  198              mj_input = ioport("MJ4")->read();
  199              break;
  200          default:
  201              mj_input = 0;
  202  
  203      }
  204  
  205      return  mj_input & 0xff;
  206  }
  207  
  208  
  209  READ32_MEMBER(ms32_state::ms32_read_inputs3)
  210  {
  211      int a,b,c,d;
  212      a = ioport("AN2?")->read(); // unused?
  213      b = ioport("AN2?")->read(); // unused?
  214      c = ioport("AN1")->read();
  215      d = (ioport("AN0")->read() - 0xb0) & 0xff;
  216      return a << 24 | b << 16 | c << 8 | d << 0;
  217  }
  218  
  219  
  220  WRITE32_MEMBER(ms32_state::ms32_sound_w)
  221  {
  222      soundlatch_byte_w(space, 0, data & 0xff);
  223      machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
  224  
  225      // give the Z80 time to respond
  226      space.device().execute().spin_until_time(attotime::from_usec(40));
  227  }
  228  
  229  READ32_MEMBER(ms32_state::ms32_sound_r)
  230  {
  231      return m_to_main^0xff;
  232  }
  233  
  234  WRITE32_MEMBER(ms32_state::reset_sub_w)
  235  {
  236      if(data) machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); // 0 too ?
  237  }
  238  
  239  
  240  
  241  
  242  /********** MEMORY MAP **********/
  243  
  244  
  245  READ8_MEMBER(ms32_state::ms32_nvram_r8)
  246  {
  247      return m_nvram_8[offset];
  248  }
  249  
  250  WRITE8_MEMBER(ms32_state::ms32_nvram_w8)
  251  {
  252      m_nvram_8[offset] = data;
  253  }
  254  
  255  READ8_MEMBER(ms32_state::ms32_priram_r8)
  256  {
  257      return m_priram_8[offset];
  258  }
  259  
  260  WRITE8_MEMBER(ms32_state::ms32_priram_w8)
  261  {
  262      m_priram_8[offset] = data;
  263  }
  264  
  265  READ16_MEMBER(ms32_state::ms32_palram_r16)
  266  {
  267      return m_palram_16[offset];
  268  }
  269  
  270  WRITE16_MEMBER(ms32_state::ms32_palram_w16)
  271  {
  272      COMBINE_DATA(&m_palram_16[offset]);
  273  }
  274  
  275  READ16_MEMBER(ms32_state::ms32_rozram_r16)
  276  {
  277      return m_rozram_16[offset];
  278  }
  279  
  280  WRITE16_MEMBER(ms32_state::ms32_rozram_w16)
  281  {
  282      COMBINE_DATA(&m_rozram_16[offset]);
  283      m_roz_tilemap->mark_tile_dirty(offset/2);
  284  }
  285  
  286  READ16_MEMBER(ms32_state::ms32_lineram_r16)
  287  {
  288      return m_lineram_16[offset];
  289  }
  290  
  291  WRITE16_MEMBER(ms32_state::ms32_lineram_w16)
  292  {
  293      COMBINE_DATA(&m_lineram_16[offset]);
  294  }
  295  
  296  READ16_MEMBER(ms32_state::ms32_sprram_r16)
  297  {
  298      return m_sprram_16[offset];
  299  }
  300  
  301  WRITE16_MEMBER(ms32_state::ms32_sprram_w16)
  302  {
  303      COMBINE_DATA(&m_sprram_16[offset]);
  304  }
  305  
  306  READ16_MEMBER(ms32_state::ms32_txram_r16)
  307  {
  308      return m_txram_16[offset];
  309  }
  310  
  311  WRITE16_MEMBER(ms32_state::ms32_txram_w16)
  312  {
  313      COMBINE_DATA(&m_txram_16[offset]);
  314      m_tx_tilemap->mark_tile_dirty(offset/2);
  315  }
  316  
  317  READ16_MEMBER(ms32_state::ms32_bgram_r16)
  318  {
  319      return m_bgram_16[offset];
  320  }
  321  
  322  WRITE16_MEMBER(ms32_state::ms32_bgram_w16)
  323  {
  324      COMBINE_DATA(&m_bgram_16[offset]);
  325      m_bg_tilemap->mark_tile_dirty(offset/2);
  326      m_bg_tilemap_alt->mark_tile_dirty(offset/2);
  327  }
  328  
  329  WRITE32_MEMBER(ms32_state::pip_w)
  330  {
  331      m_tilemaplayoutcontrol = data;
  332  
  333      if ((data) && (data != 1))
  334          popmessage("fce00a7c = %02x",data);
  335  }
  336  
  337  
  338  static ADDRESS_MAP_START( ms32_map, AS_PROGRAM, 32, ms32_state )
  339      /* RAM areas verified by testing on real hw - usually accessed at the 0xfc000000 + mirror */
  340      AM_RANGE(0xc0000000, 0xc0007fff) AM_READWRITE8(ms32_nvram_r8,   ms32_nvram_w8,   0x000000ff) AM_MIRROR(0x3c1fe000)  // nvram is 8-bit wide, 0x2000 in size */
  341  /*  AM_RANGE(0xc0008000, 0xc01fffff) // mirrors of nvramram, handled above */
  342      AM_RANGE(0xc1180000, 0xc1187fff) AM_READWRITE8(ms32_priram_r8,  ms32_priram_w8,  0x000000ff) AM_MIRROR(0x3c038000) /* priram is 8-bit wide, 0x2000 in size */
  343  /*  AM_RANGE(0xc1188000, 0xc11bffff) // mirrors of priram, handled above */
  344      AM_RANGE(0xc1400000, 0xc143ffff) AM_READWRITE16(ms32_palram_r16, ms32_palram_w16, 0x0000ffff) AM_MIRROR(0x3c1c0000) /* palram is 16-bit wide, 0x20000 in size */
  345  /*  AM_RANGE(0xc1440000, 0xc145ffff) // mirrors of palram, handled above */
  346      AM_RANGE(0xc2000000, 0xc201ffff) AM_READWRITE16(ms32_rozram_r16, ms32_rozram_w16, 0x0000ffff) AM_MIRROR(0x3c1e0000) /* rozram is 16-bit wide, 0x10000 in size */
  347  /*  AM_RANGE(0xc2020000, 0xc21fffff) // mirrors of rozram, handled above */
  348      AM_RANGE(0xc2200000, 0xc2201fff) AM_READWRITE16(ms32_lineram_r16,ms32_lineram_w16,0x0000ffff) AM_MIRROR(0x3c1fe000) /* lineram is 16-bit wide, 0x1000 in size */
  349  /*  AM_RANGE(0xc2202000, 0xc23fffff) // mirrors of lineram, handled above */
  350      AM_RANGE(0xc2800000, 0xc283ffff) AM_READWRITE16(ms32_sprram_r16, ms32_sprram_w16, 0x0000ffff) AM_MIRROR(0x3c1c0000) /* spriteram is 16-bit wide, 0x20000 in size */
  351  /*  AM_RANGE(0xc2840000, 0xc29fffff) // mirrors of sprram, handled above */
  352      AM_RANGE(0xc2c00000, 0xc2c07fff) AM_READWRITE16(ms32_txram_r16,  ms32_txram_w16,  0x0000ffff) AM_MIRROR(0x3c1f0000) /* txram is 16-bit wide, 0x4000 in size */
  353      AM_RANGE(0xc2c08000, 0xc2c0ffff) AM_READWRITE16(ms32_bgram_r16,  ms32_bgram_w16,  0x0000ffff) AM_MIRROR(0x3c1f0000) /* bgram is 16-bit wide, 0x4000 in size */
  354  /*  AM_RANGE(0xc2c10000, 0xc2dfffff) // mirrors of txram / bg, handled above */
  355      AM_RANGE(0xc2e00000, 0xc2e1ffff) AM_RAM AM_SHARE("mainram")                                AM_MIRROR(0x3c0e0000) /* mainram is 32-bit wide, 0x20000 in size */
  356      AM_RANGE(0xc3e00000, 0xc3ffffff) AM_ROMBANK("bank1")                                                AM_MIRROR(0x3c000000) // ROM is 32-bit wide, 0x200000 in size */
  357  
  358      /* todo: clean up the mapping of these */
  359      AM_RANGE(0xfc800000, 0xfc800003) AM_READNOP /* sound? */
  360      AM_RANGE(0xfc800000, 0xfc800003) AM_WRITE(ms32_sound_w) /* sound? */
  361      AM_RANGE(0xfcc00004, 0xfcc00007) AM_READ_PORT("INPUTS")
  362      AM_RANGE(0xfcc00010, 0xfcc00013) AM_READ_PORT("DSW")
  363      AM_RANGE(0xfce00034, 0xfce00037) AM_WRITENOP // irq ack?
  364      AM_RANGE(0xfce00038, 0xfce0003b) AM_WRITE(reset_sub_w)
  365      AM_RANGE(0xfce00050, 0xfce0005f) AM_WRITENOP    // watchdog? I haven't investigated
  366  //  AM_RANGE(0xfce00000, 0xfce0007f) AM_WRITEONLY AM_SHARE("ms32_fce00000") /* registers not ram? */
  367      AM_RANGE(0xfce00000, 0xfce00003) AM_WRITE(ms32_gfxctrl_w)   /* flip screen + other unknown bits */
  368      AM_RANGE(0xfce00280, 0xfce0028f) AM_WRITE(ms32_brightness_w)    // global brightness control
  369  /**/AM_RANGE(0xfce00600, 0xfce0065f) AM_RAM AM_SHARE("roz_ctrl")        /* roz control registers */
  370  /**/AM_RANGE(0xfce00a00, 0xfce00a17) AM_RAM AM_SHARE("tx_scroll")   /* tx layer scroll */
  371  /**/AM_RANGE(0xfce00a20, 0xfce00a37) AM_RAM AM_SHARE("bg_scroll")   /* bg layer scroll */
  372      AM_RANGE(0xfce00a7c, 0xfce00a7f) AM_WRITE(pip_w)    // ??? layer related? seems to be always 0
  373  //  AM_RANGE(0xfce00e00, 0xfce00e03)    coin counters + something else
  374      AM_RANGE(0xfd000000, 0xfd000003) AM_READ(ms32_sound_r)
  375      AM_RANGE(0xfd1c0000, 0xfd1c0003) AM_WRITEONLY AM_SHARE("mahjong_select")
  376  ADDRESS_MAP_END
  377  
  378  
  379  /* F1 Super Battle has an extra linemap for the road, and am unknown maths chip (mcu?) handling perspective calculations for the road / corners etc. */
  380  /* it should use it's own memory map */
  381  
  382  WRITE16_MEMBER(ms32_state::ms32_extra_w16)
  383  {
  384      COMBINE_DATA(&m_f1superb_extraram_16[offset]);
  385      m_extra_tilemap->mark_tile_dirty(offset/2);
  386  }
  387  READ16_MEMBER(ms32_state::ms32_extra_r16)
  388  {
  389      return m_f1superb_extraram_16[offset];
  390  }
  391  
  392  WRITE32_MEMBER(ms32_state::ms32_irq2_guess_w)
  393  {
  394      irq_raise(2);
  395  }
  396  
  397  WRITE32_MEMBER(ms32_state::ms32_irq5_guess_w)
  398  {
  399      irq_raise(5);
  400  }
  401  
  402  static ADDRESS_MAP_START( f1superb_map, AS_PROGRAM, 32, ms32_state )
  403      AM_RANGE(0xfd0e0000, 0xfd0e0003) AM_READ(ms32_read_inputs3)
  404  
  405      AM_RANGE(0xfce00004, 0xfce00023) AM_RAM // regs?
  406      AM_RANGE(0xfce00200, 0xfce0021f) AM_RAM // regs?
  407      AM_RANGE(0xfce00800, 0xfce0085f) AM_RAM // regs?
  408  
  409      /* these two are almost certainly wrong, they just let you see what
  410         happens if you generate the FPU ints without breaking other games */
  411      AM_RANGE(0xfce00e00, 0xfce00e03) AM_WRITE(ms32_irq5_guess_w)
  412      AM_RANGE(0xfd0f0000, 0xfd0f0003) AM_WRITE(ms32_irq2_guess_w)
  413  
  414      AM_RANGE(0xfd100000, 0xfd103fff) AM_RAM // used when you start enabling fpu ints
  415      AM_RANGE(0xfd104000, 0xfd105fff) AM_RAM // uploads data here
  416  
  417      AM_RANGE(0xfd140000, 0xfd143fff) AM_RAM // used when you start enabling fpu ints
  418      AM_RANGE(0xfd144000, 0xfd145fff) AM_RAM // same data here
  419  
  420      AM_RANGE(0xfdc00000, 0xfdc007ff) AM_READWRITE16(ms32_extra_r16, ms32_extra_w16, 0x0000ffff) // definitely line ram
  421      AM_RANGE(0xfde00000, 0xfde01fff) AM_RAM // scroll info for lineram?
  422  
  423      AM_IMPORT_FROM(ms32_map)
  424  ADDRESS_MAP_END
  425  
  426  /* F1 Super Battle speculation from nuapete
  427  
  428  Hi David,
  429  
  430  I had a first look at f1superb, this is what I found so far.
  431  
  432  The sprite RAM is updated in a few places, but taking one of the
  433  sprite RAM updating routines at 0xFFE47B6F which is used to draw stuff
  434  that should move around, I see that the information is copied from
  435  buffers with these bases:
  436  FEE11000 = x position data
  437  FEE11100 = y position data
  438  FEE11200 = priority etc data
  439  
  440  You already spotted that loop at FFE19D1C that fills the "y position"
  441  buffer from an array of static values. The buffers are refilled again
  442  by the routine at 0xFFE17581. You can see that the data is sourced
  443  from another buffer at 0xFD100000 (currently not mapped in the driver,
  444  but I mapped it in for testing...)
  445  
  446  If you backtrace that call, it comes from irq 5 and 7. (They have
  447  identical ISR code) so I tried adding in a trigger for irq 7. Now the
  448  values are populated, and stuff moves, but everything moves way too
  449  much, it's all over the place, eventually the car zooms off up into
  450  the sky. It gets clearer as you map less and less of the RAM at
  451  0xFD100000. With just 1K or so mapped, you can see the buildings in
  452  the background veer about in quite a promising manner. (The patch you
  453  put in loses effect with irq 5 or 7 hooked up, because they repopulate
  454  the Y coords too.)
  455  
  456  I took a closer look at the interrupts. Handily enough they left some
  457  strings in the ROM with names for each interrupt  :)  They aren't quite
  458  in the order of the interrupts, but I matched the unreferenced strings
  459  up to the valid interrupts as well as I could and then tried to
  460  confirm them by looking at the code. The ROM string is in quotes.
  461  
  462  FFE00DE8  ; irq_0  probably "1msec interrupt"
  463  FFE00DF4  ; irq_1  "sound cpu interrupt"
  464  FFE00878  ; irq_2  probably "fpu 1-1 interrupt"
  465  FFE00884  ; irq_3  unused and labelled "fpu 0-1 interrupt"
  466  FFE00898  ; irq_4  unused and labelled "fpu 1-0 interrupt"
  467  FFE008AC  ; irq_5  probably "fpu 0-0 interrupt", x coords (and y) populated from here
  468  FFE008D0  ; irq_6  unused and labelled "option 2 interrupt"
  469  FFE008E4  ; irq_7  same as 5 - probably "option 1 interrupt"
  470  FFE01034  ; irq_9  VBL at 60Hz this would be "16msec interrupt"
  471  FFE01094  ; irq_10 loads of processing in the 0xfc000000 area : must be "32msec interrupt"
  472  FFE00E14  ; irq_11 "communication interrupt"
  473  
  474  irq_0 is sort of confirmed by the "hayaosi2 needs at least 12 IRQ
  475  0..." comment. irq_1 I see is already known. irq_9 is known, irq_10 I
  476  tried halving the frequency it runs at, no effect. irq_11 can be
  477  pretty much confirmed as comms by the code there and the use of
  478  MOVT/MOVZ to i/o with 16 bit device based at FEE00000, so that leaves
  479  the ones that do the sprite info loading, this is where it starts to
  480  look less promising  :(
  481  
  482  Between irqs 2,3,4,5,7 the only unused strings in the ROM are the four "fpu
  483  * interrupt" and the "option 1".
  484  Irqs 2,5,7 all do "or.w    #6, FD1424C8[PC]" ,so they are all probably
  485  "fpu * interrupt".
  486  
  487  I'm thinking that the stuff is dumped in that RAM at 0xFD100000 that's
  488  not used by other games and then some FPU operation is carried out on it
  489  before it's grabbed by the sprite copy code. The "option" stuff, may be
  490  they tried a few different ways to work out the sprite coords? There's
  491  one more intersting string at 0xFFE481FC referenced from unused code
  492  at 0xFFE47FBC. It looks like debugging dump of sprite coordinate and
  493  angle information.
  494  
  495  I had a scout around for photos or anything of the PCB to see if there
  496  is some sort of DSP or FPU on it, but I can't find anything useful. I
  497  suspect it's not a generic MegaSystem 32 PCB, going by the extra
  498  stuff, and also the IRQ 5/7 breaks the other games. I see a vanilla
  499  one for sale, but I'd guess there's no point me picking it up for a
  500  closer look because it won't have whatever the extras are.
  501  
  502  I'll keep looking a bit more, but I think that 0xFD100000 buffer is
  503  processed by something external that triggers irq 5 or 7 when it's
  504  done. I might see something obvious by looking at the values in
  505  fact... I'd be interested to know what you think, or if there's any
  506  chance of finding out if there's stuff like dual port RAM or something
  507  that might qualify as a FPU?
  508  
  509  
  510  Hi David,
  511  
  512  On the f1superb stuff, I've traced the sprite elements right back to
  513  the arrays for each race track in ROM that they are sourced from. The
  514  only processing they get is in that "fpu" interrupt. I've figured out
  515  the structure of the "fpu" device, it uses two arrays of static info
  516  loaded from the ROM at boot, two identical sets of registers, and 4
  517  banks of volatile data read in every frame or so from the ROM race
  518  track arrays (although it looks like one was not used in the end).
  519  There's a sequence of four operations ivolving the "fpu" carried out
  520  to prepare the info which then gets copied back to RAM and then to
  521  sprite RAM. I'll capture the relevant info and see if I can figure out
  522  what the operations might be, my maths isn't up to much though...
  523  
  524  */
  525  
  526  //  AM_RANGE(0xfce00800, 0xfce0085f) // f1superb, roz #2 control?
  527  ///**/AM_RANGE(0xfd104000, 0xfd105fff) AM_RAM /* f1superb */
  528  ///**/AM_RANGE(0xfd144000, 0xfd145fff) AM_RAM /* f1superb */
  529  ///**/AM_RANGE(0xfd440000, 0xfd47ffff) AM_RAM /* f1superb color */
  530  ///**/AM_RANGE(0xfdc00000, 0xfdc006ff) AM_RAM /* f1superb */
  531  ///**/AM_RANGE(0xfde00000, 0xfde01fff) AM_RAM /* f1superb lineram #2? */
  532  ///**/AM_RANGE(0xfe202000, 0xfe2fffff) AM_RAM /* f1superb vram */
  533  //  AM_RANGE(0xfd0e0000, 0xfd0e0003) AM_READ(ms32_read_inputs3) /* analog controls in f1superb? */
  534  
  535  /*************************************
  536   *
  537   *  Generic port definitions
  538   *
  539   *************************************/
  540  
  541  static INPUT_PORTS_START( ms32 )
  542      PORT_START("INPUTS")
  543      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
  544      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
  545      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
  546      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
  547      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
  548      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
  549      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
  550      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
  551      PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
  552      PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
  553      PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
  554      PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
  555      PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
  556      PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
  557      PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
  558      PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
  559  
  560      PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
  561      PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
  562      PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_SERVICE1 )
  563      PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)
  564      PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_START1 )
  565      PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_START2 )
  566      PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
  567      PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
  568      PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  569      PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  570      PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  571      PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  572      PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  573      PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  574      PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  575      PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  576  
  577      PORT_START("DSW")
  578      PORT_DIPUNUSED_DIPLOC( 0x00000001, 0x00000001, "SW2:8" )
  579      PORT_DIPUNUSED_DIPLOC( 0x00000002, 0x00000002, "SW2:7" )
  580      PORT_DIPUNUSED_DIPLOC( 0x00000004, 0x00000004, "SW2:6" )
  581      PORT_DIPUNUSED_DIPLOC( 0x00000008, 0x00000008, "SW2:5" )
  582      PORT_DIPUNUSED_DIPLOC( 0x00000010, 0x00000010, "SW2:4" )
  583      PORT_DIPUNUSED_DIPLOC( 0x00000020, 0x00000020, "SW2:3" )
  584      PORT_DIPUNUSED_DIPLOC( 0x00000040, 0x00000040, "SW2:2" )
  585      PORT_DIPUNUSED_DIPLOC( 0x00000080, 0x00000080, "SW2:1" )
  586      PORT_SERVICE_DIPLOC( 0x00000100, IP_ACTIVE_LOW, "SW1:8" )
  587      PORT_DIPNAME( 0x00000200, 0x00000200, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:7")
  588      PORT_DIPSETTING(          0x00000200, DEF_STR( Off ) )
  589      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  590      PORT_DIPNAME( 0x00001c00, 0x00001c00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:6,5,4")
  591      PORT_DIPSETTING(          0x00000000, DEF_STR( 5C_1C ) )
  592      PORT_DIPSETTING(          0x00001000, DEF_STR( 4C_1C ) )
  593      PORT_DIPSETTING(          0x00000800, DEF_STR( 3C_1C ) )
  594      PORT_DIPSETTING(          0x00001800, DEF_STR( 2C_1C ) )
  595      PORT_DIPSETTING(          0x00001c00, DEF_STR( 1C_1C ) )
  596      PORT_DIPSETTING(          0x00000c00, DEF_STR( 1C_2C ) )
  597      PORT_DIPSETTING(          0x00001400, DEF_STR( 1C_3C ) )
  598      PORT_DIPSETTING(          0x00000400, DEF_STR( 1C_4C ) )
  599      PORT_DIPNAME( 0x0000e000, 0x0000e000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,2,1")
  600      PORT_DIPSETTING(          0x00000000, DEF_STR( 5C_1C ) )
  601      PORT_DIPSETTING(          0x00008000, DEF_STR( 4C_1C ) )
  602      PORT_DIPSETTING(          0x00004000, DEF_STR( 3C_1C ) )
  603      PORT_DIPSETTING(          0x0000c000, DEF_STR( 2C_1C ) )
  604      PORT_DIPSETTING(          0x0000e000, DEF_STR( 1C_1C ) )
  605      PORT_DIPSETTING(          0x00006000, DEF_STR( 1C_2C ) )
  606      PORT_DIPSETTING(          0x0000a000, DEF_STR( 1C_3C ) )
  607      PORT_DIPSETTING(          0x00002000, DEF_STR( 1C_4C ) )
  608  
  609      PORT_DIPUNUSED_DIPLOC( 0x00010000, 0x00010000, "SW3:8" )
  610      PORT_DIPUNUSED_DIPLOC( 0x00020000, 0x00020000, "SW3:7" )
  611      PORT_DIPUNUSED_DIPLOC( 0x00040000, 0x00040000, "SW3:6" )
  612      PORT_DIPUNUSED_DIPLOC( 0x00080000, 0x00080000, "SW3:5" )
  613      PORT_DIPUNUSED_DIPLOC( 0x00100000, 0x00100000, "SW3:4" )
  614      PORT_DIPUNUSED_DIPLOC( 0x00200000, 0x00200000, "SW3:3" )
  615      PORT_DIPUNUSED_DIPLOC( 0x00400000, 0x00400000, "SW3:2" )
  616      PORT_DIPUNUSED_DIPLOC( 0x00800000, 0x00800000, "SW3:1" )
  617      PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED )   // Unused?
  618  INPUT_PORTS_END
  619  
  620  static INPUT_PORTS_START( ms32_mahjong )
  621      PORT_INCLUDE( ms32 )
  622  
  623      PORT_MODIFY("INPUTS")
  624      PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ms32_state,mahjong_ctrl_r, NULL)    // here we read mahjong keys
  625      PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNUSED )
  626      PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
  627      PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
  628      PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_SERVICE1 )
  629      PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)
  630      PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED )   /* Start 1 is already mapped in mahjong inputs */
  631      PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )   /* ms32.c mahjongs don't have P2 inputs -> no Start 2*/
  632      PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  633      PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  634  
  635      PORT_START("MJ0")
  636      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 )
  637      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_A )
  638      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_E )
  639      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_M )
  640      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_I )
  641      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
  642      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  643      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  644  
  645      PORT_START("MJ1")
  646      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
  647      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_B )
  648      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_F )
  649      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_N )
  650      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_J )
  651      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
  652      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  653      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  654  
  655      PORT_START("MJ2")
  656      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
  657      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_C )
  658      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_G )
  659      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
  660      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_K )
  661      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
  662      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  663      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  664  
  665      PORT_START("MJ3")
  666      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
  667      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_D )
  668      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_H )
  669      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
  670      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_L )
  671      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  672      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  673      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  674  
  675      PORT_START("MJ4")
  676      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
  677      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN )
  678      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
  679      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
  680      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  681      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  682      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  683      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  684  INPUT_PORTS_END
  685  
  686  /*************************************
  687   *
  688   *  Game-specific port definitions
  689   *
  690   *************************************/
  691  
  692  static INPUT_PORTS_START( bbbxing )
  693      PORT_INCLUDE( ms32 )
  694  
  695      PORT_MODIFY("DSW")
  696      PORT_DIPNAME( 0x00000001, 0x00000001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
  697      PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
  698      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  699      PORT_DIPNAME( 0x00000002, 0x00000000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:7")
  700      PORT_DIPSETTING(          0x00000002, DEF_STR( Japanese ) )
  701      PORT_DIPSETTING(          0x00000000, DEF_STR( English ) )
  702      PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:6")
  703      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  704      PORT_DIPSETTING(          0x00000004, DEF_STR( On ) )
  705      PORT_DIPNAME( 0x00000030, 0x00000030, "Timer Speed" ) PORT_DIPLOCATION("SW2:4,3")
  706      PORT_DIPSETTING(          0x00000000, "60/60" )
  707      PORT_DIPSETTING(          0x00000020, "50/60" )
  708      PORT_DIPSETTING(          0x00000010, "40/60" )
  709      PORT_DIPSETTING(          0x00000030, "35/60" )
  710      PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,1")
  711      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
  712      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
  713      PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
  714      PORT_DIPSETTING(          0x00000080, DEF_STR( Hardest ) )
  715  
  716      PORT_DIPNAME( 0x00020000, 0x00020000, "Grute's Attacking Power" ) PORT_DIPLOCATION("SW3:7")
  717      PORT_DIPSETTING(          0x00020000, DEF_STR( Normal ) )
  718      PORT_DIPSETTING(          0x00000000, DEF_STR( Harder ) )
  719      PORT_DIPNAME( 0x00040000, 0x00040000, "Biff's Attacking Power" ) PORT_DIPLOCATION("SW3:6")
  720      PORT_DIPSETTING(          0x00040000, DEF_STR( Normal ) )
  721      PORT_DIPSETTING(          0x00000000, DEF_STR( Harder ) )
  722      PORT_DIPNAME( 0x00080000, 0x00080000, "Carolde's Attacking Power" ) PORT_DIPLOCATION("SW3:5")
  723      PORT_DIPSETTING(          0x00080000, DEF_STR( Normal ) )
  724      PORT_DIPSETTING(          0x00000000, DEF_STR( Harder ) )
  725      PORT_DIPNAME( 0x00100000, 0x00100000, "Jose's Attacking Power" ) PORT_DIPLOCATION("SW3:4")
  726      PORT_DIPSETTING(          0x00100000, DEF_STR( Normal ) )
  727      PORT_DIPSETTING(          0x00000000, DEF_STR( Harder ) )
  728      PORT_DIPNAME( 0x00200000, 0x00200000, "Thamalatt's Attacking Power" ) PORT_DIPLOCATION("SW3:3")
  729      PORT_DIPSETTING(          0x00200000, DEF_STR( Normal ) )
  730      PORT_DIPSETTING(          0x00000000, DEF_STR( Harder ) )
  731      PORT_DIPNAME( 0x00400000, 0x00400000, "Kim's Attacking Power" ) PORT_DIPLOCATION("SW3:2")
  732      PORT_DIPSETTING(          0x00400000, DEF_STR( Normal ) )
  733      PORT_DIPSETTING(          0x00000000, DEF_STR( Harder ) )
  734      PORT_DIPNAME( 0x00800000, 0x00800000, "Jyoji's Attacking Power" ) PORT_DIPLOCATION("SW3:1")
  735      PORT_DIPSETTING(          0x00800000, DEF_STR( Normal ) )
  736      PORT_DIPSETTING(          0x00000000, DEF_STR( Harder ) )
  737  INPUT_PORTS_END
  738  
  739  static INPUT_PORTS_START( desertwr )
  740      PORT_INCLUDE( ms32 )
  741  
  742      PORT_MODIFY("DSW")
  743      PORT_DIPNAME( 0x00000001, 0x00000001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
  744      PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
  745      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  746      PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
  747      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  748      PORT_DIPSETTING(          0x00000002, DEF_STR( On ) )
  749      PORT_DIPNAME( 0x00000030, 0x00000030, "Armors" ) PORT_DIPLOCATION("SW2:4,3")
  750  //  PORT_DIPSETTING(          0x00000000, "2" )           // duplicate setting ?
  751      PORT_DIPSETTING(          0x00000010, "2" )
  752      PORT_DIPSETTING(          0x00000030, "3" )
  753      PORT_DIPSETTING(          0x00000020, "4" )
  754      PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,1")
  755      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
  756      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
  757      PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
  758      PORT_DIPSETTING(          0x00000080, DEF_STR( Hardest ) )
  759  
  760      PORT_DIPNAME( 0x00100000, 0x00000000, "Title screen" ) PORT_DIPLOCATION("SW3:4")
  761      PORT_DIPSETTING(          0x00100000, DEF_STR( Japanese ) )
  762      PORT_DIPSETTING(          0x00000000, DEF_STR( English ) )
  763      PORT_DIPNAME( 0x00400000, 0x00400000, "FBI Logo" ) PORT_DIPLOCATION("SW3:2")
  764      PORT_DIPSETTING(          0x00400000, DEF_STR( No ) )
  765      PORT_DIPSETTING(          0x00000000, DEF_STR( Yes ) )
  766      PORT_DIPNAME( 0x00800000, 0x00000000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW3:1")
  767      PORT_DIPSETTING(          0x00800000, DEF_STR( Japanese ) )
  768      PORT_DIPSETTING(          0x00000000, DEF_STR( English ) )
  769  INPUT_PORTS_END
  770  
  771  static INPUT_PORTS_START( gametngk )
  772      PORT_INCLUDE( ms32 )
  773  
  774      PORT_MODIFY("DSW")
  775      PORT_DIPNAME( 0x00000001, 0x00000001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
  776      PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
  777      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  778      PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
  779      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  780      PORT_DIPSETTING(          0x00000002, DEF_STR( On ) )
  781      PORT_DIPNAME( 0x00000030, 0x00000030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4,3")
  782      PORT_DIPSETTING(          0x00000000, "1" )
  783      PORT_DIPSETTING(          0x00000030, "3" )
  784      PORT_DIPSETTING(          0x00000010, "4" )
  785      PORT_DIPSETTING(          0x00000020, "5" )
  786      PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,1")
  787      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
  788      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
  789      PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
  790      PORT_DIPSETTING(          0x00000080, DEF_STR( Hardest ) )
  791  
  792      PORT_DIPNAME( 0x00010000, 0x00010000, "Freeze" ) PORT_DIPLOCATION("SW3:8")
  793      PORT_DIPSETTING(          0x00010000, DEF_STR( Off ) )
  794      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  795      PORT_DIPNAME( 0x00020000, 0x00020000, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW3:7")
  796      PORT_DIPSETTING(          0x00020000, DEF_STR( Off ) )
  797      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  798      PORT_DIPNAME( 0x00200000, 0x00200000, "Voice" ) PORT_DIPLOCATION("SW3:3")
  799      PORT_DIPSETTING(          0x00000000, DEF_STR( No ) )
  800      PORT_DIPSETTING(          0x00200000, DEF_STR( Yes ) )
  801      PORT_DIPNAME( 0x00400000, 0x00400000, "FBI Logo" ) PORT_DIPLOCATION("SW3:2")
  802      PORT_DIPSETTING(          0x00400000, DEF_STR( No ) )
  803      PORT_DIPSETTING(          0x00000000, DEF_STR( Yes ) )
  804      PORT_DIPNAME( 0x00800000, 0x00000000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW3:1")
  805      PORT_DIPSETTING(          0x00800000, DEF_STR( Japanese ) )
  806      PORT_DIPSETTING(          0x00000000, DEF_STR( English ) )
  807  INPUT_PORTS_END
  808  
  809  static INPUT_PORTS_START( tetrisp )
  810      PORT_INCLUDE( ms32 )
  811  
  812      /* There are inputs for players 3 and 4 in the "test mode",
  813               but NO addresses are read to check them ! */
  814  
  815      PORT_MODIFY("DSW")
  816      PORT_DIPNAME( 0x00000001, 0x00000001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
  817      PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
  818      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  819      PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
  820      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  821      PORT_DIPSETTING(          0x00000002, DEF_STR( On ) )
  822      PORT_DIPNAME( 0x0000000c, 0x0000000c, "Join In" ) PORT_DIPLOCATION("SW2:6,5")
  823      PORT_DIPSETTING(          0x0000000c, "All Modes" )
  824      PORT_DIPSETTING(          0x00000004, "Normal and Puzzle Modes" )
  825      PORT_DIPSETTING(          0x00000008, "VS Mode" )
  826  //  PORT_DIPSETTING(          0x00000000, "Normal and Puzzle Modes" )             // "can't play normal mode" in "test mode"
  827      PORT_DIPNAME( 0x00000030, 0x00000030, "Winning Rounds (Player VS Player)" ) PORT_DIPLOCATION("SW2:4,3")
  828      PORT_DIPSETTING(          0x00000000, "1/1" )
  829      PORT_DIPSETTING(          0x00000030, "2/3" )
  830      PORT_DIPSETTING(          0x00000010, "3/5" )
  831      PORT_DIPSETTING(          0x00000020, "4/7" )
  832      PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,1")
  833      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
  834      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
  835      PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
  836      PORT_DIPSETTING(          0x00000080, DEF_STR( Hardest ) )
  837  
  838      PORT_DIPNAME( 0x00010000, 0x00010000, "Freeze" ) PORT_DIPLOCATION("SW3:8")
  839      PORT_DIPSETTING(          0x00010000, DEF_STR( Off ) )
  840      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  841      PORT_DIPNAME( 0x00080000, 0x00080000, "After VS Mode" ) PORT_DIPLOCATION("SW3:5")
  842      PORT_DIPSETTING(          0x00080000, "Game Ends" )
  843      PORT_DIPSETTING(          0x00000000, "Winner Continues" )
  844      PORT_DIPNAME( 0x00100000, 0x00100000, "Voice" ) PORT_DIPLOCATION("SW3:4")
  845      PORT_DIPSETTING(          0x00000000, "English Only" )
  846      PORT_DIPSETTING(          0x00100000, DEF_STR( Yes ) )
  847      PORT_DIPNAME( 0x00400000, 0x00400000, "FBI Logo" ) PORT_DIPLOCATION("SW3:2")
  848      PORT_DIPSETTING(          0x00400000, DEF_STR( No ) )
  849      PORT_DIPSETTING(          0x00000000, DEF_STR( Yes ) )
  850      PORT_DIPNAME( 0x00800000, 0x00000000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW3:1")
  851      PORT_DIPSETTING(          0x00800000, DEF_STR( Japanese ) )
  852      PORT_DIPSETTING(          0x00000000, DEF_STR( English ) )
  853  INPUT_PORTS_END
  854  
  855  static INPUT_PORTS_START( tp2m32 )
  856      PORT_INCLUDE( ms32 )
  857  
  858      PORT_MODIFY("DSW")
  859      PORT_DIPNAME( 0x00000001, 0x00000001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
  860      PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
  861      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  862      PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
  863      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  864      PORT_DIPSETTING(          0x00000002, DEF_STR( On ) )
  865      PORT_DIPNAME( 0x0000000c, 0x0000000c, "VS Match" ) PORT_DIPLOCATION("SW2:6,5")
  866      PORT_DIPSETTING(          0x00000000, "1" )
  867      PORT_DIPSETTING(          0x0000000c, "3" )
  868      PORT_DIPSETTING(          0x00000004, "5" )
  869      PORT_DIPSETTING(          0x00000008, "7" )
  870      PORT_DIPNAME( 0x00000030, 0x00000030, "Puzzle Difficulty" ) PORT_DIPLOCATION("SW2:4,3")
  871      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
  872      PORT_DIPSETTING(          0x00000030, DEF_STR( Normal ) )
  873      PORT_DIPSETTING(          0x00000010, DEF_STR( Hard ) )
  874      PORT_DIPSETTING(          0x00000020, DEF_STR( Very_Hard ) )
  875      PORT_DIPNAME( 0x000000c0, 0x000000c0, "Endless Difficulty" ) PORT_DIPLOCATION("SW2:2,1")
  876      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
  877      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
  878      PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
  879      PORT_DIPSETTING(          0x00000080, DEF_STR( Very_Hard ) )
  880  
  881      PORT_DIPNAME( 0x00010000, 0x00010000, "Freeze" ) PORT_DIPLOCATION("SW3:8")
  882      PORT_DIPSETTING(          0x00010000, DEF_STR( Off ) )
  883      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  884      PORT_DIPNAME( 0x00060000, 0x00060000, "Bomb" ) PORT_DIPLOCATION("SW3:7,6")
  885      PORT_DIPSETTING(          0x00040000, "0" )
  886      PORT_DIPSETTING(          0x00020000, "1" )
  887      PORT_DIPSETTING(          0x00060000, "2" )
  888      PORT_DIPSETTING(          0x00000000, "3" )
  889      PORT_DIPNAME( 0x00080000, 0x00080000, "Join In" ) PORT_DIPLOCATION("SW3:5")
  890      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  891      PORT_DIPSETTING(          0x00080000, DEF_STR( On ) )
  892      PORT_DIPNAME( 0x00200000, 0x00200000, "Voice" ) PORT_DIPLOCATION("SW3:3")
  893      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  894      PORT_DIPSETTING(          0x00200000, DEF_STR( On ) )
  895      PORT_DIPNAME( 0x00400000, 0x00400000, "FBI Logo" ) PORT_DIPLOCATION("SW3:2")
  896      PORT_DIPSETTING(          0x00400000, DEF_STR( No ) )
  897      PORT_DIPSETTING(          0x00000000, DEF_STR( Yes ) )
  898      PORT_DIPNAME( 0x00800000, 0x00000000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW3:1")
  899      PORT_DIPSETTING(          0x00800000, DEF_STR( Japanese ) )
  900      PORT_DIPSETTING(          0x00000000, DEF_STR( English ) )
  901  INPUT_PORTS_END
  902  
  903  static INPUT_PORTS_START( p47aces )
  904      PORT_INCLUDE( ms32 )
  905  
  906      /* The Dip Switches for this game are completely wrong in the "test mode" ! */
  907      PORT_MODIFY("DSW")
  908      PORT_DIPNAME( 0x00000001, 0x00000001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
  909      PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
  910      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  911      PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
  912      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  913      PORT_DIPSETTING(          0x00000002, DEF_STR( On ) )
  914      PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:6")
  915      PORT_DIPSETTING(          0x00000004, "500k" )
  916      PORT_DIPSETTING(          0x00000000, DEF_STR( None ) )
  917      PORT_DIPNAME( 0x00000030, 0x00000030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4,3")
  918      PORT_DIPSETTING(          0x00000000, "1" )
  919      PORT_DIPSETTING(          0x00000020, "2" )
  920      PORT_DIPSETTING(          0x00000030, "3" )
  921      PORT_DIPSETTING(          0x00000010, "4" )
  922      PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,1")
  923      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
  924      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
  925      PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
  926      PORT_DIPSETTING(          0x00000080, DEF_STR( Hardest ) )
  927  
  928      PORT_DIPNAME( 0x00030000, 0x00030000, "FG/BG X offset" ) PORT_DIPLOCATION("SW3:8,7")
  929      PORT_DIPSETTING(          0x00030000, "0/0" )
  930      PORT_DIPSETTING(          0x00020000, "5/5" )
  931  //  PORT_DIPSETTING(          0x00010000, "5/5" )
  932      PORT_DIPSETTING(          0x00000000, "2/4" )
  933      PORT_DIPNAME( 0x00400000, 0x00400000, "FBI Logo" ) PORT_DIPLOCATION("SW3:2")
  934      PORT_DIPSETTING(          0x00400000, DEF_STR( No ) )
  935      PORT_DIPSETTING(          0x00000000, DEF_STR( Yes ) )
  936      PORT_DIPNAME( 0x00800000, 0x00000000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW3:1")
  937      PORT_DIPSETTING(          0x00800000, DEF_STR( Japanese ) )
  938      PORT_DIPSETTING(          0x00000000, DEF_STR( English ) )
  939  INPUT_PORTS_END
  940  
  941  static INPUT_PORTS_START( gratia )
  942      PORT_INCLUDE( ms32 )
  943  
  944      PORT_MODIFY("DSW")
  945      PORT_DIPNAME( 0x00000001, 0x00000001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
  946      PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
  947      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  948      PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
  949      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
  950      PORT_DIPSETTING(          0x00000002, DEF_STR( On ) )
  951      PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:6")
  952      PORT_DIPSETTING(          0x00000004, "200k and every 1000k" )
  953      PORT_DIPSETTING(          0x00000000, DEF_STR( None ) )
  954      PORT_DIPNAME( 0x00000008, 0x00000008, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW2:5")
  955      PORT_DIPSETTING(          0x00000008, DEF_STR( Off ) )
  956      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
  957      PORT_DIPNAME( 0x00000030, 0x00000030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4,3")
  958      PORT_DIPSETTING(          0x00000000, "1" )
  959      PORT_DIPSETTING(          0x00000020, "2" )
  960      PORT_DIPSETTING(          0x00000030, "3" )
  961      PORT_DIPSETTING(          0x00000010, "4" )
  962      PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,1")
  963      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
  964      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
  965      PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
  966      PORT_DIPSETTING(          0x00000080, DEF_STR( Hardest ) )
  967  
  968      PORT_DIPNAME( 0x00400000, 0x00400000, "FBI Logo" ) PORT_DIPLOCATION("SW3:2")
  969      PORT_DIPSETTING(          0x00400000, DEF_STR( No ) )
  970      PORT_DIPSETTING(          0x00000000, DEF_STR( Yes ) )
  971      PORT_DIPNAME( 0x00800000, 0x00000000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW3:1")
  972      PORT_DIPSETTING(          0x00800000, DEF_STR( Japanese ) )
  973      PORT_DIPSETTING(          0x00000000, DEF_STR( English ) )
  974  
  975  INPUT_PORTS_END
  976  
  977  static INPUT_PORTS_START( hayaosi2 )
  978      PORT_INCLUDE( ms32 )
  979  
  980      PORT_MODIFY("INPUTS")
  981      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
  982      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
  983      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
  984      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
  985      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
  986      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
  987      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)   // "Buzzer" (input 0 in "test mode")
  988      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(3)   // "Buzzer" (input 0 in "test mode")
  989      PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
  990      PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
  991      PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
  992      PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
  993      PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
  994      PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
  995      PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)   // "Buzzer" (input 0 in "test mode")
  996      PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_START3 )
  997  
  998      PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  999      PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNKNOWN )
 1000  
 1001      PORT_MODIFY("DSW")
 1002      PORT_DIPNAME( 0x00000100, 0x00000100, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8")
 1003      PORT_DIPSETTING(          0x00000100, DEF_STR( Off ) )
 1004      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
 1005  
 1006      PORT_DIPUNKNOWN_DIPLOC( 0x00000001, 0x00000001, "SW2:8" )
 1007      PORT_DIPUNKNOWN_DIPLOC( 0x00000002, 0x00000002, "SW2:7" )
 1008      PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:6")
 1009      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1010      PORT_DIPSETTING(          0x00000004, DEF_STR( On ) )
 1011      /* Round   Default    More */
 1012      /*   1       10        15  */
 1013      PORT_DIPNAME( 0x00000008, 0x00000008, "Questions (VS Mode)" ) PORT_DIPLOCATION("SW2:5") // TO DO : check all rounds
 1014      PORT_DIPSETTING(          0x00000008, "Default" )
 1015      PORT_DIPSETTING(          0x00000000, "More" )
 1016      /*  Lap    Time    Questions */
 1017      /*   1     1:00        4     */
 1018      /*   2     1:00        6     */
 1019      /*   3     1:30        8     */
 1020      /*   4     1:30       10     */
 1021      /*   4     2:00       14     */
 1022      /* final   2:00       18     */
 1023      PORT_DIPNAME( 0x00000030, 0x00000030, "Time (Race Mode)" ) PORT_DIPLOCATION("SW2:4,3")
 1024      PORT_DIPSETTING(          0x00000000, "Default - 0:15" )
 1025      PORT_DIPSETTING(          0x00000020, "Default - 0:10" )
 1026      PORT_DIPSETTING(          0x00000030, "Default" )
 1027      PORT_DIPSETTING(          0x00000010, "Default + 0:15" )
 1028      PORT_DIPNAME( 0x000000c0, 0x000000c0, "Computer's AI (VS Mode)" ) PORT_DIPLOCATION("SW2:2,1")
 1029      PORT_DIPSETTING(          0x00000040, DEF_STR( Low ) )
 1030      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
 1031      PORT_DIPSETTING(          0x00000080, DEF_STR( High ) )
 1032      PORT_DIPSETTING(          0x00000000, DEF_STR( Highest ) )
 1033  INPUT_PORTS_END
 1034  
 1035  static INPUT_PORTS_START( hayaosi3 )
 1036      PORT_INCLUDE( hayaosi2 )
 1037  
 1038      PORT_MODIFY("DSW")
 1039      PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
 1040      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1041      PORT_DIPSETTING(          0x00000002, DEF_STR( On ) )
 1042      PORT_DIPUNKNOWN_DIPLOC( 0x00000004, 0x00000004, "SW2:6" )
 1043  INPUT_PORTS_END
 1044  
 1045  static INPUT_PORTS_START( kirarast )    // player 1 inputs done? others?
 1046      PORT_INCLUDE( ms32_mahjong )
 1047  
 1048      PORT_MODIFY("DSW")
 1049      PORT_DIPUNUSED_DIPLOC( 0x00000400, 0x00000400, "SW1:6" )
 1050      PORT_DIPUNUSED_DIPLOC( 0x00000800, 0x00000800, "SW1:5" )
 1051      PORT_DIPUNUSED_DIPLOC( 0x00001000, 0x00001000, "SW1:4" )
 1052      PORT_DIPNAME( 0x0000e000, 0x0000e000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,2,1")
 1053      PORT_DIPSETTING(          0x00000000, DEF_STR( 5C_1C ) )
 1054      PORT_DIPSETTING(          0x00008000, DEF_STR( 4C_1C ) )
 1055      PORT_DIPSETTING(          0x00004000, DEF_STR( 3C_1C ) )
 1056      PORT_DIPSETTING(          0x0000c000, DEF_STR( 2C_1C ) )
 1057      PORT_DIPSETTING(          0x0000e000, DEF_STR( 1C_1C ) )
 1058      PORT_DIPSETTING(          0x00006000, DEF_STR( 1C_2C ) )
 1059      PORT_DIPSETTING(          0x0000a000, DEF_STR( 1C_3C ) )
 1060      PORT_DIPSETTING(          0x00002000, DEF_STR( 1C_4C ) )
 1061  
 1062      PORT_DIPNAME( 0x00000001, 0x00000001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
 1063      PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
 1064      PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
 1065      PORT_DIPNAME( 0x00000004, 0x00000004, "Campaign Mode" ) PORT_DIPLOCATION("SW2:6")
 1066      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1067      PORT_DIPSETTING(          0x00000004, DEF_STR( On ) )
 1068      PORT_DIPNAME( 0x00000008, 0x00000008, "Tumo Pinfu" ) PORT_DIPLOCATION("SW2:5")
 1069      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1070      PORT_DIPSETTING(          0x00000008, DEF_STR( On ) )
 1071      PORT_DIPNAME( 0x00000010, 0x00000010, DEF_STR( Demo_Sounds) ) PORT_DIPLOCATION("SW2:4")
 1072      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1073      PORT_DIPSETTING(          0x00000010, DEF_STR( On ) )
 1074      PORT_DIPNAME( 0x000000e0, 0x000000e0, DEF_STR (Difficulty) ) PORT_DIPLOCATION("SW2:3,2,1")
 1075      PORT_DIPSETTING(          0x00000000, DEF_STR( Easiest ) )
 1076      PORT_DIPSETTING(          0x00000080, DEF_STR( Very_Easy) )
 1077      PORT_DIPSETTING(          0x00000040, DEF_STR( Easier ) )
 1078      PORT_DIPSETTING(          0x000000c0, DEF_STR( Easy ) )
 1079      PORT_DIPSETTING(          0x000000e0, DEF_STR( Normal ) )
 1080      PORT_DIPSETTING(          0x00000060, DEF_STR( Hard ) )
 1081      PORT_DIPSETTING(          0x000000a0, DEF_STR( Harder ) )
 1082      PORT_DIPSETTING(          0x00000020, DEF_STR( Hardest ) )
 1083  INPUT_PORTS_END
 1084  
 1085  static INPUT_PORTS_START( 47pie2 )  // player 1 inputs done? others?
 1086      PORT_INCLUDE( kirarast )
 1087  
 1088      PORT_MODIFY("INPUTS")
 1089      PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNUSED )    /* coin 2 is unused */
 1090  
 1091      PORT_MODIFY("DSW")
 1092      PORT_DIPNAME( 0x00000400, 0x00000400, "Campaign Mode" ) PORT_DIPLOCATION("SW1:6")
 1093      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1094      PORT_DIPSETTING(          0x00000400, DEF_STR( On ) )
 1095      PORT_DIPNAME( 0x00000800, 0x00000800, "Tumo Pinfu" ) PORT_DIPLOCATION("SW1:5")
 1096      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1097      PORT_DIPSETTING(          0x00000800, DEF_STR( On ) )
 1098      PORT_DIPNAME( 0x00001000, 0x00001000, DEF_STR( Demo_Sounds) ) PORT_DIPLOCATION("SW1:4")
 1099      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1100      PORT_DIPSETTING(          0x00001000, DEF_STR( On ) )
 1101  
 1102      PORT_DIPUNUSED_DIPLOC( 0x00000001, 0x00000001, "SW2:8" )
 1103      PORT_DIPUNUSED_DIPLOC( 0x00000002, 0x00000002, "SW2:7" )
 1104      PORT_DIPUNUSED_DIPLOC( 0x00000004, 0x00000004, "SW2:6" )
 1105      PORT_DIPUNUSED_DIPLOC( 0x00000008, 0x00000008, "SW2:5" )
 1106      PORT_DIPUNUSED_DIPLOC( 0x00000010, 0x00000010, "SW2:4" )
 1107      PORT_DIPUNUSED_DIPLOC( 0x00000020, 0x00000020, "SW2:3" )
 1108      PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,1")
 1109      PORT_DIPSETTING(          0x00000000, DEF_STR( Easy ) )
 1110      PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
 1111      PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
 1112      PORT_DIPSETTING(          0x00000080, DEF_STR( Hardest ) )
 1113  INPUT_PORTS_END
 1114  
 1115  
 1116  static INPUT_PORTS_START( wpksocv2 )
 1117      PORT_INCLUDE( ms32 )
 1118  
 1119      PORT_MODIFY("INPUTS")
 1120      /* Still missing the correct input for begin the left right movement */
 1121      PORT_BIT( 0x0000000f, 0x00000000, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(7) PORT_PLAYER(1)
 1122      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED )
 1123      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
 1124      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNUSED )
 1125      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED )
 1126      PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
 1127      PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
 1128      PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
 1129      PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
 1130      PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNUSED )
 1131      PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNUSED )
 1132      PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNUSED )
 1133      PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED )
 1134  
 1135      PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
 1136      PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
 1137  
 1138      PORT_MODIFY("DSW")
 1139      PORT_DIPUNUSED_DIPLOC( 0x00000100, 0x00000100, "SW1:8" )
 1140      PORT_DIPUNUSED_DIPLOC( 0x00000200, 0x00000200, "SW1:7" )
 1141      PORT_DIPUNUSED_DIPLOC( 0x00000400, 0x00000400, "SW1:6" )
 1142      PORT_DIPUNUSED_DIPLOC( 0x00000800, 0x00000800, "SW1:5" )
 1143      PORT_DIPNAME( 0x00001000, 0x00001000, DEF_STR( Demo_Sounds) ) PORT_DIPLOCATION("SW1:4")
 1144      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1145      PORT_DIPSETTING(          0x00001000, DEF_STR( On ) )
 1146      PORT_DIPNAME( 0x0000e000, 0x0000e000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,2,1")
 1147      PORT_DIPSETTING(          0x00008000, DEF_STR( 4C_1C ) )
 1148      PORT_DIPSETTING(          0x00004000, DEF_STR( 3C_1C ) )
 1149      PORT_DIPSETTING(          0x0000c000, DEF_STR( 2C_1C ) )
 1150      PORT_DIPSETTING(          0x0000e000, DEF_STR( 1C_1C ) )
 1151      PORT_DIPSETTING(          0x00000000, DEF_STR( 2C_3C ) )
 1152      PORT_DIPSETTING(          0x00006000, DEF_STR( 1C_2C ) )
 1153      PORT_DIPSETTING(          0x0000a000, DEF_STR( 1C_3C ) )
 1154      PORT_DIPSETTING(          0x00002000, DEF_STR( 1C_4C ) )
 1155  
 1156      PORT_DIPNAME( 0x00200000, 0x00000000, "Tickets" ) PORT_DIPLOCATION("SW3:3")
 1157      PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
 1158      PORT_DIPSETTING(          0x00200000, DEF_STR( On ) )
 1159      PORT_DIPNAME( 0x00c00000, 0x00000000, DEF_STR( Region ) ) PORT_DIPLOCATION("SW3:2,1")
 1160      PORT_DIPSETTING(          0x00400000, DEF_STR( USA ) )
 1161      PORT_DIPSETTING(          0x00000000, DEF_STR( World ) )
 1162  //  PORT_DIPSETTING(          0x00800000, "?" )
 1163      PORT_DIPSETTING(          0x00c00000, DEF_STR( Japan ) )
 1164  INPUT_PORTS_END
 1165  
 1166  
 1167  static INPUT_PORTS_START( f1superb )    // Mostly wrong !
 1168      PORT_INCLUDE( ms32 )
 1169  
 1170      PORT_MODIFY("INPUTS")
 1171      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
 1172      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
 1173      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
 1174      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
 1175      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
 1176      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
 1177      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
 1178      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
 1179      PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
 1180      PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
 1181      PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
 1182      PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
 1183      PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
 1184      PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
 1185      PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
 1186      PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
 1187  
 1188      PORT_MODIFY("DSW")
 1189      PORT_DIPUNKNOWN_DIPLOC( 0x00000001, 0x00000001, "SW2:8" )
 1190      PORT_DIPUNKNOWN_DIPLOC( 0x00000002, 0x00000002, "SW2:7" )
 1191      PORT_DIPUNKNOWN_DIPLOC( 0x00000004, 0x00000004, "SW2:6" )
 1192      PORT_DIPUNKNOWN_DIPLOC( 0x00000008, 0x00000008, "SW2:5" )
 1193      PORT_DIPUNKNOWN_DIPLOC( 0x00000010, 0x00000010, "SW2:4" )
 1194      PORT_DIPUNKNOWN_DIPLOC( 0x00000020, 0x00000020, "SW2:3" )
 1195      PORT_DIPUNKNOWN_DIPLOC( 0x00000040, 0x00000040, "SW2:2" )
 1196      PORT_DIPUNKNOWN_DIPLOC( 0x00000080, 0x00000080, "SW2:1" )
 1197  
 1198      PORT_DIPUNKNOWN_DIPLOC( 0x00010000, 0x00010000, "SW3:8" )
 1199      PORT_DIPUNKNOWN_DIPLOC( 0x00020000, 0x00020000, "SW3:7" )
 1200      PORT_DIPUNKNOWN_DIPLOC( 0x00040000, 0x00040000, "SW3:6" )
 1201      PORT_DIPUNKNOWN_DIPLOC( 0x00080000, 0x00080000, "SW3:5" )
 1202      PORT_DIPUNKNOWN_DIPLOC( 0x00100000, 0x00100000, "SW3:4" )
 1203      PORT_DIPUNKNOWN_DIPLOC( 0x00200000, 0x00200000, "SW3:3" )
 1204      PORT_DIPUNKNOWN_DIPLOC( 0x00400000, 0x00400000, "SW3:2" )
 1205      PORT_DIPUNKNOWN_DIPLOC( 0x00800000, 0x00800000, "SW3:1" )
 1206  
 1207      PORT_START("AN0")   // Acceleration (wrong?)
 1208      PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
 1209  
 1210  
 1211      PORT_START("AN1")   // Steering
 1212      PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(1)
 1213  
 1214      PORT_START("AN2?")  // Shift + Brake
 1215      PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
 1216      PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
 1217      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
 1218      PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
 1219      PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
 1220      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
 1221      PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
 1222      PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
 1223      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
 1224      PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
 1225      PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
 1226      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
 1227      PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
 1228      PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
 1229      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
 1230      PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
 1231      PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
 1232      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
 1233      PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
 1234      PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
 1235      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
 1236      PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
 1237      PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
 1238      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
 1239  
 1240  INPUT_PORTS_END
 1241  
 1242  /********** GFX DECODE **********/
 1243  
 1244  /* sprites are contained in 256x256 "tiles" */
 1245  static GFXLAYOUT_RAW( spritelayout, 256, 256, 256*8, 256*256*8 )
 1246  static GFXLAYOUT_RAW( bglayout, 16, 16, 16*8, 16*16*8 )
 1247  static GFXLAYOUT_RAW( txlayout, 8, 8, 8*8, 8*8*8 )
 1248  
 1249  static GFXLAYOUT_RAW( f1layout, 2048, 1, 2048*8, 2048*8 )
 1250  
 1251  
 1252  static GFXDECODE_START( ms32 )
 1253      GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0x0000, 0x10 )
 1254      GFXDECODE_ENTRY( "gfx2", 0, bglayout,     0x2000, 0x10 )
 1255      GFXDECODE_ENTRY( "gfx3", 0, bglayout,     0x1000, 0x10 )
 1256      GFXDECODE_ENTRY( "gfx4", 0, txlayout,     0x6000, 0x10 )
 1257  GFXDECODE_END
 1258  
 1259  static GFXDECODE_START( f1superb )
 1260      GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0x0000, 0x10 )
 1261      GFXDECODE_ENTRY( "gfx2", 0, bglayout,     0x2000, 0x10 )
 1262      GFXDECODE_ENTRY( "gfx3", 0, bglayout,     0x1000, 0x10 )
 1263      GFXDECODE_ENTRY( "gfx4", 0, txlayout,     0x6000, 0x10 )
 1264      GFXDECODE_ENTRY( "gfx5", 0, f1layout,     0x0000, 0x100 ) // not tilemap data?
 1265  GFXDECODE_END
 1266  
 1267  
 1268  
 1269  /********** INTERRUPTS **********/
 1270  
 1271  /* Irqs used in desertwr:
 1272     1  - 6a0 - minimal
 1273     9  - 6c8 - minimal
 1274     10 - 6d4 - big, vbl?
 1275  */
 1276  
 1277  
 1278  IRQ_CALLBACK_MEMBER(ms32_state::irq_callback)
 1279  {
 1280      int i;
 1281      for(i=15; i>=0 && !(m_irqreq & (1<<i)); i--);
 1282      m_irqreq &= ~(1<<i);
 1283      if(!m_irqreq)
 1284          device.execute().set_input_line(0, CLEAR_LINE);
 1285      return i;
 1286  }
 1287  
 1288  void ms32_state::irq_init()
 1289  {
 1290      m_irqreq = 0;
 1291      machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
 1292      machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(ms32_state::irq_callback),this));
 1293  }
 1294  
 1295  void ms32_state::irq_raise(int level)
 1296  {
 1297      m_irqreq |= (1<<level);
 1298      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
 1299  }
 1300  
 1301  /* TODO: fix this arrangement (derived from old deprecat lib) */
 1302  TIMER_DEVICE_CALLBACK_MEMBER(ms32_state::ms32_interrupt)
 1303  {
 1304      int scanline = param;
 1305      if( scanline == 0) irq_raise(10);
 1306      if( scanline == 8) irq_raise(9);
 1307      /* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
 1308         kirarast needs it too, at least 8 per frame, but waits for a variable amount
 1309         47pi2 needs ?? per frame (otherwise it hangs when you lose)
 1310         in different points. Could this be a raster interrupt?
 1311         Other games using it but not needing it to work:
 1312         desertwr
 1313         p47aces
 1314         */
 1315      if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(0);
 1316  }
 1317  
 1318  
 1319  /********** SOUND **********/
 1320  
 1321  /*
 1322   Jaleco Mega System 32 sound Z80
 1323  
 1324   RAM 62256 - the highest RAM adr line is grounded, only 16k is used
 1325  
 1326   0000-3eff: program ROM (fixed)
 1327   3f00-3f0f: YMF271-F
 1328   3f10     : RW :command latch
 1329   3f20     : RW :2nd command latch  ?? (not connected on PCB)
 1330   3f40     : W : YMF271 pin 4 (bit 1) , YMF271 pin 39 (bit 4)
 1331   3f70     : W : unknown ? connected to JALECO GS91022-04 pin 55 (from GAL)
 1332   3f80     : Bank select - $bB
 1333   4000-7fff: RAM
 1334   8000-bfff: banked ROM area #1 - bank B+1
 1335   c000-ffff: banked ROM area #2 - bank b+1
 1336  
 1337   IRQ is unused (YMF271 timers are polled to control tempo)
 1338   NMI reads the command latch
 1339   code at $38 reads the 2nd command latch ??
 1340  */
 1341  
 1342  READ8_MEMBER(ms32_state::latch_r)
 1343  {
 1344      machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
 1345      return soundlatch_byte_r(space,0)^0xff;
 1346  }
 1347  
 1348  WRITE8_MEMBER(ms32_state::ms32_snd_bank_w)
 1349  {
 1350      membank("bank4")->set_entry((data >> 0) & 0x0F);
 1351      membank("bank5")->set_entry((data >> 4) & 0x0F);
 1352  }
 1353  
 1354  WRITE8_MEMBER(ms32_state::to_main_w)
 1355  {
 1356      m_to_main=data;
 1357      irq_raise(1);
 1358  }
 1359  
 1360  static ADDRESS_MAP_START( ms32_sound_map, AS_PROGRAM, 8, ms32_state )
 1361      AM_RANGE(0x0000, 0x3eff) AM_ROM
 1362      AM_RANGE(0x3f00, 0x3f0f) AM_DEVREADWRITE_LEGACY("ymf", ymf271_r,ymf271_w)
 1363      AM_RANGE(0x3f10, 0x3f10) AM_READWRITE(latch_r,to_main_w)
 1364      AM_RANGE(0x3f20, 0x3f20) AM_READNOP /* 2nd latch ? */
 1365      AM_RANGE(0x3f20, 0x3f20) AM_WRITENOP /* to_main2_w  ? */
 1366      AM_RANGE(0x3f40, 0x3f40) AM_WRITENOP   /* YMF271 pin 4 (bit 1) , YMF271 pin 39 (bit 4) */
 1367      AM_RANGE(0x3f70, 0x3f70) AM_WRITENOP   // watchdog? banking? very noisy
 1368      AM_RANGE(0x3f80, 0x3f80) AM_WRITE(ms32_snd_bank_w)
 1369      AM_RANGE(0x4000, 0x7fff) AM_RAM
 1370      AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank4")
 1371      AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank5")
 1372  ADDRESS_MAP_END
 1373  
 1374  
 1375  /********** MACHINE INIT **********/
 1376  
 1377  void ms32_state::machine_reset()
 1378  {
 1379      machine().root_device().membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base());
 1380      machine().root_device().membank("bank4")->set_entry(0);
 1381      machine().root_device().membank("bank5")->set_entry(1);
 1382      irq_init();
 1383  }
 1384  
 1385  /********** MACHINE DRIVER **********/
 1386  
 1387  static MACHINE_CONFIG_START( ms32, ms32_state )
 1388  
 1389      /* basic machine hardware */
 1390      MCFG_CPU_ADD("maincpu", V70, 20000000) // 20MHz
 1391      MCFG_CPU_PROGRAM_MAP(ms32_map)
 1392      MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ms32_state, ms32_interrupt, "screen", 0, 1)
 1393  
 1394      MCFG_CPU_ADD("audiocpu", Z80, 4000000)
 1395      MCFG_CPU_PROGRAM_MAP(ms32_sound_map)
 1396  
 1397      MCFG_QUANTUM_TIME(attotime::from_hz(60000))
 1398  
 1399  
 1400      /* video hardware */
 1401      MCFG_SCREEN_ADD("screen", RASTER)
 1402      MCFG_SCREEN_REFRESH_RATE(60)
 1403      MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
 1404      MCFG_SCREEN_SIZE(40*8, 28*8)
 1405      MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
 1406      MCFG_SCREEN_UPDATE_DRIVER(ms32_state, screen_update_ms32)
 1407  
 1408      MCFG_GFXDECODE(ms32)
 1409      MCFG_PALETTE_LENGTH(0x10000)
 1410  
 1411  
 1412      /* sound hardware */
 1413      MCFG_SPEAKER_STANDARD_MONO("mono")
 1414  
 1415      MCFG_SOUND_ADD("ymf", YMF271, 16934400)
 1416      MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
 1417  
 1418  MACHINE_CONFIG_END
 1419  
 1420  static MACHINE_CONFIG_DERIVED( f1superb, ms32 )
 1421      /* basic machine hardware */
 1422      MCFG_CPU_MODIFY("maincpu")
 1423      MCFG_CPU_PROGRAM_MAP(f1superb_map)
 1424  
 1425      MCFG_GFXDECODE(f1superb)
 1426  
 1427      MCFG_VIDEO_START_OVERRIDE(ms32_state,f1superb)
 1428  MACHINE_CONFIG_END
 1429  
 1430  
 1431  
 1432  /********** ROM LOADING **********/
 1433  
 1434  ROM_START( bbbxing )
 1435      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1436      ROM_LOAD32_BYTE( "bbbx25.bin", 0x000003, 0x80000, CRC(b526b41e) SHA1(44945931b159646468a954d5acdd2c6c61daf098) )
 1437      ROM_LOAD32_BYTE( "bbbx27.bin", 0x000002, 0x80000, CRC(45b27ad8) SHA1(0af415b17400aabecdcb6d1d069f28b64780017f) )
 1438      ROM_LOAD32_BYTE( "bbbx29.bin", 0x000001, 0x80000, CRC(85bbbe79) SHA1(bc5ebb96491762e6a0d202ddf7faeb57c66211b4) )
 1439      ROM_LOAD32_BYTE( "bbbx31.bin", 0x000000, 0x80000, CRC(e0c865ed) SHA1(f21e8dc174c50d7afdd3f82c1c66dfcc002bdd07) )
 1440  
 1441      ROM_REGION( 0x1100000, "gfx1", 0 ) /* sprites */
 1442      ROM_LOAD32_WORD( "bbbx1.bin",   0x0000002, 0x200000, CRC(c1c10c3b) SHA1(e1f739f38e148c4d7aff6b81b3e42131c5c6c3dd) )
 1443      ROM_LOAD32_WORD( "bbbx13.bin",  0x0000000, 0x200000, CRC(4b8c1574) SHA1(c389c70b532d54528a175f460ca3f329b34cf67c) )
 1444      ROM_LOAD32_WORD( "bbbx2.bin",   0x0400002, 0x200000, CRC(03b77c1e) SHA1(f156ae6a4f2a8ae99815eb5a7b28425d273c1c3e) )
 1445      ROM_LOAD32_WORD( "bbbx14.bin",  0x0400000, 0x200000, CRC(e9cfd83b) SHA1(8580c571a4144ea27c7fca7e86e3e4f5e4f5facb) )
 1446      ROM_LOAD32_WORD( "bbbx3.bin",   0x0800002, 0x200000, CRC(bba0d1a4) SHA1(15f8de7478182c36927a84ee8de8eb8ac3e65d7b) )
 1447      ROM_LOAD32_WORD( "bbbx15.bin",  0x0800000, 0x200000, CRC(6ab64a10) SHA1(4ee2cec6b9f8d729ff53851f7949c5cd3a8029d8) )
 1448      ROM_LOAD32_WORD( "bbbx4.bin",   0x0c00002, 0x200000, CRC(97f97e3a) SHA1(260603a10fe742986aa4f7fb90e4f141bdadae17) )
 1449      ROM_LOAD32_WORD( "bbbx16.bin",  0x0c00000, 0x200000, CRC(e001d6cb) SHA1(c887dbf192e6b46c86fd86bb5f58b44ab8fe8d73) )
 1450      ROM_LOAD32_WORD( "bbbx5.bin",   0x1000002, 0x080000, CRC(64989edf) SHA1(033eab0e8a53607b2bb420f6356804b2cfa1544c) )
 1451      ROM_LOAD32_WORD( "bbbx17.bin",  0x1000000, 0x080000, CRC(1d7ebaf0) SHA1(5aac7cb01013ce3be206318678aced5812bff9a9) )
 1452  
 1453      ROM_REGION( 0x200000, "gfx2", 0 ) /* roz tiles */
 1454      ROM_LOAD( "bbbx9.bin",   0x000000, 0x200000, CRC(a41cb650) SHA1(1c55a4afe55c1250806f2d93c25842dc3fb7f987) )
 1455  
 1456      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 1457      ROM_LOAD( "bbbx11.bin",  0x000000, 0x200000, CRC(85238ca9) SHA1(1ce32d585fe66764d621c11882ef9d2abaea6256) )
 1458  
 1459      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1460      ROM_LOAD( "bbbx32-2.bin",0x000000, 0x080000, CRC(3ffdae75) SHA1(2b837d28f7ecdd49e8525bd5c249e83021d5fe9f) )
 1461  
 1462      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1463      ROM_LOAD( "bbbx21.bin",  0x000000, 0x040000, CRC(5f3ea01f) SHA1(761f6a5852312d2b12de009f3cf0476f5b2e906c) )
 1464      ROM_RELOAD(              0x010000, 0x40000 )
 1465  
 1466      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 1467      ROM_LOAD( "bbbx22.bin",  0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
 1468      ROM_LOAD( "bbbx23.bin",  0x200000, 0x200000, CRC(b7875a23) SHA1(62bb4c1318f98ea68894658d92ce08e84d386d0c) )
 1469  
 1470      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1471      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1472  ROM_END
 1473  
 1474  ROM_START( 47pie2 )
 1475      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1476      ROM_LOAD32_BYTE( "93166-26.v11", 0x000003, 0x80000, CRC(e4e62134) SHA1(224b3e8dba56009bf2af6eceb7495e60302a6360) )
 1477      ROM_LOAD32_BYTE( "93166-27.v11", 0x000002, 0x80000, CRC(7bd00919) SHA1(60565b5e1da5fee00ac4a7fb1202d7150dab49ee) )
 1478      ROM_LOAD32_BYTE( "93166-28.v11", 0x000001, 0x80000, CRC(aa49eec2) SHA1(173afc596caa1c464fc3247cb64d36c1d97a1520) )
 1479      ROM_LOAD32_BYTE( "93166-29.v11", 0x000000, 0x80000, CRC(92763e41) SHA1(eb593bbb586661c4c4e8728d845b146974d0bdf8) )
 1480  
 1481      ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprites */
 1482      ROM_LOAD32_WORD( "94019-02.1",  0x000002, 0x200000, CRC(f9d692f2) SHA1(666df55d26e00be39073173fa3616ac9dafbe615) )
 1483      ROM_LOAD32_WORD( "94019-01.13", 0x000000, 0x200000, CRC(1ddfe825) SHA1(27fbf492fdb4f0b4b8db18330e840c130213e15e) )
 1484      ROM_LOAD32_WORD( "94019-04.2",  0x400002, 0x200000, CRC(24ca77ec) SHA1(a5c575224ab276cbed5785f40fc0d35dd2748e74) )
 1485      ROM_LOAD32_WORD( "94019-03.14", 0x400000, 0x200000, CRC(b26426c4) SHA1(2d95137edea7d0c380dd8fd99852254ad3e4c837) )
 1486      ROM_LOAD32_WORD( "94019-06.3",  0x800002, 0x200000, CRC(c8aa4b57) SHA1(55da6a43ba6f0cb32f5d024f67cae21d04019d2a) )
 1487      ROM_LOAD32_WORD( "94019-05.15", 0x800000, 0x200000, CRC(1da63eb4) SHA1(8193ad27ddfe6ba242b73082d1b4a400e88401ba) )
 1488      ROM_LOAD32_WORD( "94019-08.4",  0xc00002, 0x200000, CRC(4b07edc9) SHA1(22aaa923a94a7bec997d2adabc8ec2c7696c33a5) )
 1489      ROM_LOAD32_WORD( "94019-07.16", 0xc00000, 0x200000, CRC(34f471a8) SHA1(4c9c358a9bfdb436a211caa14d085e631609681d) )
 1490  
 1491      ROM_REGION( 0x200000, "gfx2", 0 ) /* roz tiles */
 1492      ROM_LOAD( "94019-09.11", 0x000000, 0x200000, CRC(cde7bb6f) SHA1(47454dac4ce67ce8d7e0c5ef3a732477ac8170a7) )
 1493  
 1494      ROM_REGION( 0x100000, "gfx3", 0 ) /* bg tiles */
 1495      ROM_LOAD( "94019-12.10", 0x000000, 0x100000, CRC(15ae05d9) SHA1(ac00d3766c42ccba4585b9acfacc81bcb940ac26) )
 1496  
 1497      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1498      ROM_LOAD( "93166-30.bin", 0x000000, 0x080000, CRC(0c738883) SHA1(e552c1842d759e5e617eb9c6cc178620a461b4dd) )
 1499  
 1500      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1501      ROM_LOAD( "93166-21.bin", 0x000000, 0x040000, CRC(e7fd1bf4) SHA1(74567530364bfd93bffddb588758d8498e197668) )
 1502      ROM_RELOAD(              0x010000, 0x40000 )
 1503  
 1504      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 1505      ROM_LOAD( "94019-10.22", 0x000000, 0x200000, CRC(745d41ec) SHA1(9118d0f27b65c9d37970326ccf86fdccb81d32f5) )
 1506      ROM_LOAD( "94019-11.23", 0x200000, 0x200000, CRC(021dc350) SHA1(c71936091f86440201fdbdc94b0d1d22c4018188) )
 1507  
 1508      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1509      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1510  ROM_END
 1511  
 1512  ROM_START( 47pie2o )
 1513      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1514      ROM_LOAD32_BYTE( "93166-26.v10", 0x000003, 0x80000, CRC(21dc94dd) SHA1(faf2eea891cb061d5df47ef31d9538feb0c1233c) )
 1515      ROM_LOAD32_BYTE( "93166-27.v10", 0x000002, 0x80000, CRC(5bf18a7d) SHA1(70869dc37e6ad79ce4e85db71a03c5cccf9d732b) )
 1516      ROM_LOAD32_BYTE( "93166-28.v10", 0x000001, 0x80000, CRC(b1261d51) SHA1(3f393aeb7a076c4d2d2cc7f22ead05f405186d80) )
 1517      ROM_LOAD32_BYTE( "93166-29.v10", 0x000000, 0x80000, CRC(9211c82a) SHA1(0aa3f93293b81e0f66b985046eb5e91708693959) )
 1518  
 1519      ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprites */
 1520      ROM_LOAD32_WORD( "94019-02.1",  0x000002, 0x200000, CRC(f9d692f2) SHA1(666df55d26e00be39073173fa3616ac9dafbe615) )
 1521      ROM_LOAD32_WORD( "94019-01.13", 0x000000, 0x200000, CRC(1ddfe825) SHA1(27fbf492fdb4f0b4b8db18330e840c130213e15e) )
 1522      ROM_LOAD32_WORD( "94019-04.2",  0x400002, 0x200000, CRC(24ca77ec) SHA1(a5c575224ab276cbed5785f40fc0d35dd2748e74) )
 1523      ROM_LOAD32_WORD( "94019-03.14", 0x400000, 0x200000, CRC(b26426c4) SHA1(2d95137edea7d0c380dd8fd99852254ad3e4c837) )
 1524      ROM_LOAD32_WORD( "94019-06.3",  0x800002, 0x200000, CRC(c8aa4b57) SHA1(55da6a43ba6f0cb32f5d024f67cae21d04019d2a) )
 1525      ROM_LOAD32_WORD( "94019-05.15", 0x800000, 0x200000, CRC(1da63eb4) SHA1(8193ad27ddfe6ba242b73082d1b4a400e88401ba) )
 1526      ROM_LOAD32_WORD( "94019-08.4",  0xc00002, 0x200000, CRC(4b07edc9) SHA1(22aaa923a94a7bec997d2adabc8ec2c7696c33a5) )
 1527      ROM_LOAD32_WORD( "94019-07.16", 0xc00000, 0x200000, CRC(34f471a8) SHA1(4c9c358a9bfdb436a211caa14d085e631609681d) )
 1528  
 1529      ROM_REGION( 0x200000, "gfx2", 0 ) /* roz tiles */
 1530      ROM_LOAD( "94019-09.11", 0x000000, 0x200000, CRC(cde7bb6f) SHA1(47454dac4ce67ce8d7e0c5ef3a732477ac8170a7) )
 1531  
 1532      ROM_REGION( 0x100000, "gfx3", 0 ) /* bg tiles */
 1533      ROM_LOAD( "94019-12.10", 0x000000, 0x100000, CRC(15ae05d9) SHA1(ac00d3766c42ccba4585b9acfacc81bcb940ac26) )
 1534  
 1535      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1536      ROM_LOAD( "93166-30.bin", 0x000000, 0x080000, CRC(0c738883) SHA1(e552c1842d759e5e617eb9c6cc178620a461b4dd) )
 1537  
 1538      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1539      ROM_LOAD( "93166-21.bin", 0x000000, 0x040000, CRC(e7fd1bf4) SHA1(74567530364bfd93bffddb588758d8498e197668) )
 1540      ROM_RELOAD(              0x010000, 0x40000 )
 1541  
 1542      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 1543      ROM_LOAD( "94019-10.22", 0x000000, 0x200000, CRC(745d41ec) SHA1(9118d0f27b65c9d37970326ccf86fdccb81d32f5) )
 1544      ROM_LOAD( "94019-11.23", 0x200000, 0x200000, CRC(021dc350) SHA1(c71936091f86440201fdbdc94b0d1d22c4018188) )
 1545  
 1546      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1547      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1548  ROM_END
 1549  
 1550  ROM_START( desertwr )
 1551      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1552      ROM_LOAD32_BYTE( "93166-26.37", 0x000003, 0x80000, CRC(582b9584) SHA1(027a987cde7e9e1b24aef6a3086eba61679ad0b6) )
 1553      ROM_LOAD32_BYTE( "93166-27.38", 0x000002, 0x80000, CRC(cb60dda3) SHA1(0499b8ab19abdf8db8c18d778b3f9f6e0d277ff0) )
 1554      ROM_LOAD32_BYTE( "93166-28.39", 0x000001, 0x80000, CRC(0de40efb) SHA1(c49c3b27939e428dec1f642b7fdb9a1ff760289a) )
 1555      ROM_LOAD32_BYTE( "93166-29.40", 0x000000, 0x80000, CRC(fc25eae2) SHA1(a4d47fcb4d4c3285cf67d77d8a21478f344b98ca) )
 1556  
 1557      ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprites */
 1558      ROM_LOAD32_WORD( "94038-01.20", 0x000000, 0x200000, CRC(f11f83e2) SHA1(e3c99e6583003210483163c79182cb14aa334702) )
 1559      ROM_LOAD32_WORD( "94038-02.3",  0x000002, 0x200000, CRC(3d1fa710) SHA1(5fae3e8c714cca88e22e432dd7275c6898c631a8) )
 1560      ROM_LOAD32_WORD( "94038-03.21", 0x400000, 0x200000, CRC(84fd5790) SHA1(6187ff32a63f3b4105ea875f52237f0d4314f8b6) )
 1561      ROM_LOAD32_WORD( "94038-04.4",  0x400002, 0x200000, CRC(b9ef5b78) SHA1(e2f160a93532f67948a557db717d44c926ae0e49) )
 1562      ROM_LOAD32_WORD( "94038-05.22", 0x800000, 0x200000, CRC(feee1b8d) SHA1(39e1d424dd56257139ab5ab8e897caa1c9cd4e71) )
 1563      ROM_LOAD32_WORD( "94038-06.5",  0x800002, 0x200000, CRC(d417f289) SHA1(39cca11989bb5dc95ef03013d23a7c100bcb36ab) )
 1564      ROM_LOAD32_WORD( "94038-07.23", 0xc00000, 0x200000, CRC(426f4193) SHA1(98a16a70c225d7cd061fcd6e88992d393e6ef9fd) )
 1565      ROM_LOAD32_WORD( "94038-08.6",  0xc00002, 0x200000, CRC(f4088399) SHA1(9d53880996f85776815840bca1f8c3958de4c275) )
 1566  
 1567      ROM_REGION( 0x400000, "gfx2", 0 ) /* roz tiles */
 1568      ROM_LOAD( "94038-11.13", 0x000000, 0x200000, CRC(bf2ec3a3) SHA1(904cd5ab2e855bdb94bc70efa6db42af672337d7) )
 1569      ROM_LOAD( "94038-12.14", 0x200000, 0x200000, CRC(d0e113da) SHA1(57f27cbd58421a0afe724fec5628c4a29aad8868) )
 1570  
 1571      ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles */
 1572      ROM_LOAD( "94038-09.12", 0x000000, 0x200000, CRC(72ec1ce7) SHA1(88bd9ca3aa7a6410e8fcf6fd70304f12724653bb) )
 1573      ROM_LOAD( "94038-10.11", 0x200000, 0x200000, CRC(1e17f2a9) SHA1(19e6be1daa157593fbab84149f1f739dd39c9226) )
 1574  
 1575      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1576      ROM_LOAD( "93166-30.41", 0x000000, 0x080000, CRC(980ab89c) SHA1(8468fc13a5988e25750e8d99ff464f46e86ab412) )
 1577  
 1578      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1579      ROM_LOAD( "93166-21.30", 0x000000, 0x040000, CRC(9300be4c) SHA1(a8e9c1704abf26545aeb9a5d28fd0cafd38f2d84) )
 1580      ROM_RELOAD(              0x010000, 0x40000 )
 1581  
 1582      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 1583      ROM_LOAD( "92042-01.33", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
 1584      ROM_LOAD( "94038-13.34", 0x200000, 0x200000, CRC(b0cac8f2) SHA1(f7d2e32d9c2f301341f7c02678c2c1e09ce655ba) )
 1585  
 1586      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1587      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1588  ROM_END
 1589  
 1590  ROM_START( f1superb )
 1591      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1592      ROM_LOAD32_BYTE( "f1sb26.bin", 0x000003, 0x80000, CRC(042fccd5) SHA1(4a69de3aef51adad502d54987468170b9e7bb8ac) )
 1593      ROM_LOAD32_BYTE( "f1sb27.bin", 0x000002, 0x80000, CRC(5f96cf32) SHA1(c9c64576a8bb81a8e8bbe30b054ed33afd760b93) )
 1594      ROM_LOAD32_BYTE( "f1sb28.bin", 0x000001, 0x80000, CRC(cfda8003) SHA1(460146556f606bf213d7e2ab29d2eb8827131bd0) )
 1595      ROM_LOAD32_BYTE( "f1sb29.bin", 0x000000, 0x80000, CRC(f21f1481) SHA1(97a97ff3b9a71b1a024d8f2cfe57a1d02cec5ea4) )
 1596  
 1597      ROM_REGION( 0x2000000, "gfx1", 0 ) /* 8x8 not all? */
 1598      ROM_LOAD32_WORD( "f1sb1.bin",  0x0000002, 0x200000, CRC(53a3a97b) SHA1(c8cd501ae10d9eb48a02e4e59a1ce389a27afc44) )
 1599      ROM_LOAD32_WORD( "f1sb13.bin", 0x0000000, 0x200000, CRC(36565a99) SHA1(db08ff3107dcc07ca31140715d7d4b7bd27fa4c5) )
 1600      ROM_LOAD32_WORD( "f1sb2.bin",  0x0400002, 0x200000, CRC(a452f50a) SHA1(3782a37203b652ea5df5b04dc74a0fdace7b14cc) )
 1601      ROM_LOAD32_WORD( "f1sb14.bin", 0x0400000, 0x200000, CRC(c0c20490) SHA1(9e93beae38c5cfca9f381b4d134c1d95cfa2223a) )
 1602      ROM_LOAD32_WORD( "f1sb3.bin",  0x0800002, 0x200000, CRC(265d068c) SHA1(a2a7850fbc2a04e448f772544d2f6925f9aaf99c) )
 1603      ROM_LOAD32_WORD( "f1sb15.bin", 0x0800000, 0x200000, CRC(575a146e) SHA1(bf67a89ac3145d38564b9dbc3c650c9d5f2bcd92) )
 1604      ROM_LOAD32_WORD( "f1sb4.bin",  0x0c00002, 0x200000, CRC(0ccc66fd) SHA1(07ffef821300386224a7743e8f83088e3437c6db) )
 1605      ROM_LOAD32_WORD( "f1sb16.bin", 0x0c00000, 0x200000, CRC(a2d017a1) SHA1(6c1dd67a1c9c18d69f7dbf7d4637671809be5c89) )
 1606      ROM_LOAD32_WORD( "f1sb5.bin",  0x1000002, 0x200000, CRC(bff4271b) SHA1(dc5672f51348fe0a79352eeafaeeefd78428fe5a) )
 1607      ROM_LOAD32_WORD( "f1sb17.bin", 0x1000000, 0x200000, CRC(2b9739d5) SHA1(db9e93fe79dfa041584730df9cc678caad073251) )
 1608      ROM_LOAD32_WORD( "f1sb6.bin",  0x1400002, 0x200000, CRC(6caf48ec) SHA1(18ea445970285950c61c8eff74a3ab6387816990) )
 1609      ROM_LOAD32_WORD( "f1sb18.bin", 0x1400000, 0x200000, CRC(c49055ff) SHA1(6038dc497583229060ad686090d6940c0a3d1558) )
 1610      ROM_LOAD32_WORD( "f1sb7.bin",  0x1800002, 0x200000, CRC(a5458947) SHA1(7743d67a167f6eecfac6614d1336c6df425e5e95) )
 1611      ROM_LOAD32_WORD( "f1sb19.bin", 0x1800000, 0x200000, CRC(b7cacf0d) SHA1(cea52b1062cf154ccba11640798902b0f9ddeb77) )
 1612      ROM_LOAD32_WORD( "f1sb8.bin",  0x1c00002, 0x200000, CRC(ba3f1533) SHA1(3ff1c4cca8358fc8daf0d2c381672569085ac9ae) )
 1613      ROM_LOAD32_WORD( "f1sb20.bin", 0x1c00000, 0x200000, CRC(fa349897) SHA1(31e08aa2821e409057e3094333b9ecbe04a6a38a) )
 1614  
 1615      ROM_REGION( 0x800000, "gfx2", 0 ) /* roz tiles */
 1616      ROM_LOAD( "f1sb9.bin",  0x000000, 0x200000, CRC(66b12e1f) SHA1(4dc3f162a5116403cc0c491af335208672c8e9af) )
 1617      ROM_LOAD( "f1sb10.bin", 0x200000, 0x200000, CRC(893d7f4b) SHA1(b2734f20f703a0dcf8b1fdaebf2b6198b2fb0f51) )
 1618      ROM_LOAD( "f1sb11.bin", 0x400000, 0x200000, CRC(0b848bb5) SHA1(e4c0e434add151112352d6068e5de1a7098e6346) )
 1619      ROM_LOAD( "f1sb12.bin", 0x600000, 0x200000, CRC(edecd5f4) SHA1(9b86802d08e5c8ec1a6dcea75dc8f050d3e96970) )
 1620  
 1621      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 1622      ROM_LOAD( "f1sb31.bin", 0x000000, 0x200000, CRC(1d0d2efd) SHA1(e6446ef9c71be9316c286157f71e0043347c6a5c) )
 1623  
 1624      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1625      ROM_LOAD( "f1sb32.bin", 0x000000, 0x080000, CRC(1b31fcce) SHA1(354cc6f43cd3bf3ba921ac8c5631ab993bedf563) )
 1626  
 1627      ROM_REGION( 0x800000, "gfx5", 0 ) /* extra data? doesn't seem to be tiles */
 1628      ROM_LOAD( "f1sb2b.bin", 0x000000, 0x200000, CRC(18d73b16) SHA1(f06f4d31b15658cc1e1b559ae3b8a90b797546ca) )
 1629      ROM_LOAD( "f1sb3b.bin", 0x200000, 0x200000, CRC(ce728fe0) SHA1(e0fd7b8f4d3dc9e2b15ddf027c61e67e5c1f22b5) )
 1630      ROM_LOAD( "f1sb4b.bin", 0x400000, 0x200000, CRC(077180c5) SHA1(ab16739da709ecdbbb1264beba349ef6ecf3f8b1) )
 1631      ROM_LOAD( "f1sb5b.bin", 0x600000, 0x200000, CRC(efabc47d) SHA1(195afde8a1f45da4fc04c3080a3cf5fdfff7be5e) )
 1632  
 1633      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1634      ROM_LOAD( "f1sb21.bin", 0x000000, 0x040000, CRC(e131e1c7) SHA1(33f95a074930c49548069518d8c6dcde7fa25627) )
 1635      ROM_RELOAD(              0x010000, 0x40000 )
 1636  
 1637      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 1638      ROM_LOAD( "f1sb24.bin", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
 1639      ROM_LOAD( "f1sb23.bin", 0x200000, 0x200000, CRC(bfefa3ab) SHA1(7770cc9b091e258ede7f2780df61a592cc008dd7) )
 1640  
 1641      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1642      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1643  ROM_END
 1644  
 1645  ROM_START( gratia )
 1646      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1647      ROM_LOAD32_BYTE( "94019.026", 0x000003, 0x80000, CRC(f398cba5) SHA1(11e06abebfdfc8a99b5c56e9f6ed389f645b6c72) )
 1648      ROM_LOAD32_BYTE( "94019.027", 0x000002, 0x80000, CRC(ba3318c5) SHA1(9b100988b998c39b586b51fe9fee874dbf711610) )
 1649      ROM_LOAD32_BYTE( "94019.028", 0x000001, 0x80000, CRC(e0762e89) SHA1(a567c347e7f73f1ef1c753d14ac4f58311380fac) )
 1650      ROM_LOAD32_BYTE( "94019.029", 0x000000, 0x80000, CRC(8059800b) SHA1(7548d01b6ea15e962353b3585db6515e5819e5ce) )
 1651  
 1652      ROM_REGION( 0x0c00000, "gfx1", 0 ) /* sprites */
 1653      ROM_LOAD32_WORD( "94019.01", 0x000000, 0x200000, CRC(92d8ae9b) SHA1(02b36e6e14b28a9830e07fd328772dbb20b76889) )
 1654      ROM_LOAD32_WORD( "94019.02", 0x000002, 0x200000, CRC(f7bd9cc4) SHA1(5658bfb4081439ab06c6ade2531581aa60d1c6be) )
 1655      ROM_LOAD32_WORD( "94019.03", 0x400000, 0x200000, CRC(62a69590) SHA1(d95cc1e1ec85161ee6cd1ae77b405cf8ef81217a) )
 1656      ROM_LOAD32_WORD( "94019.04", 0x400002, 0x200000, CRC(5a76a39b) SHA1(fc7c1ff9a0a3c2639fc52720aefe8b2a9e5d2857) )
 1657      ROM_LOAD32_WORD( "94019.05", 0x800000, 0x200000, CRC(a16994df) SHA1(9170b1fd9252d7a9601c3b2e6b1ba86686730b86) )
 1658      ROM_LOAD32_WORD( "94019.06", 0x800002, 0x200000, CRC(01d52ef1) SHA1(1585c7eb3729bab78467f627b7b671d619451a74) )
 1659  
 1660      ROM_REGION( 0x400000, "gfx2", 0 ) /* roz tiles */
 1661      ROM_LOAD( "94019.08", 0x000000, 0x200000, CRC(abd124e0) SHA1(2da1d818c909e4abbb79ed03f3dbf15d744439ce) )
 1662      ROM_LOAD( "94019.09", 0x200000, 0x200000, CRC(711ab08b) SHA1(185b80b965ac3aba4857b4f83637008c2c1cc6ff) )
 1663  
 1664      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 1665      ROM_LOAD( "94019_2.07", 0x000000, 0x200000, CRC(043f969b) SHA1(ad10339e561c1a65451a2e9a8e79ceda3787674a) )
 1666  
 1667      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1668      ROM_LOAD( "94019_2.030",0x000000, 0x080000, CRC(f9543fcf) SHA1(8466c7893bc6c43e2a80b8f91a776fd0a345ea6c) )
 1669  
 1670      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1671      ROM_LOAD( "94019.021",0x000000, 0x040000, CRC(6e8dd039) SHA1(f1e69c9b40b14ba0f8377a6d9b6c3933919bc803) )
 1672      ROM_RELOAD(              0x010000, 0x40000 )
 1673  
 1674      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 1675      ROM_LOAD( "92042.01", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common rom?
 1676      ROM_LOAD( "94019.10", 0x200000, 0x200000, CRC(a751e316) SHA1(3d658370c71b83582fd132b3da441089df9bfd05) )
 1677  
 1678      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1679      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1680  ROM_END
 1681  
 1682  ROM_START( gratiaa )
 1683      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1684      ROM_LOAD32_BYTE( "94019.026", 0x000003, 0x80000, CRC(f398cba5) SHA1(11e06abebfdfc8a99b5c56e9f6ed389f645b6c72) )
 1685      ROM_LOAD32_BYTE( "94019.027", 0x000002, 0x80000, CRC(ba3318c5) SHA1(9b100988b998c39b586b51fe9fee874dbf711610) )
 1686      ROM_LOAD32_BYTE( "94019.028", 0x000001, 0x80000, CRC(e0762e89) SHA1(a567c347e7f73f1ef1c753d14ac4f58311380fac) )
 1687      ROM_LOAD32_BYTE( "94019.029", 0x000000, 0x80000, CRC(8059800b) SHA1(7548d01b6ea15e962353b3585db6515e5819e5ce) )
 1688  
 1689      ROM_REGION( 0x0c00000, "gfx1", 0 ) /* sprites */
 1690      ROM_LOAD32_WORD( "94019.01", 0x000000, 0x200000, CRC(92d8ae9b) SHA1(02b36e6e14b28a9830e07fd328772dbb20b76889) )
 1691      ROM_LOAD32_WORD( "94019.02", 0x000002, 0x200000, CRC(f7bd9cc4) SHA1(5658bfb4081439ab06c6ade2531581aa60d1c6be) )
 1692      ROM_LOAD32_WORD( "94019.03", 0x400000, 0x200000, CRC(62a69590) SHA1(d95cc1e1ec85161ee6cd1ae77b405cf8ef81217a) )
 1693      ROM_LOAD32_WORD( "94019.04", 0x400002, 0x200000, CRC(5a76a39b) SHA1(fc7c1ff9a0a3c2639fc52720aefe8b2a9e5d2857) )
 1694      ROM_LOAD32_WORD( "94019.05", 0x800000, 0x200000, CRC(a16994df) SHA1(9170b1fd9252d7a9601c3b2e6b1ba86686730b86) )
 1695      ROM_LOAD32_WORD( "94019.06", 0x800002, 0x200000, CRC(01d52ef1) SHA1(1585c7eb3729bab78467f627b7b671d619451a74) )
 1696  
 1697      ROM_REGION( 0x400000, "gfx2", 0 ) /* roz tiles */
 1698      ROM_LOAD( "94019.08", 0x000000, 0x200000, CRC(abd124e0) SHA1(2da1d818c909e4abbb79ed03f3dbf15d744439ce) )
 1699      ROM_LOAD( "94019.09", 0x200000, 0x200000, CRC(711ab08b) SHA1(185b80b965ac3aba4857b4f83637008c2c1cc6ff) )
 1700  
 1701      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 1702      ROM_LOAD( "94019.07", 0x000000, 0x200000, BAD_DUMP CRC(acb75824) SHA1(3b43e00a2d240761565042c8feead25a83ef0eb1)  )  // FIXED BITS (xxxxxxxx11111111)
 1703  
 1704      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1705      ROM_LOAD( "94019.030",0x000000, 0x080000, CRC(026b5379) SHA1(b9237477f1bf8ae83174e8231492fe667e6d6a13) )
 1706  
 1707      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1708      ROM_LOAD( "94019.021",0x000000, 0x040000, CRC(6e8dd039) SHA1(f1e69c9b40b14ba0f8377a6d9b6c3933919bc803) )
 1709      ROM_RELOAD(              0x010000, 0x40000 )
 1710  
 1711      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 1712      ROM_LOAD( "92042.01", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common rom?
 1713      ROM_LOAD( "94019.10", 0x200000, 0x200000, CRC(a751e316) SHA1(3d658370c71b83582fd132b3da441089df9bfd05) )
 1714  
 1715      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1716      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1717  ROM_END
 1718  
 1719  ROM_START( gametngk )
 1720      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1721      ROM_LOAD32_BYTE( "mr94041.26", 0x000003, 0x80000, CRC(e622e774) SHA1(203c2a3563a337af4cec92a66e0fa410d901b01f) )
 1722      ROM_LOAD32_BYTE( "mr94041.27", 0x000002, 0x80000, CRC(da862b9c) SHA1(17dc6da08d7f5551c8f4bc4d9c416dbfc82d8397) )
 1723      ROM_LOAD32_BYTE( "mr94041.28", 0x000001, 0x80000, CRC(b3738934) SHA1(cd07572e55e83807e76179cfc6b97e0410067911) )
 1724      ROM_LOAD32_BYTE( "mr94041.29", 0x000000, 0x80000, CRC(45154a45) SHA1(4c7c2c6738fdfe54ebe41a0ac6222cbfce5d7757) )
 1725  
 1726      ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprites */
 1727      ROM_LOAD32_WORD( "mr94041.01", 0x0000000, 0x200000, CRC(3f99adf7) SHA1(cbb8d2fc253b0c58e7eb9286c66e6b36daf9d4af) )
 1728      ROM_LOAD32_WORD( "mr94041.02", 0x0000002, 0x200000, CRC(c3c5ae69) SHA1(5ed7f57a7139f87c680c68e44ea4022b917a9381) )
 1729      ROM_LOAD32_WORD( "mr94041.03", 0x0400000, 0x200000, CRC(d858b6de) SHA1(a06cf529c9508c8c8508894e2e004373edd9debf) )
 1730      ROM_LOAD32_WORD( "mr94041.04", 0x0400002, 0x200000, CRC(8c96ca20) SHA1(097cab64ef8e515c59178c36171f87bed4b3d1e5) )
 1731      ROM_LOAD32_WORD( "mr94041.05", 0x0800000, 0x200000, CRC(ac664a0b) SHA1(bd002822a38369599a1b5a7456957de1d9cd976e) )
 1732      ROM_LOAD32_WORD( "mr94041.06", 0x0800002, 0x200000, CRC(70dd0dd4) SHA1(da648c16ad0cb12ac66656522da14392be7772c9) )
 1733      ROM_LOAD32_WORD( "mr94041.07", 0x0c00000, 0x200000, CRC(a6966af5) SHA1(3a65824f3f325af39d8e9932357ce9f8878f0321) )
 1734      ROM_LOAD32_WORD( "mr94041.08", 0x0c00002, 0x200000, CRC(d7d2f73a) SHA1(0eb28f4cdea73aa8fed0b62cbac6cd7d7694c2ee) )
 1735  
 1736      ROM_REGION( 0x400000, "gfx2", 0 ) /* roz tiles */
 1737      ROM_LOAD( "mr94041.11", 0x000000, 0x200000, CRC(00dcdbc3) SHA1(f7e34bc9f714ea81fc9855d90db792dd1e99bae8) )
 1738      ROM_LOAD( "mr94041.12", 0x200000, 0x200000, CRC(0ce48329) SHA1(9c198cef998eb3b9c33123bd8cc02210498f82d9) )
 1739  
 1740      ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles */
 1741      ROM_LOAD( "mr94041.09", 0x000000, 0x200000, CRC(a33e6051) SHA1(d6e34b022eb36dcfa8cfe6d6d1254f994b3b3dca) )
 1742      ROM_LOAD( "mr94041.10", 0x200000, 0x200000, CRC(b3497147) SHA1(df7d8ea7ec3e3df5e0c6658f14995df5479181bf) )
 1743  
 1744      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1745      ROM_LOAD( "mr94041.30", 0x000000, 0x080000, CRC(c0f27b7f) SHA1(874fe80aa4b46520f844ef6efa61f28eabccbc4f) )
 1746  
 1747      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1748      ROM_LOAD( "mr94041.21", 0x000000, 0x040000, CRC(38dcb837) SHA1(29fdde54e52dec4ee39a6f2db8e0d67774320d15) )
 1749      ROM_RELOAD(              0x010000, 0x40000 )
 1750  
 1751      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 1752      ROM_LOAD( "mr94041.13", 0x000000, 0x200000, CRC(fba84caf) SHA1(318270dbf825a8e0f315992c49a2dc34dd1df7c1) )
 1753      ROM_LOAD( "mr94041.14", 0x200000, 0x200000, CRC(2d6308bd) SHA1(600b6ccdbb976301075e0b287124a9fd5fe7fc1b) )
 1754  
 1755      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1756      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1757  ROM_END
 1758  
 1759  ROM_START( hayaosi2 )
 1760      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1761      ROM_LOAD32_BYTE( "mb93138a.25", 0x000003, 0x80000, CRC(563c6f2f) SHA1(bc2a61fd2e0adf58256feeef8491b67af6d6eacf) )
 1762      ROM_LOAD32_BYTE( "mb93138a.27", 0x000002, 0x80000, CRC(fe8e283a) SHA1(fc6c06ae296110b1f5794187d5208b17541614cb) )
 1763      ROM_LOAD32_BYTE( "mb93138a.29", 0x000001, 0x80000, CRC(e6fe3d0d) SHA1(9a0caab82b160991b4f2ac993e7e4b4c5d3bb15e) )
 1764      ROM_LOAD32_BYTE( "mb93138a.31", 0x000000, 0x80000, CRC(d944bf8c) SHA1(ce93b5d2ebe886b38dc42b1e554b17dc951a51b4) )
 1765  
 1766      ROM_REGION( 0x900000, "gfx1", 0 ) /* sprites */
 1767      ROM_LOAD32_WORD( "mr93038.04",  0x000000, 0x200000, CRC(ab5edb11) SHA1(b7742aefbce9efc512c3526714b6f20a6c03af60) )
 1768      ROM_LOAD32_WORD( "mr93038.05",  0x000002, 0x200000, CRC(274522f1) SHA1(717435d6bf1b2a2220a2f0a53b070bb81cc2ed2b) )
 1769      ROM_LOAD32_WORD( "mr93038.06",  0x400000, 0x200000, CRC(f9961ebf) SHA1(e91b160cb5a76e3f6044cc71681dadf2fbff7e8b) )
 1770      ROM_LOAD32_WORD( "mr93038.07",  0x400002, 0x200000, CRC(1abef1c5) SHA1(4b40adaebf9d9963493bfb285badbb19a5b181be) )
 1771      ROM_LOAD32_WORD( "mb93138a.15", 0x800000, 0x080000, CRC(a5f64d87) SHA1(11bf017f700faba57a5a2edced7a5d81a581bc50) )
 1772      ROM_LOAD32_WORD( "mb93138a.3",  0x800002, 0x080000, CRC(a2ae2b21) SHA1(65cee4e5e0a9b8dcac578e34210e1af7d7b2e6f7) )
 1773  
 1774      ROM_REGION( 0x200000, "gfx2", 0 ) /* roz tiles */
 1775      ROM_LOAD( "mr93038.03",  0x000000, 0x200000, CRC(6999dec9) SHA1(eb4c6ba200cd08b41509314c659feb3af12117ee) )
 1776  
 1777      ROM_REGION( 0x100000, "gfx3", 0 ) /* bg tiles */
 1778      ROM_LOAD( "mr93038.08",  0x000000, 0x100000, CRC(21282cb0) SHA1(52ea94a6457f7684674783c362052bcc40086dd0) )
 1779  
 1780      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1781      ROM_LOAD( "mb93138a.32", 0x000000, 0x080000, CRC(f563a144) SHA1(14d86e4992329811857e1faf282cd9ec530a364c) )
 1782  
 1783      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1784      ROM_LOAD( "mb93138a.21", 0x000000, 0x040000, CRC(8e8048b0) SHA1(93285a0570ed829b36f4e8c57d133a7dd14f123d) )
 1785      ROM_RELOAD(              0x010000, 0x40000 )
 1786  
 1787      ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
 1788      ROM_LOAD( "mr92042.01",  0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
 1789      ROM_LOAD( "mr93038.01",  0x200000, 0x200000, CRC(b8a38bfc) SHA1(1aa7b69beebceb6f09a1ee006de054cb84002e94) )
 1790  
 1791      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1792      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1793  ROM_END
 1794  
 1795  /*
 1796  
 1797  Hayaoshi Quiz Nettou Namahousou
 1798  (c)1993 Jaleco
 1799  
 1800  MB-93140A EB91022-20079-1 (Motherboard. Mega System 32?)
 1801  MB-93138A EB91022-20078-1 (ROM board)
 1802  SE-93139 EB91022-30056 (extended board on ROM board)
 1803  
 1804  CPU  : NEC JAPAN D70632GD-20 (V70)
 1805  Sound: Z80 YMF271-F
 1806  OSC  : 48.0000MHz (OSC1) 40.0000MHz (OSC2) 16.9344MHz (X1)
 1807  
 1808  ROMs:
 1809  MR94027.02 (16M mask, location IC 3( 1)) [59976568]
 1810  MR94027.04 (16M mask, location IC 4( 2)) [6a16d13a]
 1811  MR94027.06 (16M mask, location IC 5( 3)) [1618785a]
 1812  MR94027.08 (16M mask, location IC 6( 4)) [753b05e0]
 1813  
 1814  MR94027.09 (16M mask, location IC11( 9)) [32ead437]
 1815  MR94027.11 (16M mask, location IC13(11)) [b65d5096]
 1816  
 1817  MR94027.01 (16M mask, location IC20(13)) [c72e5c6e]
 1818  MR94027.03 (16M mask, location IC21(14)) [3ff68f4f]
 1819  MR94027.05 (16M mask, location IC22(15)) [59545977]
 1820  MR94027.07 (16M mask, location IC23(16)) [c66099c4]
 1821  
 1822  MB93138.21 (M27C2001, location IC30(21)) [008bc217] Ver1.0
 1823  actual label is "MB-93138 21 Ver1.0"
 1824  
 1825  MR92042.01 (16M mask, location IC33(22)) [0fa26f65]
 1826  MR94027.10 (16M mask, locaiton IC34(23)) [e7cabe41]
 1827  
 1828  MB93138.25 (M27C4001, location IC36(25)) [ba8cec03] Ver1.5
 1829  MB93138.27 (M27C4001, location IC38(27)) [571725df] Ver1.5
 1830  MB93138.29 (M27C4001, location IC40(29)) [da891976] Ver1.5
 1831  MB93138.31 (M27C4001, location IC42(31)) [2d17bb06] Ver1.5
 1832  actual label is "???????N?C?Y?M?????????IMB-93138-?? Ver.1.5"
 1833  
 1834  MB93138.32 (M27C4001, location IC43(32)) [df5d00b4] Ver1.0
 1835  actual label is "MB-93138 32 Ver1.0"
 1836  
 1837  
 1838  PALs (not dumped):
 1839  91022-01.2 (18CV8,  IC83(2))
 1840  91022-02.1 (22CV10, IC62(1))
 1841  
 1842  Custom chips:
 1843  SS91022-01 9348 ACBA (IC36, 208pin PQFP)
 1844  SS91022-02 9350 IAHA (IC 9, 100pin PQFP)
 1845  SS91022-03 9343EX006 (IC11, 176pin PQFP)
 1846  SS91022-05 9347EX002 (IC31, 120pin PQFP)
 1847  SS91022-07 9345EV 450881 06440 (IC70, 208pin PQFP)
 1848  
 1849  GS91022-01 9340EK002 (IC46, 120pin PQFP)
 1850  GS91022-02 9334EK709 (IC6,  160pin PQFP)
 1851  GS91022-03 9335PP711 (IC7,  100pin PQFP)
 1852  GS91022-04 9334PP712 (IC24, 100pin PQFP)
 1853  
 1854  SS92046-01 9338EV 436091 06441 (IC1 of EB91022-30056, 144pin PQFP)
 1855  
 1856  Others:
 1857  Lithium battery + LH5168D-10L(SRAM)
 1858  
 1859  */
 1860  
 1861  
 1862  ROM_START( hayaosi3 )
 1863      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1864      ROM_LOAD32_BYTE( "mb93138.25", 0x000003, 0x80000, CRC(ba8cec03) SHA1(edaa52e0b07307bb21168205ee0d5d6ff8168de9) )
 1865      ROM_LOAD32_BYTE( "mb93138.27", 0x000002, 0x80000, CRC(571725df) SHA1(66575ec1a29d6fc1b50ae5a5ce8025bb1043deaf))
 1866      ROM_LOAD32_BYTE( "mb93138.29", 0x000001, 0x80000, CRC(da891976) SHA1(27e8c395e92ca01b47bffdf766bc95a6c2150815) )
 1867      ROM_LOAD32_BYTE( "mb93138.31", 0x000000, 0x80000, CRC(2d17bb06) SHA1(623b603c4002734427c882424a1e0dc889cf7e02) )
 1868  
 1869      ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprites */
 1870      ROM_LOAD32_WORD( "mr94027.01",  0x000000, 0x200000, CRC(c72e5c6e) SHA1(b98cd656c48c775953d00b5d8bafd4ffde76d8df) )
 1871      ROM_LOAD32_WORD( "mr94027.02",  0x000002, 0x200000, CRC(59976568) SHA1(a280c352d612913834c76b8e23d86c937fd21281) )
 1872      ROM_LOAD32_WORD( "mr94027.03",  0x400000, 0x200000, CRC(3ff68f4f) SHA1(1e367b92560c32c87e27fc0e99be3bdb5eb0510b) )
 1873      ROM_LOAD32_WORD( "mr94027.04",  0x400002, 0x200000, CRC(6a16d13a) SHA1(65a7751c248c966fd01149418ce6bedba7a0d48a) )
 1874      ROM_LOAD32_WORD( "mr94027.05",  0x800000, 0x200000, CRC(59545977) SHA1(2e0a83efd7ae210c0b4360e9572dd7eec38cd974) )
 1875      ROM_LOAD32_WORD( "mr94027.06",  0x800002, 0x200000, CRC(1618785a) SHA1(3f2698d07a52947429313a78ebcedfdae478efd7) )
 1876      ROM_LOAD32_WORD( "mr94027.07",  0xc00000, 0x200000, CRC(c66099c4) SHA1(5a6edffa39a98f38cc3cffbad9191fb2e794a812) )
 1877      ROM_LOAD32_WORD( "mr94027.08",  0xc00002, 0x200000, CRC(753b05e0) SHA1(0424e92b32a73c27ecb549e6e9449446ea938e40) )
 1878  
 1879      ROM_REGION( 0x200000, "gfx2", 0 ) /* roz tiles */
 1880      ROM_LOAD( "mr94027.09",  0x000000, 0x200000, CRC(32ead437) SHA1(b94175cf186b4ebcc180a4c092d2ffcdd9ff3b1d) )
 1881  
 1882      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 1883      ROM_LOAD( "mr94027.11",  0x000000, 0x200000, CRC(b65d5096) SHA1(2c4e1e3e9f96be8369cb2de142a82f94506f85c0) )
 1884  
 1885      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1886      ROM_LOAD( "mb93138.32", 0x000000, 0x080000, CRC(df5d00b4) SHA1(2bbbcd546d5b5170d81bf33b37b46b70b417c9c7) )
 1887  
 1888      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1889      ROM_LOAD( "mb93138.21", 0x000000, 0x040000, CRC(008bc217) SHA1(eec66a86f285ccbc47eba17a4bb83cc1f8a5f425) )
 1890      ROM_RELOAD(              0x010000, 0x40000 )
 1891  
 1892      ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
 1893      ROM_LOAD( "mr92042.01",  0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
 1894      ROM_LOAD( "mr94027.10",  0x200000, 0x200000, CRC(e7cabe41) SHA1(5d903baed690a98856f7581319cf4dbfe1db47bb) )
 1895  
 1896      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1897      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1898  ROM_END
 1899  
 1900  ROM_START( kirarast )
 1901      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1902      ROM_LOAD32_BYTE( "mr95025.26", 0x000003, 0x80000, CRC(eb7faf5f) SHA1(5b79ff3043db5ef2622ae1665145462d949c9bb8) )
 1903      ROM_LOAD32_BYTE( "mr95025.27", 0x000002, 0x80000, CRC(80644d05) SHA1(6da8bf8aeb1477112f9022c0c5f472cbcd27df8e) )
 1904      ROM_LOAD32_BYTE( "mr95025.28", 0x000001, 0x80000, CRC(6df8c384) SHA1(3ad01d3d51cfc1f48029c16ee1cc74fc59d7603c) )
 1905      ROM_LOAD32_BYTE( "mr95025.29", 0x000000, 0x80000, CRC(3b6e681b) SHA1(148fa10631db53a4ad1dcdfb60b4f0654e077396) )
 1906  
 1907      ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprites */
 1908      ROM_LOAD32_WORD( "mr95025.01",  0x000000, 0x200000, CRC(02279069) SHA1(fb3ce00701271d0163f72e4f2e56faa9f16d8fd0) )
 1909      ROM_LOAD32_WORD( "mr95025.02",  0x000002, 0x200000, CRC(885161d4) SHA1(1bc82de0b2759758d437db3ef9f0f7805f759b59) )
 1910      ROM_LOAD32_WORD( "mr95025.03",  0x400000, 0x200000, CRC(1ae06df9) SHA1(e1493a386fd8c54c88afab43d13d73869ae467ee) )
 1911      ROM_LOAD32_WORD( "mr95025.04",  0x400002, 0x200000, CRC(91ab7006) SHA1(0b99c352a696e21b2f31207cbf9b4a64edf543ce) )
 1912      ROM_LOAD32_WORD( "mr95025.05",  0x800000, 0x200000, CRC(e61af029) SHA1(685315e833a168383c4c5cdaf72de172f14995b6) )
 1913      ROM_LOAD32_WORD( "mr95025.06",  0x800002, 0x200000, CRC(63f64ffc) SHA1(a2a109be24b5f1ec2e41e423d4194394ea8c3c8b) )
 1914      ROM_LOAD32_WORD( "mr95025.07",  0xc00000, 0x200000, CRC(0263a010) SHA1(b9c85647b406c89f0e839eac93eaf5d2e6963f7d) )
 1915      ROM_LOAD32_WORD( "mr95025.08",  0xc00002, 0x200000, CRC(8efc00d6) SHA1(f750e0e21310ceceeae3ad80eb2fe2920f5a0076) )
 1916  
 1917      ROM_REGION( 0x400000, "gfx2", 0 ) /* roz tiles */
 1918      ROM_LOAD( "mr95025.10",  0x000000, 0x200000, CRC(ba7ad413) SHA1(b1f1c218dea3217f21d5e2f44db3786055ed879a) )
 1919      ROM_LOAD( "mr95025.11",  0x200000, 0x200000, CRC(11557299) SHA1(6efa56f897ab026f965376a0d4032f7a0d20cafe) )
 1920  
 1921      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 1922      ROM_LOAD( "mr95025.09",  0x000000, 0x200000, CRC(ca6cbd17) SHA1(9d16ef187b062590315066218e89bdf33cfd9865) )
 1923  
 1924      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1925      ROM_LOAD( "mr95025.30",  0x000000, 0x080000, CRC(aee6e0c2) SHA1(dee985f7a9773ba7a4d31a3833a7775d778bbe5a) )
 1926  
 1927      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1928      ROM_LOAD( "mr95025.21",  0x000000, 0x040000, CRC(a6c70c7f) SHA1(fe2108f3e8d46ed53d8c5c98e8d0fdb19b77075d) )
 1929      ROM_RELOAD(              0x010000, 0x40000 )
 1930  
 1931      ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
 1932      ROM_LOAD( "mr95025.12",  0x000000, 0x200000, CRC(1dd4f766) SHA1(455befd3a216f2197cd2e7e4899d4f1af7d20bf7) )
 1933      ROM_LOAD( "mr95025.13",  0x200000, 0x200000, CRC(0adfe5b8) SHA1(02309e5789b58896e5f68603502c76d4a917bd91) )
 1934  
 1935      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1936      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1937  ROM_END
 1938  
 1939  ROM_START( akiss )
 1940      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1941      ROM_LOAD32_BYTE( "93166.26", 0x000003, 0x80000, CRC(5bdd01ee) SHA1(21b8e07bb7ef6b437a43719b02deeba970330900) )
 1942      ROM_LOAD32_BYTE( "93166.27", 0x000002, 0x80000, CRC(bb11b2c9) SHA1(86ba06d28bc8f560ac3d05515d061e05c90d1628) )
 1943      ROM_LOAD32_BYTE( "93166.28", 0x000001, 0x80000, CRC(20565478) SHA1(d532ab55be287f45d8d81317bb844c675eb1292c) )
 1944      ROM_LOAD32_BYTE( "93166.29", 0x000000, 0x80000, CRC(ff454f0d) SHA1(db81aaaf4160eb62badbe08fc01543463470ac97) )
 1945  
 1946      ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprites */
 1947      ROM_LOAD32_WORD( "95008-01.13", 0x000000, 0x200000, CRC(1be66420) SHA1(9fc85e6108f230418e012ad05586010235139039))
 1948      ROM_LOAD32_WORD( "95008-02.1",  0x000002, 0x200000, CRC(1cc4808e) SHA1(70a19d66b4f187320c67760bc453b6afb7d66f9a) )
 1949      ROM_LOAD32_WORD( "95008-03.14", 0x400000, 0x200000, CRC(4045f0dc) SHA1(5ba9786618ecad9410dbdf3664f9dda848a754f7) )
 1950      ROM_LOAD32_WORD( "95008-04.2",  0x400002, 0x200000, CRC(ef3c139d) SHA1(3de374e77443dd4e967dbb5da820fe1c8c78aa1b) )
 1951      ROM_LOAD32_WORD( "95008-05.15", 0x800000, 0x200000, CRC(43ea4a84) SHA1(d9d9898edcf432998ed6b9a1622812def45cf369) )
 1952      ROM_LOAD32_WORD( "95008-06.3",  0x800002, 0x200000, CRC(24f23d4e) SHA1(8a7b6f28f25227391df73edb096695c5fe8df7dc))
 1953      ROM_LOAD32_WORD( "95008-07.16", 0xc00000, 0x200000, CRC(bf47747e) SHA1(b97121953f41039182e25ea023802df4524cf9bd) )
 1954      ROM_LOAD32_WORD( "95008-08.4",  0xc00002, 0x200000, CRC(34829a09) SHA1(7229c56fee53a9d4d29cf0c9dec471b6cc4dc30b) )
 1955  
 1956      ROM_REGION( 0x400000, "gfx2", 0 ) /* roz tiles */
 1957      ROM_LOAD( "95008-10.11",  0x000000, 0x200000, CRC(52da2e9e) SHA1(d7a29bdd1c6801aa8d36bc098e75091c63ba0766) )
 1958  
 1959      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 1960      ROM_LOAD( "95008-09.10",  0x000000, 0x200000,CRC(7236f6a0) SHA1(98dbb55f08d669ef3bf69394bb9739d0e6137fcb) )
 1961  
 1962      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 1963      ROM_LOAD( "93166.30",  0x000000, 0x080000, CRC(1807c1ea) SHA1(94696b8319c4982cb5d33423f56e2348f210cdb5) )
 1964  
 1965      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 1966      ROM_LOAD( "93166.21",  0x000000, 0x040000, CRC(01a03687) SHA1(2340c4ed19f434e8c23709edfc93259313aefaf9))
 1967      ROM_RELOAD(              0x010000, 0x40000 )
 1968  
 1969      ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
 1970      ROM_LOAD( "95008-11.22",  0x000000, 0x200000, CRC(23b9af76) SHA1(98b4087c142500dc759bda94d71c77634452a7ad))
 1971      ROM_LOAD( "95008-12.23",  0x200000, 0x200000, CRC(780a2f45) SHA1(770cbf04e34ae7d72e6eb2304bcdfaff483cd8c1))
 1972  
 1973      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 1974      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 1975  ROM_END
 1976  
 1977  ROM_START( p47aces )
 1978      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 1979      ROM_LOAD32_BYTE( "p47-26.bin", 0x000003, 0x80000, CRC(e017b819) SHA1(942fb48e8bb3a263534a0351a1a9979d786bc475) )
 1980      ROM_LOAD32_BYTE( "p47-27.bin", 0x000002, 0x80000, CRC(bd1b81e0) SHA1(b15f157fe3a30295f999a4c285da2d6f22d7fba6) )
 1981      ROM_LOAD32_BYTE( "p47-28.bin", 0x000001, 0x80000, CRC(4742a5f7) SHA1(cd297aa150082c545647c9a755cf2cdbdc98c988) )
 1982      ROM_LOAD32_BYTE( "p47-29.bin", 0x000000, 0x80000, CRC(86e17d8b) SHA1(73004f243c6dfb86ce4cc61475dc7caaf452750e) )
 1983  
 1984      ROM_REGION( 0xe00000, "gfx1", 0 ) /* sprites */
 1985      ROM_LOAD32_WORD( "p47-01.bin",  0x000002, 0x200000, CRC(28732d3c) SHA1(15b2687bcad31793fc7d6a9dc3eccb7ad9b5f659) )
 1986      ROM_LOAD32_WORD( "p47-13.bin",  0x000000, 0x200000, CRC(a6ccf999) SHA1(5d32fb6f6987ede6c125bec9581da4695ad64dff) )
 1987      ROM_LOAD32_WORD( "p47-02.bin",  0x400002, 0x200000, CRC(128db576) SHA1(f6561f54f6b95842a5f14d29682449bf0d837a85) )
 1988      ROM_LOAD32_WORD( "p47-14.bin",  0x400000, 0x200000, CRC(efc52b38) SHA1(589caaaba4e3ddaf41e05f0f12b8d4bc6d63fa5c) )
 1989      ROM_LOAD32_WORD( "p47-03.bin",  0x800002, 0x200000, CRC(324cd504) SHA1(79b3ef3ae0aa14d903113ccf5b57d459c329cf12) )
 1990      ROM_LOAD32_WORD( "p47-15.bin",  0x800000, 0x200000, CRC(ca164b17) SHA1(ea1cb0894632442f40d321b5843125f874768aae) )
 1991      ROM_LOAD32_WORD( "p47-04.bin",  0xc00002, 0x100000, CRC(4b3372be) SHA1(cdc7d7615b6b5d45ca071b2967980dc6c6294ac0) )
 1992      ROM_LOAD32_WORD( "p47-16.bin",  0xc00000, 0x100000, CRC(c23c5467) SHA1(5ff51ecb86ccbae2af160599890e13a7cc70072d) )
 1993  
 1994      ROM_REGION( 0x400000, "gfx2", 0 ) /* roz tiles */
 1995      ROM_LOAD( "p47-11.bin",  0x000000, 0x200000, CRC(c1fe16b3) SHA1(8b9d2483ba06ab8072676e73d949c696535b3d26) )
 1996      ROM_LOAD( "p47-12.bin",  0x200000, 0x200000, CRC(75871325) SHA1(9191263a52ec6ac325cf6130b35be7cdd1ec2f50) )
 1997  
 1998      ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles */
 1999      ROM_LOAD( "p47-10.bin",  0x000000, 0x200000, CRC(a44e9e06) SHA1(ff51796e160d996e931b92049e6214982f270caa) )
 2000      ROM_LOAD( "p47-09.bin",  0x200000, 0x200000, CRC(226014a6) SHA1(090bdc1f6d2b9d33b431dbb49a457a4bb36cd3ad) )
 2001  
 2002      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 2003      ROM_LOAD( "p47-30.bin",  0x000000, 0x080000, CRC(7ba90fad) SHA1(c0a3d4458816f00b8f5eb4b6d4531d1abeaccbe5) )
 2004  
 2005      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 2006      ROM_LOAD( "p47-21.bin",  0x000000, 0x040000, CRC(f2d43927) SHA1(69ac20f339a515d58cafbcd6f7d7982ca5cda681) )
 2007      ROM_RELOAD(              0x010000, 0x40000 )
 2008  
 2009      ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
 2010      ROM_LOAD( "p47-22.bin",  0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) )
 2011      ROM_LOAD( "p47-23.bin",  0x200000, 0x200000, CRC(547fa4d4) SHA1(8a5ecb3300646762f63d37a27e643e1f6ce5e775) )
 2012  
 2013      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 2014      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 2015  ROM_END
 2016  
 2017  ROM_START( tetrisp )
 2018      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 2019      ROM_LOAD32_BYTE( "mr95024.26", 0x000003, 0x80000, CRC(d318a9ba) SHA1(cae86d86518fdfeb736e7b2040277c76cc3b4017) )
 2020      ROM_LOAD32_BYTE( "mr95024.27", 0x000002, 0x80000, CRC(2d69b6d3) SHA1(f0a513f449aa25808672fb27e3691ccabfba48a1) )
 2021      ROM_LOAD32_BYTE( "mr95024.28", 0x000001, 0x80000, CRC(87522e16) SHA1(4f0d8abec046884d89c559e3a4a5ac9e0e47a0dc) )
 2022      ROM_LOAD32_BYTE( "mr95024.29", 0x000000, 0x80000, CRC(43a61941) SHA1(a097c88c45d8486eb6ffdd13904b6eb2a3fa45b9) )
 2023  
 2024      ROM_REGION( 0x400000, "gfx1", 0 ) /* sprites */
 2025      ROM_LOAD32_WORD( "mr95024.01", 0x000002, 0x200000, CRC(cb0e92b9) SHA1(179cc9e2d819d7f6238e924184e8a383d172aa72) )
 2026      ROM_LOAD32_WORD( "mr95024.13", 0x000000, 0x200000, CRC(4a825990) SHA1(f99ba9f88f5582259ba0e50480451d4e9d1d03b7) )
 2027  
 2028      ROM_REGION( 0x200000, "gfx2", 0 ) /* roz tiles */
 2029      ROM_LOAD( "mr95024.11", 0x000000, 0x200000, CRC(c0d5246f) SHA1(413285f6b40001281c4fcec1ce73400c3ae610ed) )
 2030  
 2031      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 2032      ROM_LOAD( "mr95024.10", 0x000000, 0x200000, CRC(a03e4a8d) SHA1(d52c78d5e9d874dce514ffb035f2424409d8fb7a) )
 2033  
 2034      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 2035      ROM_LOAD( "mr95024.30", 0x000000, 0x080000, CRC(cea7002d) SHA1(5462edaeb9339790b95ed15a4bfaab8fae655b12) )
 2036  
 2037      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 2038      ROM_LOAD( "mr95024.21", 0x000000, 0x040000, CRC(5c565e3b) SHA1(d349a8ca50d03c06d8978e6d3632b624f019dee4) )
 2039      ROM_RELOAD(              0x010000, 0x40000 )
 2040  
 2041      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 2042      ROM_LOAD( "mr95024.22", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
 2043      ROM_LOAD( "mr95024.23", 0x200000, 0x200000, CRC(57502a17) SHA1(ce880188854dc17d9ebbfa3c373469cf5e6858c2) )
 2044  
 2045      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 2046      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 2047  ROM_END
 2048  
 2049  ROM_START( tp2m32 )
 2050      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 2051      ROM_LOAD32_BYTE( "tp2m3226.26", 0x000003, 0x80000, CRC(152f0ccf) SHA1(1e318e125a54216ebf3f85740db1dd85aacac819) )
 2052      ROM_LOAD32_BYTE( "tp2m3227.27", 0x000002, 0x80000, CRC(d89468d0) SHA1(023fbc13b0f6332217904c89225b330aa5742f20) )
 2053      ROM_LOAD32_BYTE( "tp2m3228.28", 0x000001, 0x80000, CRC(041aac23) SHA1(3f7863ffa897978493e98445fe020dccbe521752) )
 2054      ROM_LOAD32_BYTE( "tp2m3229.29", 0x000000, 0x80000, CRC(4e83b2ca) SHA1(2766793f050a6952f4f53a763686f95bd7544f3f) )
 2055  
 2056      ROM_REGION( 0x800000, "gfx1", 0 ) /* sprites */
 2057      ROM_LOAD32_WORD( "96019-01.9", 0x000000, 0x400000, CRC(06f7dc64) SHA1(722c51b707b9854c0293afdff18b27ec7cae6719) )
 2058      ROM_LOAD32_WORD( "96019-02.8", 0x000002, 0x400000, CRC(3e613bed) SHA1(038b5e43fa3d69654107c8093126eeb2e8fa4ddc) )
 2059  
 2060      ROM_REGION( 0x200000, "gfx2", 0 ) /* roz tiles */
 2061      ROM_LOAD( "tp2m3204.11", 0x000000, 0x200000, CRC(b5a03129) SHA1(a50d8b70615c49216f647534d1658c1a6d58a783) )
 2062  
 2063      ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles */
 2064      ROM_LOAD( "tp2m3203.10", 0x000000, 0x400000, CRC(94af8057) SHA1(e3bc6e02fe4c503ae51284770a76abbeff989147) )
 2065  
 2066      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 2067      ROM_LOAD( "tp2m3230.30", 0x000000, 0x080000, CRC(6845e476) SHA1(61c33714db2e2b5ccdcef0e0d3efdc391fe6aba2) )
 2068  
 2069      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 2070      ROM_LOAD( "tp2m3221.21", 0x000000, 0x040000, CRC(2bcc4176) SHA1(74740fa13ab81b9819b4cfbe9d34a0749ba23b8f) )
 2071      ROM_RELOAD(              0x010000, 0x40000 )
 2072  
 2073      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 2074      ROM_LOAD( "tp2m3205.22", 0x000000, 0x200000, CRC(74aa5c31) SHA1(7e3f86198fb678244fab76bee9c72bbdfc818118) )
 2075  
 2076      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 2077      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 2078  ROM_END
 2079  
 2080  
 2081  
 2082  ROM_START( bnstars ) /* ver 1.1 */
 2083      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 2084      ROM_LOAD32_BYTE( "vsjanshi26.37", 0x000003, 0x80000, CRC(75eeec8f) SHA1(26315381baa0abb470203dc565ad98c52fe17b20) )
 2085      ROM_LOAD32_BYTE( "vsjanshi27.38", 0x000002, 0x80000, CRC(69f24ab9) SHA1(e019a444111e4ed7f9a378d6e2d13ddb9324bc49) )
 2086      ROM_LOAD32_BYTE( "vsjanshi28.39", 0x000001, 0x80000, CRC(d075cfb6) SHA1(f70741e9f536d5c7604126d36c7aa8ed8f25c329) )
 2087      ROM_LOAD32_BYTE( "vsjanshi29.40", 0x000000, 0x80000, CRC(bc395b50) SHA1(84d7cc492a11a5a9402e929f0bd138ad63e3d079) )
 2088  
 2089      ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprites */
 2090      ROM_LOAD32_WORD( "mr96004-01.13", 0x000000, 0x200000, CRC(3366d104) SHA1(2de0cabe2ead777b5b02cade7f2003ef7f90b75b) )
 2091      ROM_LOAD32_WORD( "mr96004-02.1",  0x000002, 0x200000, CRC(ad556664) SHA1(4b36f8d8d9efa37cf515af41d14433e7eafa27a2) )
 2092      ROM_LOAD32_WORD( "mr96004-03.14", 0x400000, 0x200000, CRC(b399e2b1) SHA1(9b6a00a219db8d66dcf592160b7b5f7a86b8f0c9) )
 2093      ROM_LOAD32_WORD( "mr96004-04.2",  0x400002, 0x200000, CRC(f4f4cf4a) SHA1(fe497989cf96c68602f68f14920aed44fd934573) )
 2094      ROM_LOAD32_WORD( "mr96004-05.15", 0x800000, 0x200000, CRC(cd6c357e) SHA1(44cd2d0607c7ccd80f701cf1675fd283acb07252) )
 2095      ROM_LOAD32_WORD( "mr96004-06.3",  0x800002, 0x200000, CRC(fc6daad7) SHA1(99f14ac6b06ad9a8a3d2e9f69b693c7ce420a47d) )
 2096      ROM_LOAD32_WORD( "mr96004-07.16", 0xc00000, 0x200000, CRC(177e32fa) SHA1(3ca1f397dc28f1fa3a4136705b92c63e4e438f05) )
 2097      ROM_LOAD32_WORD( "mr96004-08.4",  0xc00002, 0x200000, CRC(f6df27b2) SHA1(60590976020d86bdccd4eaf57b349ea31bec6830) )
 2098  
 2099      ROM_REGION( 0x400000, "gfx2", 0 ) /* roz tiles */
 2100      ROM_LOAD( "mr96004-09.11",  0x000000, 0x400000, CRC(7f8ea9f0) SHA1(f1fe682dcb884f1aa4a5536e17ab94157a99f519) )
 2101  
 2102      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 2103      ROM_LOAD( "mr96004-11.10", 0x000000, 0x200000,  CRC(e6da552c) SHA1(69a5af3015883793c7d1343243ccae23db9ef77c) )
 2104  
 2105      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 2106      ROM_LOAD( "vsjanshi30.41",  0x000000, 0x080000, CRC(fdbbac21) SHA1(c77d852e53126cc8ebfe1e79d1134e42b54d1aab) )
 2107  
 2108      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 2109      ROM_LOAD( "vsjanshi21.30",  0x000000, 0x040000, CRC(d622bce1) SHA1(059fcc3c7216d3ea4f3a4226a06219375ce8c2bf) )
 2110      ROM_RELOAD(              0x010000, 0x40000 )
 2111  
 2112      ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
 2113      ROM_LOAD( "mr96004-10.22",  0x000000, 0x400000, CRC(83f4303a) SHA1(90ee010591afe1d35744925ef0e8d9a7e2ef3378) )
 2114  
 2115      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 2116      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 2117  ROM_END
 2118  
 2119  /*
 2120  
 2121  World PK Soccer V2
 2122  (c)1996 Jaleco
 2123  
 2124  MegaSystem32 with I/O subboard OZ-93155
 2125  
 2126  ROM board:
 2127  MB-93138A EB91022-20078-1
 2128  
 2129  25 (actual label is "PK SOCCER V2 ROM 25 VER. 1.1") IC36
 2130  27 (actual label is "PK SOCCER V2 ROM 27 VER. 1.1") IC38
 2131  29 (actual label is "PK SOCCER V2 ROM 29 VER. 1.1") IC40
 2132  31 (actual label is "PK SOCCER V2 ROM 31 VER. 1.1") IC42
 2133  32 (actual label is "PK SOCCER V2 ROM 32 VER. 1.1") IC43
 2134  
 2135  MR92042-01.22 (16M mask) IC33
 2136  MR92042-08.23 (16M mask) IC34
 2137  
 2138  ws-21 25 (actual label is "MB93138 Ver1.0 WS-21") IC30
 2139  
 2140  MR95033-01.13 (16M mask) IC20
 2141  MR95033-02.1  (16M mask) IC3
 2142  MR95033-03.14 (16M mask) IC21
 2143  MR95033-04.2  (16M mask) IC4
 2144  MR95033-05.15 (16M mask) IC22
 2145  MR95033-06.3  (16M mask) IC5
 2146  
 2147  MR95033-07.9  (16M mask) IC11
 2148  
 2149  MR95033-09.11 (16M mask) IC13
 2150  
 2151  Daughter board:
 2152  SE-93139 EB91022-30056
 2153  Custom chip: SS92046-01 9338EV 436091 06441
 2154  
 2155  */
 2156  
 2157  ROM_START( wpksocv2 )
 2158      ROM_REGION( 0x200000, "maincpu", 0 ) /* V70 code */
 2159      ROM_LOAD32_BYTE( "25", 0x000003, 0x80000, CRC(6c22a56c) SHA1(a03cbcfc024b39d2776f9e9897d1da07df6ae2d7) )
 2160      ROM_LOAD32_BYTE( "27", 0x000002, 0x80000, CRC(50c594a8) SHA1(454a63d7b2a07399a64449205271b797bca1dec1) )
 2161      ROM_LOAD32_BYTE( "29", 0x000001, 0x80000, CRC(22acd835) SHA1(0fa96a6dfde737d541842f85dc257776044e15b5) )
 2162      ROM_LOAD32_BYTE( "31", 0x000000, 0x80000, CRC(f25e50f5) SHA1(b58722f11a8b94ef053caf531ac94a959350288a) )
 2163  
 2164      ROM_REGION( 0xc00000, "gfx1", 0 ) /* sprites */
 2165      ROM_LOAD32_WORD( "mr95033-01.13", 0x000000, 0x200000, CRC(1f76ed57) SHA1(af9076b4b4c26b362825d892f46d2c04b4bb9d07) )
 2166      ROM_LOAD32_WORD( "mr95033-02.1",  0x000002, 0x200000, CRC(5b119910) SHA1(aff44e355227dd159e388ab85a5b6d48644ff421) )
 2167      ROM_LOAD32_WORD( "mr95033-03.14", 0x400000, 0x200000, CRC(8b6099ed) SHA1(c514cec1491aed00a5714c0b8d17c96e87ba50aa) )
 2168      ROM_LOAD32_WORD( "mr95033-04.2",  0x400002, 0x200000, CRC(59144dc6) SHA1(0e192001d668791c91ca2af6b367067a5106a4b2) )
 2169      ROM_LOAD32_WORD( "mr95033-05.15", 0x800000, 0x200000, CRC(cc5b8d0b) SHA1(70a5b9db600fc168d13ad54653cf1c8d2a45d991) )
 2170      ROM_LOAD32_WORD( "mr95033-06.3",  0x800002, 0x200000, CRC(2f79942f) SHA1(73417d10f37bcd539b8081312226cf142a5a0d3d) )
 2171  
 2172      ROM_REGION( 0x200000, "gfx2", 0 ) /* roz tiles */
 2173      ROM_LOAD( "mr95033-07.9", 0x000000, 0x200000, CRC(76cd2e0b) SHA1(41aa18dfb4e06547d1f6d7ce49e5225027d16bbb) )
 2174  
 2175      ROM_REGION( 0x200000, "gfx3", 0 ) /* bg tiles */
 2176      ROM_LOAD( "mr95033-09.11", 0x000000, 0x200000, CRC(8a6dae81) SHA1(e235f2865a9a003330bff1e4d0a017e5d10efd2a) )
 2177  
 2178      ROM_REGION( 0x080000, "gfx4", 0 ) /* tx tiles */
 2179      ROM_LOAD( "32", 0x000000, 0x080000, CRC(becc25c2) SHA1(4ae7665cd45ebd9586068e99327145194ba216fc) )
 2180  
 2181      ROM_REGION( 0x50000, "audiocpu", 0 ) /* z80 program */
 2182      ROM_LOAD( "ws-21", 0x000000, 0x040000, CRC(bdeff5d6) SHA1(920a6fc983d53f09510887e4e81ee89ccd5079e6) )
 2183      ROM_RELOAD(              0x010000, 0x40000 )
 2184  
 2185      ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
 2186      ROM_LOAD( "mr92042-01.22", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) )
 2187      ROM_LOAD( "mr95033-08.23", 0x200000, 0x200000, CRC(89a291fa) SHA1(7746a0490134fc902ce2dc7b0d33b455d792c105) )
 2188  
 2189      ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
 2190      ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
 2191  ROM_END
 2192  
 2193  
 2194  static void configure_banks(running_machine &machine)
 2195  {
 2196      ms32_state *state = machine.driver_data<ms32_state>();
 2197      state_save_register_global(machine, state->m_to_main);
 2198      state->membank("bank4")->configure_entries(0, 16, state->memregion("audiocpu")->base() + 0x14000, 0x4000);
 2199      state->membank("bank5")->configure_entries(0, 16, state->memregion("audiocpu")->base() + 0x14000, 0x4000);
 2200  }
 2201  
 2202  DRIVER_INIT_MEMBER(ms32_state,ms32_common)
 2203  {
 2204      m_nvram_8 = auto_alloc_array(machine(), UINT8, 0x2000);
 2205      configure_banks(machine());
 2206  }
 2207  
 2208  /* SS91022-10: desertwr, gratiaa, tp2m32, gametngk */
 2209  DRIVER_INIT_MEMBER(ms32_state,ss91022_10)
 2210  {
 2211      DRIVER_INIT_CALL(ms32_common);
 2212      ms32_rearrange_sprites(machine(), "gfx1");
 2213      decrypt_ms32_tx(machine(), 0x00000,0x35, "gfx4");
 2214      decrypt_ms32_bg(machine(), 0x00000,0xa3, "gfx3");
 2215  }
 2216  
 2217  /* SS92046_01: bbbxing, f1superb, tetrisp, hayaosi2 */
 2218  DRIVER_INIT_MEMBER(ms32_state,ss92046_01)
 2219  {
 2220      DRIVER_INIT_CALL(ms32_common);
 2221      ms32_rearrange_sprites(machine(), "gfx1");
 2222      decrypt_ms32_tx(machine(), 0x00020,0x7e, "gfx4");
 2223      decrypt_ms32_bg(machine(), 0x00001,0x9b, "gfx3");
 2224  }
 2225  
 2226  /* SS92047-01: gratia, kirarast */
 2227  DRIVER_INIT_MEMBER(ms32_state,ss92047_01)
 2228  {
 2229      DRIVER_INIT_CALL(ms32_common);
 2230      ms32_rearrange_sprites(machine(), "gfx1");
 2231      decrypt_ms32_tx(machine(), 0x24000,0x18, "gfx4");
 2232      decrypt_ms32_bg(machine(), 0x24000,0x55, "gfx3");
 2233  }
 2234  
 2235  /* SS92048-01: p47aces, 47pie2, 47pie2o */
 2236  DRIVER_INIT_MEMBER(ms32_state,ss92048_01)
 2237  {
 2238      DRIVER_INIT_CALL(ms32_common);
 2239      ms32_rearrange_sprites(machine(), "gfx1");
 2240      decrypt_ms32_tx(machine(), 0x20400,0xd6, "gfx4");
 2241      decrypt_ms32_bg(machine(), 0x20400,0xd4, "gfx3");
 2242  }
 2243  
 2244  DRIVER_INIT_MEMBER(ms32_state,kirarast)
 2245  {
 2246      DRIVER_INIT_CALL(ss92047_01);
 2247  }
 2248  
 2249  DRIVER_INIT_MEMBER(ms32_state,47pie2)
 2250  {
 2251      DRIVER_INIT_CALL(ss92048_01);
 2252  }
 2253  
 2254  DRIVER_INIT_MEMBER(ms32_state,f1superb)
 2255  {
 2256  #if 0 // we shouldn't need this hack, something else is wrong, and the x offsets are never copied either, v70 problems??
 2257      UINT32 *pROM = (UINT32 *)machine().root_device().memregion("maincpu")->base();
 2258      pROM[0x19d04/4]=0x167a021a; // bne->br  : sprite Y offset table is always copied to RAM
 2259  #endif
 2260      DRIVER_INIT_CALL(ss92046_01);
 2261  }
 2262  
 2263  DRIVER_INIT_MEMBER(ms32_state,bnstars)
 2264  {
 2265      DRIVER_INIT_CALL(ss92046_01);
 2266  }
 2267  
 2268  /********** GAME DRIVERS **********/
 2269  
 2270  
 2271  
 2272  GAME( 1994, hayaosi2, 0,        ms32, hayaosi2, ms32_state, ss92046_01, ROT0,   "Jaleco", "Hayaoshi Quiz Grand Champion Taikai", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
 2273  GAME( 1994, hayaosi3, 0,        ms32, hayaosi3, ms32_state, ss92046_01, ROT0,   "Jaleco", "Hayaoshi Quiz Nettou Namahousou", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
 2274  GAME( 1994, bbbxing,  0,        ms32, bbbxing, ms32_state,  ss92046_01, ROT0,   "Jaleco", "Best Bout Boxing", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
 2275  GAME( 1994, 47pie2,   0,        ms32, 47pie2, ms32_state,   47pie2,     ROT0,   "Jaleco", "Idol Janshi Su-Chi-Pie 2 (v1.1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2276  GAME( 1994, 47pie2o,  47pie2,   ms32, 47pie2, ms32_state,   47pie2,     ROT0,   "Jaleco", "Idol Janshi Su-Chi-Pie 2 (v1.0)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2277  GAME( 1995, desertwr, 0,        ms32, desertwr, ms32_state, ss91022_10, ROT270, "Jaleco", "Desert War / Wangan Sensou", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2278  GAME( 1995, gametngk, 0,        ms32, gametngk, ms32_state, ss91022_10, ROT270, "Jaleco", "The Game Paradise - Master of Shooting! / Game Tengoku - The Game Paradise", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2279  GAME( 1995, tetrisp,  0,        ms32, tetrisp, ms32_state,  ss92046_01, ROT0,   "Jaleco / BPS", "Tetris Plus", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2280  GAME( 1995, p47aces,  0,        ms32, p47aces, ms32_state,  ss92048_01, ROT0,   "Jaleco", "P-47 Aces", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2281  GAME( 1995, akiss,    0,        ms32, 47pie2, ms32_state,   kirarast,   ROT0,   "Jaleco", "Mahjong Angel Kiss", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2282  GAME( 1996, gratia,   0,        ms32, gratia, ms32_state,   ss92047_01, ROT0,   "Jaleco", "Gratia - Second Earth (92047-01 version)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2283  GAME( 1996, gratiaa,  gratia,   ms32, gratia, ms32_state,   ss91022_10, ROT0,   "Jaleco", "Gratia - Second Earth (91022-10 version)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2284  GAME( 1996, kirarast, 0,        ms32, kirarast, ms32_state, kirarast,   ROT0,   "Jaleco", "Ryuusei Janshi Kirara Star", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2285  GAME( 1997, tp2m32,   tetrisp2, ms32, tp2m32, ms32_state,   ss91022_10, ROT0,   "Jaleco", "Tetris Plus 2 (MegaSystem 32 Version)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2286  GAME( 1997, bnstars,  bnstars1, ms32, 47pie2, ms32_state,   bnstars,    ROT0,   "Jaleco", "Vs. Janshi Brandnew Stars (MegaSystem32 Version)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2287  GAME( 1996, wpksocv2, 0,        ms32, wpksocv2, ms32_state, ss92046_01, ROT0,   "Jaleco", "World PK Soccer V2 (ver 1.1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 2288  
 2289  
 2290  /* these boot and show something */
 2291  GAME( 1994, f1superb, 0,        f1superb, f1superb, ms32_state, f1superb, ROT0,   "Jaleco", "F1 Super Battle", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
 2292  
 2293  /* Notes from Charles MacDonald
 2294  
 2295  ----------------------------------------------------------------------------
 2296   Z80 communication
 2297   ----------------------------------------------------------------------------
 2298  
 2299   The system has two 8-bit registers which store bytes going from the Z80
 2300   to the V70 and vice-versa.
 2301  
 2302   V70 side
 2303  
 2304   $FC800000 : Writes load the Z80 sound latch and trigger a NMI.
 2305  
 2306               Reads return D31-D16 = open bus, D15-D0 = $FFFF.
 2307  
 2308   $FD000000 : Reads return D31-D16 = open bus, D15-D8 = $FF, and
 2309               D7-D0 =  V70 sound latch, inverted.
 2310  
 2311               Writes halt the system.
 2312  
 2313   Z80 side
 2314  
 2315       $3F10 : Reads return the contents of the Z80 sound latch, inverted.
 2316               Writes load the V70 sound latch.
 2317  
 2318   To handle the inversion of sound latch data, both CPUs should invert the
 2319   data read from their respective read addresses.
 2320  
 2321   *** Does NMI stay low such that further NMIs can't occur until it's ACK'd?
 2322  
 2323       Well, reading 3F10-3F1F allows further NMIs which are otherwise masked.
 2324  
 2325       Is /NMI line really physically held low during this time?
 2326       Or is there just a flip-flop that remains set until read, which
 2327       gates NMI?
 2328  
 2329   *** Does $3F10 cause interrupt on V60 side when accessed? Or $3F20?
 2330       Could 3F20 be a V70-side interrupt request clear register?
 2331  
 2332   ----------------------------------------------------------------------------
 2333   Sound reset register
 2334   ----------------------------------------------------------------------------
 2335  
 2336   Writing a '1' to bit 0 of $FCE00038 temporarily pulses the Z80 /RESET pin
 2337   low for approximately one second, at which point it goes high again and the
 2338   Z80 resumes operation.
 2339  
 2340   Setting this bit does *not* keep the Z80 reset for the duration that
 2341   it is set. It's function is that of a trigger for an automatically timed
 2342   reset pulse.
 2343  
 2344   *** Measure /RESET pulse width in units of Z80 clocks.
 2345  
 2346   ----------------------------------------------------------------------------
 2347   V70 memory map
 2348   ----------------------------------------------------------------------------
 2349  
 2350   Overview
 2351  
 2352   The hardware maps memory and other devices to a 64MB chunk that is
 2353   repeatedly mirrored throughout the last 1GB of the address space.
 2354  
 2355   The system is set up so the V70 is halted when it accesses an unused
 2356   memory address or accesses it in an unintended way (reading write-only
 2357   locations, writing to read-only locations). Shortly thereafter the
 2358   watchdog resets the system due to inactivity.
 2359  
 2360   The V70 data bus is 32-bit but is connected to a mix of 8, 16, and 32-bit
 2361   hardware. The undriven data bus bits tend to float high, though my
 2362   board had a lot of extra pull-up resistors someone added in one of
 2363   the expansion sockets. I'll try to give approximate garbage values read
 2364   from these locations when possible.
 2365  
 2366   V70 memory map
 2367  
 2368   C0000000-FBFFFFFF : Mirror of FC000000-FFFFFFFF
 2369  
 2370   Range               Acc  Repeat  Size  Width Description
 2371  
 2372   FC000000-FC1FFFFF : R/W : 32K  : 8K   : 8  : NVRAM
 2373   FC600000-FC7FFFFF : R/W : ---  : ---  : -- : Unused (return $FFFFFFFF)
 2374   FC800000-FC9FFFFF : R/W : 4b   :      : 16 : Z80 sound latch (out)
 2375   FCC00000-FCDFFFFF : R/W : 32b  :      : 32 : I/O area
 2376   FCE00000-FCFFFFFF : W/O : 8K   : 4K   : 16 : Video registers
 2377   FD000000-FD03FFFF : R/O : 4b   :      : 16 : Z80 sound latch (in)
 2378   FD180000-FD1BFFFF : R/W : 32K  : 8K   : 8  : Priority RAM
 2379   FD400000-FD5FFFFF : R/W : 256K : 128K : 16 : Color RAM
 2380   FE000000-FE1FFFFF : R/W : 128K : 64K  : 16 : Rotate RAM
 2381   FE200000-FE3FFFFF : R/W : 8K   : 4K   : 16 : Line RAM
 2382   FE800000-FE9FFFFF : R/W : 256K : 128K : 16 : Object RAM
 2383   FEC00000-FEDFFFFF : R/W : 64K  : 32K  : 16 : ASCII RAM / Scroll RAM
 2384   FEE00000-FEEFFFFF : R/W : 128K : 128K : 32 : Work RAM
 2385   FF000000-FFFFFFFF : R/O : 2MB  : 2MB  : 32 : Program ROM
 2386  
 2387   For example, the object RAM is 128Kx16, mapped to D15-D0 of each word.
 2388   This corresponds to a 256K space (128K x 32-bits, 16 of which are used)
 2389   that repeats every 256K within FE800000-FE9FFFFF.
 2390  
 2391   1.) Data written to the LSB is stored inverted in $3F10 and triggers NMI.
 2392       Writing to D15-D8 does nothing and value read is $FF.
 2393       Writing to D31-D16 resets the machine, values read are open bus (opcodes).
 2394  
 2395   All items listed are repeatedly mirrored throughout the memory ranges
 2396   they are assigned to.
 2397  
 2398   This is the memory map for a Desert War boardset. Other games can add
 2399   additional hardware on the ROM board which take up memory ranges not listed
 2400   here. Consider it to be the memory map for a stock Mega System 32 mainboard.
 2401  
 2402   ----------------------------------------------------------------------------
 2403   I/O ports
 2404   ----------------------------------------------------------------------------
 2405  
 2406   The I/O area consists of 16 word locations that are mirrored repeatedly
 2407   throughout the range they are mapped to:
 2408  
 2409   FCC00000 : ?
 2410   FCC00004 : Player 1, 2 and control panel inputs
 2411   FCC00008 : ?
 2412   FCC0000C : ?
 2413   FCC00010 : DIP switch inputs
 2414   FCC00014 : ?
 2415   FCC00018 : ?
 2416   FCC0001C : ?
 2417  
 2418   Input details
 2419  
 2420   FCC00004 : ---- ---- ---- ---- ---- ---- 4321 rldu : 1P buttons, joystick
 2421            : ---- ---- ---- ---- 4321 rldu ---- ---- : 2P buttons, joystick
 2422            : ---- ---- ---- --21 ---- ---- ---- ---- : 2P coin, 1P coin
 2423            : ---- ---- ---- ts-- ---- ---- ---- ---- : Test, service
 2424            : ---- ---- --21 ---- ---- ---- ---- ---- : 2P start, 1P start
 2425  
 2426   * All inputs are active-high (1= switch released, 0= switch pressed)
 2427  
 2428   * When the TILT input is asserted, the system is reset. This continues
 2429     until TILT is released. The state of TILT cannot be read.
 2430  
 2431   FCC00010 : ---- ---- ---- ---- ---- ---- 1234 5678 : DIP SW2 #1-8
 2432            : ---- ---- ---- ---- 1234 5678 ---- ---- : DIP SW1 #1-8
 2433            : ---- ---- 1234 5678 ---- ---- ---- ---- : DIP SW3 #1-8
 2434  
 2435   * All inputs are active-low (1= switch OFF, 0= switch ON)
 2436  
 2437  
 2438   ----------------------------------------------------------------------------
 2439   System and video registers
 2440   ----------------------------------------------------------------------------
 2441  
 2442   This area is 8K long and repeats every 8K. All registers are write-only
 2443   and are mapped to D15-D0 of each word.
 2444  
 2445   $FCE00000 : Screen mode control
 2446  
 2447   D0 : Dot clock control (1= 24 KHz?, 0= 15 KHz)
 2448  
 2449   $FCE00004 : Horizontal timing
 2450   $FCE00008 : Horizontal timing
 2451   $FCE0000C : Horizontal timing
 2452   $FCE00010 : Horizontal viewport start
 2453   $FCE00014 : Frame height
 2454   $FCE00018 : Display height
 2455   $FCE0001C : Horizontal positioning
 2456   $FCE00020 : Fine positioning adjust
 2457  
 2458   $FCE00045 : IRQ acknowledge
 2459   $FCE00038 : Sound CPU reset
 2460   $FCE00050 : Watchdog reset
 2461   $FCE006xx : ROZ
 2462  
 2463   $FCE00A00 : Text layer horizontal scroll #1
 2464   $FCE00A04 : Text layer vertical scroll #1
 2465   $FCE00A08 : Text layer horizontal scroll #2
 2466   $FCE00A0C : Text layer vertical scroll #2
 2467  
 2468   $FCE00A2x : BG layer
 2469   $FCE00A7C : Layer related
 2470   $FCE00Exx : Coin meter + lockout
 2471  
 2472   ----------------------------------------------------------------------------
 2473   NVRAM
 2474   ----------------------------------------------------------------------------
 2475  
 2476   NVRAM is 8K, occupying D7-D0 of each word. It is mirrored every 8K-words
 2477   (32K bytes) in memory.
 2478  
 2479   Remaining data bits return $FFFFF4xx.
 2480  
 2481   The NVRAM consists of a low-power 8K SRAM connected to a .1F capacitor for
 2482   short-term data retention and a CR2032 lithium battery for long-term
 2483   retention. It also has a write inhibit circuit to protect RAM from spurious
 2484   writes when the voltage drops low enough to trigger a system reset.
 2485   During normal operation the write protection is transparent to the
 2486   programmer and the SRAM can be accessed normally.
 2487  
 2488   ----------------------------------------------------------------------------
 2489   Priority RAM
 2490   ----------------------------------------------------------------------------
 2491  
 2492   Priority RAM is 8K, occupying D7-D0 of each word. It is mirrored
 2493   every 8K-words (32K bytes) in memory.
 2494  
 2495   Remaining data bits return $00FFFFxx.
 2496  
 2497   Note that the priority RAM chip is actually 32K. The upper address lines
 2498   are tied low or high, so perhaps priority RAM is banked.
 2499  
 2500   ----------------------------------------------------------------------------
 2501   Color RAM
 2502   ----------------------------------------------------------------------------
 2503  
 2504   Color RAM is implemented with three 32Kx8 SRAMs. Every eight-byte area
 2505   within color RAM addresses one location in color RAM. The red and green
 2506   color RAMs are connected in parallel to D15-D0 respectively for even words,
 2507   and the blue color RAM is connected to D7-D0 for odd words:
 2508  
 2509          MSB                                  LSB
 2510   +$00 : ---- ---- ---- ---- rrrr rrrr gggg gggg : Red, green components
 2511   +$04 : ---- ---- ---- ---- ---- ---- bbbb bbbb : Blue component
 2512  
 2513   - = Bit isn't used. Usually returns '1'.
 2514  
 2515   The color RAM area is 256K in size (32K entries x 8 bytes per entry) and
 2516   is mirrored every 256K bytes in memory.
 2517  
 2518   ----------------------------------------------------------------------------
 2519   Rotate RAM
 2520   ----------------------------------------------------------------------------
 2521  
 2522   Rotate RAM is 64K, occuping D15-D0 of each word. It is mirrored every
 2523   64K-words (128K bytes) in memory.
 2524  
 2525   Remaining data bits return $00FFxxxx or $0000xxxx randomly.
 2526  
 2527   ----------------------------------------------------------------------------
 2528   Object RAM
 2529   ----------------------------------------------------------------------------
 2530  
 2531   Object RAM is 128K, occuping D15-D0 of each word. It is mirrored every
 2532   128K-words (256K bytes) in memory.
 2533  
 2534   Remaining data bits return $FFFFxxxx.
 2535  
 2536   ----------------------------------------------------------------------------
 2537   ASCII / Scroll RAM
 2538   ----------------------------------------------------------------------------
 2539  
 2540   ASCII / Scroll RAM is 32K, occupying D15-D0 of each word. It is mirrored
 2541   every 64K-words (128K bytes) in memory.
 2542  
 2543   Remaining data bits return $0000xxxx.
 2544  
 2545   ----------------------------------------------------------------------------
 2546   Work RAM
 2547   ----------------------------------------------------------------------------
 2548  
 2549   Work RAM is 128K, occupying D31-D0 of each word. It is mirrored every 128K
 2550   bytes in memory.
 2551  
 2552   ----------------------------------------------------------------------------
 2553   Program ROM
 2554   ----------------------------------------------------------------------------
 2555  
 2556   Program ROM is 512K, occupying D31-D0 of each word. It is mirrored every
 2557   512K bytes in memory.
 2558  
 2559   ----------------------------------------------------------------------------
 2560   CPU information
 2561   ----------------------------------------------------------------------------
 2562  
 2563   Main CPU:  NEC uPD70632GD-20 (200-pin PQFP, 20 MHz)
 2564  
 2565   * The value of PIR for this particular chip is $00007007.
 2566  
 2567   * The instruction MOV.D with a register operand uses the register
 2568     pair "rn:rn+1" as the source data. R31 is a special case; the second
 2569     register of the pair is still R31 rather than wrapping to R0.
 2570  
 2571     mov.d r2, [r0]       ; Write pair R2:R3 to [R0]
 2572     mov.d r3, [r0]       ; Write pair R3:R4 to [R0]
 2573     mov.d r31, [r0]      ; Write pair R31:R31 to [R0]
 2574  
 2575     Using the immediate or quick immediate addressing mode for the source
 2576     operand causes an Addressing Mode exception, just like the uPD70616.
 2577  
 2578   Sound CPU: Zilog Z80840008PSC (40-pin DIP, 8 MHz)
 2579  
 2580   * NMOS type. Undocumented instruction "out (c), 0" functions normally.
 2581  
 2582  
 2583   */