From deb9cdaf648ec66af4c527273a9ee76d9b703995 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Mon, 28 Dec 2009 19:32:13 +0000 Subject: [PATCH] Taito wip: * Fixed TC0480SCP device start procedures as well * Converted groundfx.c, gunbustr.c, slapshot.c, superchs.c, taito_z.c to use video devices --- src/mame/drivers/groundfx.c | 33 +++++-- src/mame/drivers/gunbustr.c | 29 +++--- src/mame/drivers/slapshot.c | 30 +++++-- src/mame/drivers/superchs.c | 20 ++++- src/mame/drivers/taito_z.c | 159 ++++++++++++++++++++++++--------- src/mame/video/groundfx.c | 83 +++++++++--------- src/mame/video/gunbustr.c | 43 +++++---- src/mame/video/slapshot.c | 46 ++++------ src/mame/video/superchs.c | 43 +++++---- src/mame/video/taiicdev.c | 8 +- src/mame/video/taito_z.c | 170 +++++++++++++++++------------------- 11 files changed, 384 insertions(+), 280 deletions(-) diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c index aaa3f102d73..6259d433d5a 100644 --- a/src/mame/drivers/groundfx.c +++ b/src/mame/drivers/groundfx.c @@ -64,7 +64,7 @@ #include "driver.h" #include "cpu/m68000/m68000.h" -#include "video/taitoic.h" +#include "video/taiicdev.h" #include "machine/eeprom.h" #include "sound/es5506.h" #include "includes/taito_f3.h" @@ -228,10 +228,10 @@ static ADDRESS_MAP_START( groundfx_map, ADDRESS_SPACE_PROGRAM, 32 ) AM_RANGE(0x500000, 0x500007) AM_WRITE(groundfx_input_w) /* eeprom etc. */ AM_RANGE(0x600000, 0x600003) AM_READWRITE(groundfx_adc_r,groundfx_adc_w) AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_BASE(&f3_shared_ram) - AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0480SCP_long_r,TC0480SCP_long_w) /* tilemaps */ - AM_RANGE(0x830000, 0x83002f) AM_READWRITE(TC0480SCP_ctrl_long_r,TC0480SCP_ctrl_long_w) // debugging - AM_RANGE(0x900000, 0x90ffff) AM_READWRITE(TC0100SCN_long_r,TC0100SCN_long_w) /* piv tilemaps */ - AM_RANGE(0x920000, 0x92000f) AM_READWRITE(TC0100SCN_ctrl_long_r,TC0100SCN_ctrl_long_w) + AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_long_r, tc0480scp_long_w) /* tilemaps */ + AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w) // debugging + AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_long_r, tc0100scn_long_w) /* piv tilemaps */ + AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_long_r, tc0100scn_ctrl_long_w) AM_RANGE(0xa00000, 0xa0ffff) AM_RAM_WRITE(color_ram_w) AM_BASE_GENERIC(paletteram) /* palette ram */ AM_RANGE(0xb00000, 0xb003ff) AM_RAM // ?? single bytes, blending ?? AM_RANGE(0xc00000, 0xc00007) AM_READNOP /* Network? */ @@ -341,6 +341,26 @@ GFXDECODE_END MACHINE DRIVERS ***********************************************************/ +static const tc0100scn_interface groundfx_tc0100scn_intf = +{ + "screen", + 2, 3, /* gfxnum, txnum */ + 50, 8, /* x_offset, y_offset */ + 0, 0, /* flip_xoff, flip_yoff */ + 0, 0, /* flip_text_xoff, flip_text_yoff */ + 0, 0 +}; + +static const tc0480scp_interface groundfx_tc0480scp_intf = +{ + 1, 4, /* gfxnum, txnum */ + 0, /* pixels */ + 0x24, 0, /* x_offset, y_offset */ + -1, 0, /* text_xoff, text_yoff */ + 0, 0, /* flip_xoff, flip_yoff */ + 0 /* col_base */ +}; + static INTERRUPT_GEN( groundfx_interrupt ) { frame_counter^=1; @@ -370,6 +390,9 @@ static MACHINE_DRIVER_START( groundfx ) MDRV_VIDEO_START(groundfx) MDRV_VIDEO_UPDATE(groundfx) + MDRV_TC0100SCN_ADD("tc0100scn", groundfx_tc0100scn_intf) + MDRV_TC0480SCP_ADD("tc0480scp", groundfx_tc0480scp_intf) + /* sound hardware */ MDRV_IMPORT_FROM(taito_f3_sound) MACHINE_DRIVER_END diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c index 8e67f7f9573..d69932e609c 100644 --- a/src/mame/drivers/gunbustr.c +++ b/src/mame/drivers/gunbustr.c @@ -46,7 +46,7 @@ #include "driver.h" #include "cpu/m68000/m68000.h" -#include "video/taitoic.h" +#include "video/taiicdev.h" #include "audio/taitosnd.h" #include "machine/eeprom.h" #include "sound/es5506.h" @@ -185,8 +185,8 @@ static ADDRESS_MAP_START( gunbustr_map, ADDRESS_SPACE_PROGRAM, 32 ) AM_RANGE(0x400004, 0x400007) AM_READ_PORT("SYSTEM") AM_RANGE(0x400000, 0x400007) AM_WRITE(gunbustr_input_w) /* eerom etc. */ AM_RANGE(0x500000, 0x500003) AM_READWRITE(gunbustr_gun_r, gunbustr_gun_w) /* gun coord read */ - AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0480SCP_long_r, TC0480SCP_long_w) - AM_RANGE(0x830000, 0x83002f) AM_READWRITE(TC0480SCP_ctrl_long_r, TC0480SCP_ctrl_long_w) + AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_long_r, tc0480scp_long_w) + AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w) AM_RANGE(0x900000, 0x901fff) AM_RAM_WRITE(gunbustr_palette_w) AM_BASE_GENERIC(paletteram) /* Palette ram */ AM_RANGE(0xc00000, 0xc03fff) AM_RAM /* network ram ?? */ ADDRESS_MAP_END @@ -303,17 +303,6 @@ GFXDECODE_END MACHINE DRIVERS ***********************************************************/ -static const UINT8 default_eeprom[128]={ - 0x00,0x01,0x00,0x85,0x00,0xfd,0x00,0xff,0x00,0x67,0x00,0x02,0x00,0x00,0x00,0x7b, - 0x00,0xff,0x00,0xff,0x00,0x78,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0x01,0x01,0x00,0x00,0x01,0x02,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x10,0x00,0x00, - 0x21,0x13,0x14,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -}; - static const eeprom_interface gunbustr_eeprom_interface = { 6, /* address bits */ @@ -325,6 +314,16 @@ static const eeprom_interface gunbustr_eeprom_interface = "0100110000", /* lock command */ }; +static const tc0480scp_interface gunbustr_tc0480scp_intf = +{ + 1, 2, /* gfxnum, txnum */ + 0, /* pixels */ + 0x20, 0x07, /* x_offset, y_offset */ + -1, -1, /* text_xoff, text_yoff */ + -1, 0, /* flip_xoff, flip_yoff */ + 0 /* col_base */ +}; + static MACHINE_DRIVER_START( gunbustr ) /* basic machine hardware */ @@ -348,6 +347,8 @@ static MACHINE_DRIVER_START( gunbustr ) MDRV_VIDEO_START(gunbustr) MDRV_VIDEO_UPDATE(gunbustr) + MDRV_TC0480SCP_ADD("tc0480scp", gunbustr_tc0480scp_intf) + /* sound hardware */ MDRV_IMPORT_FROM(taito_f3_sound) MACHINE_DRIVER_END diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c index e3dcf2357a8..90a88251f5f 100644 --- a/src/mame/drivers/slapshot.c +++ b/src/mame/drivers/slapshot.c @@ -134,7 +134,7 @@ Region byte at offset 0x031: #include "driver.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" -#include "video/taitoic.h" +#include "video/taiicdev.h" #include "audio/taitosnd.h" #include "sound/2610intf.h" #include "machine/timekpr.h" @@ -284,11 +284,11 @@ static ADDRESS_MAP_START( slapshot_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x500000, 0x50ffff) AM_RAM /* main RAM */ AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* sprite ram */ AM_RANGE(0x700000, 0x701fff) AM_RAM AM_BASE(&taito_sprite_ext) AM_SIZE(&taito_spriteext_size) /* debugging */ - AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0480SCP_word_r, TC0480SCP_word_w) /* tilemaps */ - AM_RANGE(0x830000, 0x83002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w) + AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemaps */ + AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) AM_RANGE(0x900000, 0x907fff) AM_READWRITE(color_ram_word_r, color_ram_word_w) AM_BASE(&color_ram) /* 8bpg palette */ AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE8("mk48t08", timekeeper_r, timekeeper_w, 0xff00) /* nvram (only low bytes used) */ - AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0xff00) /* priority chip */ + AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8("tc0360pri", tc0360pri_w, 0xff00) /* priority chip */ AM_RANGE(0xc00000, 0xc0000f) AM_DEVREADWRITE("tc0640fio", tc0640fio_halfword_byteswap_r, tc0640fio_halfword_byteswap_w) AM_RANGE(0xc00020, 0xc0002f) AM_READ(slapshot_service_input_r) /* service mirror */ AM_RANGE(0xd00000, 0xd00003) AM_READWRITE(slapshot_msb_sound_r, slapshot_msb_sound_w) @@ -299,11 +299,11 @@ static ADDRESS_MAP_START( opwolf3_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x500000, 0x50ffff) AM_RAM /* main RAM */ AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* sprite ram */ AM_RANGE(0x700000, 0x701fff) AM_RAM AM_BASE(&taito_sprite_ext) AM_SIZE(&taito_spriteext_size) /* debugging */ - AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0480SCP_word_r, TC0480SCP_word_w) /* tilemaps */ - AM_RANGE(0x830000, 0x83002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w) + AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemaps */ + AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) AM_RANGE(0x900000, 0x907fff) AM_READWRITE(color_ram_word_r, color_ram_word_w) AM_BASE(&color_ram) /* 8bpg palette */ AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE8("mk48t08", timekeeper_r, timekeeper_w, 0xff00) /* nvram (only low bytes used) */ - AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0xff00) /* priority chip */ + AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8("tc0360pri", tc0360pri_w, 0xff00) /* priority chip */ AM_RANGE(0xc00000, 0xc0000f) AM_DEVREADWRITE("tc0640fio", tc0640fio_halfword_byteswap_r, tc0640fio_halfword_byteswap_w) AM_RANGE(0xc00020, 0xc0002f) AM_READ(slapshot_service_input_r) /* service mirror */ AM_RANGE(0xd00000, 0xd00003) AM_READWRITE(slapshot_msb_sound_r, slapshot_msb_sound_w) @@ -495,6 +495,16 @@ static const ym2610_interface ym2610_config = MACHINE DRIVERS ***********************************************************/ +static const tc0480scp_interface slapshot_tc0480scp_intf = +{ + 1, 2, /* gfxnum, txnum */ + 3, /* pixels */ + 30, 9, /* x_offset, y_offset */ + -1, 1, /* text_xoff, text_yoff */ + 0, 2, /* flip_xoff, flip_yoff */ + 256 /* col_base */ +}; + static const tc0640fio_interface slapshot_io_intf = { DEVCB_NULL, DEVCB_INPUT_PORT("COINS"), @@ -532,6 +542,9 @@ static MACHINE_DRIVER_START( slapshot ) MDRV_VIDEO_EOF(taito_no_buffer) MDRV_VIDEO_UPDATE(slapshot) + MDRV_TC0480SCP_ADD("tc0480scp", slapshot_tc0480scp_intf) + MDRV_TC0360PRI_ADD("tc0360pri") + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -574,6 +587,9 @@ static MACHINE_DRIVER_START( opwolf3 ) MDRV_VIDEO_EOF(taito_no_buffer) MDRV_VIDEO_UPDATE(slapshot) + MDRV_TC0480SCP_ADD("tc0480scp", slapshot_tc0480scp_intf) + MDRV_TC0360PRI_ADD("tc0360pri") + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c index cbd3e8041f8..b4b9a6a5b32 100644 --- a/src/mame/drivers/superchs.c +++ b/src/mame/drivers/superchs.c @@ -35,7 +35,7 @@ #include "driver.h" #include "cpu/m68000/m68000.h" -#include "video/taitoic.h" +#include "video/taiicdev.h" #include "audio/taitosnd.h" #include "machine/eeprom.h" #include "sound/es5506.h" @@ -235,8 +235,8 @@ static ADDRESS_MAP_START( superchs_map, ADDRESS_SPACE_PROGRAM, 32 ) AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_BASE(&superchs_ram) AM_RANGE(0x140000, 0x141fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) - AM_RANGE(0x180000, 0x18ffff) AM_READWRITE(TC0480SCP_long_r, TC0480SCP_long_w) - AM_RANGE(0x1b0000, 0x1b002f) AM_READWRITE(TC0480SCP_ctrl_long_r, TC0480SCP_ctrl_long_w) + AM_RANGE(0x180000, 0x18ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_long_r, tc0480scp_long_w) + AM_RANGE(0x1b0000, 0x1b002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w) AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_BASE(&shared_ram) AM_RANGE(0x240000, 0x240003) AM_WRITE(cpua_ctrl_w) AM_RANGE(0x280000, 0x287fff) AM_RAM_WRITE(superchs_palette_w) AM_BASE_GENERIC(paletteram) @@ -248,7 +248,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( superchs_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x200000, 0x20ffff) AM_RAM - AM_RANGE(0x600000, 0x60ffff) AM_WRITE(TC0480SCP_word_w) /* Only written upon errors */ + AM_RANGE(0x600000, 0x60ffff) AM_DEVWRITE("tc0480scp", tc0480scp_word_w) /* Only written upon errors */ AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_RANGE(0xa00000, 0xa001ff) AM_RAM /* Extra road control?? */ ADDRESS_MAP_END @@ -360,6 +360,16 @@ static const eeprom_interface superchs_eeprom_interface = "0100110000", /* lock command */ }; +static const tc0480scp_interface superchs_tc0480scp_intf = +{ + 1, 2, /* gfxnum, txnum */ + 0, /* pixels */ + 0x20, 0x08, /* x_offset, y_offset */ + -1, 0, /* text_xoff, text_yoff */ + 0, 0, /* flip_xoff, flip_yoff */ + 0 /* col_base */ +}; + static MACHINE_DRIVER_START( superchs ) /* basic machine hardware */ @@ -389,6 +399,8 @@ static MACHINE_DRIVER_START( superchs ) MDRV_VIDEO_START(superchs) MDRV_VIDEO_UPDATE(superchs) + MDRV_TC0480SCP_ADD("tc0480scp", superchs_tc0480scp_intf) + /* sound hardware */ MDRV_IMPORT_FROM(taito_f3_sound) MACHINE_DRIVER_END diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c index f9dfc837cdf..6b24e259f9a 100644 --- a/src/mame/drivers/taito_z.c +++ b/src/mame/drivers/taito_z.c @@ -880,7 +880,7 @@ J1100256A VIDEO PCB #include "includes/taitoipt.h" #include "cpu/m68000/m68000.h" #include "machine/eeprom.h" -#include "video/taitoic.h" +#include "video/taiicdev.h" #include "audio/taitosnd.h" #include "sound/2610intf.h" #include "sound/flt_vol.h" @@ -890,7 +890,6 @@ J1100256A VIDEO PCB #include "dblaxle.lh" VIDEO_START( taitoz ); -VIDEO_START( spacegun ); VIDEO_UPDATE( contcirc ); VIDEO_UPDATE( chasehq ); @@ -904,10 +903,6 @@ WRITE16_HANDLER( contcirc_out_w ); READ16_HANDLER ( sci_spriteframe_r ); WRITE16_HANDLER( sci_spriteframe_w ); -// These TC0150ROD prototypes will go in taitoic.h // -READ16_HANDLER ( TC0150ROD_word_r ); /* Road generator */ -WRITE16_HANDLER( TC0150ROD_word_w ); - static UINT16 cpua_ctrl; static INT32 sci_int6 = 0; static INT32 dblaxle_int6 = 0; @@ -1510,10 +1505,10 @@ static ADDRESS_MAP_START( contcirc_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x080000, 0x083fff) AM_RAM AM_RANGE(0x084000, 0x087fff) AM_RAM AM_SHARE("share1") AM_RANGE(0x090000, 0x090001) AM_WRITE(contcirc_out_w) /* road palette bank, sub CPU reset, 3d glasses control */ - AM_RANGE(0x100000, 0x100007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_rbswap_word_w) /* palette */ - AM_RANGE(0x200000, 0x20ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w) /* tilemaps */ - AM_RANGE(0x220000, 0x22000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) - AM_RANGE(0x300000, 0x301fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) /* "root ram" */ + AM_RANGE(0x100000, 0x100007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_rbswap_word_w) /* palette */ + AM_RANGE(0x200000, 0x20ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ + AM_RANGE(0x220000, 0x22000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) + AM_RANGE(0x300000, 0x301fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) /* "root ram" */ AM_RANGE(0x400000, 0x4006ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) ADDRESS_MAP_END @@ -1536,9 +1531,9 @@ static ADDRESS_MAP_START( chasehq_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff) AM_RANGE(0x800000, 0x800001) AM_WRITE(cpua_ctrl_w) AM_RANGE(0x820000, 0x820003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w) - AM_RANGE(0xa00000, 0xa00007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w) /* palette */ - AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w) /* tilemaps */ - AM_RANGE(0xc20000, 0xc2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) + AM_RANGE(0xa00000, 0xa00007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette */ + AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ + AM_RANGE(0xc20000, 0xc2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) AM_RANGE(0xe00000, 0xe003ff) AM_READWRITE(chasehq_motor_r, chasehq_motor_w) /* motor cpu */ ADDRESS_MAP_END @@ -1547,7 +1542,7 @@ static ADDRESS_MAP_START( chq_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x01ffff) AM_ROM AM_RANGE(0x100000, 0x103fff) AM_RAM AM_RANGE(0x108000, 0x10bfff) AM_RAM AM_SHARE("share1") - AM_RANGE(0x800000, 0x801fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) + AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) ADDRESS_MAP_END @@ -1557,10 +1552,10 @@ static ADDRESS_MAP_START( enforce_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x104000, 0x107fff) AM_RAM AM_SHARE("share1") AM_RANGE(0x200000, 0x200001) AM_WRITE(cpua_ctrl_w) // works without? AM_RANGE(0x300000, 0x3006ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) - AM_RANGE(0x400000, 0x401fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) /* "root ram" ??? */ - AM_RANGE(0x500000, 0x500007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_rbswap_word_w) /* palette */ - AM_RANGE(0x600000, 0x60ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w) /* tilemaps */ - AM_RANGE(0x620000, 0x62000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) + AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) /* "root ram" ??? */ + AM_RANGE(0x500000, 0x500007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_rbswap_word_w) /* palette */ + AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ + AM_RANGE(0x620000, 0x62000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) ADDRESS_MAP_END static ADDRESS_MAP_START( enforce_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) @@ -1582,8 +1577,8 @@ static ADDRESS_MAP_START( bshark_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x800000, 0x800007) AM_READWRITE(bshark_stick_r, bshark_stick_w) AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) AM_RANGE(0xc00000, 0xc00fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) - AM_RANGE(0xd00000, 0xd0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w) /* tilemaps */ - AM_RANGE(0xd20000, 0xd2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) + AM_RANGE(0xd00000, 0xd0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ + AM_RANGE(0xd20000, 0xd2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) ADDRESS_MAP_END static ADDRESS_MAP_START( bshark_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) @@ -1595,7 +1590,7 @@ static ADDRESS_MAP_START( bshark_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x600000, 0x600007) AM_DEVREADWRITE8("ymsnd", ym2610_r, ym2610_w, 0x00ff) AM_RANGE(0x60000c, 0x60000d) AM_NOP // interrupt controller? AM_RANGE(0x60000e, 0x60000f) AM_NOP - AM_RANGE(0x800000, 0x801fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) /* "root ram" */ + AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) ADDRESS_MAP_END @@ -1609,8 +1604,8 @@ static ADDRESS_MAP_START( sci_map, ADDRESS_SPACE_PROGRAM, 16 ) // AM_RANGE(0x400000, 0x400001) AM_WRITE(cpua_ctrl_w) // ?? doesn't seem to fit what's written AM_RANGE(0x420000, 0x420003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w) AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) - AM_RANGE(0xa00000, 0xa0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w) /* tilemaps */ - AM_RANGE(0xa20000, 0xa2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) + AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ + AM_RANGE(0xa20000, 0xa2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) AM_RANGE(0xc08000, 0xc08001) AM_READWRITE(sci_spriteframe_r, sci_spriteframe_w) ADDRESS_MAP_END @@ -1619,7 +1614,7 @@ static ADDRESS_MAP_START( sci_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x01ffff) AM_ROM AM_RANGE(0x200000, 0x203fff) AM_RAM AM_RANGE(0x208000, 0x20bfff) AM_RAM AM_SHARE("share1") - AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) + AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) ADDRESS_MAP_END @@ -1630,9 +1625,9 @@ static ADDRESS_MAP_START( nightstr_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) AM_RANGE(0x800000, 0x800001) AM_WRITE(cpua_ctrl_w) AM_RANGE(0x820000, 0x820003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w) - AM_RANGE(0xa00000, 0xa00007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w) /* palette */ - AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w) /* tilemaps */ - AM_RANGE(0xc20000, 0xc2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) + AM_RANGE(0xa00000, 0xa00007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette */ + AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ + AM_RANGE(0xc20000, 0xc2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP /* Motor 1 (left) */ AM_RANGE(0xe00008, 0xe00009) AM_WRITENOP /* Motor 2 (center) */ @@ -1644,7 +1639,7 @@ static ADDRESS_MAP_START( nightstr_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x100000, 0x103fff) AM_RAM AM_RANGE(0x104000, 0x107fff) AM_RAM AM_SHARE("share1") - AM_RANGE(0x800000, 0x801fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) /* "root ram" */ + AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) ADDRESS_MAP_END @@ -1653,10 +1648,10 @@ static ADDRESS_MAP_START( aquajack_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x100000, 0x103fff) AM_RAM AM_RANGE(0x104000, 0x107fff) AM_RAM AM_SHARE("share1") AM_RANGE(0x200000, 0x200001) AM_WRITE(cpua_ctrl_w) // not needed, but it's probably like the others - AM_RANGE(0x300000, 0x300007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w) /* palette */ - AM_RANGE(0x800000, 0x801fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) - AM_RANGE(0xa00000, 0xa0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w) /* tilemaps */ - AM_RANGE(0xa20000, 0xa2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) + AM_RANGE(0x300000, 0x300007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette */ + AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) + AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ + AM_RANGE(0xa20000, 0xa2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) AM_RANGE(0xc40000, 0xc403ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) ADDRESS_MAP_END @@ -1677,9 +1672,9 @@ static ADDRESS_MAP_START( spacegun_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x30c000, 0x30ffff) AM_RAM AM_RANGE(0x310000, 0x31ffff) AM_RAM AM_SHARE("share1") AM_RANGE(0x500000, 0x5005ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) - AM_RANGE(0x900000, 0x90ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w) /* tilemaps */ - AM_RANGE(0x920000, 0x92000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w) - AM_RANGE(0xb00000, 0xb00007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_rbswap_word_w) /* palette */ + AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ + AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) + AM_RANGE(0xb00000, 0xb00007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_rbswap_word_w) /* palette */ ADDRESS_MAP_END static ADDRESS_MAP_START( spacegun_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) @@ -1705,9 +1700,9 @@ static ADDRESS_MAP_START( dblaxle_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x600000, 0x600001) AM_WRITE(cpua_ctrl_w) /* could this be causing int6 ? */ AM_RANGE(0x620000, 0x620003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w) AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) - AM_RANGE(0x900000, 0x90ffff) AM_READWRITE(TC0480SCP_word_r, TC0480SCP_word_w) /* tilemap mirror */ - AM_RANGE(0xa00000, 0xa0ffff) AM_READWRITE(TC0480SCP_word_r, TC0480SCP_word_w) /* tilemaps */ - AM_RANGE(0xa30000, 0xa3002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w) + AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemap mirror */ + AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemaps */ + AM_RANGE(0xa30000, 0xa3002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* mostly unused ? */ AM_RANGE(0xc08000, 0xc08001) AM_READWRITE(sci_spriteframe_r, sci_spriteframe_w) /* set in int6, seems to stay zero */ ADDRESS_MAP_END @@ -1716,7 +1711,7 @@ static ADDRESS_MAP_START( dblaxle_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x100000, 0x103fff) AM_RAM AM_RANGE(0x110000, 0x11ffff) AM_RAM AM_SHARE("share1") - AM_RANGE(0x300000, 0x301fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) + AM_RANGE(0x300000, 0x301fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) AM_RANGE(0x500000, 0x503fff) AM_RAM /* network ram ? (see Gunbustr) */ ADDRESS_MAP_END @@ -1730,8 +1725,8 @@ static ADDRESS_MAP_START( racingb_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x500002, 0x500003) AM_WRITE(cpua_ctrl_w) AM_RANGE(0x520000, 0x520003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w) AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) - AM_RANGE(0x900000, 0x90ffff) AM_READWRITE(TC0480SCP_word_r, TC0480SCP_word_w) /* tilemaps */ - AM_RANGE(0x930000, 0x93002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w) + AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemaps */ + AM_RANGE(0x930000, 0x93002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) /* mostly unused ? */ AM_RANGE(0xb08000, 0xb08001) AM_READWRITE(sci_spriteframe_r, sci_spriteframe_w) /* alternates 0/0x100 */ ADDRESS_MAP_END @@ -1740,7 +1735,7 @@ static ADDRESS_MAP_START( racingb_cpub_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x400000, 0x403fff) AM_RAM AM_RANGE(0x410000, 0x41ffff) AM_RAM AM_SHARE("share1") - AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE(TC0150ROD_word_r, TC0150ROD_word_w) + AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_word_r, tc0150rod_word_w) AM_RANGE(0xd00000, 0xd03fff) AM_RAM /* network ram ? */ ADDRESS_MAP_END @@ -2874,6 +2869,50 @@ Contcirc road glitchiness in attract? ***********************************************************/ +static const tc0100scn_interface taitoz_tc0100scn_intf = +{ + "screen", + 1, 2, /* gfxnum, txnum */ + 0, 0, /* x_offset, y_offset */ + 0, 0, /* flip_xoff, flip_yoff */ + 0, 0, /* flip_text_xoff, flip_text_yoff */ + 0, 0 +}; + +static const tc0100scn_interface chasehq_tc0100scn_intf = +{ + "screen", + 1, 3, /* gfxnum, txnum */ + 0, 0, /* x_offset, y_offset */ + 0, 0, /* flip_xoff, flip_yoff */ + 0, 0, /* flip_text_xoff, flip_text_yoff */ + 0, 0 +}; + +static const tc0100scn_interface spacegun_tc0100scn_intf = +{ + "screen", + 1, 2, /* gfxnum, txnum */ + 4, 0, /* x_offset, y_offset */ + 0, 0, /* flip_xoff, flip_yoff */ + 0, 0, /* flip_text_xoff, flip_text_yoff */ + 0, 0 +}; + +static const tc0480scp_interface taitoz_tc0480scp_intf = +{ + 1, 2, /* gfxnum, txnum */ + 0, /* pixels */ + 0x21, 0x08, /* x_offset, y_offset */ + 4, 0, /* text_xoff, text_yoff */ + 0, 0, /* flip_xoff, flip_yoff */ + 0 /* col_base */ +}; + +static const tc0110pcr_interface taitoz_tc0110pcr_intf = { 0 }; + +static const tc0150rod_interface taitoz_tc0150rod_intf = { "gfx3" }; + static const tc0220ioc_interface taitoz_io220_intf = { DEVCB_INPUT_PORT("DSWA"), DEVCB_INPUT_PORT("DSWB"), @@ -2921,6 +2960,10 @@ static MACHINE_DRIVER_START( contcirc ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(contcirc) + MDRV_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + MDRV_TC0110PCR_ADD("tc0110pcr", taitoz_tc0110pcr_intf) + /* sound hardware */ MDRV_SPEAKER_ADD("front", 0.0, 0.0, 0.7) MDRV_SPEAKER_ADD("rear", 0.0, 0.0, 1.3) @@ -2979,6 +3022,10 @@ static MACHINE_DRIVER_START( chasehq ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(chasehq) + MDRV_TC0100SCN_ADD("tc0100scn", chasehq_tc0100scn_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + MDRV_TC0110PCR_ADD("tc0110pcr", taitoz_tc0110pcr_intf) + /* sound hardware */ MDRV_SPEAKER_ADD("front", 0.0, 0.0, 0.7) MDRV_SPEAKER_ADD("rear", 0.0, 0.0, 1.3) @@ -3037,6 +3084,10 @@ static MACHINE_DRIVER_START( enforce ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(contcirc) + MDRV_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + MDRV_TC0110PCR_ADD("tc0110pcr", taitoz_tc0110pcr_intf) + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -3093,6 +3144,9 @@ static MACHINE_DRIVER_START( bshark ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(bshark) + MDRV_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -3150,6 +3204,9 @@ static MACHINE_DRIVER_START( sci ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(sci) + MDRV_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -3207,6 +3264,10 @@ static MACHINE_DRIVER_START( nightstr ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(chasehq) + MDRV_TC0100SCN_ADD("tc0100scn", chasehq_tc0100scn_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + MDRV_TC0110PCR_ADD("tc0110pcr", taitoz_tc0110pcr_intf) + /* sound hardware */ MDRV_SPEAKER_ADD("front", 0.0, 0.0, 0.7) MDRV_SPEAKER_ADD("rear", 0.0, 0.0, 1.3) @@ -3265,6 +3326,10 @@ static MACHINE_DRIVER_START( aquajack ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(aquajack) + MDRV_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + MDRV_TC0110PCR_ADD("tc0110pcr", taitoz_tc0110pcr_intf) + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -3317,9 +3382,11 @@ static MACHINE_DRIVER_START( spacegun ) MDRV_GFXDECODE(taitoz) MDRV_PALETTE_LENGTH(4096) - MDRV_VIDEO_START(spacegun) MDRV_VIDEO_UPDATE(spacegun) + MDRV_TC0100SCN_ADD("tc0100scn", spacegun_tc0100scn_intf) + MDRV_TC0110PCR_ADD("tc0110pcr", taitoz_tc0110pcr_intf) + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -3377,6 +3444,9 @@ static MACHINE_DRIVER_START( dblaxle ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(dblaxle) + MDRV_TC0480SCP_ADD("tc0480scp", taitoz_tc0480scp_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -3433,6 +3503,9 @@ static MACHINE_DRIVER_START( racingb ) MDRV_VIDEO_START(taitoz) MDRV_VIDEO_UPDATE(dblaxle) + MDRV_TC0480SCP_ADD("tc0480scp", taitoz_tc0480scp_intf) + MDRV_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf) + /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c index 8af2f302123..1a349dd499f 100644 --- a/src/mame/video/groundfx.c +++ b/src/mame/video/groundfx.c @@ -1,8 +1,5 @@ #include "driver.h" -#include "video/taitoic.h" - -#define TC0100SCN_GFX_NUM 2 -#define TC0480SCP_GFX_NUM 1 +#include "video/taiicdev.h" UINT16 groundfx_rotate_ctrl[8]; @@ -24,14 +21,11 @@ VIDEO_START( groundfx ) { spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000); - TC0100SCN_vh_start(machine,1,TC0100SCN_GFX_NUM,50,8,0,0,0,0,0); - TC0480SCP_vh_start(machine,TC0480SCP_GFX_NUM,0,0x24,0,-1,0,0,0,0); - /* Hack */ - hack_cliprect.min_x=69; - hack_cliprect.max_x=250; - hack_cliprect.min_y=24 + 5; - hack_cliprect.max_y=24 + 44; + hack_cliprect.min_x = 69; + hack_cliprect.max_x = 250; + hack_cliprect.min_y = 24 + 5; + hack_cliprect.max_y = 24 + 44; } /*************************************************************** @@ -220,31 +214,32 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan VIDEO_UPDATE( groundfx ) { - const address_space *space = cputag_get_address_space(screen->machine, "maincpu", ADDRESS_SPACE_PROGRAM); + const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; - TC0100SCN_tilemap_update(screen->machine); - TC0480SCP_tilemap_update(screen->machine); + tc0100scn_tilemap_update(tc0100scn); + tc0480scp_tilemap_update(tc0480scp); - priority = TC0480SCP_get_bg_priority(); + priority = tc0480scp_get_bg_priority(tc0480scp); - layer[0] = (priority &0xf000) >> 12; /* tells us which bg layer is bottom */ - layer[1] = (priority &0x0f00) >> 8; - layer[2] = (priority &0x00f0) >> 4; - layer[3] = (priority &0x000f) >> 0; /* tells us which is top */ + layer[0] = (priority & 0xf000) >> 12; /* tells us which bg layer is bottom */ + layer[1] = (priority & 0x0f00) >> 8; + layer[2] = (priority & 0x00f0) >> 4; + layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ layer[4] = 4; /* text layer always over bg layers */ - pivlayer[0] = TC0100SCN_bottomlayer(0); + pivlayer[0] = tc0100scn_bottomlayer(tc0100scn); pivlayer[1] = pivlayer[0]^1; pivlayer[2] = 2; - bitmap_fill(screen->machine->priority_bitmap,cliprect,0); - bitmap_fill(bitmap,cliprect,0); /* wrong color? */ + bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); + bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[0],TILEMAP_DRAW_OPAQUE,0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[1],0,0); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[0], TILEMAP_DRAW_OPAQUE, 0); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[1], 0, 0); /* BIG HACK! @@ -262,23 +257,31 @@ VIDEO_UPDATE( groundfx ) it's contents the usual way. */ - if (TC0100SCN_long_r(space,0x4090/4,0xffffffff) || TC0480SCP_long_r(space,0x20/4,0xffffffff)==0x240866) { /* Anything in text layer - really stupid hack */ - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,2); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,4); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,8); - //TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[2],0,0); - if (TC0480SCP_long_r(space,0x20/4,0xffffffff)!=0x240866) /* Stupid hack for start of race */ - TC0480SCP_tilemap_draw(screen->machine,bitmap,&hack_cliprect,layer[0],0,0); - draw_sprites(screen->machine,bitmap,cliprect,1,44,-574); - } else { - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],0,1); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,2); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,4); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,8); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[2],0,0); - draw_sprites(screen->machine,bitmap,cliprect,0,44,-574); + if (tc0100scn_long_r(tc0100scn, 0x4090 / 4, 0xffffffff) || + tc0480scp_long_r(tc0480scp, 0x20 / 4, 0xffffffff) == 0x240866) /* Anything in text layer - really stupid hack */ + { + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 2); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 4); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 8); + + //tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, 0, pivlayer[2], 0, 0); + + if (tc0480scp_long_r(tc0480scp, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */ + tc0480scp_tilemap_draw(tc0480scp, bitmap, &hack_cliprect, layer[0], 0, 0); + draw_sprites(screen->machine, bitmap, cliprect, 1, 44, -574); + } + else + { + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], 0, 1); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 2); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 4); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 8); + + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0); + + draw_sprites(screen->machine, bitmap, cliprect, 0, 44, -574); } - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,0); /* TC0480SCP text layer */ + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); /* TC0480SCP text layer */ return 0; } diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c index 8a5382f707c..ca08cdfd9a9 100644 --- a/src/mame/video/gunbustr.c +++ b/src/mame/video/gunbustr.c @@ -1,7 +1,5 @@ #include "driver.h" -#include "video/taitoic.h" - -#define TC0480SCP_GFX_NUM 1 +#include "video/taiicdev.h" struct tempsprite { @@ -19,8 +17,6 @@ static struct tempsprite *spritelist; VIDEO_START( gunbustr ) { spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000); - - TC0480SCP_vh_start(machine,TC0480SCP_GFX_NUM,0,0x20,0x07,-1,-1,-1,0,0); } /************************************************************ @@ -216,17 +212,18 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); VIDEO_UPDATE( gunbustr ) { + const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; - TC0480SCP_tilemap_update(screen->machine); + tc0480scp_tilemap_update(tc0480scp); - priority = TC0480SCP_get_bg_priority(); - layer[0] = (priority &0xf000) >> 12; /* tells us which bg layer is bottom */ - layer[1] = (priority &0x0f00) >> 8; - layer[2] = (priority &0x00f0) >> 4; - layer[3] = (priority &0x000f) >> 0; /* tells us which is top */ + priority = tc0480scp_get_bg_priority(tc0480scp); + layer[0] = (priority & 0xf000) >> 12; /* tells us which bg layer is bottom */ + layer[1] = (priority & 0x0f00) >> 8; + layer[2] = (priority & 0x00f0) >> 4; + layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ layer[4] = 4; /* text layer always over bg layers */ bitmap_fill(screen->machine->priority_bitmap,cliprect,0); @@ -235,19 +232,19 @@ VIDEO_UPDATE( gunbustr ) sprites as pdrawgfx cannot yet cope with more than 4 layers */ #ifdef MAME_DEBUG - if (!input_code_pressed (screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); - if (!input_code_pressed (screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); - if (!input_code_pressed (screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); - if (!input_code_pressed (screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); - if (!input_code_pressed (screen->machine, KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); - if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); + if (!input_code_pressed (screen->machine, KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0); + if (!input_code_pressed (screen->machine, KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); + if (!input_code_pressed (screen->machine, KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); + if (!input_code_pressed (screen->machine, KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); + if (!input_code_pressed (screen->machine, KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); + if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine, bitmap, cliprect, primasks, 48, -116); #else - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); /* text layer */ - draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); /* text layer */ + draw_sprites(screen->machine, bitmap, cliprect, primasks, 48, -116); #endif return 0; } diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c index 83386dd7888..73500d5dd4d 100644 --- a/src/mame/video/slapshot.c +++ b/src/mame/video/slapshot.c @@ -1,8 +1,5 @@ #include "driver.h" -#include "video/taitoic.h" - -#define TC0480SCP_GFX_NUM 1 -#define TC0100SCN_GFX_NUM 1 +#include "video/taiicdev.h" struct tempsprite { @@ -38,13 +35,6 @@ static VIDEO_START( slapshot_core ) spriteram_buffered = auto_alloc_array(machine, UINT16, machine->generic.spriteram_size/2); spritelist = auto_alloc_array(machine, struct tempsprite, 0x400); - if (has_TC0480SCP(machine)) /* it's a tc0480scp game */ - TC0480SCP_vh_start(machine,TC0480SCP_GFX_NUM,taito_hide_pixels,30,9,-1,1,0,2,256); - else /* it's a tc0100scn game */ - TC0100SCN_vh_start(machine,1,TC0100SCN_GFX_NUM,taito_hide_pixels,0,0,0,0,0,0); - - TC0360PRI_vh_start(machine); /* Purely for save-state purposes */ - for (i = 0; i < 8; i ++) spritebank[i] = 0x400 * i; @@ -510,6 +500,8 @@ a bg layer given priority over some sprites. VIDEO_UPDATE( slapshot ) { + const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + const device_config *tc0360pri = devtag_get_device(screen->machine, "tc0360pri"); UINT8 layer[5]; UINT8 tilepri[5]; UINT8 spritepri[4]; @@ -553,9 +545,9 @@ VIDEO_UPDATE( slapshot ) taito_handle_sprite_buffering(screen->machine); - TC0480SCP_tilemap_update(screen->machine); + tc0480scp_tilemap_update(tc0480scp); - priority = TC0480SCP_get_bg_priority(); + priority = tc0480scp_get_bg_priority(tc0480scp); layer[0] = (priority &0xf000) >> 12; /* tells us which bg layer is bottom */ layer[1] = (priority &0x0f00) >> 8; @@ -563,18 +555,18 @@ VIDEO_UPDATE( slapshot ) layer[3] = (priority &0x000f) >> 0; /* tells us which is top */ layer[4] = 4; /* text layer always over bg layers */ - tilepri[0] = TC0360PRI_regs[4] & 0x0f; /* bg0 */ - tilepri[1] = TC0360PRI_regs[4] >> 4; /* bg1 */ - tilepri[2] = TC0360PRI_regs[5] & 0x0f; /* bg2 */ - tilepri[3] = TC0360PRI_regs[5] >> 4; /* bg3 */ + tilepri[0] = tc0360pri_r(tc0360pri, 4) & 0x0f; /* bg0 */ + tilepri[1] = tc0360pri_r(tc0360pri, 4) >> 4; /* bg1 */ + tilepri[2] = tc0360pri_r(tc0360pri, 5) & 0x0f; /* bg2 */ + tilepri[3] = tc0360pri_r(tc0360pri, 5) >> 4; /* bg3 */ /* we actually assume text layer is on top of everything anyway, but FWIW... */ - tilepri[layer[4]] = TC0360PRI_regs[7] & 0x0f; /* fg (text layer) */ + tilepri[layer[4]] = tc0360pri_r(tc0360pri, 7) & 0x0f; /* fg (text layer) */ - spritepri[0] = TC0360PRI_regs[6] & 0x0f; - spritepri[1] = TC0360PRI_regs[6] >> 4; - spritepri[2] = TC0360PRI_regs[7] & 0x0f; - spritepri[3] = TC0360PRI_regs[7] >> 4; + spritepri[0] = tc0360pri_r(tc0360pri, 6) & 0x0f; + spritepri[1] = tc0360pri_r(tc0360pri, 6) >> 4; + spritepri[2] = tc0360pri_r(tc0360pri, 7) & 0x0f; + spritepri[3] = tc0360pri_r(tc0360pri, 7) >> 4; bitmap_fill(screen->machine->priority_bitmap,cliprect,0); bitmap_fill(bitmap,cliprect,0); @@ -582,22 +574,22 @@ VIDEO_UPDATE( slapshot ) #ifdef MAME_DEBUG if (dislayer[layer[0]]==0) #endif - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],0,1); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], 0, 1); #ifdef MAME_DEBUG if (dislayer[layer[1]]==0) #endif - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,2); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 2); #ifdef MAME_DEBUG if (dislayer[layer[2]]==0) #endif - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,4); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 4); #ifdef MAME_DEBUG if (dislayer[layer[3]]==0) #endif - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,8); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 8); { int primasks[4] = {0,0,0,0}; @@ -623,7 +615,7 @@ VIDEO_UPDATE( slapshot ) #ifdef MAME_DEBUG if (dislayer[layer[4]]==0) #endif - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,0); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); return 0; } diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c index d5399f43c1a..0d8ed2206a7 100644 --- a/src/mame/video/superchs.c +++ b/src/mame/video/superchs.c @@ -1,7 +1,5 @@ #include "driver.h" -#include "video/taitoic.h" - -#define TC0480SCP_GFX_NUM 1 +#include "video/taiicdev.h" struct tempsprite { @@ -17,8 +15,6 @@ static struct tempsprite *spritelist; VIDEO_START( superchs ) { spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000); - - TC0480SCP_vh_start(machine,TC0480SCP_GFX_NUM,0,0x20,0x08,-1,0,0,0,0); } /************************************************************ @@ -213,17 +209,18 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); VIDEO_UPDATE( superchs ) { + const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; - TC0480SCP_tilemap_update(screen->machine); + tc0480scp_tilemap_update(tc0480scp); - priority = TC0480SCP_get_bg_priority(); - layer[0] = (priority &0xf000) >> 12; /* tells us which bg layer is bottom */ - layer[1] = (priority &0x0f00) >> 8; - layer[2] = (priority &0x00f0) >> 4; - layer[3] = (priority &0x000f) >> 0; /* tells us which is top */ + priority = tc0480scp_get_bg_priority(tc0480scp); + layer[0] = (priority & 0xf000) >> 12; /* tells us which bg layer is bottom */ + layer[1] = (priority & 0x0f00) >> 8; + layer[2] = (priority & 0x00f0) >> 4; + layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ layer[4] = 4; /* text layer always over bg layers */ bitmap_fill(screen->machine->priority_bitmap,cliprect,0); @@ -232,19 +229,19 @@ VIDEO_UPDATE( superchs ) sprites as pdrawgfx cannot yet cope with more than 4 layers */ #ifdef MAME_DEBUG - if (!input_code_pressed (screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); - if (!input_code_pressed (screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); - if (!input_code_pressed (screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); - if (!input_code_pressed (screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); - if (!input_code_pressed (screen->machine, KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); - if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); + if (!input_code_pressed (screen->machine, KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + if (!input_code_pressed (screen->machine, KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); + if (!input_code_pressed (screen->machine, KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); + if (!input_code_pressed (screen->machine, KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); + if (!input_code_pressed (screen->machine, KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); + if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine, bitmap, cliprect, primasks, 48, -116); #else - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); /* text layer */ - draw_sprites(screen->machine, bitmap,cliprect,primasks,48,-116); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); /* text layer */ + draw_sprites(screen->machine, bitmap, cliprect, primasks, 48, -116); #endif return 0; } diff --git a/src/mame/video/taiicdev.c b/src/mame/video/taiicdev.c index d91b3094025..20afc6f7cae 100644 --- a/src/mame/video/taiicdev.c +++ b/src/mame/video/taiicdev.c @@ -3616,11 +3616,8 @@ static DEVICE_START( tc0480scp ) const tc0480scp_interface *intf = tc0480scp_get_interface(device); int i, xd, yd; - /* use the given gfx set for bg tiles */ + /* use the given gfx set for bg/tx tiles */ tc0480scp->bg_gfx = intf->gfxnum; - - /* create the char set (gfx will then be updated dynamically from RAM) */ - device->machine->gfx[intf->txnum] = gfx_element_alloc(device->machine, &tc0480scp_charlayout, (UINT8 *)tc0480scp->char_ram, 64, 0); tc0480scp->tx_gfx = intf->txnum; tc0480scp->tile_colbase = intf->col_base; @@ -3702,6 +3699,9 @@ static DEVICE_START( tc0480scp ) tc0480scp_set_layer_ptrs(tc0480scp); + /* create the char set (gfx will then be updated dynamically from RAM) */ + device->machine->gfx[tc0480scp->tx_gfx] = gfx_element_alloc(device->machine, &tc0480scp_charlayout, (UINT8 *)tc0480scp->char_ram, 64, 0); + state_save_register_device_item_pointer(device, 0, tc0480scp->ram, TC0480SCP_RAM_SIZE / 2); state_save_register_device_item_array(device, 0, tc0480scp->ctrl); state_save_register_device_item(device, 0, tc0480scp->dblwidth); diff --git a/src/mame/video/taito_z.c b/src/mame/video/taito_z.c index 71e6c2c36cd..40eae6cec70 100644 --- a/src/mame/video/taito_z.c +++ b/src/mame/video/taito_z.c @@ -1,8 +1,5 @@ #include "driver.h" -#include "video/taitoic.h" - -#define TC0100SCN_GFX_NUM 1 -#define TC0480SCP_GFX_NUM 1 +#include "video/taiicdev.h" static int sci_spriteframe; @@ -11,29 +8,9 @@ static int road_palbank; /**********************************************************/ -static void taitoz_core_vh_start(running_machine *machine, int x_offs) -{ - if (has_TC0480SCP(machine)) /* it's Dblaxle, a tc0480scp game */ - TC0480SCP_vh_start(machine,TC0480SCP_GFX_NUM,x_offs,0x21,0x08,4,0,0,0,0); - else /* it's a tc0100scn game */ - TC0100SCN_vh_start(machine,1,TC0100SCN_GFX_NUM,x_offs,0,0,0,0,0,0); - - if (has_TC0150ROD(machine)) - TC0150ROD_vh_start(machine); - - if (TC0110PCR_mask(machine) & 1) - TC0110PCR_vh_start(machine); -} - VIDEO_START( taitoz ) { road_palbank = 3; - taitoz_core_vh_start(machine, 0); -} - -VIDEO_START( spacegun ) -{ - taitoz_core_vh_start(machine, 4); } /******************************************************** @@ -844,24 +821,26 @@ WRITE16_HANDLER( contcirc_out_w ) VIDEO_UPDATE( contcirc ) { + const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + const device_config *tc0150rod = devtag_get_device(screen->machine, "tc0150rod"); UINT8 layer[3]; - TC0100SCN_tilemap_update(screen->machine); + tc0100scn_tilemap_update(tc0100scn); - layer[0] = TC0100SCN_bottomlayer(0); - layer[1] = layer[0]^1; + layer[0] = tc0100scn_bottomlayer(tc0100scn); + layer[1] = layer[0] ^ 1; layer[2] = 2; bitmap_fill(screen->machine->priority_bitmap,cliprect,0); bitmap_fill(bitmap, cliprect, 0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[0],0,0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[1],0,1); - TC0150ROD_draw(screen->machine,bitmap,cliprect,-3,road_palbank << 6,1,0,1,2); // -6 - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[2],0,4); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[0], 0, 0); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1); + tc0150rod_draw(tc0150rod, bitmap, cliprect, -3, road_palbank << 6, 1, 0, 1, 2); // -6 + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 4); - contcirc_draw_sprites_16x8(screen->machine, bitmap,cliprect,5); // 7 + contcirc_draw_sprites_16x8(screen->machine, bitmap, cliprect, 5); // 7 return 0; } @@ -870,12 +849,14 @@ VIDEO_UPDATE( contcirc ) VIDEO_UPDATE( chasehq ) { + const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + const device_config *tc0150rod = devtag_get_device(screen->machine, "tc0150rod"); UINT8 layer[3]; - TC0100SCN_tilemap_update(screen->machine); + tc0100scn_tilemap_update(tc0100scn); - layer[0] = TC0100SCN_bottomlayer(0); - layer[1] = layer[0]^1; + layer[0] = tc0100scn_bottomlayer(tc0100scn); + layer[1] = layer[0] ^ 1; layer[2] = 2; bitmap_fill(screen->machine->priority_bitmap,cliprect,0); @@ -883,111 +864,118 @@ VIDEO_UPDATE( chasehq ) /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[1],0,1); - TC0150ROD_draw(screen->machine,bitmap,cliprect,-1,0xc0,0,0,1,2); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[2],0,4); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1); + tc0150rod_draw(tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 4); - chasehq_draw_sprites_16x16(screen->machine, bitmap,cliprect,7); + chasehq_draw_sprites_16x16(screen->machine, bitmap, cliprect, 7); return 0; } VIDEO_UPDATE( bshark ) { + const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + const device_config *tc0150rod = devtag_get_device(screen->machine, "tc0150rod"); UINT8 layer[3]; - TC0100SCN_tilemap_update(screen->machine); + tc0100scn_tilemap_update(tc0100scn); - layer[0] = TC0100SCN_bottomlayer(0); - layer[1] = layer[0]^1; + layer[0] = tc0100scn_bottomlayer(tc0100scn); + layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine->priority_bitmap,cliprect,0); + bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ - bitmap_fill(bitmap, cliprect,0); + bitmap_fill(bitmap, cliprect, 0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[1],0,1); - TC0150ROD_draw(screen->machine,bitmap,cliprect,-1,0xc0,0,1,1,2); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[2],0,4); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1); + tc0150rod_draw(tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 1, 1, 2); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 4); - bshark_draw_sprites_16x8(screen->machine, bitmap,cliprect,8); + bshark_draw_sprites_16x8(screen->machine, bitmap, cliprect, 8); return 0; } VIDEO_UPDATE( sci ) { + const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + const device_config *tc0150rod = devtag_get_device(screen->machine, "tc0150rod"); UINT8 layer[3]; - TC0100SCN_tilemap_update(screen->machine); + tc0100scn_tilemap_update(tc0100scn); - layer[0] = TC0100SCN_bottomlayer(0); - layer[1] = layer[0]^1; + layer[0] = tc0100scn_bottomlayer(tc0100scn); + layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine->priority_bitmap,cliprect,0); + bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[1],0,1); - TC0150ROD_draw(screen->machine,bitmap,cliprect,-1,0xc0,0,0,1,2); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[2],0,4); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1); + tc0150rod_draw(tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 4); - sci_draw_sprites_16x8(screen->machine, bitmap,cliprect,6); + sci_draw_sprites_16x8(screen->machine, bitmap, cliprect, 6); return 0; } VIDEO_UPDATE( aquajack ) { + const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + const device_config *tc0150rod = devtag_get_device(screen->machine, "tc0150rod"); UINT8 layer[3]; - TC0100SCN_tilemap_update(screen->machine); + tc0100scn_tilemap_update(tc0100scn); - layer[0] = TC0100SCN_bottomlayer(0); - layer[1] = layer[0]^1; + layer[0] = tc0100scn_bottomlayer(tc0100scn); + layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine->priority_bitmap,cliprect,0); + bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[1],0,1); - TC0150ROD_draw(screen->machine,bitmap,cliprect,-1,0,2,1,1,2); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[2],0,4); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1); + tc0150rod_draw(tc0150rod, bitmap, cliprect, -1, 0, 2, 1, 1, 2); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 4); - aquajack_draw_sprites_16x8(screen->machine, bitmap,cliprect,3); + aquajack_draw_sprites_16x8(screen->machine, bitmap, cliprect, 3); return 0; } VIDEO_UPDATE( spacegun ) { + const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); UINT8 layer[3]; - TC0100SCN_tilemap_update(screen->machine); + tc0100scn_tilemap_update(tc0100scn); - layer[0] = TC0100SCN_bottomlayer(0); - layer[1] = layer[0]^1; + layer[0] = tc0100scn_bottomlayer(tc0100scn); + layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine->priority_bitmap,cliprect,0); + bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[1],0,2); - TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,layer[2],0,4); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 2); + tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 4); - spacegun_draw_sprites_16x8(screen->machine, bitmap,cliprect,4); + spacegun_draw_sprites_16x8(screen->machine, bitmap, cliprect, 4); return 0; } @@ -995,34 +983,36 @@ VIDEO_UPDATE( spacegun ) VIDEO_UPDATE( dblaxle ) { + const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + const device_config *tc0150rod = devtag_get_device(screen->machine, "tc0150rod"); UINT8 layer[5]; UINT16 priority; - TC0480SCP_tilemap_update(screen->machine); + tc0480scp_tilemap_update(tc0480scp); - priority = TC0480SCP_get_bg_priority(); + priority = tc0480scp_get_bg_priority(tc0480scp); - layer[0] = (priority &0xf000) >> 12; /* tells us which bg layer is bottom */ - layer[1] = (priority &0x0f00) >> 8; - layer[2] = (priority &0x00f0) >> 4; - layer[3] = (priority &0x000f) >> 0; /* tells us which is top */ + layer[0] = (priority & 0xf000) >> 12; /* tells us which bg layer is bottom */ + layer[1] = (priority & 0x0f00) >> 8; + layer[2] = (priority & 0x00f0) >> 4; + layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ layer[4] = 4; /* text layer always over bg layers */ - bitmap_fill(screen->machine->priority_bitmap,cliprect,0); + bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); /* Ensure screen blanked - this shouldn't be necessary! */ bitmap_fill(bitmap, cliprect, 0); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,0); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,1); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 0); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 1); - TC0150ROD_draw(screen->machine,bitmap,cliprect,-1,0xc0,0,0,1,2); - bshark_draw_sprites_16x8(screen->machine, bitmap,cliprect,7); + tc0150rod_draw(tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2); + bshark_draw_sprites_16x8(screen->machine, bitmap, cliprect, 7); /* This layer used for the big numeric displays */ - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); - TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,0); /* Text layer */ + tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); /* Text layer */ return 0; }