summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2016-12-21 16:12:14 -0500
committer Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2016-12-21 16:12:14 -0500
commit5dd72e942258f185a5fa54d710fa428f43ec7fa9 (patch)
treed64b06fa743390afa8ec77a1710fdb2f922d182a
parentf3a80d7d53359306e6273b8d90e222cb16cccbc0 (diff)
Decapped, deprotected, dumped and hooked up the hd647180X mcus for vimana, fire shark and teki paki [Caps0ff]
New clone added ---------------- 'NEW VER!' hack of Fire Shark (samesamenh) [Caps0ff, trap15]
-rw-r--r--src/mame/drivers/toaplan1.cpp341
-rw-r--r--src/mame/drivers/toaplan2.cpp79
-rw-r--r--src/mame/includes/toaplan1.h20
-rw-r--r--src/mame/includes/toaplan2.h8
-rw-r--r--src/mame/machine/toaplan1.cpp139
-rw-r--r--src/mame/mame.lst1
6 files changed, 298 insertions, 290 deletions
diff --git a/src/mame/drivers/toaplan1.cpp b/src/mame/drivers/toaplan1.cpp
index 9a916bfee97..ee2a50234e1 100644
--- a/src/mame/drivers/toaplan1.cpp
+++ b/src/mame/drivers/toaplan1.cpp
@@ -603,14 +603,6 @@ Stephh's and AWJ's notes (based on the games M68000 and Z80 code and some tests)
- Sound routines at 0x01792c and 0x0179ba.
-To Do:
- Add support for HD647180 (Z180) sound CPUs (once their internal ROMS are dumped).
- These are:
- Fire Shark / Same! Same! Same!
- Vimana
- In the meantime, it can be interesting to simulate the basic communications (coinage and credits)
- between the M68000 and the Z180. [stephh]
-
***************************************************************************/
#include "emu.h"
@@ -756,7 +748,7 @@ static ADDRESS_MAP_START( samesame_main_map, AS_PROGRAM, 16, toaplan1_state )
AM_RANGE(0x140008, 0x140009) AM_READ_PORT("SYSTEM")
AM_RANGE(0x14000a, 0x14000b) AM_READ(samesame_port_6_word_r) /* Territory, and MCU ready */
AM_RANGE(0x14000c, 0x14000d) AM_WRITE(samesame_coin_w) /* Coin counter/lockout */
-// AM_RANGE(0x14000e, 0x14000f) AM_WRITE(samesame_mcu_w) /* Commands sent to HD647180 */
+ AM_RANGE(0x14000e, 0x14000f) AM_WRITE(samesame_mcu_w) /* Commands sent to HD647180 */
AM_RANGE(0x180000, 0x180001) AM_WRITE(toaplan1_bcu_flipscreen_w)
AM_RANGE(0x180002, 0x180003) AM_READWRITE(toaplan1_tileram_offs_r, toaplan1_tileram_offs_w)
AM_RANGE(0x180004, 0x180007) AM_READWRITE(toaplan1_tileram16_r, toaplan1_tileram16_w)
@@ -827,13 +819,7 @@ static ADDRESS_MAP_START( vimana_main_map, AS_PROGRAM, 16, toaplan1_state )
AM_RANGE(0x400008, 0x40000f) AM_WRITE(toaplan1_bcu_control_w)
AM_RANGE(0x404000, 0x4047ff) AM_RAM_WRITE(toaplan1_bgpalette_w) AM_SHARE("bgpalette")
AM_RANGE(0x406000, 0x4067ff) AM_RAM_WRITE(toaplan1_fgpalette_w) AM_SHARE("fgpalette")
- AM_RANGE(0x440000, 0x440005) AM_READWRITE(vimana_mcu_r, vimana_mcu_w) /* shared memory from 0x440000 to 0x44ffff ? */
- AM_RANGE(0x440006, 0x440007) AM_READ_PORT("DSWA")
- AM_RANGE(0x440008, 0x440009) AM_READ(vimana_system_port_r) /* "SYSTEM" + coinage simulation */
- AM_RANGE(0x44000a, 0x44000b) AM_READ_PORT("P1")
- AM_RANGE(0x44000c, 0x44000d) AM_READ_PORT("P2")
- AM_RANGE(0x44000e, 0x44000f) AM_READ_PORT("DSWB")
- AM_RANGE(0x440010, 0x440011) AM_READ_PORT("TJUMP")
+ AM_RANGE(0x440000, 0x4407ff) AM_READWRITE(toaplan1_shared_r, toaplan1_shared_w) /* inputs, coins and sound handled by 647180 MCU via this space */
AM_RANGE(0x480000, 0x487fff) AM_RAM
AM_RANGE(0x4c0000, 0x4c0001) AM_WRITE(toaplan1_bcu_flipscreen_w)
AM_RANGE(0x4c0002, 0x4c0003) AM_READWRITE(toaplan1_tileram_offs_r, toaplan1_tileram_offs_w)
@@ -940,10 +926,80 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( hd647180_mem_map, AS_PROGRAM, 8, toaplan1_state )
AM_RANGE(0x00000, 0x03fff) AM_ROM /* Internal 16k byte ROM */
+ AM_RANGE(0x08000, 0x087ff) AM_RAM AM_SHARE("sharedram") /* 2048 bytes of shared ram w/maincpu */
+ AM_RANGE(0x0fe00, 0x0ffff) AM_RAM /* Internal 512 byte RAM */
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( hd647180_io_map, AS_IO, 8, toaplan1_state )
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+ // lots of low level 647180 peripherals are not emulated yet, ddr regs, timer regs etc, see comments below
+ // also see http://bitsavers.trailing-edge.com/pdf/hitachi/_dataBooks/U94_HD647180X_8-Bit_Microcontroller_Hardware_Manual_Jan88.pdf particularly page 38 (pdf page 56)
+ AM_RANGE(0x32, 0x32) AM_WRITENOP // DMA WAIT/Control register
+ AM_RANGE(0x33, 0x33) AM_WRITENOP // IL (int vector low) register
+ AM_RANGE(0x36, 0x36) AM_WRITENOP // refresh control register for RFSH pin
+ // 53: disable reg for port A
+ AM_RANGE(0x60, 0x60) AM_READ_PORT("DSWB") // read/write port A
+ // 61: read/write port B
+ // 62: read/write port C
+ // 63: read/write port D
+ // 64: read/write port E
+ // 65: read/write port F
+ AM_RANGE(0x66, 0x66) AM_READ_PORT("TJUMP") // read/write port G, bits 7 and 6 ALWAYS read as 1 due to port G being just 6 bits
+ // 70: ddr for port A
+ AM_RANGE(0x71, 0x71) AM_WRITENOP // ddr for port B
+ AM_RANGE(0x72, 0x72) AM_WRITENOP // ddr for port C
+ AM_RANGE(0x73, 0x73) AM_WRITENOP // ddr for port D
+ AM_RANGE(0x74, 0x74) AM_WRITENOP // ddr for port E
+ AM_RANGE(0x75, 0x75) AM_WRITENOP // ddr for port F
+ AM_RANGE(0x80, 0x80) AM_READ_PORT("P1")
+ AM_RANGE(0x81, 0x81) AM_READ_PORT("P2")
+ AM_RANGE(0x82, 0x82) AM_READ_PORT("DSWA")
+ AM_RANGE(0x83, 0x83) AM_READ_PORT("SYSTEM")
+ AM_RANGE(0x84, 0x84) AM_WRITE(toaplan1_coin_w) // Coin counter/lockout // needs verify
+ AM_RANGE(0x87, 0x87) AM_DEVREADWRITE("ymsnd", ym3812_device, status_port_r, control_port_w)
+ AM_RANGE(0x8f, 0x8f) AM_DEVREADWRITE("ymsnd", ym3812_device, read_port_r, write_port_w)
+ADDRESS_MAP_END
+
+
+
+WRITE16_MEMBER(toaplan1_state::samesame_mcu_w)
+{
+ m_to_mcu = data;
+ m_cmdavailable = 1;
+};
+
+READ8_MEMBER(toaplan1_state::samesame_soundlatch_r)
+{
+ return m_to_mcu;
+};
+
+WRITE8_MEMBER(toaplan1_state::samesame_sound_done_w)
+{
+ m_to_mcu = data;
+ m_cmdavailable = 0;
+}
+
+READ8_MEMBER(toaplan1_state::samesame_cmdavailable_r)
+{
+ if (m_cmdavailable) return 0xff;
+ else return 0x00;
+};
+
+static ADDRESS_MAP_START( samesame_hd647180_mem_map, AS_PROGRAM, 8, toaplan1_state )
+ AM_RANGE(0x00000, 0x03fff) AM_ROM /* Internal 16k byte ROM */
AM_RANGE(0x0fe00, 0x0ffff) AM_RAM /* Internal 512 byte RAM */
ADDRESS_MAP_END
+static ADDRESS_MAP_START( samesame_hd647180_io_map, AS_IO, 8, toaplan1_state )
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+
+ AM_RANGE(0x63, 0x63) AM_READ( samesame_cmdavailable_r )
+ AM_RANGE(0xa0, 0xa0) AM_READ( samesame_soundlatch_r )
+ AM_RANGE(0xb0, 0xb0) AM_WRITE( samesame_sound_done_w )
+ AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("ymsnd", ym3812_device, status_port_r, control_port_w)
+ AM_RANGE(0x81, 0x81) AM_DEVREADWRITE("ymsnd", ym3812_device, read_port_r, write_port_w)
+ADDRESS_MAP_END
/*****************************************************************************
Generic Input Port definitions
@@ -1645,14 +1701,14 @@ static INPUT_PORTS_START( outzonec )
INPUT_PORTS_END
-/* verified from M68000 - coinage based on "test mode" and handled by the MCU simulation */
+/* verified from M68000 */
static INPUT_PORTS_START( vimana )
PORT_INCLUDE( toaplan1_2b )
/* 0x440007.b */
PORT_START("DSWA")
TOAPLAN_MACHINE_NO_COCKTAIL
- TOAPLAN_COINAGE_DUAL(TJUMP, 0x0f, 0x02) /* see notes */
+ TOAPLAN_COINAGE_DUAL(TJUMP, 0x0f, 0x0d) /* see notes */
/* 0x44000f.b */
PORT_START("DSWB")
@@ -1667,32 +1723,32 @@ static INPUT_PORTS_START( vimana )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x20, "4" )
PORT_DIPSETTING( 0x10, "5" )
- PORT_DIPNAME( 0x40, 0x00, "Invulnerability" ) /* see notes */
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x40, DEF_STR( On ) )
+ PORT_DIPNAME( 0x40, 0x40, "Invulnerability" ) /* see notes */
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
PORT_DIPSETTING( 0x80, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
/* 0x440011.b */
PORT_START("TJUMP") /* Territory Jumper Block - see notes */
- PORT_DIPNAME( 0x0f, 0x02, DEF_STR( Region ) )
- PORT_DIPSETTING( 0x02, DEF_STR( Europe ) )
- PORT_DIPSETTING( 0x01, DEF_STR( USA ) )
- PORT_DIPSETTING( 0x07, "USA (Romstar license)" )
-// PORT_DIPSETTING( 0x00, "Japan (distributed by Tecmo)" )
-// PORT_DIPSETTING( 0x0f, "Japan (distributed by Tecmo)" )
- PORT_DIPSETTING( 0x04, DEF_STR( Korea ) )
- PORT_DIPSETTING( 0x03, DEF_STR( Hong_Kong ) )
- PORT_DIPSETTING( 0x08, "Hong Kong (Honest Trading license)" )
- PORT_DIPSETTING( 0x05, DEF_STR( Taiwan ) )
- PORT_DIPSETTING( 0x06, "Taiwan (Spacy license)" )
-// PORT_DIPSETTING( 0x09, "???" )
-// PORT_DIPSETTING( 0x0a, "???" )
-// PORT_DIPSETTING( 0x0b, "???" )
-// PORT_DIPSETTING( 0x0c, "???" )
-// PORT_DIPSETTING( 0x0d, "???" )
-// PORT_DIPSETTING( 0x0e, "???" )
+ PORT_DIPNAME( 0x0f, 0x0d, DEF_STR( Region ) )
+// PORT_DIPSETTING( 0x00, "Japan (distributed by Tecmo)" )
+// PORT_DIPSETTING( 0x01, "01" )
+// PORT_DIPSETTING( 0x02, "02" )
+// PORT_DIPSETTING( 0x03, "03" )
+// PORT_DIPSETTING( 0x04, "04" )
+// PORT_DIPSETTING( 0x05, "05" )
+// PORT_DIPSETTING( 0x06, "06" )
+ PORT_DIPSETTING( 0x07, "Hong Kong (Honest Trading license)" )
+ PORT_DIPSETTING( 0x08, "USA (Romstar license)" )
+ PORT_DIPSETTING( 0x09, "Taiwan (Spacy license)" )
+ PORT_DIPSETTING( 0x0a, DEF_STR( Taiwan ) )
+ PORT_DIPSETTING( 0x0b, DEF_STR( Korea ) )
+ PORT_DIPSETTING( 0x0c, DEF_STR( Hong_Kong ) )
+ PORT_DIPSETTING( 0x0d, DEF_STR( Europe ) )
+ PORT_DIPSETTING( 0x0e, DEF_STR( USA ) )
+ PORT_DIPSETTING( 0x0f, "Japan (distributed by Tecmo)" )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
/* P1 : 0x44000b.b */
@@ -1704,7 +1760,7 @@ static INPUT_PORTS_START( vimana )
/* VBLANK : 0x400001.b */
INPUT_PORTS_END
-/* verified from M68000 - coinage based on "test mode" and handled by the MCU simulation */
+/* verified from M68000 */
static INPUT_PORTS_START( vimanan )
PORT_INCLUDE( vimana )
@@ -1713,23 +1769,24 @@ static INPUT_PORTS_START( vimanan )
/* 0x440011.b */
PORT_MODIFY("TJUMP") /* Territory Jumper Block - see notes */
- PORT_DIPNAME( 0x0f, 0x02, DEF_STR( Region ) )
- PORT_DIPSETTING( 0x02, "Europe (Nova Apparate license)" )
- PORT_DIPSETTING( 0x01, DEF_STR( USA ) )
- PORT_DIPSETTING( 0x07, "USA (Romstar license)" )
-// PORT_DIPSETTING( 0x00, "Japan (distributed by Tecmo)" ) /* "ending" text in English */
-// PORT_DIPSETTING( 0x0f, "Japan (distributed by Tecmo)" ) /* "ending" text in English */
- PORT_DIPSETTING( 0x04, DEF_STR( Korea ) )
- PORT_DIPSETTING( 0x03, DEF_STR( Hong_Kong ) )
- PORT_DIPSETTING( 0x08, "Hong Kong (Honest Trading license)" )
- PORT_DIPSETTING( 0x05, DEF_STR( Taiwan ) )
- PORT_DIPSETTING( 0x06, "Taiwan (Spacy license)" )
-// PORT_DIPSETTING( 0x09, "???" )
-// PORT_DIPSETTING( 0x0a, "???" )
-// PORT_DIPSETTING( 0x0b, "???" )
-// PORT_DIPSETTING( 0x0c, "???" )
-// PORT_DIPSETTING( 0x0d, "???" )
-// PORT_DIPSETTING( 0x0e, "???" )
+ PORT_DIPNAME( 0x0f, 0x0d, DEF_STR( Region ) )
+ // PORT_DIPSETTING( 0x00, "Japan (distributed by Tecmo)" ) /* "ending" text in English */
+// PORT_DIPSETTING( 0x01, "01" )
+// PORT_DIPSETTING( 0x02, "02" )
+// PORT_DIPSETTING( 0x03, "03" )
+// PORT_DIPSETTING( 0x04, "04" )
+// PORT_DIPSETTING( 0x05, "05" )
+// PORT_DIPSETTING( 0x06, "06" )
+ PORT_DIPSETTING( 0x07, "Hong Kong (Honest Trading license)" )
+ PORT_DIPSETTING( 0x08, "USA (Romstar license)" )
+ PORT_DIPSETTING( 0x09, "Taiwan (Spacy license)" )
+ PORT_DIPSETTING( 0x0a, DEF_STR( Taiwan ) )
+ PORT_DIPSETTING( 0x0b, DEF_STR( Korea ) )
+ PORT_DIPSETTING( 0x0c, DEF_STR( Hong_Kong ) )
+ PORT_DIPSETTING( 0x0d, "Europe (Nova Apparate license)" )
+ PORT_DIPSETTING( 0x0e, DEF_STR( USA ) )
+// PORT_DIPSETTING( 0x0f, "Japan (distributed by Tecmo)" ) /* "ending" text in English */
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
/* P1 : 0x44000b.b */
/* P2 : 0x44000d.b */
@@ -1737,7 +1794,7 @@ static INPUT_PORTS_START( vimanan )
/* VBLANK : 0x400001.b */
INPUT_PORTS_END
-/* verified from M68000 - coinage based on "test mode" and handled by the MCU simulation */
+/* verified from M68000 */
static INPUT_PORTS_START( vimanaj )
PORT_INCLUDE( vimana )
@@ -1746,23 +1803,23 @@ static INPUT_PORTS_START( vimanaj )
/* 0x440011.b */
PORT_MODIFY("TJUMP") /* Territory Jumper Block - see notes */
- PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Region ) )
-// PORT_DIPSETTING( 0x02, DEF_STR( Europe ) )
-// PORT_DIPSETTING( 0x01, DEF_STR( USA ) )
-// PORT_DIPSETTING( 0x07, "USA (Romstar license)" )
- PORT_DIPSETTING( 0x00, "Japan (distributed by Tecmo)" )
-// PORT_DIPSETTING( 0x0f, "Japan (distributed by Tecmo)" )
-// PORT_DIPSETTING( 0x04, "Korea" )
-// PORT_DIPSETTING( 0x03, "Hong Kong" )
-// PORT_DIPSETTING( 0x08, "Hong Kong (Honest Trading license)" )
-// PORT_DIPSETTING( 0x05, "Taiwan" )
-// PORT_DIPSETTING( 0x06, "Taiwan (Spacy license)" )
-// PORT_DIPSETTING( 0x09, "???" )
-// PORT_DIPSETTING( 0x0a, "???" )
-// PORT_DIPSETTING( 0x0b, "???" )
-// PORT_DIPSETTING( 0x0c, "???" )
-// PORT_DIPSETTING( 0x0d, "???" )
-// PORT_DIPSETTING( 0x0e, "???" )
+ PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Region ) )
+// PORT_DIPSETTING( 0x00, "Japan (distributed by Tecmo)" )
+// PORT_DIPSETTING( 0x01, "01" )
+// PORT_DIPSETTING( 0x02, "02" )
+// PORT_DIPSETTING( 0x03, "03" )
+// PORT_DIPSETTING( 0x04, "04" )
+// PORT_DIPSETTING( 0x05, "05" )
+// PORT_DIPSETTING( 0x06, "06" )
+// PORT_DIPSETTING( 0x07, "Hong Kong (Honest Trading license)" )
+// PORT_DIPSETTING( 0x08, "USA (Romstar license)" )
+// PORT_DIPSETTING( 0x09, "Taiwan (Spacy license)" )
+// PORT_DIPSETTING( 0x0a, DEF_STR( Taiwan ) )
+// PORT_DIPSETTING( 0x0b, DEF_STR( Korea ) )
+// PORT_DIPSETTING( 0x0c, DEF_STR( Hong_Kong ) )
+// PORT_DIPSETTING( 0x0d, DEF_STR( Europe ) )
+// PORT_DIPSETTING( 0x0e, DEF_STR( USA ) )
+ PORT_DIPSETTING( 0x0f, "Japan (distributed by Tecmo)" )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
/* P1 : 0x44000b.b */
@@ -2015,8 +2072,10 @@ static MACHINE_CONFIG_START( samesame, toaplan1_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", toaplan1_state, toaplan1_interrupt)
MCFG_CPU_ADD("audiocpu", Z180, XTAL_28MHz/8) /* HD647180XOFS6 CPU */
- MCFG_CPU_PROGRAM_MAP(hd647180_mem_map)
- MCFG_DEVICE_DISABLE() /* Internal code is not dumped */
+ MCFG_CPU_PROGRAM_MAP(samesame_hd647180_mem_map)
+ MCFG_CPU_IO_MAP(samesame_hd647180_io_map)
+
+ MCFG_QUANTUM_PERFECT_CPU("maincpu")
MCFG_MACHINE_RESET_OVERRIDE(toaplan1_state,zerowing)
@@ -2128,7 +2187,9 @@ static MACHINE_CONFIG_START( vimana, toaplan1_state )
MCFG_CPU_ADD("audiocpu", Z180, XTAL_28MHz/8) /* HD647180XOFS6 CPU */
MCFG_CPU_PROGRAM_MAP(hd647180_mem_map)
- MCFG_DEVICE_DISABLE() /* Internal code is not dumped */
+ MCFG_CPU_IO_MAP(hd647180_io_map)
+
+ MCFG_QUANTUM_TIME(attotime::from_hz(600)) // GUESSED
MCFG_MACHINE_RESET_OVERRIDE(toaplan1_state,vimana)
@@ -2553,8 +2614,7 @@ ROM_START( samesame )
ROM_LOAD16_BYTE( "o17_12.7l", 0x040001, 0x20000, CRC(ef698811) SHA1(4c729704eba0bf469599c79009327e4fa5dc540b) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.017", 0x00000, 0x08000, NO_DUMP )
+ ROM_LOAD( "hd647180.017", 0x00000, 0x08000, CRC(43523032) SHA1(1b94003a00e7bf6bdf1b1b946f42ff5d04629949) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "o17_05.12j", 0x00000, 0x20000, CRC(565315f8) SHA1(6b1c5ef52359483228b329c89c2e1174e3fbf017) )
@@ -2581,8 +2641,34 @@ ROM_START( samesame2 )
ROM_LOAD16_BYTE( "o17_12ii.7l", 0x040001, 0x20000, CRC(6adb6eb5) SHA1(9b6e63aa50d271c2bb0b4cf822fc6f3684f10230) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.017", 0x00000, 0x08000, NO_DUMP )
+ ROM_LOAD( "hd647180.017", 0x00000, 0x08000, CRC(43523032) SHA1(1b94003a00e7bf6bdf1b1b946f42ff5d04629949) )
+
+ ROM_REGION( 0x80000, "gfx1", 0 )
+ ROM_LOAD16_BYTE( "o17_05.12j", 0x00000, 0x20000, CRC(565315f8) SHA1(6b1c5ef52359483228b329c89c2e1174e3fbf017) )
+ ROM_LOAD16_BYTE( "o17_06.13j", 0x00001, 0x20000, CRC(95262d4c) SHA1(16f3aabecb1c87ce7eadf4f0ff61b29a4c017614) )
+ ROM_LOAD16_BYTE( "o17_07.12l", 0x40000, 0x20000, CRC(4c4b735c) SHA1(812c3bf46bd7764b2bb812bd2b9eb0331ed257ae) )
+ ROM_LOAD16_BYTE( "o17_08.13l", 0x40001, 0x20000, CRC(95c6586c) SHA1(ff87901f79d80f73ad09664b0c0d892898570616) )
+
+ ROM_REGION( 0x80000, "gfx2", 0 )
+ ROM_LOAD16_BYTE( "o17_01.1d", 0x00000, 0x20000, CRC(ea12e491) SHA1(02190722b7c5383471e0af9596be7039a5367240) )
+ ROM_LOAD16_BYTE( "o17_02.3d", 0x00001, 0x20000, CRC(32a13a9f) SHA1(1446acdfd21cd41f3d97aaf30f498c0c5d890605) )
+ ROM_LOAD16_BYTE( "o17_03.5d", 0x40000, 0x20000, CRC(68723dc9) SHA1(4f1b7aa2469c955e03737b611a7d2524f1e4f61e) )
+ ROM_LOAD16_BYTE( "o17_04.7d", 0x40001, 0x20000, CRC(fe0ecb13) SHA1(634a49262b9c092c25f11b14c6757fe94ea9eddc) )
+
+ ROM_REGION( 0x40, "proms", 0 ) /* nibble bproms, lo/hi order to be determined */
+ ROM_LOAD( "prom14.25b", 0x00, 0x20, CRC(bc88cced) SHA1(5055362710c0f58823c05fb4c0e0eec638b91e3d) ) /* sprite attribute (flip/position) ?? */
+ ROM_LOAD( "prom15.20c", 0x20, 0x20, CRC(a1e17492) SHA1(9ddec4c97f2d541f69f3c32c47aaa21fd9699ae2) ) /* ??? */
+ROM_END
+
+ROM_START( samesamenh ) /* this hack has been used on various PCBs */
+ ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */
+ ROM_LOAD16_BYTE( "o17_09_nv.8j", 0x000000, 0x08000, CRC(f60af2f9) SHA1(ce41efd5ca4f4adc8bf1976f61a8a8d357fb234a) )
+ ROM_LOAD16_BYTE( "o17_10_nv.8l", 0x000001, 0x08000, CRC(023bcb95) SHA1(69a051fb223e6cacaf1cda8bf5430933d24fb8a7) )
+ ROM_LOAD16_BYTE( "o17_11.7j", 0x040000, 0x20000, CRC(be07d101) SHA1(1eda14ba24532b565d6ad57490b73ff312f98b53) )
+ ROM_LOAD16_BYTE( "o17_12.7l", 0x040001, 0x20000, CRC(ef698811) SHA1(4c729704eba0bf469599c79009327e4fa5dc540b) )
+
+ ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
+ ROM_LOAD( "hd647180.017", 0x00000, 0x08000, CRC(43523032) SHA1(1b94003a00e7bf6bdf1b1b946f42ff5d04629949) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "o17_05.12j", 0x00000, 0x20000, CRC(565315f8) SHA1(6b1c5ef52359483228b329c89c2e1174e3fbf017) )
@@ -2662,8 +2748,7 @@ ROM_START( fireshrk )
ROM_LOAD16_BYTE( "o17_12ii.7l", 0x040001, 0x20000, CRC(6adb6eb5) SHA1(9b6e63aa50d271c2bb0b4cf822fc6f3684f10230) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.017", 0x00000, 0x08000, NO_DUMP )
+ ROM_LOAD( "hd647180.017", 0x00000, 0x08000, CRC(43523032) SHA1(1b94003a00e7bf6bdf1b1b946f42ff5d04629949) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "o17_05.12j", 0x00000, 0x20000, CRC(565315f8) SHA1(6b1c5ef52359483228b329c89c2e1174e3fbf017) )
@@ -2690,8 +2775,7 @@ ROM_START( fireshrka )
ROM_LOAD16_BYTE( "o17_12ii.7l", 0x040001, 0x20000, CRC(6adb6eb5) SHA1(9b6e63aa50d271c2bb0b4cf822fc6f3684f10230) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.017", 0x00000, 0x08000, NO_DUMP )
+ ROM_LOAD( "hd647180.017", 0x00000, 0x08000, CRC(43523032) SHA1(1b94003a00e7bf6bdf1b1b946f42ff5d04629949) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "o17_05.12j", 0x00000, 0x20000, CRC(565315f8) SHA1(6b1c5ef52359483228b329c89c2e1174e3fbf017) )
@@ -2718,8 +2802,7 @@ ROM_START( fireshrkd )
ROM_LOAD16_BYTE( "o17_12ii.7l", 0x040001, 0x20000, CRC(6adb6eb5) SHA1(9b6e63aa50d271c2bb0b4cf822fc6f3684f10230) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.017", 0x00000, 0x08000, NO_DUMP )
+ ROM_LOAD( "hd647180.017", 0x00000, 0x08000, CRC(43523032) SHA1(1b94003a00e7bf6bdf1b1b946f42ff5d04629949) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "o17_05.12j", 0x00000, 0x20000, CRC(565315f8) SHA1(6b1c5ef52359483228b329c89c2e1174e3fbf017) )
@@ -2746,8 +2829,7 @@ ROM_START( fireshrkdh )
ROM_LOAD16_BYTE( "o17_12ii.7l", 0x040001, 0x20000, CRC(6adb6eb5) SHA1(9b6e63aa50d271c2bb0b4cf822fc6f3684f10230) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.017", 0x00000, 0x08000, NO_DUMP )
+ ROM_LOAD( "hd647180.017", 0x00000, 0x08000, CRC(43523032) SHA1(1b94003a00e7bf6bdf1b1b946f42ff5d04629949) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "o17_05.12j", 0x00000, 0x20000, CRC(565315f8) SHA1(6b1c5ef52359483228b329c89c2e1174e3fbf017) )
@@ -2929,8 +3011,8 @@ ROM_START( vimana ) /* From board serial number 1547.04 (July '94) */
ROM_LOAD16_BYTE( "tp019-8a.bin", 0x000001, 0x20000, CRC(03ba27e8) SHA1(edb5fe741d2a6a7fe5cde9a82317ea1e9447cf73) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.019", 0x00000, 0x08000, NO_DUMP )
+ /* sound CPU is a HD647180 (Z180) with internal ROM */
+ ROM_LOAD( "hd647180.019", 0x00000, 0x08000, CRC(41a97ebe) SHA1(9b377086e4d9b8de6e3c8c7d2dd099b80ab88934) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "vim6.bin", 0x00000, 0x20000, CRC(2886878d) SHA1(f44933d87bbcd3bd58f46e0f0f89b05c409b713b) )
@@ -2953,8 +3035,8 @@ ROM_START( vimanan )
ROM_LOAD16_BYTE( "tp019-08.rom", 0x000001, 0x20000, CRC(6cd2dc3c) SHA1(029d974eb938c5e2fbe7575f0dda342b4b12b731) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.019", 0x00000, 0x08000, NO_DUMP )
+ /* sound CPU is a HD647180 (Z180) with internal ROM */
+ ROM_LOAD( "hd647180.019", 0x00000, 0x08000, CRC(41a97ebe) SHA1(9b377086e4d9b8de6e3c8c7d2dd099b80ab88934) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "vim6.bin", 0x00000, 0x20000, CRC(2886878d) SHA1(f44933d87bbcd3bd58f46e0f0f89b05c409b713b) )
@@ -2977,8 +3059,8 @@ ROM_START( vimanaj )
ROM_LOAD16_BYTE( "vim08.bin", 0x000001, 0x20000, CRC(e45b7def) SHA1(6b92a91d64581954da8ecdbeb5fed79bcc9c5217) )
ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.019", 0x00000, 0x08000, NO_DUMP )
+ /* sound CPU is a HD647180 (Z180) with internal ROM */
+ ROM_LOAD( "hd647180.019", 0x00000, 0x08000, CRC(41a97ebe) SHA1(9b377086e4d9b8de6e3c8c7d2dd099b80ab88934) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "vim6.bin", 0x00000, 0x20000, CRC(2886878d) SHA1(f44933d87bbcd3bd58f46e0f0f89b05c409b713b) )
@@ -3007,40 +3089,45 @@ DRIVER_INIT_MEMBER(toaplan1_state,demonwld)
demonwld_driver_savestate();
}
-DRIVER_INIT_MEMBER(toaplan1_state,vimana)
-{
- toaplan1_driver_savestate();
- vimana_driver_savestate();
-}
+
GAME( 1988, rallybik, 0, rallybik, rallybik, toaplan1_state, toaplan1, ROT270, "Toaplan / Taito Corporation", "Rally Bike / Dash Yarou", 0 )
+
GAME( 1988, truxton, 0, truxton, truxton, toaplan1_state, toaplan1, ROT270, "Toaplan / Taito Corporation", "Truxton / Tatsujin", 0 )
-GAME( 1989, hellfire, 0, hellfire, hellfire, toaplan1_state, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (2P set)", 0 )
-GAME( 1989, hellfire1, hellfire, hellfire, hellfire1, toaplan1_state, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (1P set)", 0 )
-GAME( 1989, hellfire2a, hellfire, hellfire, hellfire2a,toaplan1_state, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (2P set, older)", 0 )
-GAME( 1989, hellfire1a, hellfire, hellfire, hellfire1a,toaplan1_state, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (1P set, older)", 0 )
-GAME( 1989, zerowing, 0, zerowing, zerowing2, toaplan1_state, toaplan1, ROT0, "Toaplan", "Zero Wing (2P set)", 0 )
-GAME( 1989, zerowing1, zerowing, zerowing, zerowing, toaplan1_state, toaplan1, ROT0, "Toaplan", "Zero Wing (1P set)", 0 )
-GAME( 1989, zerowingw, zerowing, zerowing, zerowing2, toaplan1_state, toaplan1, ROT0, "Toaplan (Williams license)", "Zero Wing (2P set, Williams license)", 0 )
-GAME( 1990, demonwld, 0, demonwld, demonwld, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 1)", 0 )
-GAME( 1989, demonwld1, demonwld, demonwld, demonwld, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 2)", 0 )
-GAME( 1989, demonwld2, demonwld, demonwld, demonwld1, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 3)", 0 )
-GAME( 1989, demonwld3, demonwld, demonwld, demonwld1, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 4)", 0 )
-GAME( 1989, demonwld4, demonwld, demonwld, demonwld1, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 5)", 0 )
-GAME( 1990, fireshrk, 0, samesame, fireshrk, toaplan1_state, toaplan1, ROT270, "Toaplan", "Fire Shark", MACHINE_NO_SOUND )
-GAME( 1989, fireshrka, fireshrk, samesame, fireshrka, toaplan1_state, toaplan1, ROT270, "Toaplan", "Fire Shark (earlier)", MACHINE_NO_SOUND )
-GAME( 1990, fireshrkd, fireshrk, samesame, samesame2, toaplan1_state, toaplan1, ROT270, "Toaplan (Dooyong license)", "Fire Shark (Korea, set 1, easier)", MACHINE_NO_SOUND )
-GAME( 1990, fireshrkdh, fireshrk, samesame, samesame2, toaplan1_state, toaplan1, ROT270, "Toaplan (Dooyong license)", "Fire Shark (Korea, set 2, harder)", MACHINE_NO_SOUND )
-GAME( 1989, samesame, fireshrk, samesame, samesame, toaplan1_state, toaplan1, ROT270, "Toaplan", "Same! Same! Same! (1P set)", MACHINE_NO_SOUND )
-GAME( 1989, samesame2, fireshrk, samesame, samesame2, toaplan1_state, toaplan1, ROT270, "Toaplan", "Same! Same! Same! (2P set)", MACHINE_NO_SOUND )
-GAME( 1990, outzone, 0, outzone, outzone, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone", 0 )
-GAME( 1990, outzoneh, outzone, outzone, outzone, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (harder)", 0 )
-GAME( 1990, outzonea, outzone, outzone, outzonea, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (old set)", 0 )
-GAME( 1990, outzoneb, outzone, outzone, outzonea, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (older set)", 0 )
-GAME( 1990, outzonec, outzone, outzone, outzonec, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (oldest set)", MACHINE_IMPERFECT_SOUND ) // prototype?
-GAME( 1990, outzonecv, outzone, outzonecv,outzone, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (Zero Wing TP-015 PCB conversion)", 0 )
-GAME( 1991, vimana, 0, vimana, vimana, toaplan1_state, vimana, ROT270, "Toaplan", "Vimana (World, set 1)", MACHINE_NO_SOUND )
-GAME( 1991, vimanan, vimana, vimana, vimanan, toaplan1_state, vimana, ROT270, "Toaplan", "Vimana (World, set 2)", MACHINE_NO_SOUND )
-GAME( 1991, vimanaj, vimana, vimana, vimanaj, toaplan1_state, vimana, ROT270, "Toaplan", "Vimana (Japan)", MACHINE_NO_SOUND )
+
+GAME( 1989, hellfire, 0, hellfire, hellfire, toaplan1_state, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (2P set)", 0 )
+GAME( 1989, hellfire1, hellfire, hellfire, hellfire1, toaplan1_state, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (1P set)", 0 )
+GAME( 1989, hellfire2a, hellfire, hellfire, hellfire2a,toaplan1_state, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (2P set, older)", 0 )
+GAME( 1989, hellfire1a, hellfire, hellfire, hellfire1a,toaplan1_state, toaplan1, ROT0, "Toaplan (Taito license)", "Hellfire (1P set, older)", 0 )
+
+GAME( 1989, zerowing, 0, zerowing, zerowing2, toaplan1_state, toaplan1, ROT0, "Toaplan", "Zero Wing (2P set)", 0 )
+GAME( 1989, zerowing1, zerowing, zerowing, zerowing, toaplan1_state, toaplan1, ROT0, "Toaplan", "Zero Wing (1P set)", 0 )
+GAME( 1989, zerowingw, zerowing, zerowing, zerowing2, toaplan1_state, toaplan1, ROT0, "Toaplan (Williams license)", "Zero Wing (2P set, Williams license)", 0 )
+
+GAME( 1990, demonwld, 0, demonwld, demonwld, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 1)", 0 )
+GAME( 1989, demonwld1, demonwld, demonwld, demonwld, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 2)", 0 )
+GAME( 1989, demonwld2, demonwld, demonwld, demonwld1, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 3)", 0 )
+GAME( 1989, demonwld3, demonwld, demonwld, demonwld1, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 4)", 0 )
+GAME( 1989, demonwld4, demonwld, demonwld, demonwld1, toaplan1_state, demonwld, ROT0, "Toaplan", "Demon's World / Horror Story (set 5)", 0 )
+
+GAME( 1990, fireshrk, 0, samesame, fireshrk, toaplan1_state, toaplan1, ROT270, "Toaplan", "Fire Shark", 0 )
+GAME( 1989, fireshrka, fireshrk, samesame, fireshrka, toaplan1_state, toaplan1, ROT270, "Toaplan", "Fire Shark (earlier)", 0 )
+GAME( 1990, fireshrkd, fireshrk, samesame, samesame2, toaplan1_state, toaplan1, ROT270, "Toaplan (Dooyong license)", "Fire Shark (Korea, set 1, easier)", 0 )
+GAME( 1990, fireshrkdh, fireshrk, samesame, samesame2, toaplan1_state, toaplan1, ROT270, "Toaplan (Dooyong license)", "Fire Shark (Korea, set 2, harder)", 0 )
+GAME( 1989, samesame, fireshrk, samesame, samesame, toaplan1_state, toaplan1, ROT270, "Toaplan", "Same! Same! Same! (1P set)", 0 )
+GAME( 1989, samesame2, fireshrk, samesame, samesame2, toaplan1_state, toaplan1, ROT270, "Toaplan", "Same! Same! Same! (2P set)", 0 )
+GAME( 2015, samesamenh, fireshrk, samesame, samesame, toaplan1_state, toaplan1, ROT270, "hack (trap15)", "Same! Same! Same! (1P set, NEW VER! hack)", 0 )
+
+GAME( 1990, outzone, 0, outzone, outzone, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone", 0 )
+GAME( 1990, outzoneh, outzone, outzone, outzone, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (harder)", 0 )
+GAME( 1990, outzonea, outzone, outzone, outzonea, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (old set)", 0 )
+GAME( 1990, outzoneb, outzone, outzone, outzonea, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (older set)", 0 )
+GAME( 1990, outzonec, outzone, outzone, outzonec, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (oldest set)", MACHINE_IMPERFECT_SOUND ) // prototype?
+GAME( 1990, outzonecv, outzone, outzonecv,outzone, toaplan1_state, toaplan1, ROT270, "Toaplan", "Out Zone (Zero Wing TP-015 PCB conversion)", 0 )
+
+// has various licenses / regions depending on jumpers, including Tecmo
+GAME( 1991, vimana, 0, vimana, vimana, toaplan1_state, toaplan1, ROT270, "Toaplan", "Vimana (World, set 1)", 0 )
+GAME( 1991, vimanan, vimana, vimana, vimanan, toaplan1_state, toaplan1, ROT270, "Toaplan", "Vimana (World, set 2)", 0 )
+GAME( 1991, vimanaj, vimana, vimana, vimanaj, toaplan1_state, toaplan1, ROT270, "Toaplan", "Vimana (Japan)", 0 )
diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp
index 8ef996f6445..c8316d6fe9d 100644
--- a/src/mame/drivers/toaplan2.cpp
+++ b/src/mame/drivers/toaplan2.cpp
@@ -311,7 +311,7 @@ Graphics Custom 208pin QFP:
Game status:
-Teki Paki Working, but no sound. Missing sound MCU dump. Chip is protected. It's a QFP80 Hitachi HD647180.
+Teki Paki Working. MCU type is a Hitachi HD647180.
Ghox Working, but no sound. Missing sound MCU dump. It's a QFP80 Hitachi HD647180.
Dogyuun Working. MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-002-MACH'.*
Knuckle Bash Working. MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-004-DASH'.*
@@ -659,9 +659,9 @@ CUSTOM_INPUT_MEMBER(toaplan2_state::c2map_r)
// For Teki Paki hardware
// bit 4 high signifies secondary CPU is ready
// bit 5 is tested low before V-Blank bit ???
- m_mcu_data = 0xff;
+ //m_mcu_data = 0xff;
- return (m_mcu_data == 0xff) ? 0x01 : 0x00;
+ return (m_cmdavailable) ? 0x00 : 0x01;
}
@@ -998,10 +998,11 @@ static ADDRESS_MAP_START( tekipaki_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x180040, 0x180041) AM_WRITE(toaplan2_coin_word_w)
AM_RANGE(0x180050, 0x180051) AM_READ_PORT("IN1")
AM_RANGE(0x180060, 0x180061) AM_READ_PORT("IN2")
- AM_RANGE(0x180070, 0x180071) AM_WRITE(toaplan2_hd647180_cpu_w)
+ AM_RANGE(0x180070, 0x180071) AM_WRITE(tekipaki_mcu_w)
ADDRESS_MAP_END
+
static ADDRESS_MAP_START( ghox_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x040000, 0x040001) AM_READ(ghox_p2_h_analog_r)
@@ -1506,6 +1507,44 @@ static ADDRESS_MAP_START( fixeightbl_oki, AS_0, 8, toaplan2_state )
ADDRESS_MAP_END
+
+WRITE16_MEMBER(toaplan2_state::tekipaki_mcu_w)
+{
+ if (ACCESSING_BITS_0_7)
+ {
+ m_mcu_data = data & 0xff;
+ m_cmdavailable = 1;
+ }
+};
+
+READ8_MEMBER(toaplan2_state::tekipaki_soundlatch_r)
+{
+ m_cmdavailable = 0;
+ return m_mcu_data;
+};
+
+READ8_MEMBER(toaplan2_state::tekipaki_cmdavailable_r)
+{
+ if (m_cmdavailable) return 0xff;
+ else return 0x00;
+};
+
+static ADDRESS_MAP_START( hd647180_mem_map, AS_PROGRAM, 8, toaplan2_state )
+ AM_RANGE(0x00000, 0x03fff) AM_ROM /* Internal 16k byte ROM */
+ AM_RANGE(0x0fe00, 0x0ffff) AM_RAM /* Internal 512 byte RAM */
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( hd647180_io_map, AS_IO, 8, toaplan2_state )
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+
+ AM_RANGE(0x60, 0x60) AM_READ(tekipaki_cmdavailable_r)
+ AM_RANGE(0x84, 0x84) AM_READ(tekipaki_soundlatch_r)
+
+ AM_RANGE(0x82, 0x82) AM_DEVREADWRITE("ymsnd", ym3812_device, status_port_r, control_port_w)
+ AM_RANGE(0x83, 0x83) AM_DEVREADWRITE("ymsnd", ym3812_device, read_port_r, write_port_w)
+ADDRESS_MAP_END
+
+
/*****************************************************************************
Input Port definitions
The following commands are available when the Invulnerability dipswitch
@@ -3014,10 +3053,7 @@ static MACHINE_CONFIG_START( tekipaki, toaplan2_state )
MCFG_CPU_PROGRAM_MAP(tekipaki_68k_mem)
MCFG_CPU_VBLANK_INT_DRIVER("screen", toaplan2_state, toaplan2_vblank_irq4)
-#ifdef USE_HD64x180
- MCFG_CPU_ADD("audiocpu", Z180, XTAL_10MHz) /* HD647180 CPU actually */
- MCFG_CPU_PROGRAM_MAP(hd647180_mem)
-#endif
+
MCFG_MACHINE_START_OVERRIDE(toaplan2_state,toaplan2)
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,toaplan2)
@@ -3045,13 +3081,26 @@ static MACHINE_CONFIG_START( tekipaki, toaplan2_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_27MHz/8)
-#ifdef USE_HD64x180
- MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
-#endif
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( tekipaki_mcu, tekipaki )
+
+ MCFG_CPU_ADD("audiocpu", Z180, XTAL_10MHz) /* HD647180 CPU actually */
+ MCFG_CPU_PROGRAM_MAP(hd647180_mem_map)
+ MCFG_CPU_IO_MAP(hd647180_io_map)
+
+ MCFG_QUANTUM_TIME(attotime::from_hz(600)) // GUESSED
+
+ MCFG_DEVICE_REMOVE("ymsnd")
+
+ MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_27MHz/8)
+ MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_START( ghox, toaplan2_state )
/* basic machine hardware */
@@ -4002,9 +4051,8 @@ ROM_START( tekipaki )
ROM_LOAD16_BYTE( "tp020-1.bin", 0x000000, 0x010000, CRC(d8420bd5) SHA1(30c1ad9e053cd7e79adb42aa428ebee28e144755) )
ROM_LOAD16_BYTE( "tp020-2.bin", 0x000001, 0x010000, CRC(7222de8e) SHA1(8352ae23efc24a2e20cc24b6d37cb8fc6b1a730c) )
- ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */
- /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
- ROM_LOAD( "hd647180.020", 0x00000, 0x08000, NO_DUMP )
+ ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */
+ ROM_LOAD( "hd647180.020", 0x00000, 0x08000, CRC(d5157c12) SHA1(b2c6c087bb539456a9e562d0b40f05dde26cacd3) )
ROM_REGION( 0x100000, "gp9001", 0 )
ROM_LOAD( "tp020-4.bin", 0x000000, 0x080000, CRC(3ebbe41e) SHA1(cea196c5f83e1a23d5b538a0db9bbbffa7af5118) )
@@ -4012,6 +4060,7 @@ ROM_START( tekipaki )
ROM_END
+
ROM_START( ghox ) /* Spinner with single axis (up/down) controls */
ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */
ROM_LOAD16_BYTE( "tp021-01.u10", 0x000000, 0x020000, CRC(9e56ac67) SHA1(daf241d9e55a6e60fc004ed61f787641595b1e62) )
@@ -5364,7 +5413,7 @@ ROM_END
// See list at top of file
// ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME FLAGS )
-GAME( 1991, tekipaki, 0, tekipaki, tekipaki, driver_device, 0, ROT0, "Toaplan", "Teki Paki", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1991, tekipaki, 0, tekipaki_mcu, tekipaki, driver_device, 0, ROT0, "Toaplan", "Teki Paki", MACHINE_SUPPORTS_SAVE )
GAME( 1991, ghox, 0, ghox, ghox, driver_device, 0, ROT270, "Toaplan", "Ghox (spinner)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1991, ghoxj, ghox, ghox, ghox, driver_device, 0, ROT270, "Toaplan", "Ghox (joystick)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/includes/toaplan1.h b/src/mame/includes/toaplan1.h
index ff437df03dc..962d1e18117 100644
--- a/src/mame/includes/toaplan1.h
+++ b/src/mame/includes/toaplan1.h
@@ -39,10 +39,6 @@ public:
uint32_t m_dsp_addr_w;
uint32_t m_main_ram_seg;
- uint8_t m_vimana_coins[2];
- uint8_t m_vimana_credits;
- uint8_t m_vimana_latch;
-
std::unique_ptr<uint16_t[]> m_pf4_tilevram16; /* || Drawn in this order */
std::unique_ptr<uint16_t[]> m_pf3_tilevram16; /* || */
std::unique_ptr<uint16_t[]> m_pf2_tilevram16; /* \||/ */
@@ -84,6 +80,8 @@ public:
tilemap_t *m_pf3_tilemap;
tilemap_t *m_pf4_tilemap;
+
+
DECLARE_WRITE16_MEMBER(toaplan1_intenable_w);
DECLARE_WRITE16_MEMBER(demonwld_dsp_addrsel_w);
DECLARE_READ16_MEMBER(demonwld_dsp_r);
@@ -92,9 +90,6 @@ public:
DECLARE_READ_LINE_MEMBER(demonwld_BIO_r);
DECLARE_WRITE16_MEMBER(demonwld_dsp_ctrl_w);
DECLARE_READ16_MEMBER(samesame_port_6_word_r);
- DECLARE_READ16_MEMBER(vimana_system_port_r);
- DECLARE_READ16_MEMBER(vimana_mcu_r);
- DECLARE_WRITE16_MEMBER(vimana_mcu_w);
DECLARE_READ16_MEMBER(toaplan1_shared_r);
DECLARE_WRITE16_MEMBER(toaplan1_shared_w);
DECLARE_WRITE16_MEMBER(toaplan1_reset_sound_w);
@@ -121,9 +116,17 @@ public:
DECLARE_READ16_MEMBER(toaplan1_scroll_regs_r);
DECLARE_WRITE16_MEMBER(toaplan1_scroll_regs_w);
+ // Fire Shark sound
+ uint8_t m_to_mcu;
+ uint8_t m_cmdavailable;
+
+ DECLARE_WRITE16_MEMBER(samesame_mcu_w);
+ DECLARE_READ8_MEMBER(samesame_soundlatch_r);
+ DECLARE_WRITE8_MEMBER(samesame_sound_done_w);
+ DECLARE_READ8_MEMBER(samesame_cmdavailable_r);
+
DECLARE_DRIVER_INIT(toaplan1);
DECLARE_DRIVER_INIT(demonwld);
- DECLARE_DRIVER_INIT(vimana);
TILE_GET_INFO_MEMBER(get_pf1_tile_info);
TILE_GET_INFO_MEMBER(get_pf2_tile_info);
TILE_GET_INFO_MEMBER(get_pf3_tile_info);
@@ -151,7 +154,6 @@ public:
void toaplan1_reset_sound();
void toaplan1_driver_savestate();
void demonwld_driver_savestate();
- void vimana_driver_savestate();
DECLARE_WRITE_LINE_MEMBER(toaplan1_reset_callback);
required_device<m68000_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h
index 6d75f4781c5..727e5ef34b6 100644
--- a/src/mame/includes/toaplan2.h
+++ b/src/mame/includes/toaplan2.h
@@ -147,6 +147,14 @@ public:
DECLARE_VIDEO_START(bgaregga);
DECLARE_VIDEO_START(bgareggabl);
DECLARE_VIDEO_START(batrider);
+
+ // Teki Paki sound
+ uint8_t m_cmdavailable;
+
+ DECLARE_WRITE16_MEMBER(tekipaki_mcu_w);
+ DECLARE_READ8_MEMBER(tekipaki_soundlatch_r);
+ DECLARE_READ8_MEMBER(tekipaki_cmdavailable_r);
+
uint32_t screen_update_toaplan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_dogyuun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/machine/toaplan1.cpp b/src/mame/machine/toaplan1.cpp
index 3ecf716ce63..8e790267d76 100644
--- a/src/mame/machine/toaplan1.cpp
+++ b/src/mame/machine/toaplan1.cpp
@@ -12,32 +12,6 @@
#include "includes/toaplan1.h"
-
-/* List of possible regions for coinage (for games with unemulated sound CPU) */
-enum {
- TOAPLAN1_REGION_JAPAN=0,
- TOAPLAN1_REGION_US,
- TOAPLAN1_REGION_WORLD,
- TOAPLAN1_REGION_OTHER
-};
-
-static const uint8_t toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER+1][2][4] =
-{
- { { 1, 1, 2, 2 }, { 1, 1, 2, 2 } }, /* TOAPLAN1_REGION_JAPAN */
- { { 1, 1, 2, 2 }, { 1, 1, 2, 2 } }, /* TOAPLAN1_REGION_US */
- { { 1, 2, 3, 4 }, { 1, 1, 1, 1 } }, /* TOAPLAN1_REGION_WORLD */
- { { 1, 1, 1, 1 }, { 1, 1, 1, 1 } } /* TOAPLAN1_REGION_OTHER */
-};
-
-static const uint8_t toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER+1][2][4] =
-{
- { { 1, 2, 1, 3 }, { 1, 2, 1, 3 } }, /* TOAPLAN1_REGION_JAPAN */
- { { 1, 2, 1, 3 }, { 1, 2, 1, 3 } }, /* TOAPLAN1_REGION_US */
- { { 1, 1, 1, 1 }, { 2, 3, 4, 6 } }, /* TOAPLAN1_REGION_WORLD */
- { { 1, 1, 1, 1 }, { 1, 1, 1, 1 } }, /* TOAPLAN1_REGION_OTHER */
-};
-
-
INTERRUPT_GEN_MEMBER(toaplan1_state::toaplan1_interrupt)
{
if (m_intenable)
@@ -179,109 +153,6 @@ READ16_MEMBER(toaplan1_state::samesame_port_6_word_r)
return (0x80 | ioport("TJUMP")->read()) & 0xff;
}
-READ16_MEMBER(toaplan1_state::vimana_system_port_r)
-{
- static const uint8_t vimana_region[16] =
- {
- TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_US , TOAPLAN1_REGION_WORLD, TOAPLAN1_REGION_JAPAN,
- TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_US ,
- TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER,
- TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_JAPAN
- };
-
- int data, p, r, d, slot, reg, dsw;
-
- slot = -1;
- d = ioport("DSWA")->read();
- r = ioport("TJUMP")->read();
- p = ioport("SYSTEM")->read();
- m_vimana_latch ^= p;
- data = (m_vimana_latch & p);
-
- /* simulate the mcu keeping track of credits based on region and coinage settings */
- /* latch so it doesn't add more than one coin per keypress */
- if (d & 0x04) /* "test mode" ON */
- {
- m_vimana_coins[0] = m_vimana_coins[1] = 0;
- m_vimana_credits = 0;
- }
- else /* "test mode" OFF */
- {
- if (data & 0x02) /* TILT */
- {
- m_vimana_coins[0] = m_vimana_coins[1] = 0;
- m_vimana_credits = 0;
- }
- if (data & 0x01) /* SERVICE1 */
- {
- m_vimana_credits++ ;
- }
- if (data & 0x08) /* COIN1 */
- {
- slot = 0;
- }
- if (data & 0x10) /* COIN2 */
- {
- slot = 1 ;
- }
-
- if (slot != -1)
- {
- reg = vimana_region[r];
- dsw = (d & 0xf0) >> (4 + 2 * slot);
- m_vimana_coins[slot]++;
- if (m_vimana_coins[slot] >= toaplan1_coins_for_credit[reg][slot][dsw])
- {
- m_vimana_credits += toaplan1_credits_for_coin[reg][slot][dsw];
- m_vimana_coins[slot] -= toaplan1_coins_for_credit[reg][slot][dsw];
- }
- machine().bookkeeping().coin_counter_w(slot, 1);
- machine().bookkeeping().coin_counter_w(slot, 0);
- }
-
- if (m_vimana_credits >= 9)
- m_vimana_credits = 9;
- }
-
- machine().bookkeeping().coin_lockout_global_w((m_vimana_credits >= 9));
-
- m_vimana_latch = p;
-
- return p & 0xffff;
-}
-
-READ16_MEMBER(toaplan1_state::vimana_mcu_r)
-{
- int data = 0 ;
- switch (offset)
- {
- case 0: data = 0xff; break;
- case 1: data = 0x00; break;
- case 2:
- {
- data = m_vimana_credits;
- break;
- }
- }
- return data & 0xff;
-}
-
-WRITE16_MEMBER(toaplan1_state::vimana_mcu_w)
-{
- switch (offset)
- {
- case 0: break;
- case 1: break;
- case 2:
- if (ACCESSING_BITS_0_7)
- {
- m_vimana_credits = data & 0xff;
- machine().bookkeeping().coin_lockout_global_w((m_vimana_credits >= 9));
- }
- break;
- }
-}
-
READ16_MEMBER(toaplan1_state::toaplan1_shared_r)
{
return m_sharedram[offset] & 0xff;
@@ -398,9 +269,6 @@ MACHINE_RESET_MEMBER(toaplan1_state,demonwld)
MACHINE_RESET_MEMBER(toaplan1_state,vimana)
{
MACHINE_RESET_CALL_MEMBER(toaplan1);
- m_vimana_coins[0] = m_vimana_coins[1] = 0;
- m_vimana_credits = 0;
- m_vimana_latch = 0;
m_maincpu->set_reset_callback(write_line_delegate(FUNC(toaplan1_state::toaplan1_reset_callback),this));
}
@@ -421,10 +289,3 @@ void toaplan1_state::demonwld_driver_savestate()
machine().save().register_postload(save_prepost_delegate(FUNC(toaplan1_state::demonwld_restore_dsp), this));
}
-void toaplan1_state::vimana_driver_savestate()
-{
- save_item(NAME(m_vimana_coins[0]));
- save_item(NAME(m_vimana_coins[1]));
- save_item(NAME(m_vimana_credits));
- save_item(NAME(m_vimana_latch));
-}
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 9bbd6af8bc9..ff6a67cc261 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -35827,6 +35827,7 @@ outzonecv // TP-O18 (c) 1990 Toaplan (TP-015 conversion)
rallybik // B45 / TP-O12 (c) 1988 Taito
samesame // TP-O17 (c) 1989 Toaplan
samesame2 // TP-O17 (c) 1989 Toaplan
+samesamenh // hack
truxton // B65 / TP-O13B (c) 1988 Taito
vimana // TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan)
vimanaj // TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan)