Previous 199869 Revisions Next

r32780 Friday 17th October, 2014 at 02:59:51 UTC by Alex Jackson
devfind: Add rom_ptr_finder, which works like shared_ptr_finder
except it finds a ROM region instead of a memory share.
Unlike the old memory_region_finder, these can be accessed without
any overhead (since it's a pointer directly to the data and not
to the memory_region object), can be whatever data type you want
(no casting needed) and are strictly type-checked--if you have a
required_rom_ptr<UINT32> the region has to be a ROM_REGION32
(or an implicitly 32-bit region due to belonging to a CPU) or
the finder won't find it and will tell you why.

Basically, rom_ptr_finders are strictly better than
memory_region_finders and all drivers using the latter should be
converted over. I've done megasys1.c and twin16.c as examples.

megasys1: Use a device address map for the peekaboo oki instead
of memcpy().

twin16: Convert the scrolling layers to tilemaps (the fixed text
layer was already one). Miscellaneous cleanups/modernizations.

(nw)

Notice that rom_ptr_finder has a length() method which returns the
length in whatever size unit the pointer is, instead of a bytes()
method. Yes, I'm going to convert shared_ptr_finder to match, since
this way makes a lot more sense (in particular, mask() is useless
for shared_ptrs that are anything other than INT8/UINT8)
[src/emu]devfind.c devfind.h
[src/mame/drivers]megasys1.c twin16.c
[src/mame/includes]megasys1.h twin16.h
[src/mame/video]twin16.c

trunk/src/mame/includes/megasys1.h
r32779r32780
2929      m_audiocpu(*this, "audiocpu"),
3030      m_oki1(*this, "oki1"),
3131      m_oki2(*this, "oki2"),
32      m_region_maincpu(*this, "maincpu"),
33      m_region_oki1(*this, "oki1"),
32      m_rom_maincpu(*this, "maincpu"),
3433      m_io_system(*this, "SYSTEM"),
3534      m_io_p1(*this, "P1"),
3635      m_io_p2(*this, "P2"),
r32779r32780
4847   optional_device<cpu_device> m_audiocpu;
4948   optional_device<okim6295_device> m_oki1;
5049   optional_device<okim6295_device> m_oki2;
51   required_memory_region m_region_maincpu;
52   optional_memory_region m_region_oki1;
50   required_rom_ptr<UINT16> m_rom_maincpu;
5351   required_ioport m_io_system;
5452   required_ioport m_io_p1;
5553   required_ioport m_io_p2;
r32779r32780
6462   UINT16 m_ip_select_values[5];
6563   UINT8 m_ignore_oki_status;
6664   UINT16 m_protection_val;
67   int m_bank;
6865   int m_scrollx[3];
6966   int m_scrolly[3];
7067   int m_active_layers;
trunk/src/mame/includes/twin16.h
r32779r32780
77public:
88   twin16_state(const machine_config &mconfig, device_type type, const char *tag)
99      : driver_device(mconfig, type, tag),
10         m_spriteram(*this, "spriteram") ,
11      m_text_ram(*this, "text_ram"),
12      m_videoram(*this, "videoram"),
13      m_tile_gfx_ram(*this, "tile_gfx_ram"),
14      m_sprite_gfx_ram(*this, "sprite_gfx_ram"),
1510      m_maincpu(*this, "maincpu"),
11      m_subcpu(*this, "sub"),
1612      m_audiocpu(*this, "audiocpu"),
17      m_subcpu(*this, "sub"),
1813      m_k007232(*this, "k007232"),
1914      m_upd7759(*this, "upd"),
2015      m_gfxdecode(*this, "gfxdecode"),
2116      m_screen(*this, "screen"),
22      m_palette(*this, "palette") { }
17      m_palette(*this, "palette"),
18      m_spriteram(*this, "spriteram"),
19      m_gfxrombank(*this, "gfxrombank"),
20      m_fixram(*this, "fixram"),
21      m_videoram(*this, "videoram"),
22      m_zipram(*this, "zipram"),
23      m_sprite_gfx_ram(*this, "sprite_gfx_ram"),
24      m_gfxrom(*this, "gfxrom") { }
2325
26   required_device<cpu_device> m_maincpu;
27   optional_device<cpu_device> m_subcpu;
28   required_device<cpu_device> m_audiocpu;
29   required_device<k007232_device> m_k007232;
30   required_device<upd7759_device> m_upd7759;
31   required_device<gfxdecode_device> m_gfxdecode;
32   required_device<screen_device> m_screen;
33   required_device<palette_device> m_palette;
2434   required_device<buffered_spriteram16_device> m_spriteram;
25   required_shared_ptr<UINT16> m_text_ram;
26   required_shared_ptr<UINT16> m_videoram;
27   optional_shared_ptr<UINT16> m_tile_gfx_ram;
35   optional_memory_bank m_gfxrombank;
36   required_shared_ptr<UINT16> m_fixram;
37   required_shared_ptr_array<UINT16, 2> m_videoram;
38   optional_shared_ptr<UINT16> m_zipram;
2839   optional_shared_ptr<UINT16> m_sprite_gfx_ram;
40   required_rom_ptr<UINT16> m_gfxrom;
2941
3042   UINT16 m_CPUA_register;
3143   UINT16 m_CPUB_register;
32   UINT16 m_custom_video;
33   UINT16 *m_gfx_rom;
44   bool m_is_fround;
3445   UINT16 m_sprite_buffer[0x800];
3546   emu_timer *m_sprite_timer;
3647   int m_sprite_busy;
3748   int m_need_process_spriteram;
38   UINT16 m_gfx_bank;
3949   UINT16 m_scrollx[3];
4050   UINT16 m_scrolly[3];
4151   UINT16 m_video_register;
42   tilemap_t *m_text_tilemap;
43   DECLARE_READ16_MEMBER(twin16_gfx_rom1_r);
44   DECLARE_READ16_MEMBER(twin16_gfx_rom2_r);
45   DECLARE_WRITE16_MEMBER(twin16_CPUA_register_w);
46   DECLARE_WRITE16_MEMBER(twin16_CPUB_register_w);
47   DECLARE_WRITE16_MEMBER(fround_CPU_register_w);
48   DECLARE_WRITE16_MEMBER(twin16_text_ram_w);
49   DECLARE_WRITE16_MEMBER(fround_gfx_bank_w);
50   DECLARE_WRITE16_MEMBER(twin16_video_register_w);
51   DECLARE_READ16_MEMBER(twin16_sprite_status_r);
52   DECLARE_READ8_MEMBER(twin16_upd_busy_r);
53   DECLARE_WRITE8_MEMBER(twin16_upd_reset_w);
54   DECLARE_WRITE8_MEMBER(twin16_upd_start_w);
52   tilemap_t *m_fixed_tmap;
53   tilemap_t *m_scroll_tmap[2];
54
55   DECLARE_WRITE16_MEMBER(CPUA_register_w);
56   DECLARE_WRITE16_MEMBER(CPUB_register_w);
57
58   DECLARE_READ16_MEMBER(sprite_status_r);
59   DECLARE_WRITE16_MEMBER(video_register_w);
60   DECLARE_WRITE16_MEMBER(fixram_w);
61   DECLARE_WRITE16_MEMBER(videoram0_w);
62   DECLARE_WRITE16_MEMBER(videoram1_w);
63   DECLARE_WRITE16_MEMBER(zipram_w);
64
65   DECLARE_READ8_MEMBER(upd_busy_r);
66   DECLARE_WRITE8_MEMBER(upd_reset_w);
67   DECLARE_WRITE8_MEMBER(upd_start_w);
68
5569   DECLARE_DRIVER_INIT(twin16);
56   DECLARE_DRIVER_INIT(fround);
57   TILE_GET_INFO_MEMBER(get_text_tile_info);
58   DECLARE_MACHINE_START(twin16);
59   DECLARE_MACHINE_RESET(twin16);
60   DECLARE_VIDEO_START(twin16);
70
71   TILE_GET_INFO_MEMBER(fix_tile_info);
72   TILE_GET_INFO_MEMBER(layer0_tile_info);
73   TILE_GET_INFO_MEMBER(layer1_tile_info);
74
6175   UINT32 screen_update_twin16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6276   void screen_eof_twin16(screen_device &screen, bool state);
6377   INTERRUPT_GEN_MEMBER(CPUA_interrupt);
6478   INTERRUPT_GEN_MEMBER(CPUB_interrupt);
65   TIMER_CALLBACK_MEMBER(twin16_sprite_tick);
66   int twin16_set_sprite_timer(  );
67   void twin16_spriteram_process(  );
79   TIMER_CALLBACK_MEMBER(sprite_tick);
80   int set_sprite_timer(  );
81   void spriteram_process(  );
6882   void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap );
69   void draw_layer( screen_device &screen, bitmap_ind16 &bitmap, int opaque );
70   int twin16_spriteram_process_enable(  );
83   int spriteram_process_enable(  );
7184   DECLARE_WRITE8_MEMBER(volume_callback);
72   required_device<cpu_device> m_maincpu;
73   required_device<cpu_device> m_audiocpu;
74   optional_device<cpu_device> m_subcpu;
75   required_device<k007232_device> m_k007232;
76   required_device<upd7759_device> m_upd7759;
77   required_device<gfxdecode_device> m_gfxdecode;
78   required_device<screen_device> m_screen;
79   required_device<palette_device> m_palette;
85protected:
86   virtual void machine_start();
87   virtual void machine_reset();
88   virtual void video_start();
89
90   virtual void tile_get_info(tile_data &tileinfo, UINT16 data, int color_base);
8091};
8192
93class fround_state : public twin16_state
94{
95public:
96   fround_state(const machine_config &mconfig, device_type type, const char *tag)
97      : twin16_state(mconfig, type, tag)
98   {}
99
100   DECLARE_WRITE16_MEMBER(fround_CPU_register_w);
101   DECLARE_WRITE16_MEMBER(gfx_bank_w);
102   DECLARE_DRIVER_INIT(fround);
103
104protected:
105   virtual void video_start();
106   virtual void tile_get_info(tile_data &tileinfo, UINT16 data, int color_base);
107
108private:
109   UINT8 m_gfx_bank[4];
110};
111
82112class cuebrickj_state : public twin16_state
83113{
84114public:
trunk/src/mame/video/twin16.c
r32779r32780
44
55    TODO:
66
7    - convert background to tilemap
87    - clean up sprite system
98    - bad sprites in devilw, eg. odd colours for the mud/lava monster in the 1st level,
109      or wrong sprite-sprite priority sometimes -- check real arcade first
11    - unsure about some sprite preprocessor attributes (see twin16_spriteram_process)
10    - unsure about some sprite preprocessor attributes (see spriteram_process)
1211
1312*/
1413
r32779r32780
4039};
4140
4241
43WRITE16_MEMBER(twin16_state::twin16_text_ram_w)
42WRITE16_MEMBER(twin16_state::fixram_w)
4443{
45   COMBINE_DATA(&m_text_ram[offset]);
46   m_text_tilemap->mark_tile_dirty(offset);
44   COMBINE_DATA(&m_fixram[offset]);
45   m_fixed_tmap->mark_tile_dirty(offset);
4746}
4847
49WRITE16_MEMBER(twin16_state::fround_gfx_bank_w)
48WRITE16_MEMBER(twin16_state::videoram0_w)
5049{
51   COMBINE_DATA(&m_gfx_bank);
50   COMBINE_DATA(&m_videoram[0][offset]);
51   m_scroll_tmap[0]->mark_tile_dirty(offset);
5252}
5353
54WRITE16_MEMBER(twin16_state::twin16_video_register_w)
54WRITE16_MEMBER(twin16_state::videoram1_w)
5555{
56   int text_flip;
56   COMBINE_DATA(&m_videoram[1][offset]);
57   m_scroll_tmap[1]->mark_tile_dirty(offset);
58}
59
60WRITE16_MEMBER(twin16_state::zipram_w)
61{
62   UINT16 old = m_zipram[offset];
63   COMBINE_DATA(&m_zipram[offset]);
64   if (m_zipram[offset] != old)
65      m_gfxdecode->gfx(1)->mark_dirty(offset / 16);
66}
67
68WRITE16_MEMBER(fround_state::gfx_bank_w)
69{
70   int changed = 0;
71
72   if (ACCESSING_BITS_0_7)
73   {
74      int oldbank0 = m_gfx_bank[0];
75      int oldbank1 = m_gfx_bank[1];
76      m_gfx_bank[0] = (data >> 0) & 0xf;
77      m_gfx_bank[1] = (data >> 4) & 0xf;
78      changed |= (oldbank0 ^ m_gfx_bank[0]) | (oldbank1 ^ m_gfx_bank[1]);
79   }
80   if (ACCESSING_BITS_8_15)
81   {
82      int oldbank2 = m_gfx_bank[2];
83      int oldbank3 = m_gfx_bank[3];
84      m_gfx_bank[2] = (data >> 8) & 0xf;
85      m_gfx_bank[3] = (data >> 12) & 0xf;
86      changed |= (oldbank2 ^ m_gfx_bank[2]) | (oldbank3 ^ m_gfx_bank[3]);
87   }
88   if (changed)
89   {
90      m_scroll_tmap[0]->mark_all_dirty();
91      m_scroll_tmap[1]->mark_all_dirty();
92   }
93}
94
95WRITE16_MEMBER(twin16_state::video_register_w)
96{
5797   switch (offset)
5898   {
5999      case 0:
100      {
101         int old = m_video_register;
60102         COMBINE_DATA( &m_video_register );
61         text_flip  = (m_video_register&TWIN16_SCREEN_FLIPX) ? TILEMAP_FLIPX : 0;
62         text_flip |= (m_video_register&TWIN16_SCREEN_FLIPY) ? TILEMAP_FLIPY : 0;
63         m_text_tilemap->set_flip(text_flip);
103         int changed = old ^ m_video_register;
104         if (changed & (TWIN16_SCREEN_FLIPX | TWIN16_SCREEN_FLIPY))
105         {
106            int flip = (m_video_register&TWIN16_SCREEN_FLIPX) ? TILEMAP_FLIPX : 0;
107            flip |= (m_video_register&TWIN16_SCREEN_FLIPY) ? TILEMAP_FLIPY : 0;
108            machine().tilemap().set_flip_all(flip);
109         }
110         if (changed & (TWIN16_TILE_FLIPX | TWIN16_TILE_FLIPY))
111         {
112            m_scroll_tmap[0]->mark_all_dirty();
113            m_scroll_tmap[1]->mark_all_dirty();
114         }
64115         break;
116      }
65117
66118      case 1: COMBINE_DATA( &m_scrollx[0] ); break;
67119      case 2: COMBINE_DATA( &m_scrolly[0] ); break;
68      case 3: COMBINE_DATA( &m_scrollx[1] ); break;
69      case 4: COMBINE_DATA( &m_scrolly[1] ); break;
70      case 5: COMBINE_DATA( &m_scrollx[2] ); break;
71      case 6: COMBINE_DATA( &m_scrolly[2] ); break;
120      case 3:
121         COMBINE_DATA( &m_scrollx[1] );
122         m_scroll_tmap[0]->set_scrollx(0, m_scrollx[1]);
123         break;
124      case 4:
125         COMBINE_DATA( &m_scrolly[1] );
126         m_scroll_tmap[0]->set_scrolly(0, m_scrolly[1]);
127         break;
128      case 5:
129         COMBINE_DATA( &m_scrollx[2] );
130         m_scroll_tmap[1]->set_scrollx(0, m_scrollx[2]);
131         break;
132      case 6:
133         COMBINE_DATA( &m_scrolly[2] );
134         m_scroll_tmap[1]->set_scrolly(0, m_scrolly[2]);
135         break;
72136
73137      default:
74138         logerror("unknown video_register write:%d", data );
r32779r32780
122186 *   3  | ------------xxxx | color
123187 */
124188
125READ16_MEMBER(twin16_state::twin16_sprite_status_r)
189READ16_MEMBER(twin16_state::sprite_status_r)
126190{
127191   // bit 0: busy, other bits: dunno
128192   return m_sprite_busy;
129193}
130194
131TIMER_CALLBACK_MEMBER(twin16_state::twin16_sprite_tick)
195TIMER_CALLBACK_MEMBER(twin16_state::sprite_tick)
132196{
133197   m_sprite_busy = 0;
134198}
135199
136int twin16_state::twin16_set_sprite_timer(  )
200int twin16_state::set_sprite_timer(  )
137201{
138202   if (m_sprite_busy) return 1;
139203
r32779r32780
144208   return 0;
145209}
146210
147void twin16_state::twin16_spriteram_process(  )
211void twin16_state::spriteram_process(  )
148212{
149213   UINT16 *spriteram16 = m_spriteram->live();
150214   UINT16 dx = m_scrollx[0];
r32779r32780
153217   const UINT16 *source = &spriteram16[0x0000];
154218   const UINT16 *finish = &spriteram16[0x1800];
155219
156   twin16_set_sprite_timer();
220   set_sprite_timer();
157221   memset(&spriteram16[0x1800],0xff,0x800*sizeof(UINT16));
158222
159223   while( source<finish )
r32779r32780
229293         int flipx = attributes&0x0100;
230294         int priority = (attributes&0x4000)?TWIN16_SPRITE_PRI_L1:TWIN16_SPRITE_PRI_L2;
231295
232         if( m_custom_video ) {
296         if( m_is_fround ) {
233297            /* fround board */
234            pen_data = m_gfx_rom + 0x80000;
298            pen_data = m_gfxrom;
235299         }
236300         else
237301         {
r32779r32780
239303            {
240304               /* bank select */
241305               case 0:
242                  pen_data = m_gfx_rom;
306                  pen_data = m_gfxrom;
243307                  break;
244308
245309               case 1:
246                  pen_data = m_gfx_rom + 0x40000;
310                  pen_data = m_gfxrom + 0x40000;
247311                  break;
248312
249313               case 2:
250                  pen_data = m_gfx_rom + 0x80000;
314                  pen_data = m_gfxrom + 0x80000;
251315                  if( code&0x4000 ) pen_data += 0x40000;
252316                  break;
253317
r32779r32780
326390}
327391
328392
329
330void twin16_state::draw_layer( screen_device &screen, bitmap_ind16 &bitmap, int opaque )
393TILE_GET_INFO_MEMBER(twin16_state::fix_tile_info)
331394{
332   UINT16 *videoram = m_videoram;
333   const UINT16 *gfx_base;
334   const UINT16 *source = videoram;
335   int i, xxor, yxor;
336   int bank_table[4];
337   int dx, dy, palette;
338   int tile_flipx = m_video_register&TWIN16_TILE_FLIPX;
339   int tile_flipy = m_video_register&TWIN16_TILE_FLIPY;
340
341   if( ((m_video_register&TWIN16_PLANE_ORDER)?1:0) != opaque ) {
342      source += 0x1000;
343      dx = m_scrollx[2];
344      dy = m_scrolly[2];
345      palette = 1;
346   }
347   else {
348      source += 0x0000;
349      dx = m_scrollx[1];
350      dy = m_scrolly[1];
351      palette = 0;
352   }
353
354   if( m_custom_video ) {
355      /* fround board */
356      gfx_base = m_gfx_rom;
357      bank_table[3] = (m_gfx_bank>>(4*3))&0xf;
358      bank_table[2] = (m_gfx_bank>>(4*2))&0xf;
359      bank_table[1] = (m_gfx_bank>>(4*1))&0xf;
360      bank_table[0] = (m_gfx_bank>>(4*0))&0xf;
361   }
362   else {
363      gfx_base = m_tile_gfx_ram;
364      bank_table[0] = 0;
365      bank_table[1] = 1;
366      bank_table[2] = 2;
367      bank_table[3] = 3;
368   }
369
370   if( m_video_register&TWIN16_SCREEN_FLIPX )
371   {
372      dx = 256-dx-64;
373      tile_flipx = !tile_flipx;
374   }
375
376   if( m_video_register&TWIN16_SCREEN_FLIPY )
377   {
378      dy = 256-dy;
379      tile_flipy = !tile_flipy;
380   }
381
382   xxor = tile_flipx ? 7 : 0;
383   yxor = tile_flipy ? 7 : 0;
384
385   for( i=0; i<64*64; i++ )
386   {
387      int y1, y2, x1, x2;
388      int sx = (i%64)*8;
389      int sy = (i/64)*8;
390      int xpos,ypos;
391
392      if( m_video_register&TWIN16_SCREEN_FLIPX ) sx = 63*8 - sx;
393      if( m_video_register&TWIN16_SCREEN_FLIPY ) sy = 63*8 - sy;
394
395      xpos = (sx-dx)&0x1ff;
396      ypos = (sy-dy)&0x1ff;
397      if( xpos>=320 ) xpos -= 512;
398      if( ypos>=256 ) ypos -= 512;
399
400      x1 = MAX(xpos, 0);
401      x2 = MIN(xpos+7, bitmap.width()-1);
402      y1 = MAX(ypos, 0);
403      y2 = MIN(ypos+7, bitmap.height()-1);
404
405      if (x1 <= x2 && y1 <= y2)
406      {
407         int code = source[i];
408         /* fedcba9876543210
409            xxx------------- color
410            ---xx----------- tile bank
411            -----xxxxxxxxxxx tile number
412         */
413         const UINT16 *gfx_data = gfx_base + (code&0x7ff)*16 + bank_table[(code>>11)&0x3]*0x8000;
414         int color = (code>>13);
415         int pal_base = 16*(0x20+color+8*palette);
416         int x, y;
417
418         if( opaque )
419         {
420            for (y = y1; y <= y2; y++)
421            {
422               const UINT16 *gfxptr = gfx_data + ((y - ypos) ^ yxor) * 2;
423               UINT16 *dest = &bitmap.pix16(y);
424               UINT8 *pdest = &screen.priority().pix8(y);
425
426               for (x = x1; x <= x2; x++)
427               {
428                  int effx = (x - xpos) ^ xxor;
429                  UINT16 data = gfxptr[effx / 4];
430                  dest[x] = pal_base + ((data >> 4*(~effx & 3)) & 0x0f);
431                  pdest[x] |= TWIN16_BG_LAYER1;
432               }
433            }
434         }
435         else
436         {
437            for (y = y1; y <= y2; y++)
438            {
439               const UINT16 *gfxptr = gfx_data + ((y - ypos) ^ yxor) * 2;
440               UINT16 *dest = &bitmap.pix16(y);
441               UINT8 *pdest = &screen.priority().pix8(y);
442
443               for (x = x1; x <= x2; x++)
444               {
445                  int effx = (x - xpos) ^ xxor;
446                  UINT16 data = gfxptr[effx / 4];
447                  UINT8 pen = (data >> 4*(~effx & 3)) & 0x0f;
448                  if (pen)
449                  {
450                     dest[x] = pal_base + pen;
451                     pdest[x] |= TWIN16_BG_LAYER2;
452                  }
453               }
454            }
455         }
456      }
457   }
458}
459
460TILE_GET_INFO_MEMBER(twin16_state::get_text_tile_info)
461{
462   const UINT16 *source = m_text_ram;
463   int attr = source[tile_index];
395   int attr = m_fixram[tile_index];
464396   /* fedcba9876543210
465397      -x-------------- yflip
466398      --x------------- xflip
r32779r32780
477409   SET_TILE_INFO_MEMBER(0, code, color, flags);
478410}
479411
480VIDEO_START_MEMBER(twin16_state,twin16)
412void twin16_state::tile_get_info(tile_data &tileinfo, UINT16 data, int color_base)
481413{
482   m_gfx_rom = (UINT16 *)memregion("gfx2")->base();
414   /* fedcba9876543210
415      xxx------------- color
416      ---xxxxxxxxxxxxx tile number
417   */
418   int code = (data & 0x1fff);
419   int color = color_base + (data >> 13);
420   int flags = 0;
421   if (m_video_register & TWIN16_TILE_FLIPX) flags |= TILE_FLIPX;
422   if (m_video_register & TWIN16_TILE_FLIPY) flags |= TILE_FLIPY;
423   SET_TILE_INFO_MEMBER(1, code, color, flags);
424}
483425
484   m_text_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(twin16_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
485   m_text_tilemap->set_transparent_pen(0);
426void fround_state::tile_get_info(tile_data &tileinfo, UINT16 data, int color_base)
427{
428   /* fedcba9876543210
429      xxx------------- color
430      ---xx----------- tile bank
431      -----xxxxxxxxxxx tile number
432   */
433   int bank = (data >> 11) & 3;
434   int code = (m_gfx_bank[bank] << 11) | (data & 0x7ff);
435   int color = color_base | (data >> 13);
436   int flags = 0;
437   if (m_video_register & TWIN16_TILE_FLIPX) flags |= TILE_FLIPX;
438   if (m_video_register & TWIN16_TILE_FLIPY) flags |= TILE_FLIPY;
439   SET_TILE_INFO_MEMBER(1, code, color, flags);
440}
486441
442TILE_GET_INFO_MEMBER(twin16_state::layer0_tile_info)
443{
444   tile_get_info(tileinfo, m_videoram[0][tile_index], 0);
445}
446
447TILE_GET_INFO_MEMBER(twin16_state::layer1_tile_info)
448{
449   tile_get_info(tileinfo, m_videoram[1][tile_index], 8);
450}
451
452void twin16_state::video_start()
453{
454   m_fixed_tmap = &machine().tilemap().create(m_gfxdecode,tilemap_get_info_delegate(FUNC(twin16_state::fix_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
455   m_scroll_tmap[0] = &machine().tilemap().create(m_gfxdecode,tilemap_get_info_delegate(FUNC(twin16_state::layer0_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
456   m_scroll_tmap[1] = &machine().tilemap().create(m_gfxdecode,tilemap_get_info_delegate(FUNC(twin16_state::layer1_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
457
458   m_fixed_tmap->set_transparent_pen(0);
459   m_scroll_tmap[0]->set_transparent_pen(0);
460   m_scroll_tmap[1]->set_transparent_pen(0);
461
487462   m_palette->set_shadow_factor(0.4); // screenshots estimate
488463
489464   memset(m_sprite_buffer,0xff,0x800*sizeof(UINT16));
465   m_video_register = 0;
490466   m_sprite_busy = 0;
491   m_sprite_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(twin16_state::twin16_sprite_tick),this));
467   m_sprite_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(twin16_state::sprite_tick),this));
492468   m_sprite_timer->adjust(attotime::never);
493469
494470   /* register for savestates */
r32779r32780
497473   save_item(NAME(m_scrolly));
498474
499475   save_item(NAME(m_need_process_spriteram));
500   save_item(NAME(m_gfx_bank));
501476   save_item(NAME(m_video_register));
502477   save_item(NAME(m_sprite_busy));
503478}
504479
480void fround_state::video_start()
481{
482   twin16_state::video_start();
483   save_item(NAME(m_gfx_bank));
484}
485
505486UINT32 twin16_state::screen_update_twin16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
506487{
507   screen.priority().fill(0, cliprect);
508   draw_layer( screen, bitmap, 1 );
509   draw_layer( screen, bitmap, 0 );
488   int layer = m_video_register & TWIN16_PLANE_ORDER ? 0 : 1;
489
490   m_scroll_tmap[layer]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, TWIN16_BG_LAYER1, 0);
491   m_scroll_tmap[layer^1]->draw(screen, bitmap, cliprect, 0, TWIN16_BG_LAYER2);
492
510493   draw_sprites( screen, bitmap );
511494
512   m_text_tilemap->draw(screen, bitmap, cliprect, 0, 0);
495   m_fixed_tmap->draw(screen, bitmap, cliprect, 0);
513496   return 0;
514497}
515498
r32779r32780
518501   // rising edge
519502   if (state)
520503   {
521      twin16_set_sprite_timer();
504      set_sprite_timer();
522505
523      if (twin16_spriteram_process_enable()) {
524         if (m_need_process_spriteram) twin16_spriteram_process();
506      if (spriteram_process_enable()) {
507         if (m_need_process_spriteram) spriteram_process();
525508         m_need_process_spriteram = 1;
526509
527510         /* if the sprite preprocessor is used, sprite ram is copied to an external buffer first,
trunk/src/mame/drivers/megasys1.c
r32779r32780
312312   AM_RANGE(0x1f0000, 0x1fffff) AM_RAM AM_SHARE("ram")
313313ADDRESS_MAP_END
314314
315static ADDRESS_MAP_START( megasys1D_oki_map, AS_0, 8, megasys1_state )
316   AM_RANGE(0x00000, 0x1ffff) AM_ROM
317   AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("okibank")
318ADDRESS_MAP_END
315319
316320/*************************************
317321 *
r32779r32780
13821386   COMBINE_DATA(&m_protection_val);
13831387
13841388   if ((m_protection_val & 0x90) == 0x90)
1385   {
1386      UINT8 *RAM = m_region_oki1->base();
1387      int new_bank = (m_protection_val & 0x7) % 7;
1389      membank("okibank")->set_entry(m_protection_val & 7);
13881390
1389      if (m_bank != new_bank)
1390      {
1391         memcpy(&RAM[0x20000],&RAM[0x40000 + 0x20000*new_bank],0x20000);
1392         m_bank = new_bank;
1393      }
1394   }
1395
13961391   m_maincpu->set_input_line(4, HOLD_LINE);
13971392}
13981393
r32779r32780
16211616   MCFG_SPEAKER_STANDARD_MONO("mono")
16221617
16231618   MCFG_OKIM6295_ADD("oki1", SYS_D_CPU_CLOCK/4, OKIM6295_PIN7_HIGH)    /* 2MHz (8MHz / 4) */
1619   MCFG_DEVICE_ADDRESS_MAP(AS_0, megasys1D_oki_map)
16241620   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16251621MACHINE_CONFIG_END
16261622
r32779r32780
31453141   ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
31463142   ROM_LOAD( "1",       0x000000, 0x080000, CRC(5a444ecf) SHA1(38a7a6e91d0635a7f82a1c9a04efe1586ed3d856) )
31473143
3148   ROM_REGION( 0x120000, "oki1", 0 )       /* Samples */
3149   ROM_LOAD( "peeksamp.124", 0x000000, 0x020000, CRC(e1206fa8) SHA1(339d5a4fa2af7fb4ab2e9c6c66f4848fa8774832) )
3150   ROM_CONTINUE(             0x040000, 0x0e0000 )
3144   ROM_REGION( 0x100000, "oki1", 0 )       /* Samples */
3145   ROM_LOAD( "peeksamp.124", 0x000000, 0x100000, CRC(e1206fa8) SHA1(339d5a4fa2af7fb4ab2e9c6c66f4848fa8774832) )
31513146
31523147   ROM_REGION( 0x0200, "proms", 0 )        /* Priority PROM */
31533148   ROM_LOAD( "priority.69",    0x000000, 0x200, CRC(b40bff56) SHA1(39c95eed79328ef2df754988db83e07909e848f8) )
r32779r32780
31733168   ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
31743169   ROM_LOAD( "1",       0x000000, 0x080000, CRC(5a444ecf) SHA1(38a7a6e91d0635a7f82a1c9a04efe1586ed3d856) )
31753170
3176   ROM_REGION( 0x120000, "oki1", 0 )       /* Samples */
3177   ROM_LOAD( "peeksamp.124", 0x000000, 0x020000, CRC(e1206fa8) SHA1(339d5a4fa2af7fb4ab2e9c6c66f4848fa8774832) )
3178   ROM_CONTINUE(             0x040000, 0x0e0000 )
3171   ROM_REGION( 0x100000, "oki1", 0 )       /* Samples */
3172   ROM_LOAD( "peeksamp.124", 0x000000, 0x100000, CRC(e1206fa8) SHA1(339d5a4fa2af7fb4ab2e9c6c66f4848fa8774832) )
31793173
31803174   ROM_REGION( 0x0200, "proms", 0 )        /* Priority PROM */
31813175   ROM_LOAD( "priority.69",    0x000000, 0x200, CRC(b40bff56) SHA1(39c95eed79328ef2df754988db83e07909e848f8) )
r32779r32780
37933787
37943788READ16_MEMBER(megasys1_state::megasys1A_mcu_hs_r)
37953789{
3796   UINT16 *ROM  = (UINT16 *) m_region_maincpu->base();
3797
37983790   if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
37993791   {
38003792      if(MCU_HS_LOG && !space.debugger_access())
r32779r32780
38033795      return 0x889e;
38043796   }
38053797
3806   return ROM[offset];
3798   return m_rom_maincpu[offset];
38073799}
38083800
38093801WRITE16_MEMBER(megasys1_state::megasys1A_mcu_hs_w)
r32779r32780
39223914
39233915READ16_MEMBER(megasys1_state::iganinju_mcu_hs_r)
39243916{
3925   UINT16 *ROM  = (UINT16 *) m_region_maincpu->base();
3926
39273917   if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
39283918   {
39293919      if(MCU_HS_LOG && !space.debugger_access())
r32779r32780
39323922      return 0x835d;
39333923   }
39343924
3935   return ROM[offset];
3925   return m_rom_maincpu[offset];
39363926}
39373927
39383928WRITE16_MEMBER(megasys1_state::iganinju_mcu_hs_w)
r32779r32780
39573947
39583948DRIVER_INIT_MEMBER(megasys1_state,iganinju)
39593949{
3960   //UINT16 *ROM;
3961
39623950   phantasm_rom_decode(machine(), "maincpu");
39633951
3964   //ROM  = (UINT16 *) m_region_maincpu->base();
39653952   m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_r),this));
39663953   m_maincpu->space(AS_PROGRAM).install_write_handler(0x2f000, 0x2f009, write16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_w),this));
39673954
3968   //ROM[0x00006e/2] = 0x0420; // the only game that does
3969                        // not like lev 3 interrupts
3955   //m_rom_maincpu[0x00006e/2] = 0x0420; // the only game that does
3956                              // not like lev 3 interrupts
39703957}
39713958
3959// jitsupro writes oki commands to both the lsb and msb; it works because of byte smearing
39723960WRITE16_MEMBER(megasys1_state::okim6295_both_1_w)
39733961{
3974   if (ACCESSING_BITS_0_7) m_oki1->write_command((data >> 0) & 0xff );
3975   else                    m_oki1->write_command((data >> 8) & 0xff );
3962   m_oki1->write_command(data & 0xff);
39763963}
39773964WRITE16_MEMBER(megasys1_state::okim6295_both_2_w)
39783965{
3979   if (ACCESSING_BITS_0_7) m_oki2->write_command((data >> 0) & 0xff );
3980   else                    m_oki2->write_command((data >> 8) & 0xff );
3966   m_oki2->write_command(data & 0xff);
39813967}
39823968
39833969DRIVER_INIT_MEMBER(megasys1_state,jitsupro)
39843970{
3985   //UINT16 *ROM  = (UINT16 *) m_region_maincpu->base();
3986
39873971   astyanax_rom_decode(machine(), "maincpu");      // Code
39883972
39893973   jitsupro_gfx_unmangle("gfx1");   // Gfx
r32779r32780
39913975   m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_r),this));
39923976   m_maincpu->space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_w),this));
39933977
3994   /* the sound code writes oki commands to both the lsb and msb */
39953978   m_audiocpu->space(AS_PROGRAM).install_write_handler(0xa0000, 0xa0003, write16_delegate(FUNC(megasys1_state::okim6295_both_1_w),this));
39963979   m_audiocpu->space(AS_PROGRAM).install_write_handler(0xc0000, 0xc0003, write16_delegate(FUNC(megasys1_state::okim6295_both_2_w),this));
39973980}
39983981
39993982DRIVER_INIT_MEMBER(megasys1_state,peekaboo)
40003983{
3984   UINT8 *ROM = memregion("oki1")->base();
3985   memory_bank *okibank = membank("okibank");
3986
3987   okibank->configure_entry(7, &ROM[0x20000]);
3988   okibank->configure_entries(0, 7, &ROM[0x20000], 0x20000);
3989
40013990   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x100000, 0x100001, read16_delegate(FUNC(megasys1_state::protection_peekaboo_r),this), write16_delegate(FUNC(megasys1_state::protection_peekaboo_w),this));
40023991}
40033992
r32779r32780
40464035
40474036READ16_MEMBER(megasys1_state::stdragon_mcu_hs_r)
40484037{
4049   UINT16 *ROM  = (UINT16 *) m_region_maincpu->base();
4050
40514038   if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
40524039   {
40534040      if(MCU_HS_LOG && !space.debugger_access())
r32779r32780
40564043      return 0x835d;
40574044   }
40584045
4059   return ROM[offset];
4046   return m_rom_maincpu[offset];
40604047}
40614048
40624049WRITE16_MEMBER(megasys1_state::stdragon_mcu_hs_w)
r32779r32780
41144101{
41154102   DRIVER_INIT_CALL(avspirit);
41164103
4117   UINT16 *ROM = (UINT16*)m_region_maincpu->base();
4118   ROM[0x00744/2] = 0x4e71; // weird check, 0xe000e R is a port-based trap?
4104   m_rom_maincpu[0x00744/2] = 0x4e71; // weird check, 0xe000e R is a port-based trap?
41194105
41204106   m_maincpu->space(AS_PROGRAM).install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::monkelf_input_r),this));
41214107}
trunk/src/mame/drivers/twin16.c
r32779r32780
5959
6060
6161
62int twin16_state::twin16_spriteram_process_enable(  )
62int twin16_state::spriteram_process_enable(  )
6363{
6464   return (m_CPUA_register & 0x40) == 0;
6565}
r32779r32780
6868
6969/* Read/Write Handlers */
7070
71READ16_MEMBER(twin16_state::twin16_gfx_rom1_r)
71WRITE16_MEMBER(twin16_state::CPUA_register_w)
7272{
73   return m_gfx_rom[offset + ((m_CPUB_register&0x04)?0x40000:0)];
74}
75
76READ16_MEMBER(twin16_state::twin16_gfx_rom2_r)
77{
78   return m_gfx_rom[offset + 0x80000 + ((m_CPUB_register&0x04)?0x40000:0)];
79}
80
81WRITE16_MEMBER(twin16_state::twin16_CPUA_register_w)
82{
8373   /*
8474   7   6   5   4   3   2   1   0
8575       X                           sprite processing disable
r32779r32780
8878                   X               0->1 trigger IRQ on sound CPU
8979                       x   x   x   coin counters
9080   */
91   UINT16 old = m_CPUA_register;
81   int old = m_CPUA_register;
9282   COMBINE_DATA(&m_CPUA_register);
83
9384   if (m_CPUA_register != old)
9485   {
95      if ((old & 0x08) == 0 && (m_CPUA_register & 0x08))
86      int rising_edge = ~old & m_CPUA_register;
87      int falling_edge = old & ~m_CPUA_register;
88     
89      if (rising_edge & 0x08)
9690         m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
9791
98      if ((old & 0x40) && (m_CPUA_register & 0x40) == 0)
99         twin16_spriteram_process();
92      if (falling_edge & 0x40)
93         spriteram_process();
10094
101      if ((old & 0x10) == 0 && (m_CPUA_register & 0x10))
95      if (rising_edge & 0x10)
10296         m_subcpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
10397
10498      coin_counter_w(machine(), 0, m_CPUA_register & 0x01);
r32779r32780
107101   }
108102}
109103
110WRITE16_MEMBER(twin16_state::twin16_CPUB_register_w)
104WRITE16_MEMBER(twin16_state::CPUB_register_w)
111105{
112106   /*
113107   7   6   5   4   3   2   1   0
r32779r32780
115109                           X       IRQ5 enable
116110                               X   0->1 trigger IRQ6 on CPUA
117111   */
118   UINT16 old = m_CPUB_register;
112   int old = m_CPUB_register;
119113   COMBINE_DATA(&m_CPUB_register);
120   if( m_CPUB_register!=old )
114
115   if (m_CPUB_register != old)
121116   {
122      if ((old & 0x01) == 0 && (m_CPUB_register & 0x01))
117      int rising_edge = ~old & m_CPUB_register;
118      if (rising_edge & 0x01)
123119         m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
120
121      m_gfxrombank->set_entry(BIT(m_CPUB_register, 2));
124122   }
125123}
126124
127WRITE16_MEMBER(twin16_state::fround_CPU_register_w)
125WRITE16_MEMBER(fround_state::fround_CPU_register_w)
128126{
129127   /*
130128   7   6   5   4   3   2   1   0
129           X                       IRQ5 enable
131130                   X               0->1 trigger IRQ on sound CPU
132131                           x   x   coin counters
133132   */
r32779r32780
143142   }
144143}
145144
146READ8_MEMBER(twin16_state::twin16_upd_busy_r)
145READ8_MEMBER(twin16_state::upd_busy_r)
147146{
148147   return m_upd7759->busy_r();
149148}
150149
151WRITE8_MEMBER(twin16_state::twin16_upd_reset_w)
150WRITE8_MEMBER(twin16_state::upd_reset_w)
152151{
153152   m_upd7759->reset_w(data & 2);
154153}
155154
156WRITE8_MEMBER(twin16_state::twin16_upd_start_w)
155WRITE8_MEMBER(twin16_state::upd_start_w)
157156{
158157   m_upd7759->start_w(data & 1);
159158}
r32779r32780
163162static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, twin16_state )
164163   AM_RANGE(0x0000, 0x7fff) AM_ROM
165164   AM_RANGE(0x8000, 0x87ff) AM_RAM
166   AM_RANGE(0x9000, 0x9000) AM_WRITE(twin16_upd_reset_w)
165   AM_RANGE(0x9000, 0x9000) AM_WRITE(upd_reset_w)
167166   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
168167   AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
169168   AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
170169   AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("upd", upd7759_device, port_w)
171   AM_RANGE(0xe000, 0xe000) AM_WRITE(twin16_upd_start_w)
172   AM_RANGE(0xf000, 0xf000) AM_READ(twin16_upd_busy_r) // miaj writes 0 to it
170   AM_RANGE(0xe000, 0xe000) AM_WRITE(upd_start_w)
171   AM_RANGE(0xf000, 0xf000) AM_READ(upd_busy_r) // miaj writes 0 to it
173172   ADDRESS_MAP_END
174173
175174static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, twin16_state )
r32779r32780
179178   AM_RANGE(0x060000, 0x063fff) AM_RAM
180179   AM_RANGE(0x080000, 0x080fff) AM_DEVREADWRITE8("palette", palette_device, read, write, 0x00ff) AM_SHARE("palette")
181180   AM_RANGE(0x081000, 0x081fff) AM_WRITENOP
182   AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("SYSTEM") AM_WRITE(twin16_CPUA_register_w)
181   AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("SYSTEM") AM_WRITE(CPUA_register_w)
183182   AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
184183   AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
185184   AM_RANGE(0x0a0006, 0x0a0007) AM_READ_PORT("P3")
r32779r32780
187186   AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
188187   AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
189188   AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
190   AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(twin16_video_register_w)
191   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
192   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(twin16_text_ram_w) AM_SHARE("text_ram")
189   AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(video_register_w)
190   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(sprite_status_r)
191   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(fixram_w) AM_SHARE("fixram")
193192//  AM_RANGE(0x104000, 0x105fff) AM_NOP             // miaj
194   AM_RANGE(0x120000, 0x123fff) AM_RAM AM_SHARE("videoram")
193   AM_RANGE(0x120000, 0x121fff) AM_RAM_WRITE(videoram0_w) AM_SHARE("videoram.0")
194   AM_RANGE(0x122000, 0x123fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram.1")
195195   AM_RANGE(0x140000, 0x143fff) AM_RAM AM_SHARE("spriteram")
196196ADDRESS_MAP_END
197197
r32779r32780
200200   AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("comram")
201201//  AM_RANGE(0x044000, 0x04ffff) AM_NOP             // miaj
202202   AM_RANGE(0x060000, 0x063fff) AM_RAM
203   AM_RANGE(0x080000, 0x09ffff) AM_ROM AM_REGION("gfx3", 0)
204   AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(twin16_CPUB_register_w)
203   AM_RANGE(0x080000, 0x09ffff) AM_ROM AM_REGION("data", 0)
204   AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(CPUB_register_w)
205205   AM_RANGE(0x400000, 0x403fff) AM_RAM AM_SHARE("spriteram")
206   AM_RANGE(0x480000, 0x483fff) AM_RAM AM_SHARE("videoram")
207   AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_SHARE("tile_gfx_ram")
208   AM_RANGE(0x600000, 0x6fffff) AM_READ(twin16_gfx_rom1_r)
209   AM_RANGE(0x700000, 0x77ffff) AM_READ(twin16_gfx_rom2_r)
206   AM_RANGE(0x480000, 0x481fff) AM_RAM_WRITE(videoram0_w) AM_SHARE("videoram.0")
207   AM_RANGE(0x482000, 0x483fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram.1")
208   AM_RANGE(0x500000, 0x53ffff) AM_RAM_WRITE(zipram_w) AM_SHARE("zipram")
209   AM_RANGE(0x600000, 0x6fffff) AM_ROM AM_REGION("gfxrom", 0)
210   AM_RANGE(0x700000, 0x77ffff) AM_ROMBANK("gfxrombank")
210211   AM_RANGE(0x780000, 0x79ffff) AM_RAM AM_SHARE("sprite_gfx_ram")
211212ADDRESS_MAP_END
212213
213static ADDRESS_MAP_START( fround_map, AS_PROGRAM, 16, twin16_state )
214static ADDRESS_MAP_START( fround_map, AS_PROGRAM, 16, fround_state )
214215   AM_RANGE(0x000000, 0x03ffff) AM_ROM
215216   AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("comram")
216217   AM_RANGE(0x060000, 0x063fff) AM_RAM
r32779r32780
222223   AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
223224   AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
224225   AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
225   AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(twin16_video_register_w)
226   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
227   AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(fround_gfx_bank_w)
228   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(twin16_text_ram_w) AM_SHARE("text_ram")
229   AM_RANGE(0x120000, 0x123fff) AM_RAM AM_SHARE("videoram")
226   AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(video_register_w)
227   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(sprite_status_r)
228   AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(gfx_bank_w)
229   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(fixram_w) AM_SHARE("fixram")
230   AM_RANGE(0x120000, 0x121fff) AM_RAM_WRITE(videoram0_w) AM_SHARE("videoram.0")
231   AM_RANGE(0x122000, 0x123fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram.1")
230232   AM_RANGE(0x140000, 0x143fff) AM_RAM AM_SHARE("spriteram")
231   AM_RANGE(0x500000, 0x6fffff) AM_ROM AM_REGION("gfx2", 0)
233   AM_RANGE(0x500000, 0x5fffff) AM_ROM AM_REGION("tiles", 0)
234   AM_RANGE(0x600000, 0x6fffff) AM_ROM AM_REGION("gfxrom", 0)
232235ADDRESS_MAP_END
233236
234237/* Input Ports */
r32779r32780
595598
596599/* Graphics Layouts */
597600
598static const gfx_layout alpha_layout =
601static const gfx_layout tile_layout =
599602{
600603   8,8,
601   0x200,
604   RGN_FRAC(1,1),
602605   4,
603606   { 0,1,2,3 },
604   { 0*4,1*4,2*4,3*4,4*4,5*4,6*4,7*4 },
605   { 0*32,1*32,2*32,3*32,4*32,5*32,6*32,7*32 },
606   8*32
607   { STEP8(0, 4) },
608   { STEP8(0, 4*8) },
609   4*8*8
607610};
608611
609612/* Graphics Decode Info */
610613
611614static GFXDECODE_START( twin16 )
612   GFXDECODE_ENTRY( "gfx1", 0x00000, alpha_layout, 0, 16 )
615   GFXDECODE_ENTRY( "fixed", 0, tile_layout,   0, 16 )
616   GFXDECODE_RAM(  "zipram", 0, tile_layout, 512, 16 )
613617GFXDECODE_END
614618
619static GFXDECODE_START( fround )
620   GFXDECODE_ENTRY( "fixed", 0, tile_layout,   0, 16 )
621   GFXDECODE_ENTRY( "tiles", 0, tile_layout, 512, 16 )
622GFXDECODE_END
623
615624/* Sound Interfaces */
616625
617626WRITE8_MEMBER(twin16_state::volume_callback)
r32779r32780
634643
635644/* Machine Drivers */
636645
637MACHINE_RESET_MEMBER(twin16_state,twin16)
646void twin16_state::machine_reset()
638647{
639648   m_CPUA_register = 0;
640649   m_CPUB_register = 0;
641650}
642651
643MACHINE_START_MEMBER(twin16_state,twin16)
652void twin16_state::machine_start()
644653{
645654   /* register for savestates */
646655   save_item(NAME(m_CPUA_register));
r32779r32780
651660   // basic machine hardware
652661   MCFG_CPU_ADD("maincpu", M68000, XTAL_18_432MHz/2)
653662   MCFG_CPU_PROGRAM_MAP(main_map)
654   MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
663   MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
655664
656665   MCFG_CPU_ADD("sub", M68000, XTAL_18_432MHz/2)
657666   MCFG_CPU_PROGRAM_MAP(sub_map)
658   MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUB_interrupt)
667   MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUB_interrupt)
659668
660669   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
661670   MCFG_CPU_PROGRAM_MAP(sound_map)
662671
663672   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
664673
665   MCFG_MACHINE_START_OVERRIDE(twin16_state,twin16)
666   MCFG_MACHINE_RESET_OVERRIDE(twin16_state,twin16)
667
668674   // video hardware
669675   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
670676
r32779r32780
676682
677683   MCFG_GFXDECODE_ADD("gfxdecode", "palette", twin16)
678684
679   MCFG_PALETTE_ADD("palette", 0x400)
685   MCFG_PALETTE_ADD("palette", 1024)
680686   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
681687   MCFG_PALETTE_MEMBITS(8)
682688   MCFG_PALETTE_ENABLE_SHADOWS()
683689
684   MCFG_VIDEO_START_OVERRIDE(twin16_state,twin16)
685
686690   // sound hardware
687691   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
688692
r32779r32780
706710   MCFG_QUANTUM_TIME(attotime::from_hz(60000)) // watchdog reset otherwise
707711MACHINE_CONFIG_END
708712
709static MACHINE_CONFIG_START( fround, twin16_state )
713static MACHINE_CONFIG_START( fround, fround_state )
710714   /* basic machine hardware */
711715   MCFG_CPU_ADD("maincpu", M68000, XTAL_18_432MHz/2)
712716   MCFG_CPU_PROGRAM_MAP(fround_map)
713   MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
717   MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
714718
715719   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
716720   MCFG_CPU_PROGRAM_MAP(sound_map)
717721
718722   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
719723
720   MCFG_MACHINE_START_OVERRIDE(twin16_state,twin16)
721   MCFG_MACHINE_RESET_OVERRIDE(twin16_state,twin16)
722
723724   /* video hardware */
724725   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
725726
r32779r32780
729730   MCFG_SCREEN_VBLANK_DRIVER(twin16_state, screen_eof_twin16)
730731   MCFG_SCREEN_PALETTE("palette")
731732
732   MCFG_GFXDECODE_ADD("gfxdecode", "palette", twin16)
733   MCFG_GFXDECODE_ADD("gfxdecode", "palette", fround)
733734
734   MCFG_PALETTE_ADD("palette", 0x400)
735   MCFG_PALETTE_ADD("palette", 1024)
735736   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
736737   MCFG_PALETTE_MEMBITS(8)
737738   MCFG_PALETTE_ENABLE_SHADOWS()
738739
739   MCFG_VIDEO_START_OVERRIDE(twin16_state,twin16)
740
741740   /* sound hardware */
742741   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
743742
r32779r32780
783782   ROM_LOAD16_BYTE( "687_q13.10s", 0x20000, 0x10000, CRC(36ae6014) SHA1(102d4c3215fb5f199ce6f93ce92725b5cce0b01d) )
784783   ROM_LOAD16_BYTE( "687_q12.8s",  0x20001, 0x10000, CRC(6d012167) SHA1(d608e29e0b2e834c099386b6ebb667e4bfc40ce7) )
785784
786   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
785   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
787786   ROM_LOAD( "687_l03.10a", 0x00000,  0x8000, CRC(7201983c) SHA1(06d089406d2f702e8d51ffdfbf34e4727a28d506) )
788787
789   ROM_REGION( 0x4000, "gfx1", 0 )
790   ROM_LOAD( "687_m14.d8", 0x0000, 0x4000, CRC(d7338557) SHA1(9b384baafabaab3888a0139674f0b530303684ca) ) /* Title screen graphics & characters */
788   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
789   ROM_LOAD( "687_m14.d8", 0x0000, 0x4000, CRC(d7338557) SHA1(9b384baafabaab3888a0139674f0b530303684ca) )
791790
792   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
791   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
793792   ROM_LOAD32_WORD_SWAP( "687i15.p13", 0x000000, 0x80000, CRC(eec8c5b2) SHA1(c400dd8c7bb85d233815572acd547acf626e4c73) )
794793   ROM_LOAD32_WORD_SWAP( "687i17.p16", 0x000002, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) )
795794   ROM_LOAD32_WORD_SWAP( "687i16.p15", 0x100000, 0x80000, CRC(746cf48b) SHA1(8f51df931b1de928f402f51bbaf02e37dfec1d6d) )
796795   ROM_LOAD32_WORD_SWAP( "687i18.p18", 0x100002, 0x80000, CRC(a1c7d0db) SHA1(901bc6e1982b9a8c2150a802995256d0168cc605) )
797796
798   ROM_REGION16_BE( 0x20000, "gfx3", 0 )   // tile data; mapped at 0x80000 on CPUB
797   ROM_REGION16_BE( 0x20000, "data", 0 )   // tile data; mapped at 0x80000 on CPUB
799798   ROM_LOAD16_BYTE( "687_l11.10r", 0x00000, 0x10000, CRC(399deee8) SHA1(dcc65e95f28ae4e9b671e70ce0bd5ba0fe178506) )
800799   ROM_LOAD16_BYTE( "687_l10.8r",  0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) )
801800
r32779r32780
819818   ROM_LOAD16_BYTE( "687_q13.10s", 0x20000, 0x10000, CRC(36ae6014) SHA1(102d4c3215fb5f199ce6f93ce92725b5cce0b01d) )
820819   ROM_LOAD16_BYTE( "687_q12.8s",  0x20001, 0x10000, CRC(6d012167) SHA1(d608e29e0b2e834c099386b6ebb667e4bfc40ce7) )
821820
822   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
821   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
823822   ROM_LOAD( "687_l03.10a", 0x00000,  0x8000, CRC(7201983c) SHA1(06d089406d2f702e8d51ffdfbf34e4727a28d506) )
824823
825   ROM_REGION( 0x4000, "gfx1", 0 )
826   ROM_LOAD( "687_l14.d8", 0x0000, 0x4000, CRC(20ecccd6) SHA1(b8ac3186de5ea81ae1c64b9511b7a0718aabab48) ) /* Title screen graphics & characters */
824   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
825   ROM_LOAD( "687_l14.d8", 0x0000, 0x4000, CRC(20ecccd6) SHA1(b8ac3186de5ea81ae1c64b9511b7a0718aabab48) )
827826
828   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
827   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
829828   ROM_LOAD32_WORD_SWAP( "687i15.p13", 0x000000, 0x80000, CRC(eec8c5b2) SHA1(c400dd8c7bb85d233815572acd547acf626e4c73) )
830829   ROM_LOAD32_WORD_SWAP( "687i17.p16", 0x000002, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) )
831830   ROM_LOAD32_WORD_SWAP( "687i16.p15", 0x100000, 0x80000, CRC(746cf48b) SHA1(8f51df931b1de928f402f51bbaf02e37dfec1d6d) )
832831   ROM_LOAD32_WORD_SWAP( "687i18.p18", 0x100002, 0x80000, CRC(a1c7d0db) SHA1(901bc6e1982b9a8c2150a802995256d0168cc605) )
833832
834   ROM_REGION16_BE( 0x20000, "gfx3", 0 )   // tile data; mapped at 0x80000 on CPUB
833   ROM_REGION16_BE( 0x20000, "data", 0 )   // tile data; mapped at 0x80000 on CPUB
835834   ROM_LOAD16_BYTE( "687_l11.10r", 0x00000, 0x10000, CRC(399deee8) SHA1(dcc65e95f28ae4e9b671e70ce0bd5ba0fe178506) )
836835   ROM_LOAD16_BYTE( "687_l10.8r",  0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) )
837836
r32779r32780
855854   ROM_LOAD16_BYTE( "687_n13.10s", 0x20000, 0x10000, CRC(f1c252af) SHA1(dbe78352ae5b284870becc92139773f66c52ed7d) )
856855   ROM_LOAD16_BYTE( "687_n12.8s",  0x20001, 0x10000, CRC(da221944) SHA1(c288ee583414a077f0d8b815b8e01b7f19a5fafe) )
857856
858   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
857   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
859858   ROM_LOAD( "687_n03.10a", 0x00000,  0x8000, CRC(a24c682f) SHA1(cf053270d3f77448ff802db832598ae3cf7dae6c) )
860859
861   ROM_REGION( 0x4000, "gfx1", 0 )
862   ROM_LOAD( "687_n14.d8", 0x0000, 0x4000, CRC(c76ac6d2) SHA1(d8fec255f1f7177a3716a5894fb679cbe172b6ea) ) /* Title screen graphics & characters */
860   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
861   ROM_LOAD( "687_n14.d8", 0x0000, 0x4000, CRC(c76ac6d2) SHA1(d8fec255f1f7177a3716a5894fb679cbe172b6ea) )
863862
864   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
863   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
865864   ROM_LOAD32_WORD_SWAP( "687i15.p13", 0x000000, 0x80000, CRC(eec8c5b2) SHA1(c400dd8c7bb85d233815572acd547acf626e4c73) )
866865   ROM_LOAD32_WORD_SWAP( "687i17.p16", 0x000002, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) )
867866   ROM_LOAD32_WORD_SWAP( "687i16.p15", 0x100000, 0x80000, CRC(746cf48b) SHA1(8f51df931b1de928f402f51bbaf02e37dfec1d6d) )
868867   ROM_LOAD32_WORD_SWAP( "687i18.p18", 0x100002, 0x80000, CRC(a1c7d0db) SHA1(901bc6e1982b9a8c2150a802995256d0168cc605) )
869868
870   ROM_REGION16_BE( 0x20000, "gfx3", 0 )   // tile data; mapped at 0x80000 on CPUB
869   ROM_REGION16_BE( 0x20000, "data", 0 )   // tile data; mapped at 0x80000 on CPUB
871870   ROM_LOAD16_BYTE( "687_l11.10r", 0x00000, 0x10000, CRC(399deee8) SHA1(dcc65e95f28ae4e9b671e70ce0bd5ba0fe178506) )
872871   ROM_LOAD16_BYTE( "687_l10.8r",  0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) )
873872
r32779r32780
891890   ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
892891   ROM_LOAD16_BYTE( "785_p12.8s",  0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
893892
894   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
893   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
895894   ROM_LOAD( "785_g03.10a", 0x00000,  0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
896895
897   ROM_REGION( 0x4000, "gfx1", 0 )
898   ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) /* Title screen graphics & characters */
896   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
897   ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) )
899898
900   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
899   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
901900   ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
902901   ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
903902   ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
904903   ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
905904
906   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
905   ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
907906
908907   ROM_REGION( 0x20000, "k007232", 0 )  // samples
909908   ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
r32779r32780
925924   ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
926925   ROM_LOAD16_BYTE( "785_p12.8s",  0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
927926
928   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
927   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
929928   ROM_LOAD( "785_g03.10a", 0x00000,  0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
930929
931   ROM_REGION( 0x4000, "gfx1", 0 )
932   ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) /* Title screen graphics & characters */
930   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
931   ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) )
933932
934   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
933   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
935934   ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
936935   ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
937936   ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
938937   ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
939938
940   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
939   ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
941940
942941   ROM_REGION( 0x20000, "k007232", 0 )  // samples
943942   ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
r32779r32780
959958   ROM_LOAD16_BYTE( "785_g13.10s", 0x20000, 0x10000, CRC(274f325d) SHA1(1076efa204eff0fc8a8788706b17b9a128023d35) )
960959   ROM_LOAD16_BYTE( "785_g12.8s",  0x20001, 0x10000, CRC(1625f933) SHA1(3f25d7396af46e75e3ae8456414e31935de43d34) )
961960
962   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
961   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
963962   ROM_LOAD( "785_g03.10a", 0x00000,  0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
964963
965   ROM_REGION( 0x4000, "gfx1", 0 )
966   ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) /* Title screen graphics & characters */
964   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
965   ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) )
967966
968   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
967   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
969968   ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
970969   ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
971970   ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
972971   ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
973972
974   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
973   ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
975974
976975   ROM_REGION( 0x20000, "k007232", 0 )  // samples
977976   ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
r32779r32780
993992   ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
994993   ROM_LOAD16_BYTE( "785_p12.8s",  0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
995994
996   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
995   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
997996   ROM_LOAD( "785_g03.10a", 0x00000,  0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
998997
999   ROM_REGION( 0x4000, "gfx1", 0 )
1000   ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */
998   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
999   ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) )
10011000
1002   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
1001   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
10031002   ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
10041003   ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
10051004   ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
10061005   ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
10071006
1008   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
1007   ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
10091008
10101009   ROM_REGION( 0x20000, "k007232", 0 )  // samples
10111010   ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
r32779r32780
10271026   ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
10281027   ROM_LOAD16_BYTE( "785_p12.8s",  0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
10291028
1030   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
1029   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
10311030   ROM_LOAD( "785_g03.10a", 0x00000,  0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
10321031
1033   ROM_REGION( 0x4000, "gfx1", 0 )
1034   ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */
1032   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
1033   ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) )
10351034
1036   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
1035   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
10371036   ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
10381037   ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
10391038   ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
10401039   ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
10411040
1042   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
1041   ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
10431042
10441043   ROM_REGION( 0x20000, "k007232", 0 )  // samples
10451044   ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
r32779r32780
10611060   ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
10621061   ROM_LOAD16_BYTE( "785_p12.8s",  0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
10631062
1064   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
1063   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
10651064   ROM_LOAD( "785_g03.10a", 0x00000,  0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
10661065
1067   ROM_REGION( 0x4000, "gfx1", 0 )
1068   ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */
1066   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
1067   ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) )
10691068
1070   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
1069   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
10711070   ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
10721071   ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
10731072   ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
10741073   ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
10751074
1076   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
1075   ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
10771076
10781077   ROM_REGION( 0x20000, "k007232", 0 )  // samples
10791078   ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
r32779r32780
10871086   ROM_LOAD16_BYTE( "870_m21.bin", 0x00000, 0x20000, CRC(436dbffb) SHA1(be8c8544f4d8ae86f216095753c6178a3cbf0e8d) )
10881087   ROM_LOAD16_BYTE( "870_m20.bin", 0x00001, 0x20000, CRC(b1c79d6a) SHA1(76e95e87eaa96ba694675fde7706540c584a36fb) )
10891088
1090   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
1089   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
10911090   ROM_LOAD( "870_f03.10a", 0x00000,  0x8000, CRC(a645c727) SHA1(e173e79130f187d090766664f1c478d47062749c) )
10921091
1093   ROM_REGION( 0x4000, "gfx1", 0 )
1094   ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */
1092   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
1093   ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) )
10951094
1096   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
1097   ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x000000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
1098   ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x000002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
1099   ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x100000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
1100   ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x100002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
1095   ROM_REGION16_BE( 0x100000, "tiles", 0 )  // tile gfx data
1096   ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x00000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
1097   ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x00002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
11011098
1099   ROM_REGION16_BE( 0x100000, "gfxrom", 0 )  // sprite gfx data
1100   ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x00000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
1101   ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x00002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
1102
11021103   ROM_REGION( 0x20000, "k007232", 0 )  // samples
11031104   ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) )
11041105
r32779r32780
11111112   ROM_LOAD16_BYTE( "870_l21.bin", 0x00000, 0x20000, CRC(e21a3a19) SHA1(5f5793c88093bc8632eab673f5e0d954ac9b9177) )
11121113   ROM_LOAD16_BYTE( "870_l20.bin", 0x00001, 0x20000, CRC(0ce9786f) SHA1(0fb0eef999ed09dd50eed403255887103fc35461) )
11131114
1114   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
1115   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
11151116   ROM_LOAD( "870_f03.10a", 0x00000,  0x8000, CRC(a645c727) SHA1(e173e79130f187d090766664f1c478d47062749c) )
11161117
1117   ROM_REGION( 0x4000, "gfx1", 0 )
1118   ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */
1118   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
1119   ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) )
11191120
1120   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
1121   ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x000000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
1122   ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x000002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
1123   ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x100000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
1124   ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x100002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
1121   ROM_REGION16_BE( 0x100000, "tiles", 0 )  // tile gfx data
1122   ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x00000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
1123   ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x00002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
11251124
1125   ROM_REGION16_BE( 0x100000, "gfxrom", 0 )  // sprite gfx data
1126   ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x00000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
1127   ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x00002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
1128
11261129   ROM_REGION( 0x20000, "k007232", 0 )  // samples
11271130   ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) )
11281131
r32779r32780
11411144   ROM_LOAD16_BYTE( "870_h07.10n", 0x00000, 0x10000, CRC(b4dda612) SHA1(e9612af11a151de1f0236629c84679f80936cae9) )
11421145   ROM_LOAD16_BYTE( "870_h06.8n",  0x00001, 0x10000, CRC(696ba702) SHA1(e35c9aeab4305d828a347eaddf4abc806a889fa3) )
11431146
1144   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
1147   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
11451148   ROM_LOAD( "870_g03.10a", 0x00000,  0x8000, CRC(db9c10c8) SHA1(b2ec4d6800a4ab00dfcc8d3cd4abf9b9d7c5544a) )
11461149
1147   ROM_REGION( 0x4000, "gfx1", 0 )
1148   ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */
1150   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
1151   ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) )
11491152
1150   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
1153   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
11511154   ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x000000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
11521155   ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x000002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
11531156   ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x100000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
11541157   ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x100002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
11551158
1156   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
1159   ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
11571160
11581161   ROM_REGION( 0x20000, "k007232", 0 )  // samples
11591162   ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) )
r32779r32780
11751178   ROM_LOAD16_BYTE("808_e13.10s", 0x20000, 0x10000, CRC(1fa708f4) SHA1(9511a19f50fb61571c2986c72d1a85e87b8d0495) )
11761179   ROM_LOAD16_BYTE("808_e12.8s",  0x20001, 0x10000, CRC(d62f1fde) SHA1(1e55084f1294b6ac7c152fcd1800511fcab5d360) )
11771180
1178   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
1181   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
11791182   ROM_LOAD( "808_e03.10a", 0x00000,  0x8000, CRC(3d93a7cd) SHA1(dcdd327e78f32436b276d0666f62a5b733b296e8) )
11801183
1181   ROM_REGION( 0x4000, "gfx1", 0 )
1182   ROM_LOAD("808_e14.d8", 0x0000, 0x4000, CRC(b9d36525) SHA1(53291c4911d7e1a5110539e4c57a11d0d530dc6f) ) /* Title screen graphics & characters */
1184   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
1185   ROM_LOAD("808_e14.d8", 0x0000, 0x4000, CRC(b9d36525) SHA1(53291c4911d7e1a5110539e4c57a11d0d530dc6f) )
11831186
1184   ROM_REGION16_BE( 0x200000, "gfx2", 0 )  // gfx data used at runtime
1187   ROM_REGION16_BE( 0x200000, "gfxrom", 0 )  // gfx data used at runtime
11851188   ROM_LOAD32_WORD_SWAP("808d15.p13", 0x000000, 0x80000, CRC(2b22a6b6) SHA1(8e1af0627a4eac045128c4096e2cfb59c3d2f5ef) )
11861189   ROM_LOAD32_WORD_SWAP("808d17.p16", 0x000002, 0x80000, CRC(d1299082) SHA1(c3c07b0517e7428ccd1cdf9e15aaf16d98e7c4cd) )
11871190
1188   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
1191   ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 )    // tile data; mapped at 0x80000 on CPUB
11891192
11901193   ROM_REGION( 0x20000, "k007232", 0 )  // samples
11911194   ROM_LOAD("808_d01.5a", 0x00000, 0x20000, CRC(fd4d37c0) SHA1(ef91c6e7bb57c27a9a51729fffd1bfe3e806fb61) )
r32779r32780
12061209   ROM_LOAD16_BYTE( "903_e13.10s", 0x20000, 0x10000, CRC(4fb5fb80) SHA1(3a59dae3846341289c31aa106684ebc45488ca45) )
12071210   ROM_LOAD16_BYTE( "903_e12.8s",  0x20001, 0x10000, CRC(883e3097) SHA1(fe0fa1a2881a67223d741c400bb8c1a0c67946c1) )
12081211
1209   ROM_REGION( 0x10000, "audiocpu", 0 )    // Z80 code (sound CPU)
1212   ROM_REGION( 0x8000, "audiocpu", 0 )    // Z80 code (sound CPU)
12101213   ROM_LOAD( "903_d03.10a", 0x00000,  0x8000, CRC(455e855a) SHA1(cfdd54a5071862653ee94c0455301f4a7245fbd8) )
12111214
1212   ROM_REGION( 0x4000, "gfx1", 0 )
1213   ROM_LOAD( "903_e14.d8", 0x0000, 0x4000, CRC(ddbebbd5) SHA1(df532f19a08cabb28d693e4cd445c47c9e35e5ff) ) /* Title screen graphics & characters */
1215   ROM_REGION( 0x4000, "fixed", 0 )  // title screen graphics & characters
1216   ROM_LOAD( "903_e14.d8", 0x0000, 0x4000, CRC(ddbebbd5) SHA1(df532f19a08cabb28d693e4cd445c47c9e35e5ff) )
12141217
1215   ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 )   // gfx data used at runtime
1218   ROM_REGION16_BE( 0x200000, "gfxrom", ROMREGION_ERASE00 )   // gfx data used at runtime
12161219   // unpopulated
12171220
1218   ROM_REGION16_BE( 0x20000, "gfx3", 0 )   // tile data; mapped at 0x80000 on CPUB
1221   ROM_REGION16_BE( 0x20000, "data", 0 )   // tile data; mapped at 0x80000 on CPUB
12191222   ROM_LOAD16_BYTE( "903_e11.10r", 0x00000, 0x10000, CRC(5c41faf8) SHA1(f9eee6a7b92d3b3aa4320747da6390310522a2cf) )
12201223   ROM_LOAD16_BYTE( "903_e10.8r",  0x00001, 0x10000, CRC(417576d4) SHA1(e84762743e3a1117b6ef7ea0b304877e4a719f75) )
12211224
r32779r32780
12301233
12311234DRIVER_INIT_MEMBER(twin16_state,twin16)
12321235{
1233   m_custom_video = 0;
1236   m_is_fround = false;
1237   m_gfxrombank->configure_entries(0, 2, memregion("gfxrom")->base() + 0x100000, 0x80000);
1238   m_gfxrombank->set_entry(0);
12341239}
12351240
1236DRIVER_INIT_MEMBER(twin16_state,fround)
1241DRIVER_INIT_MEMBER(fround_state,fround)
12371242{
1238   m_custom_video = 1;
1243   m_is_fround = true;
12391244}
12401245
12411246WRITE8_MEMBER(cuebrickj_state::nvram_bank_w)
r32779r32780
12451250
12461251DRIVER_INIT_MEMBER(cuebrickj_state,cuebrickj)
12471252{
1253   DRIVER_INIT_CALL(twin16);
1254
12481255   address_space &space = m_maincpu->space(AS_PROGRAM);
12491256
12501257   space.install_readwrite_bank(0x0b0000, 0x0b03ff, "nvrambank");
r32779r32780
12551262   machine().device<nvram_device>("nvram")->set_base(m_nvram, sizeof(m_nvram));
12561263
12571264   save_item(NAME(m_nvram));
1258
1259   m_custom_video = 0;
12601265}
12611266
12621267/* Game Drivers */
r32779r32780
12721277GAME( 1988, gradius2a, vulcan,   twin16,    vulcan, twin16_state,    twin16,    ROT0,   "Konami", "Gradius II - GOFER no Yabou (Japan Old Ver.)", GAME_SUPPORTS_SAVE )
12731278GAME( 1988, gradius2b, vulcan,   twin16,    vulcan, twin16_state,    twin16,    ROT0,   "Konami", "Gradius II - GOFER no Yabou (Japan Older Ver.)", GAME_SUPPORTS_SAVE )
12741279
1275GAME( 1988, fround,    0,        fround,    fround, twin16_state,    fround,    ROT0,   "Konami", "The Final Round (version M)", GAME_SUPPORTS_SAVE )
1276GAME( 1988, froundl,   fround,   fround,    fround, twin16_state,    fround,    ROT0,   "Konami", "The Final Round (version L)", GAME_SUPPORTS_SAVE )
1280GAME( 1988, fround,    0,        fround,    fround, fround_state,    fround,    ROT0,   "Konami", "The Final Round (version M)", GAME_SUPPORTS_SAVE )
1281GAME( 1988, froundl,   fround,   fround,    fround, fround_state,    fround,    ROT0,   "Konami", "The Final Round (version L)", GAME_SUPPORTS_SAVE )
12771282GAME( 1988, hpuncher,  fround,   twin16,    fround, twin16_state,    twin16,    ROT0,   "Konami", "Hard Puncher (Japan)", GAME_SUPPORTS_SAVE )
12781283GAME( 1989, miaj,      mia,      miaj,      miaj,   twin16_state,    twin16,    ROT0,   "Konami", "M.I.A. - Missing in Action (Japan)", GAME_SUPPORTS_SAVE )
12791284GAME( 1989, cuebrickj, cuebrick, cuebrickj, cuebrickj, cuebrickj_state, cuebrickj, ROT0, "Konami", "Cue Brick (Japan)", GAME_SUPPORTS_SAVE )
trunk/src/emu/devfind.c
r32779r32780
3737
3838
3939//-------------------------------------------------
40//  find_memory - find memory
40//  find_memregion - find memory region
4141//-------------------------------------------------
4242
43void *finder_base::find_memory(UINT8 width, size_t &bytes, bool required)
43void *finder_base::find_memregion(UINT8 width, size_t &length, bool required)
4444{
45   // look up the region and return NULL if not found
46   memory_region *region = m_base.memregion(m_tag);
47   if (region == NULL)
48      return NULL;
49
50   // check the width and warn if not correct
51   if (region->width() != width)
52   {
53      if (required)
54         osd_printf_warning("Region '%s' found but is width %d, not %d as requested\n", m_tag, region->width()*8, width*8);
55      return NULL;
56   }
57
58   // return results
59   length = region->bytes() / width;
60   return region->base();
61}
62
63
64//-------------------------------------------------
65//  find_memshare - find memory share
66//-------------------------------------------------
67
68void *finder_base::find_memshare(UINT8 width, size_t &bytes, bool required)
69{
4570   // look up the share and return NULL if not found
4671   memory_share *share = m_base.memshare(m_tag);
4772   if (share == NULL)
trunk/src/emu/devfind.h
r32779r32780
5353
5454protected:
5555   // helpers
56   void *find_memory(UINT8 width, size_t &bytes, bool required);
56   void *find_memregion(UINT8 width, size_t &length, bool required);
57   void *find_memshare(UINT8 width, size_t &bytes, bool required);
5758   bool report_missing(bool found, const char *objname, bool required);
5859
5960   // internal state
r32779r32780
304305};
305306
306307
308// ======================> rom_ptr_finder
309
310// ROM region pointer finder template
311template<typename _PointerType, bool _Required>
312class rom_ptr_finder : public object_finder_base<_PointerType>
313{
314public:
315   // construction/destruction
316   rom_ptr_finder(device_t &base, const char *tag)
317      : object_finder_base<_PointerType>(base, tag),
318         m_length(0) { }
319
320   // operators to make use transparent
321   _PointerType operator[](int index) const { return this->m_target[index]; }
322   _PointerType &operator[](int index) { return this->m_target[index]; }
323
324   // getter for explicit fetching
325   UINT32 length() const { return m_length; }
326   UINT32 mask() const { return m_length - 1; }
327
328   // finder
329   virtual bool findit(bool isvalidation = false)
330   {
331      if (isvalidation) return true;
332      this->m_target = reinterpret_cast<_PointerType *>(this->find_memregion(sizeof(_PointerType), m_length, _Required));
333      return this->report_missing(this->m_target != NULL, "memory region", _Required);
334   }
335
336protected:
337   // internal state
338   size_t m_length;
339};
340
341// optional ROM pointer finder
342template<class _PointerType>
343class optional_rom_ptr : public rom_ptr_finder<_PointerType, false>
344{
345public:
346   optional_rom_ptr(device_t &base, const char *tag = FINDER_DUMMY_TAG) : rom_ptr_finder<_PointerType, false>(base, tag) { }
347};
348
349// required ROM pointer finder
350template<class _PointerType>
351class required_rom_ptr : public rom_ptr_finder<_PointerType, true>
352{
353public:
354   required_rom_ptr(device_t &base, const char *tag = FINDER_DUMMY_TAG) : rom_ptr_finder<_PointerType, true>(base, tag) { }
355};
356
357
307358// ======================> shared_ptr_finder
308359
309360// shared pointer finder template
r32779r32780
342393   virtual bool findit(bool isvalidation = false)
343394   {
344395      if (isvalidation) return true;
345      this->m_target = reinterpret_cast<_PointerType *>(this->find_memory(m_width, m_bytes, _Required));
396      this->m_target = reinterpret_cast<_PointerType *>(this->find_memshare(m_width, m_bytes, _Required));
346397      return this->report_missing(this->m_target != NULL, "shared pointer", _Required);
347398   }
348399

Previous 199869 Revisions Next


© 1997-2024 The MAME Team