Previous 199869 Revisions Next

r24082 Friday 5th July, 2013 at 08:57:38 UTC by David Haywood
reduce AM_RAM_WRITE_LEGACY users
[src/mame/drivers]segahang.c segaorun.c segas16a.c segas16b.c segas18.c segaxbd.c segaybd.c
[src/mame/includes]segahang.h segaorun.h segas16a.h segas16b.h segas18.h segaxbd.h segaybd.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

trunk/src/mame/drivers/segas18.c
r24081r24082
8686         break;
8787
8888      case 5:
89         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segas18_state::legacy_wrapper<segaic16_tileram_0_w>), this));
90         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segas18_state::legacy_wrapper<segaic16_textram_0_w>), this));
89         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segas18_state::sega_tileram_0_w), this));
90         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segas18_state::sega_textram_0_w), this));
9191         break;
9292
9393      case 4:
r24081r24082
166166   m_nvram->set_base(m_workram, m_workram.bytes());
167167
168168   // point globals to allocated memory regions
169   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
170   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
169   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
170   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
171171
172172   // configure VDP
173173   m_vdp->set_use_cram(1);
r24081r24082
205205
206206void segas18_state::machine_reset()
207207{
208   segaic16_tilemap_reset(machine(), 0);
208   m_segaic16vid->segaic16_tilemap_reset(machine(), 0);
209209
210210   m_vdp->device_reset_old();
211211
r24081r24082
297297      // miscellaneous output
298298      case 0x06/2:
299299         set_grayscale(~data & 0x40);
300         segaic16_tilemap_set_flip(machine(), 0, data & 0x20);
300         m_segaic16vid->segaic16_tilemap_set_flip(machine(), 0, data & 0x20);
301301         m_sprites->set_flip(data & 0x20);
302302// These are correct according to cgfm's docs, but mwalker and ddcrew both
303303// enable the lockout and never turn it off
r24081r24082
312312         if (m_romboard == ROM_BOARD_171_5874 || m_romboard == ROM_BOARD_171_SHADOW)
313313            for (int i = 0; i < 4; i++)
314314            {
315               segaic16_tilemap_set_bank(machine(), 0, 0 + i, (data & 0xf) * 4 + i);
316               segaic16_tilemap_set_bank(machine(), 0, 4 + i, ((data >> 4) & 0xf) * 4 + i);
315               m_segaic16vid->segaic16_tilemap_set_bank(machine(), 0, 0 + i, (data & 0xf) * 4 + i);
316               m_segaic16vid->segaic16_tilemap_set_bank(machine(), 0, 4 + i, ((data >> 4) & 0xf) * 4 + i);
317317            }
318318         break;
319319
320320      // CNT register
321321      case 0x1c/2:
322         segaic16_set_display_enable(machine(), data & 2);
322         m_segaic16vid->segaic16_set_display_enable(machine(), data & 2);
323323         if ((old ^ data) & 4)
324324            set_vdp_enable(data & 4);
325325         break;
r24081r24082
404404      int maxbanks = machine().gfx[0]->elements() / 1024;
405405      if (data >= maxbanks)
406406         data %= maxbanks;
407      segaic16_tilemap_set_bank(machine(), 0, offset, data);
407      m_segaic16vid->segaic16_tilemap_set_bank(machine(), 0, offset, data);
408408   }
409409
410410   // sprite banking
r24081r24082
12801280   MCFG_PALETTE_LENGTH(2048*3+2048 + 64*3)
12811281
12821282   MCFG_SEGA_SYS16B_SPRITES_ADD("sprites")
1283   MCFG_SEGAIC16VID_ADD("segaic16vid")
12831284
12841285   // sound hardware
12851286   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mame/drivers/segas16a.c
r24081r24082
232232   m_video_control = data;
233233
234234   // bit 7: screen flip
235   segaic16_tilemap_set_flip(machine(), 0, data & 0x80);
235   m_segaic16vid->segaic16_tilemap_set_flip(machine(), 0, data & 0x80);
236236   m_sprites->set_flip(data & 0x80);
237237
238238   // bit 6: set 8751 interrupt line
r24081r24082
240240      m_mcu->set_input_line(MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
241241
242242   // bit 4: enable display
243   segaic16_set_display_enable(machine(), data & 0x10);
243   m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x10);
244244
245245   // bits 0 & 1: update coin counters
246246   coin_counter_w(machine(), 1, data & 0x02);
r24081r24082
269269   //       1= sound is enabled
270270   //
271271   m_soundcpu->set_input_line(INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
272   segaic16_tilemap_set_colscroll(machine(), 0, ~data & 0x04);
273   segaic16_tilemap_set_rowscroll(machine(), 0, ~data & 0x02);
272   m_segaic16vid->segaic16_tilemap_set_colscroll(machine(), 0, ~data & 0x04);
273   m_segaic16vid->segaic16_tilemap_set_rowscroll(machine(), 0, ~data & 0x02);
274274}
275275
276276
r24081r24082
500500
501501   // enable/disable the display
502502   if (data & 0x40)
503      segaic16_set_display_enable(machine(), 1);
503      m_segaic16vid->segaic16_set_display_enable(machine(), 1);
504504
505505   // apply an extra boost if the main CPU is just waking up
506506   if ((m_mcu_control ^ data) & 0x40)
r24081r24082
760760
761761   // X scroll values
762762   address_space &space = m_maincpu->space(AS_PROGRAM);
763   segaic16_textram_0_w(space, 0xff8/2, m_workram[0x0d14/2], 0xffff);
764   segaic16_textram_0_w(space, 0xffa/2, m_workram[0x0d18/2], 0xffff);
763   m_segaic16vid->segaic16_textram_0_w(space, 0xff8/2, m_workram[0x0d14/2], 0xffff);
764   m_segaic16vid->segaic16_textram_0_w(space, 0xffa/2, m_workram[0x0d18/2], 0xffff);
765765
766766   // page values
767   segaic16_textram_0_w(space, 0xe9e/2, m_workram[0x0d1c/2], 0xffff);
768   segaic16_textram_0_w(space, 0xe9c/2, m_workram[0x0d1e/2], 0xffff);
767   m_segaic16vid->segaic16_textram_0_w(space, 0xe9e/2, m_workram[0x0d1c/2], 0xffff);
768   m_segaic16vid->segaic16_textram_0_w(space, 0xe9c/2, m_workram[0x0d1e/2], 0xffff);
769769}
770770
771771
r24081r24082
997997static ADDRESS_MAP_START( system16a_map, AS_PROGRAM, 16, segas16a_state )
998998   ADDRESS_MAP_UNMAP_HIGH
999999   AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x380000) AM_ROM
1000   AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
1001   AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
1000   AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
1001   AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
10021002   AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_SHARE("sprites")
10031003   AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
10041004   AM_RANGE(0xc40000, 0xc43fff) AM_MIRROR(0x39c000) AM_READWRITE(misc_io_r, misc_io_w)
r24081r24082
19501950   MCFG_SCREEN_UPDATE_DRIVER(segas16a_state, screen_update)
19511951
19521952   MCFG_SEGA_SYS16A_SPRITES_ADD("sprites")
1953   MCFG_SEGAIC16VID_ADD("segaic16vid")
19531954
19541955   MCFG_GFXDECODE(segas16a)
19551956   MCFG_PALETTE_LENGTH(2048*3)
r24081r24082
34033404   m_custom_io_w = write16_delegate(FUNC(segas16a_state::standard_io_w), this);
34043405
34053406   // point globals to allocated memory regions
3406   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
3407   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
3407   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
3408   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
34083409
34093410   // save state
34103411   save_item(NAME(m_video_control));
trunk/src/mame/drivers/segahang.c
r24081r24082
118118   //
119119
120120   // bit 7: screen flip
121   segaic16_tilemap_set_flip(machine(), 0, data & 0x80);
121   m_segaic16vid->segaic16_tilemap_set_flip(machine(), 0, data & 0x80);
122122   m_sprites->set_flip(data & 0x80);
123123
124124   // bit 6: shadow/highlight control
125125   m_shadow = ~data & 0x40;
126126
127127   // bit 4: enable display
128   segaic16_set_display_enable(machine(), data & 0x10);
128   m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x10);
129129
130130   // bits 2 & 3: control the lamps
131131   set_led_status(machine(), 1, data & 0x08);
r24081r24082
161161   m_soundcpu->set_input_line(INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
162162
163163   // bits 1 & 2: tilemap origin
164   segaic16_tilemap_set_colscroll(machine(), 0, ~data & 0x04);
165   segaic16_tilemap_set_rowscroll(machine(), 0, ~data & 0x02);
164   m_segaic16vid->segaic16_tilemap_set_colscroll(machine(), 0, ~data & 0x04);
165   m_segaic16vid->segaic16_tilemap_set_rowscroll(machine(), 0, ~data & 0x02);
166166
167167   // bit 0: sound mute
168168   machine().sound().system_enable(data & 0x01);
r24081r24082
409409void segahang_state::machine_reset()
410410{
411411   // reset misc components
412   segaic16_tilemap_reset(machine(), 0);
412   m_segaic16vid->segaic16_tilemap_reset(machine(), 0);
413413
414414   // queue up a timer to either boost interleave or disable the MCU
415415   synchronize(TID_INIT_I8751);
r24081r24082
472472   ADDRESS_MAP_UNMAP_HIGH
473473   AM_RANGE(0x000000, 0x03ffff) AM_ROM
474474   AM_RANGE(0x20c000, 0x20ffff) AM_RAM AM_SHARE("workram")
475   AM_RANGE(0x400000, 0x403fff) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
476   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
475   AM_RANGE(0x400000, 0x403fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
476   AM_RANGE(0x410000, 0x410fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
477477   AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_SHARE("sprites")
478478   AM_RANGE(0xa00000, 0xa00fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
479479   AM_RANGE(0xc00000, 0xc3ffff) AM_ROM AM_REGION("subcpu", 0)
r24081r24082
486486   ADDRESS_MAP_UNMAP_HIGH
487487   AM_RANGE(0x000000, 0x03ffff) AM_ROM
488488   AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("workram")
489   AM_RANGE(0x100000, 0x107fff) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
490   AM_RANGE(0x108000, 0x108fff) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
489   AM_RANGE(0x100000, 0x107fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
490   AM_RANGE(0x108000, 0x108fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
491491   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
492492   AM_RANGE(0x124000, 0x127fff) AM_RAM AM_SHARE("subram")
493493   AM_RANGE(0x130000, 0x130fff) AM_RAM AM_SHARE("sprites")
r24081r24082
845845   MCFG_I8255_ADD( "i8255_1", hangon_ppi_intf_0 )
846846   MCFG_I8255_ADD( "i8255_2", hangon_ppi_intf_1 )
847847
848   MCFG_SEGAIC16VID_ADD("segaic16vid")
849
848850   // video hardware
849851   MCFG_GFXDECODE(segahang)
850852   MCFG_PALETTE_LENGTH(2048*3)
r24081r24082
18151817DRIVER_INIT_MEMBER(segahang_state,generic)
18161818{
18171819   // point globals to allocated memory regions
1818   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
1819   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
1820   segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
1820   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
1821   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
1822   m_segaic16vid->segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
18211823
18221824   // save states
18231825   save_item(NAME(m_adc_select));
trunk/src/mame/drivers/segaorun.c
r24081r24082
396396   //  D1: (CONT) - affects sprite hardware
397397   //  D0: Sound section reset (1= normal operation, 0= reset)
398398
399   segaic16_set_display_enable(machine(), data & 0x20);
399   m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x20);
400400   m_adc_select = (data >> 2) & 7;
401401   m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
402402}
r24081r24082
417417   switch (index)
418418   {
419419      case 5:
420         mapper.map_as_handler(0x90000, 0x10000, 0xf00000, read16_delegate(FUNC(segaorun_state::legacy_wrapper_r<segaic16_road_control_0_r>), this), write16_delegate(FUNC(segaorun_state::legacy_wrapper<segaic16_road_control_0_w>), this));
420         mapper.map_as_handler(0x90000, 0x10000, 0xf00000, read16_delegate(FUNC(segaorun_state::sega_road_control_0_r), this), write16_delegate(FUNC(segaorun_state::sega_road_control_0_w), this));
421421         mapper.map_as_ram(0x80000, 0x01000, 0xf0f000, "roadram", write16_delegate());
422422         mapper.map_as_ram(0x60000, 0x08000, 0xf18000, "cpu1ram", write16_delegate());
423423         mapper.map_as_ram(0x00000, 0x60000, 0xf00000, "cpu1rom", write16_delegate(FUNC(segaorun_state::nop_w), this));
r24081r24082
436436         break;
437437
438438      case 1:
439         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segaorun_state::legacy_wrapper<segaic16_tileram_0_w>), this));
440         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segaorun_state::legacy_wrapper<segaic16_textram_0_w>), this));
439         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segaorun_state::sega_tileram_0_w), this));
440         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segaorun_state::sega_textram_0_w), this));
441441         break;
442442
443443      case 0:
r24081r24082
543543   // reset misc components
544544   if (m_custom_map != NULL)
545545      m_mapper->configure_explicit(m_custom_map);
546   segaic16_tilemap_reset(machine(), 0);
546   m_segaic16vid->segaic16_tilemap_reset(machine(), 0);
547547
548548   // hook the RESET line, which resets CPU #1
549549   m68k_set_reset_callback(m_maincpu, m68k_reset_callback);
r24081r24082
747747         //  D7-D6: (ADC1-0)
748748         //  D5: Screen display
749749         m_adc_select = (data >> 6) & 3;
750         segaic16_set_display_enable(machine(), (data >> 5) & 1);
750         m_segaic16vid->segaic16_set_display_enable(machine(), (data >> 5) & 1);
751751         return;
752752
753753      case 0x0020/2:
r24081r24082
833833   AM_RANGE(0x000000, 0x05ffff) AM_ROM AM_SHARE("cpu1rom")
834834   AM_RANGE(0x060000, 0x067fff) AM_MIRROR(0x018000) AM_RAM AM_SHARE("cpu1ram")
835835   AM_RANGE(0x080000, 0x080fff) AM_MIRROR(0x00f000) AM_RAM AM_SHARE("roadram")
836   AM_RANGE(0x090000, 0x09ffff) AM_READWRITE_LEGACY(segaic16_road_control_0_r, segaic16_road_control_0_w)
836   AM_RANGE(0x090000, 0x09ffff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_road_control_0_r, segaic16_road_control_0_w)
837837ADDRESS_MAP_END
838838
839839
r24081r24082
10911091   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_25MHz/4, 400, 0, 320, 262, 0, 224)
10921092   MCFG_SCREEN_UPDATE_DRIVER(segaorun_state, screen_update_outrun)
10931093
1094   MCFG_SEGAIC16VID_ADD("segaic16vid")
1095
10941096   // sound hardware
10951097   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
10961098
r24081r24082
21202122      m_nvram->set_base(m_workram, m_workram.bytes());
21212123
21222124   // point globals to allocated memory regions
2123   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
2124   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
2125   segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
2125   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
2126   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
2127   m_segaic16vid->segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
21262128
21272129   // save state
21282130   save_item(NAME(m_adc_select));
trunk/src/mame/drivers/segaxbd.c
r24081r24082
479479         if (((oldval ^ data) & 0x40) && !(data & 0x40))
480480            machine().watchdog_reset();
481481
482         segaic16_set_display_enable(machine(), data & 0x20);
482         m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x20);
483483
484484         m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
485485         if (m_soundcpu2 != NULL)
r24081r24082
670670
671671void segaxbd_state::machine_reset()
672672{
673   segaic16_tilemap_reset(machine(), 0);
673   m_segaic16vid->segaic16_tilemap_reset(machine(), 0);
674674
675675   // hook the RESET line, which resets CPU #1
676676   m68k_set_reset_callback(m_maincpu, &segaxbd_state::m68k_reset_callback);
r24081r24082
907907   AM_RANGE(0x000000, 0x07ffff) AM_ROM
908908   AM_RANGE(0x080000, 0x083fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("backup1")
909909   AM_RANGE(0x0a0000, 0x0a3fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("backup2")
910   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
911   AM_RANGE(0x0d0000, 0x0d0fff) AM_MIRROR(0x00f000) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
910   AM_RANGE(0x0c0000, 0x0cffff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
911   AM_RANGE(0x0d0000, 0x0d0fff) AM_MIRROR(0x00f000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
912912   AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_DEVREADWRITE("multiplier_main", sega_315_5248_multiplier_device, read, write)
913913   AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("divider_main", sega_315_5249_divider_device, read, write)
914914   AM_RANGE(0x0e8000, 0x0e801f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("cmptimer_main", sega_315_5250_compare_timer_device, read, write)
r24081r24082
926926   AM_RANGE(0x2e4000, 0x2e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("divider_subx", sega_315_5249_divider_device, read, write)
927927   AM_RANGE(0x2e8000, 0x2e800f) AM_MIRROR(0x003ff0) AM_DEVREADWRITE("cmptimer_subx", sega_315_5250_compare_timer_device, read, write)
928928   AM_RANGE(0x2ec000, 0x2ecfff) AM_MIRROR(0x001000) AM_RAM AM_SHARE("roadram")
929   AM_RANGE(0x2ee000, 0x2effff) AM_READWRITE_LEGACY(segaic16_road_control_0_r, segaic16_road_control_0_w)
929   AM_RANGE(0x2ee000, 0x2effff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_road_control_0_r, segaic16_road_control_0_w)
930930//  AM_RANGE(0x2f0000, 0x2f3fff) AM_READWRITE(excs_r, excs_w)
931931   AM_RANGE(0x3f8000, 0x3fbfff) AM_RAM AM_SHARE("backup1")
932932   AM_RANGE(0x3fc000, 0x3fffff) AM_RAM AM_SHARE("backup2")
r24081r24082
948948   AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("divider_subx", sega_315_5249_divider_device, read, write)
949949   AM_RANGE(0x0e8000, 0x0e800f) AM_MIRROR(0x003ff0) AM_DEVREADWRITE("cmptimer_subx", sega_315_5250_compare_timer_device, read, write)
950950   AM_RANGE(0x0ec000, 0x0ecfff) AM_MIRROR(0x001000) AM_RAM AM_SHARE("roadram")
951   AM_RANGE(0x0ee000, 0x0effff) AM_READWRITE_LEGACY(segaic16_road_control_0_r, segaic16_road_control_0_w)
951   AM_RANGE(0x0ee000, 0x0effff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_road_control_0_r, segaic16_road_control_0_w)
952952//  AM_RANGE(0x0f0000, 0x0f3fff) AM_READWRITE(excs_r, excs_w)
953953ADDRESS_MAP_END
954954
r24081r24082
15941594   MCFG_SCREEN_UPDATE_DRIVER(segaxbd_state, screen_update)
15951595
15961596   MCFG_SEGA_XBOARD_SPRITES_ADD("sprites")
1597   MCFG_SEGAIC16VID_ADD("segaic16vid")
15971598
15981599   // sound hardware
15991600   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r24081r24082
31983199   m_iochip_custom_io_w[0][3] = iowrite_delegate(FUNC(segaxbd_state::generic_iochip0_lamps_w), this);
31993200
32003201   // point globals to allocated memory regions
3201   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
3202   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
3203   segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
3202   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
3203   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
3204   m_segaic16vid->segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
32043205
32053206   // save state
32063207   save_item(NAME(m_timer_irq_state));
trunk/src/mame/drivers/segas16b.c
r24081r24082
924924//  requests
925925//-------------------------------------------------
926926
927
928
929
930
927931void segas16b_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index)
928932{
929933   switch (index)
r24081r24082
937941         break;
938942
939943      case 5: // 64k of tileram + 4k of textram
940         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segas16b_state::legacy_wrapper<segaic16_tileram_0_w>), this));
941         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segas16b_state::legacy_wrapper<segaic16_textram_0_w>), this));
944         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segas16b_state::sega_tileram_0_w), this));
945         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segas16b_state::sega_textram_0_w), this));
942946         break;
943947
944948      case 4: // 2k of spriteram
r24081r24082
10281032WRITE16_MEMBER( segas16b_state::rom_5704_bank_w )
10291033{
10301034   if (ACCESSING_BITS_0_7)
1031      segaic16_tilemap_set_bank(machine(), 0, offset & 1, data & 7);
1035      m_segaic16vid->segaic16_tilemap_set_bank(machine(), 0, offset & 1, data & 7);
10321036}
10331037
10341038
r24081r24082
10761080
10771081      case 0x2000/2:
10781082         if (ACCESSING_BITS_0_7)
1079            segaic16_tilemap_set_bank(machine(), 0, offset & 1, data & 7);
1083            m_segaic16vid->segaic16_tilemap_set_bank(machine(), 0, offset & 1, data & 7);
10801084         break;
10811085   }
10821086}
r24081r24082
11491153         //  D1 : (Output to coin counter 2?)
11501154         //  D0 : Output to coin counter 1
11511155         //
1152         segaic16_tilemap_set_flip(machine(), 0, data & 0x40);
1156         m_segaic16vid->segaic16_tilemap_set_flip(machine(), 0, data & 0x40);
11531157         m_sprites->set_flip(data & 0x40);
11541158         if (!m_disable_screen_blanking)
1155            segaic16_set_display_enable(machine(), data & 0x20);
1159            m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x20);
11561160         set_led_status(machine(), 1, data & 0x08);
11571161         set_led_status(machine(), 0, data & 0x04);
11581162         coin_counter_w(machine(), 1, data & 0x02);
r24081r24082
13141318   synchronize(TID_INIT_I8751);
13151319
13161320   // reset tilemap state
1317   segaic16_tilemap_reset(machine(), 0);
1321   m_segaic16vid->segaic16_tilemap_reset(machine(), 0);
13181322
13191323   // configure sprite banks
13201324   static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
r24081r24082
33053309   MCFG_SCREEN_UPDATE_DRIVER(segas16b_state, screen_update)
33063310
33073311   MCFG_SEGA_SYS16B_SPRITES_ADD("sprites")
3312   MCFG_SEGAIC16VID_ADD("segaic16vid")
33083313
33093314   // sound hardware
33103315   MCFG_SPEAKER_STANDARD_MONO("mono")
r24081r24082
64346439   m_custom_io_w = write16_delegate(FUNC(segas16b_state::standard_io_w), this);
64356440
64366441   // point globals to allocated memory regions
6437   segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
6438   segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
6442   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
6443   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
64396444
64406445   // save state
64416446   save_item(NAME(m_atomicp_sound_count));
r24081r24082
64626467   // configure special behaviors for the Korean boards
64636468   m_disable_screen_blanking = true;
64646469   m_atomicp_sound_divisor = 1;
6465   segaic16_display_enable = 1;
6470   m_segaic16vid->segaic16_display_enable = 1;
64666471
64676472   // allocate a sound timer
64686473   emu_timer *timer = timer_alloc(TID_ATOMICP_SOUND_IRQ);
r24081r24082
70187023   AM_RANGE(0x000000, 0x0fffff) AM_ROMBANK(ISGSM_MAIN_BANK) AM_REGION("bios", 0) // this area is ALWAYS read-only, even when the game is banked in
70197024   AM_RANGE(0x200000, 0x23ffff) AM_RAM // used during startup for decompression
70207025   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(rom_5704_bank_w)
7021   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_SHARE("tileram")
7022   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_SHARE("textram")
7026   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
7027   AM_RANGE(0x410000, 0x410fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
70237028   AM_RANGE(0x440000, 0x4407ff) AM_RAM AM_SHARE("sprites")
70247029   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
70257030   AM_RANGE(0xc40000, 0xc43fff) AM_READWRITE(standard_io_r, standard_io_w)
r24081r24082
71557160
71567161void isgsm_state::machine_reset()
71577162{
7158   segaic16_tilemap_reset(machine(), 0);
7163   m_segaic16vid->segaic16_tilemap_reset(machine(), 0);
71597164
71607165   // configure sprite banks
71617166   for (int i = 0; i < 16; i++)
trunk/src/mame/drivers/segaybd.c
r24081r24082
204204         //  D2 = YRES
205205         //  D1-D0 = ADC0-1
206206         //
207         segaic16_set_display_enable(machine(), data & 0x80);
207         m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x80);
208208         if (((old ^ data) & 0x20) && !(data & 0x20))
209209            machine().watchdog_reset();
210210         m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
r24081r24082
726726   AM_RANGE(0x180000, 0x1807ff) AM_MIRROR(0x007800) AM_RAM AM_SHARE("rotateram")
727727   AM_RANGE(0x188000, 0x188fff) AM_MIRROR(0x007000) AM_RAM AM_SHARE("bsprites")
728728   AM_RANGE(0x190000, 0x193fff) AM_MIRROR(0x004000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
729   AM_RANGE(0x198000, 0x19ffff) AM_READ_LEGACY(segaic16_rotate_control_0_r)
729   AM_RANGE(0x198000, 0x19ffff) AM_DEVREAD("segaic16vid", segaic16_video_device, segaic16_rotate_control_0_r)
730730   AM_RANGE(0x1f0000, 0x1fffff) AM_RAM
731731ADDRESS_MAP_END
732732
r24081r24082
12181218
12191219   MCFG_SEGA_SYS16B_SPRITES_ADD("bsprites")
12201220   MCFG_SEGA_YBOARD_SPRITES_ADD("ysprites")
1221   MCFG_SEGAIC16VID_ADD("segaic16vid")
12211222
12221223   MCFG_PALETTE_LENGTH(8192*3)
12231224
r24081r24082
21812182   m_scanline_timer = timer_alloc(TID_IRQ2_GEN);
21822183
21832184   // point globals to allocated memory regions
2184   segaic16_rotateram_0 = reinterpret_cast<UINT16 *>(memshare("rotateram")->ptr());
2185   m_segaic16vid->segaic16_rotateram_0 = reinterpret_cast<UINT16 *>(memshare("rotateram")->ptr());
21852186
21862187   // save state
21872188   save_item(NAME(m_pdrift_bank));
trunk/src/mame/video/sega16sp.h
r24081r24082
3838#pragma once
3939
4040#include "sprite.h"
41#include "segaic16.h"
4142
42
4343#ifndef __SEGA16SP_H__
4444#define __SEGA16SP_H__
4545
r24081r24082
221221public:
222222   // construction/destruction
223223   sega_yboard_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
224   void set_rotate_ptr(rotate_info* segaic16_rotate) { m_segaic16_rotate = segaic16_rotate; }
224225
225226protected:
226227   // subclass overrides
227228   virtual void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
229
230   rotate_info*                  m_segaic16_rotate;
228231};
232 
229233
230
231234// device type definition
232235extern const device_type SEGA_HANGON_SPRITES;
233236extern const device_type SEGA_SHARRIER_SPRITES;
trunk/src/mame/video/segas16a.c
r24081r24082
4747void segas16a_state::video_start()
4848{
4949   // initialize the tile/text layers
50   segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16A, 0x000, 0, 1);
50   m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16A, 0x000, 0, 1);
5151}
5252
5353
r24081r24082
5858UINT32 segas16a_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5959{
6060   // if no drawing is happening, fill with black and get out
61   if (!segaic16_display_enable)
61   if (!m_segaic16vid->segaic16_display_enable)
6262   {
6363      bitmap.fill(get_black_pen(machine()), cliprect);
6464      return 0;
r24081r24082
7171   machine().priority_bitmap.fill(0, cliprect);
7272
7373   // draw background opaquely first, not setting any priorities
74   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
75   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
74   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
75   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
7676
7777   // draw background again, just to set the priorities on non-transparent pixels
7878   bitmap_ind16 dummy_bitmap;
79   segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
80   segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
79   m_segaic16vid->segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
80   m_segaic16vid->segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
8181
8282   // draw foreground
83   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
84   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
83   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
84   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
8585
8686   // text layer
87   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
88   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
87   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
88   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
8989
9090   // mix in sprites
9191   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segahang.c
r24081r24082
4747void segahang_state::video_start()
4848{
4949   // initialize the tile/text layers
50   segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_HANGON, 0x000, 0, 2);
50   m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_HANGON, 0x000, 0, 2);
5151
5252   // initialize the road
53   segaic16_road_init(machine(), 0, m_sharrier_video ? SEGAIC16_ROAD_SHARRIER : SEGAIC16_ROAD_HANGON, 0x038, 0x7c0, 0x7c0, 0);
53   m_segaic16vid->segaic16_road_init(machine(), 0, m_sharrier_video ? SEGAIC16_ROAD_SHARRIER : SEGAIC16_ROAD_HANGON, 0x038, 0x7c0, 0x7c0, 0);
5454}
5555
5656
r24081r24082
6161UINT32 segahang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6262{
6363   // if no drawing is happening, fill with black and get out
64   if (!segaic16_display_enable)
64   if (!m_segaic16vid->segaic16_display_enable)
6565   {
6666      bitmap.fill(get_black_pen(machine()), cliprect);
6767      return 0;
r24081r24082
7474   machine().priority_bitmap.fill(0, cliprect);
7575
7676   // draw the low priority road layer
77   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
77   m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
7878
7979   // draw background
80   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
81   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
80   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
81   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
8282
8383   // draw foreground
84   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
85   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
84   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
85   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
8686
8787   // draw the high priority road
88   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
88   m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
8989
9090   // text layer
9191   // note that we inflate the priority of the text layer to prevent sprites
9292   // from drawing over the high scores
93   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
94   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
93   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
94   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
9595
9696   // mix in sprites
9797   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segas16b.c
r24081r24082
4747void segas16b_state::video_start()
4848{
4949   // initialize the tile/text layers
50   segaic16_tilemap_init(machine(), 0, m_tilemap_type, 0x000, 0, 2);
50   m_segaic16vid->segaic16_tilemap_init(machine(), 0, m_tilemap_type, 0x000, 0, 2);
5151}
5252
5353
r24081r24082
5858UINT32 segas16b_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5959{
6060   // if no drawing is happening, fill with black and get out
61   if (!segaic16_display_enable)
61   if (!m_segaic16vid->segaic16_display_enable)
6262   {
6363      bitmap.fill(get_black_pen(machine()), cliprect);
6464      return 0;
r24081r24082
7171   machine().priority_bitmap.fill(0, cliprect);
7272
7373   // draw background opaquely first, not setting any priorities
74   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
75   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
74   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
75   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
7676
7777   // draw background again, just to set the priorities on non-transparent pixels
7878   bitmap_ind16 dummy_bitmap;
79   segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
80   segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
79   m_segaic16vid->segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
80   m_segaic16vid->segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
8181
8282   // draw foreground
83   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
84   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
83   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
84   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
8585
8686   // text layer
87   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
88   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
87   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
88   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
8989
9090   // mix in sprites
9191   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segas18.c
r24081r24082
6363   m_vdp_mixing = 0;
6464
6565   // initialize the tile/text layers
66   segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 8);
66   m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 8);
6767
6868   save_item(NAME(m_grayscale_enable));
6969   save_item(NAME(m_vdp_enable));
r24081r24082
216216#endif
217217
218218   // if no drawing is happening, fill with black and get out
219   if (!segaic16_display_enable)
219   if (!m_segaic16vid->segaic16_display_enable)
220220   {
221221      bitmap.fill(get_black_pen(machine()), cliprect);
222222      return 0;
r24081r24082
229229   machine().priority_bitmap.fill(0, cliprect);
230230
231231   // draw background opaquely first, not setting any priorities
232   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
233   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
232   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
233   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
234234   if (m_vdp_enable && vdplayer == 0) draw_vdp(screen, bitmap, cliprect, vdppri);
235235
236236   // draw background again to draw non-transparent pixels over the VDP and set the priority
237   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
238   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
237   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
238   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
239239   if (m_vdp_enable && vdplayer == 1) draw_vdp(screen, bitmap, cliprect, vdppri);
240240
241241   // draw foreground
242   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
243   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
242   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
243   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
244244   if (m_vdp_enable && vdplayer == 2) draw_vdp(screen, bitmap, cliprect, vdppri);
245245
246246   // text layer
247   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
248   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
247   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
248   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
249249   if (m_vdp_enable && vdplayer == 3) draw_vdp(screen, bitmap, cliprect, vdppri);
250250
251251   // mix in sprites
trunk/src/mame/video/segaxbd.c
r24081r24082
4646void segaxbd_state::video_start()
4747{
4848   // initialize the tile/text layers
49   segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x1c00, 0, 2);
49   m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x1c00, 0, 2);
5050
5151   // initialize the road
52   segaic16_road_init(machine(), 0, SEGAIC16_ROAD_XBOARD, 0x1700, 0x1720, 0x1780, -166);
52   m_segaic16vid->segaic16_road_init(machine(), 0, SEGAIC16_ROAD_XBOARD, 0x1700, 0x1720, 0x1780, -166);
5353}
5454
5555
r24081r24082
6161UINT32 segaxbd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6262{
6363   // if no drawing is happening, fill with black and get out
64   if (!segaic16_display_enable)
64   if (!m_segaic16vid->segaic16_display_enable)
6565   {
6666      bitmap.fill(get_black_pen(machine()), cliprect);
6767      return 0;
r24081r24082
7474   machine().priority_bitmap.fill(0, cliprect);
7575
7676   // draw the low priority road layer
77   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
77   m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
7878   if (m_road_priority == 0)
79      segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
79      m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
8080
8181   // draw background
82   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
83   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
82   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
83   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
8484
8585   // draw foreground
86   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
87   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
86   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
87   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
8888
8989   // draw the high priority road
9090   if (m_road_priority == 1)
91      segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
91      m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
9292
9393   // text layer
94   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
95   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
94   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
95   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
9696
9797   // mix in sprites
9898   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segaybd.c
r24081r24082
4646void segaybd_state::video_start()
4747{
4848   // initialize the rotation layer
49   segaic16_rotate_init(machine(), 0, SEGAIC16_ROTATE_YBOARD, 0x000);
49   m_segaic16vid->segaic16_rotate_init(machine(), 0, SEGAIC16_ROTATE_YBOARD, 0x000);
50   m_ysprites->set_rotate_ptr(m_segaic16vid->segaic16_rotate);
5051}
5152
5253
r24081r24082
5859UINT32 segaybd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5960{
6061   // if no drawing is happening, fill with black and get out
61   if (!segaic16_display_enable)
62   if (!m_segaic16vid->segaic16_display_enable)
6263   {
6364      bitmap.fill(get_black_pen(machine()), cliprect);
6465      return 0;
r24081r24082
7172   m_bsprites->draw_async(cliprect);
7273
7374   // apply rotation
74   segaic16_rotate_draw(machine(), 0, bitmap, cliprect, m_ysprites->bitmap());
75   m_segaic16vid->segaic16_rotate_draw(machine(), 0, bitmap, cliprect, m_ysprites->bitmap());
7576
7677   // mix in 16B sprites
7778   bitmap_ind16 &sprites = m_bsprites->bitmap();
trunk/src/mame/video/segaorun.c
r24081r24082
4949   if (m_shangon_video)
5050   {
5151      // initialize the tile/text layers
52      segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B_ALT, 0x000, 0, 2);
52      m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B_ALT, 0x000, 0, 2);
5353
5454      // initialize the road
55      segaic16_road_init(machine(), 0, SEGAIC16_ROAD_OUTRUN, 0x7f6, 0x7c0, 0x7c0, 0);
55      m_segaic16vid->segaic16_road_init(machine(), 0, SEGAIC16_ROAD_OUTRUN, 0x7f6, 0x7c0, 0x7c0, 0);
5656   }
5757   else
5858   {
5959      // initialize the tile/text layers
60      segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 2);
60      m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 2);
6161
6262      // initialize the road
63      segaic16_road_init(machine(), 0, SEGAIC16_ROAD_OUTRUN, 0x400, 0x420, 0x780, 0);
63      m_segaic16vid->segaic16_road_init(machine(), 0, SEGAIC16_ROAD_OUTRUN, 0x400, 0x420, 0x780, 0);
6464   }
6565}
6666
r24081r24082
7979   machine().priority_bitmap.fill(0, cliprect);
8080
8181   // draw the low priority road layer
82   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
82   m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
8383
8484   // draw background
85   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
86   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
85   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
86   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
8787
8888   // draw foreground
89   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
90   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
89   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
90   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
9191
9292   // draw the high priority road
93   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
93   m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
9494
9595   // text layer
9696   // note that we inflate the priority of the text layer to prevent sprites
9797   // from drawing over the high scores
98   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
99   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
98   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
99   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
100100
101101   // mix in sprites
102102   bitmap_ind16 &sprites = m_sprites->bitmap();
r24081r24082
135135UINT32 segaorun_state::screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
136136{
137137   // if no drawing is happening, fill with black and get out
138   if (!segaic16_display_enable)
138   if (!m_segaic16vid->segaic16_display_enable)
139139   {
140140      bitmap.fill(get_black_pen(machine()), cliprect);
141141      return 0;
r24081r24082
148148   machine().priority_bitmap.fill(0, cliprect);
149149
150150   // draw the low priority road layer
151   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
151   m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
152152
153153   // draw background
154   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
155   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
154   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
155   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
156156
157157   // draw foreground
158   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
159   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
158   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
159   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
160160
161161   // draw the high priority road
162   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
162   m_segaic16vid->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
163163
164164   // text layer
165   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
166   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
165   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
166   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
167167
168168   // mix in sprites
169169   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segaic16.c
r24081r24082
369369
370370
371371
372/*************************************
373 *
374 *  Globals
375 *
376 *************************************/
372const device_type SEGAIC16VID = &device_creator<segaic16_video_device>;
377373
378UINT8 segaic16_display_enable;
379UINT16 *segaic16_tileram_0;
380UINT16 *segaic16_textram_0;
381UINT16 *segaic16_roadram_0;
382UINT16 *segaic16_rotateram_0;
374segaic16_video_device::segaic16_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
375   : device_t(mconfig, SEGAIC16VID, "Sega 16-bit Video", tag, owner, clock, "segaic16_video", __FILE__)
376{
377}
383378
384struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE];
385struct road_info segaic16_road[SEGAIC16_MAX_ROADS];
386379
380void segaic16_video_device::device_config_complete()
381{
387382
383}
388384
389/*************************************
390 *
391 *  Statics
392 *
393 *************************************/
385void segaic16_video_device::device_start()
386{
394387
395static struct tilemap_info bg_tilemap[SEGAIC16_MAX_TILEMAPS];
388}
396389
390void segaic16_video_device::device_reset()
391{
397392
393}
398394
395
396
397
398
399
400
401
402
403
399404/*************************************
400405 *
401406 *  Misc functions
402407 *
403408 *************************************/
404409
405void segaic16_set_display_enable(running_machine &machine, int enable)
410void segaic16_video_device::segaic16_set_display_enable(running_machine &machine, int enable)
406411{
407412   enable = (enable != 0);
408413   if (segaic16_display_enable != enable)
r24081r24082
421426 *
422427 *************************************/
423428
424static void segaic16_draw_virtual_tilemap(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority)
429void segaic16_draw_virtual_tilemap(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority)
425430{
426431   int leftmin = -1, leftmax = -1, rightmin = -1, rightmax = -1;
427432   int topmin = -1, topmax = -1, bottommin = -1, bottommax = -1;
r24081r24082
623628 *
624629 *******************************************************************************************/
625630
626static TILE_GET_INFO( segaic16_tilemap_16a_tile_info )
631TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16a_tile_info )
627632{
628633   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
629634   UINT16 data = info->rambase[tile_index];
630635   int code = ((data >> 1) & 0x1000) | (data & 0xfff);
631636   int color = (data >> 5) & 0x7f;
632637
633   SET_TILE_INFO(0, code, color, 0);
638   SET_TILE_INFO_MEMBER(0, code, color, 0);
634639   tileinfo.category = (data >> 12) & 1;
635640}
636641
637642
638static TILE_GET_INFO( segaic16_tilemap_16a_text_info )
643TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16a_text_info )
639644{
640645   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
641646   UINT16 data = info->rambase[tile_index];
642647   int color = (data >> 8) & 0x07;
643648   int code = data & 0xff;
644649
645   SET_TILE_INFO(0, code, color, 0);
650   SET_TILE_INFO_MEMBER(0, code, color, 0);
646651   tileinfo.category = (data >> 11) & 1;
647652}
648653
649654
650static void segaic16_tilemap_16a_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority)
655void segaic16_tilemap_16a_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority)
651656{
652657   UINT16 *textram = info->textram;
653658
r24081r24082
835840 *
836841 *******************************************************************************************/
837842
838static TILE_GET_INFO( segaic16_tilemap_16b_tile_info )
843TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_tile_info )
839844{
840845   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
841846   UINT16 data = info->rambase[tile_index];
r24081r24082
844849
845850   code = info->bank[code / info->banksize] * info->banksize + code % info->banksize;
846851
847   SET_TILE_INFO(0, code, color, 0);
852   SET_TILE_INFO_MEMBER(0, code, color, 0);
848853   tileinfo.category = (data >> 15) & 1;
849854}
850855
851856
852static TILE_GET_INFO( segaic16_tilemap_16b_text_info )
857TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_text_info )
853858{
854859   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
855860   UINT16 data = info->rambase[tile_index];
r24081r24082
857862   int color = (data >> 9) & 0x07;
858863   int code = data & 0x1ff;
859864
860   SET_TILE_INFO(0, bank * info->banksize + code, color, 0);
865   SET_TILE_INFO_MEMBER(0, bank * info->banksize + code, color, 0);
861866   tileinfo.category = (data >> 15) & 1;
862867}
863868
864869
865static TILE_GET_INFO( segaic16_tilemap_16b_alt_tile_info )
870TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_alt_tile_info )
866871{
867872   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
868873   UINT16 data = info->rambase[tile_index];
r24081r24082
871876
872877   code = info->bank[code / info->banksize] * info->banksize + code % info->banksize;
873878
874   SET_TILE_INFO(0, code, color, 0);
879   SET_TILE_INFO_MEMBER(0, code, color, 0);
875880   tileinfo.category = (data >> 15) & 1;
876881}
877882
878883
879static TILE_GET_INFO( segaic16_tilemap_16b_alt_text_info )
884TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_alt_text_info )
880885{
881886   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
882887   UINT16 data = info->rambase[tile_index];
r24081r24082
884889   int color = (data >> 8) & 0x07;
885890   int code = data & 0xff;
886891
887   SET_TILE_INFO(0, bank * info->banksize + code, color, 0);
892   SET_TILE_INFO_MEMBER(0, bank * info->banksize + code, color, 0);
888893   tileinfo.category = (data >> 15) & 1;
889894}
890895
891896
892static void segaic16_tilemap_16b_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority)
897void segaic16_tilemap_16b_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority)
893898{
894899   UINT16 *textram = info->textram;
895900   UINT16 xscroll, yscroll, pages;
r24081r24082
983988}
984989
985990
986static TIMER_CALLBACK( segaic16_tilemap_16b_latch_values )
991TIMER_CALLBACK_MEMBER( segaic16_video_device::segaic16_tilemap_16b_latch_values )
987992{
988993   struct tilemap_info *info = &bg_tilemap[param];
989994   UINT16 *textram = info->textram;
r24081r24082
9981003   }
9991004
10001005   /* set a timer to do this again next frame */
1001   info->latch_timer->adjust(machine.primary_screen->time_until_pos(261), param);
1006   info->latch_timer->adjust(machine().primary_screen->time_until_pos(261), param);
10021007}
10031008
10041009
1005static void segaic16_tilemap_16b_reset(running_machine &machine, struct tilemap_info *info)
1010void segaic16_tilemap_16b_reset(running_machine &machine, struct tilemap_info *info)
10061011{
10071012   /* set a timer to latch values on scanline 261 */
10081013   info->latch_timer->adjust(machine.primary_screen->time_until_pos(261), info->index);
r24081r24082
10161021 *
10171022 *************************************/
10181023
1019void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks)
1024void segaic16_video_device::segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks)
10201025{
10211026   struct tilemap_info *info = &bg_tilemap[which];
1022   tile_get_info_func get_text_info;
1023   tile_get_info_func get_tile_info;
1027   tilemap_get_info_delegate get_text_info;
1028   tilemap_get_info_delegate get_tile_info;
10241029   int pagenum;
10251030   int i;
10261031
r24081r24082
10491054   switch (type)
10501055   {
10511056      case SEGAIC16_TILEMAP_HANGON:
1052         get_text_info = segaic16_tilemap_16a_text_info;
1053         get_tile_info = segaic16_tilemap_16a_tile_info;
1057         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16a_text_info),this);
1058         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16a_tile_info),this);
10541059         info->numpages = 4;
10551060         info->draw_layer = segaic16_tilemap_16a_draw_layer;
10561061         info->reset = NULL;
r24081r24082
10581063         break;
10591064
10601065      case SEGAIC16_TILEMAP_16A:
1061         get_text_info = segaic16_tilemap_16a_text_info;
1062         get_tile_info = segaic16_tilemap_16a_tile_info;
1066         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16a_text_info),this);
1067         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16a_tile_info),this);
10631068         info->numpages = 8;
10641069         info->draw_layer = segaic16_tilemap_16a_draw_layer;
10651070         info->reset = NULL;
r24081r24082
10671072         break;
10681073
10691074      case SEGAIC16_TILEMAP_16B:
1070         get_text_info = segaic16_tilemap_16b_text_info;
1071         get_tile_info = segaic16_tilemap_16b_tile_info;
1075         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_text_info),this);
1076         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_tile_info),this);
10721077         info->numpages = 16;
10731078         info->draw_layer = segaic16_tilemap_16b_draw_layer;
10741079         info->reset = segaic16_tilemap_16b_reset;
1075         info->latch_timer = machine.scheduler().timer_alloc(FUNC(segaic16_tilemap_16b_latch_values));
1080         info->latch_timer = machine.scheduler().timer_alloc( timer_expired_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_latch_values),this) );
10761081         break;
10771082
10781083      case SEGAIC16_TILEMAP_16B_ALT:
1079         get_text_info = segaic16_tilemap_16b_alt_text_info;
1080         get_tile_info = segaic16_tilemap_16b_alt_tile_info;
1084         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_alt_text_info),this);
1085         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_alt_tile_info),this);
10811086         info->numpages = 16;
10821087         info->draw_layer = segaic16_tilemap_16b_draw_layer;
10831088         info->reset = segaic16_tilemap_16b_reset;
1084         info->latch_timer = machine.scheduler().timer_alloc(FUNC(segaic16_tilemap_16b_latch_values));
1089         info->latch_timer = machine.scheduler().timer_alloc( timer_expired_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_latch_values),this) );
10851090         break;
10861091
10871092      default:
r24081r24082
10891094   }
10901095
10911096   /* create the tilemap for the text layer */
1092   info->textmap = tilemap_create(machine, get_text_info, TILEMAP_SCAN_ROWS,  8,8, 64,28);
1097   info->textmap = &machine.tilemap().create(get_text_info, TILEMAP_SCAN_ROWS,  8,8, 64,28);
10931098
10941099   /* configure it */
10951100   info->textmap_info.rambase = info->textram;
r24081r24082
11051110   for (pagenum = 0; pagenum < info->numpages; pagenum++)
11061111   {
11071112      /* each page is 64x32 */
1108      info->tilemaps[pagenum] = tilemap_create(machine, get_tile_info, TILEMAP_SCAN_ROWS,  8,8, 64,32);
1113      info->tilemaps[pagenum] = &machine.tilemap().create(get_tile_info, TILEMAP_SCAN_ROWS,  8,8, 64,32);
11091114
11101115      /* configure the tilemap */
11111116      info->tmap_info[pagenum].rambase = info->tileram + pagenum * 64*32;
r24081r24082
11271132 *
11281133 *************************************/
11291134
1130void segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark)
1135void segaic16_video_device::segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark)
11311136{
11321137   running_machine &machine = screen.machine();
11331138   struct tilemap_info *info = &bg_tilemap[which];
r24081r24082
11491154 *
11501155 *************************************/
11511156
1152void segaic16_tilemap_reset(running_machine &machine, int which)
1157void segaic16_video_device::segaic16_tilemap_reset(running_machine &machine, int which)
11531158{
11541159   struct tilemap_info *info = &bg_tilemap[which];
11551160
r24081r24082
11651170 *
11661171 *************************************/
11671172
1168void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset)
1173void segaic16_video_device::segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset)
11691174{
11701175   struct tilemap_info *info = &bg_tilemap[which];
11711176
r24081r24082
11861191 *
11871192 *************************************/
11881193
1189void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip)
1194void segaic16_video_device::segaic16_tilemap_set_flip(running_machine &machine, int which, int flip)
11901195{
11911196   struct tilemap_info *info = &bg_tilemap[which];
11921197   int pagenum;
r24081r24082
12111216 *
12121217 *************************************/
12131218
1214void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable)
1219void segaic16_video_device::segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable)
12151220{
12161221   struct tilemap_info *info = &bg_tilemap[which];
12171222
r24081r24082
12321237 *
12331238 *************************************/
12341239
1235void segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable)
1240void segaic16_video_device::segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable)
12361241{
12371242   struct tilemap_info *info = &bg_tilemap[which];
12381243
r24081r24082
12531258 *
12541259 *************************************/
12551260
1256WRITE16_HANDLER( segaic16_tileram_0_w )
1261READ16_MEMBER( segaic16_video_device::segaic16_tileram_0_r )
12571262{
1263   return segaic16_tileram_0[offset];
1264}
1265
1266
1267WRITE16_MEMBER( segaic16_video_device::segaic16_tileram_0_w )
1268{
12581269   COMBINE_DATA(&segaic16_tileram_0[offset]);
12591270   bg_tilemap[0].tilemaps[offset / (64*32)]->mark_tile_dirty(offset % (64*32));
12601271}
12611272
12621273
1263WRITE16_HANDLER( segaic16_textram_0_w )
1274READ16_MEMBER( segaic16_video_device::segaic16_textram_0_r )
12641275{
1276   return segaic16_textram_0[offset];
1277}
1278
1279
1280WRITE16_MEMBER( segaic16_video_device::segaic16_textram_0_w )
1281{
12651282   /* certain ranges need immediate updates */
12661283   if (offset >= 0xe80/2)
12671284      space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
r24081r24082
17771794 *
17781795 *************************************/
17791796
1780void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs)
1797void segaic16_video_device::segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs)
17811798{
17821799   struct road_info *info = &segaic16_road[which];
17831800
r24081r24082
18301847 *
18311848 *************************************/
18321849
1833void segaic16_road_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority)
1850void segaic16_video_device::segaic16_road_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority)
18341851{
18351852   struct road_info *info = &segaic16_road[which];
18361853   (*info->draw)(info, bitmap, cliprect, priority);
r24081r24082
18441861 *
18451862 *************************************/
18461863
1847READ16_HANDLER( segaic16_road_control_0_r )
1864READ16_MEMBER( segaic16_video_device::segaic16_road_control_0_r )
18481865{
18491866   struct road_info *info = &segaic16_road[0];
18501867
r24081r24082
18671884}
18681885
18691886
1870WRITE16_HANDLER( segaic16_road_control_0_w )
1887WRITE16_MEMBER( segaic16_video_device::segaic16_road_control_0_w )
18711888{
18721889   struct road_info *info = &segaic16_road[0];
18731890
r24081r24082
18851902 *
18861903 *************************************/
18871904
1888void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase)
1905void segaic16_video_device::segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase)
18891906{
18901907   struct rotate_info *info = &segaic16_rotate[which];
18911908
r24081r24082
19321949 *
19331950 *************************************/
19341951
1935void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap)
1952void segaic16_video_device::segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap)
19361953{
19371954   struct rotate_info *info = &segaic16_rotate[which];
19381955   INT32 currx = (info->buffer[0x3f0] << 16) | info->buffer[0x3f1];
r24081r24082
19952012 *
19962013 *************************************/
19972014
1998READ16_HANDLER( segaic16_rotate_control_0_r )
2015READ16_MEMBER( segaic16_video_device::segaic16_rotate_control_0_r )
19992016{
20002017   struct rotate_info *info = &segaic16_rotate[0];
20012018
trunk/src/mame/video/segaic16.h
r24081r24082
44
55***************************************************************************/
66
7#pragma once
8#ifndef __SEGAIC16VID_H__
9#define __SEGAIC16VID_H__
10
11
712#include "devcb.h"
813
9/* globals */
10extern UINT8 segaic16_display_enable;
11extern UINT16 *segaic16_tileram_0;
12extern UINT16 *segaic16_textram_0;
13extern UINT16 *segaic16_roadram_0;
14extern UINT16 *segaic16_rotateram_0;
1514
16/* misc functions */
17void segaic16_set_display_enable(running_machine &machine, int enable);
18
1915/* tilemap systems */
2016#define SEGAIC16_MAX_TILEMAPS       1
2117
r24081r24082
2824#define SEGAIC16_TILEMAP_BACKGROUND 1
2925#define SEGAIC16_TILEMAP_TEXT       2
3026
31void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks);
32void segaic16_tilemap_reset(running_machine &machine, int which);
33void segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark);
34void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset);
35void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip);
36void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable);
37void segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable);
38
39DECLARE_WRITE16_HANDLER( segaic16_tileram_0_w );
40DECLARE_WRITE16_HANDLER( segaic16_textram_0_w );
41
4227/* road systems */
4328#define SEGAIC16_MAX_ROADS          1
4429
r24081r24082
5035#define SEGAIC16_ROAD_BACKGROUND    0
5136#define SEGAIC16_ROAD_FOREGROUND    1
5237
53void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs);
54void segaic16_road_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority);
55DECLARE_READ16_HANDLER( segaic16_road_control_0_r );
56DECLARE_WRITE16_HANDLER( segaic16_road_control_0_w );
5738
39
5840/* rotation systems */
5941#define SEGAIC16_MAX_ROTATE         1
6042
6143#define SEGAIC16_ROTATE_YBOARD      0
6244
63void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase);
64void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap);
65DECLARE_READ16_HANDLER( segaic16_rotate_control_0_r );
6645
46
6747/*************************************
6848 *
6949 *  Type definitions
r24081r24082
134114    FUNCTION PROTOTYPES
135115***************************************************************************/
136116
137extern struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE];
138extern struct road_info segaic16_road[SEGAIC16_MAX_ROADS];
117
118
119class segaic16_video_device : public device_t
120{
121public:
122   segaic16_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
123   ~segaic16_video_device() {}
124   
125   UINT8 segaic16_display_enable;
126   UINT16 *segaic16_tileram_0;
127   UINT16 *segaic16_textram_0;
128   UINT16 *segaic16_roadram_0;
129   UINT16 *segaic16_rotateram_0;
130
131   void segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable);
132   void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable);
133   void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip);
134   void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset);
135   void segaic16_tilemap_reset(running_machine &machine, int which);
136   void segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark);
137//   void segaic16_tilemap_16b_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority);
138//   void segaic16_tilemap_16a_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority);
139//   void segaic16_draw_virtual_tilemap(running_machine &machine, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority);
140//   void segaic16_tilemap_16b_reset(running_machine &machine, struct tilemap_info *info);
141
142   TIMER_CALLBACK_MEMBER( segaic16_tilemap_16b_latch_values );
143
144   struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE];
145   struct road_info segaic16_road[SEGAIC16_MAX_ROADS];
146   struct tilemap_info bg_tilemap[SEGAIC16_MAX_TILEMAPS];
147
148   void segaic16_set_display_enable(running_machine &machine, int enable);
149   void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks);
150   void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs);
151   void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase);
152
153   DECLARE_READ16_MEMBER( segaic16_tileram_0_r );
154   DECLARE_READ16_MEMBER( segaic16_textram_0_r );
155   DECLARE_WRITE16_MEMBER( segaic16_tileram_0_w );
156   DECLARE_WRITE16_MEMBER( segaic16_textram_0_w );
157
158   void segaic16_road_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority);
159   void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap);
160
161   DECLARE_READ16_MEMBER( segaic16_road_control_0_r );
162   DECLARE_WRITE16_MEMBER( segaic16_road_control_0_w );
163
164
165   DECLARE_READ16_MEMBER( segaic16_rotate_control_0_r );
166
167   TILE_GET_INFO_MEMBER( segaic16_tilemap_16b_tile_info );
168   TILE_GET_INFO_MEMBER( segaic16_tilemap_16b_text_info );
169   TILE_GET_INFO_MEMBER( segaic16_tilemap_16b_alt_tile_info );
170   TILE_GET_INFO_MEMBER( segaic16_tilemap_16b_alt_text_info );
171
172   TILE_GET_INFO_MEMBER( segaic16_tilemap_16a_tile_info );
173   TILE_GET_INFO_MEMBER( segaic16_tilemap_16a_text_info );
174
175protected:
176   // device-level overrides
177   virtual void device_config_complete();
178   virtual void device_start();
179   virtual void device_reset();
180
181private:
182   // internal state
183};
184
185extern const device_type SEGAIC16VID;
186
187#define MCFG_SEGAIC16VID_ADD(_tag) \
188   MCFG_DEVICE_ADD(_tag, SEGAIC16VID, 0) \
189
190
191#endif
trunk/src/mame/video/sega16sp.c
r24081r24082
12911291   //
12921292
12931293   // clear out any scanlines we might be using
1294   const UINT16 *rotatebase = segaic16_rotate[0].buffer ? segaic16_rotate[0].buffer : segaic16_rotate[0].rotateram;
1294   const UINT16 *rotatebase = m_segaic16_rotate[0].buffer ? m_segaic16_rotate[0].buffer : m_segaic16_rotate[0].rotateram;
12951295   rotatebase -= yorigin();
12961296   for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
12971297      if (!(rotatebase[y & ~1] & 0xc000))
trunk/src/mame/includes/segaxbd.h
r24081r24082
5858         m_mcu(*this, "mcu"),
5959         m_cmptimer_1(*this, "cmptimer_main"),
6060         m_sprites(*this, "sprites"),
61         m_segaic16vid(*this, "segaic16vid"),
6162         m_gprider_hack(false),
6263         m_road_priority(1),
6364         m_scanline_timer(NULL),
r24081r24082
148149   optional_device<i8751_device> m_mcu;
149150   required_device<sega_315_5250_compare_timer_device> m_cmptimer_1;
150151   required_device<sega_xboard_sprite_device> m_sprites;
152   required_device<segaic16_video_device> m_segaic16vid;
151153
152154   // configuration
153155   bool            m_gprider_hack;
trunk/src/mame/includes/segaybd.h
r24081r24082
5656         m_soundcpu(*this, "soundcpu"),
5757         m_bsprites(*this, "bsprites"),
5858         m_ysprites(*this, "ysprites"),
59         m_segaic16vid(*this, "segaic16vid"),
5960         m_pdrift_bank(0),
6061         m_scanline_timer(NULL),
6162         m_irq2_scanline(0),
r24081r24082
126127   required_device<z80_device> m_soundcpu;
127128   required_device<sega_sys16b_sprite_device> m_bsprites;
128129   required_device<sega_yboard_sprite_device> m_ysprites;
130   required_device<segaic16_video_device> m_segaic16vid;
129131
130132   // configuration
131133   output_delegate m_output_cb1;
trunk/src/mame/includes/segas16a.h
r24081r24082
6464         m_n7751(*this, "n7751"),
6565         m_n7751_i8243(*this, "n7751_8243"),
6666         m_nvram(*this, "nvram"),
67         m_segaic16vid(*this, "segaic16vid"),
6768         m_sprites(*this, "sprites"),
6869         m_workram(*this, "nvram"),
6970         m_video_control(0),
r24081r24082
159160   optional_device<n7751_device> m_n7751;
160161   optional_device<i8243_device> m_n7751_i8243;
161162   required_device<nvram_device> m_nvram;
163   required_device<segaic16_video_device> m_segaic16vid;
162164   required_device<sega_sys16a_sprite_device> m_sprites;
163165
164166   // memory pointers
trunk/src/mame/includes/segahang.h
r24081r24082
5959         m_i8255_1(*this, "i8255_1"),
6060         m_i8255_2(*this, "i8255_2"),
6161         m_sprites(*this, "sprites"),
62         m_segaic16vid(*this, "segaic16vid"),
6263         m_workram(*this, "workram"),
6364         m_sharrier_video(false),
6465         m_adc_select(0)
r24081r24082
120121   required_device<i8255_device> m_i8255_1;
121122   required_device<i8255_device> m_i8255_2;
122123   required_device<sega_16bit_sprite_device> m_sprites;
124   required_device<segaic16_video_device> m_segaic16vid;
123125
124126   // memory pointers
125127   required_shared_ptr<UINT16> m_workram;
trunk/src/mame/includes/segas16b.h
r24081r24082
6767         m_cmptimer_2(*this, "cmptimer_2"),
6868         m_nvram(*this, "nvram"),
6969         m_sprites(*this, "sprites"),
70         m_segaic16vid(*this, "segaic16vid"),
7071         m_workram(*this, "workram"),
7172         m_romboard(ROM_BOARD_INVALID),
7273         m_tilemap_type(SEGAIC16_TILEMAP_16B),
r24081r24082
140141   // video updates
141142   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
142143
143   // wrappers for legacy functions (to be removed)
144   template<write16_space_func _Legacy>
145   WRITE16_MEMBER( legacy_wrapper ) { _Legacy(space, offset, data, mem_mask); }
144   DECLARE_WRITE16_HANDLER( sega_tileram_0_w ) { m_segaic16vid->segaic16_tileram_0_w(space,offset,data,mem_mask); };
145   DECLARE_WRITE16_HANDLER( sega_textram_0_w ) { m_segaic16vid->segaic16_textram_0_w(space,offset,data,mem_mask); };
146146
147147protected:
148148   // internal types
r24081r24082
208208   optional_device<sega_315_5250_compare_timer_device> m_cmptimer_2;
209209   required_device<nvram_device> m_nvram;
210210   required_device<sega_sys16b_sprite_device> m_sprites;
211   required_device<segaic16_video_device> m_segaic16vid;
211212
212213   // memory pointers
213214   required_shared_ptr<UINT16> m_workram;
trunk/src/mame/includes/segaorun.h
r24081r24082
5959         m_i8255(*this, "i8255"),
6060         m_nvram(*this, "nvram"),
6161         m_sprites(*this, "sprites"),
62         m_segaic16vid(*this, "segaic16vid"),
6263         m_workram(*this, "workram"),
6364         m_custom_map(NULL),
6465         m_shangon_video(false),
r24081r24082
99100   UINT32 screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
100101   UINT32 screen_update_shangon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
101102
102   // wrappers for legacy functions (to be removed)
103   template<read16_space_func _Legacy>
104   READ16_MEMBER( legacy_wrapper_r ) { return _Legacy(space, offset, mem_mask); }
105   template<write16_space_func _Legacy>
106   WRITE16_MEMBER( legacy_wrapper ) { _Legacy(space, offset, data, mem_mask); }
103   DECLARE_WRITE16_HANDLER( sega_tileram_0_w ) { m_segaic16vid->segaic16_tileram_0_w(space,offset,data,mem_mask); };
104   DECLARE_WRITE16_HANDLER( sega_textram_0_w ) { m_segaic16vid->segaic16_textram_0_w(space,offset,data,mem_mask); };
105   DECLARE_READ16_HANDLER( sega_road_control_0_r ) { return m_segaic16vid->segaic16_road_control_0_r(space,offset,mem_mask); };
106   DECLARE_WRITE16_HANDLER( sega_road_control_0_w ) { m_segaic16vid->segaic16_road_control_0_w(space,offset,data,mem_mask); };
107107
108108protected:
109109   // timer IDs
r24081r24082
137137   required_device<i8255_device> m_i8255;
138138   optional_device<nvram_device> m_nvram;
139139   required_device<sega_16bit_sprite_device> m_sprites;
140   required_device<segaic16_video_device> m_segaic16vid;
140141
141142   // memory
142143   required_shared_ptr<UINT16> m_workram;
trunk/src/mame/includes/segas18.h
r24081r24082
6060         m_vdp(*this, "gen_vdp"),
6161         m_nvram(*this, "nvram"),
6262         m_sprites(*this, "sprites"),
63         m_segaic16vid(*this, "segaic16vid"),
6364         m_workram(*this, "workram"),
6465         m_romboard(ROM_BOARD_INVALID),
6566         m_has_guns(false),
r24081r24082
117118   template<write16_space_func _Legacy>
118119   WRITE16_MEMBER( legacy_wrapper ) { _Legacy(space, offset, data, mem_mask); }
119120
121   DECLARE_WRITE16_HANDLER( sega_tileram_0_w ) { m_segaic16vid->segaic16_tileram_0_w(space,offset,data,mem_mask); };
122   DECLARE_WRITE16_HANDLER( sega_textram_0_w ) { m_segaic16vid->segaic16_textram_0_w(space,offset,data,mem_mask); };
123
120124protected:
121125   // timer IDs
122126   enum
r24081r24082
153157   required_device<sega_genesis_vdp_device> m_vdp;
154158   required_device<nvram_device> m_nvram;
155159   required_device<sega_sys16b_sprite_device> m_sprites;
160   required_device<segaic16_video_device> m_segaic16vid;
156161
157162   // memory pointers
158163   required_shared_ptr<UINT16> m_workram;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team