Previous 199869 Revisions Next

r33961 Friday 19th December, 2014 at 17:53:11 UTC by Osso
Added missing save state support to segaic16_video_device. Fixes quartet2 save state problem (nw)
Some almost exclusively cosmetic changes to the device, while at it (nw)
[src/mame/drivers]segahang.c segaorun.c segas16a.c segas16b.c segas18.c segaxbd.c segaybd.c
[src/mame/includes]segaorun.h segas16b.h segas18.h
[src/mame/video]segahang.c segaic16.c segaic16.h segaorun.c segas16a.c segas16b.c segas18.c segaxbd.c segaybd.c

trunk/src/mame/drivers/segahang.c
r242472r242473
5959   //
6060
6161   // bit 7: screen flip
62   m_segaic16vid->segaic16_tilemap_set_flip(0, data & 0x80);
62   m_segaic16vid->tilemap_set_flip(0, data & 0x80);
6363   m_sprites->set_flip(data & 0x80);
6464
6565   // bit 6: shadow/highlight control
6666   m_shadow = ~data & 0x40;
6767
6868   // bit 4: enable display
69   m_segaic16vid->segaic16_set_display_enable(data & 0x10);
69   m_segaic16vid->set_display_enable(data & 0x10);
7070
7171   // bits 2 & 3: control the lamps
7272   set_led_status(machine(), 1, data & 0x08);
r242472r242473
102102   m_soundcpu->set_input_line(INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
103103
104104   // bits 1 & 2: tilemap origin
105   m_segaic16vid->segaic16_tilemap_set_colscroll(0, ~data & 0x04);
106   m_segaic16vid->segaic16_tilemap_set_rowscroll(0, ~data & 0x02);
105   m_segaic16vid->tilemap_set_colscroll(0, ~data & 0x04);
106   m_segaic16vid->tilemap_set_rowscroll(0, ~data & 0x02);
107107
108108   // bit 0: sound mute
109109   machine().sound().system_enable(data & 0x01);
r242472r242473
350350void segahang_state::machine_reset()
351351{
352352   // reset misc components
353   m_segaic16vid->segaic16_tilemap_reset(*m_screen);
353   m_segaic16vid->tilemap_reset(*m_screen);
354354
355355   // queue up a timer to either boost interleave or disable the MCU
356356   synchronize(TID_INIT_I8751);
r242472r242473
413413   ADDRESS_MAP_UNMAP_HIGH
414414   AM_RANGE(0x000000, 0x03ffff) AM_ROM
415415   AM_RANGE(0x20c000, 0x20ffff) AM_RAM AM_SHARE("workram")
416   AM_RANGE(0x400000, 0x403fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
417   AM_RANGE(0x410000, 0x410fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
416   AM_RANGE(0x400000, 0x403fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, tileram_r, tileram_w) AM_SHARE("tileram")
417   AM_RANGE(0x410000, 0x410fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, textram_r, textram_w) AM_SHARE("textram")
418418   AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_SHARE("sprites")
419419   AM_RANGE(0xa00000, 0xa00fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
420420   AM_RANGE(0xc00000, 0xc3ffff) AM_ROM AM_REGION("subcpu", 0)
r242472r242473
427427   ADDRESS_MAP_UNMAP_HIGH
428428   AM_RANGE(0x000000, 0x03ffff) AM_ROM
429429   AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("workram")
430   AM_RANGE(0x100000, 0x107fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
431   AM_RANGE(0x108000, 0x108fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
430   AM_RANGE(0x100000, 0x107fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, tileram_r, tileram_w) AM_SHARE("tileram")
431   AM_RANGE(0x108000, 0x108fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, textram_r, textram_w) AM_SHARE("textram")
432432   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
433433   AM_RANGE(0x124000, 0x127fff) AM_RAM AM_SHARE("subram")
434434   AM_RANGE(0x130000, 0x130fff) AM_RAM AM_SHARE("sprites")
r242472r242473
17461746DRIVER_INIT_MEMBER(segahang_state,generic)
17471747{
17481748   // point globals to allocated memory regions
1749   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
1750   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
17511749   m_segaic16road->segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
17521750
17531751   // save states
trunk/src/mame/drivers/segaorun.c
r242472r242473
349349   //  D1: (CONT) - affects sprite hardware
350350   //  D0: Sound section reset (1= normal operation, 0= reset)
351351
352   m_segaic16vid->segaic16_set_display_enable(data & 0x20);
352   m_segaic16vid->set_display_enable(data & 0x20);
353353   m_adc_select = (data >> 2) & 7;
354354   m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
355355}
r242472r242473
459459         break;
460460
461461      case 1:
462         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segaorun_state::sega_tileram_0_w), this));
463         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segaorun_state::sega_textram_0_w), this));
462         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segaorun_state::tileram_w), this));
463         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segaorun_state::textram_w), this));
464464         break;
465465
466466      case 0:
r242472r242473
568568   // reset misc components
569569   if (m_custom_map != NULL)
570570      m_mapper->configure_explicit(m_custom_map);
571   m_segaic16vid->segaic16_tilemap_reset(*m_screen);
571   m_segaic16vid->tilemap_reset(*m_screen);
572572
573573   // hook the RESET line, which resets CPU #1
574574   m_maincpu->set_reset_callback(write_line_delegate(FUNC(segaorun_state::m68k_reset_callback),this));
r242472r242473
814814            //  D2: Start lamp
815815            //  other bits: ?
816816            m_adc_select = data >> 6 & 3;
817            m_segaic16vid->segaic16_set_display_enable(data >> 5 & 1);
817            m_segaic16vid->set_display_enable(data >> 5 & 1);
818818            output_set_value("Vibration_motor", data >> 3 & 1);
819819            output_set_value("Start_lamp", data >> 2 & 1);
820820         }
r242472r242473
23692369      m_nvram->set_base(m_workram, m_workram.bytes());
23702370
23712371   // point globals to allocated memory regions
2372   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
2373   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
23742372   m_segaic16road->segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
23752373
23762374   // save state
trunk/src/mame/drivers/segas16a.c
r242472r242473
187187   m_video_control = data;
188188
189189   // bit 7: screen flip
190   m_segaic16vid->segaic16_tilemap_set_flip(0, data & 0x80);
190   m_segaic16vid->tilemap_set_flip(0, data & 0x80);
191191   m_sprites->set_flip(data & 0x80);
192192
193193   // bit 6: set 8751 interrupt line
r242472r242473
195195      m_mcu->set_input_line(MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
196196
197197   // bit 4: enable display
198   m_segaic16vid->segaic16_set_display_enable(data & 0x10);
198   m_segaic16vid->set_display_enable(data & 0x10);
199199
200200   // bits 0 & 1: update coin counters
201201   coin_counter_w(machine(), 1, data & 0x02);
r242472r242473
224224   //       1= sound is enabled
225225   //
226226   m_soundcpu->set_input_line(INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
227   m_segaic16vid->segaic16_tilemap_set_colscroll(0, ~data & 0x04);
228   m_segaic16vid->segaic16_tilemap_set_rowscroll(0, ~data & 0x02);
227   m_segaic16vid->tilemap_set_colscroll(0, ~data & 0x04);
228   m_segaic16vid->tilemap_set_rowscroll(0, ~data & 0x02);
229229}
230230
231231
r242472r242473
455455
456456   // enable/disable the display
457457   if (data & 0x40)
458      m_segaic16vid->segaic16_set_display_enable(1);
458      m_segaic16vid->set_display_enable(1);
459459
460460   // apply an extra boost if the main CPU is just waking up
461461   if ((m_mcu_control ^ data) & 0x40)
r242472r242473
715715
716716   // X scroll values
717717   address_space &space = m_maincpu->space(AS_PROGRAM);
718   m_segaic16vid->segaic16_textram_0_w(space, 0xff8/2, m_workram[0x0d14/2], 0xffff);
719   m_segaic16vid->segaic16_textram_0_w(space, 0xffa/2, m_workram[0x0d18/2], 0xffff);
718   m_segaic16vid->textram_w(space, 0xff8/2, m_workram[0x0d14/2], 0xffff);
719   m_segaic16vid->textram_w(space, 0xffa/2, m_workram[0x0d18/2], 0xffff);
720720
721721   // page values
722   m_segaic16vid->segaic16_textram_0_w(space, 0xe9e/2, m_workram[0x0d1c/2], 0xffff);
723   m_segaic16vid->segaic16_textram_0_w(space, 0xe9c/2, m_workram[0x0d1e/2], 0xffff);
722   m_segaic16vid->textram_w(space, 0xe9e/2, m_workram[0x0d1c/2], 0xffff);
723   m_segaic16vid->textram_w(space, 0xe9c/2, m_workram[0x0d1e/2], 0xffff);
724724}
725725
726726
r242472r242473
952952static ADDRESS_MAP_START( system16a_map, AS_PROGRAM, 16, segas16a_state )
953953   ADDRESS_MAP_UNMAP_HIGH
954954   AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x380000) AM_ROM
955   AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
956   AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
955   AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, tileram_r, tileram_w) AM_SHARE("tileram")
956   AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, textram_r, textram_w) AM_SHARE("textram")
957957   AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_SHARE("sprites")
958958   AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
959959   AM_RANGE(0xc40000, 0xc43fff) AM_MIRROR(0x39c000) AM_READWRITE(misc_io_r, misc_io_w)
r242472r242473
34543454   m_custom_io_r = read16_delegate(FUNC(segas16a_state::standard_io_r), this);
34553455   m_custom_io_w = write16_delegate(FUNC(segas16a_state::standard_io_w), this);
34563456
3457   // point globals to allocated memory regions
3458   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
3459   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
3460
34613457   // save state
34623458   save_item(NAME(m_video_control));
34633459   save_item(NAME(m_mcu_control));
trunk/src/mame/drivers/segas16b.c
r242472r242473
912912         break;
913913
914914      case 5: // 64k of tileram + 4k of textram
915         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segas16b_state::sega_tileram_0_w), this));
916         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segas16b_state::sega_textram_0_w), this));
915         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segas16b_state::tileram_w), this));
916         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segas16b_state::textram_w), this));
917917         break;
918918
919919      case 4: // 2k of spriteram
r242472r242473
10031003WRITE16_MEMBER( segas16b_state::rom_5704_bank_w )
10041004{
10051005   if (ACCESSING_BITS_0_7)
1006      m_segaic16vid->segaic16_tilemap_set_bank(0, offset & 1, data & 7);
1006      m_segaic16vid->tilemap_set_bank(0, offset & 1, data & 7);
10071007}
10081008
10091009
r242472r242473
10511051
10521052      case 0x2000/2:
10531053         if (ACCESSING_BITS_0_7)
1054            m_segaic16vid->segaic16_tilemap_set_bank(0, offset & 1, data & 7);
1054            m_segaic16vid->tilemap_set_bank(0, offset & 1, data & 7);
10551055         break;
10561056   }
10571057}
r242472r242473
11241124         //  D1 : (Output to coin counter 2?)
11251125         //  D0 : Output to coin counter 1
11261126         //
1127         m_segaic16vid->segaic16_tilemap_set_flip(0, data & 0x40);
1127         m_segaic16vid->tilemap_set_flip(0, data & 0x40);
11281128         m_sprites->set_flip(data & 0x40);
11291129         if (!m_disable_screen_blanking)
1130            m_segaic16vid->segaic16_set_display_enable(data & 0x20);
1130            m_segaic16vid->set_display_enable(data & 0x20);
11311131         set_led_status(machine(), 1, data & 0x08);
11321132         set_led_status(machine(), 0, data & 0x04);
11331133         coin_counter_w(machine(), 1, data & 0x02);
r242472r242473
12881288   synchronize(TID_INIT_I8751);
12891289
12901290   // reset tilemap state
1291   m_segaic16vid->segaic16_tilemap_reset(*m_screen);
1291   m_segaic16vid->tilemap_reset(*m_screen);
12921292
12931293   // configure sprite banks
12941294   static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
r242472r242473
66256625   m_custom_io_r = read16_delegate(FUNC(segas16b_state::standard_io_r), this);
66266626   m_custom_io_w = write16_delegate(FUNC(segas16b_state::standard_io_w), this);
66276627
6628   // point globals to allocated memory regions
6629   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
6630   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
6631
66326628   // save state
66336629   save_item(NAME(m_atomicp_sound_count));
66346630   save_item(NAME(m_hwc_input_value));
r242472r242473
66546650   // configure special behaviors for the Korean boards
66556651   m_disable_screen_blanking = true;
66566652   m_atomicp_sound_divisor = 1;
6657   m_segaic16vid->segaic16_display_enable = 1;
6653   m_segaic16vid->m_display_enable = 1;
66586654
66596655   // allocate a sound timer
66606656   emu_timer *timer = timer_alloc(TID_ATOMICP_SOUND_IRQ);
r242472r242473
72217217   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
72227218   AM_RANGE(0x200000, 0x23ffff) AM_RAM // used during startup for decompression
72237219   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(rom_5704_bank_w)
7224   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
7225   AM_RANGE(0x410000, 0x410fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
7220   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, tileram_r, tileram_w) AM_SHARE("tileram")
7221   AM_RANGE(0x410000, 0x410fff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, textram_r, textram_w) AM_SHARE("textram")
72267222   AM_RANGE(0x440000, 0x4407ff) AM_RAM AM_SHARE("sprites")
72277223   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
72287224   AM_RANGE(0xc40000, 0xc43fff) AM_READWRITE(standard_io_r, standard_io_w)
r242472r242473
73587354
73597355void isgsm_state::machine_reset()
73607356{
7361   m_segaic16vid->segaic16_tilemap_reset(*m_screen);
7357   m_segaic16vid->tilemap_reset(*m_screen);
73627358
73637359   // configure sprite banks
73647360   for (int i = 0; i < 16; i++)
trunk/src/mame/drivers/segas18.c
r242472r242473
5757         break;
5858
5959      case 5:
60         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segas18_state::sega_tileram_0_w), this));
61         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segas18_state::sega_textram_0_w), this));
60         mapper.map_as_ram(0x00000, 0x10000, 0xfe0000, "tileram", write16_delegate(FUNC(segas18_state::tileram_w), this));
61         mapper.map_as_ram(0x10000, 0x01000, 0xfef000, "textram", write16_delegate(FUNC(segas18_state::textram_w), this));
6262         break;
6363
6464      case 4:
r242472r242473
141141   // configure the NVRAM to point to our workram
142142   m_nvram->set_base(m_workram, m_workram.bytes());
143143
144   // point globals to allocated memory regions
145   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
146   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
147
148144   // configure VDP
149145   m_vdp->set_use_cram(1);
150146   m_vdp->set_vdp_pal(FALSE);
r242472r242473
181177
182178void segas18_state::machine_reset()
183179{
184   m_segaic16vid->segaic16_tilemap_reset(*m_screen);
180   m_segaic16vid->tilemap_reset(*m_screen);
185181
186182   m_vdp->device_reset_old();
187183
r242472r242473
202198{
203199   // miscellaneous output
204200   set_grayscale(~data & 0x40);
205   m_segaic16vid->segaic16_tilemap_set_flip(0, data & 0x20);
201   m_segaic16vid->tilemap_set_flip(0, data & 0x20);
206202   m_sprites->set_flip(data & 0x20);
207203   // These are correct according to cgfm's docs, but mwalker and ddcrew both
208204   // enable the lockout and never turn it off
r242472r242473
284280   {
285281      for (int i = 0; i < 4; i++)
286282      {
287         m_segaic16vid->segaic16_tilemap_set_bank(0, 0 + i, (data & 0xf) * 4 + i);
288         m_segaic16vid->segaic16_tilemap_set_bank(0, 4 + i, ((data >> 4) & 0xf) * 4 + i);
283         m_segaic16vid->tilemap_set_bank(0, 0 + i, (data & 0xf) * 4 + i);
284         m_segaic16vid->tilemap_set_bank(0, 4 + i, ((data >> 4) & 0xf) * 4 + i);
289285      }
290286   }
291287}
r242472r242473
305301      int maxbanks = m_gfxdecode->gfx(0)->elements() / 1024;
306302      if (data >= maxbanks)
307303         data %= maxbanks;
308      m_segaic16vid->segaic16_tilemap_set_bank(0, offset, data);
304      m_segaic16vid->tilemap_set_bank(0, offset, data);
309305   }
310306
311307   // sprite banking
r242472r242473
335331      if (data & 0x80) data += 0x20;
336332      data &= 0x3f;
337333
338      m_segaic16vid->segaic16_tilemap_set_bank(0, offset, data);
334      m_segaic16vid->tilemap_set_bank(0, offset, data);
339335   }
340336
341337   // sprite banking
r242472r242473
12171213   MCFG_315_5296_IN_PORTF_CB(IOPORT("COINAGE"))
12181214   MCFG_315_5296_IN_PORTG_CB(IOPORT("DSW"))
12191215   MCFG_315_5296_OUT_PORTH_CB(WRITE8(segas18_state, rom_5874_bank_w))
1220   MCFG_315_5296_OUT_CNT1_CB(DEVWRITELINE("segaic16vid", segaic16_video_device, segaic16_set_display_enable))
1216   MCFG_315_5296_OUT_CNT1_CB(DEVWRITELINE("segaic16vid", segaic16_video_device, set_display_enable))
12211217   MCFG_315_5296_OUT_CNT2_CB(WRITELINE(segas18_state, set_vdp_enable))
12221218
12231219   MCFG_DEVICE_ADD("gen_vdp", SEGA315_5313, 0)
trunk/src/mame/drivers/segaxbd.c
r242472r242473
449449         if (((oldval ^ data) & 0x40) && !(data & 0x40))
450450            machine().watchdog_reset();
451451
452         m_segaic16vid->segaic16_set_display_enable(data & 0x20);
452         m_segaic16vid->set_display_enable(data & 0x20);
453453
454454         m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
455455         if (m_soundcpu2 != NULL)
r242472r242473
640640
641641void segaxbd_state::machine_reset()
642642{
643   m_segaic16vid->segaic16_tilemap_reset(*m_screen);
643   m_segaic16vid->tilemap_reset(*m_screen);
644644
645645   // hook the RESET line, which resets CPU #1
646646   m_maincpu->set_reset_callback(write_line_delegate(FUNC(segaxbd_state::m68k_reset_callback),this));
r242472r242473
876876   AM_RANGE(0x000000, 0x07ffff) AM_ROM
877877   AM_RANGE(0x080000, 0x083fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("backup1")
878878   AM_RANGE(0x0a0000, 0x0a3fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("backup2")
879   AM_RANGE(0x0c0000, 0x0cffff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_tileram_0_r, segaic16_tileram_0_w) AM_SHARE("textram")
880   AM_RANGE(0x0d0000, 0x0d0fff) AM_MIRROR(0x00f000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, segaic16_textram_0_r, segaic16_textram_0_w) AM_SHARE("tileram")
879   AM_RANGE(0x0c0000, 0x0cffff) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, tileram_r, tileram_w) AM_SHARE("tileram")
880   AM_RANGE(0x0d0000, 0x0d0fff) AM_MIRROR(0x00f000) AM_DEVREADWRITE("segaic16vid", segaic16_video_device, textram_r, textram_w) AM_SHARE("textram")
881881   AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_DEVREADWRITE("multiplier_main", sega_315_5248_multiplier_device, read, write)
882882   AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("divider_main", sega_315_5249_divider_device, read, write)
883883   AM_RANGE(0x0e8000, 0x0e801f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("cmptimer_main", sega_315_5250_compare_timer_device, read, write)
r242472r242473
32093209   m_iochip_custom_io_w[0][3] = iowrite_delegate(FUNC(segaxbd_state::generic_iochip0_lamps_w), this);
32103210
32113211   // point globals to allocated memory regions
3212   m_segaic16vid->segaic16_tileram_0 = reinterpret_cast<UINT16 *>(memshare("tileram")->ptr());
3213   m_segaic16vid->segaic16_textram_0 = reinterpret_cast<UINT16 *>(memshare("textram")->ptr());
32143212   m_segaic16road->segaic16_roadram_0 = reinterpret_cast<UINT16 *>(memshare("roadram")->ptr());
32153213
32163214   // save state
trunk/src/mame/drivers/segaybd.c
r242472r242473
207207         //  D2 = YRES
208208         //  D1-D0 = ADC0-1
209209         //
210         m_segaic16vid->segaic16_set_display_enable(data & 0x80);
210         m_segaic16vid->set_display_enable(data & 0x80);
211211         if (((old ^ data) & 0x20) && !(data & 0x20))
212212            machine().watchdog_reset();
213213         m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
r242472r242473
741741   AM_RANGE(0x180000, 0x1807ff) AM_MIRROR(0x007800) AM_RAM AM_SHARE("rotateram")
742742   AM_RANGE(0x188000, 0x188fff) AM_MIRROR(0x007000) AM_RAM AM_SHARE("bsprites")
743743   AM_RANGE(0x190000, 0x193fff) AM_MIRROR(0x004000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
744   AM_RANGE(0x198000, 0x19ffff) AM_DEVREAD("segaic16vid", segaic16_video_device, segaic16_rotate_control_0_r)
744   AM_RANGE(0x198000, 0x19ffff) AM_DEVREAD("segaic16vid", segaic16_video_device, rotate_control_r)
745745   AM_RANGE(0x1f0000, 0x1fffff) AM_RAM
746746ADDRESS_MAP_END
747747
r242472r242473
25292529   // allocate a scanline timer
25302530   m_scanline_timer = timer_alloc(TID_IRQ2_GEN);
25312531
2532   // point globals to allocated memory regions
2533   m_segaic16vid->segaic16_rotateram_0 = reinterpret_cast<UINT16 *>(memshare("rotateram")->ptr());
2534
25352532   // save state
25362533   save_item(NAME(m_pdrift_bank));
25372534   save_item(NAME(m_analog_data));
trunk/src/mame/includes/segaorun.h
r242472r242473
8080   UINT32 screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8181   UINT32 screen_update_shangon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8282
83   DECLARE_WRITE16_MEMBER( sega_tileram_0_w ) { m_segaic16vid->segaic16_tileram_0_w(space,offset,data,mem_mask); };
84   DECLARE_WRITE16_MEMBER( sega_textram_0_w ) { m_segaic16vid->segaic16_textram_0_w(space,offset,data,mem_mask); };
83   DECLARE_WRITE16_MEMBER( tileram_w ) { m_segaic16vid->tileram_w(space,offset,data,mem_mask); };
84   DECLARE_WRITE16_MEMBER( textram_w ) { m_segaic16vid->textram_w(space,offset,data,mem_mask); };
8585   DECLARE_READ16_MEMBER( sega_road_control_0_r ) { return m_segaic16road->segaic16_road_control_0_r(space,offset,mem_mask); };
8686   DECLARE_WRITE16_MEMBER( sega_road_control_0_w ) { m_segaic16road->segaic16_road_control_0_w(space,offset,data,mem_mask); };
8787
trunk/src/mame/includes/segas16b.h
r242472r242473
114114   // video updates
115115   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
116116
117   DECLARE_WRITE16_MEMBER( sega_tileram_0_w ) { m_segaic16vid->segaic16_tileram_0_w(space,offset,data,mem_mask); };
118   DECLARE_WRITE16_MEMBER( sega_textram_0_w ) { m_segaic16vid->segaic16_textram_0_w(space,offset,data,mem_mask); };
117   DECLARE_WRITE16_MEMBER( tileram_w ) { m_segaic16vid->tileram_w(space,offset,data,mem_mask); };
118   DECLARE_WRITE16_MEMBER( textram_w ) { m_segaic16vid->textram_w(space,offset,data,mem_mask); };
119119
120120protected:
121121   // internal types
trunk/src/mame/includes/segas18.h
r242472r242473
9191
9292   DECLARE_READ16_MEMBER( genesis_vdp_r ) { return m_vdp->vdp_r(space, offset, mem_mask); }
9393   DECLARE_WRITE16_MEMBER( genesis_vdp_w ) { m_vdp->vdp_w(space, offset, data, mem_mask); }
94   DECLARE_WRITE16_MEMBER( sega_tileram_0_w ) { m_segaic16vid->segaic16_tileram_0_w(space, offset, data, mem_mask); }
95   DECLARE_WRITE16_MEMBER( sega_textram_0_w ) { m_segaic16vid->segaic16_textram_0_w(space, offset, data, mem_mask); }
94   DECLARE_WRITE16_MEMBER( tileram_w ) { m_segaic16vid->tileram_w(space, offset, data, mem_mask); }
95   DECLARE_WRITE16_MEMBER( textram_w ) { m_segaic16vid->textram_w(space, offset, data, mem_mask); }
9696
9797   DECLARE_WRITE_LINE_MEMBER(set_grayscale);
9898   DECLARE_WRITE_LINE_MEMBER(set_vdp_enable);
trunk/src/mame/video/segahang.c
r242472r242473
1818void segahang_state::video_start()
1919{
2020   // initialize the tile/text layers
21   m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_HANGON, 0x000, 0, 2);
21   m_segaic16vid->tilemap_init( 0, SEGAIC16_TILEMAP_HANGON, 0x000, 0, 2);
2222
2323   // initialize the road
2424   m_segaic16road->segaic16_road_init(machine(), 0, m_sharrier_video ? SEGAIC16_ROAD_SHARRIER : SEGAIC16_ROAD_HANGON, 0x038, 0x7c0, 0x7c0, 0);
r242472r242473
3232UINT32 segahang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3333{
3434   // if no drawing is happening, fill with black and get out
35   if (!m_segaic16vid->segaic16_display_enable)
35   if (!m_segaic16vid->m_display_enable)
3636   {
3737      bitmap.fill(m_palette->black_pen(), cliprect);
3838      return 0;
r242472r242473
4848   m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
4949
5050   // draw background
51   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
52   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
51   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
52   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
5353
5454   // draw foreground
55   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
56   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
55   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
56   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
5757
5858   // draw the high priority road
5959   m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
r242472r242473
6161   // text layer
6262   // note that we inflate the priority of the text layer to prevent sprites
6363   // from drawing over the high scores
64   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
65   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
64   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
65   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
6666
6767   // mix in sprites
6868   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segaic16.c
r242472r242473
336336    and clipping capabilities, and advanced hot-spot positioning.  The
337337    mixer chip adds totally dynamic priorities, alpha-blending of the
338338    tilemaps, per-component color control, and some other funnies we
339    have not been able to decypher.
339    have not been able to decipher.
340340
341341  ST-V (also know as Titan or the Saturn console):
342342    The ultimate 2D system.  Even more advanced tilemaps, with 6-dof
343343    roz support, alpha up to the wazoo and other niceties, known as
344    the vdp2.  Ths sprite engine, vdp1, allows for any 4-point
345    streching of the sprites, actually giving polygonal 3D
344    the vdp2.  The sprite engine, vdp1, allows for any 4-point
345    stretching of the sprites, actually giving polygonal 3D
346346    capabilities.  Interestingly, the mixer capabilities took a hit,
347347    with no real per-sprite mixer priority, which could be considered
348348    annoying for a 2D system.  It still allowed some beauties like
r242472r242473
374374segaic16_video_device::segaic16_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
375375   : device_t(mconfig, SEGAIC16VID, "Sega 16-bit Video", tag, owner, clock, "segaic16_video", __FILE__),
376376      device_video_interface(mconfig, *this),
377      m_display_enable(0),
378      m_tileram(*this, ":tileram"),
379      m_textram(*this, ":textram"),
380      m_rotateram(*this, ":rotateram"),
377381      m_gfxdecode(*this)
378382{
383   memset(m_rotate, 0, sizeof(m_rotate));
384   memset(m_bg_tilemap, 0, sizeof(m_bg_tilemap));
379385}
380386
381387//-------------------------------------------------
r242472r242473
389395}
390396
391397
392void segaic16_video_device::device_config_complete()
393{
394}
395
396398void segaic16_video_device::device_start()
397399{
400   save_item(NAME(m_display_enable));
398401}
399402
400403void segaic16_video_device::device_reset()
r242472r242473
402405}
403406
404407
405
406
407
408
409
410
411
412
413408/*************************************
414409 *
415410 *  Misc functions
416411 *
417412 *************************************/
418413
419void segaic16_video_device::segaic16_set_display_enable(int enable)
414void segaic16_video_device::set_display_enable(int enable)
420415{
421416   enable = (enable != 0);
422   if (segaic16_display_enable != enable)
417   if (m_display_enable != enable)
423418   {
424419      m_screen->update_partial(m_screen->vpos());
425      segaic16_display_enable = enable;
420      m_display_enable = enable;
426421   }
427422}
428423
r242472r242473
435430 *
436431 *************************************/
437432
438void segaic16_draw_virtual_tilemap(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority)
433void draw_virtual_tilemap(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority)
439434{
440435   int leftmin = -1, leftmax = -1, rightmin = -1, rightmax = -1;
441436   int topmin = -1, topmax = -1, bottommin = -1, bottommax = -1;
r242472r242473
637632 *
638633 *******************************************************************************************/
639634
640TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16a_tile_info )
635TILE_GET_INFO_MEMBER( segaic16_video_device::tilemap_16a_tile_info )
641636{
642637   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)tilemap.user_data();
643638   UINT16 data = info->rambase[tile_index];
r242472r242473
649644}
650645
651646
652TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16a_text_info )
647TILE_GET_INFO_MEMBER( segaic16_video_device::tilemap_16a_text_info )
653648{
654649   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)tilemap.user_data();
655650   UINT16 data = info->rambase[tile_index];
r242472r242473
661656}
662657
663658
664void segaic16_tilemap_16a_draw_layer(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority)
659void tilemap_16a_draw_layer(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority)
665660{
666661   UINT16 *textram = info->textram;
667662
r242472r242473
712707            /* draw the chunk */
713708            effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff;
714709            effyscroll = effyscroll & 0x1ff;
715            segaic16_draw_virtual_tilemap(screen, info, bitmap, rowcolclip, pages, effxscroll, effyscroll, flags, priority);
710            draw_virtual_tilemap(screen, info, bitmap, rowcolclip, pages, effxscroll, effyscroll, flags, priority);
716711         }
717712      }
718713   }
r242472r242473
741736         /* draw the chunk */
742737         effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff;
743738         effyscroll = effyscroll & 0x1ff;
744         segaic16_draw_virtual_tilemap(screen, info, bitmap, colclip, pages, effxscroll, effyscroll, flags, priority);
739         draw_virtual_tilemap(screen, info, bitmap, colclip, pages, effxscroll, effyscroll, flags, priority);
745740      }
746741   }
747742   else if (info->rowscroll)
r242472r242473
770765         /* draw the chunk */
771766         effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff;
772767         effyscroll = effyscroll & 0x1ff;
773         segaic16_draw_virtual_tilemap(screen, info, bitmap, rowclip, pages, effxscroll, effyscroll, flags, priority);
768         draw_virtual_tilemap(screen, info, bitmap, rowclip, pages, effxscroll, effyscroll, flags, priority);
774769      }
775770   }
776771   else
r242472r242473
780775         xscroll += 17;
781776      xscroll = (0xc8 - xscroll + info->xoffs) & 0x3ff;
782777      yscroll = yscroll & 0x1ff;
783      segaic16_draw_virtual_tilemap(screen, info, bitmap, cliprect, pages, xscroll, yscroll, flags, priority);
778      draw_virtual_tilemap(screen, info, bitmap, cliprect, pages, xscroll, yscroll, flags, priority);
784779   }
785780}
786781
r242472r242473
849844 *
850845 *******************************************************************************************/
851846
852TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_tile_info )
847TILE_GET_INFO_MEMBER( segaic16_video_device::tilemap_16b_tile_info )
853848{
854849   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)tilemap.user_data();
855850   UINT16 data = info->rambase[tile_index];
r242472r242473
863858}
864859
865860
866TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_text_info )
861TILE_GET_INFO_MEMBER( segaic16_video_device::tilemap_16b_text_info )
867862{
868863   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)tilemap.user_data();
869864   UINT16 data = info->rambase[tile_index];
r242472r242473
876871}
877872
878873
879TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_alt_tile_info )
874TILE_GET_INFO_MEMBER( segaic16_video_device::tilemap_16b_alt_tile_info )
880875{
881876   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)tilemap.user_data();
882877   UINT16 data = info->rambase[tile_index];
r242472r242473
890885}
891886
892887
893TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_alt_text_info )
888TILE_GET_INFO_MEMBER( segaic16_video_device::tilemap_16b_alt_text_info )
894889{
895890   const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)tilemap.user_data();
896891   UINT16 data = info->rambase[tile_index];
r242472r242473
903898}
904899
905900
906void segaic16_tilemap_16b_draw_layer(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority)
901void tilemap_16b_draw_layer(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority)
907902{
908903   UINT16 *textram = info->textram;
909904   UINT16 xscroll, yscroll, pages;
r242472r242473
955950            /* draw the chunk */
956951            effxscroll = (0xc0 - effxscroll + info->xoffs) & 0x3ff;
957952            effyscroll = effyscroll & 0x1ff;
958            segaic16_draw_virtual_tilemap(screen, info, bitmap, rowcolclip, effpages, effxscroll, effyscroll, flags, priority);
953            draw_virtual_tilemap(screen, info, bitmap, rowcolclip, effpages, effxscroll, effyscroll, flags, priority);
959954         }
960955      }
961956   }
r242472r242473
991986         /* draw the chunk */
992987         effxscroll = (0xc0 - effxscroll + info->xoffs) & 0x3ff;
993988         effyscroll = effyscroll & 0x1ff;
994         segaic16_draw_virtual_tilemap(screen, info, bitmap, rowclip, effpages, effxscroll, effyscroll, flags, priority);
989         draw_virtual_tilemap(screen, info, bitmap, rowclip, effpages, effxscroll, effyscroll, flags, priority);
995990      }
996991   }
997992}
998993
999994
1000TIMER_CALLBACK_MEMBER( segaic16_video_device::segaic16_tilemap_16b_latch_values )
995TIMER_CALLBACK_MEMBER( segaic16_video_device::tilemap_16b_latch_values )
1001996{
1002   struct tilemap_info *info = &bg_tilemap[param];
997   struct tilemap_info *info = &m_bg_tilemap[param];
1003998   UINT16 *textram = info->textram;
1004999   int i;
10051000
r242472r242473
10161011}
10171012
10181013
1019void segaic16_tilemap_16b_reset(screen_device &screen, struct tilemap_info *info)
1014void tilemap_16b_reset(screen_device &screen, struct tilemap_info *info)
10201015{
10211016   /* set a timer to latch values on scanline 261 */
10221017   info->latch_timer->adjust(screen.time_until_pos(261), info->index);
r242472r242473
10301025 *
10311026 *************************************/
10321027
1033void segaic16_video_device::segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks)
1028void segaic16_video_device::tilemap_init(int which, int type, int colorbase, int xoffs, int numbanks)
10341029{
1035   struct tilemap_info *info = &bg_tilemap[which];
1030   struct tilemap_info *info = &m_bg_tilemap[which];
10361031   tilemap_get_info_delegate get_text_info;
10371032   tilemap_get_info_delegate get_tile_info;
10381033   int pagenum;
r242472r242473
10511046   switch (which)
10521047   {
10531048      case 0:
1054         info->textram = segaic16_textram_0;
1055         info->tileram = segaic16_tileram_0;
1049         info->textram = m_textram;
1050         info->tileram = m_tileram;
10561051         break;
10571052
10581053      default:
1059         fatalerror("Invalid tilemap index specified in segaic16_tilemap_init\n");
1054         fatalerror("Invalid tilemap index specified in tilemap_init\n");
10601055   }
10611056
10621057   /* determine the parameters of the tilemaps */
10631058   switch (type)
10641059   {
10651060      case SEGAIC16_TILEMAP_HANGON:
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);
1061         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::tilemap_16a_text_info),this);
1062         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::tilemap_16a_tile_info),this);
10681063         info->numpages = 4;
1069         info->draw_layer = segaic16_tilemap_16a_draw_layer;
1064         info->draw_layer = tilemap_16a_draw_layer;
10701065         info->reset = NULL;
10711066         info->latch_timer = NULL;
10721067         break;
10731068
10741069      case SEGAIC16_TILEMAP_16A:
1075         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16a_text_info),this);
1076         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16a_tile_info),this);
1070         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::tilemap_16a_text_info),this);
1071         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::tilemap_16a_tile_info),this);
10771072         info->numpages = 8;
1078         info->draw_layer = segaic16_tilemap_16a_draw_layer;
1073         info->draw_layer = tilemap_16a_draw_layer;
10791074         info->reset = NULL;
10801075         info->latch_timer = NULL;
10811076         break;
10821077
10831078      case SEGAIC16_TILEMAP_16B:
1084         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_text_info),this);
1085         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_tile_info),this);
1079         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::tilemap_16b_text_info),this);
1080         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::tilemap_16b_tile_info),this);
10861081         info->numpages = 16;
1087         info->draw_layer = segaic16_tilemap_16b_draw_layer;
1088         info->reset = segaic16_tilemap_16b_reset;
1089         info->latch_timer = machine.scheduler().timer_alloc( timer_expired_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_latch_values),this) );
1082         info->draw_layer = tilemap_16b_draw_layer;
1083         info->reset = tilemap_16b_reset;
1084         info->latch_timer = machine().scheduler().timer_alloc( timer_expired_delegate(FUNC(segaic16_video_device::tilemap_16b_latch_values),this) );
10901085         break;
10911086
10921087      case SEGAIC16_TILEMAP_16B_ALT:
1093         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_alt_text_info),this);
1094         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_alt_tile_info),this);
1088         get_text_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::tilemap_16b_alt_text_info),this);
1089         get_tile_info = tilemap_get_info_delegate(FUNC(segaic16_video_device::tilemap_16b_alt_tile_info),this);
10951090         info->numpages = 16;
1096         info->draw_layer = segaic16_tilemap_16b_draw_layer;
1097         info->reset = segaic16_tilemap_16b_reset;
1098         info->latch_timer = machine.scheduler().timer_alloc( timer_expired_delegate(FUNC(segaic16_video_device::segaic16_tilemap_16b_latch_values),this) );
1091         info->draw_layer = tilemap_16b_draw_layer;
1092         info->reset = tilemap_16b_reset;
1093         info->latch_timer = machine().scheduler().timer_alloc( timer_expired_delegate(FUNC(segaic16_video_device::tilemap_16b_latch_values),this) );
10991094         break;
11001095
11011096      default:
1102         fatalerror("Invalid tilemap type specified in segaic16_tilemap_init\n");
1097         fatalerror("Invalid tilemap type specified in tilemap_init\n");
11031098   }
11041099
11051100   /* create the tilemap for the text layer */
1106   info->textmap = &machine.tilemap().create(m_gfxdecode, get_text_info, TILEMAP_SCAN_ROWS,  8,8, 64,28);
1101   info->textmap = &machine().tilemap().create(m_gfxdecode, get_text_info, TILEMAP_SCAN_ROWS,  8,8, 64,28);
11071102
11081103   /* configure it */
11091104   info->textmap_info.rambase = info->textram;
r242472r242473
11191114   for (pagenum = 0; pagenum < info->numpages; pagenum++)
11201115   {
11211116      /* each page is 64x32 */
1122      info->tilemaps[pagenum] = &machine.tilemap().create(m_gfxdecode, get_tile_info, TILEMAP_SCAN_ROWS,  8,8, 64,32);
1117      info->tilemaps[pagenum] = &machine().tilemap().create(m_gfxdecode, get_tile_info, TILEMAP_SCAN_ROWS,  8,8, 64,32);
11231118
11241119      /* configure the tilemap */
11251120      info->tmap_info[pagenum].rambase = info->tileram + pagenum * 64*32;
r242472r242473
11311126      info->tilemaps[pagenum]->set_scrolldx(0, 22);
11321127      info->tilemaps[pagenum]->set_scrolldy(0, 38);
11331128   }
1129   
1130   save_item(NAME(info->flip), which);
1131   save_item(NAME(info->rowscroll), which);
1132   save_item(NAME(info->colscroll), which);
1133   save_item(NAME(info->bank), which);
1134   save_item(NAME(info->latched_xscroll), which);
1135   save_item(NAME(info->latched_yscroll), which);
1136   save_item(NAME(info->latched_pageselect), which);
11341137}
11351138
11361139
r242472r242473
11411144 *
11421145 *************************************/
11431146
1144void segaic16_video_device::segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark)
1147void segaic16_video_device::tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark)
11451148{
1146   struct tilemap_info *info = &bg_tilemap[which];
1149   struct tilemap_info *info = &m_bg_tilemap[which];
11471150
11481151   /* text layer is a special common case */
11491152   if (map == SEGAIC16_TILEMAP_TEXT)
r242472r242473
11621165 *
11631166 *************************************/
11641167
1165void segaic16_video_device::segaic16_tilemap_reset(screen_device &screen)
1168void segaic16_video_device::tilemap_reset(screen_device &screen)
11661169{
1167   struct tilemap_info *info = &bg_tilemap[0];
1170   struct tilemap_info *info = &m_bg_tilemap[0];
11681171
11691172   if (info->reset)
11701173      (*info->reset)(screen, info);
r242472r242473
11781181 *
11791182 *************************************/
11801183
1181void segaic16_video_device::segaic16_tilemap_set_bank(int which, int banknum, int offset)
1184void segaic16_video_device::tilemap_set_bank(int which, int banknum, int offset)
11821185{
1183   struct tilemap_info *info = &bg_tilemap[which];
1186   struct tilemap_info *info = &m_bg_tilemap[which];
11841187
11851188   if (info->bank[banknum] != offset)
11861189   {
r242472r242473
11981201 *
11991202 *************************************/
12001203
1201void segaic16_video_device::segaic16_tilemap_set_flip(int which, int flip)
1204void segaic16_video_device::tilemap_set_flip(int which, int flip)
12021205{
1203   struct tilemap_info *info = &bg_tilemap[which];
1206   struct tilemap_info *info = &m_bg_tilemap[which];
12041207   int pagenum;
12051208
12061209   flip = (flip != 0);
r242472r242473
12221225 *
12231226 *************************************/
12241227
1225void segaic16_video_device::segaic16_tilemap_set_rowscroll(int which, int enable)
1228void segaic16_video_device::tilemap_set_rowscroll(int which, int enable)
12261229{
1227   struct tilemap_info *info = &bg_tilemap[which];
1230   struct tilemap_info *info = &m_bg_tilemap[which];
12281231
12291232   enable = (enable != 0);
12301233   if (info->rowscroll != enable)
r242472r242473
12421245 *
12431246 *************************************/
12441247
1245void segaic16_video_device::segaic16_tilemap_set_colscroll(int which, int enable)
1248void segaic16_video_device::tilemap_set_colscroll(int which, int enable)
12461249{
1247   struct tilemap_info *info = &bg_tilemap[which];
1250   struct tilemap_info *info = &m_bg_tilemap[which];
12481251
12491252   enable = (enable != 0);
12501253   if (info->colscroll != enable)
r242472r242473
12621265 *
12631266 *************************************/
12641267
1265READ16_MEMBER( segaic16_video_device::segaic16_tileram_0_r )
1268READ16_MEMBER( segaic16_video_device::tileram_r )
12661269{
1267   return segaic16_tileram_0[offset];
1270   return m_tileram[offset];
12681271}
12691272
12701273
1271WRITE16_MEMBER( segaic16_video_device::segaic16_tileram_0_w )
1274WRITE16_MEMBER( segaic16_video_device::tileram_w )
12721275{
1273   COMBINE_DATA(&segaic16_tileram_0[offset]);
1274   bg_tilemap[0].tilemaps[offset / (64*32)]->mark_tile_dirty(offset % (64*32));
1276   COMBINE_DATA(&m_tileram[offset]);
1277   m_bg_tilemap[0].tilemaps[offset / (64*32)]->mark_tile_dirty(offset % (64*32));
12751278}
12761279
12771280
1278READ16_MEMBER( segaic16_video_device::segaic16_textram_0_r )
1281READ16_MEMBER( segaic16_video_device::textram_r )
12791282{
1280   return segaic16_textram_0[offset];
1283   return m_textram[offset];
12811284}
12821285
12831286
1284WRITE16_MEMBER( segaic16_video_device::segaic16_textram_0_w )
1287WRITE16_MEMBER( segaic16_video_device::textram_w )
12851288{
12861289   /* certain ranges need immediate updates */
12871290   if (offset >= 0xe80/2)
12881291      m_screen->update_partial(m_screen->vpos());
12891292
1290   COMBINE_DATA(&segaic16_textram_0[offset]);
1291   bg_tilemap[0].textmap->mark_tile_dirty(offset);
1293   COMBINE_DATA(&m_textram[offset]);
1294   m_bg_tilemap[0].textmap->mark_tile_dirty(offset);
12921295}
12931296
12941297
r242472r242473
13031306 *
13041307 *************************************/
13051308
1306void segaic16_video_device::segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase)
1309void segaic16_video_device::rotate_init(int which, int type, int colorbase)
13071310{
1308   struct rotate_info *info = &segaic16_rotate[which];
1311   struct rotate_info *info = &m_rotate[which];
13091312
13101313   /* reset the tilemap info */
13111314   memset(info, 0, sizeof(*info));
r242472r242473
13171320   switch (which)
13181321   {
13191322      case 0:
1320         info->rotateram = segaic16_rotateram_0;
1323         info->rotateram = m_rotateram;
13211324         break;
13221325
13231326      default:
1324         fatalerror("Invalid rotate index specified in segaic16_rotate_init\n");
1327         fatalerror("Invalid rotate index specified in rotate_init\n");
13251328   }
13261329
13271330   /* determine the parameters of the rotate */
r242472r242473
13321335         break;
13331336
13341337      default:
1335         fatalerror("Invalid rotate system specified in segaic16_rotate_init\n");
1338         fatalerror("Invalid rotate system specified in rotate_init\n");
13361339   }
13371340
13381341   /* allocate a buffer for swapping */
1339   info->buffer = auto_alloc_array(machine, UINT16, info->ramsize/2);
1342   info->buffer = auto_alloc_array(machine(), UINT16, info->ramsize/2);
13401343
1341   state_save_register_item(machine, "segaic16_rot", NULL, which, info->colorbase);
1342   state_save_register_item_pointer(machine, "segaic16_rot", NULL, which, ((UINT8 *) info->buffer), info->ramsize);
1344   save_item(NAME(info->colorbase), which);
1345   save_pointer(NAME((UINT8 *) info->buffer), info->ramsize, which);
13431346}
13441347
13451348
r242472r242473
13501353 *
13511354 *************************************/
13521355
1353void segaic16_video_device::segaic16_rotate_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, bitmap_ind16 &srcbitmap)
1356void segaic16_video_device::rotate_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, bitmap_ind16 &srcbitmap)
13541357{
1355   struct rotate_info *info = &segaic16_rotate[which];
1358   struct rotate_info *info = &m_rotate[which];
13561359   INT32 currx = (info->buffer[0x3f0] << 16) | info->buffer[0x3f1];
13571360   INT32 curry = (info->buffer[0x3f2] << 16) | info->buffer[0x3f3];
13581361   INT32 dyy = (info->buffer[0x3f4] << 16) | info->buffer[0x3f5];
r242472r242473
14131416 *
14141417 *************************************/
14151418
1416READ16_MEMBER( segaic16_video_device::segaic16_rotate_control_0_r )
1419READ16_MEMBER( segaic16_video_device::rotate_control_r )
14171420{
1418   struct rotate_info *info = &segaic16_rotate[0];
1421   struct rotate_info *info = &m_rotate[0];
14191422
14201423   if (info->buffer)
14211424   {
trunk/src/mame/video/segaic16.h
r242472r242473
9999   // static configuration
100100   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
101101
102   UINT8 segaic16_display_enable;
103   UINT16 *segaic16_tileram_0;
104   UINT16 *segaic16_textram_0;
105   UINT16 *segaic16_rotateram_0;
102   UINT8 m_display_enable;
103   optional_shared_ptr<UINT16> m_tileram;
104   optional_shared_ptr<UINT16> m_textram;
105   optional_shared_ptr<UINT16> m_rotateram;
106106
107   void segaic16_tilemap_set_colscroll(int which, int enable);
108   void segaic16_tilemap_set_rowscroll(int which, int enable);
109   void segaic16_tilemap_set_flip(int which, int flip);
110   void segaic16_tilemap_set_bank(int which, int banknum, int offset);
111   void segaic16_tilemap_reset(screen_device &screen);
112   void segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark);
113//  void segaic16_tilemap_16b_draw_layer(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority);
114//  void segaic16_tilemap_16a_draw_layer(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority);
115//  void segaic16_draw_virtual_tilemap(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority);
116//  void segaic16_tilemap_16b_reset(screen_device &screen, struct tilemap_info *info);
107   void tilemap_set_colscroll(int which, int enable);
108   void tilemap_set_rowscroll(int which, int enable);
109   void tilemap_set_flip(int which, int flip);
110   void tilemap_set_bank(int which, int banknum, int offset);
111   void tilemap_reset(screen_device &screen);
112   void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark);
113//  void tilemap_16b_draw_layer(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority);
114//  void tilemap_16a_draw_layer(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flags, int priority);
115//  void draw_virtual_tilemap(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority);
116//  void tilemap_16b_reset(screen_device &screen, struct tilemap_info *info);
117117
118   TIMER_CALLBACK_MEMBER( segaic16_tilemap_16b_latch_values );
118   TIMER_CALLBACK_MEMBER( tilemap_16b_latch_values );
119119
120   struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE];
121   struct tilemap_info bg_tilemap[SEGAIC16_MAX_TILEMAPS];
120   struct rotate_info m_rotate[SEGAIC16_MAX_ROTATE];
121   struct tilemap_info m_bg_tilemap[SEGAIC16_MAX_TILEMAPS];
122122
123   void segaic16_set_display_enable(int enable);
124   void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks);
125   void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase);
123   void set_display_enable(int enable);
124   void tilemap_init(int which, int type, int colorbase, int xoffs, int numbanks);
125   void rotate_init(int which, int type, int colorbase);
126126
127   DECLARE_READ16_MEMBER( segaic16_tileram_0_r );
128   DECLARE_READ16_MEMBER( segaic16_textram_0_r );
129   DECLARE_WRITE16_MEMBER( segaic16_tileram_0_w );
130   DECLARE_WRITE16_MEMBER( segaic16_textram_0_w );
127   DECLARE_READ16_MEMBER( tileram_r );
128   DECLARE_READ16_MEMBER( textram_r );
129   DECLARE_WRITE16_MEMBER( tileram_w );
130   DECLARE_WRITE16_MEMBER( textram_w );
131131
132   void segaic16_rotate_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, bitmap_ind16 &srcbitmap);
132   void rotate_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, bitmap_ind16 &srcbitmap);
133133
134   DECLARE_READ16_MEMBER( segaic16_rotate_control_0_r );
134   DECLARE_READ16_MEMBER( rotate_control_r );
135135
136   TILE_GET_INFO_MEMBER( segaic16_tilemap_16b_tile_info );
137   TILE_GET_INFO_MEMBER( segaic16_tilemap_16b_text_info );
138   TILE_GET_INFO_MEMBER( segaic16_tilemap_16b_alt_tile_info );
139   TILE_GET_INFO_MEMBER( segaic16_tilemap_16b_alt_text_info );
136   TILE_GET_INFO_MEMBER( tilemap_16b_tile_info );
137   TILE_GET_INFO_MEMBER( tilemap_16b_text_info );
138   TILE_GET_INFO_MEMBER( tilemap_16b_alt_tile_info );
139   TILE_GET_INFO_MEMBER( tilemap_16b_alt_text_info );
140140
141   TILE_GET_INFO_MEMBER( segaic16_tilemap_16a_tile_info );
142   TILE_GET_INFO_MEMBER( segaic16_tilemap_16a_text_info );
141   TILE_GET_INFO_MEMBER( tilemap_16a_tile_info );
142   TILE_GET_INFO_MEMBER( tilemap_16a_text_info );
143143
144144protected:
145145   // device-level overrides
146   virtual void device_config_complete();
147146   virtual void device_start();
148147   virtual void device_reset();
149148
trunk/src/mame/video/segaorun.c
r242472r242473
2020   if (m_shangon_video)
2121   {
2222      // initialize the tile/text layers
23      m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B_ALT, 0x000, 0, 2);
23      m_segaic16vid->tilemap_init(0, SEGAIC16_TILEMAP_16B_ALT, 0x000, 0, 2);
2424
2525      // initialize the road
2626      m_segaic16road->segaic16_road_init(machine(), 0, SEGAIC16_ROAD_OUTRUN, 0x7f6, 0x7c0, 0x7c0, 0);
r242472r242473
2828   else
2929   {
3030      // initialize the tile/text layers
31      m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 2);
31      m_segaic16vid->tilemap_init(0, SEGAIC16_TILEMAP_16B, 0x000, 0, 2);
3232
3333      // initialize the road
3434      m_segaic16road->segaic16_road_init(machine(), 0, SEGAIC16_ROAD_OUTRUN, 0x400, 0x420, 0x780, 0);
r242472r242473
5353   m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
5454
5555   // draw background
56   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
57   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
56   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
57   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
5858
5959   // draw foreground
60   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
61   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
60   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
61   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
6262
6363   // draw the high priority road
6464   m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
r242472r242473
6666   // text layer
6767   // note that we inflate the priority of the text layer to prevent sprites
6868   // from drawing over the high scores
69   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
70   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
69   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
70   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
7171
7272   // mix in sprites
7373   bitmap_ind16 &sprites = m_sprites->bitmap();
r242472r242473
106106UINT32 segaorun_state::screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
107107{
108108   // if no drawing is happening, fill with black and get out
109   if (!m_segaic16vid->segaic16_display_enable)
109   if (!m_segaic16vid->m_display_enable)
110110   {
111111      bitmap.fill(m_palette->black_pen(), cliprect);
112112      return 0;
r242472r242473
122122   m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
123123
124124   // draw background
125   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
126   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
125   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
126   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
127127
128128   // draw foreground
129   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
130   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
129   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
130   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
131131
132132   // draw the high priority road
133133   m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
134134
135135   // text layer
136   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
137   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
136   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
137   m_segaic16vid->tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
138138
139139   // mix in sprites
140140   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segas16a.c
r242472r242473
1818void segas16a_state::video_start()
1919{
2020   // initialize the tile/text layers
21   m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16A, 0x000, 0, 1);
21   m_segaic16vid->tilemap_init( 0, SEGAIC16_TILEMAP_16A, 0x000, 0, 1);
2222}
2323
2424
r242472r242473
2929UINT32 segas16a_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3030{
3131   // if no drawing is happening, fill with black and get out
32   if (!m_segaic16vid->segaic16_display_enable)
32   if (!m_segaic16vid->m_display_enable)
3333   {
3434      bitmap.fill(m_palette->black_pen(), cliprect);
3535      return 0;
r242472r242473
4242   screen.priority().fill(0, cliprect);
4343
4444   // draw background opaquely first, not setting any priorities
45   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
46   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
45   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
46   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
4747
4848   // draw background again, just to set the priorities on non-transparent pixels
4949   bitmap_ind16 dummy_bitmap;
50   m_segaic16vid->segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
51   m_segaic16vid->segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
50   m_segaic16vid->tilemap_draw( screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
51   m_segaic16vid->tilemap_draw( screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
5252
5353   // draw foreground
54   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
55   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
54   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
55   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
5656
5757   // text layer
58   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
59   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
58   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
59   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
6060
6161   // mix in sprites
6262   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segas16b.c
r242472r242473
1818void segas16b_state::video_start()
1919{
2020   // initialize the tile/text layers
21   m_segaic16vid->segaic16_tilemap_init(machine(), 0, m_tilemap_type, 0x000, 0, 2);
21   m_segaic16vid->tilemap_init( 0, m_tilemap_type, 0x000, 0, 2);
2222}
2323
2424
r242472r242473
2929UINT32 segas16b_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3030{
3131   // if no drawing is happening, fill with black and get out
32   if (!m_segaic16vid->segaic16_display_enable)
32   if (!m_segaic16vid->m_display_enable)
3333   {
3434      bitmap.fill(m_palette->black_pen(), cliprect);
3535      return 0;
r242472r242473
4242   screen.priority().fill(0, cliprect);
4343
4444   // draw background opaquely first, not setting any priorities
45   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
46   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
45   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
46   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
4747
4848   // draw background again, just to set the priorities on non-transparent pixels
4949   bitmap_ind16 dummy_bitmap;
50   m_segaic16vid->segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
51   m_segaic16vid->segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
50   m_segaic16vid->tilemap_draw( screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
51   m_segaic16vid->tilemap_draw( screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
5252
5353   // draw foreground
54   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
55   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
54   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
55   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
5656
5757   // text layer
58   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
59   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
58   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
59   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
6060
6161   // mix in sprites
6262   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segas18.c
r242472r242473
3434   m_vdp_mixing = 0;
3535
3636   // initialize the tile/text layers
37   m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 8);
37   m_segaic16vid->tilemap_init( 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 8);
3838
3939   save_item(NAME(m_grayscale_enable));
4040   save_item(NAME(m_vdp_enable));
r242472r242473
187187#endif
188188
189189   // if no drawing is happening, fill with black and get out
190   if (!m_segaic16vid->segaic16_display_enable)
190   if (!m_segaic16vid->m_display_enable)
191191   {
192192      bitmap.fill(m_palette->black_pen(), cliprect);
193193      return 0;
r242472r242473
200200   screen.priority().fill(0, cliprect);
201201
202202   // draw background opaquely first, not setting any priorities
203   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
204   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
203   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
204   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
205205   if (m_vdp_enable && vdplayer == 0) draw_vdp(screen, bitmap, cliprect, vdppri);
206206
207207   // draw background again to draw non-transparent pixels over the VDP and set the priority
208   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
209   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
208   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
209   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
210210   if (m_vdp_enable && vdplayer == 1) draw_vdp(screen, bitmap, cliprect, vdppri);
211211
212212   // draw foreground
213   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
214   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
213   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
214   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
215215   if (m_vdp_enable && vdplayer == 2) draw_vdp(screen, bitmap, cliprect, vdppri);
216216
217217   // text layer
218   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
219   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
218   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
219   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
220220   if (m_vdp_enable && vdplayer == 3) draw_vdp(screen, bitmap, cliprect, vdppri);
221221
222222   // mix in sprites
trunk/src/mame/video/segaxbd.c
r242472r242473
1717void segaxbd_state::video_start()
1818{
1919   // initialize the tile/text layers
20   m_segaic16vid->segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x1c00, 0, 2);
20   m_segaic16vid->tilemap_init( 0, SEGAIC16_TILEMAP_16B, 0x1c00, 0, 2);
2121
2222   // initialize the road
2323   m_segaic16road->segaic16_road_init(machine(), 0, SEGAIC16_ROAD_XBOARD, 0x1700, 0x1720, 0x1780, -166);
r242472r242473
3232UINT32 segaxbd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3333{
3434   // if no drawing is happening, fill with black and get out
35   if (!m_segaic16vid->segaic16_display_enable)
35   if (!m_segaic16vid->m_display_enable)
3636   {
3737      bitmap.fill(m_palette->black_pen(), cliprect);
3838      return 0;
r242472r242473
5050      m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
5151
5252   // draw background
53   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
54   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
53   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
54   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
5555
5656   // draw foreground
57   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
58   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
57   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
58   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
5959
6060   // draw the high priority road
6161   if (m_road_priority == 1)
6262      m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
6363
6464   // text layer
65   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
66   m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
65   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
66   m_segaic16vid->tilemap_draw( screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
6767
6868   // mix in sprites
6969   bitmap_ind16 &sprites = m_sprites->bitmap();
trunk/src/mame/video/segaybd.c
r242472r242473
1717void segaybd_state::video_start()
1818{
1919   // initialize the rotation layer
20   m_segaic16vid->segaic16_rotate_init(machine(), 0, SEGAIC16_ROTATE_YBOARD, 0x000);
21   m_ysprites->set_rotate_ptr(m_segaic16vid->segaic16_rotate);
20   m_segaic16vid->rotate_init(0, SEGAIC16_ROTATE_YBOARD, 0x000);
21   m_ysprites->set_rotate_ptr(m_segaic16vid->m_rotate);
2222}
2323
2424
r242472r242473
3030UINT32 segaybd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3131{
3232   // if no drawing is happening, fill with black and get out
33   if (!m_segaic16vid->segaic16_display_enable)
33   if (!m_segaic16vid->m_display_enable)
3434   {
3535      bitmap.fill(m_palette->black_pen(), cliprect);
3636      return 0;
r242472r242473
4343   m_bsprites->draw_async(cliprect);
4444
4545   // apply rotation
46   m_segaic16vid->segaic16_rotate_draw(0, bitmap, cliprect, screen.priority(), m_ysprites->bitmap());
46   m_segaic16vid->rotate_draw(0, bitmap, cliprect, screen.priority(), m_ysprites->bitmap());
4747
4848   // mix in 16B sprites
4949   bitmap_ind16 &sprites = m_bsprites->bitmap();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team