Previous 199869 Revisions Next

r17594 Sunday 2nd September, 2012 at 19:46:02 UTC by Aaron Giles
Created new sprite device base class, which manages a bitmap
and a sparse bitmap for tracking which areas got updated.
This allows sprites to be rendered independently to their own
bitmap and then mixed in a final step. Converted the Sega
sprite device over to this new model, and moved the mixing
steps out of the sprite implementations and into the driver-
specific video updates where it belongs. [Aaron Giles]

Added some further methods and helpers to the bitmap_t and
rectangle classes. [Aaron Giles]

Created a sega_16bit_common_base class which handles the
common Sega palette RAM mappings and open bus reads.
[Aaron Giles]
[src/emu]emu.mak sprite.c* sprite.h*
[src/lib/util]bitmap.h
[src/mame/drivers]segahang.c segaorun.c segas16a.c segas16b.c segas18.c segaxbd.c segaybd.c system16.c
[src/mame/includes]segahang.h segaorun.h segas16a.h segas16b.h segas18.h segaxbd.h segaybd.h system16.h
[src/mame/machine]segaic16.c segaic16.h
[src/mame/video]sega16sp.c sega16sp.h* segahang.c segaic16.c segaic16.h segaorun.c segas16a.c segas16b.c segas18.c segaxbd.c segaybd.c system16.c

trunk/src/mame/machine/segaic16.c
r17593r17594
6767//  MISC HELPERS
6868//**************************************************************************
6969
70READ16_HANDLER( segaic16_open_bus_r )
70//-------------------------------------------------
71//  sega_16bit_common_base - constructor
72//-------------------------------------------------
73
74sega_16bit_common_base::sega_16bit_common_base(const machine_config &mconfig, device_type type, const char *tag)
75   : driver_device(mconfig, type, tag),
76     m_paletteram(*this, "paletteram"),
77     m_open_bus_recurse(false),
78     m_palette_entries(0)
7179{
72   static UINT8 recurse = 0;
73   UINT16 result;
80   palette_init();
81}
7482
83
84//-------------------------------------------------
85//  open_bus_r - return value from reading an
86//   unmapped address
87//-------------------------------------------------
88
89READ16_MEMBER( sega_16bit_common_base::open_bus_r )
90{
7591   // Unmapped memory returns the last word on the data bus, which is almost always the opcode
7692   // of the next instruction due to prefetch; however, since we may be encrypted, we actually
7793   // need to return the encrypted opcode, not the last decrypted data.
r17593r17594
8197   // return the prefetched value.
8298
8399   // prevent recursion
84   if (recurse)
100   if (m_open_bus_recurse)
85101      return 0xffff;
86102
87103   // read original encrypted memory at that address
88   recurse = 1;
89   result = space->read_word(cpu_get_pc(&space->device()));
90   recurse = 0;
104   m_open_bus_recurse = true;
105   UINT16 result = space.read_word(cpu_get_pc(&space.device()));
106   m_open_bus_recurse = false;
91107   return result;
92108}
93109
94110
111//-------------------------------------------------
112//  palette_init - precompute weighted RGB values
113//   for each input value 0-31
114//-------------------------------------------------
95115
116void sega_16bit_common_base::palette_init()
117{
118   //
119   //   Color generation details
120   //
121   //   Each color is made up of 5 bits, connected through one or more resistors like so:
122   //
123   //   Bit 0 = 1 x 3.9K ohm
124   //   Bit 1 = 1 x 2.0K ohm
125   //   Bit 2 = 1 x 1.0K ohm
126   //   Bit 3 = 2 x 1.0K ohm
127   //   Bit 4 = 4 x 1.0K ohm
128   //
129   //   Another data bit is connected by a tristate buffer to the color output through a
130   //   470 ohm resistor. The buffer allows the resistor to have no effect (tristate),
131   //   halve brightness (pull-down) or double brightness (pull-up). The data bit source
132   //   is bit 15 of each color RAM entry.
133   //
134   
135   // compute weight table for regular palette entries
136   static const int resistances_normal[6] = { 3900, 2000, 1000, 1000/2, 1000/4, 0   };
137   double weights_normal[6];
138   compute_resistor_weights(0, 255, -1.0,
139      6, resistances_normal, weights_normal, 0, 0,
140      0, NULL, NULL, 0, 0,
141      0, NULL, NULL, 0, 0);
142
143   // compute weight table for shadow/hilight palette entries
144   static const int resistances_sh[6]     = { 3900, 2000, 1000, 1000/2, 1000/4, 470 };
145   double weights_sh[6];
146   compute_resistor_weights(0, 255, -1.0,
147      6, resistances_sh, weights_sh, 0, 0,
148      0, NULL, NULL, 0, 0,
149      0, NULL, NULL, 0, 0);
150
151   // compute R, G, B for each weight
152   for (int value = 0; value < 32; value++)
153   {
154      int i4 = (value >> 4) & 1;
155      int i3 = (value >> 3) & 1;
156      int i2 = (value >> 2) & 1;
157      int i1 = (value >> 1) & 1;
158      int i0 = (value >> 0) & 1;
159      m_palette_normal[value] = combine_6_weights(weights_normal, i0, i1, i2, i3, i4, 0);
160      m_palette_shadow[value] = combine_6_weights(weights_sh, i0, i1, i2, i3, i4, 0);
161      m_palette_hilight[value] = combine_6_weights(weights_sh, i0, i1, i2, i3, i4, 1);
162   }
163}
164
165
166//-------------------------------------------------
167//  paletteram_w - handle writes to palette RAM
168//-------------------------------------------------
169
170WRITE16_MEMBER( sega_16bit_common_base::paletteram_w )
171{
172   // compute the number of entries
173   if (m_palette_entries == 0)
174      m_palette_entries = memshare("paletteram")->bytes() / 2;
175
176   // get the new value
177   UINT16 newval = m_paletteram[offset];
178   COMBINE_DATA(&newval);
179   m_paletteram[offset] = newval;
180
181   //     byte 0    byte 1
182   //  sBGR BBBB GGGG RRRR
183   //  x000 4321 4321 4321
184   int r = ((newval >> 12) & 0x01) | ((newval << 1) & 0x1e);
185   int g = ((newval >> 13) & 0x01) | ((newval >> 3) & 0x1e);
186   int b = ((newval >> 14) & 0x01) | ((newval >> 7) & 0x1e);
187
188   // normal colors
189   palette_set_color_rgb(machine(), offset + 0 * m_palette_entries, m_palette_normal[r],  m_palette_normal[g],  m_palette_normal[b]);
190   palette_set_color_rgb(machine(), offset + 1 * m_palette_entries, m_palette_shadow[r],  m_palette_shadow[g],  m_palette_shadow[b]);
191   palette_set_color_rgb(machine(), offset + 2 * m_palette_entries, m_palette_hilight[r], m_palette_hilight[g], m_palette_hilight[b]);
192}
193
194
195
96196//**************************************************************************
97197//  315-5195 MEMORY MAPPER
98198//**************************************************************************
r17593r17594
273373         logerror("Unknown memory_mapper_r from address %02X\n", offset);
274374         break;
275375   }
276   return (space.data_width() == 8) ? 0xff : segaic16_open_bus_r(&space, 0, 0xffff);
376   return (space.data_width() == 8) ? 0xff : machine().driver_data<sega_16bit_common_base>()->open_bus_r(space, 0, 0xffff);
277377}
278378
279379
trunk/src/mame/machine/segaic16.h
r17593r17594
8080//**************************************************************************
8181
8282
83// ======================> sega_16bit_common_base
84
85class sega_16bit_common_base : public driver_device
86{
87public:
88   // construction/destruction
89   sega_16bit_common_base(const machine_config &mconfig, device_type type, const char *tag);
90
91   // open bus read helpers
92   DECLARE_READ16_MEMBER( open_bus_r );
93   
94   // palette helpers
95   DECLARE_WRITE16_MEMBER( paletteram_w );
96
97protected:
98   // internal helpers
99   void palette_init();
100
101public: // -- stupid system16.c
102   // memory pointers
103   required_shared_ptr<UINT16> m_paletteram;
104protected:
105   
106   // internal state
107   bool      m_open_bus_recurse;         // flag to track recursion through open_bus_r
108   UINT32      m_palette_entries;         // number of palette entries
109   UINT8      m_palette_normal[32];      // RGB translations for normal pixels
110   UINT8      m_palette_shadow[32];      // RGB translations for shadowed pixels
111   UINT8      m_palette_hilight[32];      // RGB translations for hilighted pixels
112};
113
114
83115// ======================> sega_315_5195_mapper_device
84116
85117class sega_315_5195_mapper_device : public device_t
r17593r17594
272304extern const device_type SEGA_315_5250_COMPARE_TIMER;
273305
274306
275
276/* open bus read helpers */
277READ16_HANDLER( segaic16_open_bus_r );
278
279
280307#endif
trunk/src/mame/video/segaxbd.c
r17593r17594
4545
4646void segaxbd_state::video_start()
4747{
48   // compute palette info
49   segaic16_palette_init(0x2000);
50
5148   // initialize the tile/text layers
5249   segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x1c00, 0, 2);
5350
r17593r17594
7067      return 0;
7168   }
7269
70   // start the sprites drawing
71   m_sprites->draw_async(cliprect);
72
7373   // reset priorities
7474   machine().priority_bitmap.fill(0, cliprect);
7575
r17593r17594
9494   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
9595   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
9696
97   // draw the sprites
98   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
97   // mix in sprites
98   bitmap_ind16 &sprites = m_sprites->bitmap();
99   for (const sparse_dirty_rect *rect = m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
100      for (int y = rect->min_y; y <= rect->max_y; y++)
101      {
102         UINT16 *dest = &bitmap.pix(y);
103         UINT16 *src = &sprites.pix(y);
104         UINT8 *pri = &machine().priority_bitmap.pix(y);
105         for (int x = rect->min_x; x <= rect->max_x; x++)
106         {
107            // only process written pixels
108            UINT16 pix = src[x];
109            if (pix != 0xffff)
110            {
111               // compare sprite priority against tilemap priority
112               int priority = (pix >> 12) & 3;
113               if ((1 << priority) > pri[x])
114               {
115                  // if the shadow flag is set, this triggers shadow/hilight for pen 0xa
116                  if ((pix & 0x400f) == 0x400a)
117                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries;
118
119                  // otherwise, just add in sprite palette base
120                  else
121                     dest[x] = pix & 0xfff;
122               }
123            }
124         }
125      }
126
99127   return 0;
100128}
trunk/src/mame/video/segaybd.c
r17593r17594
4545
4646void segaybd_state::video_start()
4747{
48   // compute palette info
49   segaic16_palette_init(0x2000);
50
5148   // initialize the rotation layer
5249   segaic16_rotate_init(machine(), 0, SEGAIC16_ROTATE_YBOARD, 0x000);
5350}
r17593r17594
6764      return 0;
6865   }
6966
70   // draw the yboard sprites
67   // start the sprites drawing
7168   rectangle yboard_clip(0, 511, 0, 511);
72   segaic16_sprites_draw(screen, m_tmp_bitmap, yboard_clip, 1);
69   m_ysprites->bitmap().fill(0xffff);
70   m_ysprites->draw_async(yboard_clip);
71   m_bsprites->draw_async(cliprect);
7372
7473   // apply rotation
75   segaic16_rotate_draw(machine(), 0, bitmap, cliprect, &m_tmp_bitmap);
74   segaic16_rotate_draw(machine(), 0, bitmap, cliprect, m_ysprites->bitmap());
7675
77   // draw the 16B sprites
78   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
76   // mix in 16B sprites
77   bitmap_ind16 &sprites = m_bsprites->bitmap();
78   for (const sparse_dirty_rect *rect = m_bsprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
79      for (int y = rect->min_y; y <= rect->max_y; y++)
80      {
81         UINT16 *dest = &bitmap.pix(y);
82         UINT16 *src = &sprites.pix(y);
83         UINT8 *pri = &machine().priority_bitmap.pix(y);
84         for (int x = rect->min_x; x <= rect->max_x; x++)
85         {
86            // only process written pixels
87            UINT16 pix = src[x];
88            if (pix != 0xffff)
89            {
90               // compare sprite priority against tilemap priority
91               int priority = (pix >> 11) & 0x1e;
92               if (priority < pri[x])
93               {
94                  // if the color is set to maximum, shadow pixels underneath us
95                  if ((pix & 0xf) == 0xe)
96                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries;
97
98                  // otherwise, just add in sprite palette base
99                  else
100                     dest[x] = 2048 + (pix & 0x3ff);
101               }
102            }
103         }
104      }
105
79106   return 0;
80107}
trunk/src/mame/video/segaorun.c
r17593r17594
4646
4747void segaorun_state::video_start()
4848{
49   // compute palette info
50   segaic16_palette_init(0x1000);
51
5249   if (m_shangon_video)
5350   {
5451      // initialize the tile/text layers
r17593r17594
7572
7673UINT32 segaorun_state::screen_update_shangon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7774{
75   // start the sprites drawing
76   m_sprites->draw_async(cliprect);
77
7878   // reset priorities
7979   machine().priority_bitmap.fill(0, cliprect);
8080
r17593r17594
9898   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
9999   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
100100
101   // draw the sprites
102   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
101   // mix in sprites
102   bitmap_ind16 &sprites = m_sprites->bitmap();
103   for (const sparse_dirty_rect *rect = m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
104      for (int y = rect->min_y; y <= rect->max_y; y++)
105      {
106         UINT16 *dest = &bitmap.pix(y);
107         UINT16 *src = &sprites.pix(y);
108         UINT8 *pri = &machine().priority_bitmap.pix(y);
109         for (int x = rect->min_x; x <= rect->max_x; x++)
110         {
111            // only process written pixels
112            UINT16 pix = src[x];
113            if (pix != 0xffff)
114            {
115               // compare sprite priority against tilemap priority
116               int priority = (pix >> 10) & 3;
117               if ((1 << priority) > pri[x])
118               {
119                  // if the color is set to maximum, shadow pixels underneath us
120                  if ((pix & 0x03f0) == 0x03f0)
121                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries;
122
123                  // otherwise, just add in sprite palette base
124                  else
125                     dest[x] = 1024 + (pix & 0x3ff);
126               }
127            }
128         }
129      }
130
103131   return 0;
104132}
105133
r17593r17594
113141      return 0;
114142   }
115143
144   // start the sprites drawing
145   m_sprites->draw_async(cliprect);
146
116147   // reset priorities
117148   machine().priority_bitmap.fill(0, cliprect);
118149
r17593r17594
134165   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
135166   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
136167
137   // draw the sprites
138   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
168   // mix in sprites
169   bitmap_ind16 &sprites = m_sprites->bitmap();
170   for (const sparse_dirty_rect *rect = m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
171      for (int y = rect->min_y; y <= rect->max_y; y++)
172      {
173         UINT16 *dest = &bitmap.pix(y);
174         UINT16 *src = &sprites.pix(y);
175         UINT8 *pri = &machine().priority_bitmap.pix(y);
176         for (int x = rect->min_x; x <= rect->max_x; x++)
177         {
178            // only process written pixels
179            UINT16 pix = src[x];
180            if (pix != 0xffff)
181            {
182               // compare sprite priority against tilemap priority
183               int priority = (pix >> 12) & 3;
184               if ((1 << priority) > pri[x])
185               {
186                  // if the shadow flag is set, this triggers shadow/hilight for pen 0xa
187                  if ((pix & 0x400f) == 0x400a)
188                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries;
189
190                  // otherwise, just add in sprite palette base
191                  else
192                     dest[x] = 2048 + (pix & 0x7ff);
193               }
194            }
195         }
196      }
197
139198   return 0;
140199}
trunk/src/mame/video/system16.c
r17593r17594
3939      static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
4040      int i;
4141      for (i = 0; i < 16; i++)
42         segaic16_sprites_set_bank(machine, 0, i, default_banklist[i]);
42         state->m_sprites->set_bank(i, default_banklist[i]);
4343   }
4444   else
4545   {
4646      static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 };
4747      int i;
4848      for (i = 0; i < 16; i++)
49         segaic16_sprites_set_bank(machine, 0, i, alternate_banklist[i]);
49         state->m_sprites->set_bank(i, alternate_banklist[i]);
5050
5151   }
5252
r17593r17594
431431      state->m_system18 = 0;
432432   }
433433
434   segaic16_palette_init(0x800);
435434   setup_system16_bootleg_spritebanking(machine);
436
437
438435}
439436
440437VIDEO_START( system18old )
r17593r17594
597594   state->m_text_tilemap->set_transparent_pen(0);
598595   state->m_bg_tilemaps[0]->set_transparent_pen(0);
599596   state->m_bg_tilemaps[1]->set_transparent_pen(0);
600
601   segaic16_palette_init(0x800);
602
603597}
604598
605599VIDEO_START( s16a_bootleg_wb3bl )
r17593r17594
635629
636630   bitmap.fill(get_black_pen(screen.machine()), cliprect);
637631
632   // start the sprites drawing
633   state->m_sprites->draw_async(cliprect);
634
638635   // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
639636   state->m_bg_tilemaps[0]->mark_all_dirty();
640637   state->m_bg_tilemaps[1]->mark_all_dirty();
r17593r17594
672669      state->m_text_tilemap->draw(bitmap, cliprect, 0, 0);
673670   }
674671
675   /* draw the sprites */
676   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
672   // mix in sprites
673   bitmap_ind16 &sprites = state->m_sprites->bitmap();
674   for (const sparse_dirty_rect *rect = state->m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
675      for (int y = rect->min_y; y <= rect->max_y; y++)
676      {
677         UINT16 *dest = &bitmap.pix(y);
678         UINT16 *src = &sprites.pix(y);
679//         UINT8 *pri = &screen.machine().priority_bitmap.pix(y);
680         for (int x = rect->min_x; x <= rect->max_x; x++)
681         {
682            // only process written pixels
683            UINT16 pix = src[x];
684            if (pix != 0xffff)
685            {
686               // compare sprite priority against tilemap priority
687//               int priority = (pix >> 12) & 3;
688               if (1)
689               {
690                  // if the color is set to maximum, shadow pixels underneath us
691                  if ((pix & 0x03f0) == 0x03f0)
692                     dest[x] += (state->m_paletteram[dest[x]] & 0x8000) ? screen.machine().total_colors()*2 : screen.machine().total_colors();
677693
694                  // otherwise, just add in sprite palette base
695                  else
696                     dest[x] = 1024 + (pix & 0x3ff);
697               }
698            }
699         }
700      }
701
702
678703   return 0;
679704}
680705
r17593r17594
693718
694719   bitmap.fill(get_black_pen(screen.machine()), cliprect);
695720
721   // start the sprites drawing
722   state->m_sprites->draw_async(cliprect);
723
696724   // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
697725   state->m_bg_tilemaps[0]->mark_all_dirty();
698726   state->m_bg_tilemaps[1]->mark_all_dirty();
r17593r17594
713741      state->m_text_tilemap->draw(bitmap, cliprect, 0, 0);
714742   }
715743
716   /* draw the sprites */
717   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
744   // mix in sprites
745   bitmap_ind16 &sprites = state->m_sprites->bitmap();
746   for (const sparse_dirty_rect *rect = state->m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
747      for (int y = rect->min_y; y <= rect->max_y; y++)
748      {
749         UINT16 *dest = &bitmap.pix(y);
750         UINT16 *src = &sprites.pix(y);
751//         UINT8 *pri = &screen.machine().priority_bitmap.pix(y);
752         for (int x = rect->min_x; x <= rect->max_x; x++)
753         {
754            // only process written pixels
755            UINT16 pix = src[x];
756            if (pix != 0xffff)
757            {
758               // compare sprite priority against tilemap priority
759//               int priority = (pix >> 12) & 3;
760               if (1)
761               {
762                  // if the color is set to maximum, shadow pixels underneath us
763                  if ((pix & 0x03f0) == 0x03f0)
764                     dest[x] += (state->m_paletteram[dest[x]] & 0x8000) ? screen.machine().total_colors()*2 : screen.machine().total_colors();
718765
766                  // otherwise, just add in sprite palette base
767                  else
768                     dest[x] = 1024 + (pix & 0x3ff);
769               }
770            }
771         }
772      }
773
774
719775   return 0;
720776}
721777
r17593r17594
732788      return 0;
733789   }
734790
791   // start the sprites drawing
792   state->m_sprites->draw_async(cliprect);
793
735794   update_page(screen.machine());
736795
737796   screen.machine().priority_bitmap.fill(0, cliprect);
r17593r17594
762821
763822   //draw_sprites(screen.machine(), bitmap, cliprect,0);
764823
765   /* draw the sprites */
766   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
824
825   // mix in sprites
826   bitmap_ind16 &sprites = state->m_sprites->bitmap();
827   for (const sparse_dirty_rect *rect = state->m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
828      for (int y = rect->min_y; y <= rect->max_y; y++)
829      {
830         UINT16 *dest = &bitmap.pix(y);
831         UINT16 *src = &sprites.pix(y);
832//         UINT8 *pri = &screen.machine().priority_bitmap.pix(y);
833         for (int x = rect->min_x; x <= rect->max_x; x++)
834         {
835            // only process written pixels
836            UINT16 pix = src[x];
837            if (pix != 0xffff)
838            {
839               // compare sprite priority against tilemap priority
840//               int priority = (pix >> 12) & 3;
841               if (1)
842               {
843                  // if the color is set to maximum, shadow pixels underneath us
844                  if ((pix & 0x03f0) == 0x03f0)
845                     dest[x] += (state->m_paletteram[dest[x]] & 0x8000) ? screen.machine().total_colors()*2 : screen.machine().total_colors();
846
847                  // otherwise, just add in sprite palette base
848                  else
849                     dest[x] = 1024 + (pix & 0x3ff);
850               }
851            }
852         }
853      }
854
767855   return 0;
768856}
769857
r17593r17594
778866      return 0;
779867   }
780868
869   // start the sprites drawing
870   state->m_sprites->draw_async(cliprect);
871
781872   update_page(screen.machine());
782873
783874   screen.machine().priority_bitmap.fill(0);
r17593r17594
796887   state->m_text_layer->draw(bitmap, cliprect, 1, 0x7);
797888   state->m_text_layer->draw(bitmap, cliprect, 0, 0xf);
798889
799   /* draw the sprites */
800   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
890   // mix in sprites
891   bitmap_ind16 &sprites = state->m_sprites->bitmap();
892   for (const sparse_dirty_rect *rect = state->m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
893      for (int y = rect->min_y; y <= rect->max_y; y++)
894      {
895         UINT16 *dest = &bitmap.pix(y);
896         UINT16 *src = &sprites.pix(y);
897//         UINT8 *pri = &screen.machine().priority_bitmap.pix(y);
898         for (int x = rect->min_x; x <= rect->max_x; x++)
899         {
900            // only process written pixels
901            UINT16 pix = src[x];
902            if (pix != 0xffff)
903            {
904               // compare sprite priority against tilemap priority
905//               int priority = (pix >> 12) & 3;
906               if (1)
907               {
908                  // if the color is set to maximum, shadow pixels underneath us
909                  if ((pix & 0x03f0) == 0x03f0)
910                     dest[x] += (state->m_paletteram[dest[x]] & 0x8000) ? screen.machine().total_colors()*2 : screen.machine().total_colors();
801911
912                  // otherwise, just add in sprite palette base
913                  else
914                     dest[x] = 1024 + (pix & 0x3ff);
915               }
916            }
917         }
918      }
919
802920   return 0;
803921}
trunk/src/mame/video/segaic16.c
r17593r17594
380380UINT16 *segaic16_textram_0;
381381UINT16 *segaic16_roadram_0;
382382UINT16 *segaic16_rotateram_0;
383UINT16 *segaic16_paletteram;
384383
385struct palette_info segaic16_palette;
386384struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE];
387385struct road_info segaic16_road[SEGAIC16_MAX_ROADS];
388386
r17593r17594
418416
419417/*************************************
420418 *
421 *  Palette computation
422 *
423 *************************************/
424
425/*
426    Color generation details
427
428    Each color is made up of 5 bits, connected through one or more resistors like so:
429
430    Bit 0 = 1 x 3.9K ohm
431    Bit 1 = 1 x 2.0K ohm
432    Bit 2 = 1 x 1.0K ohm
433    Bit 3 = 2 x 1.0K ohm
434    Bit 4 = 4 x 1.0K ohm
435
436    Another data bit is connected by a tristate buffer to the color output through a
437    470 ohm resistor. The buffer allows the resistor to have no effect (tristate),
438    halve brightness (pull-down) or double brightness (pull-up). The data bit source
439    is bit 15 of each color RAM entry.
440*/
441
442void segaic16_palette_init(int entries)
443{
444   static const int resistances_normal[6] = { 3900, 2000, 1000, 1000/2, 1000/4, 0   };
445   static const int resistances_sh[6]     = { 3900, 2000, 1000, 1000/2, 1000/4, 470 };
446   double weights[2][6];
447   int i;
448   struct palette_info *info = &segaic16_palette;
449
450   /* compute the number of palette entries */
451   info->entries = entries;
452
453   /* compute weight table for regular palette entries */
454   compute_resistor_weights(0, 255, -1.0,
455      6, resistances_normal, weights[0], 0, 0,
456      0, NULL, NULL, 0, 0,
457      0, NULL, NULL, 0, 0);
458
459   /* compute weight table for shadow/hilight palette entries */
460   compute_resistor_weights(0, 255, -1.0,
461      6, resistances_sh, weights[1], 0, 0,
462      0, NULL, NULL, 0, 0,
463      0, NULL, NULL, 0, 0);
464
465   /* compute R, G, B for each weight */
466   for (i = 0; i < 32; i++)
467   {
468      int i4 = (i >> 4) & 1;
469      int i3 = (i >> 3) & 1;
470      int i2 = (i >> 2) & 1;
471      int i1 = (i >> 1) & 1;
472      int i0 = (i >> 0) & 1;
473
474      info->normal[i] = combine_6_weights(weights[0], i0, i1, i2, i3, i4, 0);
475      info->shadow[i] = combine_6_weights(weights[1], i0, i1, i2, i3, i4, 0);
476      info->hilight[i] = combine_6_weights(weights[1], i0, i1, i2, i3, i4, 1);
477   }
478}
479
480
481
482/*************************************
483 *
484 *  Palette accessors
485 *
486 *************************************/
487
488WRITE16_HANDLER( segaic16_paletteram_w )
489{
490   UINT16 newval;
491   int r, g, b;
492   struct palette_info *info = &segaic16_palette;
493
494   /* get the new value */
495   newval = segaic16_paletteram[offset];
496   COMBINE_DATA(&newval);
497   segaic16_paletteram[offset] = newval;
498
499   /*     byte 0    byte 1 */
500   /*  sBGR BBBB GGGG RRRR */
501   /*  x000 4321 4321 4321 */
502   r = ((newval >> 12) & 0x01) | ((newval << 1) & 0x1e);
503   g = ((newval >> 13) & 0x01) | ((newval >> 3) & 0x1e);
504   b = ((newval >> 14) & 0x01) | ((newval >> 7) & 0x1e);
505
506   /* normal colors */
507   palette_set_color_rgb(space->machine(), offset + 0 * info->entries, info->normal[r],  info->normal[g],  info->normal[b]);
508   palette_set_color_rgb(space->machine(), offset + 1 * info->entries, info->shadow[r],  info->shadow[g],  info->shadow[b]);
509   palette_set_color_rgb(space->machine(), offset + 2 * info->entries, info->hilight[r], info->hilight[g], info->hilight[b]);
510}
511
512
513
514/*************************************
515 *
516419 *  Draw a split tilemap in up to
517420 *  four pieces
518421 *
r17593r17594
20291932 *
20301933 *************************************/
20311934
2032void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 *srcbitmap)
1935void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap)
20331936{
20341937   struct rotate_info *info = &segaic16_rotate[which];
20351938   INT32 currx = (info->buffer[0x3f0] << 16) | info->buffer[0x3f1];
r17593r17594
20481951   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
20491952   {
20501953      UINT16 *dest = &bitmap.pix16(y);
2051      UINT16 *src = &srcbitmap->pix16(0);
1954      UINT16 *src = &srcbitmap.pix16(0);
20521955      UINT8 *pri = &machine.priority_bitmap.pix8(y);
20531956      INT32 tx = currx;
20541957      INT32 ty = curry;
r17593r17594
20591962         /* fetch the pixel from the source bitmap */
20601963         int sx = (tx >> 14) & 0x1ff;
20611964         int sy = (ty >> 14) & 0x1ff;
2062         int pix = src[sy * srcbitmap->rowpixels() + sx];
1965         int pix = src[sy * srcbitmap.rowpixels() + sx];
20631966
20641967         /* non-zero pixels get written; everything else is the scanline color */
20651968         if (pix != 0xffff)
r17593r17594
21132016
21142017   return 0xffff;
21152018}
2116
2117
2118DEFINE_LEGACY_DEVICE(SEGA16SP, sega16sp);
trunk/src/mame/video/segaic16.h
r17593r17594
1010extern UINT8 segaic16_display_enable;
1111extern UINT16 *segaic16_tileram_0;
1212extern UINT16 *segaic16_textram_0;
13extern UINT16 *segaic16_spriteram_0;
14extern UINT16 *segaic16_spriteram_1;
1513extern UINT16 *segaic16_roadram_0;
1614extern UINT16 *segaic16_rotateram_0;
17extern UINT16 *segaic16_paletteram;
1815
1916/* misc functions */
2017void segaic16_set_display_enable(running_machine &machine, int enable);
2118
22/* palette handling */
23void segaic16_palette_init(int entries);
24WRITE16_HANDLER( segaic16_paletteram_w );
25
2619/* tilemap systems */
2720#define SEGAIC16_MAX_TILEMAPS      1
2821
r17593r17594
4639WRITE16_HANDLER( segaic16_tileram_0_w );
4740WRITE16_HANDLER( segaic16_textram_0_w );
4841
49/* sprite systems */
50#define SEGAIC16_MAX_SPRITES      2
51
52#define SEGAIC16_SPRITES_OUTRUN      4
53#define SEGAIC16_SPRITES_XBOARD      5
54
55void segaic16_sprites_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which);
56void segaic16_sprites_set_bank(running_machine &machine, int which, int banknum, int offset);
57void segaic16_sprites_set_flip(running_machine &machine, int which, int flip);
58void segaic16_sprites_set_shadow(running_machine &machine, int which, int shadow);
59WRITE16_HANDLER( segaic16_sprites_draw_0_w );
60WRITE16_HANDLER( segaic16_sprites_draw_1_w );
61
6242/* road systems */
6343#define SEGAIC16_MAX_ROADS         1
6444
r17593r17594
8161#define SEGAIC16_ROTATE_YBOARD      0
8262
8363void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase);
84void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 *srcbitmap);
64void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap);
8565READ16_HANDLER( segaic16_rotate_control_0_r );
8666
8767/*************************************
r17593r17594
139119   UINT8 *         gfx;                     /* expanded road graphics */
140120};
141121
142struct palette_info
143{
144   INT32         entries;                  /* number of entries (not counting shadows) */
145   UINT8         normal[32];                  /* RGB translations for normal pixels */
146   UINT8         shadow[32];                  /* RGB translations for shadowed pixels */
147   UINT8         hilight[32];               /* RGB translations for hilighted pixels */
148};
149
150122struct rotate_info
151123{
152124   UINT8         index;                     /* index of this structure */
r17593r17594
157129   UINT16 *      buffer;                     /* buffered data */
158130};
159131
160/* interface */
161typedef struct _sega16sp_interface sega16sp_interface;
162struct _sega16sp_interface
163{
164   UINT8         which;                     /* which sprite RAM */
165   UINT16         colorbase;                  /* base color index */
166   INT32         ramsize;                  /* size of sprite RAM */
167   INT32         xoffs;                     /* X scroll offset */
168   void         (*draw)(running_machine &machine, device_t* device, bitmap_ind16 &bitmap, const rectangle &cliprect);
169   int            buffer;                     /* should ram be buffered? */
170};
171132
172
173
174
175/* state */
176typedef struct _sega16sp_state sega16sp_state;
177struct _sega16sp_state
178{
179   UINT8         which;                     /* which sprite RAM */
180   UINT8         flip;                     /* screen flip? */
181   UINT8         shadow;                     /* shadow or hilight? */
182   UINT8         bank[16];                  /* banking redirection */
183   UINT16         colorbase;                  /* base color index */
184   INT32         ramsize;                  /* size of sprite RAM */
185   INT32         xoffs;                     /* X scroll offset */
186   void         (*draw)(running_machine &machine, device_t* device, bitmap_ind16 &bitmap, const rectangle &cliprect);
187   UINT16 *      spriteram;                  /* pointer to spriteram pointer */
188   UINT16 *      buffer;                     /* buffered spriteram for those that use it */
189
190};
191
192133/***************************************************************************
193134    FUNCTION PROTOTYPES
194135***************************************************************************/
195136
196DECLARE_LEGACY_DEVICE(SEGA16SP, sega16sp);
197
198void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
199void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
200void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
201void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
202void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
203void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
204void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
205void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
206void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
207void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
208void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
209
210/* the various sprite configs */
211static const sega16sp_interface hangon_sega16sp_intf =
212{
213   0,      // which spriteram
214   1024,  // colorbase
215   0x800, // ramsize
216   0,     // xoffs
217   segaic16_sprites_hangon_draw, // draw function
218   0, // use buffer
219};
220
221static const sega16sp_interface sharrier_sega16sp_intf =
222{
223   0,      // which spriteram
224   1024,  // colorbase
225   0x1000, // ramsize
226   0,     // xoffs
227   segaic16_sprites_sharrier_draw, // draw function
228   0, // use buffer
229};
230
231static const sega16sp_interface yboard_16b_sega16sp_intf =
232{
233   0,      // which spriteram
234   2048,  // colorbase
235   0x800, // ramsize
236   0,     // xoffs
237   segaic16_sprites_yboard_16b_draw, // draw function
238   0, // use buffer
239};
240
241static const sega16sp_interface yboard_sega16sp_intf =
242{
243   1,      // which spriteram
244   4096,  // colorbase
245   0x10000, // ramsize
246   0,     // xoffs
247   segaic16_sprites_yboard_draw, // draw function
248   0, // use buffer
249};
250
251static const sega16sp_interface s16a_sega16sp_intf =
252{
253   0,      // which spriteram
254   1024,  // colorbase
255   0x800, // ramsize
256   0,     // xoffs
257   segaic16_sprites_16a_draw, // draw function
258   0, // use buffer
259};
260
261static const sega16sp_interface s16b_sega16sp_intf =
262{
263   0,      // which spriteram
264   1024,  // colorbase
265   0x800, // ramsize
266   0,     // xoffs
267   segaic16_sprites_16b_draw, // draw function
268   0, // use buffer
269};
270
271static const sega16sp_interface outrun_sega16sp_intf =
272{
273   0,      // which spriteram
274   2048,  // colorbase
275   0x1000, // ramsize
276   0,     // xoffs
277   segaic16_sprites_outrun_draw, // draw function
278   1, // use buffer
279};
280
281
282static const sega16sp_interface xboard_sega16sp_intf =
283{
284   0,      // which spriteram
285   0,  // colorbase
286   0x1000, // ramsize
287   0,     // xoffs
288   segaic16_sprites_xboard_draw, // draw function
289   1, // use buffer
290};
291
292
293
294#define MCFG_SEGA16SP_ADD(_tag, _interface) \
295   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
296   MCFG_DEVICE_CONFIG(_interface)
297
298#define MCFG_SEGA16SP_ADD_HANGON(_tag) \
299   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
300   MCFG_DEVICE_CONFIG(hangon_sega16sp_intf)
301
302#define MCFG_SEGA16SP_ADD_SHARRIER(_tag) \
303   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
304   MCFG_DEVICE_CONFIG(sharrier_sega16sp_intf)
305
306#define MCFG_SEGA16SP_ADD_YBOARD(_tag) \
307   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
308   MCFG_DEVICE_CONFIG(yboard_sega16sp_intf)
309
310#define MCFG_SEGA16SP_ADD_YBOARD_16B(_tag) \
311   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
312   MCFG_DEVICE_CONFIG(yboard_16b_sega16sp_intf)
313
314#define MCFG_SEGA16SP_ADD_16A(_tag) \
315   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
316   MCFG_DEVICE_CONFIG(s16a_sega16sp_intf)
317
318#define MCFG_SEGA16SP_ADD_16B(_tag) \
319   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
320   MCFG_DEVICE_CONFIG(s16b_sega16sp_intf)
321
322#define MCFG_SEGA16SP_ADD_OUTRUN(_tag) \
323   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
324   MCFG_DEVICE_CONFIG(outrun_sega16sp_intf)
325
326#define MCFG_SEGA16SP_ADD_XBOARD(_tag) \
327   MCFG_DEVICE_ADD(_tag, SEGA16SP, 0) \
328   MCFG_DEVICE_CONFIG(xboard_sega16sp_intf)
329
330
331extern struct palette_info segaic16_palette;
332137extern struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE];
333138extern struct road_info segaic16_road[SEGAIC16_MAX_ROADS];
334139
trunk/src/mame/video/sega16sp.c
r17593r17594
1/***************************************************************************
2
3    Sega 16-bit sprite hardware
4
5****************************************************************************
6
7    Copyright Aaron Giles
8    All rights reserved.
9
10    Redistribution and use in source and binary forms, with or without
11    modification, are permitted provided that the following conditions are
12    met:
13
14        * Redistributions of source code must retain the above copyright
15          notice, this list of conditions and the following disclaimer.
16        * Redistributions in binary form must reproduce the above copyright
17          notice, this list of conditions and the following disclaimer in
18          the documentation and/or other materials provided with the
19          distribution.
20        * Neither the name 'MAME' nor the names of its contributors may be
21          used to endorse or promote products derived from this software
22          without specific prior written permission.
23
24    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
25    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
28    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34    POSSIBILITY OF SUCH DAMAGE.
35
36***************************************************************************/
37
138#include "emu.h"
39#include "sega16sp.h"
240#include "segaic16.h"
341
442
5UINT16 *segaic16_spriteram_0;
6UINT16 *segaic16_spriteram_1;
743
44//****************************************************************************
45//  CONSTANTS
46//****************************************************************************
847
48// device type definition
49const device_type SEGA_HANGON_SPRITES = &device_creator<sega_hangon_sprite_device>;
50const device_type SEGA_SHARRIER_SPRITES = &device_creator<sega_sharrier_sprite_device>;
51const device_type SEGA_OUTRUN_SPRITES = &device_creator<sega_outrun_sprite_device>;
52const device_type SEGA_SYS16A_SPRITES = &device_creator<sega_sys16a_sprite_device>;
53const device_type BOOTLEG_SYS16A_SPRITES = &device_creator<bootleg_sys16a_sprite_device>;
54const device_type SEGA_SYS16B_SPRITES = &device_creator<sega_sys16b_sprite_device>;
55const device_type SEGA_XBOARD_SPRITES = &device_creator<sega_xboard_sprite_device>;
56const device_type SEGA_YBOARD_SPRITES = &device_creator<sega_yboard_sprite_device>;
957
1058
11/*****************************************************************************
12    INLINE FUNCTIONS
13*****************************************************************************/
1459
15INLINE sega16sp_state *get_safe_token( device_t *device )
60//****************************************************************************
61//  DEVICE INTERFACE
62//****************************************************************************
63
64//-------------------------------------------------
65//  sega_16bit_sprite_device -- core constructor
66//-------------------------------------------------
67
68sega_16bit_sprite_device::sega_16bit_sprite_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner)
69   : sprite16_device_ind16(mconfig, type, name, tag, owner),
70     m_flip(false)
1671{
17   assert(device != NULL);
18   assert(device->type() == SEGA16SP);
72   // default to 1:1 bank mapping
73   for (int bank = 0; bank < ARRAY_LENGTH(m_bank); bank++)
74      m_bank[bank] = bank;
75}
1976
20   return (sega16sp_state *)downcast<legacy_device_base *>(device)->token();
77
78//-------------------------------------------------
79//  device_start -- device startup
80//-------------------------------------------------
81
82void sega_16bit_sprite_device::device_start()
83{
84   // let the parent do its work
85   sprite16_device_ind16::device_start();
86
87   // save states
88   save_item(NAME(m_flip));
89   save_item(NAME(m_bank));
2190}
2291
23INLINE const sega16sp_interface *get_interface( device_t *device )
92
93//-------------------------------------------------
94//  draw_write -- trigger a buffer flip
95//-------------------------------------------------
96
97WRITE16_MEMBER( sega_16bit_sprite_device::draw_write )
2498{
25   assert(device != NULL);
26   assert((device->type() == SEGA16SP));
27   return (const sega16sp_interface *) device->static_config();
99   UINT32 *src = reinterpret_cast<UINT32 *>(spriteram());
100   UINT32 *dst = reinterpret_cast<UINT32 *>(buffer());
101
102   // swap the halves of the sprite RAM
103   for (int i = 0; i < spriteram_bytes()/4; i++)
104   {
105      UINT32 temp = *src;
106      *src++ = *dst;
107      *dst++ = temp;
108   }
109
110   // hack for thunderblade
111   *spriteram() = 0xffff;
112
113   // we will render the sprites when the video update happens
28114}
29115
30/*******************************************************************************************
31 *
32 *  Hang On-style sprites
33 *
34 *      Offs  Bits               Usage
35 *       +0   bbbbbbbb --------  Bottom scanline of sprite - 1
36 *       +0   -------- tttttttt  Top scanline of sprite - 1
37 *       +2   bbbb---- --------  Sprite bank
38 *       +2   -------x xxxxxxxx  X position of sprite (position $BD is screen position 0)
39 *       +4   pppppppp pppppppp  Signed 16-bit pitch value between scanlines
40 *       +6   -ooooooo oooooooo  Offset within selected sprite bank
41 *       +6   f------- --------  Horizontal flip: read the data backwards if set
42 *       +8   --cccccc --------  Sprite color palette
43 *       +8   -------- zzzzzz--  Zoom factor
44 *       +8   -------- ------pp  Sprite priority
45 *       +E   dddddddd dddddddd  Scratch space for current address
46 *
47 *  Special notes:
48 *
49 *      There is an interaction between the horizonal flip bit and the offset.
50 *      The offset is maintained as a 16-bit value, even though only the lower
51 *      15 bits are used for the address. The top bit is used to control flipping.
52 *      This means that if the low 15 bits overflow during rendering, the sprite
53 *      data will be read backwards after the overflow. This is important to
54 *      emulate correctly as many games make use of this feature to render sprites
55 *      at the beginning of a bank.
56 *
57 *******************************************************************************************/
58116
59#define hangon_draw_pixel()                                       \
60   /* only draw if onscreen, not 0 or 15 */                        \
61   if (pix != 0 && pix != 15)                                    \
62   {                                                      \
63      /* are we high enough priority to be visible? */               \
64      if (sprpri > pri[x])                                    \
65      {                                                   \
66         /* shadow/hilight mode? */                              \
67         if (color == sega16sp->colorbase + (0x3f << 4))                  \
68            dest[x] += sega16sp->shadow ? segaic16_palette.entries*2 : segaic16_palette.entries;   \
69                                                         \
70         /* regular draw */                                    \
71         else                                             \
72            dest[x] = pix | color;                              \
73      }                                                   \
74                                                         \
75      /* always mark priority so no one else draws here */            \
76      pri[x] = 0xff;                                          \
77   }                                                      \
78117
79void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
118//****************************************************************************
119//  HANG ON-STYLE SPRITES
120//****************************************************************************
121
122//-------------------------------------------------
123//  sega_hangon_sprite_device -- constructor
124//-------------------------------------------------
125
126sega_hangon_sprite_device::sega_hangon_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
127   : sega_16bit_sprite_device(mconfig, SEGA_HANGON_SPRITES, "Sega Hang On Sprites", tag, owner)
80128{
81   UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
82   const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
83   const UINT8 *zoom = (const UINT8 *)machine.root_device().memregion("proms")->base();
84   sega16sp_state *sega16sp = get_safe_token(device);
85   UINT16* data = sega16sp->spriteram;
129   set_origin(189, -1);
130}
86131
87   /* first scan forward to find the end of the list */
88   for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8)
89      if ((data[0] >> 8) > 0xf0)
90         break;
91132
92   /* now scan backwards and render the sprites in order */
93   for (data -= 8; data >= sega16sp->spriteram; data -= 8)
133//-------------------------------------------------
134//  draw -- render the sprites within the cliprect
135//-------------------------------------------------
136
137void sega_hangon_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect)
138{
139   //
140   //   Hang On-style sprites
141   //
142   //       Offs  Bits               Usage
143   //        +0   bbbbbbbb --------  Bottom scanline of sprite - 1
144   //        +0   -------- tttttttt  Top scanline of sprite - 1
145   //        +2   bbbb---- --------  Sprite bank
146   //        +2   -------x xxxxxxxx  X position of sprite (position $BD is screen position 0)
147   //        +4   pppppppp pppppppp  Signed 16-bit pitch value between scanlines
148   //        +6   -ooooooo oooooooo  Offset within selected sprite bank
149   //        +6   f------- --------  Horizontal flip: read the data backwards if set
150   //        +8   --cccccc --------  Sprite color palette
151   //        +8   -------- zzzzzz--  Zoom factor
152   //        +8   -------- ------pp  Sprite priority
153   //        +E   dddddddd dddddddd  Scratch space for current address
154   //
155   //    Final bitmap format:
156   //
157   //             ----pp-- --------  Sprite priority
158   //             ------cc cccc----  Sprite color palette
159   //             -------- ----llll  4-bit pixel data
160   //
161   //   Special notes:
162   //
163   //       There is an interaction between the horizonal flip bit and the offset.
164   //       The offset is maintained as a 16-bit value, even though only the lower
165   //       15 bits are used for the address. The top bit is used to control flipping.
166   //       This means that if the low 15 bits overflow during rendering, the sprite
167   //       data will be read backwards after the overflow. This is important to
168   //       emulate correctly as many games make use of this feature to render sprites
169   //       at the beginning of a bank.
170   //
171
172   // render the sprites in order
173   const UINT16 *spritebase = reinterpret_cast<const UINT16 *>(region()->base());
174   UINT8 numbanks = region()->bytes() / 0x10000;
175   const UINT8 *zoom = memregion("zoom")->base();
176   UINT16 *ramend = spriteram() + spriteram_elements();
177   for (UINT16 *data = spriteram(); data < ramend; data += 8)
94178   {
95      int bottom  = (data[0] >> 8) + 1;
96      int top     = (data[0] & 0xff) + 1;
97      int bank    = sega16sp->bank[(data[1] >> 12) & 0xf];
98      int xpos    = (data[1] & 0x1ff) - 0xbd;
99      int pitch   = (INT16)data[2];
179      // fetch the bottom; stop when we get something out of range
180      int bottom  = data[0] >> 8;
181      if (bottom > 0xf0)
182         break;
183
184      // extract remaining parameters
185      int top     = data[0] & 0xff;
186      int bank    = m_bank[(data[1] >> 12) & 0xf];
187      int xpos    = data[1] & 0x1ff;
188      int pitch   = INT16(data[2]);
100189      UINT16 addr = data[3];
101      int color  = sega16sp->colorbase + (((data[4] >> 8) & 0x3f) << 4);
190      int colpri  = (((data[4] >> 8) & 0x3f) << 4) | (((data[4] >> 0) & 0x3) << 10);
102191      int vzoom   = (data[4] >> 2) & 0x3f;
103192      int hzoom   = vzoom << 1;
104      int sprpri  = 1 << ((data[4] >> 0) & 0x3);
105      int x, y, pix, zaddr, zmask;
106      const UINT16 *spritedata;
107193
108      /* initialize the end address to the start address */
194      // initialize the end address to the start address
109195      data[7] = addr;
110196
111      /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */
112      if ((top >= bottom) || bank == 255)
197      // if hidden, or top greater than/equal to bottom, or invalid bank, punt
198      if (top >= bottom || bank == 255)
113199         continue;
114200
115      /* clamp to within the memory region size */
201      // clamp to within the memory region size
116202      if (numbanks)
117203         bank %= numbanks;
118      spritedata = spritebase + 0x8000 * bank;
204      const UINT16 *spritedata = spritebase + 0x8000 * bank;
119205
120      /* determine the starting zoom address and mask */
121      zaddr = (vzoom & 0x38) << 5;
122      zmask = 1 << (vzoom & 7);
206      // determine the starting zoom address and mask
207      int zaddr = (vzoom & 0x38) << 5;
208      int zmask = 1 << (vzoom & 7);
123209
124      /* loop from top to bottom */
125      for (y = top; y < bottom; y++)
210      // loop from top to bottom
211      int minx = xpos;
212      int maxx = xpos;
213      int miny = -1;
214      int maxy = -1;
215      for (int y = top; y < bottom; y++)
126216      {
127         /* advance a row */
217         // advance a row
128218         addr += pitch;
129219
130         /* if the zoom bit says so, add pitch a second time */
220         // if the zoom bit says so, add pitch a second time
131221         if (zoom[zaddr++] & zmask)
132222            addr += pitch;
133223
134         /* skip drawing if not within the cliprect */
224         // skip drawing if not within the cliprect
135225         if (y >= cliprect.min_y && y <= cliprect.max_y)
136226         {
137            UINT16 *dest = &bitmap.pix16(y);
138            UINT8 *pri = &machine.priority_bitmap.pix8(y);
227            UINT16 *dest = &bitmap.pix(y);
139228            int xacc = 0x00;
229            int x;
140230
141            /* note that the System 16A sprites have a design flaw that allows the address */
142            /* to carry into the flip flag, which is the topmost bit -- it is very important */
143            /* to emulate this as the games compensate for it */
231            // note that the System 16A sprites have a design flaw that allows the address
232            // to carry into the flip flag, which is the topmost bit -- it is very important
233            // to emulate this as the games compensate for it
144234
145            /* non-flipped case */
235            // non-flipped case
146236            if (!(addr & 0x8000))
147237            {
148               /* start at the word before because we preincrement below */
238               // start at the word before because we preincrement below
149239               data[7] = addr - 1;
150240               for (x = xpos; x <= cliprect.max_x; )
151241               {
152242                  UINT16 pixels = spritedata[++data[7] & 0x7fff];
153243
154                  /* draw four pixels */
155                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
156                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
157                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
158                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
244                  // draw four pixels
245                  int pix;
246                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
247                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
248                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
249                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
159250
160                  /* stop if the last pixel in the group was 0xf */
251                  // stop if the last pixel in the group was 0xf
161252                  if (pix == 15)
162253                     break;
163254               }
164255            }
165256
166            /* flipped case */
257            // flipped case
167258            else
168259            {
169               /* start at the word after because we predecrement below */
260               // start at the word after because we predecrement below
170261               data[7] = addr + 1;
171262               for (x = xpos; x <= cliprect.max_x; )
172263               {
173264                  UINT16 pixels = spritedata[--data[7] & 0x7fff];
174265
175                  /* draw four pixels */
176                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
177                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
178                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
179                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
266                  // draw four pixels
267                  int pix;
268                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
269                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
270                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
271                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
180272
181                  /* stop if the last pixel in the group was 0xf */
273                  // stop if the last pixel in the group was 0xf
182274                  if (pix == 15)
183275                     break;
184276               }
185277            }
278           
279            // update bounds
280            if (x > maxx) maxx = x;
281            if (miny == -1) miny = y;
282            maxy = y;
186283         }
187284      }
285     
286      // mark dirty
287      if (miny != -1)
288         mark_dirty(minx, maxx, miny, maxy);
188289   }
189290}
190291
191292
192293
193/*******************************************************************************************
194 *
195 *  Space Harrier-style sprites
196 *
197 *      Offs  Bits               Usage
198 *       +0   bbbbbbbb --------  Bottom scanline of sprite - 1
199 *       +0   -------- tttttttt  Top scanline of sprite - 1
200 *       +2   bbbb---- --------  Sprite bank
201 *       +2   -------x xxxxxxxx  X position of sprite (position $BD is screen position 0)
202 *       +4   s------- --------  Sprite shadow enable (0=enable, 1=disable)
203 *       +4   -p------ --------  Sprite priority
204 *       +4   --cccccc --------  Sprite color palette
205 *       +4   -------- -ppppppp  Signed 7-bit pitch value between scanlines
206 *       +6   f------- --------  Horizontal flip: read the data backwards if set
207 *       +6   -ooooooo oooooooo  Offset within selected sprite bank
208 *       +8   --zzzzzz --------  Horizontal zoom factor
209 *       +8   -------- --zzzzzz  Vertical zoom factor
210 *       +E   dddddddd dddddddd  Scratch space for current address
211 *
212 *  Special notes:
213 *
214 *      There is an interaction between the horizonal flip bit and the offset.
215 *      The offset is maintained as a 16-bit value, even though only the lower
216 *      15 bits are used for the address. The top bit is used to control flipping.
217 *      This means that if the low 15 bits overflow during rendering, the sprite
218 *      data will be read backwards after the overflow. This is important to
219 *      emulate correctly as many games make use of this feature to render sprites
220 *      at the beginning of a bank.
221 *
222 *******************************************************************************************/
294//****************************************************************************
295//  SPACE HARRIER-STYLE SPRITES
296//****************************************************************************
223297
224#define sharrier_draw_pixel()                                    \
225   /* only draw if onscreen, not 0 or 15 */                        \
226   if (pix != 0 && pix != 15)                                    \
227   {                                                      \
228      /* are we high enough priority to be visible? */               \
229      if (sprpri > pri[x])                                    \
230      {                                                   \
231         /* shadow/hilight mode? */                              \
232         if (shadow && pix == 0xa)                              \
233            dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? segaic16_palette.entries*2 : segaic16_palette.entries;   \
234                                                         \
235         /* regular draw */                                    \
236         else                                             \
237            dest[x] = pix | color;                              \
238      }                                                   \
239                                                         \
240      /* always mark priority so no one else draws here */            \
241      pri[x] = 0xff;                                          \
242   }                                                      \
298//-------------------------------------------------
299//  sega_sharrier_sprite_device -- constructor
300//-------------------------------------------------
243301
244void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
302sega_sharrier_sprite_device::sega_sharrier_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
303   : sega_16bit_sprite_device(mconfig, SEGA_SHARRIER_SPRITES, "Sega Space Harrier Sprites", tag, owner)
245304{
246   UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x20000;
247   const UINT32 *spritebase = (const UINT32 *)machine.root_device().memregion("gfx2")->base();
248   const UINT8 *zoom = (const UINT8 *)machine.root_device().memregion("proms")->base();
249   sega16sp_state *sega16sp = get_safe_token(device);
250   UINT16* data = sega16sp->spriteram;
305   set_origin(189, -1);
306}
251307
252   /* first scan forward to find the end of the list */
253   for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8)
254      if ((data[0] >> 8) > 0xf0)
255         break;
256308
257   /* now scan backwards and render the sprites in order */
258   for (data -= 8; data >= sega16sp->spriteram; data -= 8)
309//-------------------------------------------------
310//  draw -- render the sprites within the cliprect
311//-------------------------------------------------
312
313void sega_sharrier_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect)
314{
315   //
316   //   Space Harrier-style sprites
317   //
318   //      Offs  Bits               Usage
319   //       +0   bbbbbbbb --------  Bottom scanline of sprite - 1
320   //       +0   -------- tttttttt  Top scanline of sprite - 1
321   //       +2   bbbb---- --------  Sprite bank
322   //       +2   -------x xxxxxxxx  X position of sprite (position $BD is screen position 0)
323   //       +4   s------- --------  Sprite shadow disable (0=enable, 1=disable)
324   //       +4   -p------ --------  Sprite priority
325   //       +4   --cccccc --------  Sprite color palette
326   //       +4   -------- -ppppppp  Signed 7-bit pitch value between scanlines
327   //       +6   f------- --------  Horizontal flip: read the data backwards if set
328   //       +6   -ooooooo oooooooo  Offset within selected sprite bank
329   //       +8   --zzzzzz --------  Horizontal zoom factor
330   //       +8   -------- --zzzzzz  Vertical zoom factor
331   //       +E   dddddddd dddddddd  Scratch space for current address
332   //
333   //    Final bitmap format:
334   //
335   //             ----s--- --------  Sprite shadow disable
336   //             -----p-- --------  Sprite priority
337   //             ------cc cccc----  Sprite color palette
338   //             -------- ----llll  4-bit pixel data
339   //
340   //   Special notes:
341   //
342   //      There is an interaction between the horizonal flip bit and the offset.
343   //      The offset is maintained as a 16-bit value, even though only the lower
344   //      15 bits are used for the address. The top bit is used to control flipping.
345   //      This means that if the low 15 bits overflow during rendering, the sprite
346   //      data will be read backwards after the overflow. This is important to
347   //      emulate correctly as many games make use of this feature to render sprites
348   //      at the beginning of a bank.
349   //
350   
351   // render the sprites in order
352   const UINT32 *spritebase = reinterpret_cast<const UINT32 *>(region()->base());
353   UINT8 numbanks = region()->bytes() / 0x20000;
354   const UINT8 *zoom = memregion("zoom")->base();
355   UINT16 *ramend = spriteram() + spriteram_elements();
356   for (UINT16 *data = spriteram(); data < ramend; data += 8)
259357   {
260      int bottom  = (data[0] >> 8) + 1;
261      int top     = (data[0] & 0xff) + 1;
262      int bank    = sega16sp->bank[(data[1] >> 12) & 0x7];
263      int xpos    = (data[1] & 0x1ff) - 0xbd;
264      int shadow  = (~data[2] >> 15) & 1;
265      int sprpri  = ((data[2] >> 14) & 1) ? (1<<3) : (1<<1);
266      int color   = sega16sp->colorbase + (((data[2] >> 8) & 0x3f) << 4);
267      int pitch   = (INT16)(data[2] << 9) >> 9;
358      // fetch the bottom; stop when we get something out of range
359      int bottom  = data[0] >> 8;
360      if (bottom > 0xf0)
361         break;
362
363      // extract remaining parameters
364      int top     = data[0] & 0xff;
365      int bank    = m_bank[(data[1] >> 12) & 0x7];
366      int xpos    = data[1] & 0x1ff;
367      int colpri  = ((data[2] >> 8) & 0xff) << 4;
368      int pitch   = INT16(data[2] << 9) >> 9;
268369      UINT16 addr = data[3];
269370      int hzoom   = ((data[4] >> 8) & 0x3f) << 1;
270371      int vzoom   = (data[4] >> 0) & 0x3f;
271      int x, y, pix, zaddr, zmask;
272      const UINT32 *spritedata;
273372
274      /* initialize the end address to the start address */
373      // initialize the end address to the start address
275374      data[7] = addr;
276375
277      /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */
278      if ((top >= bottom) || bank == 255)
376      // if hidden, or top greater than/equal to bottom, or invalid bank, punt
377      if (top >= bottom || bank == 255)
279378         continue;
280379
281      /* clamp to within the memory region size */
380      // clamp to within the memory region size
282381      if (numbanks)
283382         bank %= numbanks;
284      spritedata = spritebase + 0x8000 * bank;
383      const UINT32 *spritedata = spritebase + 0x8000 * bank;
285384
286      /* determine the starting zoom address and mask */
287      zaddr = (vzoom & 0x38) << 5;
288      zmask = 1 << (vzoom & 7);
385      // determine the starting zoom address and mask
386      int zaddr = (vzoom & 0x38) << 5;
387      int zmask = 1 << (vzoom & 7);
289388
290      /* loop from top to bottom */
291      for (y = top; y < bottom; y++)
389      // loop from top to bottom
390      int minx = xpos;
391      int maxx = xpos;
392      int miny = -1;
393      int maxy = -1;
394      for (int y = top; y < bottom; y++)
292395      {
293         /* advance a row */
396         // advance a row
294397         addr += pitch;
295398
296         /* if the zoom bit says so, add pitch a second time */
399         // if the zoom bit says so, add pitch a second time
297400         if (zoom[zaddr++] & zmask)
298401            addr += pitch;
299402
300         /* skip drawing if not within the cliprect */
403         // skip drawing if not within the cliprect
301404         if (y >= cliprect.min_y && y <= cliprect.max_y)
302405         {
303            UINT16 *dest = &bitmap.pix16(y);
304            UINT8 *pri = &machine.priority_bitmap.pix8(y);
406            UINT16 *dest = &bitmap.pix(y);
305407            int xacc = 0x00;
408            int x;
306409
307            /* note that the System 16A sprites have a design flaw that allows the address */
308            /* to carry into the flip flag, which is the topmost bit -- it is very important */
309            /* to emulate this as the games compensate for it */
410            // note that the System 16A sprites have a design flaw that allows the address
411            // to carry into the flip flag, which is the topmost bit -- it is very important
412            // to emulate this as the games compensate for it
310413
311            /* non-flipped case */
414            // non-flipped case
312415            if (!(addr & 0x8000))
313416            {
314               /* start at the word before because we preincrement below */
417               // start at the word before because we preincrement below
315418               data[7] = addr - 1;
316419               for (x = xpos; x <= cliprect.max_x; )
317420               {
318421                  UINT32 pixels = spritedata[++data[7] & 0x7fff];
319422
320                  /* draw 8 pixels */
321                  pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
322                  pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
323                  pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
324                  pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
325                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
326                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
327                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
328                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
423                  // draw 8 pixels
424                  int pix;
425                  pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
426                  pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
427                  pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
428                  pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
429                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
430                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
431                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
432                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
329433
330                  /* stop if the last pixel in the group was 0xf */
434                  // stop if the last pixel in the group was 0xf
331435                  if (pix == 15)
332436                     break;
333437               }
334438            }
335439
336            /* flipped case */
440            // flipped case
337441            else
338442            {
339               /* start at the word after because we predecrement below */
443               // start at the word after because we predecrement below
340444               data[7] = addr + 1;
341445               for (x = xpos; x <= cliprect.max_x; )
342446               {
343447                  UINT32 pixels = spritedata[--data[7] & 0x7fff];
344448
345                  /* draw 8 pixels */
346                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
347                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
348                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
349                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
350                  pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
351                  pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
352                  pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
353                  pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
449                  // draw 8 pixels
450                  int pix;
451                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
452                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
453                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
454                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
455                  pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
456                  pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
457                  pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
458                  pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x++; }
354459
355                  /* stop if the last pixel in the group was 0xf */
460                  // stop if the last pixel in the group was 0xf
356461                  if (pix == 15)
357462                     break;
358463               }
359464            }
465           
466            // update bounds
467            if (x > maxx) maxx = x;
468            if (miny == -1) miny = y;
469            maxy = y;
360470         }
361471      }
472     
473      // mark dirty
474      if (miny != -1)
475         mark_dirty(minx, maxx, miny, maxy);
362476   }
363477}
364478
365479
366480
367/*******************************************************************************************
368 *
369 *  System 16A-style sprites
370 *
371 *      Offs  Bits               Usage
372 *       +0   bbbbbbbb --------  Bottom scanline of sprite - 1
373 *       +0   -------- tttttttt  Top scanline of sprite - 1
374 *       +2   -------x xxxxxxxx  X position of sprite (position $BD is screen position 0)
375 *       +4   pppppppp pppppppp  Signed 16-bit pitch value between scanlines
376 *       +6   -ooooooo oooooooo  Offset within selected sprite bank
377 *       +6   f------- --------  Horizontal flip: read the data backwards if set
378 *       +8   --cccccc --------  Sprite color palette
379 *       +8   -------- -bbb----  Sprite bank
380 *       +8   -------- ------pp  Sprite priority
381 *       +E   dddddddd dddddddd  Scratch space for current address
382 *
383 *  Special notes:
384 *
385 *      There is an interaction between the horizonal flip bit and the offset.
386 *      The offset is maintained as a 16-bit value, even though only the lower
387 *      15 bits are used for the address. The top bit is used to control flipping.
388 *      This means that if the low 15 bits overflow during rendering, the sprite
389 *      data will be read backwards after the overflow. This is important to
390 *      emulate correctly as many games make use of this feature to render sprites
391 *      at the beginning of a bank.
392 *
393 *******************************************************************************************/
481//****************************************************************************
482//  SYSTEM 16A-STYLE SPRITES
483//****************************************************************************
394484
395#define system16a_draw_pixel()                                    \
396   /* only draw if onscreen, not 0 or 15 */                        \
397   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
398   {                                                      \
399      /* are we high enough priority to be visible? */               \
400      if (sprpri > pri[x])                                    \
401      {                                                   \
402         /* shadow/hilight mode? */                              \
403         if (color == sega16sp->colorbase + (0x3f << 4))                  \
404            dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? segaic16_palette.entries*2 : segaic16_palette.entries;   \
405                                                         \
406         /* regular draw */                                    \
407         else                                             \
408            dest[x] = pix | color;                              \
409      }                                                   \
410                                                         \
411      /* always mark priority so no one else draws here */            \
412      pri[x] = 0xff;                                          \
413   }                                                      \
485//-------------------------------------------------
486//  sega_sys16a_sprite_device -- constructor
487//-------------------------------------------------
414488
415void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
489sega_sys16a_sprite_device::sega_sys16a_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
490   : sega_16bit_sprite_device(mconfig, SEGA_SYS16A_SPRITES, "Sega System 16A Sprites", tag, owner)
416491{
417   UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
418   const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
419   sega16sp_state *sega16sp = get_safe_token(device);
420   UINT16* data = sega16sp->spriteram;
492   set_origin(189, -1);
493}
421494
422   /* first scan forward to find the end of the list */
423   for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8)
424      if ((data[0] >> 8) > 0xf0)
425         break;
426495
427   /* now scan backwards and render the sprites in order */
428   for (data -= 8; data >= sega16sp->spriteram; data -= 8)
496//-------------------------------------------------
497//  draw -- render the sprites within the cliprect
498//-------------------------------------------------
499
500void sega_sys16a_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect)
501{
502   //
503   //   System 16A-style sprites
504   //
505   //      Offs  Bits               Usage
506   //       +0   bbbbbbbb --------  Bottom scanline of sprite - 1
507   //       +0   -------- tttttttt  Top scanline of sprite - 1
508   //       +2   -------x xxxxxxxx  X position of sprite (position $BD is screen position 0)
509   //       +4   pppppppp pppppppp  Signed 16-bit pitch value between scanlines
510   //       +6   -ooooooo oooooooo  Offset within selected sprite bank
511   //       +6   f------- --------  Horizontal flip: read the data backwards if set
512   //       +8   --cccccc --------  Sprite color palette
513   //       +8   -------- -bbb----  Sprite bank
514   //       +8   -------- ------pp  Sprite priority
515   //       +E   dddddddd dddddddd  Scratch space for current address
516   //
517   //    Final bitmap format:
518   //
519   //             ----pp-- --------  Sprite priority
520   //             ------cc cccc----  Sprite color palette
521   //             -------- ----llll  4-bit pixel data
522   //
523   //   Special notes:
524   //
525   //      There is an interaction between the horizonal flip bit and the offset.
526   //      The offset is maintained as a 16-bit value, even though only the lower
527   //      15 bits are used for the address. The top bit is used to control flipping.
528   //      This means that if the low 15 bits overflow during rendering, the sprite
529   //      data will be read backwards after the overflow. This is important to
530   //      emulate correctly as many games make use of this feature to render sprites
531   //      at the beginning of a bank.
532   //
533
534   // render the sprites in order
535   const UINT16 *spritebase = reinterpret_cast<const UINT16 *>(region()->base());
536   UINT8 numbanks = region()->bytes() / 0x10000;
537   UINT16 *ramend = spriteram() + spriteram_elements();
538   for (UINT16 *data = spriteram(); data < ramend; data += 8)
429539   {
430      int bottom  = (data[0] >> 8) + 1;
431      int top     = (data[0] & 0xff) + 1;
432      int xpos    = (data[1] & 0x1ff) - 0xbd;
433      int pitch   = (INT16)data[2];
540      // fetch the bottom; stop when we get something out of range
541      int bottom  = data[0] >> 8;
542      if (bottom > 0xf0)
543         break;
544
545      // extract remaining parameters
546      int top     = data[0] & 0xff;
547      int xpos    = data[1] & 0x1ff;
548      int pitch   = INT16(data[2]);
434549      UINT16 addr = data[3];
435      int color   = sega16sp->colorbase + (((data[4] >> 8) & 0x3f) << 4);
436      int bank    = sega16sp->bank[(data[4] >> 4) & 0x7];
437      int sprpri  = 1 << ((data[4] >> 0) & 0x3);
438      const UINT16 *spritedata;
439      int x, y, pix, xdelta = 1;
550      int colpri  = (((data[4] >> 8) & 0x3f) << 4) | (((data[4] >> 0) & 0x3) << 10);
551      int bank    = m_bank[(data[4] >> 4) & 0x7];
440552
441      /* initialize the end address to the start address */
553      // initialize the end address to the start address
442554      data[7] = addr;
443555
444      /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */
445      if ((top >= bottom) || bank == 255)
556      // if hidden, or top greater than/equal to bottom, or invalid bank, punt
557      if (top >= bottom || bank == 255)
446558         continue;
447559
448      /* clamp to within the memory region size */
560      // clamp to within the memory region size
449561      if (numbanks)
450562         bank %= numbanks;
451      spritedata = spritebase + 0x8000 * bank;
563      const UINT16 *spritedata = spritebase + 0x8000 * bank;
452564
453      /* adjust positions for screen flipping */
454      if (sega16sp->flip)
565      // adjust positions for screen flipping
566      int xdelta = 1;
567      if (m_flip)
455568      {
456569         int temp = top;
457570         top = 224 - bottom;
r17593r17594
460573         xdelta = -1;
461574      }
462575
463      /* loop from top to bottom */
464      for (y = top; y < bottom; y++)
576      // loop from top to bottom
577      int minx = xpos;
578      int maxx = xpos;
579      int miny = -1;
580      int maxy = -1;
581      for (int y = top; y < bottom; y++)
465582      {
466         /* advance a row */
583         // advance a row
467584         addr += pitch;
468585
469         /* skip drawing if not within the cliprect */
586         // skip drawing if not within the cliprect
470587         if (y >= cliprect.min_y && y <= cliprect.max_y)
471588         {
472            UINT16 *dest = &bitmap.pix16(y);
473            UINT8 *pri = &machine.priority_bitmap.pix8(y);
589            UINT16 *dest = &bitmap.pix(y);
590            int x;
474591
475            /* note that the System 16A sprites have a design flaw that allows the address */
476            /* to carry into the flip flag, which is the topmost bit -- it is very important */
477            /* to emulate this as the games compensate for it */
592            // note that the System 16A sprites have a design flaw that allows the address
593            // to carry into the flip flag, which is the topmost bit -- it is very important
594            // to emulate this as the games compensate for it
478595
479            /* non-flipped case */
596            // non-flipped case
480597            if (!(addr & 0x8000))
481598            {
482               /* start at the word before because we preincrement below */
599               // start at the word before because we preincrement below
483600               data[7] = addr - 1;
484601               for (x = xpos; ((xpos - x) & 0x1ff) != 1; )
485602               {
486603                  UINT16 pixels = spritedata[++data[7] & 0x7fff];
487604
488                  /* draw four pixels */
489                  pix = (pixels >> 12) & 0xf; system16a_draw_pixel(); x += xdelta;
490                  pix = (pixels >>  8) & 0xf; system16a_draw_pixel(); x += xdelta;
491                  pix = (pixels >>  4) & 0xf; system16a_draw_pixel(); x += xdelta;
492                  pix = (pixels >>  0) & 0xf; system16a_draw_pixel(); x += xdelta;
605                  // draw four pixels
606                  int pix;
607                  pix = (pixels >> 12) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
608                  pix = (pixels >>  8) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
609                  pix = (pixels >>  4) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
610                  pix = (pixels >>  0) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
493611
494                  /* stop if the last pixel in the group was 0xf */
612                  // stop if the last pixel in the group was 0xf
495613                  if (pix == 15)
496614                     break;
497615               }
498616            }
499617
500            /* flipped case */
618            // flipped case
501619            else
502620            {
503               /* start at the word after because we predecrement below */
621               // start at the word after because we predecrement below
504622               data[7] = addr + 1;
505623               for (x = xpos; ((xpos - x) & 0x1ff) != 1; )
506624               {
507625                  UINT16 pixels = spritedata[--data[7] & 0x7fff];
508626
509                  /* draw four pixels */
510                  pix = (pixels >>  0) & 0xf; system16a_draw_pixel(); x += xdelta;
511                  pix = (pixels >>  4) & 0xf; system16a_draw_pixel(); x += xdelta;
512                  pix = (pixels >>  8) & 0xf; system16a_draw_pixel(); x += xdelta;
513                  pix = (pixels >> 12) & 0xf; system16a_draw_pixel(); x += xdelta;
627                  // draw four pixels
628                  int pix;
629                  pix = (pixels >>  0) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
630                  pix = (pixels >>  4) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
631                  pix = (pixels >>  8) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
632                  pix = (pixels >> 12) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
514633
515                  /* stop if the last pixel in the group was 0xf */
634                  // stop if the last pixel in the group was 0xf
516635                  if (pix == 15)
517636                     break;
518637               }
519638            }
639           
640            // update bounds
641            if (x > maxx) maxx = x;
642            if (x < minx) minx = x;
643            if (miny == -1) miny = y;
644            maxy = y;
520645         }
521646      }
647     
648      // mark dirty
649      if (miny != -1)
650         mark_dirty(minx, maxx, miny, maxy);
522651   }
523652}
524653
525654
655//****************************************************************************
656//  BOOTLEG SYSTEM 16A-STYLE SPRITES
657//****************************************************************************
526658
527/*******************************************************************************************
528 *
529 *  System 16B-style sprites
530 *
531 *      Offs  Bits               Usage
532 *       +0   bbbbbbbb --------  Bottom scanline of sprite - 1
533 *       +0   -------- tttttttt  Top scanline of sprite - 1
534 *       +2   -------x xxxxxxxx  X position of sprite (position $BD is screen position 0)
535 *       +4   e------- --------  Signify end of sprite list
536 *       +4   -h------ --------  Hide this sprite
537 *       +4   -------f --------  Horizontal flip: read the data backwards if set
538 *       +4   -------- pppppppp  Signed 8-bit pitch value between scanlines
539 *       +6   oooooooo oooooooo  Offset within selected sprite bank
540 *       +8   ----bbbb --------  Sprite bank
541 *       +8   -------- pp------  Sprite priority, relative to tilemaps
542 *       +8   -------- --cccccc  Sprite color palette
543 *       +A   ------vv vvv-----  Vertical zoom factor (0 = full size, 0x10 = half size)
544 *       +A   -------- ---hhhhh  Horizontal zoom factor (0 = full size, 0x10 = half size)
545 *       +E   dddddddd dddddddd  Scratch space for current address
546 *
547 *  Note that the zooming described below is 100% accurate to the real board.
548 *
549 *******************************************************************************************/
659//-------------------------------------------------
660//  bootleg_sys16a_sprite_device -- constructor
661//-------------------------------------------------
550662
551#define system16b_draw_pixel()                                    \
552   /* only draw if onscreen, not 0 or 15 */                        \
553   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
554   {                                                      \
555      /* are we high enough priority to be visible? */               \
556      if (sprpri > pri[x])                                    \
557      {                                                   \
558         /* shadow/hilight mode? */                              \
559         if (color == sega16sp->colorbase + (0x3f << 4))                  \
560         {                                                \
561            /* we have to check this for System 18 so that we don't */  \
562            /* attempt to shadow VDP pixels */                     \
563            if (dest[x] < segaic16_palette.entries)                        \
564               dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? segaic16_palette.entries*2 : segaic16_palette.entries; \
565         }                                                \
566                                                         \
567         /* regular draw */                                    \
568         else                                             \
569            dest[x] = pix | color;                              \
570      }                                                   \
571                                                         \
572      /* always mark priority so no one else draws here */            \
573      pri[x] = 0xff;                                          \
574   }                                                      \
663bootleg_sys16a_sprite_device::bootleg_sys16a_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
664   : sega_16bit_sprite_device(mconfig, BOOTLEG_SYS16A_SPRITES, "Bootleg System 16A Sprites", tag, owner)
665{
666   m_addrmap[0] = 0;
667   m_addrmap[1] = 1;
668   m_addrmap[2] = 2;
669   m_addrmap[3] = 3;
670   m_addrmap[4] = 4;
671   m_addrmap[5] = 5;
672   m_addrmap[6] = 6;
673   m_addrmap[7] = 7;
674   set_origin(189, -1);
675}
575676
576void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
677
678//-------------------------------------------------
679//  static_set_remap -- configure sprite address
680//   remapping
681//-------------------------------------------------
682
683void bootleg_sys16a_sprite_device::static_set_remap(device_t &device, UINT8 offs0, UINT8 offs1, UINT8 offs2, UINT8 offs3, UINT8 offs4, UINT8 offs5, UINT8 offs6, UINT8 offs7)
577684{
578   UINT8 numbanks;
579   const UINT16 *spritebase;
580   sega16sp_state *sega16sp = get_safe_token(device);
581   UINT16* data = sega16sp->spriteram;
685   bootleg_sys16a_sprite_device &target = downcast<bootleg_sys16a_sprite_device &>(device);
686   target.m_addrmap[0] = offs0;
687   target.m_addrmap[1] = offs1;
688   target.m_addrmap[2] = offs2;
689   target.m_addrmap[3] = offs3;
690   target.m_addrmap[4] = offs4;
691   target.m_addrmap[5] = offs5;
692   target.m_addrmap[6] = offs6;
693   target.m_addrmap[7] = offs7;
694}
582695
583   spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
584   if (!spritebase)
585      return;
586696
587   numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x20000;
697//-------------------------------------------------
698//  draw -- render the sprites within the cliprect
699//-------------------------------------------------
588700
589   /* first scan forward to find the end of the list */
590   for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8)
591      if (data[2] & 0x8000)
592         break;
701void bootleg_sys16a_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect)
702{
703   //
704   //   Bootleg System 16A-style sprites
705   //
706   //   These are identical to regular System 16A sprites (see above), with two exceptions:
707   //
708   //      1. Addresses within each sprite entry are generally shuffled relative
709   //         to the original, and
710   //
711   //      2. The pitch increment happens at the end, not at the beginning of
712   //         the loop.
713   //
593714
594   /* now scan backwards and render the sprites in order */
595   for (data -= 8; data >= sega16sp->spriteram; data -= 8)
715   // render the sprites in order
716   const UINT16 *spritebase = reinterpret_cast<const UINT16 *>(region()->base());
717   UINT8 numbanks = region()->bytes() / 0x10000;
718   UINT16 *ramend = spriteram() + spriteram_elements();
719   for (UINT16 *data = spriteram(); data < ramend; data += 8)
596720   {
597      int bottom  = data[0] >> 8;
598      int top     = data[0] & 0xff;
599      int xpos    = (data[1] & 0x1ff);
600      int hide    = data[2] & 0x4000;
601      int flip    = data[2] & 0x100;
602      int pitch   = (INT8)(data[2] & 0xff);
603      UINT16 addr = data[3];
604      int bank    = sega16sp->bank[(data[4] >> 8) & 0xf];
605      int sprpri  = 1 << ((data[4] >> 6) & 0x3);
606      int color   = sega16sp->colorbase + ((data[4] & 0x3f) << 4);
607      int vzoom   = (data[5] >> 5) & 0x1f;
608      int hzoom   = data[5] & 0x1f;
609      const UINT16 *spritedata;
610      int x, y, pix, xdelta = 1;
721      // fetch the bottom; stop when we get something out of range
722      int bottom  = data[m_addrmap[0]] >> 8;
723      if (bottom > 0xf0)
724         break;
611725
612      /* some bootlegs have offset sprites */
613      xpos += sega16sp->xoffs;
614      xpos &= 0x1ff;
726      // extract remaining parameters
727      int top     = data[m_addrmap[0]] & 0xff;
728      int xpos    = data[m_addrmap[1]] & 0x1ff;
729      int pitch   = INT16(data[m_addrmap[2]]);
730      UINT16 addr = data[m_addrmap[3]];
731      int colpri  = (((data[m_addrmap[4]] >> 8) & 0x3f) << 4) | (((data[m_addrmap[4]] >> 0) & 0x3) << 10);
732      int bank    = m_bank[(data[m_addrmap[4]] >> 4) & 0x7];
615733
616      /* originals all have this offset */
617      xpos -= 0xb8;
734      // initialize the end address to the start address
735      UINT16 &data7 = data[m_addrmap[7]];
736      data7 = addr;
618737
619      /* initialize the end address to the start address */
620      data[7] = addr;
621
622      /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */
623      if (hide || (top >= bottom) || bank == 255)
738      // if hidden, or top greater than/equal to bottom, or invalid bank, punt
739      if (top >= bottom || bank == 255)
624740         continue;
625741
626      /* clamp to within the memory region size */
742      // clamp to within the memory region size
627743      if (numbanks)
628744         bank %= numbanks;
629      spritedata = spritebase + 0x10000 * bank;
745      const UINT16 *spritedata = spritebase + 0x8000 * bank;
630746
631      /* reset the yzoom counter */
632      data[5] &= 0x03ff;
633
634      /* adjust positions for screen flipping */
635      if (sega16sp->flip)
747      // adjust positions for screen flipping
748      int xdelta = 1;
749      if (m_flip)
636750      {
637751         int temp = top;
638752         top = 224 - bottom;
r17593r17594
641755         xdelta = -1;
642756      }
643757
644      /* loop from top to bottom */
645      for (y = top; y < bottom; y++)
758      // loop from top to bottom
759      int minx = xpos;
760      int maxx = xpos;
761      int miny = -1;
762      int maxy = -1;
763      for (int y = top; y < bottom; y++)
646764      {
647         /* advance a row */
648         addr += pitch;
649
650         /* accumulate zoom factors; if we carry into the high bit, skip an extra row */
651         data[5] += vzoom << 10;
652         if (data[5] & 0x8000)
653         {
654            addr += pitch;
655            data[5] &= ~0x8000;
656         }
657
658         /* skip drawing if not within the cliprect */
765         // skip drawing if not within the cliprect
659766         if (y >= cliprect.min_y && y <= cliprect.max_y)
660767         {
661            UINT16 *dest = &bitmap.pix16(y);
662            UINT8 *pri = &machine.priority_bitmap.pix8(y);
663            int xacc;
768            UINT16 *dest = &bitmap.pix(y);
769            int x;
664770
665            /* compute the initial X zoom accumulator; this is verified on the real PCB */
666            xacc = 4 * hzoom;
771            // note that the System 16A sprites have a design flaw that allows the address
772            // to carry into the flip flag, which is the topmost bit -- it is very important
773            // to emulate this as the games compensate for it
667774
668            /* non-flipped case */
669            if (!flip)
775            // non-flipped case
776            if (!(addr & 0x8000))
670777            {
671               /* start at the word before because we preincrement below */
672               data[7] = addr - 1;
778               // start at the word before because we preincrement below
779               data7 = addr - 1;
673780               for (x = xpos; ((xpos - x) & 0x1ff) != 1; )
674781               {
675                  UINT16 pixels = spritedata[++data[7]];
782                  UINT16 pixels = spritedata[++data7 & 0x7fff];
676783
677                  /* draw four pixels */
678                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; }
679                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; }
680                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; }
681                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; }
784                  // draw four pixels
785                  int pix;
786                  pix = (pixels >> 12) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
787                  pix = (pixels >>  8) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
788                  pix = (pixels >>  4) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
789                  pix = (pixels >>  0) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
682790
683                  /* stop if the last pixel in the group was 0xf */
791                  // stop if the last pixel in the group was 0xf
684792                  if (pix == 15)
685793                     break;
686794               }
687795            }
688796
689            /* flipped case */
797            // flipped case
690798            else
691799            {
692               /* start at the word after because we predecrement below */
693               data[7] = addr + 1;
800               // start at the word after because we predecrement below
801               data7 = addr + 1;
694802               for (x = xpos; ((xpos - x) & 0x1ff) != 1; )
695803               {
696                  UINT16 pixels = spritedata[--data[7]];
804                  UINT16 pixels = spritedata[--data7 & 0x7fff];
697805
698                  /* draw four pixels */
699                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; }
700                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; }
701                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; }
702                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; }
806                  // draw four pixels
807                  int pix;
808                  pix = (pixels >>  0) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
809                  pix = (pixels >>  4) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
810                  pix = (pixels >>  8) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
811                  pix = (pixels >> 12) & 0xf; if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta;
703812
704                  /* stop if the last pixel in the group was 0xf */
813                  // stop if the last pixel in the group was 0xf
705814                  if (pix == 15)
706815                     break;
707816               }
708817            }
818           
819            // update bounds
820            if (x > maxx) maxx = x;
821            if (x < minx) minx = x;
822            if (miny == -1) miny = y;
823            maxy = y;
709824         }
825
826         // advance a row - must be done at the end on the bootlegs!
827         addr += pitch;
710828      }
829     
830      // mark dirty
831      if (miny != -1)
832         mark_dirty(minx, maxx, miny, maxy);
711833   }
712834}
713835
714836
715/*******************************************************************************************
716 *
717 *  The Y-board variant has different mixing properties. The sprite implementation itself
718 *  is identical, however.
719 *
720 *******************************************************************************************/
721837
722#define yboard_16b_draw_pixel()                                  \
723   /* only draw if onscreen, not 0 or 15 */                        \
724   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
725   {                                                      \
726      /* are we high enough priority to be visible? */               \
727      if ((sprpri & 0x1f) < (pri[x] & 0x1f))                        \
728      {                                                   \
729         /* shadow/hilight mode? */                              \
730         if (pix == 14)                                       \
731            dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? segaic16_palette.entries*2 : segaic16_palette.entries;   \
732                                                         \
733         /* regular draw */                                    \
734         else                                             \
735            dest[x] = pix | color;                              \
736      }                                                   \
737                                                         \
738      /* always mark priority so no one else draws here */            \
739      pri[x] = 0;                                             \
740   }                                                      \
838//****************************************************************************
839//  SYSTEM 16B-STYLE SPRITES
840//****************************************************************************
741841
742void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
842//-------------------------------------------------
843//  sega_sys16b_sprite_device -- constructor
844//-------------------------------------------------
845
846sega_sys16b_sprite_device::sega_sys16b_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
847   : sega_16bit_sprite_device(mconfig, SEGA_SYS16B_SPRITES, "Sega System 16B Sprites", tag, owner)
743848{
744   UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x20000;
745   const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
746   sega16sp_state *sega16sp = get_safe_token(device);
747   UINT16* data = sega16sp->spriteram;
849   set_origin(184, 0x00);
850}
851   
748852
749   /* first scan forward to find the end of the list */
750   for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8)
853//-------------------------------------------------
854//  draw -- render the sprites within the cliprect
855//-------------------------------------------------
856
857void sega_sys16b_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect)
858{
859   //
860   //   System 16B-style sprites
861   //
862   //      Offs  Bits               Usage
863   //       +0   bbbbbbbb --------  Bottom scanline of sprite - 1
864   //       +0   -------- tttttttt  Top scanline of sprite - 1
865   //       +2   -------x xxxxxxxx  X position of sprite (position $BD is screen position 0)
866   //       +2   ---iiii- --------  Sprite/sprite priority for Y-board
867   //       +4   e------- --------  Signify end of sprite list
868   //       +4   -h------ --------  Hide this sprite
869   //       +4   -------f --------  Horizontal flip: read the data backwards if set
870   //       +4   -------- pppppppp  Signed 8-bit pitch value between scanlines
871   //       +6   oooooooo oooooooo  Offset within selected sprite bank
872   //       +8   ----bbbb --------  Sprite bank
873   //       +8   -------- pp------  Sprite priority, relative to tilemaps
874   //       +8   -------- --cccccc  Sprite color palette
875   //       +A   ------vv vvv-----  Vertical zoom factor (0 = full size, 0x10 = half size)
876   //       +A   -------- ---hhhhh  Horizontal zoom factor (0 = full size, 0x10 = half size)
877   //       +E   dddddddd dddddddd  Scratch space for current address
878   //
879   //    Final bitmap format:
880   //
881   //             iiii---- --------  Sprite/sprite priority for Y-board
882   //             ----pp-- --------  Sprite priority
883   //             ------cc cccc----  Sprite color palette
884   //             -------- ----llll  4-bit pixel data
885   //
886   //   Note that the zooming described below is 100% accurate to the real board.
887   //
888
889   // render the sprites in order
890   const UINT16 *spritebase = reinterpret_cast<const UINT16 *>(region()->base());
891   UINT8 numbanks = region()->bytes() / 0x20000;
892   UINT16 *ramend = spriteram() + spriteram_elements();
893   for (UINT16 *data = spriteram(); data < ramend; data += 8)
894   {
895      // stop when we hit the end of sprite list
751896      if (data[2] & 0x8000)
752897         break;
753898
754   /* now scan backwards and render the sprites in order */
755   for (data -= 8; data >= sega16sp->spriteram; data -= 8)
756   {
899      // extract parameters
757900      int bottom  = data[0] >> 8;
758901      int top     = data[0] & 0xff;
759      int xpos    = (data[1] & 0x1ff) - 0xb8;
760      int sprpri  = (data[1] >> 8) & 0x1e;   // 0x00 = high, 0x7f = low -- 0x71 = ship in gforce, 0x31 = strike fighter logo
902      int xpos    = data[1] & 0x1ff;
761903      int hide    = data[2] & 0x4000;
762904      int flip    = data[2] & 0x100;
763      int pitch   = (INT8)(data[2] & 0xff);
905      int pitch   = INT8(data[2] & 0xff);
764906      UINT16 addr = data[3];
765      int bank    = sega16sp->bank[(data[4] >> 8) & 0xf];
766      int color   = sega16sp->colorbase + ((data[4] & 0x7f) << 4);
907      int bank    = m_bank[(data[4] >> 8) & 0xf];
908      int colpri  = ((data[4] & 0xff) << 4) | (((data[1] >> 9) & 0xf) << 12);
767909      int vzoom   = (data[5] >> 5) & 0x1f;
768910      int hzoom   = data[5] & 0x1f;
769911      const UINT16 *spritedata;
770      int x, y, pix, xdelta = 1;
771912
772      /* initialize the end address to the start address */
913      xpos &= 0x1ff;
914
915      // initialize the end address to the start address
773916      data[7] = addr;
774917
775      /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */
776      if (hide || (top >= bottom) || bank == 255)
918      // if hidden, or top greater than/equal to bottom, or invalid bank, punt
919      if (hide || top >= bottom || bank == 255)
777920         continue;
778921
779      /* clamp to within the memory region size */
922      // clamp to within the memory region size
780923      if (numbanks)
781924         bank %= numbanks;
782925      spritedata = spritebase + 0x10000 * bank;
783926
784      /* reset the yzoom counter */
927      // reset the yzoom counter
785928      data[5] &= 0x03ff;
786929
787      /* adjust positions for screen flipping */
788      if (sega16sp->flip)
930      // adjust positions for screen flipping
931      int xdelta = 1;
932      if (m_flip)
789933      {
790934         int temp = top;
791935         top = 224 - bottom;
r17593r17594
794938         xdelta = -1;
795939      }
796940
797      /* loop from top to bottom */
798      for (y = top; y < bottom; y++)
941      // loop from top to bottom
942      int minx = xpos;
943      int maxx = xpos;
944      int miny = -1;
945      int maxy = -1;
946      for (int y = top; y < bottom; y++)
799947      {
800         /* advance a row */
948         // advance a row
801949         addr += pitch;
802950
803         /* accumulate zoom factors; if we carry into the high bit, skip an extra row */
951         // accumulate zoom factors; if we carry into the high bit, skip an extra row
804952         data[5] += vzoom << 10;
805953         if (data[5] & 0x8000)
806954         {
r17593r17594
808956            data[5] &= ~0x8000;
809957         }
810958
811         /* skip drawing if not within the cliprect */
959         // skip drawing if not within the cliprect
812960         if (y >= cliprect.min_y && y <= cliprect.max_y)
813961         {
814            UINT16 *dest = &bitmap.pix16(y);
815            UINT8 *pri = &machine.priority_bitmap.pix8(y);
816            int xacc;
962            UINT16 *dest = &bitmap.pix(y);
963            int x;
817964
818            /* compute the initial X zoom accumulator; this is verified on the real PCB */
819            xacc = 4 * hzoom;
965            // compute the initial X zoom accumulator; this is verified on the real PCB
966            int xacc = 4 * hzoom;
820967
821            /* non-flipped case */
968            // non-flipped case
822969            if (!flip)
823970            {
824               /* start at the word before because we preincrement below */
971               // start at the word before because we preincrement below
825972               data[7] = addr - 1;
826973               for (x = xpos; ((xpos - x) & 0x1ff) != 1; )
827974               {
828975                  UINT16 pixels = spritedata[++data[7]];
829976
830                  /* draw four pixels */
831                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; }
832                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; }
833                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; }
834                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; }
977                  // draw four pixels
978                  int pix;
979                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; }
980                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; }
981                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; }
982                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; }
835983
836                  /* stop if the last pixel in the group was 0xf */
984                  // stop if the last pixel in the group was 0xf
837985                  if (pix == 15)
838986                     break;
839987               }
840988            }
841989
842            /* flipped case */
990            // flipped case
843991            else
844992            {
845               /* start at the word after because we predecrement below */
993               // start at the word after because we predecrement below
846994               data[7] = addr + 1;
847995               for (x = xpos; ((xpos - x) & 0x1ff) != 1; )
848996               {
849997                  UINT16 pixels = spritedata[--data[7]];
850998
851                  /* draw four pixels */
852                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; }
853                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; }
854                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; }
855                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; }
999                  // draw four pixels
1000                  int pix;
1001                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; }
1002                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; }
1003                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; }
1004                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; }
8561005
857                  /* stop if the last pixel in the group was 0xf */
1006                  // stop if the last pixel in the group was 0xf
8581007                  if (pix == 15)
8591008                     break;
8601009               }
8611010            }
1011           
1012            // update bounds
1013            if (x > maxx) maxx = x;
1014            if (x < minx) minx = x;
1015            if (miny == -1) miny = y;
1016            maxy = y;
8621017         }
8631018      }
1019     
1020      // mark dirty
1021      if (miny != -1)
1022         mark_dirty(minx, maxx, miny, maxy);
8641023   }
8651024}
8661025
8671026
8681027
869/*******************************************************************************************
870 *
871 *  Out Run/X-Board-style sprites
872 *
873 *      Offs  Bits               Usage
874 *       +0   e------- --------  Signify end of sprite list
875 *       +0   -h-h---- --------  Hide this sprite if either bit is set
876 *       +0   ----bbb- --------  Sprite bank
877 *       +0   -------t tttttttt  Top scanline of sprite + 256
878 *       +2   oooooooo oooooooo  Offset within selected sprite bank
879 *       +4   ppppppp- --------  Signed 7-bit pitch value between scanlines
880 *       +4   -------x xxxxxxxx  X position of sprite (position $BE is screen position 0)
881 *       +6   -s------ --------  Enable shadows
882 *       +6   --pp---- --------  Sprite priority, relative to tilemaps
883 *       +6   ------vv vvvvvvvv  Vertical zoom factor (0x200 = full size, 0x100 = half size, 0x300 = 2x size)
884 *       +8   y------- --------  Render from top-to-bottom (1) or bottom-to-top (0) on screen
885 *       +8   -f------ --------  Horizontal flip: read the data backwards if set
886 *       +8   --x----- --------  Render from left-to-right (1) or right-to-left (0) on screen
887 *       +8   ------hh hhhhhhhh  Horizontal zoom factor (0x200 = full size, 0x100 = half size, 0x300 = 2x size)
888 *       +E   dddddddd dddddddd  Scratch space for current address
889 *
890 *    Out Run only:
891 *       +A   hhhhhhhh --------  Height in scanlines - 1
892 *       +A   -------- -ccccccc  Sprite color palette
893 *
894 *    X-Board only:
895 *       +A   ----hhhh hhhhhhhh  Height in scanlines - 1
896 *       +C   -------- cccccccc  Sprite color palette
897 *
898 *******************************************************************************************/
1028//****************************************************************************
1029//  OUT RUN/X-BOARD-STYLE SPRITES
1030//****************************************************************************
8991031
900#define outrun_draw_pixel()                                     \
901   /* only draw if onscreen, not 0 or 15 */                        \
902   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
903   {                                                      \
904      /* are we high enough priority to be visible? */               \
905      if (sprpri > pri[x])                                    \
906      {                                                   \
907         /* shadow/hilight mode? */                              \
908         if (shadow && pix == 0xa)                              \
909            dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? segaic16_palette.entries*2 : segaic16_palette.entries;   \
910                                                         \
911         /* regular draw */                                    \
912         else                                             \
913            dest[x] = pix | color;                              \
914      }                                                   \
915                                                         \
916      /* always mark priority so no one else draws here */            \
917      pri[x] = 0xff;                                          \
918   }                                                      \
1032//-------------------------------------------------
1033//  sega_outrun_sprite_device -- constructor
1034//-------------------------------------------------
9191035
920static void segaic16_sprites_xboard_outrun_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int type)
1036sega_outrun_sprite_device::sega_outrun_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1037   : sega_16bit_sprite_device(mconfig, SEGA_OUTRUN_SPRITES, "Sega Out Run Sprites", tag, owner),
1038     m_is_xboard(false)
9211039{
922   UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x40000;
923   const UINT32 *spritebase = (const UINT32 *)machine.root_device().memregion("gfx2")->base();
924   sega16sp_state *sega16sp = get_safe_token(device);
925   UINT16* data = sega16sp->spriteram;
1040   set_origin(190, 0x00);
1041}
9261042
927   /* first scan forward to find the end of the list */
928   for (data = sega16sp->buffer; data < sega16sp->buffer + sega16sp->ramsize/2; data += 8)
1043sega_outrun_sprite_device::sega_outrun_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, bool xboard_variant)
1044   : sega_16bit_sprite_device(mconfig, SEGA_XBOARD_SPRITES, "Sega X-Board Sprites", tag, owner),
1045     m_is_xboard(true)
1046{
1047   set_origin(190, 0x00);
1048}
1049
1050
1051//-------------------------------------------------
1052//  sega_xboard_sprite_device -- constructor
1053//-------------------------------------------------
1054
1055sega_xboard_sprite_device::sega_xboard_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1056   : sega_outrun_sprite_device(mconfig, tag, owner, clock, true)
1057{
1058}
1059
1060
1061//-------------------------------------------------
1062//  draw -- render the sprites within the cliprect
1063//-------------------------------------------------
1064
1065void sega_outrun_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect)
1066{
1067   //
1068   //   Out Run/X-Board-style sprites
1069   //
1070   //      Offs  Bits               Usage
1071   //       +0   e------- --------  Signify end of sprite list
1072   //       +0   -h-h---- --------  Hide this sprite if either bit is set
1073   //       +0   ----bbb- --------  Sprite bank
1074   //       +0   -------t tttttttt  Top scanline of sprite + 256
1075   //       +2   oooooooo oooooooo  Offset within selected sprite bank
1076   //       +4   ppppppp- --------  Signed 7-bit pitch value between scanlines
1077   //       +4   -------x xxxxxxxx  X position of sprite (position $BE is screen position 0)
1078   //       +6   -s------ --------  Enable shadows
1079   //       +6   --pp---- --------  Sprite priority, relative to tilemaps
1080   //       +6   ------vv vvvvvvvv  Vertical zoom factor (0x200 = full size, 0x100 = half size, 0x300 = 2x size)
1081   //       +8   y------- --------  Render from top-to-bottom (1) or bottom-to-top (0) on screen
1082   //       +8   -f------ --------  Horizontal flip: read the data backwards if set
1083   //       +8   --x----- --------  Render from left-to-right (1) or right-to-left (0) on screen
1084   //       +8   ------hh hhhhhhhh  Horizontal zoom factor (0x200 = full size, 0x100 = half size, 0x300 = 2x size)
1085   //       +E   dddddddd dddddddd  Scratch space for current address
1086   //
1087   //   Out Run only:
1088   //       +A   hhhhhhhh --------  Height in scanlines - 1
1089   //       +A   -------- -ccccccc  Sprite color palette
1090   //
1091   //  X-Board only:
1092   //       +A   ----hhhh hhhhhhhh  Height in scanlines - 1
1093   //       +C   -------- cccccccc  Sprite color palette
1094   //
1095   //    Final bitmap format:
1096   //
1097   //             -s------ --------  Shadow control
1098   //             --pp---- --------  Sprite priority
1099   //             ----cccc cccc----  Sprite color palette
1100   //             -------- ----llll  4-bit pixel data
1101   //
1102
1103   // render the sprites in order
1104   const UINT32 *spritebase = reinterpret_cast<const UINT32 *>(region()->base());
1105   UINT8 numbanks = region()->bytes() / 0x40000;
1106   UINT16 *ramend = buffer() + spriteram_elements();
1107   for (UINT16 *data = buffer(); data < ramend; data += 8)
1108   {
1109      // stop when we hit the end of sprite list
9291110      if (data[0] & 0x8000)
9301111         break;
9311112
932   /* now scan backwards and render the sprites in order */
933   for (data -= 8; data >= sega16sp->buffer; data -= 8)
934   {
1113      // extract parameters
9351114      int hide    = (data[0] & 0x5000);
9361115      int bank    = (data[0] >> 9) & 7;
9371116      int top     = (data[0] & 0x1ff) - 0x100;
9381117      UINT16 addr = data[1];
939      int pitch   = (INT16)((data[2] >> 1) | ((data[4] & 0x1000) << 3)) >> 8;
1118      int pitch   = INT16((data[2] >> 1) | ((data[4] & 0x1000) << 3)) >> 8;
9401119      int xpos    = data[2] & 0x1ff;
941      int shadow  = (data[3] >> 14) & 1;
942      int sprpri  = 1 << ((data[3] >> 12) & 3);
9431120      int vzoom   = data[3] & 0x7ff;
9441121      int ydelta  = (data[4] & 0x8000) ? 1 : -1;
9451122      int flip    = (~data[4] >> 14) & 1;
9461123      int xdelta  = (data[4] & 0x2000) ? 1 : -1;
9471124      int hzoom   = data[4] & 0x7ff;
948      int height  = ((type == SEGAIC16_SPRITES_OUTRUN) ? (data[5] >> 8) : (data[5] & 0xfff)) + 1;
949      int color   = sega16sp->colorbase + (((type == SEGAIC16_SPRITES_OUTRUN) ? (data[5] & 0x7f) : (data[6] & 0xff)) << 4);
950      int x, y, ytarget, yacc = 0, pix;
951      const UINT32 *spritedata;
1125      int height  = (m_is_xboard ? (data[5] & 0xfff) : (data[5] >> 8)) + 1;
1126      int colpri  = ((m_is_xboard ? (data[6] & 0xff) : (data[5] & 0x7f)) << 4) | (((data[3] >> 12) & 7) << 12);
9521127
953      /* adjust X coordinate */
954      /* note: the threshhold below is a guess. If it is too high, rachero will draw garbage */
955      /* If it is too low, smgp won't draw the bottom part of the road */
1128      // adjust X coordinate
1129      // note: the threshhold below is a guess. If it is too high, rachero will draw garbage
1130      // If it is too low, smgp won't draw the bottom part of the road
9561131      if (xpos < 0x80 && xdelta < 0)
9571132         xpos += 0x200;
958      xpos -= 0xbe;
9591133
960      /* initialize the end address to the start address */
1134      // initialize the end address to the start address
9611135      data[7] = addr;
9621136
963      /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */
1137      // if hidden, or top greater than/equal to bottom, or invalid bank, punt
9641138      if (hide || height == 0)
9651139         continue;
9661140
967      /* clamp to within the memory region size */
1141      // clamp to within the memory region size
9681142      if (numbanks)
9691143         bank %= numbanks;
970      spritedata = spritebase + 0x10000 * bank;
1144      const UINT32 *spritedata = spritebase + 0x10000 * bank;
9711145
972      /* clamp to a maximum of 8x (not 100% confirmed) */
1146      // clamp to a maximum of 8x (not 100% confirmed)
9731147      if (vzoom < 0x40) vzoom = 0x40;
9741148      if (hzoom < 0x40) hzoom = 0x40;
9751149
976      /* loop from top to bottom */
977      ytarget = top + ydelta * height;
978      for (y = top; y != ytarget; y += ydelta)
1150      // loop from top to bottom
1151      int minx = xpos;
1152      int maxx = xpos;
1153      int miny = -1;
1154      int maxy = -1;
1155      int yacc = 0;
1156      int ytarget = top + ydelta * height;
1157      for (int y = top; y != ytarget; y += ydelta)
9791158      {
980         /* skip drawing if not within the cliprect */
1159         // skip drawing if not within the cliprect
9811160         if (y >= cliprect.min_y && y <= cliprect.max_y)
9821161         {
983            UINT16 *dest = &bitmap.pix16(y);
984            UINT8 *pri = &machine.priority_bitmap.pix8(y);
1162            UINT16 *dest = &bitmap.pix(y);
9851163            int xacc = 0;
1164            int x;
9861165
987            /* non-flipped case */
1166            // non-flipped case
9881167            if (!flip)
9891168            {
990               /* start at the word before because we preincrement below */
1169               // start at the word before because we preincrement below
9911170               data[7] = addr - 1;
9921171               for (x = xpos; (xdelta > 0 && x <= cliprect.max_x) || (xdelta < 0 && x >= cliprect.min_x); )
9931172               {
9941173                  UINT32 pixels = spritedata[++data[7]];
9951174
996                  /* draw four pixels */
997                  pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
998                  pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
999                  pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1000                  pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1001                  pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1002                  pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1003                  pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1004                  pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1175                  // draw four pixels
1176                  int pix;
1177                  pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1178                  pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1179                  pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1180                  pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1181                  pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1182                  pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1183                  pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1184                  pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
10051185
1006                  /* stop if the second-to-last pixel in the group was 0xf */
1186                  // stop if the second-to-last pixel in the group was 0xf
10071187                  if ((pixels & 0x000000f0) == 0x000000f0)
10081188                     break;
10091189               }
10101190            }
10111191
1012            /* flipped case */
1192            // flipped case
10131193            else
10141194            {
1015               /* start at the word after because we predecrement below */
1195               // start at the word after because we predecrement below
10161196               data[7] = addr + 1;
10171197               for (x = xpos; (xdelta > 0 && x <= cliprect.max_x) || (xdelta < 0 && x >= cliprect.min_x); )
10181198               {
10191199                  UINT32 pixels = spritedata[--data[7]];
10201200
1021                  /* draw four pixels */
1022                  pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1023                  pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1024                  pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1025                  pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1026                  pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1027                  pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1028                  pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1029                  pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200;
1201                  // draw four pixels
1202                  int pix;
1203                  pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1204                  pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1205                  pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1206                  pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1207                  pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1208                  pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1209                  pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
1210                  pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) dest[x] = colpri | pix; x += xdelta; xacc += hzoom; } xacc -= 0x200;
10301211
1031                  /* stop if the second-to-last pixel in the group was 0xf */
1212                  // stop if the second-to-last pixel in the group was 0xf
10321213                  if ((pixels & 0x0f000000) == 0x0f000000)
10331214                     break;
10341215               }
10351216            }
1217           
1218            // update bounds
1219            if (x > maxx) maxx = x;
1220            if (x < minx) minx = x;
1221            if (miny == -1) miny = y;
1222            maxy = y;
10361223         }
10371224
1038         /* accumulate zoom factors; if we carry into the high bit, skip an extra row */
1225         // accumulate zoom factors; if we carry into the high bit, skip an extra row
10391226         yacc += vzoom;
10401227         addr += pitch * (yacc >> 9);
10411228         yacc &= 0x1ff;
10421229      }
1230     
1231      // mark dirty
1232      if (miny != -1)
1233         mark_dirty(minx, maxx, miny, maxy);
10431234   }
10441235}
10451236
1046void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
1047{
1048   segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_OUTRUN);
1049}
10501237
1051void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
1238
1239//****************************************************************************
1240//  Y BOARD-STYLE SPRITES
1241//****************************************************************************
1242
1243//-------------------------------------------------
1244//  sega_yboard_sprite_device -- constructor
1245//-------------------------------------------------
1246
1247sega_yboard_sprite_device::sega_yboard_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1248   : sega_16bit_sprite_device(mconfig, SEGA_YBOARD_SPRITES, "Sega Y-Board Sprites", tag, owner)
10521249{
1053   segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_XBOARD);
1250   set_origin(0x600, 0x600);
10541251}
10551252
10561253
1057/*******************************************************************************************
1058 *
1059 *  Y-Board-style sprites
1060 *
1061 *      Offs  Bits               Usage
1062 *       +0   e------- --------  Signify end of sprite list
1063 *       +0   -----iii iiiiiiii  Address of indirection table (/16)
1064 *       +2   bbbb---- --------  Upper 4 bits of bank index
1065 *       +2   ----xxxx xxxxxxxx  X position of sprite (position $600 is screen position 0)
1066 *       +4   bbbb---- --------  Lower 4 bits of bank index
1067 *       +4   ----yyyy yyyyyyyy  Y position of sprite (position $600 is screen position 0)
1068 *       +6   oooooooo oooooooo  Offset within selected sprite bank
1069 *       +8   hhhhhhhh hhhhhhhh  Height of sprite
1070 *       +A   -y------ --------  Render from top-to-bottom (1) or bottom-to-top (0) on screen
1071 *       +A   --f----- --------  Horizontal flip: read the data backwards if set
1072 *       +A   ---x---- --------  Render from left-to-right (1) or right-to-left (0) on screen
1073 *       +A   -----zzz zzzzzzzz  Zoom factor
1074 *       +C   -ccc---- --------  Sprite color
1075 *       +C   ----rrrr --------  Sprite priority
1076 *       +C   -------- pppppppp  Signed 8-bit pitch value between scanlines
1077 *       +E   ----nnnn nnnnnnnn  Index of next sprite
1078 *
1079 *  In addition to these parameters, the sprite area is clipped using scanline extents
1080 *  stored for every pair of scanlines in the rotation RAM. It's a bit of a cheat for us
1081 *  to poke our nose into the rotation structure, but there are no known cases of Y-board
1082 *  sprites without rotation RAM.
1083 *
1084 *******************************************************************************************/
1254//-------------------------------------------------
1255//  draw -- render the sprites within the cliprect
1256//-------------------------------------------------
10851257
1086#define yboard_draw_pixel()                                     \
1087   /* only draw if onscreen */                                    \
1088   if (x >= minx && x <= maxx && ind < 0x1fe)                        \
1089      dest[x] = ind | colorpri;                                 \
1090
1091void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
1258void sega_yboard_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect)
10921259{
1093   UINT8 numbanks = machine.root_device().memregion("gfx1")->bytes() / 0x80000;
1094   const UINT64 *spritebase = (const UINT64 *)machine.root_device().memregion("gfx1")->base();
1260   //
1261   //   Y-Board-style sprites
1262   //
1263   //      Offs  Bits               Usage
1264   //       +0   e------- --------  Signify end of sprite list
1265   //       +0   -----iii iiiiiiii  Address of indirection table (/16)
1266   //       +2   bbbb---- --------  Upper 4 bits of bank index
1267   //       +2   ----xxxx xxxxxxxx  X position of sprite (position $600 is screen position 0)
1268   //       +4   bbbb---- --------  Lower 4 bits of bank index
1269   //       +4   ----yyyy yyyyyyyy  Y position of sprite (position $600 is screen position 0)
1270   //       +6   oooooooo oooooooo  Offset within selected sprite bank
1271   //       +8   hhhhhhhh hhhhhhhh  Height of sprite
1272   //       +A   -y------ --------  Render from top-to-bottom (1) or bottom-to-top (0) on screen
1273   //       +A   --f----- --------  Horizontal flip: read the data backwards if set
1274   //       +A   ---x---- --------  Render from left-to-right (1) or right-to-left (0) on screen
1275   //       +A   -----zzz zzzzzzzz  Zoom factor
1276   //       +C   -ccc---- --------  Sprite color
1277   //       +C   ----rrrr --------  Sprite priority
1278   //       +C   -------- pppppppp  Signed 8-bit pitch value between scanlines
1279   //       +E   ----nnnn nnnnnnnn  Index of next sprite
1280   //
1281   //    Final bitmap format:
1282   //
1283   //             ccc----- --------  Sprite color
1284   //             ---rrrr- --------  Sprite priority
1285   //             -------i iiiiiiii  Indirected color data
1286   //
1287   //   In addition to these parameters, the sprite area is clipped using scanline extents
1288   //   stored for every pair of scanlines in the rotation RAM. It's a bit of a cheat for us
1289   //   to poke our nose into the rotation structure, but there are no known cases of Y-board
1290   //   sprites without rotation RAM.
1291   //
1292
1293   // clear out any scanlines we might be using
10951294   const UINT16 *rotatebase = segaic16_rotate[0].buffer ? segaic16_rotate[0].buffer : segaic16_rotate[0].rotateram;
1096   UINT8 visited[0x1000];
1097   sega16sp_state *sega16sp = get_safe_token(device);
1098   int next = 0;
1099   int y;
1100   UINT16* data = sega16sp->spriteram;
1295   rotatebase -= yorigin();
1296   for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
1297      if (!(rotatebase[y & ~1] & 0xc000))
1298         memset(&bitmap.pix(y, cliprect.min_x), 0xff, cliprect.width() * sizeof(UINT16));
11011299
1102   /* reset the visited list */
1300   // reset the visited list
1301   UINT8 visited[0x1000];
11031302   memset(visited, 0, sizeof(visited));
11041303
1105   /* clear out any scanlines we might be using */
1106   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
1107      if (!(rotatebase[y & ~1] & 0xc000))
1108         memset(&bitmap.pix16(y, cliprect.min_x), 0xff, cliprect.width() * sizeof(UINT16));
1109
1110   /* now scan backwards and render the sprites in order */
1111   for (data = sega16sp->spriteram; !(data[0] & 0x8000) && !visited[next]; data = sega16sp->spriteram + next * 8)
1304   // render the sprites in order
1305   const UINT64 *spritebase = reinterpret_cast<const UINT64 *>(region()->base());
1306   UINT8 numbanks = region()->bytes() / 0x80000;
1307   int next = 0;
1308   for (UINT16 *data = spriteram(); !(data[0] & 0x8000) && !visited[next]; data = spriteram() + next * 8)
11121309   {
11131310      int hide    = (data[0] & 0x5000);
1114      UINT16 *indirect = sega16sp->spriteram + ((data[0] & 0x7ff) << 4);
1311      const UINT16 *indirect = spriteram() + ((data[0] & 0x7ff) << 4);
11151312      int bank    = ((data[1] >> 8) & 0x10) | ((data[2] >> 12) & 0x0f);
1116      int xpos    = (data[1] & 0xfff) - 0x600;
1117      int top     = (data[2] & 0xfff) - 0x600;
1313      int xpos    = data[1] & 0xfff;
1314      int top     = data[2] & 0xfff;
11181315      UINT16 addr = data[3];
11191316      int height  = data[4];
11201317      int ydelta  = (data[5] & 0x4000) ? 1 : -1;
11211318      int flip    = (~data[5] >> 13) & 1;
11221319      int xdelta  = (data[5] & 0x1000) ? 1 : -1;
11231320      int zoom    = data[5] & 0x7ff;
1124      int colorpri= (data[6] << 1) & 0xfe00;
1125      int pitch   = (INT8)data[6];
1126      int x, y, ytarget, yacc = 0, pix, ind;
1127      const UINT64 *spritedata;
1128      UINT16 offs;
1321      int colpri  = (data[6] << 1) & 0xfe00;
1322      int pitch   = INT8(data[6]);
11291323
1130      /* note that we've visited this entry and get the offset of the next one */
1324      // note that we've visited this entry and get the offset of the next one
11311325      visited[next] = 1;
11321326      next = data[7] & 0xfff;
11331327
1134      /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */
1328      // if hidden, or top greater than/equal to bottom, or invalid bank, punt
11351329      if (hide || height == 0)
11361330         continue;
11371331
1138      /* clamp to within the memory region size */
1332      // clamp to within the memory region size
11391333      if (numbanks)
11401334         bank %= numbanks;
1141      spritedata = spritebase + 0x10000 * bank;
1335      const UINT64 *spritedata = spritebase + 0x10000 * bank;
11421336
1143      /* clamp to a maximum of 8x (not 100% confirmed) */
1337      // clamp to a maximum of 8x (not 100% confirmed)
11441338      if (zoom == 0) zoom = 1;
11451339
1146      /* loop from top to bottom */
1147      ytarget = top + ydelta * height;
1148      for (y = top; y != ytarget; y += ydelta)
1340      // loop from top to bottom
1341      int dminx = xpos;
1342      int dmaxx = xpos;
1343      int dminy = -1;
1344      int dmaxy = -1;
1345      int ytarget = top + ydelta * height;
1346      int yacc = 0;
1347      for (int y = top; y != ytarget; y += ydelta)
11491348      {
1150         /* skip drawing if not within the cliprect */
1349         // skip drawing if not within the cliprect
11511350         if (y >= cliprect.min_y && y <= cliprect.max_y)
11521351         {
1153            UINT16 *dest = &bitmap.pix16(y);
1352            UINT16 *dest = &bitmap.pix(y);
11541353            int minx = rotatebase[y & ~1];
11551354            int maxx = rotatebase[y |  1];
11561355            int xacc = 0;
11571356
1158            /* bit 0x8000 from rotate RAM means that Y is above the top of the screen */
1357            // bit 0x8000 from rotate RAM means that Y is above the top of the screen
11591358            if ((minx & 0x8000) && ydelta < 0)
11601359               break;
11611360
1162            /* bit 0x4000 from rotate RAM means that Y is below the bottom of the screen */
1361            // bit 0x4000 from rotate RAM means that Y is below the bottom of the screen
11631362            if ((minx & 0x4000) && ydelta > 0)
11641363               break;
11651364
1166            /* if either bit is set, skip the rest for this scanline */
1365            // if either bit is set, skip the rest for this scanline
11671366            if (!(minx & 0xc000))
11681367            {
1169               /* clamp min/max to the cliprect */
1170               minx -= 0x600;
1171               maxx -= 0x600;
1368               // clamp min/max to the cliprect
11721369               if (minx < cliprect.min_x)
11731370                  minx = cliprect.min_x;
11741371               if (maxx > cliprect.max_x)
11751372                  maxx = cliprect.max_x;
11761373
1177               /* non-flipped case */
1374               // non-flipped case
1375               int x;
11781376               if (!flip)
11791377               {
1180                  /* start at the word before because we preincrement below */
1181                  offs = addr - 1;
1378                  // start at the word before because we preincrement below
1379                  UINT16 offs = addr - 1;
11821380                  for (x = xpos; (xdelta > 0 && x <= maxx) || (xdelta < 0 && x >= minx); )
11831381                  {
11841382                     UINT64 pixels = spritedata[++offs];
11851383
1186                     /* draw four pixels */
1187                     pix = (pixels >> 60) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1188                     pix = (pixels >> 56) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1189                     pix = (pixels >> 52) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1190                     pix = (pixels >> 48) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1191                     pix = (pixels >> 44) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1192                     pix = (pixels >> 40) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1193                     pix = (pixels >> 36) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1194                     pix = (pixels >> 32) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1195                     pix = (pixels >> 28) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1196                     pix = (pixels >> 24) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1197                     pix = (pixels >> 20) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1198                     pix = (pixels >> 16) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1199                     pix = (pixels >> 12) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1200                     pix = (pixels >>  8) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1201                     pix = (pixels >>  4) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1202                     pix = (pixels >>  0) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1384                     // draw 16 pixels
1385                     int pix, ind;
1386                     pix = (pixels >> 60) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1387                     pix = (pixels >> 56) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1388                     pix = (pixels >> 52) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1389                     pix = (pixels >> 48) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1390                     pix = (pixels >> 44) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1391                     pix = (pixels >> 40) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1392                     pix = (pixels >> 36) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1393                     pix = (pixels >> 32) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1394                     pix = (pixels >> 28) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1395                     pix = (pixels >> 24) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1396                     pix = (pixels >> 20) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1397                     pix = (pixels >> 16) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1398                     pix = (pixels >> 12) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1399                     pix = (pixels >>  8) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1400                     pix = (pixels >>  4) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1401                     pix = (pixels >>  0) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
12031402
1204                     /* stop if the second-to-last pixel in the group was 0xf */
1403                     // stop if the last pixel in the group was 0xf
12051404                     if (pix == 0x0f)
12061405                        break;
12071406                  }
12081407               }
12091408
1210               /* flipped case */
1409               // flipped case
12111410               else
12121411               {
1213                  /* start at the word after because we predecrement below */
1214                  offs = addr + 1;
1412                  // start at the word after because we predecrement below
1413                  UINT16 offs = addr + 1;
12151414                  for (x = xpos; (xdelta > 0 && x <= maxx) || (xdelta < 0 && x >= minx); )
12161415                  {
12171416                     UINT64 pixels = spritedata[--offs];
12181417
1219                     /* draw four pixels */
1220                     pix = (pixels >>  0) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1221                     pix = (pixels >>  4) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1222                     pix = (pixels >>  8) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1223                     pix = (pixels >> 12) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1224                     pix = (pixels >> 16) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1225                     pix = (pixels >> 20) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1226                     pix = (pixels >> 24) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1227                     pix = (pixels >> 28) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1228                     pix = (pixels >> 32) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1229                     pix = (pixels >> 36) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1230                     pix = (pixels >> 40) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1231                     pix = (pixels >> 44) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1232                     pix = (pixels >> 48) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1233                     pix = (pixels >> 52) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1234                     pix = (pixels >> 56) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1235                     pix = (pixels >> 60) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200;
1418                     // draw 16 pixels
1419                     int pix, ind;
1420                     pix = (pixels >>  0) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1421                     pix = (pixels >>  4) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1422                     pix = (pixels >>  8) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1423                     pix = (pixels >> 12) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1424                     pix = (pixels >> 16) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1425                     pix = (pixels >> 20) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1426                     pix = (pixels >> 24) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1427                     pix = (pixels >> 28) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1428                     pix = (pixels >> 32) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1429                     pix = (pixels >> 36) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1430                     pix = (pixels >> 40) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1431                     pix = (pixels >> 44) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1432                     pix = (pixels >> 48) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1433                     pix = (pixels >> 52) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1434                     pix = (pixels >> 56) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
1435                     pix = (pixels >> 60) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { if (x >= minx && x <= maxx && ind < 0x1fe) dest[x] = colpri | ind; x += xdelta; xacc += zoom; } xacc -= 0x200;
12361436
1237                     /* stop if the second-to-last pixel in the group was 0xf */
1437                     // stop if the last pixel in the group was 0xf
12381438                     if (pix == 0x0f)
12391439                        break;
12401440                  }
12411441               }
1442           
1443               // update bounds
1444               if (x > dmaxx) dmaxx = x;
1445               if (x < dminx) dminx = x;
1446               if (dminy == -1) dminy = y;
1447               dmaxy = y;
12421448            }
12431449         }
12441450
1245         /* accumulate zoom factors; if we carry into the high bit, skip an extra row */
1451         // accumulate zoom factors; if we carry into the high bit, skip an extra row
12461452         yacc += zoom;
12471453         addr += pitch * (yacc >> 9);
12481454         yacc &= 0x1ff;
12491455      }
1456     
1457      // mark dirty
1458      if (dminy != -1)
1459         mark_dirty(dminx, dmaxx, dminy, dmaxy);
12501460   }
12511461}
1252
1253/* bootlegs */
1254
1255/*
1256
1257 the system16a bootleg sprite hardware differs in subtle ways on a per game basis
1258 with each game having the words swapped around.
1259
1260 there are also some subtle, but important changes when compared to the original
1261 system16a sprites, mainly the increment of the address not happening until
1262 the end of the loop
1263
1264*/
1265
1266/* ignores the sprite priority until we understand priority better on the bootlegs */
1267#define system16a_bootleg_draw_pixel()                                    \
1268   /* only draw if onscreen, not 0 or 15 */                        \
1269   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
1270   {                                                      \
1271      /* are we high enough priority to be visible? */               \
1272      if (sprpri || 1)                                    \
1273      {                                                   \
1274         /* shadow/hilight mode? */                              \
1275         if (color == sega16sp->colorbase + (0x3f << 4))                  \
1276            dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? segaic16_palette.entries*2 : segaic16_palette.entries;   \
1277                                                         \
1278         /* regular draw */                                    \
1279         else                                             \
1280            dest[x] = pix | color;                              \
1281      }                                                   \
1282                                                         \
1283      /* always mark priority so no one else draws here */            \
1284      pri[x] = 0xff;                                          \
1285   }                                                      \
1286
1287
1288/* make this an actual function */
1289#define system16a_bootleg_draw_core()                                       \
1290   {                                                               \
1291      const UINT16 *spritedata;                                          \
1292      int x, y, pix, xdelta = 1;                                          \
1293                                                                  \
1294      xpos += sega16sp->xoffs;                                             \
1295      xpos &= 0x1ff;                                                   \
1296                                                                  \
1297      xpos -= 0xbd;                                                   \
1298                                                                  \
1299      /* initialize the end address to the start address */                     \
1300      data[7] = addr;                                                \
1301                                                                  \
1302      /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */      \
1303      if ((top >= bottom) || bank == 255)                                    \
1304         continue;                                                   \
1305                                                                  \
1306      /* clamp to within the memory region size */                           \
1307      if (numbanks)                                                   \
1308         bank %= numbanks;                                             \
1309      spritedata = spritebase + 0x8000 * bank;                              \
1310                                                                  \
1311      /* adjust positions for screen flipping */                              \
1312      if (sega16sp->flip)                                                   \
1313      {                                                            \
1314         int temp = top;                                                \
1315         top = 224 - bottom;                                             \
1316         bottom = 224 - temp;                                          \
1317         xpos = 320 - xpos;                                             \
1318         xdelta = -1;                                                \
1319      }                                                            \
1320                                                                  \
1321      /* loop from top to bottom */                                       \
1322      for (y = top; y < bottom; y++)                                       \
1323      {                                                            \
1324                                                                  \
1325         /* skip drawing if not within the cliprect */                        \
1326         if (y >= cliprect.min_y && y <= cliprect.max_y)                     \
1327         {                                                         \
1328            UINT16 *dest = &bitmap.pix16(y);                        \
1329            UINT8 *pri = &machine.priority_bitmap.pix8(y);                  \
1330                                                                  \
1331            /* note that the System 16A sprites have a design flaw that allows the address */      \
1332            /* to carry into the flip flag, which is the topmost bit -- it is very important */      \
1333            /* to emulate this as the games compensate for it */                           \
1334                                                                              \
1335            /* non-flipped case */                                                   \
1336            if (!(addr & 0x8000))                                                   \
1337            {                                                                  \
1338               /* start at the word before because we preincrement below */                  \
1339               data[7] = addr - 1;                                                \
1340               for (x = xpos; ((xpos - x) & 0x1ff) != 1; )                                 \
1341               {                                                               \
1342                  UINT16 pixels = spritedata[++data[7] & 0x7fff];                           \
1343                                                                              \
1344                  /* draw four pixels */                                             \
1345                  pix = (pixels >> 12) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta;      \
1346                  pix = (pixels >>  8) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta;      \
1347                  pix = (pixels >>  4) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta;      \
1348                  pix = (pixels >>  0) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta;      \
1349                                                                              \
1350                  /* stop if the last pixel in the group was 0xf */                        \
1351                  if (pix == 15)                                                   \
1352                     break;                                                      \
1353               }                                                               \
1354            }                                                                  \
1355                                                                              \
1356            /* flipped case */                                                      \
1357            else                                                               \
1358            {                                                                  \
1359               /* start at the word after because we predecrement below */                     \
1360               data[7] = addr + 1;                                                   \
1361               for (x = xpos; ((xpos - x) & 0x1ff) != 1; )                                 \
1362               {                                                               \
1363                  UINT16 pixels = spritedata[--data[7] & 0x7fff];                           \
1364                                                                              \
1365                  /* draw four pixels */                                             \
1366                  pix = (pixels >>  0) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta;      \
1367                  pix = (pixels >>  4) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta;      \
1368                  pix = (pixels >>  8) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta;      \
1369                  pix = (pixels >> 12) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta;      \
1370                                                                              \
1371                  /* stop if the last pixel in the group was 0xf */                        \
1372                  if (pix == 15)                                                   \
1373                     break;                                                      \
1374               }                                                               \
1375            }                                                                  \
1376         }                                                                     \
1377                                                                              \
1378         /* advance a row - must be done at the end on the bootlegs! */                        \
1379         addr += pitch;                                                            \
1380      }                                                                        \
1381   }                                                                           \
1382
1383
1384
1385void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
1386{
1387   UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
1388   const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
1389   sega16sp_state *sega16sp = get_safe_token(device);
1390   UINT16* data = sega16sp->spriteram;
1391
1392   for (data = sega16sp->spriteram; data < sega16sp->spriteram+ sega16sp->ramsize/2; data += 8)
1393   {
1394      int bottom  = (data[4] >> 8);
1395      int top     = (data[4] & 0xff);
1396      int xpos    = (data[0]);
1397      int pitch   = (INT16)data[5];
1398      UINT16 addr = data[1];
1399      int color   = sega16sp->colorbase + (((data[6] >> 8) & 0x3f) << 4);
1400      int bank    = sega16sp->bank[(data[6] >> 4) & 0x7];
1401      int sprpri  = 1 << ((data[6] >> 0) & 0x3);
1402
1403      system16a_bootleg_draw_core();
1404   }
1405}
1406
1407/* 4 player passing shot is different to this.. */
1408void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
1409{
1410   UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
1411   const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
1412   sega16sp_state *sega16sp = get_safe_token(device);
1413   UINT16* data = sega16sp->spriteram;
1414
1415   for (data = sega16sp->spriteram; data < sega16sp->spriteram+ sega16sp->ramsize/2; data += 8)
1416   {
1417      int bottom  = (data[1] >> 8)-1;
1418      int top     = (data[1] & 0xff)-1;
1419      int xpos    = (data[0]);
1420      int pitch   = (INT16)data[3];
1421      UINT16 addr = data[2];
1422      int color   = sega16sp->colorbase + (((data[5] >> 8) & 0x3f) << 4);
1423      int bank    = sega16sp->bank[(data[5] >> 4) & 0x7];
1424      int sprpri  = 1 << ((data[5] >> 0) & 0x3);
1425
1426      system16a_bootleg_draw_core();
1427   }
1428}
1429
1430void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect)
1431{
1432   UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x10000;
1433   const UINT16 *spritebase = (const UINT16 *)machine.root_device().memregion("gfx2")->base();
1434   sega16sp_state *sega16sp = get_safe_token(device);
1435   UINT16* data = sega16sp->spriteram;
1436
1437   for (data = sega16sp->spriteram; data < sega16sp->spriteram+ sega16sp->ramsize/2; data += 8)
1438   {
1439      int bottom  = (data[0] >> 8)-1;
1440      int top     = (data[0] & 0xff)-1;
1441      int xpos    = (data[1]);
1442      int pitch   = (INT16)data[2];
1443      UINT16 addr = data[3];
1444      int color   = sega16sp->colorbase + (((data[4] >> 8) & 0x3f) << 4);
1445      int bank    = sega16sp->bank[(data[4] >> 4) & 0x7];
1446      int sprpri  = 1 << ((data[4] >> 0) & 0x3);
1447
1448      system16a_bootleg_draw_core();
1449   }
1450}
1451
1452/*************************************
1453 *
1454 *  General sprite drawing
1455 *
1456 *************************************/
1457
1458void segaic16_sprites_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which)
1459{
1460   device_t* device = 0;
1461   sega16sp_state *sega16sp;
1462
1463   if (!which)
1464      device = screen.machine().device("segaspr1");
1465   else
1466      device = screen.machine().device("segaspr2");
1467
1468   if (!device)
1469      fatalerror("segaic16_sprites_draw device not found\n");
1470
1471   sega16sp = get_safe_token(device);
1472
1473   if (!sega16sp->which)
1474      sega16sp->spriteram = segaic16_spriteram_0;
1475   else
1476      sega16sp->spriteram = segaic16_spriteram_1;
1477
1478   (*sega16sp->draw)(screen.machine(), device, bitmap, cliprect);
1479}
1480
1481
1482
1483/*************************************
1484 *
1485 *  General sprite banking
1486 *
1487 *************************************/
1488
1489void segaic16_sprites_set_bank(running_machine &machine, int which, int banknum, int offset)
1490{
1491   device_t* device = 0;
1492
1493   if (!which)
1494      device = machine.device("segaspr1");
1495   else
1496      device = machine.device("segaspr2");
1497
1498   if (!device)
1499      fatalerror("segaic16_sprites_set_bank device not found\n");
1500
1501   sega16sp_state *sega16sp = get_safe_token(device);
1502
1503   if (sega16sp->bank[banknum] != offset)
1504   {
1505      screen_device &screen = *machine.primary_screen;
1506      screen.update_partial(screen.vpos());
1507      sega16sp->bank[banknum] = offset;
1508   }
1509}
1510
1511
1512
1513/*************************************
1514 *
1515 *  General sprite screen flipping
1516 *
1517 *************************************/
1518
1519void segaic16_sprites_set_flip(running_machine &machine, int which, int flip)
1520{
1521   device_t* device = 0;
1522
1523   if (!which)
1524      device = machine.device("segaspr1");
1525   else
1526      device = machine.device("segaspr2");
1527
1528   if (!device)
1529      fatalerror("segaic16_sprites_set_flip device not found\n");
1530
1531   sega16sp_state *sega16sp = get_safe_token(device);
1532
1533   flip = (flip != 0);
1534   if (sega16sp->flip != flip)
1535   {
1536      screen_device &screen = *machine.primary_screen;
1537      screen.update_partial(screen.vpos());
1538      sega16sp->flip = flip;
1539   }
1540}
1541
1542
1543
1544/*************************************
1545 *
1546 *  General sprite shadows
1547 *
1548 *************************************/
1549
1550void segaic16_sprites_set_shadow(running_machine &machine, int which, int shadow)
1551{
1552   device_t* device = 0;
1553
1554   if (!which)
1555      device = machine.device("segaspr1");
1556   else
1557      device = machine.device("segaspr2");
1558
1559   if (!device)
1560      fatalerror("segaic16_sprites_set_shadow device not found\n");
1561
1562   sega16sp_state *sega16sp = get_safe_token(device);
1563
1564   shadow = (shadow != 0);
1565   if (sega16sp->shadow != shadow)
1566   {
1567      screen_device &screen = *machine.primary_screen;
1568      screen.update_partial(screen.vpos());
1569      sega16sp->shadow = shadow;
1570   }
1571}
1572
1573
1574
1575/*************************************
1576 *
1577 *  General sprite buffer control
1578 *
1579 *************************************/
1580
1581static void segaic16_sprites_buffer(device_t* device)
1582{
1583   sega16sp_state *sega16sp = get_safe_token(device);
1584
1585   if (!sega16sp->which)
1586      sega16sp->spriteram = segaic16_spriteram_0;
1587   else
1588      sega16sp->spriteram = segaic16_spriteram_1;
1589
1590
1591   if (sega16sp->buffer)
1592   {
1593      UINT32 *src = (UINT32 *)sega16sp->spriteram;
1594      UINT32 *dst = (UINT32 *)sega16sp->buffer;
1595      int i;
1596
1597      /* swap the halves of the sprite RAM */
1598      for (i = 0; i < sega16sp->ramsize/4; i++)
1599      {
1600         UINT32 temp = *src;
1601         *src++ = *dst;
1602         *dst++ = temp;
1603      }
1604
1605      /* hack for thunderblade */
1606      *sega16sp->spriteram = 0xffff;
1607   }
1608
1609   /* we will render the sprites when the video update happens */
1610}
1611
1612
1613WRITE16_HANDLER( segaic16_sprites_draw_0_w )
1614{
1615   device_t* device = 0;
1616
1617   device = space->machine().device("segaspr1");
1618
1619   if (!device)
1620      fatalerror("segaic16_sprites_draw_0_w device not found\n");
1621
1622   segaic16_sprites_buffer(device);
1623}
1624
1625
1626WRITE16_HANDLER( segaic16_sprites_draw_1_w )
1627{
1628   device_t* device = 0;
1629
1630   device = space->machine().device("segaspr2");
1631
1632   if (!device)
1633      fatalerror("segaic16_sprites_draw_1_w device not found\n");
1634
1635   if (device)
1636      segaic16_sprites_buffer(device);
1637}
1638
1639
1640/*****************************************************************************
1641    DEVICE INTERFACE
1642*****************************************************************************/
1643
1644static DEVICE_START( sega16sp )
1645{
1646   sega16sp_state *sega16sp = get_safe_token(device);
1647   const sega16sp_interface *intf = get_interface(device);
1648   int i;
1649
1650   sega16sp->flip = 0;
1651   sega16sp->shadow = 0;
1652
1653   for (i=0;i<16;i++)
1654      sega16sp->bank[i] = i;// intf->bank[i];
1655
1656   sega16sp->which = intf->which;
1657   sega16sp->colorbase = intf->colorbase;
1658   sega16sp->ramsize = intf->ramsize;
1659   sega16sp->xoffs = intf->xoffs;
1660   sega16sp->draw = intf->draw;
1661
1662   if (intf->buffer)
1663      sega16sp->buffer = auto_alloc_array(device->machine(), UINT16, sega16sp->ramsize/2);
1664
1665
1666   device->save_item(NAME(sega16sp->flip));
1667   device->save_item(NAME(sega16sp->shadow));
1668   device->save_item(NAME(sega16sp->bank));
1669   device->save_item(NAME(sega16sp->colorbase));
1670   device->save_item(NAME(sega16sp->xoffs));
1671
1672   if (intf->buffer)
1673      device->save_pointer(NAME(((UINT8 *) sega16sp->buffer)), sega16sp->ramsize);
1674
1675
1676}
1677
1678
1679DEVICE_GET_INFO( sega16sp )
1680{
1681   switch (state)
1682   {
1683      /* --- the following bits of info are returned as 64-bit signed integers --- */
1684      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(sega16sp_state);               break;
1685
1686      /* --- the following bits of info are returned as pointers to data or functions --- */
1687      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(sega16sp);      break;
1688      case DEVINFO_FCT_STOP:               /* Nothing */                           break;
1689      case DEVINFO_FCT_RESET:               /*info->reset = DEVICE_RESET_NAME(sega16sp);*/   break;
1690
1691      /* --- the following bits of info are returned as NULL-terminated strings --- */
1692      case DEVINFO_STR_NAME:               strcpy(info->s, "Sega System SH/HO/OR/16/18/X/Y Sprites");            break;
1693      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Sega Video ICs");               break;
1694      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
1695      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
1696      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MAME Team");         break;
1697   }
1698}
trunk/src/mame/video/sega16sp.h
r0r17594
1/***************************************************************************
2
3    Sega 16-bit sprite hardware
4
5****************************************************************************
6
7    Copyright Aaron Giles
8    All rights reserved.
9
10    Redistribution and use in source and binary forms, with or without
11    modification, are permitted provided that the following conditions are
12    met:
13
14        * Redistributions of source code must retain the above copyright
15          notice, this list of conditions and the following disclaimer.
16        * Redistributions in binary form must reproduce the above copyright
17          notice, this list of conditions and the following disclaimer in
18          the documentation and/or other materials provided with the
19          distribution.
20        * Neither the name 'MAME' nor the names of its contributors may be
21          used to endorse or promote products derived from this software
22          without specific prior written permission.
23
24    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
25    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
28    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34    POSSIBILITY OF SUCH DAMAGE.
35
36***************************************************************************/
37
38#pragma once
39
40#include "sprite.h"
41
42
43#ifndef __SEGA16SP_H__
44#define __SEGA16SP_H__
45
46
47//**************************************************************************
48//  INTERFACE CONFIGURATION MACROS
49//**************************************************************************
50
51#define MCFG_SEGA_HANGON_SPRITES_ADD(_tag) \
52   MCFG_DEVICE_ADD(_tag, SEGA_HANGON_SPRITES, 0) \
53
54#define MCFG_SEGA_SHARRIER_SPRITES_ADD(_tag) \
55   MCFG_DEVICE_ADD(_tag, SEGA_SHARRIER_SPRITES, 0) \
56
57#define MCFG_SEGA_OUTRUN_SPRITES_ADD(_tag) \
58   MCFG_DEVICE_ADD(_tag, SEGA_OUTRUN_SPRITES, 0) \
59
60#define MCFG_SEGA_SYS16A_SPRITES_ADD(_tag) \
61   MCFG_DEVICE_ADD(_tag, SEGA_SYS16A_SPRITES, 0) \
62
63#define MCFG_SEGA_SYS16B_SPRITES_ADD(_tag) \
64   MCFG_DEVICE_ADD(_tag, SEGA_SYS16B_SPRITES, 0) \
65
66#define MCFG_SEGA_XBOARD_SPRITES_ADD(_tag) \
67   MCFG_DEVICE_ADD(_tag, SEGA_XBOARD_SPRITES, 0) \
68
69#define MCFG_SEGA_YBOARD_SPRITES_ADD(_tag) \
70   MCFG_DEVICE_ADD(_tag, SEGA_YBOARD_SPRITES, 0) \
71
72
73#define MCFG_BOOTLEG_SYS16A_SPRITES_ADD(_tag) \
74   MCFG_DEVICE_ADD(_tag, BOOTLEG_SYS16A_SPRITES, 0) \
75   
76#define MCFG_BOOTLEG_SYS16A_SPRITES_REMAP(_0,_1,_2,_3,_4,_5,_6,_7) \
77   bootleg_sys16a_sprite_device::static_set_remap(*device, _0,_1,_2,_3,_4,_5,_6,_7);
78   
79#define MCFG_BOOTLEG_SYS16A_SPRITES_XORIGIN(_xorigin) \
80   bootleg_sys16a_sprite_device::static_set_xorigin(*device, _xorigin);
81
82#define MCFG_BOOTLEG_SYS16A_SPRITES_YORIGIN(_yorigin) \
83   bootleg_sys16a_sprite_device::static_set_yorigin(*device, _yorigin);
84
85
86#define MCFG_BOOTLEG_SYS16B_SPRITES_ADD(_tag) \
87   MCFG_DEVICE_ADD(_tag, SEGA_SYS16B_SPRITES, 0) \
88   
89#define MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(_xorigin) \
90   bootleg_sys16a_sprite_device::static_set_xorigin(*device, _xorigin);
91
92
93
94//**************************************************************************
95//  TYPE DEFINITIONS
96//**************************************************************************
97
98
99// ======================> sega_16bit_sprite_device
100
101class sega_16bit_sprite_device : public sprite16_device_ind16
102{
103protected:
104   // construction/destruction
105   sega_16bit_sprite_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner);
106
107public:
108   // live configuration
109   void set_bank(int banknum, int offset) { m_bank[banknum] = offset; }
110   void set_flip(bool flip) { m_flip = flip; }
111
112   // write trigger memory handler
113   DECLARE_WRITE16_MEMBER( draw_write );
114
115protected:
116   // device-level overrides
117   virtual void device_start();
118
119   // internal state
120   bool                  m_flip;               // screen flip?
121   UINT8                  m_bank[16];            // banking redirection
122};
123
124
125// ======================> sega_hangon_sprite_device
126
127class sega_hangon_sprite_device : public sega_16bit_sprite_device
128{
129public:
130   // construction/destruction
131   sega_hangon_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
132   
133protected:
134   // subclass overrides
135   virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
136};
137
138
139// ======================> sega_sharrier_sprite_device
140
141class sega_sharrier_sprite_device : public sega_16bit_sprite_device
142{
143public:
144   // construction/destruction
145   sega_sharrier_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
146   
147protected:
148   // subclass overrides
149   virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
150};
151
152
153// ======================> sega_outrun_sprite_device
154
155class sega_outrun_sprite_device : public sega_16bit_sprite_device
156{
157public:
158   // construction/destruction
159   sega_outrun_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
160protected:
161   sega_outrun_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, bool xboard_variant);
162
163   // subclass overrides
164   virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
165   
166   // configuration
167   bool         m_is_xboard;
168};
169
170class sega_xboard_sprite_device : public sega_outrun_sprite_device
171{
172public:
173   // construction/destruction
174   sega_xboard_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
175};
176
177
178// ======================> sega_sys16a_sprite_device
179
180class sega_sys16a_sprite_device : public sega_16bit_sprite_device
181{
182public:
183   // construction/destruction
184   sega_sys16a_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
185
186protected:
187   // subclass overrides
188   virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
189};
190
191
192// ======================> bootleg_sys16a_sprite_device
193
194class bootleg_sys16a_sprite_device : public sega_16bit_sprite_device
195{
196public:
197   // construction/destruction
198   bootleg_sys16a_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
199   
200   // configuration
201   static void static_set_remap(device_t &device, UINT8 offs0, UINT8 offs1, UINT8 offs2, UINT8 offs3, UINT8 offs4, UINT8 offs5, UINT8 offs6, UINT8 offs7);
202
203protected:
204   // subclass overrides
205   virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
206   
207   // internal state
208   UINT8      m_addrmap[8];
209};
210
211
212// ======================> sega_sys16b_sprite_device
213
214class sega_sys16b_sprite_device : public sega_16bit_sprite_device
215{
216public:
217   // construction/destruction
218   sega_sys16b_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
219   
220protected:
221   // subclass overrides
222   virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
223};
224
225
226// ======================> sega_yboard_sprite_device
227
228class sega_yboard_sprite_device : public sega_16bit_sprite_device
229{
230public:
231   // construction/destruction
232   sega_yboard_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
233   
234protected:
235   // subclass overrides
236   virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
237};
238
239
240// device type definition
241extern const device_type SEGA_HANGON_SPRITES;
242extern const device_type SEGA_SHARRIER_SPRITES;
243extern const device_type SEGA_OUTRUN_SPRITES;
244extern const device_type SEGA_SYS16A_SPRITES;
245extern const device_type BOOTLEG_SYS16A_SPRITES;
246extern const device_type SEGA_SYS16B_SPRITES;
247extern const device_type SEGA_XBOARD_SPRITES;
248extern const device_type SEGA_YBOARD_SPRITES;
249
250
251#endif
252
trunk/src/mame/video/segas16a.c
r17593r17594
4646
4747void segas16a_state::video_start()
4848{
49   // compute palette info
50   segaic16_palette_init(0x800);
51
5249   // initialize the tile/text layers
5350   segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16A, 0x000, 0, 1);
5451}
r17593r17594
6764      return 0;
6865   }
6966
67   // start the sprites drawing
68   m_sprites->draw_async(cliprect);
69
7070   // reset priorities
7171   machine().priority_bitmap.fill(0, cliprect);
7272
r17593r17594
8787   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
8888   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
8989
90   // draw the sprites
91   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
90   // mix in sprites
91   bitmap_ind16 &sprites = m_sprites->bitmap();
92   for (const sparse_dirty_rect *rect = m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
93      for (int y = rect->min_y; y <= rect->max_y; y++)
94      {
95         UINT16 *dest = &bitmap.pix(y);
96         UINT16 *src = &sprites.pix(y);
97         UINT8 *pri = &machine().priority_bitmap.pix(y);
98         for (int x = rect->min_x; x <= rect->max_x; x++)
99         {
100            // only process written pixels
101            UINT16 pix = src[x];
102            if (pix != 0xffff)
103            {
104               // compare sprite priority against tilemap priority
105               int priority = pix >> 10;
106               if ((1 << priority) > pri[x])
107               {
108                  // if color bits are all 1, this triggers shadow/hilight
109                  if ((pix & 0x3f0) == 0x3f0)
110                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries;
111
112                  // otherwise, just add in sprite palette base
113                  else
114                     dest[x] = 1024 + (pix & 0x3ff);
115               }
116            }
117         }
118      }
119
92120   return 0;
93121}
trunk/src/mame/video/segahang.c
r17593r17594
4646
4747void segahang_state::video_start()
4848{
49   // compute palette info
50   segaic16_palette_init(0x800);
51
5249   // initialize the tile/text layers
5350   segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_HANGON, 0x000, 0, 2);
5451
r17593r17594
7067      return 0;
7168   }
7269
70   // start the sprites drawing
71   m_sprites->draw_async(cliprect);
72
7373   // reset priorities
7474   machine().priority_bitmap.fill(0, cliprect);
7575
r17593r17594
9393   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
9494   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
9595
96   // draw the sprites
97   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
96   // mix in sprites
97   bitmap_ind16 &sprites = m_sprites->bitmap();
98   for (const sparse_dirty_rect *rect = m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
99      for (int y = rect->min_y; y <= rect->max_y; y++)
100      {
101         UINT16 *dest = &bitmap.pix(y);
102         UINT16 *src = &sprites.pix(y);
103         UINT8 *pri = &machine().priority_bitmap.pix(y);
104         
105         // hangon mixing
106         if (!m_sharrier_video)
107         {
108            for (int x = rect->min_x; x <= rect->max_x; x++)
109            {
110               // only process written pixels
111               UINT16 pix = src[x];
112               if (pix != 0xffff)
113               {
114                  // compare sprite priority against tilemap priority
115                  int priority = pix >> 10;
116                  if ((1 << priority) > pri[x])
117                  {
118                     // if color bits are all 1, this triggers shadow/hilight
119                     if ((pix & 0x3f0) == 0x3f0)
120                        dest[x] += m_shadow ? m_palette_entries*2 : m_palette_entries;
121
122                     // otherwise, just add in sprite palette base
123                     else
124                        dest[x] = 1024 + (pix & 0x3ff);
125                  }
126               }
127            }
128         }
129         
130         // sharrier mixing
131         else
132         {
133            for (int x = rect->min_x; x <= rect->max_x; x++)
134            {
135               // only process written pixels
136               UINT16 pix = src[x];
137               if (pix != 0xffff)
138               {
139                  // compare sprite priority against tilemap priority
140                  int priority = ((pix >> 9) & 2) | 1;
141                  if ((1 << priority) > pri[x])
142                  {
143                     // if shadow bit is 0 and pix data is 0xa, this triggers shadow/hilight
144                     if ((pix & 0x80f) == 0x00a)
145                        dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries;
146
147                     // otherwise, just add in sprite palette base
148                     else
149                        dest[x] = 1024 + (pix & 0x3ff);
150                  }
151               }
152            }
153         }
154      }
155
98156   return 0;
99157}
100158
trunk/src/mame/video/segas16b.c
r17593r17594
4646
4747void segas16b_state::video_start()
4848{
49   // compute palette info
50   segaic16_palette_init(0x800);
51
5249   // initialize the tile/text layers
5350   segaic16_tilemap_init(machine(), 0, m_tilemap_type, 0x000, 0, 2);
5451}
r17593r17594
6764      return 0;
6865   }
6966
67   // start the sprites drawing
68   m_sprites->draw_async(cliprect);
69
7070   // reset priorities
7171   machine().priority_bitmap.fill(0, cliprect);
7272
r17593r17594
8787   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
8888   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
8989
90   // draw the sprites
91   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
90   // mix in sprites
91   bitmap_ind16 &sprites = m_sprites->bitmap();
92   for (const sparse_dirty_rect *rect = m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
93      for (int y = rect->min_y; y <= rect->max_y; y++)
94      {
95         UINT16 *dest = &bitmap.pix(y);
96         UINT16 *src = &sprites.pix(y);
97         UINT8 *pri = &machine().priority_bitmap.pix(y);
98         for (int x = rect->min_x; x <= rect->max_x; x++)
99         {
100            // only process written pixels
101            UINT16 pix = src[x];
102            if (pix != 0xffff)
103            {
104               // compare sprite priority against tilemap priority
105               int priority = (pix >> 10) & 3;
106               if ((1 << priority) > pri[x])
107               {
108                  // if the color is set to maximum, shadow pixels underneath us
109                  if ((pix & 0x03f0) == 0x03f0)
110                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries;
111
112                  // otherwise, just add in sprite palette base
113                  else
114                     dest[x] = 1024 + (pix & 0x3ff);
115               }
116            }
117         }
118      }
119
92120   return 0;
93121}
trunk/src/mame/video/segas18.c
r17593r17594
6363   m_vdp_enable = false;
6464   m_vdp_mixing = 0;
6565
66   // compute palette info
67   segaic16_palette_init(0x800);
68
6966   // initialize the tile/text layers
7067   segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 8);
7168
r17593r17594
227224      return 0;
228225   }
229226
227   // start the sprites drawing
228   m_sprites->draw_async(cliprect);
229
230230   // reset priorities
231231   machine().priority_bitmap.fill(0, cliprect);
232232
r17593r17594
250250   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
251251   if (m_vdp_enable && vdplayer == 3) draw_vdp(screen, bitmap, cliprect, vdppri);
252252
253   // draw the sprites
254   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
253   // mix in sprites
254   bitmap_ind16 &sprites = m_sprites->bitmap();
255   for (const sparse_dirty_rect *rect = m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
256      for (int y = rect->min_y; y <= rect->max_y; y++)
257      {
258         UINT16 *dest = &bitmap.pix(y);
259         UINT16 *src = &sprites.pix(y);
260         UINT8 *pri = &machine().priority_bitmap.pix(y);
261         for (int x = rect->min_x; x <= rect->max_x; x++)
262         {
263            // only process written pixels
264            UINT16 pix = src[x];
265            if (pix != 0xffff)
266            {
267               // compare sprite priority against tilemap priority
268               int priority = (pix >> 10) & 3;
269               if ((1 << priority) > pri[x])
270               {
271                  // if the color is set to maximum, shadow pixels underneath us
272                  if ((pix & 0x03f0) == 0x03f0)
273                     dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries;
255274
275                  // otherwise, just add in sprite palette base
276                  else
277                     dest[x] = 1024 + (pix & 0x3ff);
278               }
279            }
280         }
281      }
282
256283#if DEBUG_VDP
257284   if (m_vdp_enable && machine().input().code_pressed(KEYCODE_V))
258285   {
trunk/src/mame/includes/segaxbd.h
r17593r17594
4040#include "cpu/z80/z80.h"
4141#include "machine/segaic16.h"
4242#include "video/segaic16.h"
43#include "video/sega16sp.h"
4344
4445
4546// ======================> segaxbd_state
4647
47class segaxbd_state : public driver_device
48class segaxbd_state : public sega_16bit_common_base
4849{
4950public:
5051   // construction/destruction
5152   segaxbd_state(const machine_config &mconfig, device_type type, const char *tag)
52      : driver_device(mconfig, type, tag),
53      : sega_16bit_common_base(mconfig, type, tag),
5354        m_maincpu(*this, "maincpu"),
5455        m_subcpu(*this, "subcpu"),
5556        m_soundcpu(*this, "soundcpu"),
5657        m_soundcpu2(*this, "soundcpu2"),
5758        m_mcu(*this, "mcu"),
5859        m_cmptimer_1(*this, "cmptimer_main"),
60        m_sprites(*this, "sprites"),
5961        m_gprider_hack(false),
6062        m_road_priority(1),
6163        m_scanline_timer(NULL),
r17593r17594
145147   optional_device<z80_device> m_soundcpu2;
146148   optional_device<i8751_device> m_mcu;
147149   required_device<sega_315_5250_compare_timer_device> m_cmptimer_1;
150   required_device<sega_xboard_sprite_device> m_sprites;
148151
149152   // configuration
150153   bool         m_gprider_hack;
trunk/src/mame/includes/segaybd.h
r17593r17594
3939#include "cpu/z80/z80.h"
4040#include "machine/segaic16.h"
4141#include "video/segaic16.h"
42#include "video/sega16sp.h"
4243
4344
4445// ======================> segaybd_state
4546
46class segaybd_state : public driver_device
47class segaybd_state : public sega_16bit_common_base
4748{
4849public:
4950   // construction/destruction
5051   segaybd_state(const machine_config &mconfig, device_type type, const char *tag)
51      : driver_device(mconfig, type, tag),
52      : sega_16bit_common_base(mconfig, type, tag),
5253        m_maincpu(*this, "maincpu"),
5354        m_subx(*this, "subx"),
5455        m_suby(*this, "suby"),
5556        m_soundcpu(*this, "soundcpu"),
57        m_bsprites(*this, "bsprites"),
58        m_ysprites(*this, "ysprites"),
5659        m_pdrift_bank(0),
5760        m_scanline_timer(NULL),
5861        m_irq2_scanline(0),
r17593r17594
121124   required_device<m68000_device> m_subx;
122125   required_device<m68000_device> m_suby;
123126   required_device<z80_device> m_soundcpu;
127   required_device<sega_sys16b_sprite_device> m_bsprites;
128   required_device<sega_yboard_sprite_device> m_ysprites;
124129
125130   // configuration
126131   output_delegate   m_output_cb1;
trunk/src/mame/includes/segaorun.h
r17593r17594
4141#include "machine/nvram.h"
4242#include "machine/segaic16.h"
4343#include "video/segaic16.h"
44#include "video/sega16sp.h"
4445
4546
4647// ======================> segaorun_state
4748
48class segaorun_state : public driver_device
49class segaorun_state : public sega_16bit_common_base
4950{
5051public:
5152   // construction/destruction
5253   segaorun_state(const machine_config &mconfig, device_type type, const char *tag)
53      : driver_device(mconfig, type, tag),
54      : sega_16bit_common_base(mconfig, type, tag),
5455        m_mapper(*this, "mapper"),
5556        m_maincpu(*this, "maincpu"),
5657        m_subcpu(*this, "subcpu"),
5758        m_soundcpu(*this, "soundcpu"),
5859        m_i8255(*this, "i8255"),
5960        m_nvram(*this, "nvram"),
61        m_sprites(*this, "sprites"),
6062        m_workram(*this, "workram"),
6163        m_custom_map(NULL),
6264        m_shangon_video(false),
r17593r17594
134136   required_device<z80_device> m_soundcpu;
135137   required_device<i8255_device> m_i8255;
136138   optional_device<nvram_device> m_nvram;
139   required_device<sega_16bit_sprite_device> m_sprites;
137140
138141   // memory
139142   required_shared_ptr<UINT16> m_workram;
trunk/src/mame/includes/system16.h
r17593r17594
11
22// later, this might be merged with segas1x_state in segas16.h
33
4class segas1x_bootleg_state : public driver_device
4#include "video/sega16sp.h"
5#include "machine/segaic16.h"
6
7class segas1x_bootleg_state : public sega_16bit_common_base
58{
69public:
710   segas1x_bootleg_state(const machine_config &mconfig, device_type type, const char *tag)
8      : driver_device(mconfig, type, tag) ,
11      : sega_16bit_common_base(mconfig, type, tag) ,
912      m_textram(*this, "textram"),
1013      m_bg0_tileram(*this, "bg0_tileram"),
1114      m_bg1_tileram(*this, "bg1_tileram"),
1215      m_tileram(*this, "tileram"),
1316      m_goldnaxeb2_bgpage(*this, "gab2_bgpage"),
14      m_goldnaxeb2_fgpage(*this, "gab2_fgpage"){ }
17      m_goldnaxeb2_fgpage(*this, "gab2_fgpage"),
18      m_sprites(*this, "sprites")
19      { }
1520
1621   required_shared_ptr<UINT16> m_textram;
1722   optional_shared_ptr<UINT16> m_bg0_tileram;
r17593r17594
2025   optional_shared_ptr<UINT16> m_goldnaxeb2_bgpage;
2126   optional_shared_ptr<UINT16> m_goldnaxeb2_fgpage;
2227
28   required_device<sega_16bit_sprite_device> m_sprites;
2329
2430   UINT16 m_coinctrl;
2531
trunk/src/mame/includes/segas16a.h
r17593r17594
4545#include "machine/segaic16.h"
4646#include "sound/2151intf.h"
4747#include "video/segaic16.h"
48#include "video/sega16sp.h"
4849
4950
5051// ======================> segas16a_state
5152
52class segas16a_state : public driver_device
53class segas16a_state : public sega_16bit_common_base
5354{
5455public:
5556   // construction/destruction
5657   segas16a_state(const machine_config &mconfig, device_type type, const char *tag)
57      : driver_device(mconfig, type, tag),
58      : sega_16bit_common_base(mconfig, type, tag),
5859        m_maincpu(*this, "maincpu"),
5960        m_soundcpu(*this, "soundcpu"),
6061        m_mcu(*this, "mcu"),
r17593r17594
6364        m_n7751(*this, "n7751"),
6465        m_n7751_i8243(*this, "n7751_8243"),
6566        m_nvram(*this, "nvram"),
67        m_sprites(*this, "sprites"),
6668        m_workram(*this, "nvram"),
6769        m_video_control(0),
6870        m_mcu_control(0),
r17593r17594
158160   optional_device<n7751_device> m_n7751;
159161   optional_device<i8243_device> m_n7751_i8243;
160162   required_device<nvram_device> m_nvram;
163   required_device<sega_sys16a_sprite_device> m_sprites;
161164
162165   // memory pointers
163166   required_shared_ptr<UINT16> m_workram;
trunk/src/mame/includes/segahang.h
r17593r17594
4141#include "machine/i8255.h"
4242#include "machine/segaic16.h"
4343#include "video/segaic16.h"
44#include "video/sega16sp.h"
4445
4546
4647// ======================> segahang_state
4748
48class segahang_state : public driver_device
49class segahang_state : public sega_16bit_common_base
4950{
5051public:
5152   // construction/destruction
5253   segahang_state(const machine_config &mconfig, device_type type, const char *tag)
53      : driver_device(mconfig, type, tag),
54      : sega_16bit_common_base(mconfig, type, tag),
5455        m_maincpu(*this, "maincpu"),
5556        m_subcpu(*this, "subcpu"),
5657        m_soundcpu(*this, "soundcpu"),
5758        m_mcu(*this, "mcu"),
5859        m_i8255_1(*this, "i8255_1"),
5960        m_i8255_2(*this, "i8255_2"),
61        m_sprites(*this, "sprites"),
6062        m_workram(*this, "workram"),
6163        m_sharrier_video(false),
6264        m_adc_select(0)
r17593r17594
8789   DECLARE_DRIVER_INIT(enduror);
8890   DECLARE_DRIVER_INIT(endurobl);
8991   DECLARE_DRIVER_INIT(endurob2);
92   
9093   // video updates
9194   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9295
r17593r17594
116119   optional_device<i8751_device> m_mcu;
117120   required_device<i8255_device> m_i8255_1;
118121   required_device<i8255_device> m_i8255_2;
119
122   required_device<sega_16bit_sprite_device> m_sprites;
123   
120124   // memory pointers
121125   required_shared_ptr<UINT16> m_workram;
122126
r17593r17594
126130
127131   // internal state
128132   UINT8               m_adc_select;
133   bool               m_shadow;
129134};
trunk/src/mame/includes/segas16b.h
r17593r17594
4444#include "sound/2413intf.h"
4545#include "sound/upd7759.h"
4646#include "video/segaic16.h"
47#include "video/sega16sp.h"
4748
4849
4950// ======================> segas16b_state
5051
51class segas16b_state : public driver_device
52class segas16b_state : public sega_16bit_common_base
5253{
5354public:
5455   // construction/destruction
5556   segas16b_state(const machine_config &mconfig, device_type type, const char *tag)
56      : driver_device(mconfig, type, tag),
57      : sega_16bit_common_base(mconfig, type, tag),
5758        m_mapper(*this, "mapper"),
5859        m_maincpu(*this, "maincpu"),
5960        m_soundcpu(*this, "soundcpu"),
r17593r17594
6566        m_cmptimer_1(*this, "cmptimer_1"),
6667        m_cmptimer_2(*this, "cmptimer_2"),
6768        m_nvram(*this, "nvram"),
69        m_sprites(*this, "sprites"),
6870        m_workram(*this, "workram"),
6971        m_romboard(ROM_BOARD_INVALID),
7072        m_tilemap_type(SEGAIC16_TILEMAP_16B),
r17593r17594
193195   DECLARE_WRITE16_MEMBER( sjryuko_custom_io_w );
194196
195197   // devices
196   required_device<sega_315_5195_mapper_device> m_mapper;
198   optional_device<sega_315_5195_mapper_device> m_mapper;
197199   required_device<m68000_device> m_maincpu;
198200   optional_device<z80_device> m_soundcpu;
199201   optional_device<i8751_device> m_mcu;
r17593r17594
204206   optional_device<sega_315_5250_compare_timer_device> m_cmptimer_1;
205207   optional_device<sega_315_5250_compare_timer_device> m_cmptimer_2;
206208   required_device<nvram_device> m_nvram;
209   required_device<sega_sys16b_sprite_device> m_sprites;
207210
208211   // memory pointers
209212   required_shared_ptr<UINT16> m_workram;
trunk/src/mame/includes/segas18.h
r17593r17594
3838#include "cpu/m68000/m68000.h"
3939#include "cpu/mcs51/mcs51.h"
4040#include "cpu/z80/z80.h"
41#include "machine/megavdp.h"
4142#include "machine/nvram.h"
4243#include "machine/segaic16.h"
4344#include "video/segaic16.h"
44#include "machine/megavdp.h"
45#include "video/sega16sp.h"
4546
4647
4748// ======================> segas18_state
4849
49class segas18_state : public driver_device
50class segas18_state : public sega_16bit_common_base
5051{
5152public:
5253   // construction/destruction
5354   segas18_state(const machine_config &mconfig, device_type type, const char *tag)
54      : driver_device(mconfig, type, tag),
55      : sega_16bit_common_base(mconfig, type, tag),
5556        m_mapper(*this, "mapper"),
5657        m_maincpu(*this, "maincpu"),
5758        m_soundcpu(*this, "soundcpu"),
5859        m_mcu(*this, "mcu"),
5960        m_vdp(*this, "gen_vdp"),
6061        m_nvram(*this, "nvram"),
62        m_sprites(*this, "sprites"),
6163        m_workram(*this, "workram"),
6264        m_romboard(ROM_BOARD_INVALID),
6365        m_has_guns(false),
r17593r17594
150152   optional_device<i8751_device> m_mcu;
151153   required_device<sega_genesis_vdp_device> m_vdp;
152154   required_device<nvram_device> m_nvram;
155   required_device<sega_sys16b_sprite_device> m_sprites;
153156
154157   // memory pointers
155158   required_shared_ptr<UINT16> m_workram;
trunk/src/mame/drivers/segaxbd.c
r17593r17594
927927   AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_DEVREADWRITE("multiplier_main", sega_315_5248_multiplier_device, read, write)
928928   AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("divider_main", sega_315_5249_divider_device, read, write)
929929   AM_RANGE(0x0e8000, 0x0e801f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("cmptimer_main", sega_315_5250_compare_timer_device, read, write)
930   AM_RANGE(0x100000, 0x100fff) AM_MIRROR(0x00f000) AM_RAM AM_SHARE("spriteram")
931   AM_RANGE(0x110000, 0x11ffff) AM_WRITE_LEGACY(segaic16_sprites_draw_0_w)
932   AM_RANGE(0x120000, 0x123fff) AM_MIRROR(0x00c000) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_SHARE("paletteram")
930   AM_RANGE(0x100000, 0x100fff) AM_MIRROR(0x00f000) AM_RAM AM_SHARE("sprites")
931   AM_RANGE(0x110000, 0x11ffff) AM_DEVWRITE("sprites", sega_xboard_sprite_device, draw_write)
932   AM_RANGE(0x120000, 0x123fff) AM_MIRROR(0x00c000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
933933   AM_RANGE(0x130000, 0x13ffff) AM_READWRITE(adc_r, adc_w)
934934   AM_RANGE(0x140000, 0x14000f) AM_MIRROR(0x00fff0) AM_READWRITE(iochip_0_r, iochip_0_w)
935935   AM_RANGE(0x150000, 0x15000f) AM_MIRROR(0x00fff0) AM_READWRITE(iochip_1_r, iochip_1_w)
r17593r17594
16131613   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/8, 400, 0, 320, 262, 0, 224)
16141614   MCFG_SCREEN_UPDATE_DRIVER(segaxbd_state, screen_update)
16151615
1616   MCFG_SEGA16SP_ADD_XBOARD("segaspr1")
1616   MCFG_SEGA_XBOARD_SPRITES_ADD("sprites")
16171617
16181618   // sound hardware
16191619   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r17593r17594
17361736   ROM_LOAD( "epr-10925.153", 0x10000, 0x10000, CRC(4ef048cc) SHA1(3b386b3bfa600f114dbc19796bb6864a88ff4562) )
17371737   ROM_LOAD( "epr-10924.152", 0x20000, 0x10000, CRC(50c15a6d) SHA1(fc202cc583fc6804647abc884fdf332e72ea3100) )
17381738
1739   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
1739   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
17401740   ROM_LOAD32_BYTE( "mpr-10932.90",  0x000000, 0x20000, CRC(cc0821d6) SHA1(22e84419a585209bbda1466d2180504c316a9b7f) ) // First 8 roms are MPR, the rest are EPR
17411741   ROM_LOAD32_BYTE( "mpr-10934.94",  0x000001, 0x20000, CRC(4a51b1fa) SHA1(2eed018a5a1e935bb72b6f440a794466a1397dc5) )
17421742   ROM_LOAD32_BYTE( "mpr-10936.98",  0x000002, 0x20000, CRC(ada70d64) SHA1(ba6203b0fdb4c4998b7be5b446eb8354751d553a) )
r17593r17594
17871787   ROM_LOAD( "epr-11114.153", 0x10000, 0x10000, CRC(2e97f633) SHA1(074125c106dd00785903b2e10cd7e28d5036eb60) )
17881788   ROM_LOAD( "epr-11113.152", 0x20000, 0x10000, CRC(36058c8c) SHA1(52befe6c6c53f10b6fd4971098abc8f8d3eef9d4) )
17891789
1790   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
1790   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
17911791   ROM_LOAD32_BYTE( "mpr-10932.90",  0x000000, 0x20000, CRC(cc0821d6) SHA1(22e84419a585209bbda1466d2180504c316a9b7f) ) // First 8 roms are MPR, the rest are EPR
17921792   ROM_LOAD32_BYTE( "mpr-10934.94",  0x000001, 0x20000, CRC(4a51b1fa) SHA1(2eed018a5a1e935bb72b6f440a794466a1397dc5) )
17931793   ROM_LOAD32_BYTE( "mpr-10936.98",  0x000002, 0x20000, CRC(ada70d64) SHA1(ba6203b0fdb4c4998b7be5b446eb8354751d553a) )
r17593r17594
18541854   ROM_LOAD( "opr-12792.153", 0x10000, 0x10000, CRC(e506723c) SHA1(d04dc29686fe348f8f715d14c027de0e508c770f) )
18551855   ROM_LOAD( "opr-12793.152", 0x20000, 0x10000, CRC(0ce8cce3) SHA1(1a6b1af2b0b9e8240e681f7b15e9d08595753fe6) )
18561856
1857   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
1857   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
18581858   ROM_LOAD32_BYTE( "epr-12787.90",  0x000000, 0x20000, CRC(6431a3a6) SHA1(63a732b7dfd2b83fe7684d47fea26063c4ece099) )
18591859   ROM_LOAD32_BYTE( "epr-12788.94",  0x000001, 0x20000, CRC(1982a0ce) SHA1(e4756f31b0094e0e9ddb2df53a5c938ac5559230) )
18601860   ROM_LOAD32_BYTE( "epr-12789.98",  0x000002, 0x20000, CRC(97d03274) SHA1(b4b9921db53949bc8e91f8a2992e89c172fe8893) )
r17593r17594
19081908   ROM_LOAD( "opr-12792.153", 0x10000, 0x10000, CRC(e506723c) SHA1(d04dc29686fe348f8f715d14c027de0e508c770f) )
19091909   ROM_LOAD( "opr-12793.152", 0x20000, 0x10000, CRC(0ce8cce3) SHA1(1a6b1af2b0b9e8240e681f7b15e9d08595753fe6) )
19101910
1911   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
1911   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
19121912   ROM_LOAD32_BYTE( "epr-12787.90",  0x000000, 0x20000, CRC(6431a3a6) SHA1(63a732b7dfd2b83fe7684d47fea26063c4ece099) )
19131913   ROM_LOAD32_BYTE( "epr-12788.94",  0x000001, 0x20000, CRC(1982a0ce) SHA1(e4756f31b0094e0e9ddb2df53a5c938ac5559230) )
19141914   ROM_LOAD32_BYTE( "epr-12789.98",  0x000002, 0x20000, CRC(97d03274) SHA1(b4b9921db53949bc8e91f8a2992e89c172fe8893) )
r17593r17594
19651965   ROM_LOAD( "opr-12792.153", 0x10000, 0x10000, CRC(e506723c) SHA1(d04dc29686fe348f8f715d14c027de0e508c770f) )
19661966   ROM_LOAD( "opr-12793.152", 0x20000, 0x10000, CRC(0ce8cce3) SHA1(1a6b1af2b0b9e8240e681f7b15e9d08595753fe6) )
19671967
1968   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
1968   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
19691969   ROM_LOAD32_BYTE( "epr-12787.90",  0x000000, 0x20000, CRC(6431a3a6) SHA1(63a732b7dfd2b83fe7684d47fea26063c4ece099) )
19701970   ROM_LOAD32_BYTE( "epr-12788.94",  0x000001, 0x20000, CRC(1982a0ce) SHA1(e4756f31b0094e0e9ddb2df53a5c938ac5559230) )
19711971   ROM_LOAD32_BYTE( "epr-12789.98",  0x000002, 0x20000, CRC(97d03274) SHA1(b4b9921db53949bc8e91f8a2992e89c172fe8893) )
r17593r17594
20252025   ROM_LOAD( "epr-11315.ic153", 0x10000, 0x10000, CRC(35813088) SHA1(ea1ec982d1509efb26e7b6a150825a6a905efed9) )
20262026   ROM_LOAD( "epr-11316.ic152", 0x20000, 0x10000, CRC(84290dff) SHA1(c13fb6ef12a991f79a95072f953a02b5c992aa2d) )
20272027
2028   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2028   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
20292029   ROM_LOAD32_BYTE( "epr-11323.ic90",  0x000000, 0x20000, CRC(27e40735) SHA1(284ddb88efe741fb78199ea619c9b230ee689803) )
20302030   ROM_LOAD32_BYTE( "epr-11322.ic94",  0x000001, 0x20000, CRC(10364d74) SHA1(393b19a972b5d8817ffd438f13ded73cd58ebe56) )
20312031   ROM_LOAD32_BYTE( "epr-11321.ic98",  0x000002, 0x20000, CRC(8e738f58) SHA1(9f2dceebf01e582cf60f072ae411000d8503894b) )
r17593r17594
20792079   ROM_LOAD( "epr-11315.ic153", 0x10000, 0x10000, CRC(35813088) SHA1(ea1ec982d1509efb26e7b6a150825a6a905efed9) )
20802080   ROM_LOAD( "epr-11316.ic152", 0x20000, 0x10000, CRC(84290dff) SHA1(c13fb6ef12a991f79a95072f953a02b5c992aa2d) )
20812081
2082   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2082   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
20832083   ROM_LOAD32_BYTE( "epr-11323.ic90",  0x000000, 0x20000, CRC(27e40735) SHA1(284ddb88efe741fb78199ea619c9b230ee689803) )
20842084   ROM_LOAD32_BYTE( "epr-11322.ic94",  0x000001, 0x20000, CRC(10364d74) SHA1(393b19a972b5d8817ffd438f13ded73cd58ebe56) )
20852085   ROM_LOAD32_BYTE( "epr-11321.ic98",  0x000002, 0x20000, CRC(8e738f58) SHA1(9f2dceebf01e582cf60f072ae411000d8503894b) )
r17593r17594
21372137   ROM_LOAD( "epr-12056.ic153", 0x10000, 0x10000, CRC(3cd4c306) SHA1(b0f178688870c67936a15383024c392072e3bc66) )
21382138   ROM_LOAD( "epr-12057.ic152", 0x20000, 0x10000, CRC(37e91770) SHA1(69e26f4d3c4ebfaf0225a9b1c60038595929ef05) )
21392139
2140   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2140   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
21412141   ROM_LOAD32_BYTE( "mpr-12064.ic90",  0x000000, 0x20000, CRC(84562a69) SHA1(815189a65065def213ef171fe40a44a455dfe75a) )
21422142   ROM_LOAD32_BYTE( "mpr-12063.ic94",  0x000001, 0x20000, CRC(d163727c) SHA1(50ed2b401e107a359874dad5d86eec788f5504eb) )
21432143   ROM_LOAD32_BYTE( "mpr-12062.ic98",  0x000002, 0x20000, CRC(6b57833b) SHA1(1d70894c81a4cd39f43067701a598d2c4fbffa58) )
r17593r17594
21932193   ROM_LOAD( "epr-12880.ic153", 0x10000, 0x10000, CRC(27ff04a5) SHA1(b554a6e060f4803100be8efa52977b503eb0f31d) )
21942194   ROM_LOAD( "epr-12881.ic152", 0x20000, 0x10000, CRC(72f14491) SHA1(b7a6cbd08470a5edda77cdd0337abd502c4905fd) )
21952195
2196   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2196   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
21972197   ROM_LOAD32_BYTE( "epr-12872.ic90",  0x000000, 0x20000, CRC(68d56139) SHA1(b5f32edbda10c31d52f90defea2bae226676069f) )
21982198   ROM_LOAD32_BYTE( "epr-12873.ic94",  0x000001, 0x20000, CRC(3d3ec450) SHA1(ac96ad8c7b365478bd1e5826a073e242f1208247) )
21992199   ROM_LOAD32_BYTE( "epr-12874.ic98",  0x000002, 0x20000, CRC(7d6bde23) SHA1(88b12ec6386cdad60b0028b72033a0037a0cdbdb) )
r17593r17594
22892289   ROM_LOAD( "epr-12430.153", 0x10000, 0x10000, CRC(05e00134) SHA1(8baaa80815d5dabd38dc8600e357975b96d23b95) )
22902290   ROM_LOAD( "epr-12431.152", 0x20000, 0x10000, CRC(35572f4a) SHA1(d66456ecf7b59f81736fb873c553926b56bb3977))
22912291
2292   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2292   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
22932293   ROM_LOAD32_BYTE( "mpr-12425.90",  0x000000, 0x20000, CRC(14bf2a15) SHA1(84db3ac09e4a8fe470ac051d8d5de1814b48bc72) )
22942294   ROM_LOAD32_BYTE( "mpr-12426.94",  0x000001, 0x20000, CRC(28b60dc0) SHA1(ad69d449434853445a076319a55a29014217a100) )
22952295   ROM_LOAD32_BYTE( "mpr-12427.98",  0x000002, 0x20000, CRC(0a367928) SHA1(bcb558b7c23906397e66a7f046b09eb5036c0888) )
r17593r17594
23552355   ROM_LOAD( "epr-12430.153", 0x10000, 0x10000, CRC(05e00134) SHA1(8baaa80815d5dabd38dc8600e357975b96d23b95) )
23562356   ROM_LOAD( "epr-12431.152", 0x20000, 0x10000, CRC(35572f4a) SHA1(d66456ecf7b59f81736fb873c553926b56bb3977))
23572357
2358   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2358   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
23592359   ROM_LOAD32_BYTE( "mpr-12425.90",  0x000000, 0x20000, CRC(14bf2a15) SHA1(84db3ac09e4a8fe470ac051d8d5de1814b48bc72) )
23602360   ROM_LOAD32_BYTE( "mpr-12426.94",  0x000001, 0x20000, CRC(28b60dc0) SHA1(ad69d449434853445a076319a55a29014217a100) )
23612361   ROM_LOAD32_BYTE( "mpr-12427.98",  0x000002, 0x20000, CRC(0a367928) SHA1(bcb558b7c23906397e66a7f046b09eb5036c0888) )
r17593r17594
24712471   ROM_LOAD( "epr-12430.153", 0x10000, 0x10000, CRC(05e00134) SHA1(8baaa80815d5dabd38dc8600e357975b96d23b95) )
24722472   ROM_LOAD( "epr-12431.152", 0x20000, 0x10000, CRC(35572f4a) SHA1(d66456ecf7b59f81736fb873c553926b56bb3977))
24732473
2474   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2474   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
24752475   ROM_LOAD32_BYTE( "mpr-12425.90",  0x000000, 0x20000, CRC(14bf2a15) SHA1(84db3ac09e4a8fe470ac051d8d5de1814b48bc72) )
24762476   ROM_LOAD32_BYTE( "mpr-12426.94",  0x000001, 0x20000, CRC(28b60dc0) SHA1(ad69d449434853445a076319a55a29014217a100) )
24772477   ROM_LOAD32_BYTE( "mpr-12427.98",  0x000002, 0x20000, CRC(0a367928) SHA1(bcb558b7c23906397e66a7f046b09eb5036c0888) )
r17593r17594
25362536   ROM_LOAD( "epr-12430.153", 0x10000, 0x10000, CRC(05e00134) SHA1(8baaa80815d5dabd38dc8600e357975b96d23b95) )
25372537   ROM_LOAD( "epr-12431.152", 0x20000, 0x10000, CRC(35572f4a) SHA1(d66456ecf7b59f81736fb873c553926b56bb3977))
25382538
2539   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2539   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
25402540   ROM_LOAD32_BYTE( "mpr-12425.90",  0x000000, 0x20000, CRC(14bf2a15) SHA1(84db3ac09e4a8fe470ac051d8d5de1814b48bc72) )
25412541   ROM_LOAD32_BYTE( "mpr-12426.94",  0x000001, 0x20000, CRC(28b60dc0) SHA1(ad69d449434853445a076319a55a29014217a100) )
25422542   ROM_LOAD32_BYTE( "mpr-12427.98",  0x000002, 0x20000, CRC(0a367928) SHA1(bcb558b7c23906397e66a7f046b09eb5036c0888) )
r17593r17594
26022602   ROM_LOAD( "epr-12430.153", 0x10000, 0x10000, CRC(05e00134) SHA1(8baaa80815d5dabd38dc8600e357975b96d23b95) )
26032603   ROM_LOAD( "epr-12431.152", 0x20000, 0x10000, CRC(35572f4a) SHA1(d66456ecf7b59f81736fb873c553926b56bb3977))
26042604
2605   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2605   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
26062606   ROM_LOAD32_BYTE( "mpr-12425.90",  0x000000, 0x20000, CRC(14bf2a15) SHA1(84db3ac09e4a8fe470ac051d8d5de1814b48bc72) )
26072607   ROM_LOAD32_BYTE( "mpr-12426.94",  0x000001, 0x20000, CRC(28b60dc0) SHA1(ad69d449434853445a076319a55a29014217a100) )
26082608   ROM_LOAD32_BYTE( "mpr-12427.98",  0x000002, 0x20000, CRC(0a367928) SHA1(bcb558b7c23906397e66a7f046b09eb5036c0888) )
r17593r17594
27102710   ROM_LOAD( "epr-12430.153", 0x10000, 0x10000, CRC(05e00134) SHA1(8baaa80815d5dabd38dc8600e357975b96d23b95) )
27112711   ROM_LOAD( "epr-12431.152", 0x20000, 0x10000, CRC(35572f4a) SHA1(d66456ecf7b59f81736fb873c553926b56bb3977))
27122712
2713   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2713   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
27142714   ROM_LOAD32_BYTE( "mpr-12425.90",  0x000000, 0x20000, CRC(14bf2a15) SHA1(84db3ac09e4a8fe470ac051d8d5de1814b48bc72) )
27152715   ROM_LOAD32_BYTE( "mpr-12426.94",  0x000001, 0x20000, CRC(28b60dc0) SHA1(ad69d449434853445a076319a55a29014217a100) )
27162716   ROM_LOAD32_BYTE( "mpr-12427.98",  0x000002, 0x20000, CRC(0a367928) SHA1(bcb558b7c23906397e66a7f046b09eb5036c0888) )
r17593r17594
27752775   ROM_LOAD( "epr-12430.153", 0x10000, 0x10000, CRC(05e00134) SHA1(8baaa80815d5dabd38dc8600e357975b96d23b95) )
27762776   ROM_LOAD( "epr-12431.152", 0x20000, 0x10000, CRC(35572f4a) SHA1(d66456ecf7b59f81736fb873c553926b56bb3977))
27772777
2778   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2778   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
27792779   ROM_LOAD32_BYTE( "mpr-12425.90",  0x000000, 0x20000, CRC(14bf2a15) SHA1(84db3ac09e4a8fe470ac051d8d5de1814b48bc72) )
27802780   ROM_LOAD32_BYTE( "mpr-12426.94",  0x000001, 0x20000, CRC(28b60dc0) SHA1(ad69d449434853445a076319a55a29014217a100) )
27812781   ROM_LOAD32_BYTE( "mpr-12427.98",  0x000002, 0x20000, CRC(0a367928) SHA1(bcb558b7c23906397e66a7f046b09eb5036c0888) )
r17593r17594
28402840   ROM_LOAD( "epr-12430.153", 0x10000, 0x10000, CRC(05e00134) SHA1(8baaa80815d5dabd38dc8600e357975b96d23b95) )
28412841   ROM_LOAD( "epr-12431.152", 0x20000, 0x10000, CRC(35572f4a) SHA1(d66456ecf7b59f81736fb873c553926b56bb3977))
28422842
2843   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2843   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
28442844   ROM_LOAD32_BYTE( "mpr-12425.90",  0x000000, 0x20000, CRC(14bf2a15) SHA1(84db3ac09e4a8fe470ac051d8d5de1814b48bc72) )
28452845   ROM_LOAD32_BYTE( "mpr-12426.94",  0x000001, 0x20000, CRC(28b60dc0) SHA1(ad69d449434853445a076319a55a29014217a100) )
28462846   ROM_LOAD32_BYTE( "mpr-12427.98",  0x000002, 0x20000, CRC(0a367928) SHA1(bcb558b7c23906397e66a7f046b09eb5036c0888) )
r17593r17594
29102910   ROM_LOAD( "opr-13554.ic153", 0x10000, 0x10000, CRC(4e3df9f0) SHA1(8b481c2cd25c58612ac8ac3ffb7eeae9ca247d2e) )
29112911   ROM_LOAD( "opr-13555.ic152", 0x20000, 0x10000, CRC(6c4a1d42) SHA1(6c37b045b21173f1e2f7bd19d01c00979b8107fb) )
29122912
2913   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2913   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
29142914   ROM_LOAD32_BYTE( "opr-13552.ic90",  0x000000, 0x20000, CRC(cc2cf706) SHA1(ad39c22e652ebcd90ffb5e17ae35985645f93c71) )
29152915   ROM_LOAD32_BYTE( "opr-13551.ic94",  0x000001, 0x20000, CRC(d6f276c1) SHA1(9ec68157ea460e09ef4b69aa8ea17687dc47ea59) )
29162916   ROM_LOAD32_BYTE( "opr-13550.ic98",  0x000002, 0x20000, CRC(f16518dd) SHA1(a5f1785cd28f03069cb238ac92c6afb5a26cbd37) )
r17593r17594
29632963   ROM_LOAD( "opr-13554.ic153", 0x10000, 0x10000, CRC(4e3df9f0) SHA1(8b481c2cd25c58612ac8ac3ffb7eeae9ca247d2e) )
29642964   ROM_LOAD( "opr-13555.ic152", 0x20000, 0x10000, CRC(6c4a1d42) SHA1(6c37b045b21173f1e2f7bd19d01c00979b8107fb) )
29652965
2966   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
2966   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
29672967   ROM_LOAD32_BYTE( "opr-13552.ic90",  0x000000, 0x20000, CRC(cc2cf706) SHA1(ad39c22e652ebcd90ffb5e17ae35985645f93c71) )
29682968   ROM_LOAD32_BYTE( "opr-13551.ic94",  0x000001, 0x20000, CRC(d6f276c1) SHA1(9ec68157ea460e09ef4b69aa8ea17687dc47ea59) )
29692969   ROM_LOAD32_BYTE( "opr-13550.ic98",  0x000002, 0x20000, CRC(f16518dd) SHA1(a5f1785cd28f03069cb238ac92c6afb5a26cbd37) )
r17593r17594
30213021   ROM_LOAD( "epr-13384.ic153", 0x10000, 0x10000, CRC(fe8238bd) SHA1(601910bd86536e6b08f5308b298c8f01fa60f233) )
30223022   ROM_LOAD( "epr-13385.ic152", 0x20000, 0x10000, CRC(6df1b995) SHA1(5aab19b87a9ef162c30ccf5974cb795e37dba91f) )
30233023
3024   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
3024   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
30253025   ROM_LOAD32_BYTE( "epr-13382.ic90",  0x000000, 0x20000, CRC(01dac209) SHA1(4c6b03308193c472f6cdbcede306f8ce6db0cc4b) )
30263026   ROM_LOAD32_BYTE( "epr-13381.ic94",  0x000001, 0x20000, CRC(3a50d931) SHA1(9d9cb1793f3b8f562ce0ea49f2afeef099f20859) )
30273027   ROM_LOAD32_BYTE( "epr-13380.ic98",  0x000002, 0x20000, CRC(ad1024c8) SHA1(86e941424b2e2e00940886e5daed640a78ed7403) )
r17593r17594
30763076   ROM_LOAD( "epr-13384.ic153", 0x10000, 0x10000, CRC(fe8238bd) SHA1(601910bd86536e6b08f5308b298c8f01fa60f233) )
30773077   ROM_LOAD( "epr-13385.ic152", 0x20000, 0x10000, CRC(6df1b995) SHA1(5aab19b87a9ef162c30ccf5974cb795e37dba91f) )
30783078
3079   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
3079   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
30803080   ROM_LOAD32_BYTE( "epr-13382.ic90",  0x000000, 0x20000, CRC(01dac209) SHA1(4c6b03308193c472f6cdbcede306f8ce6db0cc4b) )
30813081   ROM_LOAD32_BYTE( "epr-13381.ic94",  0x000001, 0x20000, CRC(3a50d931) SHA1(9d9cb1793f3b8f562ce0ea49f2afeef099f20859) )
30823082   ROM_LOAD32_BYTE( "epr-13380.ic98",  0x000002, 0x20000, CRC(ad1024c8) SHA1(86e941424b2e2e00940886e5daed640a78ed7403) )
r17593r17594
31313131   ROM_LOAD( "epr-13384.ic153", 0x10000, 0x10000, CRC(fe8238bd) SHA1(601910bd86536e6b08f5308b298c8f01fa60f233) )
31323132   ROM_LOAD( "epr-13385.ic152", 0x20000, 0x10000, CRC(6df1b995) SHA1(5aab19b87a9ef162c30ccf5974cb795e37dba91f) )
31333133
3134   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
3134   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
31353135   ROM_LOAD32_BYTE( "epr-13382.ic90",  0x000000, 0x20000, CRC(01dac209) SHA1(4c6b03308193c472f6cdbcede306f8ce6db0cc4b) )
31363136   ROM_LOAD32_BYTE( "epr-13381.ic94",  0x000001, 0x20000, CRC(3a50d931) SHA1(9d9cb1793f3b8f562ce0ea49f2afeef099f20859) )
31373137   ROM_LOAD32_BYTE( "epr-13380.ic98",  0x000002, 0x20000, CRC(ad1024c8) SHA1(86e941424b2e2e00940886e5daed640a78ed7403) )
r17593r17594
31823182   ROM_LOAD( "epr-13962", 0x10000, 0x10000, CRC(7d7605bc) SHA1(20d3a7116807db7c831e285233d8c67317980e4a) )
31833183   ROM_LOAD( "epr-13963", 0x20000, 0x10000, CRC(f3376b65) SHA1(36b9292518a112409d03b97ea048b7ab22734841) )
31843184
3185   ROM_REGION32_LE( 0x200000, "gfx2", 0 ) // sprites
3185   ROM_REGION32_LE( 0x200000, "sprites", 0 ) // sprites
31863186   ROM_LOAD32_BYTE( "epr-13960",  0x000000, 0x20000, CRC(b974128d) SHA1(14450615b3a10b1de6d098a282f80f80c98c34b8) )
31873187   ROM_LOAD32_BYTE( "epr-13959",  0x000001, 0x20000, CRC(db245b22) SHA1(301b7caea7a3b42ab1ab21894ad61b8b14ef1e7c) )
31883188   ROM_LOAD32_BYTE( "epr-13958",  0x000002, 0x20000, CRC(7803a027) SHA1(ff659da334e4440a6de9be43dde9dfa21dae5f14) )
r17593r17594
32183218   m_iochip_custom_io_w[0][3] = iowrite_delegate(FUNC(segaxbd_state::generic_iochip0_lamps_w), this);
32193219
32203220   // point globals to allocated memory regions
3221   segaic16_spriteram_0 = reinterpret_cast<UINT16 *>(memshare("spriteram")->ptr());
3222   segaic16_paletteram = reinterpret_cast<UINT16 *>(memshare("paletteram")->ptr());
32233221   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
32243222   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
32253223   segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
trunk/src/mame/drivers/segaybd.c
r17593r17594
725725   AM_RANGE(0x080000, 0x080007) AM_MIRROR(0x001ff8) AM_DEVREADWRITE("multiplier_subx", sega_315_5248_multiplier_device, read, write)
726726   AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_DEVREADWRITE("divider_subx", sega_315_5249_divider_device, read, write)
727727   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE("shareram")
728   AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("spriteram2")
728   AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("ysprites")
729729   AM_RANGE(0x1f8000, 0x1fbfff) AM_RAM
730730   AM_RANGE(0x1fc000, 0x1fffff) AM_RAM AM_SHARE("backupram")
731731ADDRESS_MAP_END
r17593r17594
738738   AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_DEVREADWRITE("divider_suby", sega_315_5249_divider_device, read, write)
739739   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE("shareram")
740740   AM_RANGE(0x180000, 0x1807ff) AM_MIRROR(0x007800) AM_RAM AM_SHARE("rotateram")
741   AM_RANGE(0x188000, 0x188fff) AM_MIRROR(0x007000) AM_RAM AM_SHARE("spriteram")
742   AM_RANGE(0x190000, 0x193fff) AM_MIRROR(0x004000) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_SHARE("paletteram")
741   AM_RANGE(0x188000, 0x188fff) AM_MIRROR(0x007000) AM_RAM AM_SHARE("bsprites")
742   AM_RANGE(0x190000, 0x193fff) AM_MIRROR(0x004000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
743743   AM_RANGE(0x198000, 0x19ffff) AM_READ_LEGACY(segaic16_rotate_control_0_r)
744744   AM_RANGE(0x1f0000, 0x1fffff) AM_RAM
745745ADDRESS_MAP_END
r17593r17594
12351235   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
12361236   MCFG_SCREEN_UPDATE_DRIVER(segaybd_state,screen_update)
12371237
1238   MCFG_SEGA16SP_ADD_YBOARD_16B("segaspr1")
1239   MCFG_SEGA16SP_ADD_YBOARD("segaspr2")
1238   MCFG_SEGA_SYS16B_SPRITES_ADD("bsprites")
1239   MCFG_SEGA_YBOARD_SPRITES_ADD("ysprites")
12401240
12411241   MCFG_PALETTE_LENGTH(8192*3)
12421242
r17593r17594
12911291   ROM_LOAD16_BYTE( "epr-11816b.54",   0x000000, 0x20000, CRC(317dd0c2) SHA1(7f1c7dcfb111385e2a94912975c2f9bfe78445ac) )
12921292   ROM_LOAD16_BYTE( "epr-11815b.53",   0x000001, 0x20000, CRC(f1fb22f1) SHA1(da3ce521b0a19b391913c35af34084d29edceca7) )
12931293
1294   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
1294   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
12951295   ROM_LOAD16_BYTE( "mpr-11467.16",   0x000000, 0x20000, CRC(6e60e736) SHA1(73086744cb2fe1ce162f851cb879755c21819b33) )
12961296   ROM_LOAD16_BYTE( "mpr-11468.14",   0x000001, 0x20000, CRC(74ca9ca5) SHA1(c6f27ce43ef270088e6155c8240fd15afa5729fd) )
12971297   ROM_LOAD16_BYTE( "epr-11694.17",   0x040000, 0x20000, CRC(7e297b84) SHA1(bbf1aa2b0b6b1f9fdaf9bea77d24b7f4f9320696) )
12981298   ROM_LOAD16_BYTE( "epr-11695.15",   0x040001, 0x20000, CRC(38a864be) SHA1(ef7d89511713d695f6a454c42f079d3507d9690d) )
12991299
1300   ROM_REGION64_BE( 0x400000, "gfx1", 0)
1300   ROM_REGION64_BE( 0x400000, "ysprites", 0)
13011301   ROMX_LOAD( "mpr-11469.67",   0x000000, 0x20000, CRC(ed7a2299) SHA1(1aecf9ccba1fed0b7908008e798c522251a08b0f), ROM_SKIP(7) )
13021302   ROMX_LOAD( "mpr-11470.75",   0x000001, 0x20000, CRC(34dea550) SHA1(da95b8346c3530573461553629af4cc493bbb4af), ROM_SKIP(7) )
13031303   ROMX_LOAD( "mpr-11477.63",   0x000002, 0x20000, CRC(a2784653) SHA1(00a123d1fc8116ca678d6d8dbf1a5450feee014d), ROM_SKIP(7) )
r17593r17594
13661366   ROM_LOAD16_BYTE( "epr-11690a.54",  0x000000, 0x20000, CRC(e18bc177) SHA1(3fb179c9074954fc9b64da1463f542d60a99ec84) )
13671367   ROM_LOAD16_BYTE( "epr-11689a.53",  0x000001, 0x20000, CRC(6010e63e) SHA1(00aa5e8516f094409a407744b84ef183393b8b19) )
13681368
1369   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
1369   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
13701370   ROM_LOAD16_BYTE( "mpr-11467.16",   0x000000, 0x20000, CRC(6e60e736) SHA1(73086744cb2fe1ce162f851cb879755c21819b33) )
13711371   ROM_LOAD16_BYTE( "mpr-11468.14",   0x000001, 0x20000, CRC(74ca9ca5) SHA1(c6f27ce43ef270088e6155c8240fd15afa5729fd) )
13721372   ROM_LOAD16_BYTE( "epr-11694.17",   0x040000, 0x20000, CRC(7e297b84) SHA1(bbf1aa2b0b6b1f9fdaf9bea77d24b7f4f9320696) )
13731373   ROM_LOAD16_BYTE( "epr-11695.15",   0x040001, 0x20000, CRC(38a864be) SHA1(ef7d89511713d695f6a454c42f079d3507d9690d) )
13741374
1375   ROM_REGION64_BE( 0x400000, "gfx1", 0)
1375   ROM_REGION64_BE( 0x400000, "ysprites", 0)
13761376   ROMX_LOAD( "mpr-11469.67",   0x000000, 0x20000, CRC(ed7a2299) SHA1(1aecf9ccba1fed0b7908008e798c522251a08b0f), ROM_SKIP(7) )
13771377   ROMX_LOAD( "mpr-11470.75",   0x000001, 0x20000, CRC(34dea550) SHA1(da95b8346c3530573461553629af4cc493bbb4af), ROM_SKIP(7) )
13781378   ROMX_LOAD( "mpr-11477.63",   0x000002, 0x20000, CRC(a2784653) SHA1(00a123d1fc8116ca678d6d8dbf1a5450feee014d), ROM_SKIP(7) )
r17593r17594
14411441   ROM_LOAD16_BYTE( "epr-11513.54",   0x000000, 0x20000, CRC(e18bc177) SHA1(3fb179c9074954fc9b64da1463f542d60a99ec84) )
14421442   ROM_LOAD16_BYTE( "epr-11512.53",   0x000001, 0x20000, CRC(6010e63e) SHA1(00aa5e8516f094409a407744b84ef183393b8b19) )
14431443
1444   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
1444   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
14451445   ROM_LOAD16_BYTE( "mpr-11467.16",   0x000000, 0x20000, CRC(6e60e736) SHA1(73086744cb2fe1ce162f851cb879755c21819b33) )
14461446   ROM_LOAD16_BYTE( "mpr-11468.14",   0x000001, 0x20000, CRC(74ca9ca5) SHA1(c6f27ce43ef270088e6155c8240fd15afa5729fd) )
14471447   ROM_LOAD16_BYTE( "epr-11694.17",   0x040000, 0x20000, CRC(7e297b84) SHA1(bbf1aa2b0b6b1f9fdaf9bea77d24b7f4f9320696) )
14481448   ROM_LOAD16_BYTE( "epr-11695.15",   0x040001, 0x20000, CRC(38a864be) SHA1(ef7d89511713d695f6a454c42f079d3507d9690d) )
14491449
1450   ROM_REGION64_BE( 0x400000, "gfx1", 0)
1450   ROM_REGION64_BE( 0x400000, "ysprites", 0)
14511451   ROMX_LOAD( "mpr-11469.67",   0x000000, 0x20000, CRC(ed7a2299) SHA1(1aecf9ccba1fed0b7908008e798c522251a08b0f), ROM_SKIP(7) )
14521452   ROMX_LOAD( "mpr-11470.75",   0x000001, 0x20000, CRC(34dea550) SHA1(da95b8346c3530573461553629af4cc493bbb4af), ROM_SKIP(7) )
14531453   ROMX_LOAD( "mpr-11477.63",   0x000002, 0x20000, CRC(a2784653) SHA1(00a123d1fc8116ca678d6d8dbf1a5450feee014d), ROM_SKIP(7) )
r17593r17594
15231523   ROM_LOAD16_BYTE( "epr-13030.54",  0x000000, 0x20000, CRC(81abcabf) SHA1(cb4e817d66a7f384aa9757758c51cd1bf7347dd0) )
15241524   ROM_LOAD16_BYTE( "epr-13029.53",  0x000001, 0x20000, CRC(f3638efb) SHA1(f82a46fc8616cbe0235746161c587e54adecfe50) )
15251525
1526   ROM_REGION16_BE( 0x200000, "gfx2", 0)
1526   ROM_REGION16_BE( 0x200000, "bsprites", 0)
15271527   ROM_LOAD16_BYTE( "epr-13039.16",  0x000000, 0x80000, CRC(d7e1266d) SHA1(b0fc4cc60a7e876ae2af343bba6da3fb926ea9c5) )
15281528   ROM_LOAD16_BYTE( "epr-13037.14",  0x000001, 0x80000, CRC(b801a250) SHA1(7d1f6a1f2022a4f302f22d11fa79057cf8134ad2) )
15291529   ROM_LOAD16_BYTE( "epr-13040.17",  0x100000, 0x80000, CRC(4aeb3a85) SHA1(5521fd2d3956839bdbe7b70a9e60cd9fb72a42f1) )
15301530   ROM_LOAD16_BYTE( "epr-13038.15",  0x100001, 0x80000, CRC(0b2edb6d) SHA1(04944d6e6f020cd6d33641110847706516630227) )
15311531
1532   ROM_REGION64_BE( 0x1000000, "gfx1", 0 )
1532   ROM_REGION64_BE( 0x1000000, "ysprites", 0 )
15331533   ROMX_LOAD( "epr-13048.67",  0x000000, 0x80000, CRC(fe1eb0dd) SHA1(5e292fc0b83505eb289e026d4be24c9038ef1418), ROM_SKIP(7) )
15341534   ROMX_LOAD( "epr-13056.75",  0x000001, 0x80000, CRC(5904f8e6) SHA1(fbb01dadc796624c360d44b7631e3f1f285abf2e), ROM_SKIP(7) )
15351535   ROMX_LOAD( "epr-13044.63",  0x000002, 0x80000, CRC(4d931f89) SHA1(ff603f4347e4728a2849d9f480893ad0af7abc5c), ROM_SKIP(7) )
r17593r17594
15921592   ROM_LOAD16_BYTE( "epr-13325a.54",  0x000000, 0x20000, CRC(aba307e5) SHA1(a27a7d3699a95d7c6265a23157b2fefd362003dd) )
15931593   ROM_LOAD16_BYTE( "epr-13324a.53",  0x000001, 0x20000, CRC(eb1b19e5) SHA1(3d1d7299cb3befc22afc0db0376d7f94dec37367) )
15941594
1595   ROM_REGION16_BE( 0x200000, "gfx2", 0)
1595   ROM_REGION16_BE( 0x200000, "bsprites", 0)
15961596   ROM_LOAD16_BYTE( "epr-13039.16",  0x000000, 0x80000, CRC(d7e1266d) SHA1(b0fc4cc60a7e876ae2af343bba6da3fb926ea9c5) )
15971597   ROM_LOAD16_BYTE( "epr-13037.14",  0x000001, 0x80000, CRC(b801a250) SHA1(7d1f6a1f2022a4f302f22d11fa79057cf8134ad2) )
15981598   ROM_LOAD16_BYTE( "epr-13040.17",  0x100000, 0x80000, CRC(4aeb3a85) SHA1(5521fd2d3956839bdbe7b70a9e60cd9fb72a42f1) )
15991599   ROM_LOAD16_BYTE( "epr-13038.15",  0x100001, 0x80000, CRC(0b2edb6d) SHA1(04944d6e6f020cd6d33641110847706516630227) )
16001600
1601   ROM_REGION64_BE( 0x1000000, "gfx1", 0 )
1601   ROM_REGION64_BE( 0x1000000, "ysprites", 0 )
16021602   ROMX_LOAD( "epr-13048.67",  0x000000, 0x80000, CRC(fe1eb0dd) SHA1(5e292fc0b83505eb289e026d4be24c9038ef1418), ROM_SKIP(7) )
16031603   ROMX_LOAD( "epr-13056.75",  0x000001, 0x80000, CRC(5904f8e6) SHA1(fbb01dadc796624c360d44b7631e3f1f285abf2e), ROM_SKIP(7) )
16041604   ROMX_LOAD( "epr-13044.63",  0x000002, 0x80000, CRC(4d931f89) SHA1(ff603f4347e4728a2849d9f480893ad0af7abc5c), ROM_SKIP(7) )
r17593r17594
16681668   ROM_LOAD16_BYTE( "epr-12019a.54", 0x000000, 0x20000, CRC(11188a30) SHA1(42dd0344d92529848b53a8cec4c145237ccd5b51) )
16691669   ROM_LOAD16_BYTE( "epr-12018a.53", 0x000001, 0x20000, CRC(1c582e1f) SHA1(c32d2f921554bddd7dedcb81e231aa91f50fa27b) )
16701670
1671   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
1671   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
16721672   ROM_LOAD16_BYTE( "epr-11789.16",  0x000000, 0x20000, CRC(b86f8d2b) SHA1(a053f2021841fd0ef89fd3f28050a698b36c435e) )
16731673   ROM_LOAD16_BYTE( "epr-11791.14",  0x000001, 0x20000, CRC(36b2910a) SHA1(9948b91837f944a7a606542fa685525e74bbe398) )
16741674   ROM_LOAD16_BYTE( "epr-11790.17",  0x040000, 0x20000, CRC(2a564e66) SHA1(5f30fc15bfd017d75cfffe1e9e62ed0bcf32a98e) )
16751675   ROM_LOAD16_BYTE( "epr-11792.15",  0x040001, 0x20000, CRC(c85caf6e) SHA1(2411ea99ec7f6e2b0b4f219e86ff2172539ad2c4) )
16761676
1677   ROM_REGION64_BE( 0x400000, "gfx1", 0)
1677   ROM_REGION64_BE( 0x400000, "ysprites", 0)
16781678   ROMX_LOAD( "epr-11757.67",  0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7) )
16791679   ROMX_LOAD( "epr-11758.75",  0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7) )
16801680   ROMX_LOAD( "epr-11773.63",  0x000002, 0x20000, CRC(1b5d5758) SHA1(54f58a274740a0566e0553d145c0c284ffd1d36b), ROM_SKIP(7) )
r17593r17594
17501750   ROM_LOAD16_BYTE( "epr-12019.54", 0x000000, 0x20000, CRC(e514d7b6) SHA1(27ae99f5f3e8d2f248916f7a252e2c0686638df5) )
17511751   ROM_LOAD16_BYTE( "epr-12018.53", 0x000001, 0x20000, CRC(0a3f7faf) SHA1(fe20a164a7a2c9e9bf0e7aade75b0488bdc93d79) )
17521752
1753   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
1753   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
17541754   ROM_LOAD16_BYTE( "epr-11789.16",  0x000000, 0x20000, CRC(b86f8d2b) SHA1(a053f2021841fd0ef89fd3f28050a698b36c435e) )
17551755   ROM_LOAD16_BYTE( "epr-11791.14",  0x000001, 0x20000, CRC(36b2910a) SHA1(9948b91837f944a7a606542fa685525e74bbe398) )
17561756   ROM_LOAD16_BYTE( "epr-11790.17",  0x040000, 0x20000, CRC(2a564e66) SHA1(5f30fc15bfd017d75cfffe1e9e62ed0bcf32a98e) )
17571757   ROM_LOAD16_BYTE( "epr-11792.15",  0x040001, 0x20000, CRC(c85caf6e) SHA1(2411ea99ec7f6e2b0b4f219e86ff2172539ad2c4) )
17581758
1759   ROM_REGION64_BE( 0x400000, "gfx1", 0)
1759   ROM_REGION64_BE( 0x400000, "ysprites", 0)
17601760   ROMX_LOAD( "epr-11757.67",  0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7) )
17611761   ROMX_LOAD( "epr-11758.75",  0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7) )
17621762   ROMX_LOAD( "epr-11773.63",  0x000002, 0x20000, CRC(1b5d5758) SHA1(54f58a274740a0566e0553d145c0c284ffd1d36b), ROM_SKIP(7) )
r17593r17594
18331833   ROM_LOAD16_BYTE( "epr-11903.54",  0x000000, 0x20000, CRC(d004f411) SHA1(212a985275647fae24b580ebaffc1230c06318ac) )
18341834   ROM_LOAD16_BYTE( "epr-11902.53",  0x000001, 0x20000, CRC(e8028e08) SHA1(de4ee5011e9552e624b6223e0e1ef00bc271a811) )
18351835
1836   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
1836   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
18371837   ROM_LOAD16_BYTE( "epr-11789.16",  0x000000, 0x20000, CRC(b86f8d2b) SHA1(a053f2021841fd0ef89fd3f28050a698b36c435e) )
18381838   ROM_LOAD16_BYTE( "epr-11791.14",  0x000001, 0x20000, CRC(36b2910a) SHA1(9948b91837f944a7a606542fa685525e74bbe398) )
18391839   ROM_LOAD16_BYTE( "epr-11790.17",  0x040000, 0x20000, CRC(2a564e66) SHA1(5f30fc15bfd017d75cfffe1e9e62ed0bcf32a98e) )
18401840   ROM_LOAD16_BYTE( "epr-11792.15",  0x040001, 0x20000, CRC(c85caf6e) SHA1(2411ea99ec7f6e2b0b4f219e86ff2172539ad2c4) )
18411841
1842   ROM_REGION64_BE( 0x400000, "gfx1", 0)
1842   ROM_REGION64_BE( 0x400000, "ysprites", 0)
18431843   ROMX_LOAD( "epr-11757.67",  0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7) )
18441844   ROMX_LOAD( "epr-11758.75",  0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7) )
18451845   ROMX_LOAD( "epr-11773.63",  0x000002, 0x20000, CRC(1b5d5758) SHA1(54f58a274740a0566e0553d145c0c284ffd1d36b), ROM_SKIP(7) )
r17593r17594
19191919   ROM_LOAD16_BYTE( "epr-11750b.54", 0x000000, 0x20000, CRC(bc14ce30) SHA1(9bbadee0946e0abaac4f0d2625ba5550f11fa8a9) )
19201920   ROM_LOAD16_BYTE( "epr-11749b.53", 0x000001, 0x20000, CRC(9e385568) SHA1(74e22eaed645cc80b1eb0c52912186066e58b9d2) )
19211921
1922   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
1922   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
19231923   ROM_LOAD16_BYTE( "epr-11789.16",  0x000000, 0x20000, CRC(b86f8d2b) SHA1(a053f2021841fd0ef89fd3f28050a698b36c435e) )
19241924   ROM_LOAD16_BYTE( "epr-11791.14",  0x000001, 0x20000, CRC(36b2910a) SHA1(9948b91837f944a7a606542fa685525e74bbe398) )
19251925   ROM_LOAD16_BYTE( "epr-11790.17",  0x040000, 0x20000, CRC(2a564e66) SHA1(5f30fc15bfd017d75cfffe1e9e62ed0bcf32a98e) )
19261926   ROM_LOAD16_BYTE( "epr-11792.15",  0x040001, 0x20000, CRC(c85caf6e) SHA1(2411ea99ec7f6e2b0b4f219e86ff2172539ad2c4) )
19271927
1928   ROM_REGION64_BE( 0x400000, "gfx1", 0)
1928   ROM_REGION64_BE( 0x400000, "ysprites", 0)
19291929   ROMX_LOAD( "epr-11757.67",  0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7) )
19301930   ROMX_LOAD( "epr-11758.75",  0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7) )
19311931   ROMX_LOAD( "epr-11773.63",  0x000002, 0x20000, CRC(1b5d5758) SHA1(54f58a274740a0566e0553d145c0c284ffd1d36b), ROM_SKIP(7) )
r17593r17594
20092009   ROM_LOAD16_BYTE( "epr-14092.54",  0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) )
20102010   ROM_LOAD16_BYTE( "epr-14091.53",  0x000001, 0x20000, CRC(72a56f71) SHA1(d45d3072ea92b5dde5c70138e56e7f0ca248880e) )
20112011
2012   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
2012   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
20132013   ROM_LOAD16_BYTE( "mpr-13999.16", 0x000000, 0x40000, CRC(9a1dd53c) SHA1(cb01f2c64554914ea693879dfcb498181a1e7a9a) )
20142014   ROM_LOAD16_BYTE( "mpr-13997.14", 0x000001, 0x40000, CRC(1fdf1b87) SHA1(ed46af0f72081d545015b73a8d12240664f29506) )
20152015
2016   ROM_REGION64_BE( 0xc00000, "gfx1", 0)
2016   ROM_REGION64_BE( 0xc00000, "ysprites", 0)
20172017   ROMX_LOAD( "mpr-14021.67",  0x000000, 0x80000, CRC(9fa88781) SHA1(a035fd0fe1d37a589adf3a5029c20d237d5cc827), ROM_SKIP(7) )
20182018   ROMX_LOAD( "mpr-14022.75",  0x000001, 0x80000, CRC(49e824bb) SHA1(c1330719b5718aa664b5788244d8cb7b7103a57c), ROM_SKIP(7) )
20192019   ROMX_LOAD( "mpr-14009.63",  0x000002, 0x80000, CRC(35b5187e) SHA1(6f0f6471c4135d07a2c852cdc50322b99176712e), ROM_SKIP(7) )
r17593r17594
20692069   ROM_LOAD16_BYTE( "epr-13990.54.verify",  0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) // Need to verify EPR #, same as epr-14092.54 above
20702070   ROM_LOAD16_BYTE( "epr-13989.53.verify",  0x000001, 0x20000, CRC(8f4f824e) SHA1(d470f23ce2dca4e75b7b714175d47338c41bb721) ) // Need to verify EPR #
20712071
2072   ROM_REGION16_BE( 0x080000, "gfx2", 0 )
2072   ROM_REGION16_BE( 0x080000, "bsprites", 0 )
20732073   ROM_LOAD16_BYTE( "mpr-13999.16", 0x000000, 0x40000, CRC(9a1dd53c) SHA1(cb01f2c64554914ea693879dfcb498181a1e7a9a) )
20742074   ROM_LOAD16_BYTE( "mpr-13997.14", 0x000001, 0x40000, CRC(1fdf1b87) SHA1(ed46af0f72081d545015b73a8d12240664f29506) )
20752075
2076   ROM_REGION64_BE( 0xc00000, "gfx1", 0)
2076   ROM_REGION64_BE( 0xc00000, "ysprites", 0)
20772077   ROMX_LOAD( "mpr-14021.67",  0x000000, 0x80000, CRC(9fa88781) SHA1(a035fd0fe1d37a589adf3a5029c20d237d5cc827), ROM_SKIP(7) )
20782078   ROMX_LOAD( "mpr-14022.75",  0x000001, 0x80000, CRC(49e824bb) SHA1(c1330719b5718aa664b5788244d8cb7b7103a57c), ROM_SKIP(7) )
20792079   ROMX_LOAD( "mpr-14009.63",  0x000002, 0x80000, CRC(35b5187e) SHA1(6f0f6471c4135d07a2c852cdc50322b99176712e), ROM_SKIP(7) )
r17593r17594
21322132   ROM_LOAD16_BYTE( "epr-13828.54",  0x000000, 0x20000, CRC(2470cf5f) SHA1(eb1a732228fe7ad9cf0747d2b53e391c5a733667) )
21332133   ROM_LOAD16_BYTE( "epr-13827.53",  0x000001, 0x20000, CRC(a9d0cf7d) SHA1(c40c73c9e9105ed6503b77b65a6423a26057d810) )
21342134
2135   ROM_REGION16_BE( 0x200000, "gfx2", 0)
2135   ROM_REGION16_BE( 0x200000, "bsprites", 0)
21362136   ROM_LOAD16_BYTE( "epr-13833.16",  0x000000, 0x80000, CRC(6148e11a) SHA1(5802208cf0415f6af39de162e9f12e7c205915f7) )
21372137   ROM_LOAD16_BYTE( "epr-13832.14",  0x000001, 0x80000, CRC(41679754) SHA1(58d46f33a4318bbc9e2a20eb5550a66ee0b2e62f) )
21382138   ROM_LOAD16_BYTE( "epr-13040.17",  0x100000, 0x80000, CRC(4aeb3a85) SHA1(5521fd2d3956839bdbe7b70a9e60cd9fb72a42f1) )
21392139   ROM_LOAD16_BYTE( "epr-13038.15",  0x100001, 0x80000, CRC(0b2edb6d) SHA1(04944d6e6f020cd6d33641110847706516630227) )
21402140
2141   ROM_REGION64_BE( 0x1000000, "gfx1", 0 )
2141   ROM_REGION64_BE( 0x1000000, "ysprites", 0 )
21422142   ROMX_LOAD( "epr-13048.67",  0x000000, 0x80000, CRC(fe1eb0dd) SHA1(5e292fc0b83505eb289e026d4be24c9038ef1418), ROM_SKIP(7) )
21432143   ROMX_LOAD( "epr-13056.75",  0x000001, 0x80000, CRC(5904f8e6) SHA1(fbb01dadc796624c360d44b7631e3f1f285abf2e), ROM_SKIP(7) )
21442144   ROMX_LOAD( "epr-13044.63",  0x000002, 0x80000, CRC(4d931f89) SHA1(ff603f4347e4728a2849d9f480893ad0af7abc5c), ROM_SKIP(7) )
r17593r17594
22002200   m_scanline_timer = timer_alloc(TID_IRQ2_GEN);
22012201
22022202   // point globals to allocated memory regions
2203   segaic16_spriteram_0 = reinterpret_cast<UINT16 *>(memshare("spriteram")->ptr());
2204   segaic16_spriteram_1 = reinterpret_cast<UINT16 *>(memshare("spriteram2")->ptr());
2205   segaic16_paletteram = reinterpret_cast<UINT16 *>(memshare("paletteram")->ptr());
22062203   segaic16_rotateram_0 = reinterpret_cast<UINT16 *>(memshare("rotateram")->ptr());
22072204
22082205   // save state
trunk/src/mame/drivers/segas16a.c
r17593r17594
233233
234234   // bit 7: screen flip
235235   segaic16_tilemap_set_flip(machine(), 0, data & 0x80);
236   segaic16_sprites_set_flip(machine(), 0, data & 0x80);
236   m_sprites->set_flip(data & 0x80);
237237
238238   // bit 6: set 8751 interrupt line
239239   if (m_mcu != NULL)
r17593r17594
10071007   AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x380000) AM_ROM
10081008   AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
10091009   AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
1010   AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_SHARE("spriteram")
1011   AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_SHARE("paletteram")
1010   AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_SHARE("sprites")
1011   AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
10121012   AM_RANGE(0xc40000, 0xc43fff) AM_MIRROR(0x39c000) AM_READWRITE(misc_io_r, misc_io_w)
10131013   AM_RANGE(0xc60000, 0xc6ffff) AM_READ(watchdog_reset16_r)
10141014   AM_RANGE(0xc70000, 0xc73fff) AM_MIRROR(0x38c000) AM_RAM AM_SHARE("nvram")
r17593r17594
19691969   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
19701970   MCFG_SCREEN_UPDATE_DRIVER(segas16a_state, screen_update)
19711971
1972   MCFG_SEGA16SP_ADD_16A("segaspr1")
1972   MCFG_SEGA_SYS16A_SPRITES_ADD("sprites")
19731973
19741974   MCFG_GFXDECODE(segas16a)
19751975   MCFG_PALETTE_LENGTH(2048*3)
r17593r17594
20752075   ROM_LOAD( "epr-11576.94", 0x10000, 0x10000, CRC(067ed682) SHA1(13e2e1f812e5a3994a0f1d35eb210881645e74cd) )
20762076   ROM_LOAD( "epr-11577.93", 0x20000, 0x10000, CRC(f67cf331) SHA1(457b9e618dfa678ae374cdeb25488af3de2e8949) )
20772077
2078   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
2078   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
20792079   ROM_LOAD16_BYTE( "epr-11501.10", 0x00001, 0x08000, CRC(09179ead) SHA1(3e6bf04e1e9ea867d087a47ff04ad0a064a8e299) )
20802080   ROM_CONTINUE(                    0x40001, 0x08000 )
20812081   ROM_LOAD16_BYTE( "epr-11505.11", 0x00000, 0x08000, CRC(b67f1ecf) SHA1(3a26cdf91e5a1a11c1a8857e713a9e00cc1bfce0) )
r17593r17594
21272127   ROM_LOAD( "epr-10282.94", 0x10000, 0x10000, CRC(b67b8910) SHA1(f3f029a3e6547114cec28e5cf8fda65ef434c353) )
21282128   ROM_LOAD( "epr-10283.93", 0x20000, 0x10000, CRC(e7dbfd2d) SHA1(91bae3fbc4a3c612dc507eecfa8de1c2e1e7afee) )
21292129
2130   ROM_REGION16_BE( 0x40000, "gfx2", 0 ) // sprites
2130   ROM_REGION16_BE( 0x40000, "sprites", 0 ) // sprites
21312131   ROM_LOAD16_BYTE( "epr-10285", 0x00001, 0x08000, CRC(98aa3d04) SHA1(1d26d17a72e55281e3444fee9c5af69ffb9e3c69) )
21322132   ROM_LOAD16_BYTE( "epr-10286", 0x10001, 0x08000, CRC(8da050cf) SHA1(c28e8968dbd9c110672581f4486f70d5f45df7f5) )
21332133   ROM_LOAD16_BYTE( "epr-10287", 0x20001, 0x08000, CRC(7989b74a) SHA1(a87acafe82b37a11d8f8b1f2ee4c9b2e1bb8161c) )
r17593r17594
21632163   ROM_LOAD( "epr-10432.94", 0x08000, 0x08000, CRC(db8cd24e) SHA1(656d98844ad9ccaa68e3f501137dddd0a27d999d) )
21642164   ROM_LOAD( "epr-10433.93", 0x10000, 0x08000, CRC(e163c8c2) SHA1(ac54c5ecedca5b1a2c550de32687ca57c4d3a411) )
21652165
2166   ROM_REGION16_BE( 0x040000, "gfx2", 0 ) // sprites
2166   ROM_REGION16_BE( 0x040000, "sprites", 0 ) // sprites
21672167   ROM_LOAD16_BYTE( "epr-10437.10", 0x00001, 0x8000, CRC(522f7618) SHA1(9a6bc857dfef1dd1b7bffa034523c1c4cd8b3f4c) )
21682168   ROM_LOAD16_BYTE( "epr-10441.11", 0x00000, 0x8000, CRC(74e3a35c) SHA1(26b980a0a3aee94ac38e0e0c7d305bb35a60d1c4) )
21692169   ROM_LOAD16_BYTE( "epr-10438.17", 0x10001, 0x8000, CRC(738a6362) SHA1(a3c5f10c263cb216d275875f6333484a1cca281b) )
r17593r17594
22002200   ROM_LOAD( "epr-10432.94", 0x08000, 0x08000, CRC(db8cd24e) SHA1(656d98844ad9ccaa68e3f501137dddd0a27d999d) )
22012201   ROM_LOAD( "epr-10433.93", 0x10000, 0x08000, CRC(e163c8c2) SHA1(ac54c5ecedca5b1a2c550de32687ca57c4d3a411) )
22022202
2203   ROM_REGION16_BE( 0x040000, "gfx2", 0 ) // sprites
2203   ROM_REGION16_BE( 0x040000, "sprites", 0 ) // sprites
22042204   ROM_LOAD16_BYTE( "epr-10437.10", 0x00001, 0x8000, CRC(522f7618) SHA1(9a6bc857dfef1dd1b7bffa034523c1c4cd8b3f4c) )
22052205   ROM_LOAD16_BYTE( "epr-10441.11", 0x00000, 0x8000, CRC(74e3a35c) SHA1(26b980a0a3aee94ac38e0e0c7d305bb35a60d1c4) )
22062206   ROM_LOAD16_BYTE( "epr-10438.17", 0x10001, 0x8000, CRC(738a6362) SHA1(a3c5f10c263cb216d275875f6333484a1cca281b) )
r17593r17594
22452245   ROM_LOAD( "epr-10740.94", 0x10000, 0x10000, CRC(47f93015) SHA1(68247a6bffd1d4d1c450148dd46214d01ce1c668) )
22462246   ROM_LOAD( "epr-10741.93", 0x20000, 0x10000, CRC(4970739c) SHA1(5bdf4222209ec46e0015bfc0f90578dd9b30bdd1) )
22472247
2248   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
2248   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
22492249   ROM_LOAD16_BYTE( "epr-10709.10", 0x00001, 0x08000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
22502250   ROM_CONTINUE(                    0x40001, 0x08000 )
22512251   ROM_LOAD16_BYTE( "epr-10713.11", 0x00000, 0x08000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
r17593r17594
22962296   ROM_LOAD( "10740", 0x10000, 0x10000, CRC(47f93015) SHA1(68247a6bffd1d4d1c450148dd46214d01ce1c668) )
22972297   ROM_LOAD( "10741", 0x20000, 0x10000, CRC(4970739c) SHA1(5bdf4222209ec46e0015bfc0f90578dd9b30bdd1) )
22982298
2299   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
2299   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
23002300   ROM_LOAD16_BYTE( "10709.b1", 0x00001, 0x08000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
23012301   ROM_CONTINUE(                0x40001, 0x08000 )
23022302   ROM_LOAD16_BYTE( "10713.b5", 0x00000, 0x08000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
r17593r17594
23472347   ROM_LOAD( "epr-10740.94", 0x10000, 0x10000, CRC(47f93015) SHA1(68247a6bffd1d4d1c450148dd46214d01ce1c668) )
23482348   ROM_LOAD( "epr-10741.93", 0x20000, 0x10000, CRC(4970739c) SHA1(5bdf4222209ec46e0015bfc0f90578dd9b30bdd1) )
23492349
2350   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
2350   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
23512351   ROM_LOAD16_BYTE( "epr-10709.10", 0x00001, 0x08000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
23522352   ROM_CONTINUE(                    0x40001, 0x08000 )
23532353   ROM_LOAD16_BYTE( "epr-10713.11", 0x00000, 0x08000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
r17593r17594
24022402   ROM_LOAD( "epr-10322.c10", 0x08000, 0x8000, CRC(b53d3217) SHA1(baebf20925e9f8ab6660f041a24721716d5b7d92) )
24032403   ROM_LOAD( "epr-10323.c11", 0x10000, 0x8000, CRC(915a3e61) SHA1(6504a8b26b7b4880971cd69ac2c8aae30dcfa18c) )
24042404
2405   ROM_REGION16_BE( 0x40000, "gfx2", 0 ) // sprites
2405   ROM_REGION16_BE( 0x40000, "sprites", 0 ) // sprites
24062406   ROM_LOAD16_BYTE( "epr-10012.c5",  0x00001, 0x08000, CRC(990824e8) SHA1(bd45f75d07cb4e17583c2d76050e5f819f4b7efe) )
24072407   ROM_LOAD16_BYTE( "epr-10016.b2",  0x00000, 0x08000, CRC(af5dc72f) SHA1(97bbb76940c702e642d8222dda71447b8f60b616) )
24082408   ROM_LOAD16_BYTE( "epr-10013.c6",  0x10001, 0x08000, CRC(9a0919c5) SHA1(e39e60c1e834b3b46bf2ef1c5952841bebe66ade) )
r17593r17594
24472447   ROM_LOAD( "epr-7708a.c10", 0x08000, 0x8000, CRC(411be9a4) SHA1(808a9c941d353f34c3491ca2cde984e73cc7a87d) )
24482448   ROM_LOAD( "epr-7709a.c11", 0x10000, 0x8000, CRC(74ceb5a8) SHA1(93ed6bb4a3c820f3a7ee5e9b2c2ce35d2bed8529) )
24492449
2450   ROM_REGION16_BE( 0x40000, "gfx2", 0 ) // sprites
2450   ROM_REGION16_BE( 0x40000, "sprites", 0 ) // sprites
24512451   ROM_LOAD16_BYTE( "epr-7715.c5",  0x00001, 0x08000, CRC(bf47e040) SHA1(5aa1b9adaa2095844c10993402a0597bb5768efb) )
24522452   ROM_LOAD16_BYTE( "epr-7719.b2",  0x00000, 0x08000, CRC(fa5c5d6c) SHA1(6cac5d3fd705d1365348d57a18bbeb1eb9e412b8) )
24532453   ROM_LOAD16_BYTE( "epr-10013.c6", 0x10001, 0x08000, CRC(9a0919c5) SHA1(e39e60c1e834b3b46bf2ef1c5952841bebe66ade) )   // 7716
r17593r17594
24942494   ROM_LOAD( "epr-7389.94",  0x08000, 0x08000, CRC(2f4f71b8) SHA1(ceb39e95cd43904b8e4f89c7227491e139fb3ca6) )
24952495   ROM_LOAD( "epr-7390.93",  0x10000, 0x08000, CRC(d90609c6) SHA1(4232f6ecb21f242c0c8d81e06b88bc742668609f) )
24962496
2497   ROM_REGION16_BE( 0x30000, "gfx2", 0 ) // sprites
2497   ROM_REGION16_BE( 0x30000, "sprites", 0 ) // sprites
24982498   ROM_LOAD16_BYTE( "epr-7392.10",  0x00001, 0x8000, CRC(5bb7c8b6) SHA1(eaa0ed63ac4f66ee285757e842bdd7b005292600) )
24992499   ROM_LOAD16_BYTE( "epr-7396.11",  0x00000, 0x8000, CRC(74ae4b57) SHA1(1f24b1faea765994b85f0e7ac8e944c8da22103f) )
25002500   ROM_LOAD16_BYTE( "epr-7393.17",  0x10001, 0x8000, CRC(14fc7e82) SHA1(ca7caca989a3577dd30ad4f66b0fcce712a454ef) )
r17593r17594
25242524   ROM_LOAD( "epr-7389.94",  0x08000, 0x08000, CRC(2f4f71b8) SHA1(ceb39e95cd43904b8e4f89c7227491e139fb3ca6) )
25252525   ROM_LOAD( "epr-7390.93",  0x10000, 0x08000, CRC(d90609c6) SHA1(4232f6ecb21f242c0c8d81e06b88bc742668609f) )
25262526
2527   ROM_REGION16_BE( 0x30000, "gfx2", 0 ) // sprites
2527   ROM_REGION16_BE( 0x30000, "sprites", 0 ) // sprites
25282528   ROM_LOAD16_BYTE( "epr-7392.10",  0x00001, 0x8000, CRC(5bb7c8b6) SHA1(eaa0ed63ac4f66ee285757e842bdd7b005292600) )
25292529   ROM_LOAD16_BYTE( "epr-7396.11",  0x00000, 0x8000, CRC(74ae4b57) SHA1(1f24b1faea765994b85f0e7ac8e944c8da22103f) )
25302530   ROM_LOAD16_BYTE( "epr-7393.17",  0x10001, 0x8000, CRC(14fc7e82) SHA1(ca7caca989a3577dd30ad4f66b0fcce712a454ef) )
r17593r17594
25542554   ROM_LOAD( "epr-7389.94",  0x08000, 0x08000, CRC(2f4f71b8) SHA1(ceb39e95cd43904b8e4f89c7227491e139fb3ca6) )
25552555   ROM_LOAD( "epr-7390.93",  0x10000, 0x08000, CRC(d90609c6) SHA1(4232f6ecb21f242c0c8d81e06b88bc742668609f) )
25562556
2557   ROM_REGION16_BE( 0x30000, "gfx2", 0 ) // sprites
2557   ROM_REGION16_BE( 0x30000, "sprites", 0 ) // sprites
25582558   ROM_LOAD16_BYTE( "epr-7392.10",  0x00001, 0x8000, CRC(5bb7c8b6) SHA1(eaa0ed63ac4f66ee285757e842bdd7b005292600) )
25592559   ROM_LOAD16_BYTE( "epr-7396.11",  0x00000, 0x8000, CRC(74ae4b57) SHA1(1f24b1faea765994b85f0e7ac8e944c8da22103f) )
25602560   ROM_LOAD16_BYTE( "epr-7393.17",  0x10001, 0x8000, CRC(14fc7e82) SHA1(ca7caca989a3577dd30ad4f66b0fcce712a454ef) )
r17593r17594
25872587   ROM_LOAD( "epr-7052.10a", 0x08000, 0x08000, CRC(2550db0e) SHA1(28f8d68f43d26f12793fe295c205cc86adc4e96a) )
25882588   ROM_LOAD( "epr-7053.11a", 0x10000, 0x08000, CRC(5bfea038) SHA1(01dc6e14cc7bba9f7930e68573c441fa2841f49a) )
25892589
2590   ROM_REGION16_BE( 0x40000, "gfx2", 0 ) // sprites
2590   ROM_REGION16_BE( 0x40000, "sprites", 0 ) // sprites
25912591   ROM_LOAD16_BYTE( "epr-7055.5a", 0x00001, 0x8000, CRC(1fb860bd) SHA1(4a4155d0352dfae9e402a2b2f1558ef17b1303b4) )
25922592   ROM_LOAD16_BYTE( "epr-7059.2b", 0x00000, 0x8000, CRC(3d14091d) SHA1(36208415b2012b6e948fefa15b0f7041748066be) )
25932593   ROM_LOAD16_BYTE( "epr-7056.6a", 0x10001, 0x8000, CRC(b35dd968) SHA1(e306b5e38acf583d7b2089302622ad25ae5564b0) )
r17593r17594
26302630   ROM_LOAD( "epr-11835.94", 0x10000, 0x10000, CRC(6a07acc0) SHA1(218071612ee6fa89b16a47a77325a962ba38926d) )
26312631   ROM_LOAD( "epr-11836.93", 0x20000, 0x10000, CRC(93c74928) SHA1(43ea7855d5d4dcc4921b3a7b814acc75c5cfde15) )
26322632
2633   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
2633   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
26342634   ROM_LOAD16_BYTE( "epr-11842.10", 0x00001, 0x08000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
26352635   ROM_CONTINUE(                    0x40001, 0x08000 )
26362636   ROM_LOAD16_BYTE( "epr-11845.11", 0x00000, 0x08000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
r17593r17594
26792679   ROM_LOAD( "epr-7462.10c", 0x08000, 0x08000, CRC(7914af28) SHA1(4bf59fe4a0b0aa5d4cc0b6f9375ffab3c96e8a2b) )
26802680   ROM_LOAD( "epr-7463.11c", 0x10000, 0x08000, CRC(827c5603) SHA1(8db3bd6eae5aeeb229e017471049ef5347974df5) )
26812681
2682   ROM_REGION16_BE( 0x40000, "gfx2", 0 ) // sprites  - the same as quartet 2
2682   ROM_REGION16_BE( 0x40000, "sprites", 0 ) // sprites  - the same as quartet 2
26832683   ROM_LOAD16_BYTE( "epr-7465.5c",  0x00001, 0x8000, CRC(8a1ab7d7) SHA1(a2f317538c70a1603b65d795223407cbaaf88524) )
26842684   ROM_LOAD16_BYTE( "epr-7469.2b",  0x00000, 0x8000, CRC(cb65ae4f) SHA1(3ee7b3b4cce113a6f394e8dfd317cdb6ffae64f7) )
26852685   ROM_LOAD16_BYTE( "epr-7466.6c",  0x10001, 0x8000, CRC(b2d3f4f3) SHA1(65e654fde10bee4cb5eee8234d0babb78fe41cfb) )
r17593r17594
27292729   ROM_LOAD( "epr-7462.10c", 0x08000, 0x08000, CRC(7914af28) SHA1(4bf59fe4a0b0aa5d4cc0b6f9375ffab3c96e8a2b) )
27302730   ROM_LOAD( "epr-7463.11c", 0x10000, 0x08000, CRC(827c5603) SHA1(8db3bd6eae5aeeb229e017471049ef5347974df5) )
27312731
2732   ROM_REGION16_BE( 0x40000, "gfx2", 0 ) // sprites  - the same as quartet 2
2732   ROM_REGION16_BE( 0x40000, "sprites", 0 ) // sprites  - the same as quartet 2
27332733   ROM_LOAD16_BYTE( "epr-7465.5c",  0x00001, 0x8000, CRC(8a1ab7d7) SHA1(a2f317538c70a1603b65d795223407cbaaf88524) )
27342734   ROM_LOAD16_BYTE( "epr-7469.2b",  0x00000, 0x8000, CRC(cb65ae4f) SHA1(3ee7b3b4cce113a6f394e8dfd317cdb6ffae64f7) )
27352735   ROM_LOAD16_BYTE( "epr-7466.6c",  0x10001, 0x8000, CRC(b2d3f4f3) SHA1(65e654fde10bee4cb5eee8234d0babb78fe41cfb) )
r17593r17594
27852785   ROM_LOAD( "epr-7699.c10", 0x08000, 0x08000, CRC(77ec901d) SHA1(b5961895473c16a8f4a111185cce48b05ab66885) )
27862786   ROM_LOAD( "epr-7700.c11", 0x10000, 0x08000, CRC(7e348cce) SHA1(82bba65280faaf3280208c85caef48ec8baeade8) )
27872787
2788   ROM_REGION16_BE( 0x040000, "gfx2", 0 ) // sprites
2788   ROM_REGION16_BE( 0x040000, "sprites", 0 ) // sprites
27892789   ROM_LOAD16_BYTE( "epr-7465.5c",  0x00001, 0x8000, CRC(8a1ab7d7) SHA1(a2f317538c70a1603b65d795223407cbaaf88524) )
27902790   ROM_LOAD16_BYTE( "epr-7469.2b",  0x00000, 0x8000, CRC(cb65ae4f) SHA1(3ee7b3b4cce113a6f394e8dfd317cdb6ffae64f7) )
27912791   ROM_LOAD16_BYTE( "epr-7466.6c",  0x10001, 0x8000, CRC(b2d3f4f3) SHA1(65e654fde10bee4cb5eee8234d0babb78fe41cfb) )
r17593r17594
28292829   ROM_LOAD( "epr-7699.c10", 0x08000, 0x08000, CRC(77ec901d) SHA1(b5961895473c16a8f4a111185cce48b05ab66885) )
28302830   ROM_LOAD( "epr-7700.c11", 0x10000, 0x08000, CRC(7e348cce) SHA1(82bba65280faaf3280208c85caef48ec8baeade8) )
28312831
2832   ROM_REGION16_BE( 0x040000, "gfx2", 0 ) // sprites
2832   ROM_REGION16_BE( 0x040000, "sprites", 0 ) // sprites
28332833   ROM_LOAD16_BYTE( "epr-7465.5c",  0x00001, 0x8000, CRC(8a1ab7d7) SHA1(a2f317538c70a1603b65d795223407cbaaf88524) )
28342834   ROM_LOAD16_BYTE( "epr-7469.2b",  0x00000, 0x8000, CRC(cb65ae4f) SHA1(3ee7b3b4cce113a6f394e8dfd317cdb6ffae64f7) )
28352835   ROM_LOAD16_BYTE( "epr-7466.6c",  0x10001, 0x8000, CRC(b2d3f4f3) SHA1(65e654fde10bee4cb5eee8234d0babb78fe41cfb) )
r17593r17594
28732873   ROM_LOAD( "epr-10757.94", 0x10000, 0x10000, CRC(497e1740) SHA1(95b166a9db46a27087e417c1b2cbb76bee2e64a7) )
28742874   ROM_LOAD( "epr-10758.93", 0x20000, 0x10000, CRC(61d61486) SHA1(d48ff87216947b78903cd98a10436babdf8b75a0) )
28752875
2876   ROM_REGION16_BE( 0x70000, "gfx2", 0 ) // sprites
2876   ROM_REGION16_BE( 0x70000, "sprites", 0 ) // sprites
28772877   ROM_LOAD16_BYTE( "epr-10760.10", 0x00001, 0x08000, CRC(30e2c50a) SHA1(1fb9e69d4cb97fdcb0f98c2a7ede246aaa4ac382) )
28782878   ROM_CONTINUE(                    0x40001, 0x08000 )
28792879   ROM_LOAD16_BYTE( "epr-10763.11", 0x00000, 0x08000, CRC(794e3e8b) SHA1(91ca1cb9aabf99adc8426feed4494a992afb8c4a) )
r17593r17594
29132913   ROM_LOAD( "epr-11265.94", 0x10000, 0x10000, CRC(87d0f321) SHA1(885b38eaff2dcaeab4eeaa20cc8a2885d520abd6) )
29142914   ROM_LOAD( "epr-11266.93", 0x20000, 0x10000, CRC(efb4af87) SHA1(0b8a905023e1bc808fd2b1c3cfa3778cde79e659) )
29152915
2916   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
2916   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
29172917   ROM_LOAD16_BYTE( "epr-11290.10", 0x00001, 0x08000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
29182918   ROM_CONTINUE(                    0x40001, 0x08000 )
29192919   ROM_LOAD16_BYTE( "epr-11294.11", 0x00000, 0x08000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
r17593r17594
29562956   ROM_LOAD( "b6", 0x10000, 0x10000, CRC(87d0f321) SHA1(885b38eaff2dcaeab4eeaa20cc8a2885d520abd6) )
29572957   ROM_LOAD( "b7", 0x20000, 0x10000, CRC(efb4af87) SHA1(0b8a905023e1bc808fd2b1c3cfa3778cde79e659) )
29582958
2959   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
2959   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
29602960   ROM_LOAD16_BYTE( "b10", 0x00001, 0x08000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
29612961   ROM_CONTINUE(           0x40001, 0x08000 )
29622962   ROM_LOAD16_BYTE( "b14", 0x00000, 0x08000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
r17593r17594
30033003   ROM_LOAD( "7.4b", 0x10000, 0x10000, CRC(87d0f321) SHA1(885b38eaff2dcaeab4eeaa20cc8a2885d520abd6) )
30043004   ROM_LOAD( "6.5b", 0x20000, 0x10000, CRC(efb4af87) SHA1(0b8a905023e1bc808fd2b1c3cfa3778cde79e659) )
30053005
3006   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
3006   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
30073007   ROM_LOAD16_BYTE( "9.6r",  0x00001, 0x08000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
30083008   ROM_CONTINUE(             0x40001, 0x08000 )
30093009   ROM_LOAD16_BYTE( "13.8r", 0x00000, 0x08000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
r17593r17594
30563056   ROM_LOAD( "epr-11265.94", 0x10000, 0x10000, CRC(87d0f321) SHA1(885b38eaff2dcaeab4eeaa20cc8a2885d520abd6) )
30573057   ROM_LOAD( "epr-11266.93", 0x20000, 0x10000, CRC(efb4af87) SHA1(0b8a905023e1bc808fd2b1c3cfa3778cde79e659) )
30583058
3059   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
3059   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
30603060   ROM_LOAD16_BYTE( "epr-11290.10", 0x00001, 0x08000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
30613061   ROM_CONTINUE(                    0x40001, 0x08000 )
30623062   ROM_LOAD16_BYTE( "epr-11294.11", 0x00000, 0x08000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
r17593r17594
31143114   ROM_LOAD( "12226-93.b11", 0x10000, 0x08000, CRC(210e6999) SHA1(5707cc613060b0070a822850b9afab8293f64dd7) )
31153115   //(epr- xxxxx - S16a location . S16b location
31163116
3117   ROM_REGION16_BE( 0x80000, "gfx2", ROMREGION_ERASE00 ) // sprites
3117   ROM_REGION16_BE( 0x80000, "sprites", ROMREGION_ERASE00 ) // sprites
31183118   ROM_LOAD16_BYTE( "12232-10.b1", 0x00001, 0x08000, CRC(0adec62b) SHA1(cd798a7994cea73bffe78feac4e692d755074b1d) )
31193119   ROM_CONTINUE(                   0x40001, 0x08000 )
31203120   ROM_LOAD16_BYTE( "12236-11.b5", 0x00000, 0x08000, CRC(286b9af8) SHA1(085251b8ce8b7fadf15b8ebd5872f0337adf142b) )
r17593r17594
31973197   ROM_LOAD( "epr-12203.rom", 0x10000, 0x10000, CRC(a6e58ec5) SHA1(5a6c43c989768270e0ab61cfaa5ef86d4607fe20) )
31983198   ROM_LOAD( "epr-12204.rom", 0x20000, 0x10000, CRC(0ae98e23) SHA1(f067b81b85f9e03a6373c7c53ff52d5395b8a985) )
31993199
3200   ROM_REGION16_BE( 0x10000, "gfx2", 0 ) // sprites
3200   ROM_REGION16_BE( 0x10000, "sprites", 0 ) // sprites
32013201   ROM_LOAD16_BYTE( "epr-12169.b1",  0x00001, 0x8000, CRC(dacc6165) SHA1(87b1a7643e3630ff73b2b117752496e1ea5da23d) )
32023202   ROM_LOAD16_BYTE( "epr-12170.b5",  0x00000, 0x8000, CRC(87354e42) SHA1(e7fd55aee59b51d82cb9b619fbb815ad6839560c) )
32033203
r17593r17594
32223222   ROM_LOAD( "epr-12203.rom", 0x10000, 0x10000, CRC(a6e58ec5) SHA1(5a6c43c989768270e0ab61cfaa5ef86d4607fe20) )
32233223   ROM_LOAD( "epr-12204.rom", 0x20000, 0x10000, CRC(0ae98e23) SHA1(f067b81b85f9e03a6373c7c53ff52d5395b8a985) )
32243224
3225   ROM_REGION16_BE( 0x10000, "gfx2", 0 ) // sprites
3225   ROM_REGION16_BE( 0x10000, "sprites", 0 ) // sprites
32263226   ROM_LOAD16_BYTE( "epr-12169.b1",  0x00001, 0x8000, CRC(dacc6165) SHA1(87b1a7643e3630ff73b2b117752496e1ea5da23d) )
32273227   ROM_LOAD16_BYTE( "epr-12170.b5",  0x00000, 0x8000, CRC(87354e42) SHA1(e7fd55aee59b51d82cb9b619fbb815ad6839560c) )
32283228
r17593r17594
32953295   ROM_LOAD( "epr-10544.94", 0x08000, 0x8000, CRC(84fb9a3a) SHA1(efde54cc9582f68e58cae05f717a4fc8f620c0fc) )
32963296   ROM_LOAD( "epr-10545.93", 0x10000, 0x8000, CRC(c8694bc0) SHA1(e48fc349ef454ded86141937f70b006e64da6b6b) )
32973297
3298   ROM_REGION16_BE( 0x40000, "gfx2", 0 ) // sprites
3298   ROM_REGION16_BE( 0x40000, "sprites", 0 ) // sprites
32993299   ROM_LOAD16_BYTE( "epr-10548.10",  0x00001, 0x8000, CRC(aa150735) SHA1(b6e6ff9229c641e196fc7a0a2cf7aa362f554676) )
33003300   ROM_LOAD16_BYTE( "epr-10552.11",  0x00000, 0x8000, CRC(6fcbb9f7) SHA1(0a0fab930477d8b79e500263bbc80d3bf73778f8) )
33013301   ROM_LOAD16_BYTE( "epr-10549.17",  0x10001, 0x8000, CRC(2f59f067) SHA1(1fb64cce2f98ddcb5ecb662e63ea636a8da08bcd) )
r17593r17594
33403340   ROM_LOAD( "epr-12087.bin", 0x10000, 0x10000, CRC(6f0396b7) SHA1(0a340f2b58e5ecfe504197a8fd2111181e868a3e) )
33413341   ROM_LOAD( "epr-12088.bin", 0x20000, 0x10000, CRC(ba8c0749) SHA1(7d996c7a1ad249c06ef7ec9c87a83710c98005d3) )
33423342
3343   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
3343   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
33443344   ROM_LOAD16_BYTE( "epr-12090.b1", 0x00001, 0x008000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
33453345   ROM_CONTINUE(                    0x40001, 0x008000 )
33463346   ROM_LOAD16_BYTE( "epr-12094.b5", 0x00000, 0x008000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
r17593r17594
33783378   ROM_LOAD( "epr-12087.94", 0x10000, 0x10000, CRC(5fb761aa) SHA1(dcf88e68732a8ec122d0603d87f6ea1f1614adef) )
33793379   ROM_LOAD( "epr-12088.83", 0x20000, 0x10000, CRC(00579c39) SHA1(12acdea75e3d040d60a9f32d05fd9e0191d38f21) )
33803380
3381   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
3381   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
33823382   ROM_LOAD16_BYTE( "epr-12090.10", 0x00001, 0x008000, CRC(c85904c1) SHA1(e5af26ce870813bd5a88b430fc3881c7fcb63aef) )
33833383   ROM_CONTINUE(                    0x40001, 0x008000 )
33843384   ROM_LOAD16_BYTE( "epr-12094.11", 0x00000, 0x008000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
r17593r17594
34153415   ROM_LOAD( "epr-12087.94", 0x10000, 0x10000, CRC(5fb761aa) SHA1(dcf88e68732a8ec122d0603d87f6ea1f1614adef) )
34163416   ROM_LOAD( "epr-12088.83", 0x20000, 0x10000, CRC(00579c39) SHA1(12acdea75e3d040d60a9f32d05fd9e0191d38f21) )
34173417
3418   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
3418   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
34193419   ROM_LOAD16_BYTE( "epr-12090.b1", 0x00001, 0x008000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
34203420   ROM_CONTINUE(                    0x40001, 0x008000 )
34213421   ROM_LOAD16_BYTE( "epr-12094.b5", 0x00000, 0x008000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
r17593r17594
34603460   m_custom_io_w = write16_delegate(FUNC(segas16a_state::standard_io_w), this);
34613461
34623462   // point globals to allocated memory regions
3463   segaic16_spriteram_0 = reinterpret_cast<UINT16 *>(memshare("spriteram")->ptr());
3464   segaic16_paletteram = reinterpret_cast<UINT16 *>(memshare("paletteram")->ptr());
34653463   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
34663464   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
34673465
trunk/src/mame/drivers/segahang.c
r17593r17594
119119
120120   // bit 7: screen flip
121121   segaic16_tilemap_set_flip(machine(), 0, data & 0x80);
122   segaic16_sprites_set_flip(machine(), 0, data & 0x80);
122   m_sprites->set_flip(data & 0x80);
123123
124124   // bit 6: shadow/highlight control
125   segaic16_sprites_set_shadow(machine(), 0, ~data & 0x40);
125   m_shadow = ~data & 0x40;
126126
127127   // bit 4: enable display
128128   segaic16_set_display_enable(machine(), data & 0x10);
r17593r17594
244244   }
245245
246246   logerror("%06X:hangon_io_r - unknown read access to address %04X\n", m_maincpu->pc(), offset * 2);
247   return segaic16_open_bus_r(&space, 0, mem_mask);
247   return open_bus_r(space, 0, mem_mask);
248248}
249249
250250
r17593r17594
305305   }
306306
307307   logerror("%06X:sharrier_io_r - unknown read access to address %04X\n", m_maincpu->pc(), offset * 2);
308   return segaic16_open_bus_r(&space, 0, mem_mask);
308   return open_bus_r(space, 0, mem_mask);
309309}
310310
311311
r17593r17594
474474   AM_RANGE(0x20c000, 0x20ffff) AM_RAM AM_SHARE("workram")
475475   AM_RANGE(0x400000, 0x403fff) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
476476   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
477   AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_SHARE("spriteram")
478   AM_RANGE(0xa00000, 0xa00fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_SHARE("paletteram")
477   AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_SHARE("sprites")
478   AM_RANGE(0xa00000, 0xa00fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
479479   AM_RANGE(0xc00000, 0xc3ffff) AM_ROM AM_REGION("subcpu", 0)
480480   AM_RANGE(0xc68000, 0xc68fff) AM_RAM AM_SHARE("roadram")
481481   AM_RANGE(0xc7c000, 0xc7ffff) AM_RAM AM_SHARE("subram")
r17593r17594
488488   AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("workram")
489489   AM_RANGE(0x100000, 0x107fff) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
490490   AM_RANGE(0x108000, 0x108fff) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
491   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_SHARE("paletteram")
491   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
492492   AM_RANGE(0x124000, 0x127fff) AM_RAM AM_SHARE("subram")
493   AM_RANGE(0x130000, 0x130fff) AM_RAM AM_SHARE("spriteram")
493   AM_RANGE(0x130000, 0x130fff) AM_RAM AM_SHARE("sprites")
494494   AM_RANGE(0x140000, 0x14ffff) AM_READWRITE(sharrier_io_r, sharrier_io_w)
495495   AM_RANGE(0xc68000, 0xc68fff) AM_RAM AM_SHARE("roadram")
496496ADDRESS_MAP_END
r17593r17594
855855
856856static MACHINE_CONFIG_DERIVED( hangon_base, shared_base )
857857   // video hardware
858   MCFG_SEGA16SP_ADD_HANGON("segaspr1")
858   MCFG_SEGA_HANGON_SPRITES_ADD("sprites")
859859MACHINE_CONFIG_END
860860
861861
r17593r17594
870870   MCFG_CPU_CLOCK(MASTER_CLOCK_10MHz)
871871
872872   // video hardware
873   MCFG_SEGA16SP_ADD_SHARRIER("segaspr1")
873   MCFG_SEGA_SHARRIER_SPRITES_ADD("sprites")
874874MACHINE_CONFIG_END
875875
876876
r17593r17594
10631063   ROM_LOAD( "epr-6842.ic23", 0x08000, 0x08000, CRC(f677b568) SHA1(636ca60bd4be9b5c2be09de8ae49db1063aa6c79) )
10641064   ROM_LOAD( "epr-6843.ic7",  0x10000, 0x08000, CRC(a257f0da) SHA1(9828f8ce4ef245ffb8dbad347f9ca74ed81aa998) )
10651065
1066   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
1066   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
10671067   ROM_LOAD16_BYTE( "epr-6819.ic27", 0x000001, 0x8000, CRC(469dad07) SHA1(6d01c0b3506e28832928ad74d518577ff5be323b) )
10681068   ROM_LOAD16_BYTE( "epr-6820.ic34", 0x000000, 0x8000, CRC(87cbc6de) SHA1(b64652e062e1b88c6f6ae8dd2ffe4533bb27ba45) )
10691069   ROM_LOAD16_BYTE( "epr-6821.ic28", 0x010001, 0x8000, CRC(15792969) SHA1(b061dbf24e8b511116446794753c8b0cc49e2149) )
r17593r17594
10891089   ROM_LOAD( "epr-6831.ic5", 0x00000, 0x8000, CRC(cfef5481) SHA1(c04b302fee58f0e59a097b2be2b61e5d03df7c91) )
10901090   ROM_LOAD( "epr-6832.ic6", 0x08000, 0x8000, CRC(4165aea5) SHA1(be05c6d295807af2f396a1ff72d5a3d2a1e6054d) )
10911091
1092   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1092   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
10931093   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
10941094ROM_END
10951095
r17593r17594
11181118   ROM_LOAD( "epr-6842.ic23", 0x08000, 0x08000, CRC(f677b568) SHA1(636ca60bd4be9b5c2be09de8ae49db1063aa6c79) )
11191119   ROM_LOAD( "epr-6843.ic7",  0x10000, 0x08000, CRC(a257f0da) SHA1(9828f8ce4ef245ffb8dbad347f9ca74ed81aa998) )
11201120
1121   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
1121   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
11221122   ROM_LOAD16_BYTE( "epr-6819.ic27", 0x000001, 0x8000, CRC(469dad07) SHA1(6d01c0b3506e28832928ad74d518577ff5be323b) )
11231123   ROM_LOAD16_BYTE( "epr-6820.ic34", 0x000000, 0x8000, CRC(87cbc6de) SHA1(b64652e062e1b88c6f6ae8dd2ffe4533bb27ba45) )
11241124   ROM_LOAD16_BYTE( "epr-6821.ic28", 0x010001, 0x8000, CRC(15792969) SHA1(b061dbf24e8b511116446794753c8b0cc49e2149) )
r17593r17594
11441144   ROM_LOAD( "epr-6831.ic5", 0x00000, 0x8000, CRC(cfef5481) SHA1(c04b302fee58f0e59a097b2be2b61e5d03df7c91) )
11451145   ROM_LOAD( "epr-6832.ic6", 0x08000, 0x8000, CRC(4165aea5) SHA1(be05c6d295807af2f396a1ff72d5a3d2a1e6054d) )
11461146
1147   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1147   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
11481148   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
11491149ROM_END
11501150
r17593r17594
11851185   ROM_LOAD( "epr-10651.23", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
11861186   ROM_LOAD( "epr-10650.7",  0x10000, 0x08000, CRC(b236a403) SHA1(af02b8122794c083a66f2ab35d2c73b84b2df0be) )
11871187
1188   ROM_REGION16_BE( 0x00e0000, "gfx2", 0 ) // sprites
1188   ROM_REGION16_BE( 0x00e0000, "sprites", 0 ) // sprites
11891189   ROM_LOAD16_BYTE( "epr-10675.22", 0x000001, 0x010000, CRC(d6ac012b) SHA1(305023b1a0a9d84cfc081ffc2ad7578b53d562f2) )
11901190   ROM_LOAD16_BYTE( "epr-10682.11", 0x000000, 0x010000, CRC(d9d83250) SHA1(f8ca3197edcdf53643a5b335c3c044ddc1310cd4) )
11911191   ROM_LOAD16_BYTE( "epr-10676.21", 0x020001, 0x010000, CRC(25ebf2c5) SHA1(abcf673ae4e280417dd9f46d18c0ec7c0e4802ae) )
r17593r17594
12111211   ROM_LOAD( "epr-10835.55", 0x00000, 0x10000, CRC(da08ca2b) SHA1(2c94c127efd66f6cf86b25e2653637818a99aed1) )
12121212   ROM_LOAD( "epr-10836.56", 0x10000, 0x10000, CRC(8b10e601) SHA1(75e9bcdd3f096be9bed672d61064b9240690deec) )
12131213
1214   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1214   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
12151215   ROM_LOAD( "epr-6844.119", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
12161216ROM_END
12171217
r17593r17594
12371237   ROM_LOAD( "epr-10651.23", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
12381238   ROM_LOAD( "epr-10650.7",  0x10000, 0x08000, CRC(b236a403) SHA1(af02b8122794c083a66f2ab35d2c73b84b2df0be) )
12391239
1240   ROM_REGION16_BE( 0x00e0000, "gfx2", 0 ) // sprites
1240   ROM_REGION16_BE( 0x00e0000, "sprites", 0 ) // sprites
12411241   ROM_LOAD16_BYTE( "epr-10675.22", 0x000001, 0x010000, CRC(d6ac012b) SHA1(305023b1a0a9d84cfc081ffc2ad7578b53d562f2) )
12421242   ROM_LOAD16_BYTE( "epr-10682.11", 0x000000, 0x010000, CRC(d9d83250) SHA1(f8ca3197edcdf53643a5b335c3c044ddc1310cd4) )
12431243   ROM_LOAD16_BYTE( "s-hangon.20",  0x020001, 0x010000, CRC(eef23b3d) SHA1(2416fa9991afbdddf25d469082e53858289550db) )
r17593r17594
12631263   ROM_LOAD( "epr-10835.55", 0x00000, 0x10000, CRC(da08ca2b) SHA1(2c94c127efd66f6cf86b25e2653637818a99aed1) )
12641264   ROM_LOAD( "epr-10836.56", 0x10000, 0x10000, CRC(8b10e601) SHA1(75e9bcdd3f096be9bed672d61064b9240690deec) )
12651265
1266   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1266   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
12671267   ROM_LOAD( "epr-6844.119", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
12681268ROM_END
12691269
r17593r17594
12991299   ROM_LOAD( "epr-7197.ic46", 0x08000, 0x08000, CRC(39d98bd1) SHA1(5aab91bdd08b0f1ea537cd43ccc2e82fd01dd031) )
13001300   ROM_LOAD( "epr-7198.ic60", 0x10000, 0x08000, CRC(3da3ea6b) SHA1(9a6ce304a14e6ef0be41d867284a63b941f960fb) )
13011301
1302   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1302   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
13031303   ROM_LOAD32_BYTE( "epr-7230.ic36", 0x00000, 0x8000, CRC(93e2d264) SHA1(ca56de13756ab77408506d88f291da1da8134435) )
13041304   ROM_LOAD32_BYTE( "epr-7222.ic28", 0x00001, 0x8000, CRC(edbf5fc3) SHA1(a93f8c431075741c181eb422b24c9303487ca16c) )
13051305   ROM_LOAD32_BYTE( "epr-7214.ic18", 0x00002, 0x8000, CRC(e8c537d8) SHA1(c9b3c0f33272c47d32e6aa349d72f7e355468e0e) )
r17593r17594
13471347   ROM_REGION( 0x10000, "mcu", 0 )   // Internal i8751 MCU code
13481348   ROM_LOAD( "315-5163a.ic32", 0x00000, 0x1000, NO_DUMP )
13491349
1350   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1350   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
13511351   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
13521352ROM_END
13531353
r17593r17594
13801380   ROM_LOAD( "epr-7197.ic46", 0x08000, 0x08000, CRC(39d98bd1) SHA1(5aab91bdd08b0f1ea537cd43ccc2e82fd01dd031) )
13811381   ROM_LOAD( "epr-7198.ic60", 0x10000, 0x08000, CRC(3da3ea6b) SHA1(9a6ce304a14e6ef0be41d867284a63b941f960fb) )
13821382
1383   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1383   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
13841384   ROM_LOAD32_BYTE( "epr-7230.ic36", 0x00000, 0x8000, CRC(93e2d264) SHA1(ca56de13756ab77408506d88f291da1da8134435) )
13851385   ROM_LOAD32_BYTE( "epr-7222.ic28", 0x00001, 0x8000, CRC(edbf5fc3) SHA1(a93f8c431075741c181eb422b24c9303487ca16c) )
13861386   ROM_LOAD32_BYTE( "epr-7214.ic18", 0x00002, 0x8000, CRC(e8c537d8) SHA1(c9b3c0f33272c47d32e6aa349d72f7e355468e0e) )
r17593r17594
14281428   ROM_REGION( 0x10000, "mcu", 0 )   // Internal i8751 MCU code
14291429   ROM_LOAD( "315-5163.ic32", 0x00000, 0x1000, NO_DUMP )
14301430
1431   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1431   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
14321432   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
14331433ROM_END
14341434
r17593r17594
14631463   ROM_LOAD( "epr-7645.ic46", 0x08000, 0x08000, CRC(4caa0095) SHA1(a24c741cdca0542e462f17ff94f132c62710e198) )
14641464   ROM_LOAD( "epr-7646.ic60", 0x10000, 0x08000, CRC(7e432683) SHA1(c8249b23fce77eb456166161c2d9aa34309efe31) )
14651465
1466   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1466   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
14671467   ROM_LOAD32_BYTE( "epr-7678.ic36", 0x00000, 0x8000, CRC(9fb5e656) SHA1(264b0ad017eb0fc7e0b542e6dd160ba964c100fd) )
14681468   ROM_LOAD32_BYTE( "epr-7670.ic28", 0x00001, 0x8000, CRC(dbbe2f6e) SHA1(310797a61f91d6866e728e0da3b30828e06d1b52) )
14691469   ROM_LOAD32_BYTE( "epr-7662.ic18", 0x00002, 0x8000, CRC(cb0c13c5) SHA1(856d1234fd8f8146e20fe6c65c0a535b7b7512cd) )
r17593r17594
15071507   ROM_LOAD( "epr-7681.rom", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) )
15081508   ROM_LOAD( "epr-7680.rom", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) )
15091509
1510   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1510   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
15111511   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
15121512
15131513   ROM_REGION( 0x2000, "maincpu:key", 0 ) // decryption key
r17593r17594
15421542   ROM_LOAD( "epr-7645.ic46", 0x08000, 0x08000, CRC(4caa0095) SHA1(a24c741cdca0542e462f17ff94f132c62710e198) )
15431543   ROM_LOAD( "epr-7646.ic60", 0x10000, 0x08000, CRC(7e432683) SHA1(c8249b23fce77eb456166161c2d9aa34309efe31) )
15441544
1545   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1545   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
15461546   ROM_LOAD32_BYTE( "epr-7678.ic36", 0x00000, 0x8000, CRC(9fb5e656) SHA1(264b0ad017eb0fc7e0b542e6dd160ba964c100fd) )
15471547   ROM_LOAD32_BYTE( "epr-7670.ic28", 0x00001, 0x8000, CRC(dbbe2f6e) SHA1(310797a61f91d6866e728e0da3b30828e06d1b52) )
15481548   ROM_LOAD32_BYTE( "epr-7662.ic18", 0x00002, 0x8000, CRC(cb0c13c5) SHA1(856d1234fd8f8146e20fe6c65c0a535b7b7512cd) )
r17593r17594
15871587   ROM_LOAD( "epr-7762.ic5", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) )
15881588   ROM_LOAD( "epr-7763.ic6", 0x08000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) )
15891589
1590   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1590   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
15911591   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
15921592
15931593   ROM_REGION( 0x2000, "maincpu:key", 0 ) // decryption key
r17593r17594
16191619   ROM_LOAD( "epr-7645.ic46", 0x08000, 0x08000, CRC(4caa0095) SHA1(a24c741cdca0542e462f17ff94f132c62710e198) )
16201620   ROM_LOAD( "epr-7646.ic60", 0x10000, 0x08000, CRC(7e432683) SHA1(c8249b23fce77eb456166161c2d9aa34309efe31) )
16211621
1622   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1622   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
16231623   ROM_LOAD32_BYTE( "epr-7678.ic36", 0x00000, 0x8000, CRC(9fb5e656) SHA1(264b0ad017eb0fc7e0b542e6dd160ba964c100fd) )
16241624   ROM_LOAD32_BYTE( "epr-7670.ic28", 0x00001, 0x8000, CRC(dbbe2f6e) SHA1(310797a61f91d6866e728e0da3b30828e06d1b52) )
16251625   ROM_LOAD32_BYTE( "epr-7662.ic18", 0x00002, 0x8000, CRC(cb0c13c5) SHA1(856d1234fd8f8146e20fe6c65c0a535b7b7512cd) )
r17593r17594
16641664   ROM_LOAD( "epr-7762.ic5", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) )
16651665   ROM_LOAD( "epr-7763.ic6", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) )
16661666
1667   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1667   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
16681668   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
16691669ROM_END
16701670
r17593r17594
16941694   ROM_LOAD( "epr-7645.ic46", 0x08000, 0x08000, CRC(4caa0095) SHA1(a24c741cdca0542e462f17ff94f132c62710e198) )
16951695   ROM_LOAD( "epr-7646.ic60", 0x10000, 0x08000, CRC(7e432683) SHA1(c8249b23fce77eb456166161c2d9aa34309efe31) )
16961696
1697   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1697   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
16981698   ROM_LOAD32_BYTE( "epr-7678.ic36", 0x00000, 0x8000, CRC(9fb5e656) SHA1(264b0ad017eb0fc7e0b542e6dd160ba964c100fd) )
16991699   ROM_LOAD32_BYTE( "epr-7670.ic28", 0x00001, 0x8000, CRC(dbbe2f6e) SHA1(310797a61f91d6866e728e0da3b30828e06d1b52) )
17001700   ROM_LOAD32_BYTE( "epr-7662.ic18", 0x00002, 0x8000, CRC(cb0c13c5) SHA1(856d1234fd8f8146e20fe6c65c0a535b7b7512cd) )
r17593r17594
17381738   ROM_LOAD( "epr-7681.rom", 0x00000, 0x8000, CRC(bc0c4d12) SHA1(3de71bde4c23e3c31984f20fc4bc7e221354c56f) )
17391739   ROM_LOAD( "epr-7680.rom", 0x10000, 0x8000, CRC(627b3c8c) SHA1(806fe7dce619ad19c09178061be4607d2beba14d) )
17401740
1741   ROM_REGION( 0x2000, "proms", 0 ) // zoom table
1741   ROM_REGION( 0x2000, "sprites:zoom", 0 ) // zoom table
17421742   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
17431743ROM_END
17441744
r17593r17594
17551755DRIVER_INIT_MEMBER(segahang_state,generic)
17561756{
17571757   // point globals to allocated memory regions
1758   segaic16_spriteram_0 = reinterpret_cast<UINT16 *>(memshare("spriteram")->ptr());
1759   segaic16_paletteram = reinterpret_cast<UINT16 *>(memshare("paletteram")->ptr());
17601758   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
17611759   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
17621760   segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
17631761
17641762   // save states
17651763   save_item(NAME(m_adc_select));
1764   save_item(NAME(m_shadow));
17661765}
17671766
17681767
trunk/src/mame/drivers/segas18.c
r17593r17594
8282         break;
8383
8484      case 6:
85         mapper.map_as_ram(0x00000, 0x02000, 0xffe000, "paletteram", write16_delegate(FUNC(segas18_state::legacy_wrapper<segaic16_paletteram_w>), this));
85         mapper.map_as_ram(0x00000, 0x01000, 0xfff000, "paletteram", write16_delegate(FUNC(segas18_state::paletteram_w), this));
8686         break;
8787
8888      case 5:
r17593r17594
9191         break;
9292
9393      case 4:
94         mapper.map_as_ram(0x00000, 0x00800, 0xfff800, "spriteram", write16_delegate());
94         mapper.map_as_ram(0x00000, 0x00800, 0xfff800, "sprites", write16_delegate());
9595         break;
9696
9797      case 3:
r17593r17594
166166   m_nvram->set_base(m_workram, m_workram.bytes());
167167
168168   // point globals to allocated memory regions
169   segaic16_spriteram_0 = reinterpret_cast<UINT16 *>(memshare("spriteram")->ptr());
170   segaic16_paletteram = reinterpret_cast<UINT16 *>(memshare("paletteram")->ptr());
171169   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
172170   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
173171
r17593r17594
295293      case 0x06/2:
296294         set_grayscale(~data & 0x40);
297295         segaic16_tilemap_set_flip(machine(), 0, data & 0x20);
298         segaic16_sprites_set_flip(machine(), 0, data & 0x20);
296         m_sprites->set_flip(data & 0x20);
299297// These are correct according to cgfm's docs, but mwalker and ddcrew both
300298// enable the lockout and never turn it off
301299//            coin_lockout_w(machine(), 1, data & 0x08);
r17593r17594
344342   if (!m_custom_io_r.isnull())
345343      return m_custom_io_r(space, offset, mem_mask);
346344   logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
347   return segaic16_open_bus_r(&space, 0, mem_mask);
345   return open_bus_r(space, 0, mem_mask);
348346}
349347
350348
r17593r17594
407405   // sprite banking
408406   else
409407   {
410      int maxbanks = memregion("gfx2")->bytes() / 0x40000;
408      int maxbanks = memregion("sprites")->bytes() / 0x40000;
411409      if (data >= maxbanks)
412410         data = 255;
413      segaic16_sprites_set_bank(machine(), 0, (offset - 8) * 2 + 0, data * 2 + 0);
414      segaic16_sprites_set_bank(machine(), 0, (offset - 8) * 2 + 1, data * 2 + 1);
411      m_sprites->set_bank((offset - 8) * 2 + 0, data * 2 + 0);
412      m_sprites->set_bank((offset - 8) * 2 + 1, data * 2 + 1);
415413   }
416414}
417415
r17593r17594
436434      case 0x3024/2:
437435         return ioport("P34START")->read();
438436   }
439   return segaic16_open_bus_r(&space, 0, mem_mask);
437   return open_bus_r(space, 0, mem_mask);
440438}
441439
442440
r17593r17594
460458         m_lghost_value <<= 1;
461459         return result;
462460   }
463   return segaic16_open_bus_r(&space, 0, mem_mask);
461   return open_bus_r(space, 0, mem_mask);
464462}
465463
466464
r17593r17594
520518      case 0x3014/2:
521519         return (ioport("TRACKY3")->read() - m_wwally_last_y[2]) & 0xff;
522520   }
523   return segaic16_open_bus_r(&space, 0, mem_mask);
521   return open_bus_r(space, 0, mem_mask);
524522}
525523
526524
r17593r17594
598596
599597   // these get overwritten by the memory mapper above, but we put them here
600598   // so they are properly allocated and tracked for saving
601   AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("spriteram")
602   AM_RANGE(0x200000, 0x201fff) AM_RAM AM_SHARE("paletteram")
599   AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("sprites")
600   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_SHARE("paletteram")
603601   AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("tileram")
604602   AM_RANGE(0x400000, 0x400fff) AM_RAM AM_SHARE("textram")
605603   AM_RANGE(0x500000, 0x503fff) AM_RAM AM_SHARE("workram")
r17593r17594
12761274   MCFG_GFXDECODE(segas18)
12771275   MCFG_PALETTE_LENGTH(2048*3+2048 + 64*3)
12781276
1279   MCFG_SEGA16SP_ADD_16B("segaspr1")
1277   MCFG_SEGA_SYS16B_SPRITES_ADD("sprites")
12801278
12811279   // sound hardware
12821280   MCFG_SPEAKER_STANDARD_MONO("mono")
r17593r17594
13351333   ROM_LOAD( "epr-13074.bin", 0x40000, 0x40000, CRC(787afab8) SHA1(a119042bb2dad54e9733bfba4eaab0ac5fc0f9e7) )
13361334   ROM_LOAD( "epr-13075.bin", 0x80000, 0x40000, CRC(4e01b477) SHA1(4178ce4a87ea427c3b0195e64acef6cddfb3485f) )
13371335
1338   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
1336   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
13391337   ROM_LOAD16_BYTE( "mpr-13082.bin", 0x000001, 0x40000, CRC(a782b704) SHA1(ba15bdfbc267b8d86f03e5310ce60846ff846de3) )
13401338   ROM_LOAD16_BYTE( "mpr-13089.bin", 0x000000, 0x40000, CRC(2a4227f0) SHA1(47284dce8f896f8e8eace9c20302842cacb479c1) )
13411339   ROM_LOAD16_BYTE( "mpr-13081.bin", 0x080001, 0x40000, CRC(eb510228) SHA1(4cd387b160ec7050e1300ebe708853742169e643) )
r17593r17594
13711369   ROM_LOAD( "epr-13074.bin", 0x40000, 0x40000, CRC(787afab8) SHA1(a119042bb2dad54e9733bfba4eaab0ac5fc0f9e7) )
13721370   ROM_LOAD( "epr-13075.bin", 0x80000, 0x40000, CRC(4e01b477) SHA1(4178ce4a87ea427c3b0195e64acef6cddfb3485f) )
13731371
1374   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
1372   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
13751373   ROM_LOAD16_BYTE( "mpr-13082.bin", 0x000001, 0x40000, CRC(a782b704) SHA1(ba15bdfbc267b8d86f03e5310ce60846ff846de3) )
13761374   ROM_LOAD16_BYTE( "mpr-13089.bin", 0x000000, 0x40000, CRC(2a4227f0) SHA1(47284dce8f896f8e8eace9c20302842cacb479c1) )
13771375   ROM_LOAD16_BYTE( "mpr-13081.bin", 0x080001, 0x40000, CRC(eb510228) SHA1(4cd387b160ec7050e1300ebe708853742169e643) )
r17593r17594
14051403   ROM_LOAD( "epr-13074.bin", 0x40000, 0x40000, CRC(787afab8) SHA1(a119042bb2dad54e9733bfba4eaab0ac5fc0f9e7) )
14061404   ROM_LOAD( "epr-13075.bin", 0x80000, 0x40000, CRC(4e01b477) SHA1(4178ce4a87ea427c3b0195e64acef6cddfb3485f) )
14071405
1408   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
1406   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
14091407   ROM_LOAD16_BYTE( "mpr-13082.bin", 0x000001, 0x40000, CRC(a782b704) SHA1(ba15bdfbc267b8d86f03e5310ce60846ff846de3) )
14101408   ROM_LOAD16_BYTE( "mpr-13089.bin", 0x000000, 0x40000, CRC(2a4227f0) SHA1(47284dce8f896f8e8eace9c20302842cacb479c1) )
14111409   ROM_LOAD16_BYTE( "mpr-13081.bin", 0x080001, 0x40000, CRC(eb510228) SHA1(4cd387b160ec7050e1300ebe708853742169e643) )
r17593r17594
14401438   ROM_LOAD( "epr-13074.bin", 0x40000, 0x40000, CRC(787afab8) SHA1(a119042bb2dad54e9733bfba4eaab0ac5fc0f9e7) )
14411439   ROM_LOAD( "epr-13075.bin", 0x80000, 0x40000, CRC(4e01b477) SHA1(4178ce4a87ea427c3b0195e64acef6cddfb3485f) )
14421440
1443   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
1441   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
14441442   ROM_LOAD16_BYTE( "mpr-13082.bin", 0x000001, 0x40000, CRC(a782b704) SHA1(ba15bdfbc267b8d86f03e5310ce60846ff846de3) )
14451443   ROM_LOAD16_BYTE( "mpr-13089.bin", 0x000000, 0x40000, CRC(2a4227f0) SHA1(47284dce8f896f8e8eace9c20302842cacb479c1) )
14461444   ROM_LOAD16_BYTE( "mpr-13081.bin", 0x080001, 0x40000, CRC(eb510228) SHA1(4cd387b160ec7050e1300ebe708853742169e643) )
r17593r17594
14781476   ROM_LOAD( "opr-12885.b2", 0x10000, 0x10000, CRC(8041b814)SHA1(29fa49ba9a73eed07865a86ea774e2c6a60aed5b) )
14791477   ROM_LOAD( "opr-12886.b3", 0x20000, 0x10000, CRC(de32285e)SHA1(8994dc128d6a23763e5fcfca1868b336d4aa0a21) )
14801478
1481   ROM_REGION( 0x20000, "gfx2", 0 ) // sprites
1479   ROM_REGION( 0x20000, "sprites", 0 ) // sprites
14821480   ROM_LOAD16_BYTE( "opr-12891.a11", 0x00001, 0x10000, CRC(90d31a8c)SHA1(1747652a5109ce65add197cf06535f2463a99fdc) )
14831481   ROM_LOAD16_BYTE( "opr-12887.b11", 0x00000, 0x10000, CRC(f0c0f49d)SHA1(7ecd591265165f3149241e2ceb5059faab88360f) )
14841482
r17593r17594
15121510   ROM_LOAD( "mpr-13774.c2",  0x080000, 0x80000, CRC(2411a824) SHA1(0e383ccc4e0830ffb395d5102e2950610c147007) )
15131511   ROM_LOAD( "mpr-13775.c3",  0x100000, 0x80000, CRC(cf527bf6) SHA1(1f9cf1f0e92709f0465dc97ebbdaa715a419f7a7) )
15141512
1515   ROM_REGION16_BE( 0x600000, "gfx2", 0 ) // sprites
1513   ROM_REGION16_BE( 0x600000, "sprites", 0 ) // sprites
15161514   ROM_LOAD16_BYTE( "mpr-13779.c10", 0x000001, 0x80000, CRC(c707f416) SHA1(e6a9d89849f7f1c303a3ca29a629f81397945a2d) )
15171515   ROM_LOAD16_BYTE( "mpr-13787.a10", 0x000000, 0x80000, CRC(f05c68c6) SHA1(b6a0535b6c734a0c89fdb6506c32ffe6ab3aa8cd) )
15181516   ROM_LOAD16_BYTE( "mpr-13780.c11", 0x200001, 0x80000, CRC(a4c341e0) SHA1(15a0b5a42b56465a7b7df98968cc2ed177ce6f59) )
r17593r17594
15461544   ROM_LOAD( "mpr-13774.c2",  0x080000, 0x80000, CRC(2411a824) SHA1(0e383ccc4e0830ffb395d5102e2950610c147007) )
15471545   ROM_LOAD( "mpr-13775.c3",  0x100000, 0x80000, CRC(cf527bf6) SHA1(1f9cf1f0e92709f0465dc97ebbdaa715a419f7a7) )
15481546
1549   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1547   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
15501548   ROM_LOAD16_BYTE( "mpr-13779.c10", 0x000001, 0x80000, CRC(c707f416) SHA1(e6a9d89849f7f1c303a3ca29a629f81397945a2d) )
15511549   ROM_LOAD16_BYTE( "mpr-13787.a10", 0x000000, 0x80000, CRC(f05c68c6) SHA1(b6a0535b6c734a0c89fdb6506c32ffe6ab3aa8cd) )
15521550   ROM_LOAD16_BYTE( "mpr-13780.c11", 0x200001, 0x80000, CRC(a4c341e0) SHA1(15a0b5a42b56465a7b7df98968cc2ed177ce6f59) )
r17593r17594
15871585   ROM_LOAD( "epr-14128.c2", 0x40000, 0x40000, CRC(edba8e10) SHA1(25a2833ead4ca363802ddc2eb97c40976502921a) )
15881586   ROM_LOAD( "epr-14129.c3", 0x80000, 0x40000, CRC(e8ecc305) SHA1(a26d0c5c7826cd315f8b2c27e5a503a2a7b535c4) )
15891587
1590   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1588   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
15911589   ROM_LOAD16_BYTE( "mpr-14134.c10", 0x000001, 0x80000, CRC(4fda6a4b) SHA1(a9e582e494ab967e8f3ccf4d5844bb8ef889928c) )
15921590   ROM_LOAD16_BYTE( "mpr-14142.a10", 0x000000, 0x80000, CRC(3cbf1f2a) SHA1(80b6b006936740087786acd538e28aca85fa6894) )
15931591   ROM_LOAD16_BYTE( "mpr-14135.c11", 0x200001, 0x80000, CRC(e9c74876) SHA1(aff9d071e77f01c6937188bf67be38fa898343e6) )
r17593r17594
16241622   ROM_LOAD( "epr-14128.c2", 0x40000, 0x40000, CRC(edba8e10) SHA1(25a2833ead4ca363802ddc2eb97c40976502921a) )
16251623   ROM_LOAD( "epr-14129.c3", 0x80000, 0x40000, CRC(e8ecc305) SHA1(a26d0c5c7826cd315f8b2c27e5a503a2a7b535c4) )
16261624
1627   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1625   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
16281626   ROM_LOAD16_BYTE( "mpr-14134.c10", 0x000001, 0x80000, CRC(4fda6a4b) SHA1(a9e582e494ab967e8f3ccf4d5844bb8ef889928c) )
16291627   ROM_LOAD16_BYTE( "mpr-14142.a10", 0x000000, 0x80000, CRC(3cbf1f2a) SHA1(80b6b006936740087786acd538e28aca85fa6894) )
16301628   ROM_LOAD16_BYTE( "mpr-14135.c11", 0x200001, 0x80000, CRC(e9c74876) SHA1(aff9d071e77f01c6937188bf67be38fa898343e6) )
r17593r17594
16611659   ROM_LOAD( "epr-14128.c2", 0x40000, 0x40000, CRC(edba8e10) SHA1(25a2833ead4ca363802ddc2eb97c40976502921a) )
16621660   ROM_LOAD( "epr-14129.c3", 0x80000, 0x40000, CRC(e8ecc305) SHA1(a26d0c5c7826cd315f8b2c27e5a503a2a7b535c4) )
16631661
1664   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1662   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
16651663   ROM_LOAD16_BYTE( "mpr-14134.c10", 0x000001, 0x80000, CRC(4fda6a4b) SHA1(a9e582e494ab967e8f3ccf4d5844bb8ef889928c) )
16661664   ROM_LOAD16_BYTE( "mpr-14142.a10", 0x000000, 0x80000, CRC(3cbf1f2a) SHA1(80b6b006936740087786acd538e28aca85fa6894) )
16671665   ROM_LOAD16_BYTE( "mpr-14135.c11", 0x200001, 0x80000, CRC(e9c74876) SHA1(aff9d071e77f01c6937188bf67be38fa898343e6) )
r17593r17594
16991697   ROM_LOAD( "epr-14128.c2", 0x40000, 0x40000, CRC(edba8e10) SHA1(25a2833ead4ca363802ddc2eb97c40976502921a) )
17001698   ROM_LOAD( "epr-14129.c3", 0x80000, 0x40000, CRC(e8ecc305) SHA1(a26d0c5c7826cd315f8b2c27e5a503a2a7b535c4) )
17011699
1702   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1700   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
17031701   ROM_LOAD16_BYTE( "mpr-14134.c10", 0x000001, 0x80000, CRC(4fda6a4b) SHA1(a9e582e494ab967e8f3ccf4d5844bb8ef889928c) )
17041702   ROM_LOAD16_BYTE( "mpr-14142.a10", 0x000000, 0x80000, CRC(3cbf1f2a) SHA1(80b6b006936740087786acd538e28aca85fa6894) )
17051703   ROM_LOAD16_BYTE( "mpr-14135.c11", 0x200001, 0x80000, CRC(e9c74876) SHA1(aff9d071e77f01c6937188bf67be38fa898343e6) )
r17593r17594
17371735   ROM_LOAD( "epr-14128.c2", 0x40000, 0x40000, CRC(edba8e10) SHA1(25a2833ead4ca363802ddc2eb97c40976502921a) )
17381736   ROM_LOAD( "epr-14129.c3", 0x80000, 0x40000, CRC(e8ecc305) SHA1(a26d0c5c7826cd315f8b2c27e5a503a2a7b535c4) )
17391737
1740   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1738   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
17411739   ROM_LOAD16_BYTE( "mpr-14134.c10", 0x000001, 0x80000, CRC(4fda6a4b) SHA1(a9e582e494ab967e8f3ccf4d5844bb8ef889928c) )
17421740   ROM_LOAD16_BYTE( "mpr-14142.a10", 0x000000, 0x80000, CRC(3cbf1f2a) SHA1(80b6b006936740087786acd538e28aca85fa6894) )
17431741   ROM_LOAD16_BYTE( "mpr-14135.c11", 0x200001, 0x80000, CRC(e9c74876) SHA1(aff9d071e77f01c6937188bf67be38fa898343e6) )
r17593r17594
17801778   ROM_LOAD( "mpr-14782.c2", 0x100000, 0x100000, CRC(ccc98d05) SHA1(b89594bbfff45e3b4fe433aeeaf8b4073c2cabb5) )
17811779   ROM_LOAD( "mpr-14783.c3", 0x200000, 0x100000, CRC(ef202bec) SHA1(b557092f8a3e1c9889d34588344c6dd2c6f06731) )
17821780
1783   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1781   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
17841782   ROM_LOAD16_BYTE( "mpr-14788.c10", 0x000001, 0x100000, CRC(b5b05536) SHA1(f8fde7ebca38c0a6f6a864c17771aa155e6fc30d) )
17851783   ROM_LOAD16_BYTE( "mpr-14796.a10", 0x000000, 0x100000, CRC(c033220a) SHA1(279d3ef62b41d2c6a18ce1217a549402a874638b) )
17861784   ROM_LOAD16_BYTE( "mpr-14789.c11", 0x200001, 0x100000, CRC(0f9bcb97) SHA1(c15ab3ece596c54e1c4d8e8a755473609334e8ba) )
r17593r17594
18201818   ROM_LOAD( "mpr-14782.c2", 0x100000, 0x100000, CRC(ccc98d05) SHA1(b89594bbfff45e3b4fe433aeeaf8b4073c2cabb5) )
18211819   ROM_LOAD( "mpr-14783.c3", 0x200000, 0x100000, CRC(ef202bec) SHA1(b557092f8a3e1c9889d34588344c6dd2c6f06731) )
18221820
1823   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1821   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
18241822   ROM_LOAD16_BYTE( "mpr-14788.c10", 0x000001, 0x100000, CRC(b5b05536) SHA1(f8fde7ebca38c0a6f6a864c17771aa155e6fc30d) )
18251823   ROM_LOAD16_BYTE( "mpr-14796.a10", 0x000000, 0x100000, CRC(c033220a) SHA1(279d3ef62b41d2c6a18ce1217a549402a874638b) )
18261824   ROM_LOAD16_BYTE( "mpr-14789.c11", 0x200001, 0x100000, CRC(0f9bcb97) SHA1(c15ab3ece596c54e1c4d8e8a755473609334e8ba) )
r17593r17594
18601858   ROM_LOAD( "epr-13415.c2", 0x40000, 0x40000, CRC(bbb62c48) SHA1(7a4c5bd11b73a92deece72b55627f48ac167acd6) )
18611859   ROM_LOAD( "epr-13416.c3", 0x80000, 0x40000, CRC(1d11dbae) SHA1(331aa49c6b38d32ec33184dbd0851888463ddbc7) )
18621860
1863   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1861   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
18641862   ROM_LOAD16_BYTE( "epr-13603.a10", 0x000000, 0x80000, CRC(5350a94e) SHA1(47e99803cab4b508feb51069c940d6c824d6961d) )
18651863   ROM_LOAD16_BYTE( "epr-13604.c10", 0x000001, 0x80000, CRC(4009c8e5) SHA1(97f513d312f4c90f8bffdf797afa3749779989a5) )
18661864   ROM_LOAD16_BYTE( "mpr-13421.a11", 0x200000, 0x80000, CRC(2fc75890) SHA1(9f97f07dba3b978df8eb357894168ad74f151d30) )
r17593r17594
19001898   ROM_LOAD( "epr-13415.c2", 0x40000, 0x40000, CRC(bbb62c48) SHA1(7a4c5bd11b73a92deece72b55627f48ac167acd6) )
19011899   ROM_LOAD( "epr-13416.c3", 0x80000, 0x40000, CRC(1d11dbae) SHA1(331aa49c6b38d32ec33184dbd0851888463ddbc7) )
19021900
1903   ROM_REGION16_BE( 0x800000, "gfx2", 0 ) // sprites
1901   ROM_REGION16_BE( 0x800000, "sprites", 0 ) // sprites
19041902   ROM_LOAD16_BYTE( "epr-13603.a10", 0x000000, 0x80000, CRC(5350a94e) SHA1(47e99803cab4b508feb51069c940d6c824d6961d) )
19051903   ROM_LOAD16_BYTE( "epr-13604.c10", 0x000001, 0x80000, CRC(4009c8e5) SHA1(97f513d312f4c90f8bffdf797afa3749779989a5) )
19061904   ROM_LOAD16_BYTE( "mpr-13421.a11", 0x200000, 0x80000, CRC(2fc75890) SHA1(9f97f07dba3b978df8eb357894168ad74f151d30) )
r17593r17594
19391937   ROM_LOAD( "mpr-13217.b2", 0x40000, 0x40000, CRC(7d1ac3ec) SHA1(8495357304f1df135bba77ef3b96e79a883b8ff0) )
19401938   ROM_LOAD( "mpr-13218.b3", 0x80000, 0x40000, CRC(56d3393c) SHA1(50a2d065060692c9ecaa56046a781cb21d93e554) )
19411939
1942   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
1940   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
19431941   ROM_LOAD16_BYTE( "mpr-13224.b11", 0x000001, 0x40000, CRC(c59f107b) SHA1(10fa60fca6e34eda277c483bb1c0e81bb88c8a47) )
19441942   ROM_LOAD16_BYTE( "mpr-13231.a11", 0x000000, 0x40000, CRC(a5e96346) SHA1(a854f4dd5dc16975373255110fdb8ab3d121b1af) )
19451943   ROM_LOAD16_BYTE( "mpr-13223.b10", 0x080001, 0x40000, CRC(364f60ff) SHA1(9ac887ec0b2e32b504b7c6a5f3bb1ce3fe41a15a) )
r17593r17594
19771975   ROM_LOAD( "mpr-13217.b2", 0x40000, 0x40000, CRC(7d1ac3ec) SHA1(8495357304f1df135bba77ef3b96e79a883b8ff0) )
19781976   ROM_LOAD( "mpr-13218.b3", 0x80000, 0x40000, CRC(56d3393c) SHA1(50a2d065060692c9ecaa56046a781cb21d93e554) )
19791977
1980   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
1978   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
19811979   ROM_LOAD16_BYTE( "mpr-13224.b11", 0x000001, 0x40000, CRC(c59f107b) SHA1(10fa60fca6e34eda277c483bb1c0e81bb88c8a47) )
19821980   ROM_LOAD16_BYTE( "mpr-13231.a11", 0x000000, 0x40000, CRC(a5e96346) SHA1(a854f4dd5dc16975373255110fdb8ab3d121b1af) )
19831981   ROM_LOAD16_BYTE( "mpr-13223.b10", 0x080001, 0x40000, CRC(364f60ff) SHA1(9ac887ec0b2e32b504b7c6a5f3bb1ce3fe41a15a) )
r17593r17594
20152013   ROM_LOAD( "mpr-13217.b2", 0x40000, 0x40000, CRC(7d1ac3ec) SHA1(8495357304f1df135bba77ef3b96e79a883b8ff0) )
20162014   ROM_LOAD( "mpr-13218.b3", 0x80000, 0x40000, CRC(56d3393c) SHA1(50a2d065060692c9ecaa56046a781cb21d93e554) )
20172015
2018   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
2016   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
20192017   ROM_LOAD16_BYTE( "mpr-13224.b11", 0x000001, 0x40000, CRC(c59f107b) SHA1(10fa60fca6e34eda277c483bb1c0e81bb88c8a47) )
20202018   ROM_LOAD16_BYTE( "mpr-13231.a11", 0x000000, 0x40000, CRC(a5e96346) SHA1(a854f4dd5dc16975373255110fdb8ab3d121b1af) )
20212019   ROM_LOAD16_BYTE( "mpr-13223.b10", 0x080001, 0x40000, CRC(364f60ff) SHA1(9ac887ec0b2e32b504b7c6a5f3bb1ce3fe41a15a) )
r17593r17594
20572055   ROM_LOAD( "epr-13098.b2", 0x40000, 0x40000, CRC(89fc9a9b) SHA1(d98691eb5fef8aca4ad5e416d0a3797d6ca9b012) )
20582056   ROM_LOAD( "epr-13099.b3", 0x80000, 0x40000, CRC(790e0ac6) SHA1(a4999b7015ef27d6cbe4f53bc0d7fe05ee40d178) )
20592057
2060   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
2058   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
20612059   ROM_LOAD16_BYTE( "epr-13173.b11",  0x000001, 0x40000, CRC(40a0ddfa) SHA1(f3917361f627865d2f1a22791904da056ce8a93a) )
20622060   ROM_LOAD16_BYTE( "epr-13176.a11",  0x000000, 0x40000, CRC(1184fbd2) SHA1(685ee2d7c4a0134af13ccf5d15f2e56a6b905195) )
20632061
r17593r17594
20832081   ROM_LOAD( "mpr-12713.b2",  0x40000, 0x40000, CRC(852d2b1c) SHA1(8e5bc83d45e48b621ea3016207f2028fe41701e6) )
20842082   ROM_LOAD( "mpr-12714.b3",  0x80000, 0x40000, CRC(448226ce) SHA1(3060e4a43311069e2691d659c1e0c1a48edfeedb) )
20852083
2086   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
2084   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
20872085   ROM_LOAD16_BYTE( "mpr-12719.b11", 0x000001, 0x40000, CRC(d6888534) SHA1(2201f1921a68cf39e5a94b487c90e48d032d630f) )
20882086   ROM_LOAD16_BYTE( "mpr-12726.a11", 0x000000, 0x40000, CRC(ff344945) SHA1(2743778c42f53321f9691d60bbf94ea8baf1382f) )
20892087   ROM_LOAD16_BYTE( "mpr-12718.b10", 0x080001, 0x40000, CRC(ba2efc0c) SHA1(459a1a280f870c94aefb70127ed007cb090ed203) )
r17593r17594
21132111   ROM_LOAD( "mpr-12713.b2",  0x40000, 0x40000, CRC(852d2b1c) SHA1(8e5bc83d45e48b621ea3016207f2028fe41701e6) )
21142112   ROM_LOAD( "mpr-12714.b3",  0x80000, 0x40000, CRC(448226ce) SHA1(3060e4a43311069e2691d659c1e0c1a48edfeedb) )
21152113
2116   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
2114   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
21172115   ROM_LOAD16_BYTE( "mpr-12719.b11", 0x000001, 0x40000, CRC(d6888534) SHA1(2201f1921a68cf39e5a94b487c90e48d032d630f) )
21182116   ROM_LOAD16_BYTE( "mpr-12726.a11", 0x000000, 0x40000, CRC(ff344945) SHA1(2743778c42f53321f9691d60bbf94ea8baf1382f) )
21192117   ROM_LOAD16_BYTE( "mpr-12718.b10", 0x080001, 0x40000, CRC(ba2efc0c) SHA1(459a1a280f870c94aefb70127ed007cb090ed203) )
r17593r17594
21472145   ROM_LOAD( "mpr-12713.b2",  0x40000, 0x40000, CRC(852d2b1c) SHA1(8e5bc83d45e48b621ea3016207f2028fe41701e6) )
21482146   ROM_LOAD( "mpr-12714.b3",  0x80000, 0x40000, CRC(448226ce) SHA1(3060e4a43311069e2691d659c1e0c1a48edfeedb) )
21492147
2150   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
2148   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
21512149   ROM_LOAD16_BYTE( "mpr-12719.b11", 0x000001, 0x40000, CRC(d6888534) SHA1(2201f1921a68cf39e5a94b487c90e48d032d630f) )
21522150   ROM_LOAD16_BYTE( "mpr-12726.a11", 0x000000, 0x40000, CRC(ff344945) SHA1(2743778c42f53321f9691d60bbf94ea8baf1382f) )
21532151   ROM_LOAD16_BYTE( "mpr-12718.b10", 0x080001, 0x40000, CRC(ba2efc0c) SHA1(459a1a280f870c94aefb70127ed007cb090ed203) )
r17593r17594
21832181   ROM_LOAD( "mpr-14720.c2", 0x040000, 0x40000, CRC(f96d19f4) SHA1(e350b551db8d01062397cd9a0c952a7b5dbf3fe6) )
21842182   ROM_LOAD( "mpr-14721.c3", 0x080000, 0x40000, CRC(c4ced91d) SHA1(4c8a070959ca10e2dddf407ddbba212415d78727) )
21852183
2186   ROM_REGION16_BE( 0x500000, "gfx2", 0 ) // sprites
2184   ROM_REGION16_BE( 0x500000, "sprites", 0 ) // sprites
21872185   ROM_LOAD16_BYTE( "mpr-14726.c10", 0x000001, 0x100000, CRC(7213d1d3) SHA1(b70346a1dd3aa112bc696a7f4dd9ca908c3e5afa) )
21882186   ROM_LOAD16_BYTE( "mpr-14732.a10", 0x000000, 0x100000, CRC(04ced549) SHA1(59fd6510f0e14613d830ac6527f12ccc0b9351a5) )
21892187   ROM_LOAD16_BYTE( "mpr-14727.c11", 0x200001, 0x100000, CRC(3b74e0f0) SHA1(40432dbbbf75dae1e5e32b7cc2c4884f5e9e3bf5) )
r17593r17594
22162214   ROM_LOAD( "mpr-14720.c2", 0x040000, 0x40000, CRC(f96d19f4) SHA1(e350b551db8d01062397cd9a0c952a7b5dbf3fe6) )
22172215   ROM_LOAD( "mpr-14721.c3", 0x080000, 0x40000, CRC(c4ced91d) SHA1(4c8a070959ca10e2dddf407ddbba212415d78727) )
22182216
2219   ROM_REGION16_BE( 0x500000, "gfx2", 0 ) // sprites
2217   ROM_REGION16_BE( 0x500000, "sprites", 0 ) // sprites
22202218   ROM_LOAD16_BYTE( "mpr-14726.c10", 0x000001, 0x100000, CRC(7213d1d3) SHA1(b70346a1dd3aa112bc696a7f4dd9ca908c3e5afa) )
22212219   ROM_LOAD16_BYTE( "mpr-14732.a10", 0x000000, 0x100000, CRC(04ced549) SHA1(59fd6510f0e14613d830ac6527f12ccc0b9351a5) )
22222220   ROM_LOAD16_BYTE( "mpr-14727.c11", 0x200001, 0x100000, CRC(3b74e0f0) SHA1(40432dbbbf75dae1e5e32b7cc2c4884f5e9e3bf5) )
trunk/src/mame/drivers/segaorun.c
r17593r17594
428428         break;
429429
430430      case 3:
431         mapper.map_as_ram(0x00000, 0x01000, 0xfff000, "spriteram", write16_delegate());
431         mapper.map_as_ram(0x00000, 0x01000, 0xfff000, "sprites", write16_delegate());
432432         break;
433433
434434      case 2:
435         mapper.map_as_ram(0x00000, 0x02000, 0xffe000, "paletteram", write16_delegate(FUNC(segaorun_state::legacy_wrapper<segaic16_paletteram_w>), this));
435         mapper.map_as_ram(0x00000, 0x02000, 0xffe000, "paletteram", write16_delegate(FUNC(segaorun_state::paletteram_w), this));
436436         break;
437437
438438      case 1:
r17593r17594
484484   if (!m_custom_io_r.isnull())
485485      return m_custom_io_r(space, offset, mem_mask);
486486   logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
487   return segaic16_open_bus_r(&space, 0, mem_mask);
487   return open_bus_r(space, 0, mem_mask);
488488}
489489
490490
r17593r17594
657657   }
658658
659659   logerror("%06X:outrun_custom_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
660   return segaic16_open_bus_r(&space, 0, mem_mask);
660   return open_bus_r(space, 0, mem_mask);
661661}
662662
663663
r17593r17594
695695         return;
696696
697697      case 0x70/2:
698         segaic16_sprites_draw_0_w(&space, offset, data, mem_mask);
698         m_sprites->draw_write(space, offset, data, mem_mask);
699699         return;
700700   }
701701   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(&space.device()), offset * 2, data, mem_mask);
r17593r17594
728728      }
729729   }
730730   logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
731   return segaic16_open_bus_r(&space,0,mem_mask);
731   return open_bus_r(space,0,mem_mask);
732732}
733733
734734
r17593r17594
814814
815815   // these get overwritten by the memory mapper above, but we put them here
816816   // so they are properly allocated and tracked for saving
817   AM_RANGE(0x100000, 0x100fff) AM_RAM AM_SHARE("spriteram")
817   AM_RANGE(0x100000, 0x100fff) AM_RAM AM_SHARE("sprites")
818818   AM_RANGE(0x200000, 0x201fff) AM_RAM AM_SHARE("paletteram")
819819   AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("tileram")
820820   AM_RANGE(0x400000, 0x400fff) AM_RAM AM_SHARE("textram")
r17593r17594
11111111//**************************************************************************
11121112
11131113static MACHINE_CONFIG_DERIVED( outrundx, outrun_base )
1114   MCFG_SEGA16SP_ADD_OUTRUN("segaspr1")
1114   MCFG_SEGA_OUTRUN_SPRITES_ADD("sprites")
11151115MACHINE_CONFIG_END
11161116
11171117static MACHINE_CONFIG_DERIVED( outrun, outrun_base )
11181118   MCFG_NVRAM_ADD_0FILL("nvram")
11191119
1120   MCFG_SEGA16SP_ADD_OUTRUN("segaspr1")
1120   MCFG_SEGA_OUTRUN_SPRITES_ADD("sprites")
11211121MACHINE_CONFIG_END
11221122
11231123static MACHINE_CONFIG_DERIVED( outrun_fd1094, outrun )
r17593r17594
11331133   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_25MHz/4, 400, 0, 321, 262, 0, 224)
11341134   MCFG_SCREEN_UPDATE_DRIVER(segaorun_state, screen_update_shangon)
11351135
1136   MCFG_SEGA16SP_ADD_16B("segaspr1")
1136   MCFG_SEGA_SYS16B_SPRITES_ADD("sprites")
11371137MACHINE_CONFIG_END
11381138
11391139static MACHINE_CONFIG_DERIVED( shangon_fd1089b, shangon )
r17593r17594
11841184   ROM_LOAD( "opr-10266.101", 0x20000, 0x08000, CRC(9f6f1a74) SHA1(09164e858ebeedcff4d389524ddf89e7c216dcae) )
11851185   ROM_LOAD( "opr-10230.104", 0x28000, 0x08000, CRC(686f5e50) SHA1(03697b892f911177968aa40de6c5f464eb0258e7) )
11861186
1187   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1187   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
11881188   // VIDEO BD 837-6064-02 uses mask roms four times the size of those used on VIDEO BD 837-6064-01, same data
11891189   ROM_LOAD32_BYTE( "mpr-10371.9",  0x00000, 0x20000, CRC(7cc86208) SHA1(21320f945f7c8e990c97c9b1232a0f4b6bd00f8f) )
11901190   ROM_LOAD32_BYTE( "mpr-10373.10", 0x00001, 0x20000, CRC(b0d26ac9) SHA1(3a9ce8547cd43b7b04abddf9a9ab5634e0bbfaba) )
r17593r17594
12451245   ROM_LOAD( "opr-10266.101", 0x20000, 0x08000, CRC(9f6f1a74) SHA1(09164e858ebeedcff4d389524ddf89e7c216dcae) )
12461246   ROM_LOAD( "opr-10230.104", 0x28000, 0x08000, CRC(686f5e50) SHA1(03697b892f911177968aa40de6c5f464eb0258e7) )
12471247
1248   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1248   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
12491249   // VIDEO BD 837-6064-02 uses mask roms four times the size of those used on VIDEO BD 837-6064-01, same data
12501250   ROM_LOAD32_BYTE( "mpr-10371.9",  0x00000, 0x20000, CRC(7cc86208) SHA1(21320f945f7c8e990c97c9b1232a0f4b6bd00f8f) )
12511251   ROM_LOAD32_BYTE( "mpr-10373.10", 0x00001, 0x20000, CRC(b0d26ac9) SHA1(3a9ce8547cd43b7b04abddf9a9ab5634e0bbfaba) )
r17593r17594
13061306   ROM_LOAD( "opr-10266.101", 0x20000, 0x08000, CRC(9f6f1a74) SHA1(09164e858ebeedcff4d389524ddf89e7c216dcae) )
13071307   ROM_LOAD( "opr-10230.104", 0x28000, 0x08000, CRC(686f5e50) SHA1(03697b892f911177968aa40de6c5f464eb0258e7) )
13081308
1309   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1309   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
13101310   // VIDEO BD 837-6064-01 uses eproms a fourth of the size of those used on VIDEO BD 837-6064-02, same data
13111311   ROM_LOAD32_BYTE( "epr-10194.26", 0x00000, 0x08000, CRC(f0eda3bd) SHA1(173e10a10372d42da81e6eb48c3e23a117638c0c) )
13121312   ROM_LOAD32_BYTE( "epr-10203.38", 0x00001, 0x08000, CRC(8445a622) SHA1(1187dee7db09a42446fc75872d49936310141eb8) )
r17593r17594
14001400   ROM_LOAD( "opr-10266.101", 0x20000, 0x08000, CRC(9f6f1a74) SHA1(09164e858ebeedcff4d389524ddf89e7c216dcae) )
14011401   ROM_LOAD( "opr-10230.104", 0x28000, 0x08000, CRC(686f5e50) SHA1(03697b892f911177968aa40de6c5f464eb0258e7) )
14021402
1403   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1403   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
14041404   // VIDEO BD 837-6064-01 uses eproms a fourth of the size of those used on VIDEO BD 837-6064-02, same data
14051405   ROM_LOAD32_BYTE( "epr-10194.26", 0x00000, 0x08000, CRC(f0eda3bd) SHA1(173e10a10372d42da81e6eb48c3e23a117638c0c) )
14061406   ROM_LOAD32_BYTE( "epr-10203.38", 0x00001, 0x08000, CRC(8445a622) SHA1(1187dee7db09a42446fc75872d49936310141eb8) )
r17593r17594
15071507   ROM_LOAD( "a-17.bin",   0x10000, 0x10000, CRC(899c781d) SHA1(4f759c316a57a1e42838375525290425d25b53e1) )
15081508   ROM_LOAD( "a-16.bin",   0x20000, 0x10000, CRC(98dd4d15) SHA1(914ebcb330455ab35968b4add4d94be123a185a5) )
15091509
1510   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1510   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
15111511   ROM_LOAD32_BYTE( "a-18.bin",   0x00000, 0x10000, CRC(77377e00) SHA1(4f376b05692f33d529f4c058dac989136c808ca1) )
15121512   ROM_LOAD32_BYTE( "a-20.bin",   0x00001, 0x10000, CRC(69ecc975) SHA1(3560e9a31fc71e263a6ff61224b8db2b17836075) )
15131513   ROM_LOAD32_BYTE( "a-22.bin",   0x00002, 0x10000, CRC(b6a8d0e2) SHA1(6184700dbe2c8c9c91f220e246501b7a865e4a05) )
r17593r17594
15691569   ROM_LOAD( "epr-10651.55", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
15701570   ROM_LOAD( "epr-10650.56", 0x10000, 0x08000, CRC(b236a403) SHA1(af02b8122794c083a66f2ab35d2c73b84b2df0be) )
15711571
1572   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
1572   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
15731573   // Super Hang-On Video board 837-6279-01 (mask rom type), same data but mask roms twice the size as "EPR" counterparts
15741574   ROM_LOAD16_BYTE( "mpr-10794.8",    0x000001, 0x020000, CRC(7c958e63) SHA1(ef79614e94280607a6cdf6e13db051accfd2add0) )
15751575   ROM_LOAD16_BYTE( "mpr-10798.16", 0x000000, 0x020000, CRC(7d58f807) SHA1(783c9929d27a0270b3f7d5eb799cee6b2e5b7ae5) )
r17593r17594
16281628   ROM_LOAD( "epr-10651.55", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
16291629   ROM_LOAD( "epr-10650.56", 0x10000, 0x08000, CRC(b236a403) SHA1(af02b8122794c083a66f2ab35d2c73b84b2df0be) )
16301630
1631   ROM_REGION16_BE( 0x0e0000, "gfx2", 0 ) // sprites
1631   ROM_REGION16_BE( 0x0e0000, "sprites", 0 ) // sprites
16321632   ROM_LOAD16_BYTE( "epr-10675.8",    0x000001, 0x010000, CRC(d6ac012b) SHA1(305023b1a0a9d84cfc081ffc2ad7578b53d562f2) )
16331633   ROM_LOAD16_BYTE( "epr-10682.16", 0x000000, 0x010000, CRC(d9d83250) SHA1(f8ca3197edcdf53643a5b335c3c044ddc1310cd4) )
16341634   ROM_LOAD16_BYTE( "epr-10676.7",  0x020001, 0x010000, CRC(25ebf2c5) SHA1(abcf673ae4e280417dd9f46d18c0ec7c0e4802ae) )
r17593r17594
16891689   ROM_LOAD( "epr-10651.55", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
16901690   ROM_LOAD( "epr-10650.56", 0x10000, 0x08000, CRC(b236a403) SHA1(af02b8122794c083a66f2ab35d2c73b84b2df0be) )
16911691
1692   ROM_REGION16_BE( 0x0e0000, "gfx2", 0 ) // sprites
1692   ROM_REGION16_BE( 0x0e0000, "sprites", 0 ) // sprites
16931693   ROM_LOAD16_BYTE( "epr-10675.8",    0x000001, 0x010000, CRC(d6ac012b) SHA1(305023b1a0a9d84cfc081ffc2ad7578b53d562f2) )
16941694   ROM_LOAD16_BYTE( "epr-10682.16", 0x000000, 0x010000, CRC(d9d83250) SHA1(f8ca3197edcdf53643a5b335c3c044ddc1310cd4) )
16951695   ROM_LOAD16_BYTE( "epr-10676.7",  0x020001, 0x010000, CRC(25ebf2c5) SHA1(abcf673ae4e280417dd9f46d18c0ec7c0e4802ae) )
r17593r17594
17501750   ROM_LOAD( "epr-10651.55", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
17511751   ROM_LOAD( "epr-10650.56", 0x10000, 0x08000, CRC(b236a403) SHA1(af02b8122794c083a66f2ab35d2c73b84b2df0be) )
17521752
1753   ROM_REGION16_BE( 0x0e0000, "gfx2", 0 ) // sprites
1753   ROM_REGION16_BE( 0x0e0000, "sprites", 0 ) // sprites
17541754   ROM_LOAD16_BYTE( "epr-10675.8",    0x000001, 0x010000, CRC(d6ac012b) SHA1(305023b1a0a9d84cfc081ffc2ad7578b53d562f2) )
17551755   ROM_LOAD16_BYTE( "epr-10682.16", 0x000000, 0x010000, CRC(d9d83250) SHA1(f8ca3197edcdf53643a5b335c3c044ddc1310cd4) )
17561756   ROM_LOAD16_BYTE( "epr-10676.7",  0x020001, 0x010000, CRC(25ebf2c5) SHA1(abcf673ae4e280417dd9f46d18c0ec7c0e4802ae) )
r17593r17594
18111811   ROM_LOAD( "epr-10651.55", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
18121812   ROM_LOAD( "epr-10650.56", 0x10000, 0x08000, CRC(b236a403) SHA1(af02b8122794c083a66f2ab35d2c73b84b2df0be) )
18131813
1814   ROM_REGION16_BE( 0x0e0000, "gfx2", 0 ) // sprites
1814   ROM_REGION16_BE( 0x0e0000, "sprites", 0 ) // sprites
18151815   ROM_LOAD16_BYTE( "epr-10675.8",    0x000001, 0x010000, CRC(d6ac012b) SHA1(305023b1a0a9d84cfc081ffc2ad7578b53d562f2) )
18161816   ROM_LOAD16_BYTE( "epr-10682.16", 0x000000, 0x010000, CRC(d9d83250) SHA1(f8ca3197edcdf53643a5b335c3c044ddc1310cd4) )
18171817   ROM_LOAD16_BYTE( "epr-13945.7",  0x020001, 0x010000, CRC(fbb1eef9) SHA1(2798df2f25706e0d3be01d945274f478d7e5a2ae) )
r17593r17594
18781878   ROM_LOAD( "opr-12324.103", 0x10000, 0x10000, CRC(24607a55) SHA1(69033f2281cd42e88233c23d809b73607fe54853) )
18791879   ROM_LOAD( "opr-12325.104", 0x20000, 0x10000, CRC(1405137a) SHA1(367db88d36852e35c5e839f692be5ea8c8e072d2) )
18801880
1881   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1881   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
18821882   // Video BD 837-6906-2, Mask Roms twice the size as EPR/OPR counterparts
18831883   ROM_LOAD32_BYTE( "mpr-12336.9",   0x00000, 0x20000, CRC(dda465c7) SHA1(83acc12a387b004986f084f25964c15a9f88a41a) )
18841884   ROM_LOAD32_BYTE( "mpr-12337.10",  0x00001, 0x20000, CRC(828233d1) SHA1(d73a200af4245d590e1fd3ac436723f99cc50452) )
r17593r17594
19381938   ROM_LOAD( "opr-12324.103", 0x10000, 0x10000, CRC(24607a55) SHA1(69033f2281cd42e88233c23d809b73607fe54853) )
19391939   ROM_LOAD( "opr-12325.104", 0x20000, 0x10000, CRC(1405137a) SHA1(367db88d36852e35c5e839f692be5ea8c8e072d2) )
19401940
1941   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
1941   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
19421942   ROM_LOAD32_BYTE( "opr-12307.9",  0x00000, 0x10000, CRC(437dcf09) SHA1(0022ee4d1c3698f77271e570cef98a8a1e5c5d6a) )
19431943   ROM_LOAD32_BYTE( "opr-12308.10", 0x00001, 0x10000, CRC(0de70cc2) SHA1(c03f8f8cda72daf64af2878bf254840ac6dd17eb) )
19441944   ROM_LOAD32_BYTE( "opr-12309.11", 0x00002, 0x10000, CRC(deb8c242) SHA1(c05d8ced4eafae52c4795fb1471cd66f5903d1aa) )
r17593r17594
20052005   ROM_LOAD( "opr-12324.103", 0x10000, 0x10000, CRC(24607a55) SHA1(69033f2281cd42e88233c23d809b73607fe54853) )
20062006   ROM_LOAD( "opr-12325.104", 0x20000, 0x10000, CRC(1405137a) SHA1(367db88d36852e35c5e839f692be5ea8c8e072d2) )
20072007
2008   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
2008   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
20092009   ROM_LOAD32_BYTE( "opr-12307.9",  0x00000, 0x10000, CRC(437dcf09) SHA1(0022ee4d1c3698f77271e570cef98a8a1e5c5d6a) )
20102010   ROM_LOAD32_BYTE( "opr-12308.10", 0x00001, 0x10000, CRC(0de70cc2) SHA1(c03f8f8cda72daf64af2878bf254840ac6dd17eb) )
20112011   ROM_LOAD32_BYTE( "opr-12309.11", 0x00002, 0x10000, CRC(deb8c242) SHA1(c05d8ced4eafae52c4795fb1471cd66f5903d1aa) )
r17593r17594
20662066   ROM_LOAD( "opr-12324.103", 0x10000, 0x10000, CRC(24607a55) SHA1(69033f2281cd42e88233c23d809b73607fe54853) )
20672067   ROM_LOAD( "opr-12325.104", 0x20000, 0x10000, CRC(1405137a) SHA1(367db88d36852e35c5e839f692be5ea8c8e072d2) )
20682068
2069   ROM_REGION32_LE( 0x100000, "gfx2", 0 ) // sprites
2069   ROM_REGION32_LE( 0x100000, "sprites", 0 ) // sprites
20702070   ROM_LOAD32_BYTE( "opr-12307.9",  0x00000, 0x10000, CRC(437dcf09) SHA1(0022ee4d1c3698f77271e570cef98a8a1e5c5d6a) )
20712071   ROM_LOAD32_BYTE( "opr-12308.10", 0x00001, 0x10000, CRC(0de70cc2) SHA1(c03f8f8cda72daf64af2878bf254840ac6dd17eb) )
20722072   ROM_LOAD32_BYTE( "opr-12309.11", 0x00002, 0x10000, CRC(deb8c242) SHA1(c05d8ced4eafae52c4795fb1471cd66f5903d1aa) )
r17593r17594
21202120      m_nvram->set_base(m_workram, m_workram.bytes());
21212121
21222122   // point globals to allocated memory regions
2123   segaic16_spriteram_0 = reinterpret_cast<UINT16 *>(memshare("spriteram")->ptr());
2124   segaic16_paletteram = reinterpret_cast<UINT16 *>(memshare("paletteram")->ptr());
21252123   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
21262124   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
21272125   segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
trunk/src/mame/drivers/system16.c
r17593r17594
125125   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_SHARE("textram")
126126   AM_RANGE(0x411000, 0x411fff) AM_RAM AM_SHARE("bg0_tileram")
127127   AM_RANGE(0x412000, 0x412fff) AM_RAM AM_SHARE("bg1_tileram")
128   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
129   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w)  AM_BASE_LEGACY(&segaic16_paletteram)
128   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
129   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
130130   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_nmi_w)
131131   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
132132   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
r17593r17594
181181   AM_RANGE(0x40a000, 0x40afff) AM_RAM AM_SHARE("bg1_tileram")
182182   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_SHARE("textram")
183183
184   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
185   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
184   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
185   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
186186   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
187187   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
188188   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
r17593r17594
259259   AM_RANGE(0x409000, 0x40afff) AM_RAM AM_SHARE("bg0_tileram")
260260   AM_RANGE(0x40a000, 0x40bfff) AM_RAM AM_SHARE("bg1_tileram")
261261   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_SHARE("textram")
262   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
263   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w)  AM_BASE_LEGACY(&segaic16_paletteram)
262   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
263   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
264264   AM_RANGE(0xc41000, 0xc41001) AM_READ(passht4b_service_r)
265265   AM_RANGE(0xc41002, 0xc41003) AM_READ(passht4b_io1_r)
266266   AM_RANGE(0xc41004, 0xc41005) AM_READ(passht4b_io2_r)
r17593r17594
308308   AM_RANGE(0x409000, 0x40afff) AM_RAM AM_SHARE("bg0_tileram")
309309   AM_RANGE(0x40a000, 0x40bfff) AM_RAM AM_SHARE("bg1_tileram")
310310   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_SHARE("textram")
311   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
312   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
311   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
312   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
313313   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
314314   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
315315   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
r17593r17594
510510   AM_RANGE(0x000000, 0x0bffff) AM_ROM
511511   AM_RANGE(0x100000, 0x100003) AM_WRITENOP // tilebank control?
512512   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
513   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
513   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_SHARE("sprites")
514514   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
515515   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
516   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
516   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
517517   AM_RANGE(0x900000, 0x900001) AM_WRITE(sys16_coinctrl_w)
518518   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
519519   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
r17593r17594
606606   AM_RANGE(0x118018, 0x118019) AM_WRITE(s16bl_bgscrollx_w)
607607   AM_RANGE(0x118020, 0x118021) AM_WRITE(s16bl_fgpage_w)
608608   AM_RANGE(0x118028, 0x118029) AM_WRITE(s16bl_bgpage_w)
609   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w)  AM_BASE_LEGACY(&segaic16_paletteram)
610   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
609   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
610   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_SHARE("sprites")
611611   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
612612   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
613613   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
r17593r17594
624624static ADDRESS_MAP_START( bayrouteb1_map, AS_PROGRAM, 16, segas1x_bootleg_state )
625625   AM_RANGE(0x000000, 0x0bffff) AM_ROM
626626   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
627   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
627   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_SHARE("sprites")
628628   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
629629   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
630630   AM_RANGE(0x718000, 0x718001) AM_WRITE(s16bl_fgscrolly_w)
r17593r17594
633633   AM_RANGE(0x718018, 0x718019) AM_WRITE(s16bl_bgscrollx_w)
634634   AM_RANGE(0x718020, 0x718021) AM_WRITE(s16bl_fgpage_w)
635635   AM_RANGE(0x718028, 0x718029) AM_WRITE(s16bl_bgpage_w)
636   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
636   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
637637   AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_WRITE(sys16_coinctrl_w)
638638   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
639639   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
r17593r17594
693693static ADDRESS_MAP_START( bayrouteb2_map, AS_PROGRAM, 16, segas1x_bootleg_state )
694694   AM_RANGE(0x000000, 0x0bffff) AM_ROM
695695   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
696   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
696   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_SHARE("sprites")
697697   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
698698   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
699699   AM_RANGE(0x718000, 0x718001) AM_WRITE(s16bl_fgscrolly_w)
r17593r17594
705705   AM_RANGE(0x718024, 0x718025) AM_WRITE(datsu_page2_w)
706706   AM_RANGE(0x718026, 0x718027) AM_WRITE(datsu_page3_w)
707707
708   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
708   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
709709   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1")
710710   AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2")
711711   AM_RANGE(0x900006, 0x900007) AM_WRITE(sound_command_w)
r17593r17594
719719   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
720720   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
721721   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
722   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
723   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w)  AM_BASE_LEGACY(&segaic16_paletteram)
722   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
723   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
724724   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
725725   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_w)
726726   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
r17593r17594
811811   AM_RANGE(0x000000, 0x0bffff) AM_ROM
812812   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
813813   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
814   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
815   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
814   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
815   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_SHARE("sprites")
816816   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("DSW2") AM_WRITENOP
817817   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
818818   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
r17593r17594
840840
841841   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
842842   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
843   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
843   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
844844
845845   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
846846   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
r17593r17594
849849   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
850850   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
851851
852   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
852   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
853853   AM_RANGE(0x843000, 0x843001) AM_WRITENOP
854854
855855   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(s16bl_fgscrolly_w)
r17593r17594
889889   AM_RANGE(0x418020, 0x418021) AM_WRITE(s16bl_bgpage_w)
890890   AM_RANGE(0x418028, 0x418029) AM_WRITE(s16bl_fgpage_w)
891891
892   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
893   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w)  AM_BASE_LEGACY(&segaic16_paletteram)
892   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
893   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
894894   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
895895   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
896896   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
r17593r17594
916916   AM_RANGE(0x418020, 0x418021) AM_WRITE(s16bl_fgpage_w)
917917   AM_RANGE(0x418028, 0x418029) AM_WRITE(s16bl_bgpage_w)
918918
919   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
920   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w)  AM_BASE_LEGACY(&segaic16_paletteram)
919   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
920   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
921921   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
922922   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
923923   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
r17593r17594
956956   AM_RANGE(0x418020, 0x418021) AM_WRITE(s16bl_bgpage_w)
957957   AM_RANGE(0x418028, 0x418029) AM_WRITE(s16bl_fgpage_w)
958958
959   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
960   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w)  AM_BASE_LEGACY(&segaic16_paletteram)
959   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
960   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
961961
962962   AM_RANGE(0xC41000, 0xC41001) AM_READ(beautyb_unkx_r )
963963   AM_RANGE(0xC41002, 0xC41003) AM_READ(beautyb_unkx_r )
r17593r17594
973973static ADDRESS_MAP_START( tturfbl_map, AS_PROGRAM, 16, segas1x_bootleg_state )
974974   AM_RANGE(0x000000, 0x03ffff) AM_ROM
975975   AM_RANGE(0x200000, 0x203fff) AM_RAM // work ram
976   AM_RANGE(0x300000, 0x300fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
976   AM_RANGE(0x300000, 0x300fff) AM_RAM AM_SHARE("sprites")
977977   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
978978   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
979   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
979   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
980980   AM_RANGE(0x600000, 0x600001) AM_WRITE(sys16_coinctrl_w)
981981   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
982982   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
r17593r17594
11171117   AM_RANGE(0x000000, 0x07ffff) AM_ROM
11181118   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
11191119   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
1120   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
1121   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
1120   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
1121   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
11221122   AM_RANGE(0xc00000, 0xc0ffff) AM_NOP
11231123   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
11241124   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
r17593r17594
12581258   AM_RANGE(0x000000, 0x07ffff) AM_ROM
12591259   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
12601260   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
1261   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
1262   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
1261   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
1262   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
12631263
12641264   /* bootleg video regs */
12651265   /*AM_RANGE(0xc00000, 0xc00001) AM_NOP
r17593r17594
13001300   AM_RANGE(0x000000, 0x07ffff) AM_ROM
13011301   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
13021302   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
1303   AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
1304   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
1303   AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
1304   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_SHARE("sprites")
13051305   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("COINAGE")
13061306   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW1")
13071307   AM_RANGE(0xa00006, 0xa00007) AM_WRITE(sound_command_nmi_w)
r17593r17594
20972097MACHINE_CONFIG_END
20982098
20992099
2100static const sega16sp_interface shinobld_sega16sp_intf =
2101{
2102   0,      // which spriteram
2103   1024,  // colorbase
2104   0x800, // ramsize
2105   117,     // xoffs
2106   segaic16_sprites_16a_bootleg_shinobld_draw, // draw function
2107   0, // use buffer
2108};
2109
21102100static MACHINE_CONFIG_DERIVED( shinobib, system16 )
21112101
21122102   /* basic machine hardware */
21132103   MCFG_CPU_MODIFY("maincpu")
21142104   MCFG_CPU_PROGRAM_MAP(shinobib_map)
21152105
2116   MCFG_SEGA16SP_ADD("segaspr1", shinobld_sega16sp_intf)
2106   MCFG_BOOTLEG_SYS16A_SPRITES_ADD("sprites")
2107   MCFG_BOOTLEG_SYS16A_SPRITES_XORIGIN(189-117)
21172108
21182109   MCFG_VIDEO_START( s16a_bootleg_shinobi )
21192110   MCFG_SCREEN_MODIFY("screen")
21202111   MCFG_SCREEN_UPDATE_STATIC( s16a_bootleg )
21212112MACHINE_CONFIG_END
21222113
2123static const sega16sp_interface passshtb_sega16sp_intf =
2124{
2125   0,      // which spriteram
2126   1024,  // colorbase
2127   0x800, // ramsize
2128   117,     // xoffs
2129   segaic16_sprites_16a_bootleg_passhtb_draw, // draw function
2130   0, // use buffer
2131};
2132
21332114static MACHINE_CONFIG_DERIVED( passshtb, system16_7759 )
21342115
21352116   /* basic machine hardware */
21362117   MCFG_CPU_MODIFY("maincpu")
21372118   MCFG_CPU_PROGRAM_MAP(passshtb_map)
21382119
2139   MCFG_SEGA16SP_ADD("segaspr1", passshtb_sega16sp_intf)
2120   MCFG_BOOTLEG_SYS16A_SPRITES_ADD("sprites")
2121   MCFG_BOOTLEG_SYS16A_SPRITES_XORIGIN(189-117)
2122   MCFG_BOOTLEG_SYS16A_SPRITES_REMAP(1,0,3,2,5,4,7,6)
21402123
21412124   MCFG_VIDEO_START( s16a_bootleg_passsht )
21422125   MCFG_SCREEN_MODIFY("screen")
r17593r17594
21512134   MCFG_CPU_PROGRAM_MAP(passht4b_map)
21522135
21532136   // wrong
2154   MCFG_SEGA16SP_ADD("segaspr1", passshtb_sega16sp_intf)
2137   MCFG_BOOTLEG_SYS16A_SPRITES_ADD("sprites")
2138   MCFG_BOOTLEG_SYS16A_SPRITES_XORIGIN(189-117)
2139   MCFG_BOOTLEG_SYS16A_SPRITES_REMAP(1,0,3,2,5,4,7,6)
21552140
21562141   MCFG_VIDEO_START( s16a_bootleg_passsht )
21572142   MCFG_SCREEN_MODIFY("screen")
21582143   MCFG_SCREEN_UPDATE_STATIC( s16a_bootleg_passht4b )
21592144MACHINE_CONFIG_END
21602145
2161static const sega16sp_interface wb3bbl_sega16sp_intf =
2162{
2163   0,      // which spriteram
2164   1024,  // colorbase
2165   0x800, // ramsize
2166   117,     // xoffs
2167   segaic16_sprites_16a_bootleg_wb3bl_draw, // draw function
2168   0, // use buffer
2169};
2170
21712146static MACHINE_CONFIG_DERIVED( wb3bb, system16 )
21722147
21732148   /* basic machine hardware */
21742149   MCFG_CPU_MODIFY("maincpu")
21752150   MCFG_CPU_PROGRAM_MAP(wb3bbl_map)
21762151
2177   MCFG_SEGA16SP_ADD("segaspr1", wb3bbl_sega16sp_intf)
2152   MCFG_BOOTLEG_SYS16A_SPRITES_ADD("sprites")
2153   MCFG_BOOTLEG_SYS16A_SPRITES_XORIGIN(189-117)
2154   MCFG_BOOTLEG_SYS16A_SPRITES_REMAP(4,0,5,1,6,2,7,3)
2155   MCFG_BOOTLEG_SYS16A_SPRITES_YORIGIN(0)
21782156
21792157   MCFG_VIDEO_START( s16a_bootleg_wb3bl )
21802158   MCFG_SCREEN_MODIFY("screen")
r17593r17594
21822160MACHINE_CONFIG_END
21832161
21842162
2185static const sega16sp_interface s16bbl_x121_sega16sp_intf =
2186{
2187   0,      // which spriteram
2188   1024,  // colorbase
2189   0x800, // ramsize
2190   121,     // xoffs
2191   segaic16_sprites_16b_draw, // draw function
2192   0, // use buffer
2193};
2194
21952163static MACHINE_CONFIG_START( goldnaxeb1, segas1x_bootleg_state )
21962164
21972165   /* basic machine hardware */
r17593r17594
22112179   MCFG_GFXDECODE(sys16)
22122180   MCFG_PALETTE_LENGTH(2048*SHADOW_COLORS_MULTIPLIER)
22132181
2214   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x121_sega16sp_intf)
2182   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2183   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-121)
22152184
22162185   MCFG_PALETTE_INIT( all_black )
22172186   MCFG_VIDEO_START(system16)
r17593r17594
22332202   MCFG_CPU_PROGRAM_MAP(bayrouteb1_map)
22342203MACHINE_CONFIG_END
22352204
2236static const sega16sp_interface s16bbl_x107_sega16sp_intf =
2237{
2238   0,      // which spriteram
2239   1024,  // colorbase
2240   0x800, // ramsize
2241   107,     // xoffs
2242   segaic16_sprites_16b_draw, // draw function
2243   0, // use buffer
2244};
2245
22462205static MACHINE_CONFIG_DERIVED( bayrouteb2, goldnaxeb1 )
22472206
22482207   /* basic machine hardware */
r17593r17594
22512210
22522211   MCFG_FRAGMENT_ADD(system16_datsu_sound)
22532212
2254   MCFG_DEVICE_REMOVE("segaspr1")
2255   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x107_sega16sp_intf)
2213   MCFG_DEVICE_MODIFY("sprites")
2214   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-107)
2215
22562216MACHINE_CONFIG_END
22572217
22582218static MACHINE_CONFIG_DERIVED( tturfbl, system16_7759 )
r17593r17594
22712231   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
22722232   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
22732233
2274   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x107_sega16sp_intf)
2234   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2235   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-107)
22752236MACHINE_CONFIG_END
22762237
2277static const sega16sp_interface s16bbl_x112_sega16sp_intf =
2278{
2279   0,      // which spriteram
2280   1024,  // colorbase
2281   0x800, // ramsize
2282   112,     // xoffs
2283   segaic16_sprites_16b_draw, // draw function
2284   0, // use buffer
2285};
2286
22872238static MACHINE_CONFIG_DERIVED( dduxbl, system16 )
22882239
22892240   /* basic machine hardware */
22902241   MCFG_CPU_MODIFY("maincpu")
22912242   MCFG_CPU_PROGRAM_MAP(dduxbl_map)
22922243
2293   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x112_sega16sp_intf)
2244   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2245   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-112)
22942246MACHINE_CONFIG_END
22952247
2296static const sega16sp_interface s16bbl_x124_sega16sp_intf =
2297{
2298   0,      // which spriteram
2299   1024,  // colorbase
2300   0x800, // ramsize
2301   124,     // xoffs
2302   segaic16_sprites_16b_draw, // draw function
2303   0, // use buffer
2304};
2305
23062248static MACHINE_CONFIG_DERIVED( eswatbl, system16_7759 )
23072249
23082250   /* basic machine hardware */
23092251   MCFG_CPU_MODIFY("maincpu")
23102252   MCFG_CPU_PROGRAM_MAP(eswatbl_map)
23112253
2312   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x124_sega16sp_intf)
2254   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2255   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-124)
23132256MACHINE_CONFIG_END
23142257
23152258static MACHINE_CONFIG_DERIVED( fpointbl, system16 )
r17593r17594
23212264   MCFG_CPU_MODIFY("soundcpu")
23222265   MCFG_CPU_PROGRAM_MAP(fpointbl_sound_map)
23232266
2324   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x107_sega16sp_intf)
2267   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2268   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-107)
23252269MACHINE_CONFIG_END
23262270
23272271static MACHINE_CONFIG_DERIVED( tetrisbl, system16 )
r17593r17594
23302274   MCFG_CPU_MODIFY("maincpu")
23312275   MCFG_CPU_PROGRAM_MAP(tetrisbl_map)
23322276
2333   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x112_sega16sp_intf)
2277   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2278   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-112)
23342279MACHINE_CONFIG_END
23352280
23362281
r17593r17594
23402285   MCFG_CPU_MODIFY("maincpu")
23412286   MCFG_CPU_PROGRAM_MAP(beautyb_map)
23422287
2343   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x112_sega16sp_intf)
2288   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2289   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-112)
23442290MACHINE_CONFIG_END
23452291
23462292
r17593r17594
23682314
23692315   MCFG_VIDEO_START(system18old)
23702316
2371   MCFG_SEGA16SP_ADD("segaspr1", s16bbl_x107_sega16sp_intf)
2317   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2318   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-107)
23722319
23732320   /* sound hardware */
23742321   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r17593r17594
24482395   ROM_LOAD( "10.bin", 0x10000, 0x10000, CRC(7cc40b6c) SHA1(ffad7eef7ab2ff9a2e49a8d71b5785a61fa3c675) )
24492396   ROM_LOAD( "11.bin", 0x20000, 0x10000, CRC(0f6c7b1c) SHA1(defc76592c285b3396e89a3cff7a73f3a948117f) )
24502397
2451   ROM_REGION16_BE( 0x080000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2398   ROM_REGION16_BE( 0x080000, "sprites", ROMREGION_ERASEFF ) /* sprites */
24522399   ROM_LOAD16_BYTE( "5.bin", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
24532400   ROM_LOAD16_BYTE( "3.bin", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
24542401   ROM_LOAD16_BYTE( "8.bin", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
r17593r17594
24732420   ROM_LOAD( "opr11855.b10", 0x10000, 0x10000, CRC(b78762b4) SHA1(d594ef846bd7fed8da91a89906b39c1a2867a1fe) )
24742421   ROM_LOAD( "opr11856.b11", 0x20000, 0x10000, CRC(ea49f666) SHA1(36ccd32cdcbb7fcc300628bb59c220ec3c324d82) )
24752422
2476   ROM_REGION16_BE( 0x80000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2423   ROM_REGION16_BE( 0x80000, "sprites", ROMREGION_ERASEFF ) /* sprites */
24772424   ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
24782425   ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
24792426   ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
r17593r17594
24992446   ROM_LOAD( "pas4p.12", 0x10000, 0x10000, CRC(bebb9211) SHA1(4f56048f6f70b63f74a4c0d64456213d36ce5b26) )
25002447   ROM_LOAD( "pas4p.13", 0x20000, 0x10000, CRC(e37506c3) SHA1(e6fbf15d58f321a3d052fefbe5a1901e4a1734ae) )
25012448
2502   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) /* sprites */
2449   ROM_REGION16_BE( 0x60000, "sprites", 0 ) /* sprites */
25032450   ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
25042451   ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
25052452   ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
r17593r17594
25242471   ROM_LOAD( "wb3_15", 0x10000, 0x10000, CRC(96ff9d52) SHA1(791a9da4860e0d42fba98f80a3c6725ad8c73e33) )
25252472   ROM_LOAD( "wb3_16", 0x20000, 0x10000, CRC(afaf0d31) SHA1(d4309329a0a543250788146b63b27ff058c02fc3) )
25262473
2527   ROM_REGION16_BE( 0x100000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2474   ROM_REGION16_BE( 0x100000, "sprites", ROMREGION_ERASEFF ) /* sprites */
25282475   ROM_LOAD16_BYTE( "epr12090.b1", 0x00001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
25292476   ROM_LOAD16_BYTE( "epr12094.b5", 0x00000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
25302477   ROM_LOAD16_BYTE( "epr12091.b2", 0x20001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
r17593r17594
25702517   ROM_LOAD( "bs14.bin", 0x10000, 0x10000, CRC(6bc4d0a8) SHA1(90b9a61c7a140291d72554857ce26d54ebf03fc2) )
25712518   ROM_LOAD( "bs12.bin", 0x20000, 0x10000, CRC(c1f967a6) SHA1(8eb6bbd9e17dc531830bc798b8485c8ea999e56e) )
25722519
2573   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) /* sprites */
2520   ROM_REGION16_BE( 0x80000, "sprites", 0 ) /* sprites */
25742521   ROM_LOAD16_BYTE( "br_obj0o.1b", 0x00001, 0x10000, CRC(098a5e82) SHA1(c5922f418773bc3629071e584457839d67a370e9) )
25752522   ROM_LOAD16_BYTE( "br_obj0e.5b", 0x00000, 0x10000, CRC(85238af9) SHA1(39989a8d9b60c6d55272b5e2c213341a563dd993) )
25762523   ROM_LOAD16_BYTE( "br_obj1o.2b", 0x20001, 0x10000, CRC(cc641da1) SHA1(28f8a6502702cb9e2cc7f3e98f6c5d201f462fa3) )
r17593r17594
26062553   ROM_LOAD( "bs12.bin", 0x20000, 0x10000, CRC(c1f967a6) SHA1(8eb6bbd9e17dc531830bc798b8485c8ea999e56e) )
26072554
26082555   #if 0 // these look bad
2609   ROM_REGION16_BE( 0x080000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2556   ROM_REGION16_BE( 0x080000, "sprites", ROMREGION_ERASEFF ) /* sprites */
26102557   ROM_LOAD16_BYTE( "br_11",       0x00001, 0x10000, CRC(65232905) SHA1(cb195a0ce8bff9d1d3e31678060b3aaccfefcd2d) )
26112558   ROM_LOAD16_BYTE( "br_obj0e.5b", 0x00000, 0x10000, CRC(85238af9) SHA1(39989a8d9b60c6d55272b5e2c213341a563dd993) )
26122559   ROM_LOAD16_BYTE( "br_obj1o.2b", 0x20001, 0x10000, CRC(cc641da1) SHA1(28f8a6502702cb9e2cc7f3e98f6c5d201f462fa3) )
r17593r17594
26182565   #endif
26192566
26202567   // use the roms from the first bootleg set
2621   ROM_REGION16_BE( 0x080000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2568   ROM_REGION16_BE( 0x080000, "sprites", ROMREGION_ERASEFF ) /* sprites */
26222569   ROM_LOAD16_BYTE( "br_obj0o.1b", 0x00001, 0x10000, CRC(098a5e82) SHA1(c5922f418773bc3629071e584457839d67a370e9) )
26232570   ROM_LOAD16_BYTE( "br_obj0e.5b", 0x00000, 0x10000, CRC(85238af9) SHA1(39989a8d9b60c6d55272b5e2c213341a563dd993) )
26242571   ROM_LOAD16_BYTE( "br_obj1o.2b", 0x20001, 0x10000, CRC(cc641da1) SHA1(28f8a6502702cb9e2cc7f3e98f6c5d201f462fa3) )
r17593r17594
27182665   ROM_LOAD( "28.12",  0x40000, 0x10000, CRC(22f0667e) SHA1(2d11b2ce105a3db9c914942cace85aff17deded9) )
27192666   ROM_LOAD( "27.11", 0x50000, 0x10000, CRC(afb1a7e4) SHA1(726fded9db72a881128b43f449d2baf450131f63) )
27202667
2721   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) /* sprites */
2668   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) /* sprites */
27222669   ROM_LOAD16_BYTE( "33.17",      0x000001, 0x10000, CRC(28ba70c8) SHA1(a6f33e1404928b6d1006943494646d6cfbd60a4b) )
27232670   ROM_LOAD16_BYTE( "34.18",      0x020001, 0x10000, CRC(2ed96a26) SHA1(edcf915243e6f92d31cdfc53965438f6b6bff51d) )
27242671   ROM_LOAD16_BYTE( "37.bin",      0x100001, 0x10000, CRC(84dccc5b) SHA1(10263d98d663f1170c3203066f391075a1d64ff5) )
r17593r17594
28042751   ROM_LOAD( "ic2.37",  0x40000, 0x10000, CRC(22f0667e) SHA1(2d11b2ce105a3db9c914942cace85aff17deded9) )
28052752   ROM_LOAD( "ic16.40", 0x50000, 0x10000, CRC(afb1a7e4) SHA1(726fded9db72a881128b43f449d2baf450131f63) )
28062753
2807   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) /* sprites */
2754   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) /* sprites */
28082755   ROM_LOAD16_BYTE( "ic73.34",       0x000001, 0x10000, CRC(28ba70c8) SHA1(a6f33e1404928b6d1006943494646d6cfbd60a4b) ) // mpr12378.b1  [1/4]      IDENTICAL
28092756   ROM_LOAD16_BYTE( "ic74.33",       0x020001, 0x10000, CRC(2ed96a26) SHA1(edcf915243e6f92d31cdfc53965438f6b6bff51d) ) // mpr12378.b1  [2/4]      IDENTICAL
28102757   ROM_LOAD16_BYTE( "ic79.28",       0x100001, 0x10000, CRC(84dccc5b) SHA1(10263d98d663f1170c3203066f391075a1d64ff5) ) // mpr12378.b1  [3/4]      IDENTICAL
r17593r17594
28472794   ROM_LOAD( "tt16cf44.rom", 0x10000, 0x10000, CRC(4c467735) SHA1(8338b6605cbe2e076da0b3e3a47630409a79f002) )
28482795   ROM_LOAD( "tt17d59e.rom", 0x20000, 0x10000, CRC(60c0f2fe) SHA1(3fea4ed757d47628f59ff940e40cb86b3b5b443b) )
28492796
2850   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) /* sprites */
2797   ROM_REGION16_BE( 0x80000, "sprites", 0 ) /* sprites */
28512798   ROM_LOAD16_BYTE( "12279.1b", 0x00001, 0x10000, CRC(7a169fb1) SHA1(1ec6da0d2cfcf727e61f61c847fd8b975b64f944) )
28522799   ROM_LOAD16_BYTE( "12283.5b", 0x00000, 0x10000, CRC(ae0fa085) SHA1(ae9af92d4dd0c8a0f064d24e647522b588fbd7f7) )
28532800   ROM_LOAD16_BYTE( "12278.2b", 0x20001, 0x10000, CRC(961d06b7) SHA1(b1a9dea63785bfa2c0e7b931387b91dfcd27d79b) )
r17593r17594
28752822   ROM_LOAD( "dduxb15.bin", 0x10000, 0x10000, CRC(ce0d2b30) SHA1(e60521c46f1650c9bdc76f2ceb91a6d61aaa0a09) )
28762823   ROM_LOAD( "dduxb16.bin", 0x20000, 0x10000, CRC(6de95434) SHA1(7bed2a0261cf6c2fbb3756633f05f0bb2173977c) )
28772824
2878   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) //* sprites */
2825   ROM_REGION16_BE( 0x100000, "sprites", 0 ) //* sprites */
28792826   ROM_LOAD16_BYTE( "dduxb06.bin", 0x00000, 0x010000, CRC(b0079e99) SHA1(9bb4d3fa804a3d05a6e06b45a1280d7064e96ac6) )
28802827   ROM_LOAD16_BYTE( "dduxb10.bin", 0x00001, 0x010000, CRC(0be3aee5) SHA1(48fc779b7398abbb82cd0d0d28705ece75b3c4e3) )
28812828   ROM_LOAD16_BYTE( "dduxb07.bin", 0x20000, 0x010000, CRC(0217369c) SHA1(b6ec2fa1279a27a602d79e1073c54193745ea816) )
r17593r17594
29032850   ROM_LOAD( "mpr12625.b12", 0x40000, 0x40000, CRC(3b8c757e) SHA1(0b66e8446d059a12e47e2a6fe8f0a333245bb95c) ) // ic20
29042851   ROM_LOAD( "mpr12626.b13", 0x80000, 0x40000, CRC(3efca25c) SHA1(0d866bf53a16b52719f73081e933f4db27d72ece) ) // ic21
29052852
2906   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) /* sprites */
2853   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) /* sprites */
29072854   ROM_LOAD16_BYTE( "ic9",  0x000001, 0x20000, CRC(0d1530bf) SHA1(bb8626cd98761c1c20cee117d00315c85621ba6a) )
29082855   ROM_CONTINUE(            0x100001, 0x20000 )
29092856   ROM_LOAD16_BYTE( "ic12", 0x000000, 0x20000, CRC(18ff0799) SHA1(5417223378aef16ee2b4f438d1f8f11a23fe7265) )
r17593r17594
29322879   ROM_LOAD( "flpoint.005", 0x10000, 0x10000, CRC(82c0b8b0) SHA1(e1e2e721cb8ad53df33065582dc90edeba9c3cab) )
29332880   ROM_LOAD( "flpoint.004", 0x20000, 0x10000, CRC(522426ae) SHA1(90fd0a19b30a8a61dc4cfa66a64115596333dcc6) )
29342881
2935   ROM_REGION16_BE( 0x20000, "gfx2", 0 ) /* sprites */
2882   ROM_REGION16_BE( 0x20000, "sprites", 0 ) /* sprites */
29362883   ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x010000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
29372884   ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x010000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
29382885
r17593r17594
29502897   ROM_LOAD( "flpoint.005", 0x10000, 0x10000, CRC(82c0b8b0) SHA1(e1e2e721cb8ad53df33065582dc90edeba9c3cab) )
29512898   ROM_LOAD( "flpoint.004", 0x20000, 0x10000, CRC(522426ae) SHA1(90fd0a19b30a8a61dc4cfa66a64115596333dcc6) )
29522899
2953   ROM_REGION16_BE( 0x20000, "gfx2", 0 ) /* sprites */
2900   ROM_REGION16_BE( 0x20000, "sprites", 0 ) /* sprites */
29542901   ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x010000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
29552902   ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x010000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
29562903
r17593r17594
29782925   ROM_LOAD( "epr12166.b10", 0x10000, 0x10000, CRC(9abd183b) SHA1(621b017cb34973f9227be383e26b5cd41aea9422) )
29792926   ROM_LOAD( "epr12167.b11", 0x20000, 0x10000, CRC(2495fd4e) SHA1(2db94ead9223a67238a97e724668076fc43e5534) )
29802927
2981   ROM_REGION16_BE( 0x020000, "gfx2", 0 ) /* sprites */
2928   ROM_REGION16_BE( 0x020000, "sprites", 0 ) /* sprites */
29822929   ROM_LOAD16_BYTE( "obj0-o.rom", 0x00001, 0x10000, CRC(2fb38880) SHA1(0e1b601bbda78d1887951c1f7e752531c281bc83) )
29832930   ROM_LOAD16_BYTE( "obj0-e.rom", 0x00000, 0x10000, CRC(d6a02cba) SHA1(d80000f92e754e89c6ca7b7273feab448fc9a061) )
29842931
r17593r17594
30092956   ROM_LOAD( "b53.bin", 0x10000, 0x10000, CRC(aca8e330) SHA1(912e636e3c1e238682ea29620e8e2c6089c77209) )
30102957   ROM_LOAD( "b63.bin", 0x00000, 0x10000, CRC(f2af2fd5) SHA1(0a95ebb5eae7cdc6535533d73d06419c23d01ac3) )
30112958
3012   ROM_REGION( 0x020000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2959   ROM_REGION( 0x020000, "sprites", ROMREGION_ERASEFF ) /* sprites */
30132960   /* no sprites on this */
30142961
30152962   ROM_REGION( 0x40000, "soundcpu", 0 ) /* sound CPU */
r17593r17594
30362983   ROM_LOAD( "iqpipe.5", 0x10000, 0x10000, CRC(dfaedd39) SHA1(498f1c34fecd8de497fdce41bb683d00047a868a) )
30372984   ROM_LOAD( "iqpipe.6", 0x00000, 0x10000, CRC(8e554f8d) SHA1(4b3b0e47c36f37947422f1c31063f11975108cd0) )
30382985
3039   ROM_REGION( 0x020000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2986   ROM_REGION( 0x020000, "sprites", ROMREGION_ERASEFF ) /* sprites */
30402987   /* no sprites on this */
30412988
30422989   ROM_REGION( 0x40000, "soundcpu", 0 ) /* sound CPU */
r17593r17594
30683015   ROM_LOAD( "epr13074.bin", 0x40000, 0x40000, CRC(787afab8) SHA1(a119042bb2dad54e9733bfba4eaab0ac5fc0f9e7) )
30693016   ROM_LOAD( "epr13075.bin", 0x80000, 0x40000, CRC(4e01b477) SHA1(4178ce4a87ea427c3b0195e64acef6cddfb3485f) )
30703017
3071   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) /* sprites */
3018   ROM_REGION16_BE( 0x200000, "sprites", 0 ) /* sprites */
30723019   ROM_LOAD16_BYTE( "mpr13082.bin", 0x000001, 0x40000, CRC(a782b704) SHA1(ba15bdfbc267b8d86f03e5310ce60846ff846de3) )
30733020   ROM_LOAD16_BYTE( "astorm.a11",   0x000000, 0x40000, CRC(7829c4f3) SHA1(3adb7aa7f70163d3848c98316e18b9783c41d663) )
30743021   ROM_LOAD16_BYTE( "mpr13081.bin", 0x080001, 0x40000, CRC(eb510228) SHA1(4cd387b160ec7050e1300ebe708853742169e643) )
r17593r17594
31303077   ROM_LOAD( "36.03",  0x80000, 0x20000, CRC(c0f9628d) SHA1(aeacf5e409adfa0b9c28c90d4e89eb1f56cd5f4d) ) // epr13075.bin [1/2]      IDENTICAL
31313078   ROM_LOAD( "37.031", 0xa0000, 0x20000, CRC(95af904e) SHA1(6574fa874c355c368109b417aab7d0b05c9d215d) ) // epr13075.bin [2/2]      IDENTICAL
31323079
3133   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) /* sprites */
3080   ROM_REGION16_BE( 0x200000, "sprites", 0 ) /* sprites */
31343081   ROM_LOAD16_BYTE( "17.042", 0x000001, 0x20000, CRC(db08beb5) SHA1(c154d22c69b77637d6a9d0f2bffcfb47e6901ec8) ) // mpr13082.bin [1/2]      IDENTICAL
31353082   ROM_LOAD16_BYTE( "16.043", 0x040001, 0x20000, CRC(41f78977) SHA1(9cf9fcf96722d148c4b2cf7aa33425b6efcd0379) ) // mpr13082.bin [2/2]      IDENTICAL
31363083   ROM_LOAD16_BYTE( "29.012", 0x000000, 0x20000, CRC(22acf675) SHA1(80fd0d96017bf36d964a79f7e13e73fee7ed370a) ) // mpr13089.bin [1/2]      99.941254%
r17593r17594
31853132   ROM_LOAD( "mpr13217.b2", 0x40000, 0x40000, CRC(7d1ac3ec) SHA1(8495357304f1df135bba77ef3b96e79a883b8ff0) )
31863133   ROM_LOAD( "mpr13218.b3", 0x80000, 0x40000, CRC(56d3393c) SHA1(50a2d065060692c9ecaa56046a781cb21d93e554) )
31873134
3188   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) /* sprites */
3135   ROM_REGION16_BE( 0x200000, "sprites", 0 ) /* sprites */
31893136   ROM_LOAD16_BYTE( "mpr13224.b11", 0x000001, 0x40000, CRC(c59f107b) SHA1(10fa60fca6e34eda277c483bb1c0e81bb88c8a47) )
31903137   ROM_LOAD16_BYTE( "mpr13231.a11", 0x000000, 0x40000, CRC(a5e96346) SHA1(a854f4dd5dc16975373255110fdb8ab3d121b1af) )
31913138   ROM_LOAD16_BYTE( "mpr13223.b10", 0x080001, 0x40000, CRC(364f60ff) SHA1(9ac887ec0b2e32b504b7c6a5f3bb1ce3fe41a15a) )
r17593r17594
32233170   ROM_LOAD( "ic2",  0x80000, 0x20000, CRC(60095070) SHA1(913c2ee51fb6f838f3c6cbd27032bdf754fbadf1) )
32243171   ROM_LOAD( "ic16", 0xa0000, 0x20000, CRC(0f0d5dd3) SHA1(76812e2f831256a8b6598257dd84a7f07443642e) )
32253172
3226   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) /* sprites */
3173   ROM_REGION16_BE( 0x200000, "sprites", 0 ) /* sprites */
32273174
32283175   // 12719
32293176   ROM_LOAD16_BYTE( "ic73", 0x000001, 0x10000, CRC(59e77c96) SHA1(08da058529ac83352a4528d3792a21edda348f7a) )
trunk/src/mame/drivers/segas16b.c
r17593r17594
933933         break;
934934
935935      case 6:   // 4k of paletteram
936         mapper.map_as_ram(0x00000, 0x01000, 0xfff000, "paletteram", write16_delegate(FUNC(segas16b_state::legacy_wrapper<segaic16_paletteram_w>), this));
936         mapper.map_as_ram(0x00000, 0x01000, 0xfff000, "paletteram", write16_delegate(FUNC(segas16b_state::paletteram_w), this));
937937         break;
938938
939939      case 5:   // 64k of tileram + 4k of textram
r17593r17594
942942         break;
943943
944944      case 4:   // 2k of spriteram
945         mapper.map_as_ram(0x00000, 0x00800, 0xfff800, "spriteram", write16_delegate());
945         mapper.map_as_ram(0x00000, 0x00800, 0xfff800, "sprites", write16_delegate());
946946         break;
947947
948948      case 3:   // 16k or 256k of work RAM
r17593r17594
10501050         // compare registers
10511051         return m_cmptimer_1->read(space, offset, mem_mask);
10521052   }
1053   return segaic16_open_bus_r(&space, 0, mem_mask);
1053   return open_bus_r(space, 0, mem_mask);
10541054}
10551055
10561056
r17593r17594
11251125         return ioport((offset & 1) ? "DSW1" : "DSW2")->read();
11261126   }
11271127   logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
1128   return segaic16_open_bus_r(&space, 0, mem_mask);
1128   return open_bus_r(space, 0, mem_mask);
11291129}
11301130
11311131
r17593r17594
11501150            //  D0 : Output to coin counter 1
11511151            //
11521152         segaic16_tilemap_set_flip(machine(), 0, data & 0x40);
1153         segaic16_sprites_set_flip(machine(), 0, data & 0x40);
1153         m_sprites->set_flip(data & 0x40);
11541154         if (!m_disable_screen_blanking)
11551155            segaic16_set_display_enable(machine(), data & 0x20);
11561156         set_led_status(machine(), 1, data & 0x08);
r17593r17594
13211321   static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 };
13221322   const UINT8 *banklist = (m_romboard == ROM_BOARD_171_5358 || m_romboard == ROM_BOARD_171_5358_SMALL) ? alternate_banklist : default_banklist;
13231323   for (int banknum = 0; banknum < 16; banknum++)
1324      segaic16_sprites_set_bank(machine(), 0, banknum, banklist[banknum]);
1324      m_sprites->set_bank(banknum, banklist[banknum]);
13251325}
13261326
13271327
r17593r17594
17301730
17311731   // these get overwritten by the memory mapper above, but we put them here
17321732   // so they are properly allocated and tracked for saving
1733   AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("spriteram")
1733   AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("sprites")
17341734   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_SHARE("paletteram")
17351735   AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("tileram")
17361736   AM_RANGE(0x400000, 0x400fff) AM_RAM AM_SHARE("textram")
r17593r17594
17441744
17451745   // these get overwritten by the memory mapper above, but we put them here
17461746   // so they are properly allocated and tracked for saving
1747   AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("spriteram")
1747   AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("sprites")
17481748   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_SHARE("paletteram")
17491749   AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("tileram")
17501750   AM_RANGE(0x400000, 0x400fff) AM_RAM AM_SHARE("textram")
r17593r17594
33043304   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_25MHz/4, 400, 0, 320, 262, 0, 224)
33053305   MCFG_SCREEN_UPDATE_DRIVER(segas16b_state, screen_update)
33063306
3307   MCFG_SEGA16SP_ADD_16B("segaspr1")
3307   MCFG_SEGA_SYS16B_SPRITES_ADD("sprites")
33083308
33093309   // sound hardware
33103310   MCFG_SPEAKER_STANDARD_MONO("mono")
r17593r17594
34203420   ROM_LOAD( "epr-11494.b10", 0x10000, 0x10000, CRC(b67971ab) SHA1(95cb6927baf425bcc290832ea9741b19852c7a1b) )
34213421   ROM_LOAD( "epr-11495.b11", 0x20000, 0x10000, CRC(b687ab61) SHA1(b08130a9d777c918972895136b1bf520d7117114) )
34223422
3423   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
3423   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
34243424   ROM_LOAD16_BYTE( "epr-11501.b1", 0x00001, 0x10000, CRC(09179ead) SHA1(3e6bf04e1e9ea867d087a47ff04ad0a064a8e299) )
34253425   ROM_LOAD16_BYTE( "epr-11505.b5", 0x00000, 0x10000, CRC(b67f1ecf) SHA1(3a26cdf91e5a1a11c1a8857e713a9e00cc1bfce0) )
34263426   ROM_LOAD16_BYTE( "epr-11502.b2", 0x20001, 0x10000, CRC(a3ee36b8) SHA1(bc946ad67b8ad09d947465ab73160885a4a57be5) )
r17593r17594
34603460   ROM_LOAD( "epr-10703.b10", 0x10000, 0x10000, CRC(6b6dd9f5) SHA1(964409c6630caa13caf7d644d0c6fb071860b61b) )
34613461   ROM_LOAD( "epr-10704.b11", 0x20000, 0x10000, CRC(911e7ebc) SHA1(f03d3d3a09d19f7b705f9cb29f73140a3073463f) )
34623462
3463   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
3463   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
34643464   ROM_LOAD16_BYTE( "epr-10709.b1", 0x00001, 0x10000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
34653465   ROM_LOAD16_BYTE( "epr-10713.b5", 0x00000, 0x10000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
34663466   ROM_LOAD16_BYTE( "epr-10710.b2", 0x20001, 0x10000, CRC(992369eb) SHA1(c6796acf6807e9ba4c3d241903653f91adf4764e) )
r17593r17594
34993499   ROM_LOAD( "epr-10703.b10", 0x10000, 0x10000, CRC(6b6dd9f5) SHA1(964409c6630caa13caf7d644d0c6fb071860b61b) )
35003500   ROM_LOAD( "epr-10704.b11", 0x20000, 0x10000, CRC(911e7ebc) SHA1(f03d3d3a09d19f7b705f9cb29f73140a3073463f) )
35013501
3502   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
3502   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
35033503   ROM_LOAD16_BYTE( "epr-10709.b1", 0x00001, 0x10000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
35043504   ROM_LOAD16_BYTE( "epr-10713.b5", 0x00000, 0x10000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
35053505   ROM_LOAD16_BYTE( "epr-10710.b2", 0x20001, 0x10000, CRC(992369eb) SHA1(c6796acf6807e9ba4c3d241903653f91adf4764e) )
r17593r17594
35423542   ROM_LOAD( "epr-10703.b10", 0x10000, 0x10000, CRC(6b6dd9f5) SHA1(964409c6630caa13caf7d644d0c6fb071860b61b) )
35433543   ROM_LOAD( "epr-10704.b11", 0x20000, 0x10000, CRC(911e7ebc) SHA1(f03d3d3a09d19f7b705f9cb29f73140a3073463f) )
35443544
3545   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
3545   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
35463546   ROM_LOAD16_BYTE( "epr-10709.b1", 0x00001, 0x10000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
35473547   ROM_LOAD16_BYTE( "epr-10713.b5", 0x00000, 0x10000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
35483548   ROM_LOAD16_BYTE( "epr-10710.b2", 0x20001, 0x10000, CRC(992369eb) SHA1(c6796acf6807e9ba4c3d241903653f91adf4764e) )
r17593r17594
35813581   ROM_LOAD( "opr-11675.a15", 0x20000, 0x20000, CRC(2ef2f144) SHA1(38d22d609db2d9b6067b5d12f6499436de4605cb) )
35823582   ROM_LOAD( "opr-11676.a16", 0x40000, 0x20000, CRC(0c04acac) SHA1(87fe2a0dd9913f9550e9b4cbc7e7465b61640e07) )
35833583
3584   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
3584   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
35853585   ROM_LOAD16_BYTE( "epr-11677.b1", 0x00001, 0x20000, CRC(a01425cd) SHA1(72be5ec29e476601f9bf6aaedef9b73cedeb42f0) )
35863586   ROM_LOAD16_BYTE( "epr-11681.b5", 0x00000, 0x20000, CRC(d9e03363) SHA1(995a7c6a8f0c61468b57a3bb407461a2a3ae8adc) )
35873587   ROM_LOAD16_BYTE( "epr-11678.b2", 0x40001, 0x20000, CRC(17a9fc53) SHA1(85a9a605742ae5aab86db37189b9ee4d54c70e56) )
r17593r17594
36183618   ROM_LOAD( "epr-11724.a16", 0x80000, 0x10000,  CRC(6f2ed50a) SHA1(55d0c4299e7240b0ef5316b48db7a158145c76ab) ) // plane 3
36193619   ROM_LOAD( "epr-11738.b16", 0xa0000, 0x10000,  CRC(de3d6d02) SHA1(428811f21c68761022521a17fc4716f6e7214b20) )
36203620
3621   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
3621   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
36223622   ROM_LOAD16_BYTE( "epr-11725.b1",  0x000001, 0x010000, CRC(f8b3684e) SHA1(3de2685cae5fb3c954b8440fafce313072747469) )
36233623   ROM_LOAD16_BYTE( "epr-11729.b5",  0x000000, 0x010000, CRC(ae3c2793) SHA1(c4f46861ea63ffa3c038a1ef931479b94e5382df) )
36243624   ROM_LOAD16_BYTE( "epr-11726.b2",  0x040001, 0x010000, CRC(3cce5419) SHA1(fccdbd6d05f5927272e7d6e5f997418d4fa2baf5) )
r17593r17594
36613661   ROM_LOAD( "epr-11724.a16", 0x80000, 0x10000,  CRC(6f2ed50a) SHA1(55d0c4299e7240b0ef5316b48db7a158145c76ab) ) // plane 3
36623662   ROM_LOAD( "epr-11738.b16", 0xa0000, 0x10000,  CRC(de3d6d02) SHA1(428811f21c68761022521a17fc4716f6e7214b20) )
36633663
3664   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
3664   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
36653665   ROM_LOAD16_BYTE( "epr-11725.b1",  0x000001, 0x010000, CRC(f8b3684e) SHA1(3de2685cae5fb3c954b8440fafce313072747469) )
36663666   ROM_LOAD16_BYTE( "epr-11729.b5",  0x000000, 0x010000, CRC(ae3c2793) SHA1(c4f46861ea63ffa3c038a1ef931479b94e5382df) )
36673667   ROM_LOAD16_BYTE( "epr-11726.b2",  0x040001, 0x010000, CRC(3cce5419) SHA1(fccdbd6d05f5927272e7d6e5f997418d4fa2baf5) )
r17593r17594
37103710   ROM_LOAD( "epr-11724.a16", 0x80000, 0x10000,  CRC(6f2ed50a) SHA1(55d0c4299e7240b0ef5316b48db7a158145c76ab) ) // plane 3
37113711   ROM_LOAD( "epr-11738.b16", 0xa0000, 0x10000,  CRC(de3d6d02) SHA1(428811f21c68761022521a17fc4716f6e7214b20) )
37123712
3713   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
3713   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
37143714   ROM_LOAD16_BYTE( "epr-11725.b1",  0x000001, 0x010000, CRC(f8b3684e) SHA1(3de2685cae5fb3c954b8440fafce313072747469) )
37153715   ROM_LOAD16_BYTE( "epr-11729.b5",  0x000000, 0x010000, CRC(ae3c2793) SHA1(c4f46861ea63ffa3c038a1ef931479b94e5382df) )
37163716   ROM_LOAD16_BYTE( "epr-11726.b2",  0x040001, 0x010000, CRC(3cce5419) SHA1(fccdbd6d05f5927272e7d6e5f997418d4fa2baf5) )
r17593r17594
37513751   ROM_LOAD( "epr-11724.a16", 0x80000, 0x10000,  CRC(6f2ed50a) SHA1(55d0c4299e7240b0ef5316b48db7a158145c76ab) ) // plane 3
37523752   ROM_LOAD( "epr-11738.b16", 0xa0000, 0x10000,  CRC(de3d6d02) SHA1(428811f21c68761022521a17fc4716f6e7214b20) )
37533753
3754   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
3754   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
37553755   ROM_LOAD16_BYTE( "epr-11725.b1",  0x000001, 0x010000, CRC(f8b3684e) SHA1(3de2685cae5fb3c954b8440fafce313072747469) )
37563756   ROM_LOAD16_BYTE( "epr-11729.b5",  0x000000, 0x010000, CRC(ae3c2793) SHA1(c4f46861ea63ffa3c038a1ef931479b94e5382df) )
37573757   ROM_LOAD16_BYTE( "epr-11726.b2",  0x040001, 0x010000, CRC(3cce5419) SHA1(fccdbd6d05f5927272e7d6e5f997418d4fa2baf5) )
r17593r17594
37973797   ROM_LOAD( "epr-11724.a16", 0x80000, 0x10000,  CRC(6f2ed50a) SHA1(55d0c4299e7240b0ef5316b48db7a158145c76ab) ) // plane 3
37983798   ROM_LOAD( "epr-11738.b16", 0xa0000, 0x10000,  CRC(de3d6d02) SHA1(428811f21c68761022521a17fc4716f6e7214b20) )
37993799
3800   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
3800   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
38013801   ROM_LOAD16_BYTE( "epr-11725.b1",  0x000001, 0x010000, CRC(f8b3684e) SHA1(3de2685cae5fb3c954b8440fafce313072747469) )
38023802   ROM_LOAD16_BYTE( "epr-11729.b5",  0x000000, 0x010000, CRC(ae3c2793) SHA1(c4f46861ea63ffa3c038a1ef931479b94e5382df) )
38033803   ROM_LOAD16_BYTE( "epr-11726.b2",  0x040001, 0x010000, CRC(3cce5419) SHA1(fccdbd6d05f5927272e7d6e5f997418d4fa2baf5) )
r17593r17594
38353835   ROM_LOAD( "opr-11675.a15", 0x20000, 0x20000, CRC(2ef2f144) SHA1(38d22d609db2d9b6067b5d12f6499436de4605cb) )
38363836   ROM_LOAD( "opr-11676.a16", 0x40000, 0x20000, CRC(0c04acac) SHA1(87fe2a0dd9913f9550e9b4cbc7e7465b61640e07) )
38373837
3838   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
3838   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
38393839   ROM_LOAD16_BYTE( "epr-11677.b1", 0x00001, 0x20000, CRC(a01425cd) SHA1(72be5ec29e476601f9bf6aaedef9b73cedeb42f0) )
38403840   ROM_LOAD16_BYTE( "epr-11681.b5", 0x00000, 0x20000, CRC(d9e03363) SHA1(995a7c6a8f0c61468b57a3bb407461a2a3ae8adc) )
38413841   ROM_LOAD16_BYTE( "epr-11678.b2", 0x40001, 0x20000, CRC(17a9fc53) SHA1(85a9a605742ae5aab86db37189b9ee4d54c70e56) )
r17593r17594
38723872   ROM_LOAD( "opr-11675.a15", 0x20000, 0x20000, CRC(2ef2f144) SHA1(38d22d609db2d9b6067b5d12f6499436de4605cb) )
38733873   ROM_LOAD( "opr-11676.a16", 0x40000, 0x20000, CRC(0c04acac) SHA1(87fe2a0dd9913f9550e9b4cbc7e7465b61640e07) )
38743874
3875   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
3875   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
38763876   ROM_LOAD16_BYTE( "epr-11677.b1", 0x00001, 0x20000, CRC(a01425cd) SHA1(72be5ec29e476601f9bf6aaedef9b73cedeb42f0) )
38773877   ROM_LOAD16_BYTE( "epr-11681.b5", 0x00000, 0x20000, CRC(d9e03363) SHA1(995a7c6a8f0c61468b57a3bb407461a2a3ae8adc) )
38783878   ROM_LOAD16_BYTE( "epr-11678.b2", 0x40001, 0x20000, CRC(17a9fc53) SHA1(85a9a605742ae5aab86db37189b9ee4d54c70e56) )
r17593r17594
39563956   ROM_LOAD( "mpr-13452.a16", 0x80000, 0x20000, CRC(047bde5e) SHA1(e759baedcbb637a6c14af461b8a492554cadc9e4) ) // plane 3
39573957   ROM_LOAD( "mpr-13467.b16", 0xa0000, 0x20000, CRC(6309fec4) SHA1(f90c9679bade3cfbaa7949e412410c29d5bfa4d3) )
39583958
3959   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
3959   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
39603960   ROM_LOAD16_BYTE( "mpr-13453.b1",  0x000001, 0x020000, CRC(5fa0a9f8) SHA1(d9d67cc006a608d48e37aa89359f1a9403172b00) )
39613961   ROM_LOAD16_BYTE( "mpr-13457.b5",  0x000000, 0x020000, CRC(0d1b54da) SHA1(c7a6393f9e13adabe93b7a86aa7845c5f4d188f1) )
39623962   ROM_LOAD16_BYTE( "mpr-13454.b2",  0x040001, 0x020000, CRC(5f6b33b1) SHA1(5d397bdaa2c7a9ce82cc9134bfeb78418dc613b0) )
r17593r17594
39993999   ROM_LOAD( "mpr-13452.a16", 0x80000, 0x20000, CRC(047bde5e) SHA1(e759baedcbb637a6c14af461b8a492554cadc9e4) ) // plane 3
40004000   ROM_LOAD( "mpr-13467.b16", 0xa0000, 0x20000, CRC(6309fec4) SHA1(f90c9679bade3cfbaa7949e412410c29d5bfa4d3) )
40014001
4002   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
4002   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
40034003   ROM_LOAD16_BYTE( "mpr-13453.b1",  0x000001, 0x020000, CRC(5fa0a9f8) SHA1(d9d67cc006a608d48e37aa89359f1a9403172b00) )
40044004   ROM_LOAD16_BYTE( "mpr-13457.b5",  0x000000, 0x020000, CRC(0d1b54da) SHA1(c7a6393f9e13adabe93b7a86aa7845c5f4d188f1) )
40054005   ROM_LOAD16_BYTE( "mpr-13454.b2",  0x040001, 0x020000, CRC(5f6b33b1) SHA1(5d397bdaa2c7a9ce82cc9134bfeb78418dc613b0) )
r17593r17594
40664066   ROM_LOAD( "mpr-13452.a16", 0x80000, 0x20000, CRC(047bde5e) SHA1(e759baedcbb637a6c14af461b8a492554cadc9e4) ) // plane 3
40674067   ROM_LOAD( "mpr-13467.b16", 0xa0000, 0x20000, CRC(6309fec4) SHA1(f90c9679bade3cfbaa7949e412410c29d5bfa4d3) )
40684068
4069   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
4069   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
40704070   ROM_LOAD16_BYTE( "mpr-13453.b1",  0x000001, 0x020000, CRC(5fa0a9f8) SHA1(d9d67cc006a608d48e37aa89359f1a9403172b00) )
40714071   ROM_LOAD16_BYTE( "mpr-13457.b5",  0x000000, 0x020000, CRC(0d1b54da) SHA1(c7a6393f9e13adabe93b7a86aa7845c5f4d188f1) )
40724072   ROM_LOAD16_BYTE( "mpr-13454.b2",  0x040001, 0x020000, CRC(5f6b33b1) SHA1(5d397bdaa2c7a9ce82cc9134bfeb78418dc613b0) )
r17593r17594
41164116   ROM_LOAD( "opr-12463.a15", 0x10000, 0x10000, CRC(62f8200d) SHA1(a5a0035249f339396b33f8a908d393777e8951c4) )
41174117   ROM_LOAD( "opr-12464.a16", 0x20000, 0x10000, CRC(c8c59703) SHA1(3a4f45b88990d27c55ddfde5fc93496954868200) )
41184118
4119   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
4119   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
41204120   ROM_LOAD16_BYTE( "mpr-12465.b1", 0x00001, 0x20000, CRC(11d61b45) SHA1(01678e07ffcafb8c161b52763f2183dc281c7578) )
41214121   ROM_LOAD16_BYTE( "mpr-12467.b5", 0x00000, 0x20000, CRC(c3b4e4c0) SHA1(2d8dbea5278b3fac03c7ad8749f931d36cc8f341) )
41224122   ROM_LOAD16_BYTE( "mpr-12466.b2", 0x40001, 0x20000, CRC(a57f236f) SHA1(c83219cdfcee10a4fdffcbf410808f161a2b1aef) )
r17593r17594
41484148   ROM_LOAD( "opr-12463.a15", 0x10000, 0x10000, CRC(62f8200d) SHA1(a5a0035249f339396b33f8a908d393777e8951c4) )
41494149   ROM_LOAD( "opr-12464.a16", 0x20000, 0x10000, CRC(c8c59703) SHA1(3a4f45b88990d27c55ddfde5fc93496954868200) )
41504150
4151   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
4151   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
41524152   ROM_LOAD16_BYTE( "mpr-12465.b1", 0x00001, 0x20000, CRC(11d61b45) SHA1(01678e07ffcafb8c161b52763f2183dc281c7578) )
41534153   ROM_LOAD16_BYTE( "mpr-12467.b5", 0x00000, 0x20000, CRC(c3b4e4c0) SHA1(2d8dbea5278b3fac03c7ad8749f931d36cc8f341) )
41544154   ROM_LOAD16_BYTE( "mpr-12466.b2", 0x40001, 0x20000, CRC(a57f236f) SHA1(c83219cdfcee10a4fdffcbf410808f161a2b1aef) )
r17593r17594
41794179   ROM_LOAD( "opr-12463.a15", 0x10000, 0x10000, CRC(62f8200d) SHA1(a5a0035249f339396b33f8a908d393777e8951c4) )
41804180   ROM_LOAD( "opr-12464.a16", 0x20000, 0x10000, CRC(c8c59703) SHA1(3a4f45b88990d27c55ddfde5fc93496954868200) )
41814181
4182   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) // sprites
4182   ROM_REGION16_BE( 0x080000, "sprites", 0 ) // sprites
41834183   ROM_LOAD16_BYTE( "br_obj0o.b1", 0x00001, 0x10000, CRC(098a5e82) SHA1(c5922f418773bc3629071e584457839d67a370e9) )
41844184   ROM_LOAD16_BYTE( "br_obj0e.b5", 0x00000, 0x10000, CRC(85238af9) SHA1(39989a8d9b60c6d55272b5e2c213341a563dd993) )
41854185   ROM_LOAD16_BYTE( "br_obj1o.b2", 0x20001, 0x10000, CRC(cc641da1) SHA1(28f8a6502702cb9e2cc7f3e98f6c5d201f462fa3) )
r17593r17594
42314231   ROM_LOAD( "epr-10995.b10", 0x10000, 0x10000, CRC(6b97aff1) SHA1(323bafe43a703476f6f4e68b46ec86bb9152f88e) )
42324232   ROM_LOAD( "epr-10996.b11", 0x20000, 0x10000, CRC(501bddd6) SHA1(545273b1b874b3e68d23b0dcae81c8531bd98756) )
42334233
4234   ROM_REGION16_BE( 0x80000, "gfx2", ROMREGION_ERASE00 ) // sprites
4234   ROM_REGION16_BE( 0x80000, "sprites", ROMREGION_ERASE00 ) // sprites
42354235   ROM_LOAD16_BYTE( "epr-10999.b1", 0x00001, 0x010000, CRC(119f0008) SHA1(6a39b537bb58ea19ed3b0322ebca37e6574289fd) )
42364236   ROM_LOAD16_BYTE( "epr-11003.b5", 0x00000, 0x010000, CRC(2f429089) SHA1(08bf9d9c15fafbcb26604ff30be367ecf25404b2) )
42374237   ROM_LOAD16_BYTE( "epr-11000.b2", 0x20001, 0x010000, CRC(f5482bbe) SHA1(d8482ba73622798b15e78ab2c123d0fd4c33480a) )
r17593r17594
42724272   ROM_LOAD( "opr-13864.a16", 0x80000, 0x20000, CRC(d2b175bf) SHA1(897b7c794d0e7229ea5e9a682f64266a947a818f) )
42734273   ROM_LOAD( "opr-13879.b16", 0xa0000, 0x20000, CRC(b9d62531) SHA1(e8c5e7b93339c00f75a3b66ce18f7838255577be) )
42744274
4275   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
4275   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
42764276   ROM_LOAD16_BYTE( "opr-13869.b5", 0x000000, 0x20000, CRC(ab4b3468) SHA1(3071654a295152d609d2c2c1d4153b5ba3f174d5) )
42774277   ROM_LOAD16_BYTE( "opr-13865.b1", 0x000001, 0x20000, CRC(7024f404) SHA1(4b2f9cdfdd97218797a3e386106e53f713b8650d) )
42784278   ROM_LOAD16_BYTE( "opr-13870.b6", 0x040000, 0x20000, CRC(69b41ac3) SHA1(4c5a85e5a5ca9f8260557d4e97eb091dd857d63a) )
r17593r17594
43184318   ROM_LOAD( "opr-13864.a16", 0x80000, 0x20000, CRC(d2b175bf) SHA1(897b7c794d0e7229ea5e9a682f64266a947a818f) )
43194319   ROM_LOAD( "opr-13879.b16", 0xa0000, 0x20000, CRC(b9d62531) SHA1(e8c5e7b93339c00f75a3b66ce18f7838255577be) )
43204320
4321   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
4321   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
43224322   ROM_LOAD16_BYTE( "opr-13869.b5", 0x000000, 0x20000, CRC(ab4b3468) SHA1(3071654a295152d609d2c2c1d4153b5ba3f174d5) )
43234323   ROM_LOAD16_BYTE( "opr-13865.b1", 0x000001, 0x20000, CRC(7024f404) SHA1(4b2f9cdfdd97218797a3e386106e53f713b8650d) )
43244324   ROM_LOAD16_BYTE( "opr-13870.b6", 0x040000, 0x20000, CRC(69b41ac3) SHA1(4c5a85e5a5ca9f8260557d4e97eb091dd857d63a) )
r17593r17594
43654365   ROM_LOAD( "opr-13864.a16", 0x80000, 0x20000, CRC(d2b175bf) SHA1(897b7c794d0e7229ea5e9a682f64266a947a818f) )
43664366   ROM_LOAD( "opr-13879.b16", 0xa0000, 0x20000, CRC(b9d62531) SHA1(e8c5e7b93339c00f75a3b66ce18f7838255577be) )
43674367
4368   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
4368   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
43694369   ROM_LOAD16_BYTE( "opr-13869.b5", 0x000000, 0x20000, CRC(ab4b3468) SHA1(3071654a295152d609d2c2c1d4153b5ba3f174d5) )
43704370   ROM_LOAD16_BYTE( "opr-13865.b1", 0x000001, 0x20000, CRC(7024f404) SHA1(4b2f9cdfdd97218797a3e386106e53f713b8650d) )
43714371   ROM_LOAD16_BYTE( "opr-13870.b6", 0x040000, 0x20000, CRC(69b41ac3) SHA1(4c5a85e5a5ca9f8260557d4e97eb091dd857d63a) )
r17593r17594
44104410   ROM_LOAD( "epr-10486.b10", 0x08000, 0x8000, CRC(311d973c) SHA1(c4765917ba788ed45a801499f3d873a86c418eb8) )
44114411   ROM_LOAD( "epr-10487.b11", 0x10000, 0x8000, CRC(a8fb179f) SHA1(8a748d537b3d327c41d6dac17342de9be068e53b) )
44124412
4413   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
4413   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
44144414   ROM_LOAD16_BYTE( "epr-10481.b5", 0x00000, 0x8000, CRC(feb04bc9) SHA1(233dc8e3b887a88ac114723d58a909a58f0ae771) )
44154415   ROM_RELOAD(                      0x10000, 0x8000 )
44164416   ROM_LOAD16_BYTE( "epr-10477.b1", 0x00001, 0x8000, CRC(f9d3b2cb) SHA1(b530fe16882c718122bfd1de098f39e54993de28) )
r17593r17594
44794479   ROM_LOAD( "mpr-11918.a15", 0x10000, 0x10000, CRC(c731db95) SHA1(b3b9cbd772f7bfd35355bcb2a7c0801b61eaf19f) )
44804480   ROM_LOAD( "mpr-11919.a16", 0x20000, 0x10000, CRC(64d5a491) SHA1(686151c9a58f524f786f52c03f086cdaa5728233) )
44814481
4482   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
4482   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
44834483   ROM_LOAD16_BYTE( "mpr-11920.b1", 0x00001, 0x020000, CRC(e5d1e3cd) SHA1(d8c0f40dab00f1b09f6d018597fd45147f9ca3f6) )
44844484   ROM_LOAD16_BYTE( "mpr-11922.b5", 0x00000, 0x020000, CRC(70b0c4dd) SHA1(b67acab0c6a0f5051fc3fcda2476b8834f65b376) )
44854485   ROM_LOAD16_BYTE( "mpr-11921.b2", 0x40001, 0x020000, CRC(61d2358c) SHA1(216fd295ff9d56976f9b1c465a48806be843dd04) )
r17593r17594
45094509   ROM_LOAD( "mpr-11918.a15", 0x10000, 0x10000, CRC(c731db95) SHA1(b3b9cbd772f7bfd35355bcb2a7c0801b61eaf19f) )
45104510   ROM_LOAD( "mpr-11919.a16", 0x20000, 0x10000, CRC(64d5a491) SHA1(686151c9a58f524f786f52c03f086cdaa5728233) )
45114511
4512   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
4512   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
45134513   ROM_LOAD16_BYTE( "mpr-11920.b1", 0x00001, 0x020000, CRC(e5d1e3cd) SHA1(d8c0f40dab00f1b09f6d018597fd45147f9ca3f6) )
45144514   ROM_LOAD16_BYTE( "mpr-11922.b5", 0x00000, 0x020000, CRC(70b0c4dd) SHA1(b67acab0c6a0f5051fc3fcda2476b8834f65b376) )
45154515   ROM_LOAD16_BYTE( "mpr-11921.b2", 0x40001, 0x020000, CRC(61d2358c) SHA1(216fd295ff9d56976f9b1c465a48806be843dd04) )
r17593r17594
45434543   ROM_LOAD( "mpr-12625.b12", 0x40000, 0x40000, CRC(3b8c757e) SHA1(0b66e8446d059a12e47e2a6fe8f0a333245bb95c) )
45444544   ROM_LOAD( "mpr-12626.b13", 0x80000, 0x40000, CRC(3efca25c) SHA1(0d866bf53a16b52719f73081e933f4db27d72ece) )
45454545
4546   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
4546   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
45474547   ROM_LOAD16_BYTE( "mpr-12618.b1", 0x000001, 0x20000, CRC(0d1530bf) SHA1(bb8626cd98761c1c20cee117d00315c85621ba6a) )
45484548   ROM_CONTINUE(                    0x100001, 0x20000 )
45494549   ROM_LOAD16_BYTE( "mpr-12621.b4", 0x000000, 0x20000, CRC(18ff0799) SHA1(5417223378aef16ee2b4f438d1f8f11a23fe7265) )
r17593r17594
45814581   ROM_LOAD( "mpr-12625.b12", 0x40000, 0x40000, CRC(3b8c757e) SHA1(0b66e8446d059a12e47e2a6fe8f0a333245bb95c) )
45824582   ROM_LOAD( "mpr-12626.b13", 0x80000, 0x40000, CRC(3efca25c) SHA1(0d866bf53a16b52719f73081e933f4db27d72ece) )
45834583
4584   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
4584   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
45854585   ROM_LOAD16_BYTE( "mpr-12618.b1", 0x000001, 0x20000, CRC(0d1530bf) SHA1(bb8626cd98761c1c20cee117d00315c85621ba6a) )
45864586   ROM_CONTINUE(                    0x100001, 0x20000 )
45874587   ROM_LOAD16_BYTE( "mpr-12621.b4", 0x000000, 0x20000, CRC(18ff0799) SHA1(5417223378aef16ee2b4f438d1f8f11a23fe7265) )
r17593r17594
46214621   ROM_LOAD( "mpr-12625.b12", 0x40000, 0x40000, CRC(3b8c757e) SHA1(0b66e8446d059a12e47e2a6fe8f0a333245bb95c) )
46224622   ROM_LOAD( "mpr-12626.b13", 0x80000, 0x40000, CRC(3efca25c) SHA1(0d866bf53a16b52719f73081e933f4db27d72ece) )
46234623
4624   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
4624   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
46254625   ROM_LOAD16_BYTE( "mpr-12618.b1", 0x000001, 0x20000, CRC(0d1530bf) SHA1(bb8626cd98761c1c20cee117d00315c85621ba6a) )
46264626   ROM_CONTINUE(                    0x100001, 0x20000 )
46274627   ROM_LOAD16_BYTE( "mpr-12621.b4", 0x000000, 0x20000, CRC(18ff0799) SHA1(5417223378aef16ee2b4f438d1f8f11a23fe7265) )
r17593r17594
46654665   ROM_LOAD( "epr-11943.b10", 0x10000, 0x10000, CRC(d97c8982) SHA1(3e604af1771caba3aa213796c4a0812a5e352580) )
46664666   ROM_LOAD( "epr-11944.b11", 0x20000, 0x10000, CRC(a75cae80) SHA1(17c148a33b09b5403e68f5d96e506545c2ced206) )
46674667
4668   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
4668   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
46694669   ROM_LOAD16_BYTE( "epr-11950.b01", 0x00001, 0x10000, CRC(af497849) SHA1(c5fdca8d3b1d83e3d377a49ecdc0fc53714afc09) )
46704670   ROM_LOAD16_BYTE( "epr-11954.b05", 0x00000, 0x10000, CRC(5fa2106c) SHA1(2f2620fa52d07667dff4720fea32a6615d99e522) )
46714671   ROM_LOAD16_BYTE( "epr-11951.b02", 0x20001, 0x10000, CRC(c04fa974) SHA1(b1a4fb8522126113d7857d559f169f09c5f51a13) )
r17593r17594
47304730   ROM_LOAD( "opr-12594.a15", 0x10000, 0x10000, CRC(8bfc4815) SHA1(08d28b65e5024c592a9a289b270774ef5c553cbf) )
47314731   ROM_LOAD( "opr-12595.a16", 0x20000, 0x10000, CRC(5b18d60b) SHA1(8e9c81635dcefa52d1cf53c2937ae560191b5202) )
47324732
4733   ROM_REGION16_BE( 0x20000, "gfx2", 0 ) // sprites
4733   ROM_REGION16_BE( 0x20000, "sprites", 0 ) // sprites
47344734   ROM_LOAD16_BYTE( "opr-12596.b1", 0x00001, 0x10000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
47354735   ROM_LOAD16_BYTE( "opr-12597.b5", 0x00000, 0x10000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
47364736
r17593r17594
47754775   ROM_LOAD( "opr-12594.a15", 0x10000, 0x10000, CRC(8bfc4815) SHA1(08d28b65e5024c592a9a289b270774ef5c553cbf) )
47764776   ROM_LOAD( "opr-12595.a16", 0x20000, 0x10000, CRC(5b18d60b) SHA1(8e9c81635dcefa52d1cf53c2937ae560191b5202) )
47774777
4778   ROM_REGION16_BE( 0x20000, "gfx2", 0 ) // sprites
4778   ROM_REGION16_BE( 0x20000, "sprites", 0 ) // sprites
47794779   ROM_LOAD16_BYTE( "opr-12596.b1", 0x00001, 0x10000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
47804780   ROM_LOAD16_BYTE( "opr-12597.b5", 0x00000, 0x10000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
47814781
r17593r17594
48024802   ROM_LOAD( "epr-12386.ic20", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
48034803   ROM_LOAD( "epr-12387.ic21", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
48044804
4805   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
4805   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
48064806   ROM_LOAD16_BYTE( "mpr-12378.ic9",  0x000001, 0x20000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
48074807   ROM_CONTINUE(                      0x100001, 0x20000 )
48084808   ROM_LOAD16_BYTE( "mpr-12379.ic12", 0x000000, 0x20000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
r17593r17594
48434843   ROM_LOAD( "epr-12386.ic20", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
48444844   ROM_LOAD( "epr-12387.ic21", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
48454845
4846   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
4846   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
48474847   ROM_LOAD16_BYTE( "mpr-12378.ic9",  0x000001, 0x20000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
48484848   ROM_CONTINUE(                      0x100001, 0x20000 )
48494849   ROM_LOAD16_BYTE( "mpr-12379.ic12", 0x000000, 0x20000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
r17593r17594
48844884   ROM_LOAD( "epr-12386.a15", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
48854885   ROM_LOAD( "epr-12387.a16", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
48864886
4887   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
4887   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
48884888   ROM_LOAD16_BYTE( "mpr-12378.b1", 0x000001, 0x20000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
48894889   ROM_CONTINUE(                    0x100001, 0x20000 )
48904890   ROM_LOAD16_BYTE( "mpr-12379.b5", 0x000000, 0x20000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
r17593r17594
49254925   ROM_LOAD( "epr-12386.a15", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
49264926   ROM_LOAD( "epr-12387.a16", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
49274927
4928   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
4928   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
49294929   ROM_LOAD16_BYTE( "mpr-12378.b1", 0x000001, 0x20000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
49304930   ROM_CONTINUE(                    0x100001, 0x20000 )
49314931   ROM_LOAD16_BYTE( "mpr-12379.b5", 0x000000, 0x20000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
r17593r17594
49624962   ROM_LOAD( "epr-12386.a15", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
49634963   ROM_LOAD( "epr-12387.a16", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
49644964
4965   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
4965   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
49664966   ROM_LOAD16_BYTE( "mpr-12378.b1", 0x000001, 0x20000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
49674967   ROM_CONTINUE(                    0x100001, 0x20000 )
49684968   ROM_LOAD16_BYTE( "mpr-12379.b5", 0x000000, 0x20000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
r17593r17594
50035003   ROM_LOAD( "epr-12386.ic20", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
50045004   ROM_LOAD( "epr-12387.ic21", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
50055005
5006   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
5006   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
50075007   ROM_LOAD16_BYTE( "mpr-12378.ic9",  0x000001, 0x20000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
50085008   ROM_CONTINUE(                      0x100001, 0x20000 )
50095009   ROM_LOAD16_BYTE( "mpr-12379.ic12", 0x000000, 0x20000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
r17593r17594
50455045   ROM_LOAD( "mpr-11243.a16", 0x80000, 0x20000, CRC(f30cd5fd) SHA1(df6118ca4b724c37b11e18d9f2ea18e9591ae7aa) )
50465046   ROM_LOAD( "mpr-11168.b16", 0xA0000, 0x20000, CRC(5b8494a8) SHA1(9e3f09f4037a007b6a188dd81ec8f9c635e87650) )
50475047
5048   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
5048   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
50495049   ROM_LOAD16_BYTE( "mpr-11158.b1", 0x000001, 0x010000, CRC(fc098a13) SHA1(b4a6e00d4765265bad170dabf0b2a4a58e063b16) ) // all MPR-111xx here are 28 pin Fujitsu MB831000 MASK roms
50505050   ROM_CONTINUE(                    0x020001, 0x010000 )
50515051   ROM_LOAD16_BYTE( "mpr-11162.b5", 0x000000, 0x010000, CRC(5db934a8) SHA1(ba7cc93025af71ad2674b1376b61afbb7ae910ff) )
r17593r17594
50935093   ROM_LOAD( "epr-11204.a16", 0x80000, 0x20000, CRC(dfc4cd33) SHA1(880af38b6a3cb52220e7b4f0999cfafade0535f9) )
50945094   ROM_LOAD( "epr-11215.b16", 0xA0000, 0x20000, CRC(5b8494a8) SHA1(9e3f09f4037a007b6a188dd81ec8f9c635e87650) )
50955095
5096   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
5096   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
50975097   ROM_LOAD16_BYTE( "epr-11205.b1", 0x000001, 0x010000, CRC(fc098a13) SHA1(b4a6e00d4765265bad170dabf0b2a4a58e063b16) )
50985098   ROM_CONTINUE(                    0x020001, 0x010000 )
50995099   ROM_LOAD16_BYTE( "epr-11209.b5", 0x000000, 0x010000, CRC(5db934a8) SHA1(ba7cc93025af71ad2674b1376b61afbb7ae910ff) )
r17593r17594
51415141   ROM_LOAD( "13012.rom", 0x40000, 0x40000, CRC(b75e6821) SHA1(a2b049995755d79a136a4b4b0dc78d902c5b9eed) )
51425142   ROM_LOAD( "13013.rom", 0x80000, 0x40000, CRC(f1944a3c) SHA1(db59cadb435c26f3a957bd4996a083fa30c8bbd0) )
51435143
5144   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
5144   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
51455145   ROM_LOAD16_BYTE( "13003.rom", 0x000001, 0x20000, CRC(21424151) SHA1(156e15eee9ff7122c30a42bfec0b307073b7a375) )
51465146   ROM_CONTINUE(                 0x100001, 0x20000 )
51475147   ROM_LOAD16_BYTE( "13006.rom", 0x000000, 0x20000, CRC(2e9afd2f) SHA1(7fe0929e70e061878065fab2d26309066d14c038) )
r17593r17594
51875187   ROM_LOAD( "epr-12973.a16", 0x80000, 0x20000, CRC(8dc9b9ea) SHA1(048e129874c6ee9f34c5ee1722b8dffa6db8841c) )
51885188   ROM_LOAD( "epr-12985.b16", 0xa0000, 0x20000, CRC(e3f33a8a) SHA1(e7bcc882dcfa926040d0e3e0df54ed924a6b146a) )
51895189
5190   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // sprites
5190   ROM_REGION16_BE( 0x200000, "sprites", 0 ) // sprites
51915191   ROM_LOAD16_BYTE( "epr-12977.b5", 0x000000, 0x20000, CRC(b9eb9762) SHA1(dfcf607b2bc3c742770936a5476335506d778a2d) )
51925192   ROM_LOAD16_BYTE( "epr-12974.b1", 0x000001, 0x20000, CRC(e1da5597) SHA1(55e1e0948896f2afbb3b967847a341ee5afac751) )
51935193   ROM_LOAD16_BYTE( "epr-12978.b6", 0x040000, 0x20000, CRC(014b5442) SHA1(ab6273bd5107c837f33d31ba5e7efce752ee3649) )
r17593r17594
52355235   ROM_LOAD( "opr-11855.b10", 0x10000, 0x10000, CRC(b78762b4) SHA1(d594ef846bd7fed8da91a89906b39c1a2867a1fe) )
52365236   ROM_LOAD( "opr-11856.b11", 0x20000, 0x10000, CRC(ea49f666) SHA1(36ccd32cdcbb7fcc300628bb59c220ec3c324d82) )
52375237
5238   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) // sprites
5238   ROM_REGION16_BE( 0x60000, "sprites", 0 ) // sprites
52395239   ROM_LOAD16_BYTE( "opr-11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
52405240   ROM_LOAD16_BYTE( "opr-11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
52415241   ROM_LOAD16_BYTE( "opr-11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
r17593r17594
52695269   ROM_LOAD( "opr-11855.b10", 0x10000, 0x10000, CRC(b78762b4) SHA1(d594ef846bd7fed8da91a89906b39c1a2867a1fe) )
52705270   ROM_LOAD( "opr-11856.b11", 0x20000, 0x10000, CRC(ea49f666) SHA1(36ccd32cdcbb7fcc300628bb59c220ec3c324d82) )
52715271
5272   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) // sprites
5272   ROM_REGION16_BE( 0x60000, "sprites", 0 ) // sprites
52735273   ROM_LOAD16_BYTE( "opr-11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
52745274   ROM_LOAD16_BYTE( "opr-11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
52755275   ROM_LOAD16_BYTE( "opr-11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
r17593r17594
53105310   ROM_LOAD( "opr-11855.b10", 0x10000, 0x10000, CRC(b78762b4) SHA1(d594ef846bd7fed8da91a89906b39c1a2867a1fe) )
53115311   ROM_LOAD( "opr-11856.b11", 0x20000, 0x10000, CRC(ea49f666) SHA1(36ccd32cdcbb7fcc300628bb59c220ec3c324d82) )
53125312
5313   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) // sprites
5313   ROM_REGION16_BE( 0x60000, "sprites", 0 ) // sprites
53145314   ROM_LOAD16_BYTE( "opr-11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
53155315   ROM_LOAD16_BYTE( "opr-11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
53165316   ROM_LOAD16_BYTE( "opr-11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
r17593r17594
53495349   ROM_LOAD( "epr-14618.bin", 0x80000, 0x20000, CRC(00eb260e) SHA1(f293180fb9a053c98022ef086bf4002563752f61) ) // plane 3
53505350   ROM_LOAD( "epr-14627.bin", 0xa0000, 0x20000, CRC(961e5f82) SHA1(dc88b511dff6cdebf96fe8bf388bf76098296b0f) )
53515351
5352   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) // sprites
5352   ROM_REGION16_BE( 0x1c0000, "sprites", 0 ) // sprites
53535353   ROM_LOAD16_BYTE( "epr-14619.bin",  0x000001, 0x020000, CRC(6f2b5ef7) SHA1(a0186fcc5b12c31b65b84355f88bcb10b1434135) )
53545354   ROM_CONTINUE(                      0x100001, 0x020000 )
53555355   ROM_LOAD16_BYTE( "epr-14622.bin",  0x000000, 0x020000, CRC(7ca7e40d) SHA1(57d26cc1b530cb867b2a4779bb5108ac457b2154) )
r17593r17594
53895389   ROM_LOAD( "opr-13352.a15", 0x20000, 0x20000, CRC(5e5531e4) SHA1(e8e16b35f7985e6cdd77353ca5235db518914744) )
53905390   ROM_LOAD( "opr-13353.a16", 0x40000, 0x20000, CRC(6d23dfd8) SHA1(21266340290b9854cee0b62fc107cc2981519a80) )
53915391
5392   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
5392   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
53935393   ROM_LOAD16_BYTE( "opr-13354.b1", 0x00001, 0x20000, CRC(f07aad99) SHA1(71759525a5b7fe76d112cec93984f0f89cadbc00) )
53945394   ROM_LOAD16_BYTE( "opr-13356.b5", 0x00000, 0x20000, CRC(5498290b) SHA1(b3115b636d8cb6ecac22d5264b7961e3b807cf04) )
53955395   ROM_LOAD16_BYTE( "opr-13355.b2", 0x40001, 0x20000, CRC(67890019) SHA1(165c6a32f305273396ec0e9499e00329caadc484) )
r17593r17594
54225422   ROM_LOAD( "10920.b10", 0x10000, 0x10000, CRC(22b1fb4c) SHA1(f4721796155f13d472d735c646bc52f20f04debd) )
54235423   ROM_LOAD( "10921.b11", 0x20000, 0x10000, CRC(7788f55d) SHA1(435273196a5e812f28a2224807e842ccadff9c10) )
54245424
5425   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) // sprites
5425   ROM_REGION16_BE( 0x60000, "sprites", 0 ) // sprites
54265426   ROM_LOAD16_BYTE( "10760.b1", 0x00001, 0x010000, CRC(70de327b) SHA1(11dde9cefd993f5fb02baf5809fae6c1176a58a1) )
54275427   ROM_LOAD16_BYTE( "10763.b5", 0x00000, 0x010000, CRC(99ec5cb5) SHA1(933a2216a2c772fc82499c739457865b1c75cdb8) )
54285428   ROM_LOAD16_BYTE( "10761.b2", 0x20001, 0x010000, CRC(4e80f80d) SHA1(d168235bdf09317545c999676a4adf015df32366) )
r17593r17594
54575457   ROM_LOAD( "epr-10773.b10", 0x10000, 0x10000, CRC(8f7129a2) SHA1(094a4065597d8d51fb2232546df1de9043fea731) )
54585458   ROM_LOAD( "epr-10774.b11", 0x20000, 0x10000, CRC(4409411f) SHA1(84fd7128e8440d96b0384ae3c391a59bd37ecf9d) )
54595459
5460   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) // sprites
5460   ROM_REGION16_BE( 0x60000, "sprites", 0 ) // sprites
54615461   ROM_LOAD16_BYTE( "10760.b1", 0x00001, 0x010000, CRC(70de327b) SHA1(11dde9cefd993f5fb02baf5809fae6c1176a58a1) )
54625462   ROM_LOAD16_BYTE( "10763.b5", 0x00000, 0x010000, CRC(99ec5cb5) SHA1(933a2216a2c772fc82499c739457865b1c75cdb8) )
54635463   ROM_LOAD16_BYTE( "10761.b2", 0x20001, 0x010000, CRC(4e80f80d) SHA1(d168235bdf09317545c999676a4adf015df32366) )
r17593r17594
54925492   ROM_LOAD( "epr-10773.b10", 0x10000, 0x10000, CRC(8f7129a2) SHA1(094a4065597d8d51fb2232546df1de9043fea731) )
54935493   ROM_LOAD( "epr-10774.b11", 0x20000, 0x10000, CRC(4409411f) SHA1(84fd7128e8440d96b0384ae3c391a59bd37ecf9d) )
54945494
5495   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) // sprites
5495   ROM_REGION16_BE( 0x60000, "sprites", 0 ) // sprites
54965496   ROM_LOAD16_BYTE( "b1.rom",   0x00001, 0x010000, CRC(30e2c50a) SHA1(1fb9e69d4cb97fdcb0f98c2a7ede246aaa4ac382) )
54975497   ROM_LOAD16_BYTE( "b5.rom",   0x00000, 0x010000, CRC(794e3e8b) SHA1(91ca1cb9aabf99adc8426feed4494a992afb8c4a) )
54985498   ROM_LOAD16_BYTE( "b2.rom",   0x20001, 0x010000, CRC(6a8b3fd0) SHA1(a122d3cb0b3263714f026e57d85b0dbf6cb110d7) )
r17593r17594
55225522   ROM_LOAD( "epr-11364.a15", 0x20000, 0x20000, CRC(e63649a4) SHA1(042dded1ff964889571f63d2642b2b21b75f9763) )
55235523   ROM_LOAD( "epr-11365.a16", 0x40000, 0x20000, CRC(1ef55d20) SHA1(314590881a2f18339b7b9c16010e408aa0164e04) )
55245524
5525   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
5525   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
55265526   ROM_LOAD16_BYTE( "epr-11366.b1", 0x00001, 0x20000, CRC(319ede73) SHA1(c48ba4694ff677f30cc1ced3a3ad11c0feb1122d) )
55275527   ROM_LOAD16_BYTE( "epr-11368.b5", 0x00000, 0x20000, CRC(0377d7ce) SHA1(14f9674c142b78bf8b458beccfef93cc3e722c03) )
55285528   ROM_LOAD16_BYTE( "epr-11367.b2", 0x40001, 0x20000, CRC(1d06c5c7) SHA1(3a44f5a2058b96f212930c2e838eda1ce1036818) )
r17593r17594
55505550   ROM_LOAD( "epr-11364.a15", 0x20000, 0x20000, CRC(e63649a4) SHA1(042dded1ff964889571f63d2642b2b21b75f9763) )
55515551   ROM_LOAD( "epr-11365.a16", 0x40000, 0x20000, CRC(1ef55d20) SHA1(314590881a2f18339b7b9c16010e408aa0164e04) )
55525552
5553   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
5553   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
55545554   ROM_LOAD16_BYTE( "epr-11366.b1", 0x00001, 0x20000, CRC(319ede73) SHA1(c48ba4694ff677f30cc1ced3a3ad11c0feb1122d) )
55555555   ROM_LOAD16_BYTE( "epr-11368.b5", 0x00000, 0x20000, CRC(0377d7ce) SHA1(14f9674c142b78bf8b458beccfef93cc3e722c03) )
55565556   ROM_LOAD16_BYTE( "epr-11367.b2", 0x40001, 0x20000, CRC(1d06c5c7) SHA1(3a44f5a2058b96f212930c2e838eda1ce1036818) )
r17593r17594
55835583   ROM_LOAD( "epr-11285.b10", 0x10000, 0x10000, CRC(75f8fbc9) SHA1(29072edcd583af60ec66b4c8bb82b179a3751edf) )
55845584   ROM_LOAD( "epr-11286.b11", 0x20000, 0x10000, CRC(06508bb9) SHA1(57c9036123ec8e35d0275ab6eaff25a16aa203d4) )
55855585
5586   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
5586   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
55875587   ROM_LOAD16_BYTE( "epr-11290.b1", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
55885588   ROM_LOAD16_BYTE( "epr-11294.b5", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
55895589   ROM_LOAD16_BYTE( "epr-11291.b2", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
r17593r17594
56235623   ROM_LOAD( "epr-11285.b10", 0x10000, 0x10000, CRC(75f8fbc9) SHA1(29072edcd583af60ec66b4c8bb82b179a3751edf) )
56245624   ROM_LOAD( "epr-11286.b11", 0x20000, 0x10000, CRC(06508bb9) SHA1(57c9036123ec8e35d0275ab6eaff25a16aa203d4) )
56255625
5626   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
5626   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
56275627   ROM_LOAD16_BYTE( "epr-11290.b1", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
56285628   ROM_LOAD16_BYTE( "epr-11294.b5", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
56295629   ROM_LOAD16_BYTE( "epr-11291.b2", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
r17593r17594
56765676   ROM_LOAD( "opr-11345.b10", 0x10000, 0x10000, CRC(b44c068b) SHA1(05e875dc418aef12fc48d1df44f680249f6952de) )
56775677   ROM_LOAD( "opr-11346.b11", 0x20000, 0x10000, CRC(e5ada66c) SHA1(7e8e34ea909848d0d1b1fcccf628bf9ec169ae9b) )
56785678
5679   ROM_REGION16_BE( 0x80000, "gfx2", ROMREGION_ERASE00 ) // sprites
5679   ROM_REGION16_BE( 0x80000, "sprites", ROMREGION_ERASE00 ) // sprites
56805680   ROM_LOAD16_BYTE( "opr-11350.b1", 0x00001, 0x010000, CRC(525ba1df) SHA1(e35487c8bf4009a767e54258d9a55056d13ba02a) )
56815681   ROM_LOAD16_BYTE( "opr-11354.b5", 0x00000, 0x010000, CRC(793fa3ac) SHA1(14d5a71667b4745d5b556cc15334dd9bff8de93f) )
56825682   ROM_LOAD16_BYTE( "opr-11351.b2", 0x20001, 0x010000, CRC(63b1f1ca) SHA1(1f19a3af099d4a6ad196968b0a3c17a11384e474) )
r17593r17594
57205720   ROM_LOAD( "epr-12226-93.b11", 0x10000, 0x08000, CRC(210e6999) SHA1(5707cc613060b0070a822850b9afab8293f64dd7) )
57215721   //(epr xxxxx - S16a location . S16b location
57225722
5723   ROM_REGION16_BE( 0x80000, "gfx2", ROMREGION_ERASE00 ) // sprites
5723   ROM_REGION16_BE( 0x80000, "sprites", ROMREGION_ERASE00 ) // sprites
57245724   ROM_LOAD16_BYTE( "epr-12232-10.b1", 0x00001, 0x010000, CRC(0adec62b) SHA1(cd798a7994cea73bffe78feac4e692d755074b1d) )
57255725   ROM_LOAD16_BYTE( "epr-12236-11.b5", 0x00000, 0x010000, CRC(286b9af8) SHA1(085251b8ce8b7fadf15b8ebd5872f0337adf142b) )
57265726   ROM_LOAD16_BYTE( "epr-12233-17.b2", 0x20001, 0x010000, CRC(3e45969c) SHA1(804f3714c97877c6f0caf458f8af38e8d8179d73) )
r17593r17594
57675767   ROM_LOAD( "epr-11137.b10", 0x10000, 0x10000, CRC(92d96187) SHA1(45138795992b9842d5b0c86a96b300445bf12060) )
57685768   ROM_LOAD( "epr-11138.b11", 0x20000, 0x10000, CRC(c01dc773) SHA1(b27da906186e1272cdd6f8d5e5a979f6623255ac) )
57695769
5770   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
5770   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
57715771   ROM_LOAD16_BYTE( "epr-11144.b01", 0x00001, 0x10000, CRC(b31de51c) SHA1(011a79a37d32ab4545187e28e61f27aa0601f686) )
57725772   ROM_LOAD16_BYTE( "epr-11148.b05", 0x00000, 0x10000, CRC(126e1309) SHA1(7386ac5ac57325d8f661caf8cab0b19a42c0309d) )
57735773   ROM_LOAD16_BYTE( "epr-11145.b02", 0x20001, 0x10000, CRC(4223d2c3) SHA1(310d5c411eeaf69fe0dc9350e6bfe6dfe950b373) )
r17593r17594
58065806   ROM_LOAD( "epr-12166.b10", 0x10000, 0x10000, CRC(9abd183b) SHA1(621b017cb34973f9227be383e26b5cd41aea9422) )
58075807   ROM_LOAD( "epr-12167.b11", 0x20000, 0x10000, CRC(2495fd4e) SHA1(2db94ead9223a67238a97e724668076fc43e5534) )
58085808
5809   ROM_REGION16_BE( 0x020000, "gfx2", 0 ) // sprites
5809   ROM_REGION16_BE( 0x020000, "sprites", 0 ) // sprites
58105810   ROM_LOAD16_BYTE( "obj0-o.rom", 0x00001, 0x10000, CRC(2fb38880) SHA1(0e1b601bbda78d1887951c1f7e752531c281bc83) )
58115811   ROM_LOAD16_BYTE( "obj0-e.rom", 0x00000, 0x10000, CRC(d6a02cba) SHA1(d80000f92e754e89c6ca7b7273feab448fc9a061) )
58125812
r17593r17594
58455845   ROM_LOAD( "epr-12166.b10", 0x10000, 0x10000, CRC(9abd183b) SHA1(621b017cb34973f9227be383e26b5cd41aea9422) )
58465846   ROM_LOAD( "epr-12167.b11", 0x20000, 0x10000, CRC(2495fd4e) SHA1(2db94ead9223a67238a97e724668076fc43e5534) )
58475847
5848   ROM_REGION16_BE( 0x10000, "gfx2", 0 ) // sprites
5848   ROM_REGION16_BE( 0x10000, "sprites", 0 ) // sprites
58495849   ROM_LOAD16_BYTE( "epr-12169.b1", 0x0001, 0x8000, CRC(dacc6165) SHA1(87b1a7643e3630ff73b2b117752496e1ea5da23d) )
58505850   ROM_LOAD16_BYTE( "epr-12170.b5", 0x0000, 0x8000, CRC(87354e42) SHA1(e7fd55aee59b51d82cb9b619fbb815ad6839560c) )
58515851
r17593r17594
58755875   ROM_LOAD( "epr-10544.b10", 0x08000, 0x8000, CRC(84fb9a3a) SHA1(efde54cc9582f68e58cae05f717a4fc8f620c0fc) )
58765876   ROM_LOAD( "epr-10545.b11", 0x10000, 0x8000, CRC(c8694bc0) SHA1(e48fc349ef454ded86141937f70b006e64da6b6b) )
58775877
5878   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
5878   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
58795879   ROM_LOAD16_BYTE( "epr-10548.b1", 0x00001, 0x8000, CRC(aa150735) SHA1(b6e6ff9229c641e196fc7a0a2cf7aa362f554676) )
58805880   ROM_LOAD16_BYTE( "epr-10552.b5", 0x00000, 0x8000, CRC(6fcbb9f7) SHA1(0a0fab930477d8b79e500263bbc80d3bf73778f8) )
58815881   ROM_LOAD16_BYTE( "epr-10549.b2", 0x20001, 0x8000, CRC(2f59f067) SHA1(1fb64cce2f98ddcb5ecb662e63ea636a8da08bcd) )
r17593r17594
59085908   ROM_LOAD( "epr-17701.b12", 0x40000, 0x40000, CRC(6dfb025b) SHA1(502c16f650596a791fae1834f9bce6f3aa25c45f) )
59095909   ROM_LOAD( "epr-17702.b13", 0x80000, 0x40000, CRC(ae0b7eab) SHA1(403ca2b50913a744e2c5e1cd0d59c69df5464836) )
59105910
5911   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
5911   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
59125912   ROM_LOAD16_BYTE( "epr-17692.b1", 0x00001, 0x20000, CRC(543c4327) SHA1(9f40163aaf165f5e4f5aefd8ce083d5f72ded125) )
59135913   ROM_LOAD16_BYTE( "epr-17695.b4", 0x00000, 0x20000, CRC(ee60f244) SHA1(21b912e12f6a56ea6b9e5e0be117b447d1ecda43) )
59145914   ROM_LOAD16_BYTE( "epr-17693.b2", 0x40001, 0x20000, CRC(4a350b3e) SHA1(70181bf713106475cdf684f86d593ee323ded2ca) )
r17593r17594
59415941   ROM_LOAD( "12269.a15", 0x10000, 0x10000, CRC(457a8790) SHA1(b701e1a1745cefb31083c8a3daa3b23181f89576) )
59425942   ROM_LOAD( "12270.a16", 0x20000, 0x10000, CRC(69fc025b) SHA1(20be1242de27f1b997d43890051cc5d5ac8a127a) )
59435943
5944   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
5944   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
59455945   ROM_LOAD16_BYTE( "12279.b1", 0x00001, 0x10000, CRC(7a169fb1) SHA1(1ec6da0d2cfcf727e61f61c847fd8b975b64f944) )
59465946   ROM_LOAD16_BYTE( "12283.b5", 0x00000, 0x10000, CRC(ae0fa085) SHA1(ae9af92d4dd0c8a0f064d24e647522b588fbd7f7) )
59475947   ROM_LOAD16_BYTE( "12278.b2", 0x40001, 0x10000, CRC(961d06b7) SHA1(b1a9dea63785bfa2c0e7b931387b91dfcd27d79b) )
r17593r17594
59785978   ROM_LOAD( "12269.a15", 0x10000, 0x10000, CRC(457a8790) SHA1(b701e1a1745cefb31083c8a3daa3b23181f89576) )
59795979   ROM_LOAD( "12270.a16", 0x20000, 0x10000, CRC(69fc025b) SHA1(20be1242de27f1b997d43890051cc5d5ac8a127a) )
59805980
5981   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
5981   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
59825982   ROM_LOAD16_BYTE( "12276.b4", 0x00001, 0x10000, CRC(838bd71f) SHA1(82d9d127438f5e1906b1cf40bf3b4727f2ee5685) )
59835983   ROM_LOAD16_BYTE( "12280.b8", 0x00000, 0x10000, CRC(639a57cb) SHA1(84fd8b96758d38f9e1ba1a3c2cf8099ec0452784) )
59845984   ROM_LOAD16_BYTE( "12277.b3", 0x20001, 0x10000, CRC(f16b6ba2) SHA1(00cc04c7b5aad82d51d2d252e1e57bcdc5e2c9e3) )
r17593r17594
60176017   ROM_LOAD( "epr-12125.a15", 0x10000, 0x10000, CRC(9fc36df7) SHA1(b39ccc687489e9781181197505fc78aa5cf7ea55) )
60186018   ROM_LOAD( "epr-12126.a16", 0x20000, 0x10000, CRC(a693fd94) SHA1(38e5446f41b6793a8e4134fdd92b02b86e3589f7) )
60196019
6020   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
6020   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
60216021   ROM_LOAD16_BYTE( "epr-12090.b1", 0x00001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
60226022   ROM_LOAD16_BYTE( "epr-12094.b5", 0x00000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
60236023   ROM_LOAD16_BYTE( "epr-12091.b2", 0x40001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
r17593r17594
60536053   ROM_LOAD( "epr-12125.a15", 0x10000, 0x10000, CRC(9fc36df7) SHA1(b39ccc687489e9781181197505fc78aa5cf7ea55) )
60546054   ROM_LOAD( "epr-12126.a16", 0x20000, 0x10000, CRC(a693fd94) SHA1(38e5446f41b6793a8e4134fdd92b02b86e3589f7) )
60556055
6056   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
6056   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
60576057   ROM_LOAD16_BYTE( "epr-12090.b1", 0x00001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
60586058   ROM_LOAD16_BYTE( "epr-12094.b5", 0x00000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
60596059   ROM_LOAD16_BYTE( "epr-12091.b2", 0x40001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
r17593r17594
60856085   ROM_LOAD( "epr-12125.a15", 0x10000, 0x10000, CRC(9fc36df7) SHA1(b39ccc687489e9781181197505fc78aa5cf7ea55) )
60866086   ROM_LOAD( "epr-12126.a16", 0x20000, 0x10000, CRC(a693fd94) SHA1(38e5446f41b6793a8e4134fdd92b02b86e3589f7) )
60876087
6088   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) // sprites
6088   ROM_REGION16_BE( 0x100000, "sprites", 0 ) // sprites
60896089   ROM_LOAD16_BYTE( "epr-12090.b1", 0x00001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
60906090   ROM_LOAD16_BYTE( "epr-12094.b5", 0x00000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
60916091   ROM_LOAD16_BYTE( "epr-12091.b2", 0x40001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
r17593r17594
61326132   ROM_LOAD( "epr-12125.b10", 0x10000, 0x10000, CRC(9fc36df7) SHA1(b39ccc687489e9781181197505fc78aa5cf7ea55) )
61336133   ROM_LOAD( "epr-12126.b11", 0x20000, 0x10000, CRC(a693fd94) SHA1(38e5446f41b6793a8e4134fdd92b02b86e3589f7) )
61346134
6135   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) // sprites
6135   ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
61366136   ROM_LOAD16_BYTE( "epr-12090.b1", 0x00001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
61376137   ROM_LOAD16_BYTE( "epr-12094.b5", 0x00000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
61386138   ROM_LOAD16_BYTE( "epr-12091.b2", 0x20001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
r17593r17594
61856185   ROM_LOAD( "mpr-12151.a15", 0x20000, 0x20000, CRC(2b1a0751) SHA1(8cb1027ef3728f5bdfdb5e2df0f0421f743cdc0a) )
61866186   ROM_LOAD( "mpr-12152.a16", 0x40000, 0x20000, CRC(f6e190fe) SHA1(4c8b334fb22c449d8d00c8f49f5eccbe008e244f) )
61876187
6188   ROM_REGION16_BE( 0x180000, "gfx2", 0 ) // sprites
6188   ROM_REGION16_BE( 0x180000, "sprites", 0 ) // sprites
61896189   ROM_LOAD16_BYTE( "mpr-12153.b1",  0x000001, 0x20000, CRC(ffa7d368) SHA1(e5663ef1cbe8ab27be0919a3cd78d9a7747bbac6) )
61906190   ROM_LOAD16_BYTE( "mpr-12157.b5",  0x000000, 0x20000, CRC(8d7794c1) SHA1(ace87970cfa02ab8200173622633d0d70ef7aa9e) )
61916191   ROM_LOAD16_BYTE( "mpr-12154.b2",  0x040001, 0x20000, CRC(0ed343f2) SHA1(951bd616e63c5fe0aa3f387c9c12153b4f29675f) )
r17593r17594
62286228   ROM_LOAD( "mpr-12151.a15", 0x20000, 0x20000, CRC(2b1a0751) SHA1(8cb1027ef3728f5bdfdb5e2df0f0421f743cdc0a) )
62296229   ROM_LOAD( "mpr-12152.a16", 0x40000, 0x20000, CRC(f6e190fe) SHA1(4c8b334fb22c449d8d00c8f49f5eccbe008e244f) )
62306230
6231   ROM_REGION16_BE( 0x180000, "gfx2", 0 ) // sprites
6231   ROM_REGION16_BE( 0x180000, "sprites", 0 ) // sprites
62326232   ROM_LOAD16_BYTE( "mpr-12153.b1",  0x000001, 0x20000, CRC(ffa7d368) SHA1(e5663ef1cbe8ab27be0919a3cd78d9a7747bbac6) )
62336233   ROM_LOAD16_BYTE( "mpr-12157.b5",  0x000000, 0x20000, CRC(8d7794c1) SHA1(ace87970cfa02ab8200173622633d0d70ef7aa9e) )
62346234   ROM_LOAD16_BYTE( "mpr-12154.b2",  0x040001, 0x20000, CRC(0ed343f2) SHA1(951bd616e63c5fe0aa3f387c9c12153b4f29675f) )
r17593r17594
62686268   ROM_LOAD( "mpr-12151.a15", 0x20000, 0x20000, CRC(2b1a0751) SHA1(8cb1027ef3728f5bdfdb5e2df0f0421f743cdc0a) )
62696269   ROM_LOAD( "mpr-12152.a16", 0x40000, 0x20000, CRC(f6e190fe) SHA1(4c8b334fb22c449d8d00c8f49f5eccbe008e244f) )
62706270
6271   ROM_REGION16_BE( 0x180000, "gfx2", 0 ) // sprites
6271   ROM_REGION16_BE( 0x180000, "sprites", 0 ) // sprites
62726272   ROM_LOAD16_BYTE( "mpr-12153.b1",  0x000001, 0x20000, CRC(ffa7d368) SHA1(e5663ef1cbe8ab27be0919a3cd78d9a7747bbac6) )
62736273   ROM_LOAD16_BYTE( "mpr-12157.b5",  0x000000, 0x20000, CRC(8d7794c1) SHA1(ace87970cfa02ab8200173622633d0d70ef7aa9e) )
62746274   ROM_LOAD16_BYTE( "mpr-12154.b2",  0x040001, 0x20000, CRC(0ed343f2) SHA1(951bd616e63c5fe0aa3f387c9c12153b4f29675f) )
r17593r17594
63176317   ROM_LOAD( "fz2.a15", 0x20000, 0x20000, CRC(2b933344) SHA1(5b53ea8d58cc3d157aec6926db048359984e4276) )
63186318   ROM_LOAD( "fz2.a16", 0x40000, 0x20000, CRC(e63281a1) SHA1(72379c579484c1ef7784a9598d373446ef0a472b) )
63196319
6320   ROM_REGION16_BE( 0x180000, "gfx2", 0 ) // sprites
6320   ROM_REGION16_BE( 0x180000, "sprites", 0 ) // sprites
63216321   ROM_LOAD16_BYTE( "fz2.b1",  0x000001, 0x20000, CRC(46bba615) SHA1(b291df4a83d7155eb7606f86ed733c24362a4db3) )
63226322   ROM_LOAD16_BYTE( "fz2.b5",  0x000000, 0x20000, CRC(bebeee5d) SHA1(9e57e62c6b9136667aa90d7d423fc33ac6df4352) )
63236323   ROM_LOAD16_BYTE( "fz2.b2",  0x040001, 0x20000, CRC(6681a7b6) SHA1(228df38601ba3895e9449921a64850941715b421) )
r17593r17594
63496349   ROM_LOAD( "tileb.bin", 0x20000, 0x20000, CRC(59e181b7) SHA1(0d57d7b49b85baafa3038dc5b7551fea85f4f5c8) )
63506350   ROM_LOAD( "tilec.bin", 0x40000, 0x20000, CRC(375d354c) SHA1(2af5374777b13cb5aefb7fe90adea0b4d79e9202) )
63516351
6352   ROM_REGION16_BE( 0x140000, "gfx2", 0 ) // sprites
6352   ROM_REGION16_BE( 0x140000, "sprites", 0 ) // sprites
63536353   ROM_LOAD16_BYTE( "obja.bin", 0x000001, 0x20000, CRC(9af87a4d) SHA1(b4f0f40f96c4081803742bc6576c37edff6eab16) )
63546354   ROM_LOAD16_BYTE( "objb.bin", 0x000000, 0x20000, CRC(2fdbca68) SHA1(bc0c96bba9e89f2711267b737ecd4bf2a177edda) )
63556355   ROM_LOAD16_BYTE( "objc.bin", 0x040001, 0x20000, CRC(2587487a) SHA1(eb04c03e918f1d98c36360f2b089018fe25f8dad) )
r17593r17594
63896389   m_custom_io_w = write16_delegate(FUNC(segas16b_state::standard_io_w), this);
63906390
63916391   // point globals to allocated memory regions
6392   segaic16_spriteram_0 = reinterpret_cast<UINT16 *>(memshare("spriteram")->ptr());
6393   segaic16_paletteram = reinterpret_cast<UINT16 *>(memshare("paletteram")->ptr());
63946392   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
63956393   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
63966394
r17593r17594
67536751
67546752   switch (m_data_type & 0x0f)
67556753   {
6756      case 0x0: dest = memregion("gfx2")->base();
6754      case 0x0: dest = memregion("sprites")->base();
67576755         break;
67586756
67596757      case 0x1: dest = memregion("gfx1")->base();
r17593r17594
69706968   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(rom_5704_bank_w)
69716969   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
69726970   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
6973   AM_RANGE(0x440000, 0x4407ff) AM_RAM AM_SHARE("spriteram")
6974   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_SHARE("paletteram")
6971   AM_RANGE(0x440000, 0x4407ff) AM_RAM AM_SHARE("sprites")
6972   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
69756973   AM_RANGE(0xc40000, 0xc43fff) AM_READWRITE(standard_io_r, standard_io_w)
69766974
69776975   AM_RANGE(0xe00000, 0xe00001) AM_WRITE(data_w) // writes decompressed data here (copied from RAM..)
r17593r17594
71097107
71107108   // configure sprite banks
71117109   for (int i = 0; i < 16; i++)
7112      segaic16_sprites_set_bank(machine(), 0, i, i);
7110      m_sprites->set_bank(i, i);
71137111
71147112   membank(ISGSM_MAIN_BANK)->set_base(memregion("bios")->base());
71157113   m_maincpu->reset();
r17593r17594
71207118   // basic machine hardware
71217119
71227120   MCFG_DEVICE_REMOVE("maincpu")
7121   MCFG_DEVICE_REMOVE("mapper")
71237122
71247123   MCFG_CPU_ADD("maincpu", M68000, 16000000) // no obvious CPU, but seems to be clocked faster than an original system16 based on the boot times
71257124   MCFG_CPU_PROGRAM_MAP(isgsm_map)
71267125   MCFG_CPU_VBLANK_INT("screen", irq4_line_hold)
7126   
71277127MACHINE_CONFIG_END
71287128
71297129DRIVER_INIT_MEMBER(isgsm_state,isgsm)
r17593r17594
71737173   ROM_LOAD16_WORD_SWAP("ism2006v00.u1",0x00000,0x20000, CRC(2292585c) SHA1(97ba0e0f0be832a5114d95151e519bc027f6675b) ) \
71747174   ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASE00 ) \
71757175   ROM_REGION( 0x60000, "gfx1", ROMREGION_ERASE00 ) \
7176   ROM_REGION16_BE( 0x200000, "gfx2", ROMREGION_ERASE00 ) \
7176   ROM_REGION16_BE( 0x200000, "sprites", ROMREGION_ERASE00 ) \
71777177   ROM_REGION( 0x40000, "soundcpu", ROMREGION_ERASE00 ) \
71787178
71797179
trunk/src/emu/sprite.c
r0r17594
1/***************************************************************************
2
3    General sprite handling helpers
4
5****************************************************************************
6
7    Copyright Aaron Giles
8    All rights reserved.
9
10    Redistribution and use in source and binary forms, with or without
11    modification, are permitted provided that the following conditions are
12    met:
13
14        * Redistributions of source code must retain the above copyright
15          notice, this list of conditions and the following disclaimer.
16        * Redistributions in binary form must reproduce the above copyright
17          notice, this list of conditions and the following disclaimer in
18          the documentation and/or other materials provided with the
19          distribution.
20        * Neither the name 'MAME' nor the names of its contributors may be
21          used to endorse or promote products derived from this software
22          without specific prior written permission.
23
24    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
25    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
28    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34    POSSIBILITY OF SUCH DAMAGE.
35
36***************************************************************************/
37
38#include "emu.h"
39#include "sprite.h"
40
41
42//-------------------------------------------------
43//  sparse_dirty_bitmap -- constructor
44//-------------------------------------------------
45
46sparse_dirty_bitmap::sparse_dirty_bitmap(int granularity)
47   : m_width(0),
48     m_height(0),
49     m_granularity(granularity),
50     m_rect_list_bounds(0, -1, 0, -1)
51{
52}
53
54sparse_dirty_bitmap::sparse_dirty_bitmap(int width, int height, int granularity)
55   : m_width(0),
56     m_height(0),
57     m_granularity(granularity),
58     m_rect_list_bounds(0, -1, 0, -1)
59{
60   // resize to the specified width/height
61   resize(width, height);
62}
63
64
65//-------------------------------------------------
66//  dirty -- dirty a region
67//-------------------------------------------------
68
69void sparse_dirty_bitmap::dirty(INT32 left, INT32 right, INT32 top, INT32 bottom)
70{
71   // compute a rectangle in dirty space, and fill it with 1
72   rectangle rect(left >> m_granularity, right >> m_granularity, top >> m_granularity, bottom >> m_granularity);
73   m_bitmap.fill(1, rect);
74   
75   // invalidate existing rect list
76   invalidate_rect_list();
77}
78
79
80//-------------------------------------------------
81//  clean a region -- dirty a region
82//-------------------------------------------------
83
84void sparse_dirty_bitmap::clean(INT32 left, INT32 right, INT32 top, INT32 bottom)
85{
86   // if right or bottom intersect the edge of the bitmap, round up
87   int round = (1 << m_granularity) - 1;
88   if (right >= m_width - 1)
89      right = m_width + round;
90   if (bottom >= m_height - 1)
91      bottom = m_height + round;
92
93   // compute a rectangle in dirty space, and fill it with 0
94   rectangle rect((left + round) >> m_granularity, (right - round) >> m_granularity, (top + round) >> m_granularity, (bottom - round) >> m_granularity);
95   m_bitmap.fill(0, rect);
96   
97   // invalidate existing rect list
98   invalidate_rect_list();
99}
100
101
102//-------------------------------------------------
103//  resize -- resize the bitmap
104//-------------------------------------------------
105
106void sparse_dirty_bitmap::resize(int width, int height)
107{
108   // set new size
109   m_width = width;
110   m_height = height;
111   
112   // resize the bitmap
113   int round = (1 << m_granularity) - 1;
114   m_bitmap.resize((width + round) >> m_granularity, (height + round) >> m_granularity);
115   
116   // reset everything
117   dirty_all();
118}
119
120
121//-------------------------------------------------
122//  first_dirty_rect -- return the first dirty
123//   rectangle in the list
124//-------------------------------------------------
125
126sparse_dirty_rect *sparse_dirty_bitmap::first_dirty_rect(const rectangle &cliprect)
127{
128   // if what we have is valid, just return it again
129   if (m_rect_list_bounds == cliprect)
130      return m_rect_list.first();
131   
132   // reclaim the dirty list and start over
133   m_rect_allocator.reclaim_all(m_rect_list);
134   
135   // compute dirty space rectangle coordinates
136   int sx = cliprect.min_x >> m_granularity;
137   int ex = cliprect.max_x >> m_granularity;
138   int sy = cliprect.min_y >> m_granularity;
139   int ey = cliprect.max_y >> m_granularity;
140   int tilesize = 1 << m_granularity;
141
142   // loop over all grid rows that intersect our cliprect
143   for (int y = sy; y <= ey; y++)
144   {
145      UINT8 *dirtybase = &m_bitmap.pix(y);
146      sparse_dirty_rect *currect = NULL;
147
148      // loop over all grid columns that intersect our cliprect
149      for (int x = sx; x <= ex; x++)
150      {
151         // if this tile is not dirty, end our current run and continue
152         if (!*dirtybase++)
153         {
154            if (currect != NULL)
155               *currect &= cliprect;
156            currect = NULL;
157            continue;
158         }
159     
160         // if we can't add to an existing rect, create a new one
161         if (currect == NULL)
162         {
163            // allocate a new rect and add it to the list
164            currect = &m_rect_list.append(*m_rect_allocator.alloc());
165
166            // make a rect describing this grid square
167            currect->min_x = x << m_granularity;
168            currect->max_x = currect->min_x + tilesize - 1;
169            currect->min_y = y << m_granularity;
170            currect->max_y = currect->min_y + tilesize - 1;
171         }
172
173         // if we can add to the previous rect, just expand its width
174         else
175            currect->max_x += tilesize;
176      }
177
178      // clip the last rect to the cliprect
179      if (currect != NULL)
180         *currect &= cliprect;
181   }
182
183   // mark the list as valid
184   m_rect_list_bounds = cliprect;
185   return m_rect_list.first();
186}
trunk/src/emu/sprite.h
r0r17594
1/***************************************************************************
2
3    General sprite handling helpers
4
5****************************************************************************
6
7    Copyright Aaron Giles
8    All rights reserved.
9
10    Redistribution and use in source and binary forms, with or without
11    modification, are permitted provided that the following conditions are
12    met:
13
14        * Redistributions of source code must retain the above copyright
15          notice, this list of conditions and the following disclaimer.
16        * Redistributions in binary form must reproduce the above copyright
17          notice, this list of conditions and the following disclaimer in
18          the documentation and/or other materials provided with the
19          distribution.
20        * Neither the name 'MAME' nor the names of its contributors may be
21          used to endorse or promote products derived from this software
22          without specific prior written permission.
23
24    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
25    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
28    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34    POSSIBILITY OF SUCH DAMAGE.
35
36***************************************************************************/
37
38#pragma once
39
40#ifndef __EMU_H__
41#error Dont include this file directly; include emu.h instead.
42#endif
43
44#ifndef __SPRITE_H__
45#define __SPRITE_H__
46
47
48// ======================> sparse_dirty_rect
49
50// class representing a single dirty region
51class sparse_dirty_rect : public rectangle
52{
53   friend class simple_list<sparse_dirty_rect>;
54
55public:
56   // getters
57   const sparse_dirty_rect *next() const { return m_next; }
58   
59private:
60   // internal state
61   sparse_dirty_rect *   m_next;
62};
63
64
65// ======================> sparse_dirty_bitmap
66
67class sparse_dirty_bitmap
68{
69public:
70   // construction/destruction
71   sparse_dirty_bitmap(int granularity = 3);
72   sparse_dirty_bitmap(int width, int height, int granularity = 3);
73
74   // dirtying operations - partially interecting tiles are dirtied
75   void dirty(const rectangle &rect) { dirty(rect.left(), rect.right(), rect.top(), rect.bottom()); }
76   void dirty(INT32 left, INT32 right, INT32 top, INT32 bottom);
77   void dirty_all() { dirty(0, m_width - 1, 0, m_height - 1); }
78   
79   // cleaning operations - partially intersecting tiles are NOT cleaned
80   void clean(const rectangle &rect) { clean(rect.left(), rect.right(), rect.top(), rect.bottom()); }
81   void clean(INT32 left, INT32 right, INT32 top, INT32 bottom);
82   void clean_all() { clean(0, m_width - 1, 0, m_height - 1); }
83
84   // convert to rect list
85   sparse_dirty_rect *first_dirty_rect() { rectangle fullrect(0, m_width - 1, 0, m_height - 1); return first_dirty_rect(fullrect); }
86   sparse_dirty_rect *first_dirty_rect(const rectangle &cliprect);
87
88   // dynamic resizing   
89   void resize(int width, int height);
90   
91private:
92   // invalidate cached rect list
93   void invalidate_rect_list() { m_rect_list_bounds.set(0, -1, 0, -1); }
94
95   // internal state
96   int                  m_width;
97   int                  m_height;
98   int                  m_granularity;
99   bitmap_ind8            m_bitmap;
100   rectangle            m_rect_list_bounds;
101   fixed_allocator<sparse_dirty_rect>   m_rect_allocator;
102   simple_list<sparse_dirty_rect> m_rect_list;
103};
104
105
106// ======================> sprite_device
107
108template<typename _SpriteRAMType, class _BitmapType>
109class sprite_device : public device_t
110{
111   // constants
112   static const int BITMAP_SLOP = 16;
113
114protected:
115   // construction/destruction - only for subclasses
116   sprite_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, int dirty_granularity = 3)
117      : device_t(mconfig, type, name, tag, owner, 0),
118        m_xorigin(0),
119        m_yorigin(0),
120        m_spriteram(NULL),
121        m_spriteram_bytes(0),
122        m_dirty(dirty_granularity)
123   {
124      force_clear();
125   }
126
127public:
128   // getters
129   INT32 xorigin() const { return m_xorigin; }
130   INT32 yorigin() const { return m_yorigin; }
131   _BitmapType &bitmap() { return m_bitmap; }
132   sparse_dirty_rect *first_dirty_rect() { return m_dirty.first_dirty_rect(); }
133   sparse_dirty_rect *first_dirty_rect(const rectangle &cliprect) { return m_dirty.first_dirty_rect(cliprect); }
134   _SpriteRAMType *spriteram() const { return m_spriteram; }
135   UINT32 spriteram_bytes() const { return m_spriteram_bytes; }
136   UINT32 spriteram_elements() const { return m_spriteram_bytes / sizeof(_SpriteRAMType); }
137   _SpriteRAMType *buffer() { return &m_buffer[0]; }
138   
139   // static configuration
140   static void static_set_xorigin(device_t &device, int origin) { downcast<sprite_device &>(device).m_xorigin = origin; }
141   static void static_set_yorigin(device_t &device, int origin) { downcast<sprite_device &>(device).m_yorigin = origin; }
142   static void static_set_origin(device_t &device, int xorigin, int yorigin) { static_set_xorigin(device, xorigin); static_set_yorigin(device, yorigin); }
143   
144   // configuration
145   void set_origin(INT32 xorigin = 0, INT32 yorigin = 0) { m_xorigin = xorigin; m_yorigin = yorigin; }
146   
147   // buffering
148   void copy_to_buffer() { memcpy(m_buffer, m_spriteram, m_spriteram_bytes); }
149   
150   // clearing
151   void clear() { clear(m_bitmap.cliprect()); }
152   void clear(const rectangle &cliprect)
153   {
154      for (const sparse_dirty_rect *rect = m_dirty.first_dirty_rect(cliprect); rect != NULL; rect = rect->next())
155         m_bitmap.fill(~0, *rect);
156      m_dirty.clean(cliprect);
157   }
158   
159   // force clear (don't use dirty rects)
160   void force_clear()
161   {
162      m_bitmap.fill(~0);
163      m_dirty.clean_all();
164   }
165
166   // drawing
167   void draw_async(const rectangle &cliprect, bool clearit = true)
168   {
169      // if the cliprect exceeds our current bitmap dimensions, expand
170      if (cliprect.right() >= m_bitmap.width() || cliprect.bottom() >= m_bitmap.height())
171      {
172         int new_width = MAX(cliprect.right() + 1, m_bitmap.width());
173         int new_height = MAX(cliprect.bottom() + 1, m_bitmap.height());
174         m_bitmap.resize(new_width, new_height, BITMAP_SLOP, BITMAP_SLOP);
175         m_dirty.resize(new_width, new_height);
176      }
177     
178      // clear out the region
179      if (clearit)
180         clear(cliprect);
181     
182      // wrap the bitmap, adjusting for x/y origins
183      _BitmapType wrapped(&m_bitmap.pix(0) - m_xorigin - m_yorigin * m_bitmap.rowpixels(), m_xorigin + cliprect.right() + 1, m_yorigin + cliprect.bottom() + 1, m_bitmap.rowpixels());
184
185      // compute adjusted cliprect in source space
186      rectangle adjusted = cliprect;
187      adjusted.offset(m_xorigin, m_yorigin);
188     
189      // render
190      draw(wrapped, adjusted);
191   }
192
193protected:
194   // device-level overrides
195   virtual void device_start()
196   {
197      // find spriteram
198      memory_share *spriteram = owner()->memshare(tag());
199      if (spriteram == NULL)
200         throw emu_fatalerror("Unable to find shared spriteram with tag '%s'\n", tag());
201
202      // set up pointers
203      m_spriteram = reinterpret_cast<_SpriteRAMType *>(spriteram->ptr());
204      m_spriteram_bytes = spriteram->bytes();
205     
206      // allocate the double buffer to match the RAM size
207      m_buffer.resize(m_spriteram_bytes / sizeof(_SpriteRAMType));
208
209      // save states
210      save_item(NAME(m_buffer));
211   }
212   
213   // subclass overrides
214   virtual void draw(_BitmapType &bitmap, const rectangle &cliprect) = 0;
215
216   // subclass helpers
217   void mark_dirty(const rectangle &rect) { mark_dirty(rect.left(), rect.right(), rect.top(), rect.bottom()); }
218   void mark_dirty(INT32 left, INT32 right, INT32 top, INT32 bottom) { m_dirty.dirty(left - m_xorigin, right - m_xorigin, top - m_yorigin, bottom - m_yorigin); }
219   
220private:
221   // configuration
222   INT32                     m_xorigin;            // X origin for drawing
223   INT32                     m_yorigin;            // Y origin for drawing
224
225   // memory pointers and buffers
226   _SpriteRAMType *            m_spriteram;         // pointer to spriteram pointer
227   INT32                     m_spriteram_bytes;      // size of sprite RAM in bytes
228   dynamic_array<_SpriteRAMType>   m_buffer;            // buffered spriteram for those that use it
229   
230   // bitmaps
231   _BitmapType                  m_bitmap;            // live bitmap
232   sparse_dirty_bitmap            m_dirty;            // dirty bitmap
233};
234
235typedef sprite_device<UINT8, bitmap_ind16> sprite8_device_ind16;
236typedef sprite_device<UINT16, bitmap_ind16> sprite16_device_ind16;
237typedef sprite_device<UINT32, bitmap_ind16> sprite32_device_ind16;
238
239typedef sprite_device<UINT8, bitmap_ind32> sprite8_device_ind32;
240typedef sprite_device<UINT16, bitmap_ind32> sprite16_device_ind32;
241typedef sprite_device<UINT32, bitmap_ind32> sprite32_device_ind32;
242
243
244#endif   // __SPRITE_H__
trunk/src/emu/emu.mak
r17593r17594
9999   $(EMUOBJ)/softlist.o \
100100   $(EMUOBJ)/sound.o \
101101   $(EMUOBJ)/speaker.o \
102   $(EMUOBJ)/sprite.o \
102103   $(EMUOBJ)/tilemap.o \
103104   $(EMUOBJ)/timer.o \
104105   $(EMUOBJ)/ui.o \
trunk/src/lib/util/bitmap.h
r17593r17594
7676   rectangle() { }
7777   rectangle(INT32 minx, INT32 maxx, INT32 miny, INT32 maxy)
7878      : min_x(minx), max_x(maxx), min_y(miny), max_y(maxy) { }
79   
80   // getters
81   INT32 left() const { return min_x; }
82   INT32 right() const { return max_x; }
83   INT32 top() const { return min_y; }
84   INT32 bottom() const { return max_y; }
7985
8086   // compute intersection with another rect
8187   rectangle &operator&=(const rectangle &src)
r17593r17594
96102      if (src.max_y > max_y) max_y = src.max_y;
97103      return *this;
98104   }
105   
106   // comparisons
107   bool operator==(const rectangle &rhs) const { return min_x == rhs.min_x && max_x == rhs.max_x && min_y == rhs.min_y && max_y == rhs.max_y; }
108   bool operator!=(const rectangle &rhs) const { return min_x != rhs.min_x || max_x != rhs.max_x || min_y != rhs.min_y || max_y != rhs.max_y; }
109   bool operator>(const rectangle &rhs) const { return min_x < rhs.min_x && min_y < rhs.min_y && max_x > rhs.max_x && max_y > rhs.max_y; }
110   bool operator>=(const rectangle &rhs) const { return min_x <= rhs.min_x && min_y <= rhs.min_y && max_x >= rhs.max_x && max_y >= rhs.max_y; }
111   bool operator<(const rectangle &rhs) const { return min_x >= rhs.min_x || min_y >= rhs.min_y || max_x <= rhs.max_x || max_y <= rhs.max_y; }
112   bool operator<=(const rectangle &rhs) const { return min_x > rhs.min_x || min_y > rhs.min_y || max_x < rhs.max_x || max_y < rhs.max_y; }
99113
100114   // other helpers
101115   bool empty() const { return (min_x > max_x || min_y > max_y); }
r17593r17594
114128   void set_height(INT32 height) { max_y = min_y + height - 1; }
115129   void set_origin(INT32 x, INT32 y) { max_x += x - min_x; max_y += y - min_y; min_x = x; min_y = y; }
116130   void set_size(INT32 width, INT32 height) { set_width(width); set_height(height); }
131   
132   // offset helpers
133   void offset(INT32 xdelta, INT32 ydelta) { min_x += xdelta; max_x += xdelta; min_y += ydelta; max_y += ydelta; }
134   void offsetx(INT32 delta) { min_x += delta; max_x += delta; }
135   void offsety(INT32 delta) { min_y += delta; max_y += delta; }
117136
118137   // internal state
119138   INT32         min_x;         // minimum X, or left coordinate

Previous 199869 Revisions Next


© 1997-2024 The MAME Team