trunk/src/mame/drivers/segas16a.c
| r24081 | r24082 | |
| 232 | 232 | m_video_control = data; |
| 233 | 233 | |
| 234 | 234 | // bit 7: screen flip |
| 235 | | segaic16_tilemap_set_flip(machine(), 0, data & 0x80); |
| 235 | m_segaic16vid->segaic16_tilemap_set_flip(machine(), 0, data & 0x80); |
| 236 | 236 | m_sprites->set_flip(data & 0x80); |
| 237 | 237 | |
| 238 | 238 | // bit 6: set 8751 interrupt line |
| r24081 | r24082 | |
| 240 | 240 | m_mcu->set_input_line(MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); |
| 241 | 241 | |
| 242 | 242 | // bit 4: enable display |
| 243 | | segaic16_set_display_enable(machine(), data & 0x10); |
| 243 | m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x10); |
| 244 | 244 | |
| 245 | 245 | // bits 0 & 1: update coin counters |
| 246 | 246 | coin_counter_w(machine(), 1, data & 0x02); |
| r24081 | r24082 | |
| 269 | 269 | // 1= sound is enabled |
| 270 | 270 | // |
| 271 | 271 | 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); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| r24081 | r24082 | |
| 500 | 500 | |
| 501 | 501 | // enable/disable the display |
| 502 | 502 | if (data & 0x40) |
| 503 | | segaic16_set_display_enable(machine(), 1); |
| 503 | m_segaic16vid->segaic16_set_display_enable(machine(), 1); |
| 504 | 504 | |
| 505 | 505 | // apply an extra boost if the main CPU is just waking up |
| 506 | 506 | if ((m_mcu_control ^ data) & 0x40) |
| r24081 | r24082 | |
| 760 | 760 | |
| 761 | 761 | // X scroll values |
| 762 | 762 | 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); |
| 765 | 765 | |
| 766 | 766 | // 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); |
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | |
| r24081 | r24082 | |
| 997 | 997 | static ADDRESS_MAP_START( system16a_map, AS_PROGRAM, 16, segas16a_state ) |
| 998 | 998 | ADDRESS_MAP_UNMAP_HIGH |
| 999 | 999 | 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") |
| 1002 | 1002 | AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_SHARE("sprites") |
| 1003 | 1003 | AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 1004 | 1004 | AM_RANGE(0xc40000, 0xc43fff) AM_MIRROR(0x39c000) AM_READWRITE(misc_io_r, misc_io_w) |
| r24081 | r24082 | |
| 1950 | 1950 | MCFG_SCREEN_UPDATE_DRIVER(segas16a_state, screen_update) |
| 1951 | 1951 | |
| 1952 | 1952 | MCFG_SEGA_SYS16A_SPRITES_ADD("sprites") |
| 1953 | MCFG_SEGAIC16VID_ADD("segaic16vid") |
| 1953 | 1954 | |
| 1954 | 1955 | MCFG_GFXDECODE(segas16a) |
| 1955 | 1956 | MCFG_PALETTE_LENGTH(2048*3) |
| r24081 | r24082 | |
| 3403 | 3404 | m_custom_io_w = write16_delegate(FUNC(segas16a_state::standard_io_w), this); |
| 3404 | 3405 | |
| 3405 | 3406 | // 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()); |
| 3408 | 3409 | |
| 3409 | 3410 | // save state |
| 3410 | 3411 | save_item(NAME(m_video_control)); |
trunk/src/mame/drivers/segahang.c
| r24081 | r24082 | |
| 118 | 118 | // |
| 119 | 119 | |
| 120 | 120 | // bit 7: screen flip |
| 121 | | segaic16_tilemap_set_flip(machine(), 0, data & 0x80); |
| 121 | m_segaic16vid->segaic16_tilemap_set_flip(machine(), 0, data & 0x80); |
| 122 | 122 | m_sprites->set_flip(data & 0x80); |
| 123 | 123 | |
| 124 | 124 | // bit 6: shadow/highlight control |
| 125 | 125 | m_shadow = ~data & 0x40; |
| 126 | 126 | |
| 127 | 127 | // bit 4: enable display |
| 128 | | segaic16_set_display_enable(machine(), data & 0x10); |
| 128 | m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x10); |
| 129 | 129 | |
| 130 | 130 | // bits 2 & 3: control the lamps |
| 131 | 131 | set_led_status(machine(), 1, data & 0x08); |
| r24081 | r24082 | |
| 161 | 161 | m_soundcpu->set_input_line(INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); |
| 162 | 162 | |
| 163 | 163 | // 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); |
| 166 | 166 | |
| 167 | 167 | // bit 0: sound mute |
| 168 | 168 | machine().sound().system_enable(data & 0x01); |
| r24081 | r24082 | |
| 409 | 409 | void segahang_state::machine_reset() |
| 410 | 410 | { |
| 411 | 411 | // reset misc components |
| 412 | | segaic16_tilemap_reset(machine(), 0); |
| 412 | m_segaic16vid->segaic16_tilemap_reset(machine(), 0); |
| 413 | 413 | |
| 414 | 414 | // queue up a timer to either boost interleave or disable the MCU |
| 415 | 415 | synchronize(TID_INIT_I8751); |
| r24081 | r24082 | |
| 472 | 472 | ADDRESS_MAP_UNMAP_HIGH |
| 473 | 473 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 474 | 474 | 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") |
| 477 | 477 | AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_SHARE("sprites") |
| 478 | 478 | AM_RANGE(0xa00000, 0xa00fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 479 | 479 | AM_RANGE(0xc00000, 0xc3ffff) AM_ROM AM_REGION("subcpu", 0) |
| r24081 | r24082 | |
| 486 | 486 | ADDRESS_MAP_UNMAP_HIGH |
| 487 | 487 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 488 | 488 | 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") |
| 491 | 491 | AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 492 | 492 | AM_RANGE(0x124000, 0x127fff) AM_RAM AM_SHARE("subram") |
| 493 | 493 | AM_RANGE(0x130000, 0x130fff) AM_RAM AM_SHARE("sprites") |
| r24081 | r24082 | |
| 845 | 845 | MCFG_I8255_ADD( "i8255_1", hangon_ppi_intf_0 ) |
| 846 | 846 | MCFG_I8255_ADD( "i8255_2", hangon_ppi_intf_1 ) |
| 847 | 847 | |
| 848 | MCFG_SEGAIC16VID_ADD("segaic16vid") |
| 849 | |
| 848 | 850 | // video hardware |
| 849 | 851 | MCFG_GFXDECODE(segahang) |
| 850 | 852 | MCFG_PALETTE_LENGTH(2048*3) |
| r24081 | r24082 | |
| 1815 | 1817 | DRIVER_INIT_MEMBER(segahang_state,generic) |
| 1816 | 1818 | { |
| 1817 | 1819 | // 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()); |
| 1821 | 1823 | |
| 1822 | 1824 | // save states |
| 1823 | 1825 | save_item(NAME(m_adc_select)); |
trunk/src/mame/drivers/segaorun.c
| r24081 | r24082 | |
| 396 | 396 | // D1: (CONT) - affects sprite hardware |
| 397 | 397 | // D0: Sound section reset (1= normal operation, 0= reset) |
| 398 | 398 | |
| 399 | | segaic16_set_display_enable(machine(), data & 0x20); |
| 399 | m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x20); |
| 400 | 400 | m_adc_select = (data >> 2) & 7; |
| 401 | 401 | m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); |
| 402 | 402 | } |
| r24081 | r24082 | |
| 417 | 417 | switch (index) |
| 418 | 418 | { |
| 419 | 419 | 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)); |
| 421 | 421 | mapper.map_as_ram(0x80000, 0x01000, 0xf0f000, "roadram", write16_delegate()); |
| 422 | 422 | mapper.map_as_ram(0x60000, 0x08000, 0xf18000, "cpu1ram", write16_delegate()); |
| 423 | 423 | mapper.map_as_ram(0x00000, 0x60000, 0xf00000, "cpu1rom", write16_delegate(FUNC(segaorun_state::nop_w), this)); |
| r24081 | r24082 | |
| 436 | 436 | break; |
| 437 | 437 | |
| 438 | 438 | 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)); |
| 441 | 441 | break; |
| 442 | 442 | |
| 443 | 443 | case 0: |
| r24081 | r24082 | |
| 543 | 543 | // reset misc components |
| 544 | 544 | if (m_custom_map != NULL) |
| 545 | 545 | m_mapper->configure_explicit(m_custom_map); |
| 546 | | segaic16_tilemap_reset(machine(), 0); |
| 546 | m_segaic16vid->segaic16_tilemap_reset(machine(), 0); |
| 547 | 547 | |
| 548 | 548 | // hook the RESET line, which resets CPU #1 |
| 549 | 549 | m68k_set_reset_callback(m_maincpu, m68k_reset_callback); |
| r24081 | r24082 | |
| 747 | 747 | // D7-D6: (ADC1-0) |
| 748 | 748 | // D5: Screen display |
| 749 | 749 | 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); |
| 751 | 751 | return; |
| 752 | 752 | |
| 753 | 753 | case 0x0020/2: |
| r24081 | r24082 | |
| 833 | 833 | AM_RANGE(0x000000, 0x05ffff) AM_ROM AM_SHARE("cpu1rom") |
| 834 | 834 | AM_RANGE(0x060000, 0x067fff) AM_MIRROR(0x018000) AM_RAM AM_SHARE("cpu1ram") |
| 835 | 835 | 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) |
| 837 | 837 | ADDRESS_MAP_END |
| 838 | 838 | |
| 839 | 839 | |
| r24081 | r24082 | |
| 1091 | 1091 | MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_25MHz/4, 400, 0, 320, 262, 0, 224) |
| 1092 | 1092 | MCFG_SCREEN_UPDATE_DRIVER(segaorun_state, screen_update_outrun) |
| 1093 | 1093 | |
| 1094 | MCFG_SEGAIC16VID_ADD("segaic16vid") |
| 1095 | |
| 1094 | 1096 | // sound hardware |
| 1095 | 1097 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1096 | 1098 | |
| r24081 | r24082 | |
| 2120 | 2122 | m_nvram->set_base(m_workram, m_workram.bytes()); |
| 2121 | 2123 | |
| 2122 | 2124 | // 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()); |
| 2126 | 2128 | |
| 2127 | 2129 | // save state |
| 2128 | 2130 | save_item(NAME(m_adc_select)); |
trunk/src/mame/drivers/segaxbd.c
| r24081 | r24082 | |
| 479 | 479 | if (((oldval ^ data) & 0x40) && !(data & 0x40)) |
| 480 | 480 | machine().watchdog_reset(); |
| 481 | 481 | |
| 482 | | segaic16_set_display_enable(machine(), data & 0x20); |
| 482 | m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x20); |
| 483 | 483 | |
| 484 | 484 | m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); |
| 485 | 485 | if (m_soundcpu2 != NULL) |
| r24081 | r24082 | |
| 670 | 670 | |
| 671 | 671 | void segaxbd_state::machine_reset() |
| 672 | 672 | { |
| 673 | | segaic16_tilemap_reset(machine(), 0); |
| 673 | m_segaic16vid->segaic16_tilemap_reset(machine(), 0); |
| 674 | 674 | |
| 675 | 675 | // hook the RESET line, which resets CPU #1 |
| 676 | 676 | m68k_set_reset_callback(m_maincpu, &segaxbd_state::m68k_reset_callback); |
| r24081 | r24082 | |
| 907 | 907 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 908 | 908 | AM_RANGE(0x080000, 0x083fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("backup1") |
| 909 | 909 | 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") |
| 912 | 912 | AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_DEVREADWRITE("multiplier_main", sega_315_5248_multiplier_device, read, write) |
| 913 | 913 | AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("divider_main", sega_315_5249_divider_device, read, write) |
| 914 | 914 | AM_RANGE(0x0e8000, 0x0e801f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("cmptimer_main", sega_315_5250_compare_timer_device, read, write) |
| r24081 | r24082 | |
| 926 | 926 | AM_RANGE(0x2e4000, 0x2e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("divider_subx", sega_315_5249_divider_device, read, write) |
| 927 | 927 | AM_RANGE(0x2e8000, 0x2e800f) AM_MIRROR(0x003ff0) AM_DEVREADWRITE("cmptimer_subx", sega_315_5250_compare_timer_device, read, write) |
| 928 | 928 | 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) |
| 930 | 930 | // AM_RANGE(0x2f0000, 0x2f3fff) AM_READWRITE(excs_r, excs_w) |
| 931 | 931 | AM_RANGE(0x3f8000, 0x3fbfff) AM_RAM AM_SHARE("backup1") |
| 932 | 932 | AM_RANGE(0x3fc000, 0x3fffff) AM_RAM AM_SHARE("backup2") |
| r24081 | r24082 | |
| 948 | 948 | AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("divider_subx", sega_315_5249_divider_device, read, write) |
| 949 | 949 | AM_RANGE(0x0e8000, 0x0e800f) AM_MIRROR(0x003ff0) AM_DEVREADWRITE("cmptimer_subx", sega_315_5250_compare_timer_device, read, write) |
| 950 | 950 | 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) |
| 952 | 952 | // AM_RANGE(0x0f0000, 0x0f3fff) AM_READWRITE(excs_r, excs_w) |
| 953 | 953 | ADDRESS_MAP_END |
| 954 | 954 | |
| r24081 | r24082 | |
| 1594 | 1594 | MCFG_SCREEN_UPDATE_DRIVER(segaxbd_state, screen_update) |
| 1595 | 1595 | |
| 1596 | 1596 | MCFG_SEGA_XBOARD_SPRITES_ADD("sprites") |
| 1597 | MCFG_SEGAIC16VID_ADD("segaic16vid") |
| 1597 | 1598 | |
| 1598 | 1599 | // sound hardware |
| 1599 | 1600 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| r24081 | r24082 | |
| 3198 | 3199 | m_iochip_custom_io_w[0][3] = iowrite_delegate(FUNC(segaxbd_state::generic_iochip0_lamps_w), this); |
| 3199 | 3200 | |
| 3200 | 3201 | // 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()); |
| 3204 | 3205 | |
| 3205 | 3206 | // save state |
| 3206 | 3207 | save_item(NAME(m_timer_irq_state)); |
trunk/src/mame/drivers/segas16b.c
| r24081 | r24082 | |
| 924 | 924 | // requests |
| 925 | 925 | //------------------------------------------------- |
| 926 | 926 | |
| 927 | |
| 928 | |
| 929 | |
| 930 | |
| 927 | 931 | void segas16b_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index) |
| 928 | 932 | { |
| 929 | 933 | switch (index) |
| r24081 | r24082 | |
| 937 | 941 | break; |
| 938 | 942 | |
| 939 | 943 | 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)); |
| 942 | 946 | break; |
| 943 | 947 | |
| 944 | 948 | case 4: // 2k of spriteram |
| r24081 | r24082 | |
| 1028 | 1032 | WRITE16_MEMBER( segas16b_state::rom_5704_bank_w ) |
| 1029 | 1033 | { |
| 1030 | 1034 | 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); |
| 1032 | 1036 | } |
| 1033 | 1037 | |
| 1034 | 1038 | |
| r24081 | r24082 | |
| 1076 | 1080 | |
| 1077 | 1081 | case 0x2000/2: |
| 1078 | 1082 | 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); |
| 1080 | 1084 | break; |
| 1081 | 1085 | } |
| 1082 | 1086 | } |
| r24081 | r24082 | |
| 1149 | 1153 | // D1 : (Output to coin counter 2?) |
| 1150 | 1154 | // D0 : Output to coin counter 1 |
| 1151 | 1155 | // |
| 1152 | | segaic16_tilemap_set_flip(machine(), 0, data & 0x40); |
| 1156 | m_segaic16vid->segaic16_tilemap_set_flip(machine(), 0, data & 0x40); |
| 1153 | 1157 | m_sprites->set_flip(data & 0x40); |
| 1154 | 1158 | if (!m_disable_screen_blanking) |
| 1155 | | segaic16_set_display_enable(machine(), data & 0x20); |
| 1159 | m_segaic16vid->segaic16_set_display_enable(machine(), data & 0x20); |
| 1156 | 1160 | set_led_status(machine(), 1, data & 0x08); |
| 1157 | 1161 | set_led_status(machine(), 0, data & 0x04); |
| 1158 | 1162 | coin_counter_w(machine(), 1, data & 0x02); |
| r24081 | r24082 | |
| 1314 | 1318 | synchronize(TID_INIT_I8751); |
| 1315 | 1319 | |
| 1316 | 1320 | // reset tilemap state |
| 1317 | | segaic16_tilemap_reset(machine(), 0); |
| 1321 | m_segaic16vid->segaic16_tilemap_reset(machine(), 0); |
| 1318 | 1322 | |
| 1319 | 1323 | // configure sprite banks |
| 1320 | 1324 | static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; |
| r24081 | r24082 | |
| 3305 | 3309 | MCFG_SCREEN_UPDATE_DRIVER(segas16b_state, screen_update) |
| 3306 | 3310 | |
| 3307 | 3311 | MCFG_SEGA_SYS16B_SPRITES_ADD("sprites") |
| 3312 | MCFG_SEGAIC16VID_ADD("segaic16vid") |
| 3308 | 3313 | |
| 3309 | 3314 | // sound hardware |
| 3310 | 3315 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r24081 | r24082 | |
| 6434 | 6439 | m_custom_io_w = write16_delegate(FUNC(segas16b_state::standard_io_w), this); |
| 6435 | 6440 | |
| 6436 | 6441 | // 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()); |
| 6439 | 6444 | |
| 6440 | 6445 | // save state |
| 6441 | 6446 | save_item(NAME(m_atomicp_sound_count)); |
| r24081 | r24082 | |
| 6462 | 6467 | // configure special behaviors for the Korean boards |
| 6463 | 6468 | m_disable_screen_blanking = true; |
| 6464 | 6469 | m_atomicp_sound_divisor = 1; |
| 6465 | | segaic16_display_enable = 1; |
| 6470 | m_segaic16vid->segaic16_display_enable = 1; |
| 6466 | 6471 | |
| 6467 | 6472 | // allocate a sound timer |
| 6468 | 6473 | emu_timer *timer = timer_alloc(TID_ATOMICP_SOUND_IRQ); |
| r24081 | r24082 | |
| 7018 | 7023 | 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 |
| 7019 | 7024 | AM_RANGE(0x200000, 0x23ffff) AM_RAM // used during startup for decompression |
| 7020 | 7025 | 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") |
| 7023 | 7028 | AM_RANGE(0x440000, 0x4407ff) AM_RAM AM_SHARE("sprites") |
| 7024 | 7029 | AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 7025 | 7030 | AM_RANGE(0xc40000, 0xc43fff) AM_READWRITE(standard_io_r, standard_io_w) |
| r24081 | r24082 | |
| 7155 | 7160 | |
| 7156 | 7161 | void isgsm_state::machine_reset() |
| 7157 | 7162 | { |
| 7158 | | segaic16_tilemap_reset(machine(), 0); |
| 7163 | m_segaic16vid->segaic16_tilemap_reset(machine(), 0); |
| 7159 | 7164 | |
| 7160 | 7165 | // configure sprite banks |
| 7161 | 7166 | for (int i = 0; i < 16; i++) |
trunk/src/mame/video/segas16a.c
| r24081 | r24082 | |
| 47 | 47 | void segas16a_state::video_start() |
| 48 | 48 | { |
| 49 | 49 | // 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); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| r24081 | r24082 | |
| 58 | 58 | UINT32 segas16a_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 59 | 59 | { |
| 60 | 60 | // if no drawing is happening, fill with black and get out |
| 61 | | if (!segaic16_display_enable) |
| 61 | if (!m_segaic16vid->segaic16_display_enable) |
| 62 | 62 | { |
| 63 | 63 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 64 | 64 | return 0; |
| r24081 | r24082 | |
| 71 | 71 | machine().priority_bitmap.fill(0, cliprect); |
| 72 | 72 | |
| 73 | 73 | // 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); |
| 76 | 76 | |
| 77 | 77 | // draw background again, just to set the priorities on non-transparent pixels |
| 78 | 78 | 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); |
| 81 | 81 | |
| 82 | 82 | // 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); |
| 85 | 85 | |
| 86 | 86 | // 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); |
| 89 | 89 | |
| 90 | 90 | // mix in sprites |
| 91 | 91 | bitmap_ind16 &sprites = m_sprites->bitmap(); |
trunk/src/mame/video/segahang.c
| r24081 | r24082 | |
| 47 | 47 | void segahang_state::video_start() |
| 48 | 48 | { |
| 49 | 49 | // 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); |
| 51 | 51 | |
| 52 | 52 | // 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); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| r24081 | r24082 | |
| 61 | 61 | UINT32 segahang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 62 | 62 | { |
| 63 | 63 | // if no drawing is happening, fill with black and get out |
| 64 | | if (!segaic16_display_enable) |
| 64 | if (!m_segaic16vid->segaic16_display_enable) |
| 65 | 65 | { |
| 66 | 66 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 67 | 67 | return 0; |
| r24081 | r24082 | |
| 74 | 74 | machine().priority_bitmap.fill(0, cliprect); |
| 75 | 75 | |
| 76 | 76 | // 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); |
| 78 | 78 | |
| 79 | 79 | // 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); |
| 82 | 82 | |
| 83 | 83 | // 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); |
| 86 | 86 | |
| 87 | 87 | // 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); |
| 89 | 89 | |
| 90 | 90 | // text layer |
| 91 | 91 | // note that we inflate the priority of the text layer to prevent sprites |
| 92 | 92 | // 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); |
| 95 | 95 | |
| 96 | 96 | // mix in sprites |
| 97 | 97 | bitmap_ind16 &sprites = m_sprites->bitmap(); |
trunk/src/mame/video/segas16b.c
| r24081 | r24082 | |
| 47 | 47 | void segas16b_state::video_start() |
| 48 | 48 | { |
| 49 | 49 | // 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); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| r24081 | r24082 | |
| 58 | 58 | UINT32 segas16b_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 59 | 59 | { |
| 60 | 60 | // if no drawing is happening, fill with black and get out |
| 61 | | if (!segaic16_display_enable) |
| 61 | if (!m_segaic16vid->segaic16_display_enable) |
| 62 | 62 | { |
| 63 | 63 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 64 | 64 | return 0; |
| r24081 | r24082 | |
| 71 | 71 | machine().priority_bitmap.fill(0, cliprect); |
| 72 | 72 | |
| 73 | 73 | // 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); |
| 76 | 76 | |
| 77 | 77 | // draw background again, just to set the priorities on non-transparent pixels |
| 78 | 78 | 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); |
| 81 | 81 | |
| 82 | 82 | // 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); |
| 85 | 85 | |
| 86 | 86 | // 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); |
| 89 | 89 | |
| 90 | 90 | // mix in sprites |
| 91 | 91 | bitmap_ind16 &sprites = m_sprites->bitmap(); |
trunk/src/mame/video/segas18.c
| r24081 | r24082 | |
| 63 | 63 | m_vdp_mixing = 0; |
| 64 | 64 | |
| 65 | 65 | // 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); |
| 67 | 67 | |
| 68 | 68 | save_item(NAME(m_grayscale_enable)); |
| 69 | 69 | save_item(NAME(m_vdp_enable)); |
| r24081 | r24082 | |
| 216 | 216 | #endif |
| 217 | 217 | |
| 218 | 218 | // if no drawing is happening, fill with black and get out |
| 219 | | if (!segaic16_display_enable) |
| 219 | if (!m_segaic16vid->segaic16_display_enable) |
| 220 | 220 | { |
| 221 | 221 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 222 | 222 | return 0; |
| r24081 | r24082 | |
| 229 | 229 | machine().priority_bitmap.fill(0, cliprect); |
| 230 | 230 | |
| 231 | 231 | // 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); |
| 234 | 234 | if (m_vdp_enable && vdplayer == 0) draw_vdp(screen, bitmap, cliprect, vdppri); |
| 235 | 235 | |
| 236 | 236 | // 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); |
| 239 | 239 | if (m_vdp_enable && vdplayer == 1) draw_vdp(screen, bitmap, cliprect, vdppri); |
| 240 | 240 | |
| 241 | 241 | // 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); |
| 244 | 244 | if (m_vdp_enable && vdplayer == 2) draw_vdp(screen, bitmap, cliprect, vdppri); |
| 245 | 245 | |
| 246 | 246 | // 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); |
| 249 | 249 | if (m_vdp_enable && vdplayer == 3) draw_vdp(screen, bitmap, cliprect, vdppri); |
| 250 | 250 | |
| 251 | 251 | // mix in sprites |
trunk/src/mame/video/segaxbd.c
| r24081 | r24082 | |
| 46 | 46 | void segaxbd_state::video_start() |
| 47 | 47 | { |
| 48 | 48 | // 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); |
| 50 | 50 | |
| 51 | 51 | // 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); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| r24081 | r24082 | |
| 61 | 61 | UINT32 segaxbd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 62 | 62 | { |
| 63 | 63 | // if no drawing is happening, fill with black and get out |
| 64 | | if (!segaic16_display_enable) |
| 64 | if (!m_segaic16vid->segaic16_display_enable) |
| 65 | 65 | { |
| 66 | 66 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 67 | 67 | return 0; |
| r24081 | r24082 | |
| 74 | 74 | machine().priority_bitmap.fill(0, cliprect); |
| 75 | 75 | |
| 76 | 76 | // 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); |
| 78 | 78 | 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); |
| 80 | 80 | |
| 81 | 81 | // 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); |
| 84 | 84 | |
| 85 | 85 | // 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); |
| 88 | 88 | |
| 89 | 89 | // draw the high priority road |
| 90 | 90 | 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); |
| 92 | 92 | |
| 93 | 93 | // 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); |
| 96 | 96 | |
| 97 | 97 | // mix in sprites |
| 98 | 98 | bitmap_ind16 &sprites = m_sprites->bitmap(); |
trunk/src/mame/video/segaorun.c
| r24081 | r24082 | |
| 49 | 49 | if (m_shangon_video) |
| 50 | 50 | { |
| 51 | 51 | // 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); |
| 53 | 53 | |
| 54 | 54 | // 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); |
| 56 | 56 | } |
| 57 | 57 | else |
| 58 | 58 | { |
| 59 | 59 | // 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); |
| 61 | 61 | |
| 62 | 62 | // 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); |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| r24081 | r24082 | |
| 79 | 79 | machine().priority_bitmap.fill(0, cliprect); |
| 80 | 80 | |
| 81 | 81 | // 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); |
| 83 | 83 | |
| 84 | 84 | // 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); |
| 87 | 87 | |
| 88 | 88 | // 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); |
| 91 | 91 | |
| 92 | 92 | // 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); |
| 94 | 94 | |
| 95 | 95 | // text layer |
| 96 | 96 | // note that we inflate the priority of the text layer to prevent sprites |
| 97 | 97 | // 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); |
| 100 | 100 | |
| 101 | 101 | // mix in sprites |
| 102 | 102 | bitmap_ind16 &sprites = m_sprites->bitmap(); |
| r24081 | r24082 | |
| 135 | 135 | UINT32 segaorun_state::screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 136 | 136 | { |
| 137 | 137 | // if no drawing is happening, fill with black and get out |
| 138 | | if (!segaic16_display_enable) |
| 138 | if (!m_segaic16vid->segaic16_display_enable) |
| 139 | 139 | { |
| 140 | 140 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 141 | 141 | return 0; |
| r24081 | r24082 | |
| 148 | 148 | machine().priority_bitmap.fill(0, cliprect); |
| 149 | 149 | |
| 150 | 150 | // 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); |
| 152 | 152 | |
| 153 | 153 | // 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); |
| 156 | 156 | |
| 157 | 157 | // 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); |
| 160 | 160 | |
| 161 | 161 | // 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); |
| 163 | 163 | |
| 164 | 164 | // 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); |
| 167 | 167 | |
| 168 | 168 | // mix in sprites |
| 169 | 169 | bitmap_ind16 &sprites = m_sprites->bitmap(); |
trunk/src/mame/video/segaic16.c
| r24081 | r24082 | |
| 369 | 369 | |
| 370 | 370 | |
| 371 | 371 | |
| 372 | | /************************************* |
| 373 | | * |
| 374 | | * Globals |
| 375 | | * |
| 376 | | *************************************/ |
| 372 | const device_type SEGAIC16VID = &device_creator<segaic16_video_device>; |
| 377 | 373 | |
| 378 | | UINT8 segaic16_display_enable; |
| 379 | | UINT16 *segaic16_tileram_0; |
| 380 | | UINT16 *segaic16_textram_0; |
| 381 | | UINT16 *segaic16_roadram_0; |
| 382 | | UINT16 *segaic16_rotateram_0; |
| 374 | segaic16_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 | } |
| 383 | 378 | |
| 384 | | struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE]; |
| 385 | | struct road_info segaic16_road[SEGAIC16_MAX_ROADS]; |
| 386 | 379 | |
| 380 | void segaic16_video_device::device_config_complete() |
| 381 | { |
| 387 | 382 | |
| 383 | } |
| 388 | 384 | |
| 389 | | /************************************* |
| 390 | | * |
| 391 | | * Statics |
| 392 | | * |
| 393 | | *************************************/ |
| 385 | void segaic16_video_device::device_start() |
| 386 | { |
| 394 | 387 | |
| 395 | | static struct tilemap_info bg_tilemap[SEGAIC16_MAX_TILEMAPS]; |
| 388 | } |
| 396 | 389 | |
| 390 | void segaic16_video_device::device_reset() |
| 391 | { |
| 397 | 392 | |
| 393 | } |
| 398 | 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 399 | 404 | /************************************* |
| 400 | 405 | * |
| 401 | 406 | * Misc functions |
| 402 | 407 | * |
| 403 | 408 | *************************************/ |
| 404 | 409 | |
| 405 | | void segaic16_set_display_enable(running_machine &machine, int enable) |
| 410 | void segaic16_video_device::segaic16_set_display_enable(running_machine &machine, int enable) |
| 406 | 411 | { |
| 407 | 412 | enable = (enable != 0); |
| 408 | 413 | if (segaic16_display_enable != enable) |
| r24081 | r24082 | |
| 421 | 426 | * |
| 422 | 427 | *************************************/ |
| 423 | 428 | |
| 424 | | static 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) |
| 429 | 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) |
| 425 | 430 | { |
| 426 | 431 | int leftmin = -1, leftmax = -1, rightmin = -1, rightmax = -1; |
| 427 | 432 | int topmin = -1, topmax = -1, bottommin = -1, bottommax = -1; |
| r24081 | r24082 | |
| 623 | 628 | * |
| 624 | 629 | *******************************************************************************************/ |
| 625 | 630 | |
| 626 | | static TILE_GET_INFO( segaic16_tilemap_16a_tile_info ) |
| 631 | TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16a_tile_info ) |
| 627 | 632 | { |
| 628 | 633 | const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param; |
| 629 | 634 | UINT16 data = info->rambase[tile_index]; |
| 630 | 635 | int code = ((data >> 1) & 0x1000) | (data & 0xfff); |
| 631 | 636 | int color = (data >> 5) & 0x7f; |
| 632 | 637 | |
| 633 | | SET_TILE_INFO(0, code, color, 0); |
| 638 | SET_TILE_INFO_MEMBER(0, code, color, 0); |
| 634 | 639 | tileinfo.category = (data >> 12) & 1; |
| 635 | 640 | } |
| 636 | 641 | |
| 637 | 642 | |
| 638 | | static TILE_GET_INFO( segaic16_tilemap_16a_text_info ) |
| 643 | TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16a_text_info ) |
| 639 | 644 | { |
| 640 | 645 | const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param; |
| 641 | 646 | UINT16 data = info->rambase[tile_index]; |
| 642 | 647 | int color = (data >> 8) & 0x07; |
| 643 | 648 | int code = data & 0xff; |
| 644 | 649 | |
| 645 | | SET_TILE_INFO(0, code, color, 0); |
| 650 | SET_TILE_INFO_MEMBER(0, code, color, 0); |
| 646 | 651 | tileinfo.category = (data >> 11) & 1; |
| 647 | 652 | } |
| 648 | 653 | |
| 649 | 654 | |
| 650 | | static 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) |
| 655 | 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) |
| 651 | 656 | { |
| 652 | 657 | UINT16 *textram = info->textram; |
| 653 | 658 | |
| r24081 | r24082 | |
| 835 | 840 | * |
| 836 | 841 | *******************************************************************************************/ |
| 837 | 842 | |
| 838 | | static TILE_GET_INFO( segaic16_tilemap_16b_tile_info ) |
| 843 | TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_tile_info ) |
| 839 | 844 | { |
| 840 | 845 | const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param; |
| 841 | 846 | UINT16 data = info->rambase[tile_index]; |
| r24081 | r24082 | |
| 844 | 849 | |
| 845 | 850 | code = info->bank[code / info->banksize] * info->banksize + code % info->banksize; |
| 846 | 851 | |
| 847 | | SET_TILE_INFO(0, code, color, 0); |
| 852 | SET_TILE_INFO_MEMBER(0, code, color, 0); |
| 848 | 853 | tileinfo.category = (data >> 15) & 1; |
| 849 | 854 | } |
| 850 | 855 | |
| 851 | 856 | |
| 852 | | static TILE_GET_INFO( segaic16_tilemap_16b_text_info ) |
| 857 | TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_text_info ) |
| 853 | 858 | { |
| 854 | 859 | const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param; |
| 855 | 860 | UINT16 data = info->rambase[tile_index]; |
| r24081 | r24082 | |
| 857 | 862 | int color = (data >> 9) & 0x07; |
| 858 | 863 | int code = data & 0x1ff; |
| 859 | 864 | |
| 860 | | SET_TILE_INFO(0, bank * info->banksize + code, color, 0); |
| 865 | SET_TILE_INFO_MEMBER(0, bank * info->banksize + code, color, 0); |
| 861 | 866 | tileinfo.category = (data >> 15) & 1; |
| 862 | 867 | } |
| 863 | 868 | |
| 864 | 869 | |
| 865 | | static TILE_GET_INFO( segaic16_tilemap_16b_alt_tile_info ) |
| 870 | TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_alt_tile_info ) |
| 866 | 871 | { |
| 867 | 872 | const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param; |
| 868 | 873 | UINT16 data = info->rambase[tile_index]; |
| r24081 | r24082 | |
| 871 | 876 | |
| 872 | 877 | code = info->bank[code / info->banksize] * info->banksize + code % info->banksize; |
| 873 | 878 | |
| 874 | | SET_TILE_INFO(0, code, color, 0); |
| 879 | SET_TILE_INFO_MEMBER(0, code, color, 0); |
| 875 | 880 | tileinfo.category = (data >> 15) & 1; |
| 876 | 881 | } |
| 877 | 882 | |
| 878 | 883 | |
| 879 | | static TILE_GET_INFO( segaic16_tilemap_16b_alt_text_info ) |
| 884 | TILE_GET_INFO_MEMBER( segaic16_video_device::segaic16_tilemap_16b_alt_text_info ) |
| 880 | 885 | { |
| 881 | 886 | const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param; |
| 882 | 887 | UINT16 data = info->rambase[tile_index]; |
| r24081 | r24082 | |
| 884 | 889 | int color = (data >> 8) & 0x07; |
| 885 | 890 | int code = data & 0xff; |
| 886 | 891 | |
| 887 | | SET_TILE_INFO(0, bank * info->banksize + code, color, 0); |
| 892 | SET_TILE_INFO_MEMBER(0, bank * info->banksize + code, color, 0); |
| 888 | 893 | tileinfo.category = (data >> 15) & 1; |
| 889 | 894 | } |
| 890 | 895 | |
| 891 | 896 | |
| 892 | | static 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) |
| 897 | 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) |
| 893 | 898 | { |
| 894 | 899 | UINT16 *textram = info->textram; |
| 895 | 900 | UINT16 xscroll, yscroll, pages; |
| r24081 | r24082 | |
| 983 | 988 | } |
| 984 | 989 | |
| 985 | 990 | |
| 986 | | static TIMER_CALLBACK( segaic16_tilemap_16b_latch_values ) |
| 991 | TIMER_CALLBACK_MEMBER( segaic16_video_device::segaic16_tilemap_16b_latch_values ) |
| 987 | 992 | { |
| 988 | 993 | struct tilemap_info *info = &bg_tilemap[param]; |
| 989 | 994 | UINT16 *textram = info->textram; |
| r24081 | r24082 | |
| 998 | 1003 | } |
| 999 | 1004 | |
| 1000 | 1005 | /* 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); |
| 1002 | 1007 | } |
| 1003 | 1008 | |
| 1004 | 1009 | |
| 1005 | | static void segaic16_tilemap_16b_reset(running_machine &machine, struct tilemap_info *info) |
| 1010 | void segaic16_tilemap_16b_reset(running_machine &machine, struct tilemap_info *info) |
| 1006 | 1011 | { |
| 1007 | 1012 | /* set a timer to latch values on scanline 261 */ |
| 1008 | 1013 | info->latch_timer->adjust(machine.primary_screen->time_until_pos(261), info->index); |
| r24081 | r24082 | |
| 1016 | 1021 | * |
| 1017 | 1022 | *************************************/ |
| 1018 | 1023 | |
| 1019 | | void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks) |
| 1024 | void segaic16_video_device::segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks) |
| 1020 | 1025 | { |
| 1021 | 1026 | 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; |
| 1024 | 1029 | int pagenum; |
| 1025 | 1030 | int i; |
| 1026 | 1031 | |
| r24081 | r24082 | |
| 1049 | 1054 | switch (type) |
| 1050 | 1055 | { |
| 1051 | 1056 | 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); |
| 1054 | 1059 | info->numpages = 4; |
| 1055 | 1060 | info->draw_layer = segaic16_tilemap_16a_draw_layer; |
| 1056 | 1061 | info->reset = NULL; |
| r24081 | r24082 | |
| 1058 | 1063 | break; |
| 1059 | 1064 | |
| 1060 | 1065 | 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); |
| 1063 | 1068 | info->numpages = 8; |
| 1064 | 1069 | info->draw_layer = segaic16_tilemap_16a_draw_layer; |
| 1065 | 1070 | info->reset = NULL; |
| r24081 | r24082 | |
| 1067 | 1072 | break; |
| 1068 | 1073 | |
| 1069 | 1074 | 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); |
| 1072 | 1077 | info->numpages = 16; |
| 1073 | 1078 | info->draw_layer = segaic16_tilemap_16b_draw_layer; |
| 1074 | 1079 | 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) ); |
| 1076 | 1081 | break; |
| 1077 | 1082 | |
| 1078 | 1083 | 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); |
| 1081 | 1086 | info->numpages = 16; |
| 1082 | 1087 | info->draw_layer = segaic16_tilemap_16b_draw_layer; |
| 1083 | 1088 | 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) ); |
| 1085 | 1090 | break; |
| 1086 | 1091 | |
| 1087 | 1092 | default: |
| r24081 | r24082 | |
| 1089 | 1094 | } |
| 1090 | 1095 | |
| 1091 | 1096 | /* 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); |
| 1093 | 1098 | |
| 1094 | 1099 | /* configure it */ |
| 1095 | 1100 | info->textmap_info.rambase = info->textram; |
| r24081 | r24082 | |
| 1105 | 1110 | for (pagenum = 0; pagenum < info->numpages; pagenum++) |
| 1106 | 1111 | { |
| 1107 | 1112 | /* 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); |
| 1109 | 1114 | |
| 1110 | 1115 | /* configure the tilemap */ |
| 1111 | 1116 | info->tmap_info[pagenum].rambase = info->tileram + pagenum * 64*32; |
| r24081 | r24082 | |
| 1127 | 1132 | * |
| 1128 | 1133 | *************************************/ |
| 1129 | 1134 | |
| 1130 | | void segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark) |
| 1135 | void segaic16_video_device::segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark) |
| 1131 | 1136 | { |
| 1132 | 1137 | running_machine &machine = screen.machine(); |
| 1133 | 1138 | struct tilemap_info *info = &bg_tilemap[which]; |
| r24081 | r24082 | |
| 1149 | 1154 | * |
| 1150 | 1155 | *************************************/ |
| 1151 | 1156 | |
| 1152 | | void segaic16_tilemap_reset(running_machine &machine, int which) |
| 1157 | void segaic16_video_device::segaic16_tilemap_reset(running_machine &machine, int which) |
| 1153 | 1158 | { |
| 1154 | 1159 | struct tilemap_info *info = &bg_tilemap[which]; |
| 1155 | 1160 | |
| r24081 | r24082 | |
| 1165 | 1170 | * |
| 1166 | 1171 | *************************************/ |
| 1167 | 1172 | |
| 1168 | | void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset) |
| 1173 | void segaic16_video_device::segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset) |
| 1169 | 1174 | { |
| 1170 | 1175 | struct tilemap_info *info = &bg_tilemap[which]; |
| 1171 | 1176 | |
| r24081 | r24082 | |
| 1186 | 1191 | * |
| 1187 | 1192 | *************************************/ |
| 1188 | 1193 | |
| 1189 | | void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip) |
| 1194 | void segaic16_video_device::segaic16_tilemap_set_flip(running_machine &machine, int which, int flip) |
| 1190 | 1195 | { |
| 1191 | 1196 | struct tilemap_info *info = &bg_tilemap[which]; |
| 1192 | 1197 | int pagenum; |
| r24081 | r24082 | |
| 1211 | 1216 | * |
| 1212 | 1217 | *************************************/ |
| 1213 | 1218 | |
| 1214 | | void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable) |
| 1219 | void segaic16_video_device::segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable) |
| 1215 | 1220 | { |
| 1216 | 1221 | struct tilemap_info *info = &bg_tilemap[which]; |
| 1217 | 1222 | |
| r24081 | r24082 | |
| 1232 | 1237 | * |
| 1233 | 1238 | *************************************/ |
| 1234 | 1239 | |
| 1235 | | void segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable) |
| 1240 | void segaic16_video_device::segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable) |
| 1236 | 1241 | { |
| 1237 | 1242 | struct tilemap_info *info = &bg_tilemap[which]; |
| 1238 | 1243 | |
| r24081 | r24082 | |
| 1253 | 1258 | * |
| 1254 | 1259 | *************************************/ |
| 1255 | 1260 | |
| 1256 | | WRITE16_HANDLER( segaic16_tileram_0_w ) |
| 1261 | READ16_MEMBER( segaic16_video_device::segaic16_tileram_0_r ) |
| 1257 | 1262 | { |
| 1263 | return segaic16_tileram_0[offset]; |
| 1264 | } |
| 1265 | |
| 1266 | |
| 1267 | WRITE16_MEMBER( segaic16_video_device::segaic16_tileram_0_w ) |
| 1268 | { |
| 1258 | 1269 | COMBINE_DATA(&segaic16_tileram_0[offset]); |
| 1259 | 1270 | bg_tilemap[0].tilemaps[offset / (64*32)]->mark_tile_dirty(offset % (64*32)); |
| 1260 | 1271 | } |
| 1261 | 1272 | |
| 1262 | 1273 | |
| 1263 | | WRITE16_HANDLER( segaic16_textram_0_w ) |
| 1274 | READ16_MEMBER( segaic16_video_device::segaic16_textram_0_r ) |
| 1264 | 1275 | { |
| 1276 | return segaic16_textram_0[offset]; |
| 1277 | } |
| 1278 | |
| 1279 | |
| 1280 | WRITE16_MEMBER( segaic16_video_device::segaic16_textram_0_w ) |
| 1281 | { |
| 1265 | 1282 | /* certain ranges need immediate updates */ |
| 1266 | 1283 | if (offset >= 0xe80/2) |
| 1267 | 1284 | space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos()); |
| r24081 | r24082 | |
| 1777 | 1794 | * |
| 1778 | 1795 | *************************************/ |
| 1779 | 1796 | |
| 1780 | | void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs) |
| 1797 | void segaic16_video_device::segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs) |
| 1781 | 1798 | { |
| 1782 | 1799 | struct road_info *info = &segaic16_road[which]; |
| 1783 | 1800 | |
| r24081 | r24082 | |
| 1830 | 1847 | * |
| 1831 | 1848 | *************************************/ |
| 1832 | 1849 | |
| 1833 | | void segaic16_road_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) |
| 1850 | void segaic16_video_device::segaic16_road_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) |
| 1834 | 1851 | { |
| 1835 | 1852 | struct road_info *info = &segaic16_road[which]; |
| 1836 | 1853 | (*info->draw)(info, bitmap, cliprect, priority); |
| r24081 | r24082 | |
| 1844 | 1861 | * |
| 1845 | 1862 | *************************************/ |
| 1846 | 1863 | |
| 1847 | | READ16_HANDLER( segaic16_road_control_0_r ) |
| 1864 | READ16_MEMBER( segaic16_video_device::segaic16_road_control_0_r ) |
| 1848 | 1865 | { |
| 1849 | 1866 | struct road_info *info = &segaic16_road[0]; |
| 1850 | 1867 | |
| r24081 | r24082 | |
| 1867 | 1884 | } |
| 1868 | 1885 | |
| 1869 | 1886 | |
| 1870 | | WRITE16_HANDLER( segaic16_road_control_0_w ) |
| 1887 | WRITE16_MEMBER( segaic16_video_device::segaic16_road_control_0_w ) |
| 1871 | 1888 | { |
| 1872 | 1889 | struct road_info *info = &segaic16_road[0]; |
| 1873 | 1890 | |
| r24081 | r24082 | |
| 1885 | 1902 | * |
| 1886 | 1903 | *************************************/ |
| 1887 | 1904 | |
| 1888 | | void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase) |
| 1905 | void segaic16_video_device::segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase) |
| 1889 | 1906 | { |
| 1890 | 1907 | struct rotate_info *info = &segaic16_rotate[which]; |
| 1891 | 1908 | |
| r24081 | r24082 | |
| 1932 | 1949 | * |
| 1933 | 1950 | *************************************/ |
| 1934 | 1951 | |
| 1935 | | void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap) |
| 1952 | void segaic16_video_device::segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap) |
| 1936 | 1953 | { |
| 1937 | 1954 | struct rotate_info *info = &segaic16_rotate[which]; |
| 1938 | 1955 | INT32 currx = (info->buffer[0x3f0] << 16) | info->buffer[0x3f1]; |
| r24081 | r24082 | |
| 1995 | 2012 | * |
| 1996 | 2013 | *************************************/ |
| 1997 | 2014 | |
| 1998 | | READ16_HANDLER( segaic16_rotate_control_0_r ) |
| 2015 | READ16_MEMBER( segaic16_video_device::segaic16_rotate_control_0_r ) |
| 1999 | 2016 | { |
| 2000 | 2017 | struct rotate_info *info = &segaic16_rotate[0]; |
| 2001 | 2018 | |
trunk/src/mame/video/segaic16.h
| r24081 | r24082 | |
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | #pragma once |
| 8 | #ifndef __SEGAIC16VID_H__ |
| 9 | #define __SEGAIC16VID_H__ |
| 10 | |
| 11 | |
| 7 | 12 | #include "devcb.h" |
| 8 | 13 | |
| 9 | | /* globals */ |
| 10 | | extern UINT8 segaic16_display_enable; |
| 11 | | extern UINT16 *segaic16_tileram_0; |
| 12 | | extern UINT16 *segaic16_textram_0; |
| 13 | | extern UINT16 *segaic16_roadram_0; |
| 14 | | extern UINT16 *segaic16_rotateram_0; |
| 15 | 14 | |
| 16 | | /* misc functions */ |
| 17 | | void segaic16_set_display_enable(running_machine &machine, int enable); |
| 18 | | |
| 19 | 15 | /* tilemap systems */ |
| 20 | 16 | #define SEGAIC16_MAX_TILEMAPS 1 |
| 21 | 17 | |
| r24081 | r24082 | |
| 28 | 24 | #define SEGAIC16_TILEMAP_BACKGROUND 1 |
| 29 | 25 | #define SEGAIC16_TILEMAP_TEXT 2 |
| 30 | 26 | |
| 31 | | void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks); |
| 32 | | void segaic16_tilemap_reset(running_machine &machine, int which); |
| 33 | | void segaic16_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark); |
| 34 | | void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset); |
| 35 | | void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip); |
| 36 | | void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable); |
| 37 | | void segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable); |
| 38 | | |
| 39 | | DECLARE_WRITE16_HANDLER( segaic16_tileram_0_w ); |
| 40 | | DECLARE_WRITE16_HANDLER( segaic16_textram_0_w ); |
| 41 | | |
| 42 | 27 | /* road systems */ |
| 43 | 28 | #define SEGAIC16_MAX_ROADS 1 |
| 44 | 29 | |
| r24081 | r24082 | |
| 50 | 35 | #define SEGAIC16_ROAD_BACKGROUND 0 |
| 51 | 36 | #define SEGAIC16_ROAD_FOREGROUND 1 |
| 52 | 37 | |
| 53 | | void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs); |
| 54 | | void segaic16_road_draw(int which, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); |
| 55 | | DECLARE_READ16_HANDLER( segaic16_road_control_0_r ); |
| 56 | | DECLARE_WRITE16_HANDLER( segaic16_road_control_0_w ); |
| 57 | 38 | |
| 39 | |
| 58 | 40 | /* rotation systems */ |
| 59 | 41 | #define SEGAIC16_MAX_ROTATE 1 |
| 60 | 42 | |
| 61 | 43 | #define SEGAIC16_ROTATE_YBOARD 0 |
| 62 | 44 | |
| 63 | | void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase); |
| 64 | | void segaic16_rotate_draw(running_machine &machine, int which, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &srcbitmap); |
| 65 | | DECLARE_READ16_HANDLER( segaic16_rotate_control_0_r ); |
| 66 | 45 | |
| 46 | |
| 67 | 47 | /************************************* |
| 68 | 48 | * |
| 69 | 49 | * Type definitions |
| r24081 | r24082 | |
| 134 | 114 | FUNCTION PROTOTYPES |
| 135 | 115 | ***************************************************************************/ |
| 136 | 116 | |
| 137 | | extern struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE]; |
| 138 | | extern struct road_info segaic16_road[SEGAIC16_MAX_ROADS]; |
| 117 | |
| 118 | |
| 119 | class segaic16_video_device : public device_t |
| 120 | { |
| 121 | public: |
| 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 | |
| 175 | protected: |
| 176 | // device-level overrides |
| 177 | virtual void device_config_complete(); |
| 178 | virtual void device_start(); |
| 179 | virtual void device_reset(); |
| 180 | |
| 181 | private: |
| 182 | // internal state |
| 183 | }; |
| 184 | |
| 185 | extern const device_type SEGAIC16VID; |
| 186 | |
| 187 | #define MCFG_SEGAIC16VID_ADD(_tag) \ |
| 188 | MCFG_DEVICE_ADD(_tag, SEGAIC16VID, 0) \ |
| 189 | |
| 190 | |
| 191 | #endif |