tstrike, ddungeon, darktowr: use new MC68705P3 core

tigeroad.cpp: cleanup and modernisation
* split out bballs and pushman state classes
* use new MC68705R3 core for pushman (this one uses port D - another test case)
* make pushman MCU hookup believable (internal registers can't be in shared RAM)
* use derived memory maps rather than installing handlers in init members
This commit is contained in:
Vas Crabb 2017-01-16 18:35:32 +11:00
parent 650ca8b573
commit 5ae669c195
5 changed files with 293 additions and 217 deletions

View File

@ -55,7 +55,6 @@ Dip locations verified with manual for ddragon & ddragon2
#include "emu.h"
#include "cpu/m6809/hd6309.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6805/m68705.h"
#include "cpu/m6809/m6809.h"
#include "cpu/z80/z80.h"
#include "sound/ym2151.h"
@ -183,7 +182,7 @@ WRITE8_MEMBER(ddragon_state::ddragon_bankswitch_w)
}
WRITE8_MEMBER(ddragon_state::toffy_bankswitch_w)
WRITE8_MEMBER(toffy_state::toffy_bankswitch_w)
{
m_scrollx_hi = data & 0x01;
m_scrolly_hi = (data & 0x02) >> 1;
@ -195,7 +194,7 @@ WRITE8_MEMBER(ddragon_state::toffy_bankswitch_w)
}
READ8_MEMBER(ddragon_state::darktowr_mcu_bank_r)
READ8_MEMBER(darktowr_state::darktowr_mcu_bank_r)
{
// logerror("BankRead %05x %08x\n",space.device().safe_pc(),offset);
@ -216,26 +215,27 @@ READ8_MEMBER(ddragon_state::darktowr_mcu_bank_r)
}
if (offset == 0x1401 || offset == 1)
return m_darktowr_mcu_ports[0];
return m_mcu_port_a_out;
logerror("Unmapped mcu bank read %04x\n",offset);
return 0xff;
}
WRITE8_MEMBER(ddragon_state::darktowr_mcu_bank_w)
WRITE8_MEMBER(darktowr_state::darktowr_mcu_bank_w)
{
logerror("BankWrite %05x %08x %08x\n", space.device().safe_pc(), offset, data);
if (offset == 0x1400 || offset == 0)
{
m_darktowr_mcu_ports[1] = BITSWAP8(data,0,1,2,3,4,5,6,7);
logerror("MCU PORT 1 -> %04x (from %04x)\n", BITSWAP8(data,0,1,2,3,4,5,6,7), data);
uint8_t const value(BITSWAP8(data, 0, 1, 2, 3, 4, 5, 6, 7));
m_mcu->pb_w(space, 0, value);
logerror("MCU PORT 1 -> %04x (from %04x)\n", value, data);
}
}
WRITE8_MEMBER(ddragon_state::darktowr_bankswitch_w)
WRITE8_MEMBER(darktowr_state::darktowr_bankswitch_w)
{
m_scrollx_hi = (data & 0x01);
m_scrolly_hi = ((data & 0x02) >> 1);
@ -250,7 +250,7 @@ WRITE8_MEMBER(ddragon_state::darktowr_bankswitch_w)
membank("bank1")->set_entry(newbank);
if (newbank == 4 && oldbank != 4)
space.install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(ddragon_state::darktowr_mcu_bank_r),this), write8_delegate(FUNC(ddragon_state::darktowr_mcu_bank_w),this));
space.install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(darktowr_state::darktowr_mcu_bank_r),this), write8_delegate(FUNC(darktowr_state::darktowr_mcu_bank_w),this));
else if (newbank != 4 && oldbank == 4)
space.install_readwrite_bank(0x4000, 0x7fff, "bank1");
}
@ -351,10 +351,10 @@ CUSTOM_INPUT_MEMBER(ddragon_state::subcpu_bus_free)
}
WRITE8_MEMBER(ddragon_state::darktowr_mcu_w)
WRITE8_MEMBER(darktowr_state::mcu_port_a_w)
{
logerror("McuWrite %05x %08x %08x\n",space.device().safe_pc(), offset, data);
m_darktowr_mcu_ports[offset] = data;
logerror("McuWrite %05x %08x %08x\n", space.device().safe_pc(), offset, data);
m_mcu_port_a_out = data;
}
@ -592,21 +592,6 @@ ADDRESS_MAP_END
/*************************************
*
* MCU memory maps
*
*************************************/
static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, ddragon_state )
ADDRESS_MAP_GLOBAL_MASK(0x7ff)
AM_RANGE(0x0000, 0x0007) AM_RAM_WRITE(darktowr_mcu_w) AM_SHARE("darktowr_mcu")
AM_RANGE(0x0008, 0x007f) AM_RAM
AM_RANGE(0x0080, 0x07ff) AM_ROM
ADDRESS_MAP_END
/*************************************
*
* Input ports
@ -1104,17 +1089,17 @@ static MACHINE_CONFIG_START( ddragon2, ddragon_state )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( darktowr, ddragon )
static MACHINE_CONFIG_DERIVED_CLASS( darktowr, ddragon, darktowr_state )
/* basic machine hardware */
MCFG_CPU_ADD("mcu", M68705,XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(mcu_map)
MCFG_CPU_ADD("mcu", M68705P3, XTAL_4MHz)
MCFG_M68705_PORTA_W_CB(WRITE8(darktowr_state, mcu_port_a_w))
/* video hardware */
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( toffy, ddragon )
static MACHINE_CONFIG_DERIVED_CLASS( toffy, ddragon, toffy_state )
/* basic machine hardware */
MCFG_DEVICE_REMOVE("sub")
@ -1809,7 +1794,7 @@ ROM_START( tstrike )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "tstrike.30", 0x08000, 0x08000, CRC(3f3f04a1) SHA1(45d2b4542ec783c1c4122616606be6c160f76c06) )
ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x08000, "gfx1", 0 )
@ -1853,7 +1838,7 @@ ROM_START( tstrikea )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "tstrike.30", 0x08000, 0x08000, CRC(3f3f04a1) SHA1(45d2b4542ec783c1c4122616606be6c160f76c06) )
ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x08000, "gfx1", 0 )
@ -1897,7 +1882,7 @@ ROM_START( ddungeon )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "dd30.30", 0x08000, 0x08000, CRC(ef1af99a) SHA1(7ced695b81ca9efbb7b28b78013e112edac85672) )
ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "dd_mcu.bin", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x10000, "gfx1", 0 ) /* GFX? */
@ -1936,7 +1921,7 @@ ROM_START( ddungeone )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "21j-0-1", 0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) ) /* from ddragon */
ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "dd_mcu.bin", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x10000, "gfx1", 0 ) /* GFX? */
@ -1973,7 +1958,7 @@ ROM_START( darktowr )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "21j-0-1", 0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) ) /* from ddragon */
ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x08000, "gfx1", 0 ) /* chars */
@ -2090,23 +2075,26 @@ DRIVER_INIT_MEMBER(ddragon_state,ddragon2)
}
DRIVER_INIT_MEMBER(ddragon_state,darktowr)
DRIVER_INIT_MEMBER(darktowr_state, darktowr)
{
save_item(NAME(m_mcu_port_a_out));
m_sprite_irq = INPUT_LINE_NMI;
m_ym_irq = M6809_FIRQ_LINE;
m_technos_video_hw = 0;
m_maincpu->space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::darktowr_bankswitch_w),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(darktowr_state::darktowr_bankswitch_w), this));
m_mcu_port_a_out = 0xff;
}
DRIVER_INIT_MEMBER(ddragon_state,toffy)
DRIVER_INIT_MEMBER(toffy_state, toffy)
{
int i, length;
uint8_t *rom;
m_ym_irq = M6809_FIRQ_LINE;
m_technos_video_hw = 0;
m_maincpu->space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::toffy_bankswitch_w),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(toffy_state::toffy_bankswitch_w), this));
/* the program rom has a simple bitswap encryption */
rom = memregion("maincpu")->base();
@ -2170,32 +2158,32 @@ DRIVER_INIT_MEMBER(ddragon_state,ddragon6809)
*
*************************************/
GAME( 1987, ddragon, 0, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan", "Double Dragon (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonw, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito license)", "Double Dragon (World set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonw1, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito license)", "Double Dragon (World set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonu, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonua, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonub, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonb2, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonb, ddragon, ddragonb, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", MACHINE_SUPPORTS_SAVE ) // according to dump notes
GAME( 1987, ddragonba, ddragon, ddragonba, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with M6803)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragon6809, ddragon, ddragon6809, ddragon, ddragon_state, ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 1)", MACHINE_NOT_WORKING )
GAME( 1987, ddragon6809a,ddragon, ddragon6809, ddragon, ddragon_state, ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 2)", MACHINE_NOT_WORKING )
GAME( 1987, ddragon, 0, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan", "Double Dragon (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonw, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito license)", "Double Dragon (World set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonw1, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito license)", "Double Dragon (World set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonu, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonua, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonub, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonb2, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragonb, ddragon, ddragonb, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", MACHINE_SUPPORTS_SAVE ) // according to dump notes
GAME( 1987, ddragonba, ddragon, ddragonba, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with M6803)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, ddragon6809, ddragon, ddragon6809, ddragon, ddragon_state, ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 1)", MACHINE_NOT_WORKING )
GAME( 1987, ddragon6809a,ddragon, ddragon6809, ddragon, ddragon_state, ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 2)", MACHINE_NOT_WORKING )
GAME( 1988, ddragon2, 0, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (World)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, ddragon2u, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, ddragon2j, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (Japan)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad dump
GAME( 1988, ddragon2b, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "bootleg", "Double Dragon II - The Revenge (US, bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, ddragon2, 0, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (World)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, ddragon2u, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, ddragon2j, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (Japan)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad dump
GAME( 1988, ddragon2b, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "bootleg", "Double Dragon II - The Revenge (US, bootleg)", MACHINE_SUPPORTS_SAVE )
/* these were conversions of double dragon */
GAME( 1991, tstrike, 0, darktowr, tstrike, ddragon_state, darktowr, ROT0, "East Coast Coin Company", "Thunder Strike (set 1)", MACHINE_SUPPORTS_SAVE ) // same manufacturer as The Game Room?
GAME( 1991, tstrikea, tstrike, darktowr, tstrike, ddragon_state, darktowr, ROT0, "The Game Room", "Thunder Strike (set 2, older)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, ddungeon, 0, darktowr, ddungeon, ddragon_state, darktowr, ROT0, "The Game Room", "Dangerous Dungeons (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, ddungeone,ddungeon, darktowr, ddungeon, ddragon_state, darktowr, ROT0, "East Coast Coin Company", "Dangerous Dungeons (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, darktowr, 0, darktowr, darktowr, ddragon_state, darktowr, ROT0, "The Game Room", "Dark Tower", MACHINE_SUPPORTS_SAVE )
GAME( 1991, tstrike, 0, darktowr, tstrike, darktowr_state, darktowr, ROT0, "East Coast Coin Company", "Thunder Strike (set 1)", MACHINE_SUPPORTS_SAVE ) // same manufacturer as The Game Room?
GAME( 1991, tstrikea, tstrike, darktowr, tstrike, darktowr_state, darktowr, ROT0, "The Game Room", "Thunder Strike (set 2, older)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, ddungeon, 0, darktowr, ddungeon, darktowr_state, darktowr, ROT0, "The Game Room", "Dangerous Dungeons (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, ddungeone, ddungeon, darktowr, ddungeon, darktowr_state, darktowr, ROT0, "East Coast Coin Company", "Dangerous Dungeons (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, darktowr, 0, darktowr, darktowr, darktowr_state, darktowr, ROT0, "The Game Room", "Dark Tower", MACHINE_SUPPORTS_SAVE )
/* these run on their own board, but are basically the same game. Toffy even has 'dangerous dungeons' text in it */
GAME( 1993, toffy, 0, toffy, toffy, ddragon_state, toffy, ROT0, "Midas", "Toffy", MACHINE_SUPPORTS_SAVE )
GAME( 1993, toffy, 0, toffy, toffy, toffy_state, toffy, ROT0, "Midas", "Toffy", MACHINE_SUPPORTS_SAVE )
GAME( 1994, stoffy, 0, toffy, toffy, ddragon_state, toffy, ROT0, "Midas", "Super Toffy", MACHINE_SUPPORTS_SAVE )
GAME( 1994, stoffyu, stoffy, toffy, toffy, ddragon_state, toffy, ROT0, "Midas (Unico license)", "Super Toffy (Unico license)", MACHINE_SUPPORTS_SAVE )
GAME( 1994, stoffy, 0, toffy, toffy, toffy_state, toffy, ROT0, "Midas", "Super Toffy", MACHINE_SUPPORTS_SAVE )
GAME( 1994, stoffyu, stoffy, toffy, toffy, toffy_state, toffy, ROT0, "Midas (Unico license)", "Super Toffy (Unico license)", MACHINE_SUPPORTS_SAVE )

View File

@ -84,9 +84,18 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, tigeroad_state )
AM_RANGE(0xffc000, 0xffffff) AM_RAM AM_SHARE("ram16")
ADDRESS_MAP_END
static ADDRESS_MAP_START( bballs_map, AS_PROGRAM, 16, tigeroad_state )
static ADDRESS_MAP_START( pushman_map, AS_PROGRAM, 16, pushman_state )
AM_IMPORT_FROM(main_map)
AM_RANGE(0x060000, 0x060001) AM_READWRITE(mcu_data_r, mcu_data_w)
AM_RANGE(0x060002, 0x600003) AM_WRITE(mcu_cmd_w)
AM_RANGE(0x060006, 0x060007) AM_READ(mcu_ack_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( bballs_map, AS_PROGRAM, 16, bballs_state )
ADDRESS_MAP_GLOBAL_MASK(0xfffff)
AM_RANGE(0x00000, 0x3ffff) AM_ROM
AM_RANGE(0x60000, 0x60007) AM_READWRITE(bballs_68705_r, bballs_68705_w)
// are these mirror addresses or does this PCB have a different addressing?
AM_RANGE(0xe0800, 0xe17ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xe4000, 0xe4001) AM_READ_PORT("P1_P2") AM_WRITE(tigeroad_videoctrl_w)
@ -125,13 +134,6 @@ static ADDRESS_MAP_START( sample_port_map, AS_IO, 8, tigeroad_state )
AM_RANGE(0x01, 0x01) AM_WRITE(msm5205_w)
ADDRESS_MAP_END
/* Pushman ONLY */
static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, tigeroad_state )
AM_RANGE(0x0000, 0x0007) AM_READWRITE(pushman_68000_r, pushman_68000_w)
AM_RANGE(0x0010, 0x007f) AM_RAM
AM_RANGE(0x0080, 0x0fff) AM_ROM
ADDRESS_MAP_END
/* Pushman / Bouncing Balls */
static ADDRESS_MAP_START( comad_sound_map, AS_PROGRAM, 8, tigeroad_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
@ -570,25 +572,6 @@ static GFXDECODE_START( tigeroad )
GFXDECODE_ENTRY( "sprites", 0, sprite_layout, 0x200, 16 )
GFXDECODE_END
void tigeroad_state::machine_start()
{
save_item(NAME(m_control));
save_item(NAME(m_shared_ram));
save_item(NAME(m_latch));
save_item(NAME(m_new_latch));
}
MACHINE_RESET_MEMBER(tigeroad_state,pushman)
{
// todo, move to an MCU sim reset function in machine/tigeroad.c
m_latch = 0;
m_new_latch = 0;
m_control[0] = 0;
m_control[1] = 0;
memset(m_shared_ram, 0, ARRAY_LENGTH(m_shared_ram));
}
static MACHINE_CONFIG_START( tigeroad, tigeroad_state )
/* basic machine hardware */
@ -699,25 +682,47 @@ static MACHINE_CONFIG_START( f1dream_comad, tigeroad_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pushman, f1dream_comad )
MCFG_CPU_ADD("mcu", M68705, 4000000) /* No idea */
MCFG_CPU_PROGRAM_MAP(mcu_map)
MCFG_MACHINE_RESET_OVERRIDE(tigeroad_state,pushman)
void pushman_state::machine_start()
{
save_item(NAME(m_mcu_semaphore));
save_item(NAME(m_host_latch));
save_item(NAME(m_mcu_latch));
save_item(NAME(m_mcu_output));
save_item(NAME(m_mcu_latch_ctl));
}
static MACHINE_CONFIG_DERIVED_CLASS(pushman, f1dream_comad, pushman_state)
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(pushman_map)
MCFG_CPU_ADD("mcu", M68705R3, 4000000) /* No idea */
MCFG_M68705_PORTA_W_CB(WRITE8(pushman_state, mcu_pa_w))
MCFG_M68705_PORTB_W_CB(WRITE8(pushman_state, mcu_pb_w))
MCFG_M68705_PORTC_W_CB(WRITE8(pushman_state, mcu_pc_w))
MACHINE_CONFIG_END
MACHINE_RESET_MEMBER(tigeroad_state,bballs)
MACHINE_RESET_MEMBER(bballs_state, bballs)
{
MACHINE_RESET_CALL_MEMBER(pushman);
m_new_latch = 0;
m_latch = 0x400;
std::fill(std::begin(m_shared_ram), std::end(m_shared_ram), 0);
}
static MACHINE_CONFIG_DERIVED( bballs, f1dream_comad )
void bballs_state::machine_start()
{
save_item(NAME(m_shared_ram));
save_item(NAME(m_latch));
save_item(NAME(m_new_latch));
}
static MACHINE_CONFIG_DERIVED_CLASS(bballs, f1dream_comad, bballs_state)
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(bballs_map)
MCFG_MACHINE_RESET_OVERRIDE(tigeroad_state,bballs)
MCFG_MACHINE_RESET_OVERRIDE(bballs_state, bballs)
MACHINE_CONFIG_END
@ -1179,41 +1184,29 @@ ROM_START( bballsa )
ROM_END
DRIVER_INIT_MEMBER(tigeroad_state,f1dream)
DRIVER_INIT_MEMBER(tigeroad_state, f1dream)
{
m_maincpu->space(AS_PROGRAM).install_write_handler(0xfe4002, 0xfe4003, write16_delegate(FUNC(tigeroad_state::f1dream_control_w),this));
}
DRIVER_INIT_MEMBER(tigeroad_state,pushman)
{
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x060000, 0x060007, read16_delegate(FUNC(tigeroad_state::pushman_68705_r),this), write16_delegate(FUNC(tigeroad_state::pushman_68705_w),this) );
m_has_coinlock = 0;
}
DRIVER_INIT_MEMBER(tigeroad_state,bballs)
{
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x060000, 0x060007, read16_delegate(FUNC(tigeroad_state::bballs_68705_r),this), write16_delegate(FUNC(tigeroad_state::bballs_68705_w),this) );
m_has_coinlock = 0;
}
/***************************************************************************/
GAME( 1987, tigeroad, 0, tigeroad, tigeroad, driver_device, 0, ROT0, "Capcom", "Tiger Road (US)", 0 )
GAME( 1987, tigeroadu,tigeroad, tigeroad, tigeroad, driver_device, 0, ROT0, "Capcom (Romstar license)", "Tiger Road (US, Romstar license)", 0 )
GAME( 1987, toramich, tigeroad, toramich, toramich, driver_device, 0, ROT0, "Capcom", "Tora e no Michi (Japan)", 0 )
GAME( 1987, tigeroadb,tigeroad, tigeroad, tigeroad, driver_device, 0, ROT0, "bootleg", "Tiger Road (US bootleg)", 0 )
GAME( 1987, tigeroad, 0, tigeroad, tigeroad, driver_device, 0, ROT0, "Capcom", "Tiger Road (US)", 0 )
GAME( 1987, tigeroadu,tigeroad, tigeroad, tigeroad, driver_device, 0, ROT0, "Capcom (Romstar license)", "Tiger Road (US, Romstar license)", 0 )
GAME( 1987, toramich, tigeroad, toramich, toramich, driver_device, 0, ROT0, "Capcom", "Tora e no Michi (Japan)", 0 )
GAME( 1987, tigeroadb,tigeroad, tigeroad, tigeroad, driver_device, 0, ROT0, "bootleg", "Tiger Road (US bootleg)", 0 )
/* F1 Dream has an Intel 8751 microcontroller for protection */
GAME( 1988, f1dream, 0, tigeroad, f1dream, tigeroad_state, f1dream, ROT0, "Capcom (Romstar license)", "F-1 Dream", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // collisions are wrong
GAME( 1988, f1dreamb, f1dream, tigeroad, f1dream, driver_device, 0, ROT0, "bootleg", "F-1 Dream (bootleg, set 1)", 0 )
GAME( 1988, f1dreamba,f1dream, tigeroad, f1dream, driver_device, 0, ROT0, "bootleg", "F-1 Dream (bootleg, set 2)", 0 )
GAME( 1988, f1dream, 0, tigeroad, f1dream, tigeroad_state, f1dream, ROT0, "Capcom (Romstar license)", "F-1 Dream", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // collisions are wrong
GAME( 1988, f1dreamb, f1dream, tigeroad, f1dream, driver_device, 0, ROT0, "bootleg", "F-1 Dream (bootleg, set 1)", 0 )
GAME( 1988, f1dreamba,f1dream, tigeroad, f1dream, driver_device, 0, ROT0, "bootleg", "F-1 Dream (bootleg, set 2)", 0 )
/* This Comad hardware is based around the F1 Dream design */
GAME( 1990, pushman, 0, pushman, pushman, tigeroad_state, pushman, ROT0, "Comad", "Pushman (Korea, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, pushmana, pushman, pushman, pushman, tigeroad_state, pushman, ROT0, "Comad", "Pushman (Korea, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, pushmans, pushman, pushman, pushman, tigeroad_state, pushman, ROT0, "Comad (American Sammy license)", "Pushman (American Sammy license)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, pushmant, pushman, pushman, pushman, tigeroad_state, pushman, ROT0, "Comad (Top Tronic license)", "Pushman (Top Tronic license)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, pushman, 0, pushman, pushman, driver_device, 0, ROT0, "Comad", "Pushman (Korea, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, pushmana, pushman, pushman, pushman, driver_device, 0, ROT0, "Comad", "Pushman (Korea, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, pushmans, pushman, pushman, pushman, driver_device, 0, ROT0, "Comad (American Sammy license)", "Pushman (American Sammy license)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, pushmant, pushman, pushman, pushman, driver_device, 0, ROT0, "Comad (Top Tronic license)", "Pushman (Top Tronic license)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, bballs, 0, bballs, bballs, tigeroad_state, bballs, ROT0, "Comad", "Bouncing Balls", MACHINE_SUPPORTS_SAVE )
GAME( 1991, bballsa, bballs, bballs, bballs, tigeroad_state, bballs, ROT0, "Comad", "Bouncing Balls (Adult)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, bballs, 0, bballs, bballs, driver_device, 0, ROT0, "Comad", "Bouncing Balls", MACHINE_SUPPORTS_SAVE )
GAME( 1991, bballsa, bballs, bballs, bballs, driver_device, 0, ROT0, "Comad", "Bouncing Balls (Adult)", MACHINE_SUPPORTS_SAVE )

View File

@ -6,31 +6,34 @@
*************************************************************************/
#include "cpu/m6805/m68705.h"
#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class ddragon_state : public driver_device
{
public:
ddragon_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_rambase(*this, "rambase"),
m_bgvideoram(*this, "bgvideoram"),
m_fgvideoram(*this, "fgvideoram"),
m_comram(*this, "comram"),
m_spriteram(*this, "spriteram"),
m_scrollx_lo(*this, "scrollx_lo"),
m_scrolly_lo(*this, "scrolly_lo"),
m_darktowr_mcu_ports(*this, "darktowr_mcu"),
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
m_subcpu(*this, "sub"),
m_adpcm1(*this, "adpcm1"),
m_adpcm2(*this, "adpcm2"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch") { }
: driver_device(mconfig, type, tag)
, m_rambase(*this, "rambase")
, m_bgvideoram(*this, "bgvideoram")
, m_fgvideoram(*this, "fgvideoram")
, m_comram(*this, "comram")
, m_spriteram(*this, "spriteram")
, m_scrollx_lo(*this, "scrollx_lo")
, m_scrolly_lo(*this, "scrolly_lo")
, m_maincpu(*this, "maincpu")
, m_soundcpu(*this, "soundcpu")
, m_subcpu(*this, "sub")
, m_adpcm1(*this, "adpcm1")
, m_adpcm2(*this, "adpcm2")
, m_gfxdecode(*this, "gfxdecode")
, m_screen(*this, "screen")
, m_palette(*this, "palette")
, m_soundlatch(*this, "soundlatch")
{
}
/* memory pointers */
optional_shared_ptr<uint8_t> m_rambase;
@ -40,7 +43,6 @@ public:
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_scrollx_lo;
required_shared_ptr<uint8_t> m_scrolly_lo;
optional_shared_ptr<uint8_t> m_darktowr_mcu_ports;
/* video-related */
tilemap_t *m_fg_tilemap;
@ -105,15 +107,10 @@ public:
DECLARE_WRITE8_MEMBER(ddragon_fgvideoram_w);
DECLARE_CUSTOM_INPUT_MEMBER(subcpu_bus_free);
DECLARE_WRITE8_MEMBER(ddragon_bankswitch_w);
DECLARE_WRITE8_MEMBER(toffy_bankswitch_w);
DECLARE_READ8_MEMBER(darktowr_mcu_bank_r);
DECLARE_WRITE8_MEMBER(darktowr_mcu_bank_w);
DECLARE_WRITE8_MEMBER(darktowr_bankswitch_w);
DECLARE_READ8_MEMBER(ddragon_interrupt_r);
DECLARE_WRITE8_MEMBER(ddragon_interrupt_w);
DECLARE_WRITE8_MEMBER(ddragon2_sub_irq_ack_w);
DECLARE_WRITE8_MEMBER(ddragon2_sub_irq_w);
DECLARE_WRITE8_MEMBER(darktowr_mcu_w);
DECLARE_READ8_MEMBER(ddragon_hd63701_internal_registers_r);
DECLARE_WRITE8_MEMBER(ddragon_hd63701_internal_registers_w);
DECLARE_READ8_MEMBER(ddragon_comram_r);
@ -124,9 +121,45 @@ public:
DECLARE_WRITE_LINE_MEMBER(dd_adpcm_int_1);
DECLARE_WRITE_LINE_MEMBER(dd_adpcm_int_2);
DECLARE_DRIVER_INIT(toffy);
DECLARE_DRIVER_INIT(darktowr);
DECLARE_DRIVER_INIT(ddragon2);
DECLARE_DRIVER_INIT(ddragon);
DECLARE_DRIVER_INIT(ddragon6809);
};
class darktowr_state : public ddragon_state
{
public:
darktowr_state(const machine_config &mconfig, device_type type, const char *tag)
: ddragon_state(mconfig, type, tag)
, m_mcu(*this, "mcu")
, m_mcu_port_a_out(0xff)
{
}
DECLARE_READ8_MEMBER(darktowr_mcu_bank_r);
DECLARE_WRITE8_MEMBER(darktowr_mcu_bank_w);
DECLARE_WRITE8_MEMBER(darktowr_bankswitch_w);
DECLARE_WRITE8_MEMBER(mcu_port_a_w);
DECLARE_DRIVER_INIT(darktowr);
protected:
required_device<m68705p_device> m_mcu;
uint8_t m_mcu_port_a_out;;
};
class toffy_state : public ddragon_state
{
public:
toffy_state(const machine_config &mconfig, device_type type, const char *tag)
: ddragon_state(mconfig, type, tag)
{
}
DECLARE_WRITE8_MEMBER(toffy_bankswitch_w);
DECLARE_DRIVER_INIT(toffy);
};

View File

@ -1,22 +1,26 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
#include "video/bufsprite.h"
#include "sound/msm5205.h"
#include "video/tigeroad_spr.h"
#include "cpu/m68000/m68000.h"
#include "cpu/m6805/m68705.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "sound/2203intf.h"
#include "sound/msm5205.h"
#include "cpu/m6805/m68705.h"
#include "video/tigeroad_spr.h"
#include "video/bufsprite.h"
class tigeroad_state : public driver_device
{
public:
tigeroad_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_spriteram(*this, "spriteram") ,
m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
m_ram16(*this, "ram16"),
m_maincpu(*this, "maincpu"),
@ -24,10 +28,9 @@ public:
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_mcu(*this, "mcu"),
m_spritegen(*this, "spritegen"),
m_soundlatch(*this, "soundlatch"),
m_has_coinlock(1)
m_has_coinlock(true)
{ }
required_device<buffered_spriteram16_device> m_spriteram;
@ -43,8 +46,6 @@ public:
DECLARE_WRITE16_MEMBER(tigeroad_scroll_w);
DECLARE_WRITE8_MEMBER(msm5205_w);
DECLARE_DRIVER_INIT(f1dream);
DECLARE_DRIVER_INIT(pushman);
DECLARE_DRIVER_INIT(bballs);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILEMAP_MAPPER_MEMBER(tigeroad_tilemap_scan);
@ -56,28 +57,73 @@ public:
optional_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
optional_device<cpu_device> m_mcu;
required_device<tigeroad_spr_device> m_spritegen;
required_device<generic_latch_8_device> m_soundlatch;
uint16_t m_control[2];
protected:
/* misc */
uint8_t m_shared_ram[8];
uint16_t m_latch;
uint16_t m_new_latch;
int m_has_coinlock;
bool m_has_coinlock;
};
/* protection handling */
DECLARE_READ16_MEMBER(pushman_68705_r);
DECLARE_WRITE16_MEMBER(pushman_68705_w);
DECLARE_READ16_MEMBER(bballs_68705_r);
DECLARE_WRITE16_MEMBER(bballs_68705_w);
DECLARE_READ8_MEMBER(pushman_68000_r);
DECLARE_WRITE8_MEMBER(pushman_68000_w);
DECLARE_MACHINE_RESET(pushman);
DECLARE_MACHINE_RESET(bballs);
class pushman_state : public tigeroad_state
{
public:
pushman_state(const machine_config &mconfig, device_type type, const char *tag)
: tigeroad_state(mconfig, type, tag)
, m_mcu(*this, "mcu")
, m_mcu_semaphore(false)
, m_host_latch(0xffff)
, m_mcu_latch(0xffff)
, m_mcu_output(0xffff)
, m_mcu_latch_ctl(0xff)
{
m_has_coinlock = false;
}
DECLARE_READ16_MEMBER(mcu_data_r);
DECLARE_READ16_MEMBER(mcu_ack_r);
DECLARE_WRITE16_MEMBER(mcu_data_w);
DECLARE_WRITE16_MEMBER(mcu_cmd_w);
DECLARE_WRITE8_MEMBER(mcu_pa_w);
DECLARE_WRITE8_MEMBER(mcu_pb_w);
DECLARE_WRITE8_MEMBER(mcu_pc_w);
protected:
virtual void machine_start() override;
required_device<m68705u_device> m_mcu;
bool m_mcu_semaphore;
u16 m_host_latch, m_mcu_latch;
u16 m_mcu_output;
u8 m_mcu_latch_ctl;
};
class bballs_state : public tigeroad_state
{
public:
bballs_state(const machine_config &mconfig, device_type type, const char *tag)
: tigeroad_state(mconfig, type, tag)
, m_shared_ram{ 0, 0, 0, 0, 0, 0, 0, 0 }
, m_latch(0xffff)
, m_new_latch(0)
{
m_has_coinlock = false;
}
DECLARE_READ16_MEMBER(bballs_68705_r);
DECLARE_WRITE16_MEMBER(bballs_68705_w);
DECLARE_MACHINE_RESET(bballs);
DECLARE_DRIVER_INIT(bballs);
protected:
virtual void machine_start() override;
u8 m_shared_ram[8];
u16 m_latch;
u16 m_new_latch;
};

View File

@ -124,39 +124,71 @@ WRITE16_MEMBER(tigeroad_state::f1dream_control_w)
}
READ16_MEMBER(tigeroad_state::pushman_68705_r)
READ16_MEMBER(pushman_state::mcu_data_r)
{
if (offset == 0)
return m_latch;
if (offset == 3 && m_new_latch)
{
m_new_latch = 0;
return 0;
}
if (offset == 3 && !m_new_latch)
return 0xff;
return (m_shared_ram[2 * offset + 1] << 8) + m_shared_ram[2 * offset];
return m_mcu_latch;
}
WRITE16_MEMBER(tigeroad_state::pushman_68705_w)
READ16_MEMBER(pushman_state::mcu_ack_r)
{
if (ACCESSING_BITS_8_15)
m_shared_ram[2 * offset] = data >> 8;
if (ACCESSING_BITS_0_7)
m_shared_ram[2 * offset + 1] = data & 0xff;
if (offset == 1)
if (m_mcu_semaphore)
{
m_mcu->set_input_line(M68705_IRQ_LINE, HOLD_LINE);
space.device().execute().spin();
m_new_latch = 0;
m_mcu_semaphore = false;
return 0x0000;
}
else
{
return 0x00ff;
}
}
WRITE16_MEMBER(pushman_state::mcu_data_w)
{
COMBINE_DATA(&m_host_latch);
}
WRITE16_MEMBER(pushman_state::mcu_cmd_w)
{
m_mcu->pd_w(space, 0, data & 0x00ff);
m_mcu->set_input_line(M68705_IRQ_LINE, ASSERT_LINE);
}
WRITE8_MEMBER(pushman_state::mcu_pa_w)
{
m_mcu_output = (m_mcu_output & 0xff00) | (u16(data) & 0x00ff);
}
WRITE8_MEMBER(pushman_state::mcu_pb_w)
{
m_mcu_output = (m_mcu_output & 0x00ff) | (u16(data) << 8);
}
WRITE8_MEMBER(pushman_state::mcu_pc_w)
{
if (BIT(data, 0))
{
m_mcu->pa_w(space, 0, 0xff);
m_mcu->pb_w(space, 0, 0xff);
}
else
{
m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
m_mcu->pa_w(space, 0, (m_host_latch >> 8) & 0x00ff);
m_mcu->pb_w(space, 0, (m_host_latch >> 0) & 0x00ff);
}
if (BIT(m_mcu_latch_ctl, 1) && !BIT(data, 1))
{
m_mcu_latch = m_mcu_output & (BIT(m_mcu_latch_ctl, 0) ? 0xffff : m_host_latch);
m_mcu_semaphore = true;
}
m_mcu_latch_ctl = data;
}
/* ElSemi - Bouncing balls protection. */
READ16_MEMBER(tigeroad_state::bballs_68705_r)
READ16_MEMBER(bballs_state::bballs_68705_r)
{
if (offset == 0)
return m_latch;
@ -171,7 +203,7 @@ READ16_MEMBER(tigeroad_state::bballs_68705_r)
return (m_shared_ram[2 * offset + 1] << 8) + m_shared_ram[2 * offset];
}
WRITE16_MEMBER(tigeroad_state::bballs_68705_w)
WRITE16_MEMBER(bballs_state::bballs_68705_w)
{
if (ACCESSING_BITS_8_15)
m_shared_ram[2 * offset] = data >> 8;
@ -196,19 +228,3 @@ WRITE16_MEMBER(tigeroad_state::bballs_68705_w)
}
}
}
READ8_MEMBER(tigeroad_state::pushman_68000_r)
{
return m_shared_ram[offset];
}
WRITE8_MEMBER(tigeroad_state::pushman_68000_w)
{
if (offset == 2 && (m_shared_ram[2] & 2) == 0 && data & 2)
{
m_latch = (m_shared_ram[1] << 8) | m_shared_ram[0];
m_new_latch = 1;
}
m_shared_ram[offset] = data;
}