diff options
author | 2016-12-10 00:58:50 +0100 | |
---|---|---|
committer | 2016-12-10 00:59:04 +0100 | |
commit | b043dc7a182eb1ee11b85e8f6046f63f85f9b0c0 (patch) | |
tree | 9f25699ede219b7c61ff4603a1494afdc64c678b /src | |
parent | 091b93238defe4a900c6cde5c7230b9720db7437 (diff) |
-tnzs: Added Taito M-Chip M-001 dump for extrmatn. Also works for drtoppel and plumppop. [Caps0ff]
Diffstat (limited to 'src')
-rw-r--r-- | src/mame/drivers/tnzs.cpp | 215 | ||||
-rw-r--r-- | src/mame/includes/tnzs.h | 38 | ||||
-rw-r--r-- | src/mame/machine/tnzs.cpp | 495 |
3 files changed, 235 insertions, 513 deletions
diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp index c24812c04da..aab52b46744 100644 --- a/src/mame/drivers/tnzs.cpp +++ b/src/mame/drivers/tnzs.cpp @@ -413,7 +413,7 @@ TODO: - Find out how the hardware credit-counter works (MPU) - Fix MCU simulation errors : * avoid credits to be increased when in "test mode" to avoid coin lockout - (needed to complete special test mode in 'extermatn' and 'arknoid2') + (needed to complete special test mode in 'extrmatn' and 'arknoid2') * why are credits limited to 9 in some games ? pressing SERVICE1 allows to go up to 100 and cause this : . 'plumppop' : freeze @@ -770,12 +770,23 @@ static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, tnzs_state ) AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("subbank") AM_RANGE(0xa000, 0xa000) AM_WRITE(tnzs_bankswitch1_w) AM_RANGE(0xb000, 0xb001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) - AM_RANGE(0xc000, 0xc001) AM_READWRITE(tnzs_mcu_r, tnzs_mcu_w) /* not present in insectx */ + AM_RANGE(0xc000, 0xc001) AM_READWRITE(mcu_r, mcu_w) /* not present in insectx */ + AM_RANGE(0xd000, 0xdfff) AM_RAM + AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("share1") + AM_RANGE(0xf000, 0xf003) AM_READ(arknoid2_sh_f000_r) /* paddles in arkanoid2/plumppop. The ports are */ + /* read but not used by the other games, and are not read at */ + /* all by insectx. */ +ADDRESS_MAP_END + +static ADDRESS_MAP_START( arknoid2_sub_map, AS_PROGRAM, 8, tnzs_state ) + AM_RANGE(0x0000, 0x7fff) AM_ROM + AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("subbank") + AM_RANGE(0xa000, 0xa000) AM_WRITE(arknoid2_mcu_reset_w) + AM_RANGE(0xb000, 0xb001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) + AM_RANGE(0xc000, 0xc001) AM_READWRITE(arknoid2_mcu_r, arknoid2_mcu_w) AM_RANGE(0xd000, 0xdfff) AM_RAM AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("share1") AM_RANGE(0xf000, 0xf003) AM_READ(arknoid2_sh_f000_r) /* paddles in arkanoid2/plumppop. The ports are */ - /* read but not used by the other games, and are not read at */ - /* all by insectx. */ ADDRESS_MAP_END static ADDRESS_MAP_START( kageki_sub_map, AS_PROGRAM, 8, tnzs_state ) @@ -846,14 +857,13 @@ static ADDRESS_MAP_START( tnzsb_io_map, AS_IO, 8, tnzs_state ) AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END -static ADDRESS_MAP_START( i8742_io_map, AS_IO, 8, tnzs_state ) - AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(tnzs_port1_r) - AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(tnzs_port2_r, tnzs_port2_w) +static ADDRESS_MAP_START( i8742_map, AS_IO, 8, tnzs_state ) + AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(mcu_port1_r) + AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(mcu_port2_r, mcu_port2_w) AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ_PORT("COIN1") AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_PORT("COIN2") ADDRESS_MAP_END - static ADDRESS_MAP_START( jpopnics_main_map, AS_PROGRAM, 8, tnzs_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_DEVICE("mainbank", address_map_bank_device, amap8) @@ -1538,101 +1548,7 @@ WRITE_LINE_MEMBER(tnzs_state::irqhandler) m_audiocpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); } -static MACHINE_CONFIG_START( arknoid2, tnzs_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */ - MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tnzs_state, arknoid2_interrupt) - - MCFG_CPU_ADD("sub", Z80, XTAL_12MHz/2) /* verified on pcb */ - MCFG_CPU_PROGRAM_MAP(sub_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tnzs_state, irq0_line_hold) - - MCFG_FRAGMENT_ADD(tnzs_mainbank) - - MCFG_QUANTUM_PERFECT_CPU("maincpu") - - MCFG_MACHINE_START_OVERRIDE(tnzs_state,tnzs) - MCFG_MACHINE_RESET_OVERRIDE(tnzs_state,tnzs) - - MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) - MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(tnzs_state, screen_update_tnzs) - MCFG_SCREEN_VBLANK_DRIVER(tnzs_state, screen_eof_tnzs) - MCFG_SCREEN_PALETTE("palette") - - MCFG_GFXDECODE_ADD("gfxdecode", "palette", tnzs) - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - - MCFG_PALETTE_INIT_OWNER(tnzs_state,arknoid2) - - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("speaker") - - MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) -MACHINE_CONFIG_END - - -static MACHINE_CONFIG_START( drtoppel, tnzs_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz */ - MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tnzs_state, arknoid2_interrupt) - - MCFG_CPU_ADD("sub", Z80,XTAL_12MHz/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz */ - MCFG_CPU_PROGRAM_MAP(sub_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tnzs_state, irq0_line_hold) - - MCFG_FRAGMENT_ADD(tnzs_mainbank) - - MCFG_QUANTUM_PERFECT_CPU("maincpu") - - MCFG_MACHINE_START_OVERRIDE(tnzs_state,tnzs) - MCFG_MACHINE_RESET_OVERRIDE(tnzs_state,tnzs) - - MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) - MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(tnzs_state, screen_update_tnzs) - MCFG_SCREEN_VBLANK_DRIVER(tnzs_state, screen_eof_tnzs) - MCFG_SCREEN_PALETTE("palette") - - MCFG_GFXDECODE_ADD("gfxdecode", "palette", tnzs) - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_PALETTE_INIT_OWNER(tnzs_state,arknoid2) - - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("speaker") - - MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) -MACHINE_CONFIG_END - - static MACHINE_CONFIG_START( tnzs, tnzs_state ) - /* basic machine hardware */ MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz */ MCFG_CPU_PROGRAM_MAP(main_map) @@ -1643,7 +1559,7 @@ static MACHINE_CONFIG_START( tnzs, tnzs_state ) MCFG_CPU_VBLANK_INT_DRIVER("screen", tnzs_state, irq0_line_hold) MCFG_CPU_ADD("mcu", I8742, 12000000/2) /* 400KHz ??? - Main board Crystal is 12MHz */ - MCFG_CPU_IO_MAP(i8742_io_map) + MCFG_CPU_IO_MAP(i8742_map) MCFG_FRAGMENT_ADD(tnzs_mainbank) @@ -1678,6 +1594,25 @@ static MACHINE_CONFIG_START( tnzs, tnzs_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( extrmatn, tnzs ) + MCFG_PALETTE_MODIFY("palette") + MCFG_PALETTE_INIT_OWNER(tnzs_state,arknoid2) +MACHINE_CONFIG_END + +static MACHINE_CONFIG_DERIVED( arknoid2, tnzs ) + /* basic machine hardware */ + MCFG_CPU_MODIFY("maincpu") + MCFG_CPU_VBLANK_INT_DRIVER("screen", tnzs_state, arknoid2_interrupt) + + MCFG_CPU_MODIFY("sub") + MCFG_CPU_PROGRAM_MAP(arknoid2_sub_map) + + MCFG_CPU_MODIFY("mcu") + MCFG_DEVICE_DISABLE() + + MCFG_PALETTE_MODIFY("palette") + MCFG_PALETTE_INIT_OWNER(tnzs_state,arknoid2) +MACHINE_CONFIG_END static MACHINE_CONFIG_START( insectx, tnzs_state ) @@ -1907,8 +1842,8 @@ ROM_START( plumppop ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "a98-11.bin", 0x00000, 0x10000, CRC(bc56775c) SHA1(0c22c22c0e9d7ec0e34f8ab4bfe61068f65e8759) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ - ROM_LOAD( "plmp8742.bin", 0x0000, 0x0800, NO_DUMP ) + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ + ROM_LOAD( "b06-14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Chip label is a guess, also unknown if it actually uses the same MCU as drtoppel/extrmatn, but it appears to work fine */ ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "a98-01.bin", 0x00000, 0x10000, CRC(f3033dca) SHA1(130744998f0531a82de2814231dddea3ad710f60) ) @@ -1959,8 +1894,8 @@ ROM_START( extrmatn ) ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */ ROM_LOAD( "b06-19.4e", 0x00000, 0x10000, CRC(8de43ed9) SHA1(53e6d8fa93889c38733d169e983f2caf1da71f43) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ - ROM_LOAD( "extr8742.4f", 0x0000, 0x0800, NO_DUMP ) /* Labeled B06-14 */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ + ROM_LOAD( "b06-14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */ ROM_REGION( 0x80000, "gfx1", 0 ) ROM_LOAD( "b06-01.13a", 0x00000, 0x20000, CRC(d2afbf7e) SHA1(28b4cf94798f049a9f8375464741dbef208d7290) ) @@ -1981,8 +1916,8 @@ ROM_START( extrmatnu ) ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */ ROM_LOAD( "b06-22.4e", 0x00000, 0x10000, CRC(744f2c84) SHA1(7565c1594c2a3bae1ae45afcbf93363fe2b12d58) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ - ROM_LOAD( "extr8742.4f", 0x0000, 0x0800, NO_DUMP ) /* Labeled B06-14 */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ + ROM_LOAD( "b06-14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */ ROM_REGION( 0x80000, "gfx1", 0 ) ROM_LOAD( "b06-01.13a", 0x00000, 0x20000, CRC(d2afbf7e) SHA1(28b4cf94798f049a9f8375464741dbef208d7290) ) @@ -2004,8 +1939,8 @@ ROM_START( extrmatnur ) ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */ ROM_LOAD( "b06_17", 0x00000, 0x10000, CRC(744f2c84) SHA1(7565c1594c2a3bae1ae45afcbf93363fe2b12d58) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ - ROM_LOAD( "extr8742.4f", 0x0000, 0x0800, NO_DUMP ) /* Labeled B06-14 */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ + ROM_LOAD( "b06-14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */ ROM_REGION( 0x80000, "gfx1", 0 ) ROM_LOAD( "b06-01.13a", 0x00000, 0x20000, CRC(d2afbf7e) SHA1(28b4cf94798f049a9f8375464741dbef208d7290) ) @@ -2026,8 +1961,8 @@ ROM_START( extrmatnj ) ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */ ROM_LOAD( "b06-07.4e", 0x00000, 0x10000, CRC(b37fb8b3) SHA1(10696914b9e39d34d56069a69b9d641339ea2309) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ - ROM_LOAD( "extr8742.4f", 0x0000, 0x0800, NO_DUMP ) /* Labeled B06-14 */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ + ROM_LOAD( "b06-14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */ ROM_REGION( 0x80000, "gfx1", 0 ) ROM_LOAD( "b06-01.13a", 0x00000, 0x20000, CRC(d2afbf7e) SHA1(28b4cf94798f049a9f8375464741dbef208d7290) ) @@ -2048,7 +1983,7 @@ ROM_START( arknoid2 ) ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */ ROM_LOAD( "b08_13.3e", 0x00000, 0x10000, CRC(e8035ef1) SHA1(9a54e952cff0036c4b6affd9ffb1097cdccbe255) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "ark28742.3g", 0x0000, 0x0800, NO_DUMP ) ROM_REGION( 0x80000, "gfx1", 0 ) @@ -2070,7 +2005,7 @@ ROM_START( arknoid2u ) ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */ ROM_LOAD( "b08_12.3e", 0x00000, 0x10000, CRC(dc84e27d) SHA1(d549d8c9fbec0521517f0c5f5cee763e27d48633) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "ark28742.3g", 0x0000, 0x0800, NO_DUMP ) ROM_REGION( 0x80000, "gfx1", 0 ) @@ -2092,7 +2027,7 @@ ROM_START( arknoid2j ) ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */ ROM_LOAD( "b08_06.3e", 0x00000, 0x10000, CRC(adfcd40c) SHA1(f91299407ed21e2dd244c9b1a315b27ed32f5514) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "ark28742.3g", 0x0000, 0x0800, NO_DUMP ) ROM_REGION( 0x80000, "gfx1", 0 ) @@ -2114,7 +2049,7 @@ ROM_START( arknoid2b ) ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */ ROM_LOAD( "b08_13.3e", 0x00000, 0x10000, CRC(e8035ef1) SHA1(9a54e952cff0036c4b6affd9ffb1097cdccbe255) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "ark28742.3g", 0x0000, 0x0800, NO_DUMP ) ROM_REGION( 0x80000, "gfx1", 0 ) @@ -2136,8 +2071,8 @@ ROM_START( drtoppel ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b19-15.3e", 0x00000, 0x10000, CRC(37a0d3fb) SHA1(f65fb9382af5f5b09725c39b660c5138b3912f53) ) /* Hacked??, need correct Taito rom number */ - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ - ROM_LOAD( "drt8742.3g", 0x0000, 0x0800, NO_DUMP ) /* Labeled B06-14, reused from Extermination, under printed label "Taito M-001, 128P, 720100" */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ + ROM_LOAD( "b06-14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */ ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "b19-01.13a", 0x00000, 0x20000, CRC(a7e8a0c1) SHA1(a2f017ae5b6472d4202f126d0247b3fe4b1321d1) ) @@ -2162,8 +2097,8 @@ ROM_START( drtoppelu ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b19-14.3e", 0x00000, 0x10000, CRC(05565b22) SHA1(d1aa47b438d3b44c5177337809e38b50f6445c36) ) /* Hacked??, need correct Taito rom number */ - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ - ROM_LOAD( "drt8742.3g", 0x0000, 0x0800, NO_DUMP ) /* Labeled B06-14, reused from Extermination, under printed label "Taito M-001, 128P, 720100" */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ + ROM_LOAD( "b06-14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */ ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "b19-01.13a", 0x00000, 0x20000, CRC(a7e8a0c1) SHA1(a2f017ae5b6472d4202f126d0247b3fe4b1321d1) ) @@ -2188,8 +2123,8 @@ ROM_START( drtoppelj ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b19-11.3e", 0x00000, 0x10000, CRC(524dc249) SHA1(158b2de0fcd17ad16ba72bb24888122bf704e216) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* M-Chip (i8742 internal ROM) */ - ROM_LOAD( "drt8742.3g", 0x0000, 0x0800, NO_DUMP ) /* Labeled B06-14, reused from Extermination, under printed label "Taito M-001, 128P, 720100" */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ + ROM_LOAD( "b06-14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */ ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "b19-01.13a", 0x00000, 0x20000, CRC(a7e8a0c1) SHA1(a2f017ae5b6472d4202f126d0247b3fe4b1321d1) ) @@ -2326,7 +2261,7 @@ ROM_START( chukatai ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b44-12w", 0x00000, 0x10000, CRC(e80ecdca) SHA1(cd96403ca97f18f630118dcb3dc2179c01147213) ) /* Hacked??, need correct Taito rom number */ - ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "b44-8742.mcu", 0x0000, 0x0800, CRC(7dff3f9f) SHA1(bbf4e036d025fe8179b053d639f9b8ad401e6e68) ) ROM_REGION( 0x100000, "gfx1", 0 ) @@ -2348,7 +2283,7 @@ ROM_START( chukataiu ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b44-12u", 0x00000, 0x10000, CRC(9f09fd5c) SHA1(ae92f2e893e1e666dcabbd793f1a778c5e3d7bab) ) /* Hacked??, need correct Taito rom number */ - ROM_REGION( 0x1000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x1000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "b44-8742.mcu", 0x0000, 0x0800, CRC(7dff3f9f) SHA1(bbf4e036d025fe8179b053d639f9b8ad401e6e68) ) ROM_REGION( 0x100000, "gfx1", 0 ) @@ -2370,7 +2305,7 @@ ROM_START( chukataij ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b44-12", 0x00000, 0x10000, CRC(0600ace6) SHA1(3d5767b91ea63128bfbff3527ddcf90fcf43af2e) ) - ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "b44-8742.mcu", 0x0000, 0x0800, CRC(7dff3f9f) SHA1(bbf4e036d025fe8179b053d639f9b8ad401e6e68) ) ROM_REGION( 0x100000, "gfx1", 0 ) @@ -2517,7 +2452,7 @@ Taito ID: K1100356A Seta ID: P0-041A */ /* This pcb is similar but not identical to the Chuka Taisen pcb; - There is an M-chip i8742 (with Taito silkscreen) and no 3rd z80. + There is an M-chip i8x42 (with Taito silkscreen) and no 3rd z80. There is no daughter-pcb like the later TNZS pcb has. */ ROM_START( tnzsjo ) ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k + bankswitch areas for the first CPU */ @@ -2526,7 +2461,7 @@ ROM_START( tnzsjo ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b53-11.27c512.u38", 0x00000, 0x10000, CRC(9784d443) SHA1(bc3647aac9974031dbe4898417fbaa99841f9548) ) - ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "b53-09.u46", 0x0000, 0x0800, CRC(a4bfce19) SHA1(9340862d5bdc1ad4799dc92cae9bce1428b47478) ) ROM_REGION( 0x100000, "gfx1", 0 ) @@ -2554,7 +2489,7 @@ ROM_START( tnzsuo ) ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b53-13.27c512.u38", 0x00000, 0x10000, CRC(c09f4d28) SHA1(f1fd3202869738e17abcbb757f9ce7260707dd3d) ) - ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "b53-09.u46", 0x0000, 0x0800, CRC(a4bfce19) SHA1(9340862d5bdc1ad4799dc92cae9bce1428b47478) ) ROM_REGION( 0x100000, "gfx1", 0 ) @@ -2574,14 +2509,14 @@ ROM_START( tnzsuo ) ROM_LOAD( "b06-101.pal16l8a.u36.jed", 0x03000, 0x01000, NO_DUMP) ROM_END - ROM_START( tnzso ) +ROM_START( tnzso ) ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k + bankswitch areas for the first CPU */ ROM_LOAD( "b53-unknown.27c1001d.u32", 0x00000, 0x20000, CRC(edf3b39e) SHA1(be221c99e50795d569611dba454c3954a259a859) ) // ROM LABEL FOR THIS SET IS UNKNOWN ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "b53-unknown.27c512.u38", 0x00000, 0x10000, CRC(60340d63) SHA1(12a26d19dc8e407e502f25617a5a4c9cea131ce2) ) // ROM LABEL FOR THIS SET IS UNKNOWN - ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "b53-09.u46", 0x0000, 0x0800, CRC(a4bfce19) SHA1(9340862d5bdc1ad4799dc92cae9bce1428b47478) ) ROM_REGION( 0x100000, "gfx1", 0 ) @@ -2610,7 +2545,7 @@ ROM_START( tnzsop ) // prototype/location test version? ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */ ROM_LOAD( "ns_e-3.27c512.u38", 0x00000, 0x10000, CRC(c7662e96) SHA1(be28298bfde4e3867cfe75633ffb0f8611dbbd8b) ) - ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */ + ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */ ROM_LOAD( "b53-09.u46", 0x0000, 0x0800, CRC(a4bfce19) SHA1(9340862d5bdc1ad4799dc92cae9bce1428b47478) ) ROM_REGION( 0x100000, "gfx1", 0 ) @@ -2737,22 +2672,22 @@ ROM_END // YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS -GAME( 1987, plumppop, 0, drtoppel, plumppop, tnzs_state, plumpop, ROT0, "Taito Corporation", "Plump Pop (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, plumppop, 0, extrmatn, plumppop, tnzs_state, plumpop, ROT0, "Taito Corporation", "Plump Pop (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, jpopnics, 0, jpopnics, jpopnics, driver_device, 0, ROT0, "Nics", "Jumping Pop (Nics, Korean hack of Plump Pop)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1987, extrmatn, 0, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation Japan", "Extermination (World)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, extrmatnu, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito (World Games license)", "Extermination (US, World Games)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, extrmatnur,extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito America Corporation (Romstar license)", "Extermination (US, Romstar)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, extrmatnj, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation", "Extermination (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, extrmatn, 0, extrmatn, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation Japan", "Extermination (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, extrmatnu, extrmatn, extrmatn, extrmatn, tnzs_state, extrmatn, ROT270, "Taito (World Games license)", "Extermination (US, World Games)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, extrmatnur,extrmatn, extrmatn, extrmatn, tnzs_state, extrmatn, ROT270, "Taito America Corporation (Romstar license)", "Extermination (US, Romstar)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, extrmatnj, extrmatn, extrmatn, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation", "Extermination (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, arknoid2, 0, arknoid2, arknoid2, tnzs_state, arknoid2, ROT270, "Taito Corporation Japan", "Arkanoid - Revenge of DOH (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, arknoid2u, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito America Corporation (Romstar license)", "Arkanoid - Revenge of DOH (US)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, arknoid2j, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito Corporation", "Arkanoid - Revenge of DOH (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, arknoid2b, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "bootleg", "Arkanoid - Revenge of DOH (Japan bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, drtoppel, 0, drtoppel, drtoppel, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation Japan", "Dr. Toppel's Adventure (World)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */ -GAME( 1987, drtoppelu, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito America Corporation", "Dr. Toppel's Adventure (US)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */ -GAME( 1987, drtoppelj, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation", "Dr. Toppel's Tankentai (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, drtoppel, 0, extrmatn, drtoppel, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation Japan", "Dr. Toppel's Adventure (World)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */ +GAME( 1987, drtoppelu, drtoppel, extrmatn, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito America Corporation", "Dr. Toppel's Adventure (US)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */ +GAME( 1987, drtoppelj, drtoppel, extrmatn, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation", "Dr. Toppel's Tankentai (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, kageki, 0, kageki, kageki, tnzs_state, kageki, ROT90, "Kaneko / Taito America Corporation (Romstar license)", "Kageki (US)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, kagekij, kageki, kageki, kagekij, tnzs_state, kageki, ROT90, "Kaneko / Taito Corporation", "Kageki (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h index 6e57dc0ff6c..1a7ff1d9052 100644 --- a/src/mame/includes/tnzs.h +++ b/src/mame/includes/tnzs.h @@ -12,16 +12,12 @@ enum { - MCU_NONE_INSECTX = 0, + MCU_ARKANOID_SIM = 0, + MCU_MCHIP_LLE, + MCU_NONE_INSECTX, MCU_NONE_KAGEKI, MCU_NONE_TNZSB, - MCU_NONE_KABUKIZ, - MCU_EXTRMATN, - MCU_ARKANOID, - MCU_PLUMPOP, - MCU_DRTOPPEL, - MCU_CHUKATAI, - MCU_TNZS + MCU_NONE_KABUKIZ }; class tnzs_state : public driver_device @@ -48,8 +44,9 @@ public: m_coin1(*this, "COIN1"), m_coin2(*this, "COIN2"), m_an1(*this, "AN1"), - m_an2(*this, "AN2") - { } + m_an2(*this, "AN2"), + m_lockout_level(false) + { } /* devices */ required_device<cpu_device> m_maincpu; @@ -92,23 +89,26 @@ public: uint8_t m_mcu_coins_b; uint8_t m_mcu_credits; int m_bank2; + bool m_lockout_level; + + DECLARE_READ8_MEMBER(mcu_port1_r); + DECLARE_READ8_MEMBER(mcu_port2_r); + DECLARE_WRITE8_MEMBER(mcu_port2_w ); + DECLARE_READ8_MEMBER(mcu_r); + DECLARE_WRITE8_MEMBER(mcu_w); DECLARE_WRITE8_MEMBER(tnzsb_sound_command_w); DECLARE_WRITE8_MEMBER(jpopnics_subbankswitch_w); DECLARE_READ8_MEMBER(tnzs_port1_r); DECLARE_READ8_MEMBER(tnzs_port2_r); DECLARE_WRITE8_MEMBER(tnzs_port2_w); + DECLARE_WRITE8_MEMBER(extrmatn_port2_w); DECLARE_READ8_MEMBER(arknoid2_sh_f000_r); - DECLARE_READ8_MEMBER(tnzs_mcu_r); - DECLARE_WRITE8_MEMBER(tnzs_mcu_w); DECLARE_WRITE8_MEMBER(tnzs_ramrom_bankswitch_w); DECLARE_WRITE8_MEMBER(tnzs_bankswitch1_w); - DECLARE_READ8_MEMBER(mcu_tnzs_r); - DECLARE_WRITE8_MEMBER(mcu_tnzs_w); - DECLARE_READ8_MEMBER(mcu_arknoid2_r); - DECLARE_WRITE8_MEMBER(mcu_arknoid2_w); - DECLARE_READ8_MEMBER(mcu_extrmatn_r); - DECLARE_WRITE8_MEMBER(mcu_extrmatn_w); + DECLARE_READ8_MEMBER(arknoid2_mcu_r); + DECLARE_WRITE8_MEMBER(arknoid2_mcu_w); + DECLARE_WRITE8_MEMBER(arknoid2_mcu_reset_w); DECLARE_READ8_MEMBER(kageki_csport_r); DECLARE_WRITE8_MEMBER(kageki_csport_w); DECLARE_WRITE8_MEMBER(kabukiz_sound_bank_w); @@ -137,6 +137,6 @@ public: INTERRUPT_GEN_MEMBER(arknoid2_interrupt); - void mcu_reset(); + void arknoid2_mcu_reset(); void mcu_handle_coins(int coin); }; diff --git a/src/mame/machine/tnzs.cpp b/src/mame/machine/tnzs.cpp index 5359a4d0458..2119cfe2771 100644 --- a/src/mame/machine/tnzs.cpp +++ b/src/mame/machine/tnzs.cpp @@ -18,13 +18,9 @@ #include "cpu/mcs48/mcs48.h" #include "includes/tnzs.h" - - -READ8_MEMBER(tnzs_state::mcu_tnzs_r) +READ8_MEMBER(tnzs_state::mcu_r) { - uint8_t data; - - data = m_mcu->upi41_master_r(space, offset & 1); + uint8_t data = m_mcu->upi41_master_r(space, offset & 1); space.device().execute().yield(); // logerror("PC %04x: read %02x from mcu $c00%01x\n", space.device().safe_pcbase(), data, offset); @@ -32,19 +28,18 @@ READ8_MEMBER(tnzs_state::mcu_tnzs_r) return data; } -WRITE8_MEMBER(tnzs_state::mcu_tnzs_w) +WRITE8_MEMBER(tnzs_state::mcu_w) { // logerror("PC %04x: write %02x to mcu $c00%01x\n", space.device().safe_pcbase(), data, offset); m_mcu->upi41_master_w(space, offset & 1, data); } - -READ8_MEMBER(tnzs_state::tnzs_port1_r) +READ8_MEMBER(tnzs_state::mcu_port1_r) { int data = 0; - switch (m_input_select & 0x0f) + switch (m_input_select) { case 0x0a: data = m_in2->read(); break; case 0x0c: data = m_in0->read(); break; @@ -57,29 +52,21 @@ READ8_MEMBER(tnzs_state::tnzs_port1_r) return data; } -READ8_MEMBER(tnzs_state::tnzs_port2_r) +READ8_MEMBER(tnzs_state::mcu_port2_r) { - int data = m_in2->read(); - -// logerror("I8742:%04x Read %02x from port 2\n", space.device().safe_pcbase(), data); - - return data; + return m_in2->read(); } -WRITE8_MEMBER(tnzs_state::tnzs_port2_w) +WRITE8_MEMBER(tnzs_state::mcu_port2_w) { -// logerror("I8742:%04x Write %02x to port 2\n", space.device().safe_pcbase(), data); - - machine().bookkeeping().coin_lockout_w(0, (data & 0x40)); - machine().bookkeeping().coin_lockout_w(1, (data & 0x80)); + machine().bookkeeping().coin_lockout_w(0, (data & 0x40) != 0 ? m_lockout_level : !m_lockout_level); + machine().bookkeeping().coin_lockout_w(1, (data & 0x80) != 0 ? m_lockout_level : !m_lockout_level); machine().bookkeeping().coin_counter_w(0, (~data & 0x10)); machine().bookkeeping().coin_counter_w(1, (~data & 0x20)); - m_input_select = data; + m_input_select = data & 0xf; } - - READ8_MEMBER(tnzs_state::arknoid2_sh_f000_r) { // logerror("PC %04x: read input %04x\n", space.device().safe_pc(), 0xf000 + offset); @@ -93,7 +80,7 @@ READ8_MEMBER(tnzs_state::arknoid2_sh_f000_r) } -void tnzs_state::mcu_reset( ) +void tnzs_state::arknoid2_mcu_reset() { m_mcu_initializing = 3; m_mcu_coinage_init = 0; @@ -179,248 +166,6 @@ void tnzs_state::mcu_handle_coins( int coin ) m_insertcoin = coin; } - -READ8_MEMBER(tnzs_state::mcu_arknoid2_r) -{ - static const char mcu_startup[] = "\x55\xaa\x5a"; - -// logerror("PC %04x: read mcu %04x\n", space.device().safe_pc(), 0xc000 + offset); - - if (offset == 0) - { - /* if the mcu has just been reset, return startup code */ - if (m_mcu_initializing) - { - m_mcu_initializing--; - return mcu_startup[2 - m_mcu_initializing]; - } - - switch (m_mcu_command) - { - case 0x41: - return m_mcu_credits; - - case 0xc1: - /* Read the credit counter or the inputs */ - if (m_mcu_readcredits == 0) - { - m_mcu_readcredits = 1; - if (m_mcu_reportcoin & 0x08) - { - m_mcu_initializing = 3; - return 0xee; /* tilt */ - } - else return m_mcu_credits; - } - else return m_in0->read(); /* buttons */ - - default: - logerror("error, unknown mcu command\n"); - /* should not happen */ - return 0xff; - } - } - else - { - /* - status bits: - 0 = mcu is ready to send data (read from c000) - 1 = mcu has read data (from c000) - 2 = unused - 3 = unused - 4-7 = coin code - 0 = nothing - 1,2,3 = coin switch pressed - e = tilt - */ - if (m_mcu_reportcoin & 0x08) return 0xe1; /* tilt */ - if (m_mcu_reportcoin & 0x01) return 0x11; /* coin 1 (will trigger "coin inserted" sound) */ - if (m_mcu_reportcoin & 0x02) return 0x21; /* coin 2 (will trigger "coin inserted" sound) */ - if (m_mcu_reportcoin & 0x04) return 0x31; /* coin 3 (will trigger "coin inserted" sound) */ - return 0x01; - } -} - -WRITE8_MEMBER(tnzs_state::mcu_arknoid2_w) -{ - if (offset == 0) - { -// logerror("PC %04x: write %02x to mcu %04x\n", space.device().safe_pc(), data, 0xc000 + offset); - if (m_mcu_command == 0x41) - { - m_mcu_credits = (m_mcu_credits + data) & 0xff; - } - } - else - { - /* - 0xc1: read number of credits, then buttons - 0x54+0x41: add value to number of credits - 0x15: sub 1 credit (when "Continue Play" only) - 0x84: coin 1 lockout (issued only in test mode) - 0x88: coin 2 lockout (issued only in test mode) - 0x80: release coin lockout (issued only in test mode) - during initialization, a sequence of 4 bytes sets coin/credit settings - */ -// logerror("PC %04x: write %02x to mcu %04x\n", space.device().safe_pc(), data, 0xc000 + offset); - - if (m_mcu_initializing) - { - /* set up coin/credit settings */ - m_mcu_coinage[m_mcu_coinage_init++] = data; - if (m_mcu_coinage_init == 4) - m_mcu_coinage_init = 0; /* must not happen */ - } - - if (data == 0xc1) - m_mcu_readcredits = 0; /* reset input port number */ - - if (data == 0x15) - { - m_mcu_credits = (m_mcu_credits - 1) & 0xff; - if (m_mcu_credits == 0xff) - m_mcu_credits = 0; - } - m_mcu_command = data; - } -} - - -READ8_MEMBER(tnzs_state::mcu_extrmatn_r) -{ - static const char mcu_startup[] = "\x5a\xa5\x55"; - -// logerror("PC %04x: read mcu %04x\n", space.device().safe_pc(), 0xc000 + offset); - - if (offset == 0) - { - /* if the mcu has just been reset, return startup code */ - if (m_mcu_initializing) - { - m_mcu_initializing--; - return mcu_startup[2 - m_mcu_initializing]; - } - - switch (m_mcu_command) - { - case 0x01: - return m_in0->read() ^ 0xff; /* player 1 joystick + buttons */ - - case 0x02: - return m_in1->read() ^ 0xff; /* player 2 joystick + buttons */ - - case 0x1a: - return (m_coin1->read() | (m_coin2->read() << 1)); - - case 0x21: - return m_in2->read() & 0x0f; - - case 0x41: - return m_mcu_credits; - - case 0xa0: - /* Read the credit counter */ - if (m_mcu_reportcoin & 0x08) - { - m_mcu_initializing = 3; - return 0xee; /* tilt */ - } - else return m_mcu_credits; - - case 0xa1: - /* Read the credit counter or the inputs */ - if (m_mcu_readcredits == 0) - { - m_mcu_readcredits = 1; - if (m_mcu_reportcoin & 0x08) - { - m_mcu_initializing = 3; - return 0xee; /* tilt */ -// return 0x64; /* theres a reset input somewhere */ - } - else return m_mcu_credits; - } - /* buttons */ - else return ((m_in0->read() & 0xf0) | (m_in1->read() >> 4)) ^ 0xff; - - default: - logerror("error, unknown mcu command\n"); - /* should not happen */ - return 0xff; - } - } - else - { - /* - status bits: - 0 = mcu is ready to send data (read from c000) - 1 = mcu has read data (from c000) - 2 = unused - 3 = unused - 4-7 = coin code - 0 = nothing - 1,2,3 = coin switch pressed - e = tilt - */ - if (m_mcu_reportcoin & 0x08) return 0xe1; /* tilt */ - if (m_mcu_reportcoin & 0x01) return 0x11; /* coin 1 (will trigger "coin inserted" sound) */ - if (m_mcu_reportcoin & 0x02) return 0x21; /* coin 2 (will trigger "coin inserted" sound) */ - if (m_mcu_reportcoin & 0x04) return 0x31; /* coin 3 (will trigger "coin inserted" sound) */ - return 0x01; - } -} - -WRITE8_MEMBER(tnzs_state::mcu_extrmatn_w) -{ - if (offset == 0) - { -// logerror("PC %04x: write %02x to mcu %04x\n", space.device().safe_pc(), data, 0xc000 + offset); - if (m_mcu_command == 0x41) - { - m_mcu_credits = (m_mcu_credits + data) & 0xff; - } - } - else - { - /* - 0xa0: read number of credits - 0xa1: read number of credits, then buttons - 0x01: read player 1 joystick + buttons - 0x02: read player 2 joystick + buttons - 0x1a: read coin switches - 0x21: read service & tilt switches - 0x4a+0x41: add value to number of credits - 0x84: coin 1 lockout (issued only in test mode) - 0x88: coin 2 lockout (issued only in test mode) - 0x80: release coin lockout (issued only in test mode) - during initialization, a sequence of 4 bytes sets coin/credit settings - */ - -// logerror("PC %04x: write %02x to mcu %04x\n", space.device().safe_pc(), data, 0xc000 + offset); - - if (m_mcu_initializing) - { - /* set up coin/credit settings */ - m_mcu_coinage[m_mcu_coinage_init++] = data; - if (m_mcu_coinage_init == 4) - m_mcu_coinage_init = 0; /* must not happen */ - } - - if (data == 0xa1) - m_mcu_readcredits = 0; /* reset input port number */ - - /* Dr Toppel decrements credits differently. So handle it */ - if ((data == 0x09) && (m_mcu_type == MCU_DRTOPPEL || m_mcu_type == MCU_PLUMPOP)) - m_mcu_credits = (m_mcu_credits - 1) & 0xff; /* Player 1 start */ - if ((data == 0x18) && (m_mcu_type == MCU_DRTOPPEL || m_mcu_type == MCU_PLUMPOP)) - m_mcu_credits = (m_mcu_credits - 2) & 0xff; /* Player 2 start */ - - m_mcu_command = data; - } -} - - - /********************************* TNZS sync bug kludge @@ -482,37 +227,41 @@ WRITE8_MEMBER(tnzs_state::tnzs_sync_kludge_w) DRIVER_INIT_MEMBER(tnzs_state,plumpop) { - m_mcu_type = MCU_PLUMPOP; + m_mcu_type = MCU_MCHIP_LLE; + m_lockout_level = false; } DRIVER_INIT_MEMBER(tnzs_state,extrmatn) { - m_mcu_type = MCU_EXTRMATN; + m_mcu_type = MCU_MCHIP_LLE; + m_lockout_level = false; } DRIVER_INIT_MEMBER(tnzs_state,arknoid2) { - m_mcu_type = MCU_ARKANOID; + m_mcu_type = MCU_ARKANOID_SIM; } DRIVER_INIT_MEMBER(tnzs_state,drtoppel) { - m_mcu_type = MCU_DRTOPPEL; - /* drtoppel writes to the palette RAM area even if it has PROMs! We have to patch it out. */ m_maincpu->space(AS_PROGRAM).nop_write(0xf800, 0xfbff); + m_lockout_level = false; + m_mcu_type = MCU_MCHIP_LLE; } DRIVER_INIT_MEMBER(tnzs_state,chukatai) { - m_mcu_type = MCU_CHUKATAI; + m_lockout_level = true; + m_mcu_type = MCU_MCHIP_LLE; } DRIVER_INIT_MEMBER(tnzs_state,tnzs) { - m_mcu_type = MCU_TNZS; /* we need to install a kludge to avoid problems with a bug in the original code */ // m_maincpu->space(AS_PROGRAM).install_write_handler(0xef10, 0xef10, write8_delegate(FUNC(tnzs_state::tnzs_sync_kludge_w), this)); + m_lockout_level = true; + m_mcu_type = MCU_MCHIP_LLE; } DRIVER_INIT_MEMBER(tnzs_state,tnzsb) @@ -547,65 +296,118 @@ DRIVER_INIT_MEMBER(tnzs_state,kageki) } -READ8_MEMBER(tnzs_state::tnzs_mcu_r) +READ8_MEMBER(tnzs_state::arknoid2_mcu_r) { - switch (m_mcu_type) + static const char mcu_startup[] = "\x55\xaa\x5a"; + + //logerror("PC %04x: read mcu %04x\n", space.device().safe_pc(), 0xc000 + offset); + + if (offset == 0) { - case MCU_TNZS: - case MCU_CHUKATAI: - return mcu_tnzs_r(space, offset); - case MCU_ARKANOID: - return mcu_arknoid2_r(space, offset); - case MCU_EXTRMATN: - case MCU_DRTOPPEL: - case MCU_PLUMPOP: - return mcu_extrmatn_r(space, offset); - default: - return 0xff; + /* if the mcu has just been reset, return startup code */ + if (m_mcu_initializing) + { + m_mcu_initializing--; + return mcu_startup[2 - m_mcu_initializing]; + } + + switch (m_mcu_command) + { + case 0x41: + return m_mcu_credits; + + case 0xc1: + /* Read the credit counter or the inputs */ + if (m_mcu_readcredits == 0) + { + m_mcu_readcredits = 1; + if (m_mcu_reportcoin & 0x08) + { + m_mcu_initializing = 3; + return 0xee; /* tilt */ + } + else return m_mcu_credits; + } + else return m_in0->read(); /* buttons */ + + default: + logerror("error, unknown mcu command\n"); + /* should not happen */ + return 0xff; + } + } + else + { + /* + status bits: + 0 = mcu is ready to send data (read from c000) + 1 = mcu has read data (from c000) + 2 = unused + 3 = unused + 4-7 = coin code + 0 = nothing + 1,2,3 = coin switch pressed + e = tilt + */ + if (m_mcu_reportcoin & 0x08) return 0xe1; /* tilt */ + if (m_mcu_reportcoin & 0x01) return 0x11; /* coin 1 (will trigger "coin inserted" sound) */ + if (m_mcu_reportcoin & 0x02) return 0x21; /* coin 2 (will trigger "coin inserted" sound) */ + if (m_mcu_reportcoin & 0x04) return 0x31; /* coin 3 (will trigger "coin inserted" sound) */ + return 0x01; } } -WRITE8_MEMBER(tnzs_state::tnzs_mcu_w) +WRITE8_MEMBER(tnzs_state::arknoid2_mcu_w) { - switch (m_mcu_type) + if (offset == 0) { - case MCU_TNZS: - case MCU_CHUKATAI: - mcu_tnzs_w(space, offset, data); - break; - case MCU_ARKANOID: - mcu_arknoid2_w(space, offset, data); - break; - case MCU_EXTRMATN: - case MCU_DRTOPPEL: - case MCU_PLUMPOP: - mcu_extrmatn_w(space, offset, data); - break; - default: - break; + //logerror("PC %04x: write %02x to mcu %04x\n", space.device().safe_pc(), data, 0xc000 + offset); + if (m_mcu_command == 0x41) + { + m_mcu_credits = (m_mcu_credits + data) & 0xff; + } + } + else + { + /* + 0xc1: read number of credits, then buttons + 0x54+0x41: add value to number of credits + 0x15: sub 1 credit (when "Continue Play" only) + 0x84: coin 1 lockout (issued only in test mode) + 0x88: coin 2 lockout (issued only in test mode) + 0x80: release coin lockout (issued only in test mode) + during initialization, a sequence of 4 bytes sets coin/credit settings + */ + //logerror("PC %04x: write %02x to mcu %04x\n", space.device().safe_pc(), data, 0xc000 + offset); + + if (m_mcu_initializing) + { + /* set up coin/credit settings */ + m_mcu_coinage[m_mcu_coinage_init++] = data; + if (m_mcu_coinage_init == 4) + m_mcu_coinage_init = 0; /* must not happen */ + } + + if (data == 0xc1) + m_mcu_readcredits = 0; /* reset input port number */ + + if (data == 0x15) + { + m_mcu_credits = (m_mcu_credits - 1) & 0xff; + if (m_mcu_credits == 0xff) + m_mcu_credits = 0; + } + m_mcu_command = data; } } INTERRUPT_GEN_MEMBER(tnzs_state::arknoid2_interrupt) { - int coin; - - switch (m_mcu_type) - { - case MCU_ARKANOID: - case MCU_EXTRMATN: - case MCU_DRTOPPEL: - case MCU_PLUMPOP: - coin = 0; - coin |= ((m_coin1->read() & 1) << 0); - coin |= ((m_coin2->read() & 1) << 1); - coin |= ((m_in2->read() & 3) << 2); - coin ^= 0x0c; - mcu_handle_coins(coin); - break; - default: - break; - } + int coin = ((m_coin1->read() & 1) << 0); + coin |= ((m_coin2->read() & 1) << 1); + coin |= ((m_in2->read() & 3) << 2); + coin ^= 0x0c; + mcu_handle_coins(coin); device.execute().set_input_line(0, HOLD_LINE); } @@ -613,22 +415,12 @@ INTERRUPT_GEN_MEMBER(tnzs_state::arknoid2_interrupt) MACHINE_RESET_MEMBER(tnzs_state,tnzs) { /* initialize the mcu simulation */ - switch (m_mcu_type) - { - case MCU_ARKANOID: - case MCU_EXTRMATN: - case MCU_DRTOPPEL: - case MCU_PLUMPOP: - mcu_reset(); - break; - default: - break; - } + if (m_mcu_type == MCU_ARKANOID_SIM) + arknoid2_mcu_reset(); m_kageki_csport_sel = 0; - m_input_select = 0; - m_mcu_readcredits = 0; // this might belong to mcu_reset - m_insertcoin = 0; // this might belong to mcu_reset + m_mcu_readcredits = 0; // this might belong to arknoid2_mcu_reset + m_insertcoin = 0; // this might belong to arknoid2_mcu_reset } MACHINE_RESET_MEMBER(tnzs_state,jpopnics) @@ -655,7 +447,6 @@ MACHINE_START_MEMBER(tnzs_state,tnzs) MACHINE_START_CALL_MEMBER( tnzs_common ); save_item(NAME(m_kageki_csport_sel)); - save_item(NAME(m_input_select)); save_item(NAME(m_mcu_readcredits)); save_item(NAME(m_insertcoin)); save_item(NAME(m_mcu_initializing)); @@ -684,22 +475,26 @@ WRITE8_MEMBER(tnzs_state::tnzs_ramrom_bankswitch_w) m_mainbank->set_bank(data & 0x07); } +WRITE8_MEMBER(tnzs_state::arknoid2_mcu_reset_w) +{ + if (data & 0x04) + arknoid2_mcu_reset(); + + /* bits 0-1 select ROM bank */ + m_bank2 = data & 0x03; + m_subbank->set_entry(m_bank2); +} + WRITE8_MEMBER(tnzs_state::tnzs_bankswitch1_w) { // logerror("PC %04x: writing %02x to bankswitch 1\n", space.device().safe_pc(),data); switch (m_mcu_type) { - case MCU_TNZS: - case MCU_CHUKATAI: - /* bit 2 resets the mcu */ - if (data & 0x04) - { - if (m_mcu != nullptr && m_mcu->type() == I8742) - m_mcu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); - } - /* Coin count and lockout is handled by the i8742 */ - break; + case MCU_MCHIP_LLE: + if ((data & 0x04) != 0 && m_mcu != nullptr) + m_mcu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); + break; case MCU_NONE_INSECTX: machine().bookkeeping().coin_lockout_w(0, (~data & 0x04)); machine().bookkeeping().coin_lockout_w(1, (~data & 0x08)); @@ -718,14 +513,6 @@ WRITE8_MEMBER(tnzs_state::tnzs_bankswitch1_w) machine().bookkeeping().coin_counter_w(0, (data & 0x04)); machine().bookkeeping().coin_counter_w(1, (data & 0x08)); break; - case MCU_ARKANOID: - case MCU_EXTRMATN: - case MCU_DRTOPPEL: - case MCU_PLUMPOP: - /* bit 2 resets the mcu */ - if (data & 0x04) - mcu_reset(); - break; default: break; } |