From 5b6ff832cd2a1d7fc458ad61fe14ad8914968fe4 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 20 Jun 2017 10:32:53 -0400 Subject: grdian, getstarj: Replace MCU simulation with new dump --- src/mame/drivers/slapfght.cpp | 41 +--- src/mame/includes/slapfght.h | 7 +- src/mame/machine/slapfght.cpp | 435 +----------------------------------------- 3 files changed, 7 insertions(+), 476 deletions(-) diff --git a/src/mame/drivers/slapfght.cpp b/src/mame/drivers/slapfght.cpp index 8f6f10397e6..0b91d03081b 100644 --- a/src/mame/drivers/slapfght.cpp +++ b/src/mame/drivers/slapfght.cpp @@ -784,14 +784,6 @@ void slapfght_state::machine_reset() m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } -MACHINE_RESET_MEMBER(slapfght_state,getstar) -{ - // don't boot the mcu since we don't have a dump yet -// m_mcu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - - machine_reset(); -} - /**************************************************************************/ void slapfght_state::init_banks() @@ -807,18 +799,6 @@ DRIVER_INIT_MEMBER(slapfght_state,slapfigh) init_banks(); } -DRIVER_INIT_MEMBER(slapfght_state,getstar) -{ - m_getstar_id = GETSTAR; - init_banks(); -} - -DRIVER_INIT_MEMBER(slapfght_state,getstarj) -{ - m_getstar_id = GETSTARJ; - init_banks(); -} - DRIVER_INIT_MEMBER(slapfght_state,getstarb1) { m_getstar_id = GETSTARB1; @@ -1098,19 +1078,6 @@ static MACHINE_CONFIG_DERIVED( slapfighb2, slapfighb1 ) MCFG_CPU_PROGRAM_MAP(slapfighb2_map) MACHINE_CONFIG_END -static MACHINE_CONFIG_DERIVED( getstar, slapfigh ) - - /* basic machine hardware */ - MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(getstar_map) - MCFG_CPU_IO_MAP(getstar_io_map) - - MCFG_DEVICE_MODIFY("bmcu:mcu") - MCFG_DEVICE_DISABLE() - - MCFG_MACHINE_RESET_OVERRIDE(slapfght_state, getstar) -MACHINE_CONFIG_END - static MACHINE_CONFIG_DERIVED( getstarb1, slapfighb1 ) /* basic machine hardware */ @@ -1890,7 +1857,7 @@ ROM_START( grdian ) ROM_LOAD( "a68-03.12d", 0x0000, 0x2000, CRC(18daa44c) SHA1(1a3d22a186c591321d1b836ee30d89fba4771122) ) ROM_REGION( 0x0800, "bmcu:mcu", 0 ) /* 2k for the microcontroller */ - ROM_LOAD( "a68_14.6a", 0x0000, 0x0800, NO_DUMP ) + ROM_LOAD( "a68_14.6a", 0x0000, 0x0800, CRC(87c4ca48) SHA1(ae15dab7adde7ad2381ca3d70331891c8f3bcc42) ) ROM_REGION( 0x04000, "gfx1", 0 ) /* Region 1 - temporary for gfx */ ROM_LOAD( "a68_05-1.6f", 0x00000, 0x2000, CRC(06f60107) SHA1(c5dcf0c7a5863ea960ee747d2d7ec7ac8bb7d3af) ) /* Chars */ @@ -1924,7 +1891,7 @@ ROM_START( getstarj ) ROM_LOAD( "a68-03.12d", 0x00000, 0x2000, CRC(18daa44c) SHA1(1a3d22a186c591321d1b836ee30d89fba4771122) ) ROM_REGION( 0x0800, "bmcu:mcu", 0 ) /* 2k for the microcontroller */ - ROM_LOAD( "68705.6a", 0x0000, 0x0800, NO_DUMP ) + ROM_LOAD( "a68_14.6a", 0x0000, 0x0800, CRC(87c4ca48) SHA1(ae15dab7adde7ad2381ca3d70331891c8f3bcc42) ) ROM_REGION( 0x04000, "gfx1", 0 ) /* Region 1 - temporary for gfx */ ROM_LOAD( "a68_05.6f", 0x00000, 0x2000, CRC(e3d409e7) SHA1(0b6be4767f110729f4dd1a472ef8d9a0c718b684) ) /* Chars */ @@ -2033,7 +2000,7 @@ GAME( 1986, slapfighb1, alcon, slapfighb1, slapfigh, slapfght_state, slapfig GAME( 1986, slapfighb2, alcon, slapfighb2, slapfigh, slapfght_state, slapfigh, ROT270, "bootleg", "Slap Fight (bootleg set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // England? GAME( 1986, slapfighb3, alcon, slapfighb2, slapfigh, slapfght_state, slapfigh, ROT270, "bootleg", "Slap Fight (bootleg set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // PCB labeled 'slap fighter' -GAME( 1986, grdian, 0, getstar, getstar, slapfght_state, getstar, ROT0, "Toaplan / Taito America Corporation (Kitkorp license)", "Guardian (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, getstarj, grdian, getstar, getstarj, slapfght_state, getstarj, ROT0, "Toaplan / Taito", "Get Star (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, grdian, 0, slapfigh, getstar, slapfght_state, slapfigh, ROT0, "Toaplan / Taito America Corporation (Kitkorp license)", "Guardian (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, getstarj, grdian, slapfigh, getstarj, slapfght_state, slapfigh, ROT0, "Toaplan / Taito", "Get Star (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, getstarb1, grdian, getstarb1, getstarj, slapfght_state, getstarb1, ROT0, "bootleg", "Get Star (bootleg set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) GAME( 1986, getstarb2, grdian, getstarb2, getstarb2, slapfght_state, getstarb2, ROT0, "bootleg", "Get Star (bootleg set 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/slapfght.h b/src/mame/includes/slapfght.h index 3f21f29491e..9e033a23b76 100644 --- a/src/mame/includes/slapfght.h +++ b/src/mame/includes/slapfght.h @@ -47,8 +47,8 @@ public: enum getstar_id { GETSTUNK = 0, /* unknown for inclusion of possible new sets */ - GETSTAR, - GETSTARJ, + //GETSTAR, + //GETSTARJ, GETSTARB1, /* "good" bootleg with same behaviour as 'getstarj' */ GETSTARB2 /* "lame" bootleg with lots of ingame bugs */ } m_getstar_id; @@ -98,11 +98,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - DECLARE_MACHINE_RESET(getstar); void init_banks(); - DECLARE_DRIVER_INIT(getstarj); - DECLARE_DRIVER_INIT(getstar); DECLARE_DRIVER_INIT(getstarb1); DECLARE_DRIVER_INIT(slapfigh); DECLARE_DRIVER_INIT(getstarb2); diff --git a/src/mame/machine/slapfght.cpp b/src/mame/machine/slapfght.cpp index 527fef64284..b84ebf7f857 100644 --- a/src/mame/machine/slapfght.cpp +++ b/src/mame/machine/slapfght.cpp @@ -51,77 +51,12 @@ READ8_MEMBER(slapfght_state::getstar_mcusim_status_r) READ8_MEMBER(slapfght_state::getstar_mcusim_r) { - uint16_t tmp = 0; /* needed for values computed on 16 bits */ - uint8_t getstar_val = 0; - uint8_t phase_lookup_table[] = {0x00, 0x01, 0x03, 0xff, 0xff, 0x02, 0x05, 0xff, 0xff, 0x05}; /* table at 0x0e05 in 'getstarb1' */ + uint8_t getstar_val = 0; uint8_t lives_lookup_table[] = {0x03, 0x05, 0x01, 0x02}; /* table at 0x0e62 in 'getstarb1' */ uint8_t lgsb2_lookup_table[] = {0x00, 0x03, 0x04, 0x05}; /* fake tanle for "test mode" in 'getstarb2' */ switch (m_getstar_id) { - case GETSTAR: - case GETSTARJ: - switch (m_getstar_cmd) - { - case 0x20: /* continue play */ - getstar_val = ((m_gs_a & 0x30) == 0x30) ? 0x20 : 0x80; - break; - case 0x21: /* lose life */ - getstar_val = (m_gs_a << 1) | (m_gs_a >> 7); - break; - case 0x22: /* starting difficulty */ - getstar_val = ((m_gs_a & 0x0c) >> 2) + 1; - break; - case 0x23: /* starting lives */ - getstar_val = lives_lookup_table[m_gs_a]; - break; - case 0x24: /* game phase */ - getstar_val = phase_lookup_table[((m_gs_a & 0x18) >> 1) | (m_gs_a & 0x03)]; - break; - case 0x25: /* players inputs */ - getstar_val = BITSWAP8(m_gs_a, 3, 2, 1, 0, 7, 5, 6, 4); - break; - case 0x26: /* background (1st read) */ - tmp = 0x8800 + (0x001f * m_gs_a); - getstar_val = (tmp & 0x00ff) >> 0; - m_getstar_cmd |= 0x80; /* to allow a second consecutive read */ - break; - case 0xa6: /* background (2nd read) */ - tmp = 0x8800 + (0x001f * m_gs_a); - getstar_val = (tmp & 0xff00) >> 8; - break; - case 0x29: /* unknown effect */ - getstar_val = 0x00; - break; - case 0x2a: /* change player (if 2 players game) */ - getstar_val = (m_gs_a ^ 0x40); - break; - case 0x37: /* foreground (1st read) */ - tmp = ((0xd0 + ((m_gs_e >> 2) & 0x0f)) << 8) | (0x40 * (m_gs_e & 03) + m_gs_d); - getstar_val = (tmp & 0x00ff) >> 0; - m_getstar_cmd |= 0x80; /* to allow a second consecutive read */ - break; - case 0xb7: /* foreground (2nd read) */ - tmp = ((0xd0 + ((m_gs_e >> 2) & 0x0f)) << 8) | (0x40 * (m_gs_e & 03) + m_gs_d); - getstar_val = (tmp & 0xff00) >> 8; - break; - case 0x38: /* laser position (1st read) */ - tmp = 0xf740 - (((m_gs_e >> 4) << 8) | ((m_gs_e & 0x08) ? 0x80 : 0x00)) + (0x02 + (m_gs_d >> 2)); - getstar_val = (tmp & 0x00ff) >> 0; - m_getstar_cmd |= 0x80; /* to allow a second consecutive read */ - break; - case 0xb8: /* laser position (2nd read) */ - tmp = 0xf740 - (((m_gs_e >> 4) << 8) | ((m_gs_e & 0x08) ? 0x80 : 0x00)) + (0x02 + (m_gs_d >> 2)); - getstar_val = (tmp & 0xff00) >> 8; - break; - case 0x73: /* avoid "BAD HW" message */ - getstar_val = 0x76; - break; - default: - logerror("%04x: getstar_mcusim_r - cmd = %02x\n",space.device().safe_pc(),m_getstar_cmd); - break; - } - break; case GETSTARB1: /* value isn't computed by the bootleg but we want to please the "test mode" */ if (space.device().safe_pc() == 0x6b04) return (lives_lookup_table[m_gs_a]); @@ -163,374 +98,6 @@ WRITE8_MEMBER(slapfght_state::getstar_mcusim_w) switch (m_getstar_id) { - case GETSTAR: - /* unknown effect - not read back */ - if (space.device().safe_pc() == 0x00bf) - { - m_getstar_cmd = 0x00; - GS_RESET_REGS - } - /* players inputs */ - if (space.device().safe_pc() == 0x0560) - { - m_getstar_cmd = 0x25; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x056d) - { - m_getstar_cmd = 0x25; - GS_SAVE_REGS - } - /* lose life */ - if (space.device().safe_pc() == 0x0a0a) - { - m_getstar_cmd = 0x21; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0a17) - { - m_getstar_cmd = 0x21; - GS_SAVE_REGS - } - /* unknown effect */ - if (space.device().safe_pc() == 0x0a51) - { - m_getstar_cmd = 0x29; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0a6e) - { - m_getstar_cmd = 0x29; - GS_SAVE_REGS - } - /* continue play */ - if (space.device().safe_pc() == 0x0ae3) - { - m_getstar_cmd = 0x20; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0af0) - { - m_getstar_cmd = 0x20; - GS_SAVE_REGS - } - /* unknown effect - not read back */ - if (space.device().safe_pc() == 0x0b62) - { - m_getstar_cmd = 0x00; /* 0x1f */ - GS_RESET_REGS - } - /* change player (if 2 players game) */ - if (space.device().safe_pc() == 0x0bab) - { - m_getstar_cmd = 0x2a; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0bb8) - { - m_getstar_cmd = 0x2a; - GS_SAVE_REGS - } - /* game phase */ - if (space.device().safe_pc() == 0x0d37) - { - m_getstar_cmd = 0x24; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0d44) - { - m_getstar_cmd = 0x24; - GS_SAVE_REGS - } - /* starting lives */ - if (space.device().safe_pc() == 0x0d79) - { - m_getstar_cmd = 0x23; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0d8a) - { - m_getstar_cmd = 0x23; - GS_SAVE_REGS - } - /* starting difficulty */ - if (space.device().safe_pc() == 0x0dc1) - { - m_getstar_cmd = 0x22; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0dd0) - { - m_getstar_cmd = 0x22; - GS_SAVE_REGS - } - /* starting lives (again) */ - if (space.device().safe_pc() == 0x1011) - { - m_getstar_cmd = 0x23; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x101e) - { - m_getstar_cmd = 0x23; - GS_SAVE_REGS - } - /* hardware test */ - if (space.device().safe_pc() == 0x107a) - { - m_getstar_cmd = 0x73; - GS_RESET_REGS - } - /* game phase (again) */ - if (space.device().safe_pc() == 0x10c6) - { - m_getstar_cmd = 0x24; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x10d3) - { - m_getstar_cmd = 0x24; - GS_SAVE_REGS - } - /* background */ - if (space.device().safe_pc() == 0x1910) - { - m_getstar_cmd = 0x26; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x191d) - { - m_getstar_cmd = 0x26; - GS_SAVE_REGS - } - /* foreground */ - if (space.device().safe_pc() == 0x19d5) - { - m_getstar_cmd = 0x37; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x19e4) - { - m_getstar_cmd = 0x37; - GS_SAVE_REGS - } - if (space.device().safe_pc() == 0x19f1) - { - m_getstar_cmd = 0x37; - /* do NOT update the registers because there are 2 writes before 2 reads ! */ - } - /* laser position */ - if (space.device().safe_pc() == 0x26af) - { - m_getstar_cmd = 0x38; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x26be) - { - m_getstar_cmd = 0x38; - GS_SAVE_REGS - } - if (space.device().safe_pc() == 0x26cb) - { - m_getstar_cmd = 0x38; - /* do NOT update the registers because there are 2 writes before 2 reads ! */ - } - /* starting lives (for "test mode") */ - if (space.device().safe_pc() == 0x6a27) - { - m_getstar_cmd = 0x23; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x6a38) - { - m_getstar_cmd = 0x23; - GS_SAVE_REGS - } - break; - case GETSTARJ: - /* unknown effect - not read back */ - if (space.device().safe_pc() == 0x00bf) - { - m_getstar_cmd = 0x00; - GS_RESET_REGS - } - /* players inputs */ - if (space.device().safe_pc() == 0x0560) - { - m_getstar_cmd = 0x25; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x056d) - { - m_getstar_cmd = 0x25; - GS_SAVE_REGS - } - /* lose life */ - if (space.device().safe_pc() == 0x0ad5) - { - m_getstar_cmd = 0x21; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0ae2) - { - m_getstar_cmd = 0x21; - GS_SAVE_REGS - } - /* unknown effect */ - if (space.device().safe_pc() == 0x0b1c) - { - m_getstar_cmd = 0x29; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0b29) - { - m_getstar_cmd = 0x29; - GS_SAVE_REGS - } - /* continue play */ - if (space.device().safe_pc() == 0x0bae) - { - m_getstar_cmd = 0x20; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0bbb) - { - m_getstar_cmd = 0x20; - GS_SAVE_REGS - } - /* unknown effect - not read back */ - if (space.device().safe_pc() == 0x0c2d) - { - m_getstar_cmd = 0x00; /* 0x1f */ - GS_RESET_REGS - } - /* change player (if 2 players game) */ - if (space.device().safe_pc() == 0x0c76) - { - m_getstar_cmd = 0x2a; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0c83) - { - m_getstar_cmd = 0x2a; - GS_SAVE_REGS - } - /* game phase */ - if (space.device().safe_pc() == 0x0e02) - { - m_getstar_cmd = 0x24; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0e0f) - { - m_getstar_cmd = 0x24; - GS_SAVE_REGS - } - /* starting lives */ - if (space.device().safe_pc() == 0x0e44) - { - m_getstar_cmd = 0x23; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0e55) - { - m_getstar_cmd = 0x23; - GS_SAVE_REGS - } - /* starting difficulty */ - if (space.device().safe_pc() == 0x0e8c) - { - m_getstar_cmd = 0x22; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x0e9b) - { - m_getstar_cmd = 0x22; - GS_SAVE_REGS - } - /* starting lives (again) */ - if (space.device().safe_pc() == 0x10d6) - { - m_getstar_cmd = 0x23; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x10e3) - { - m_getstar_cmd = 0x23; - GS_SAVE_REGS - } - /* hardware test */ - if (space.device().safe_pc() == 0x113f) - { - m_getstar_cmd = 0x73; - GS_RESET_REGS - } - /* game phase (again) */ - if (space.device().safe_pc() == 0x118b) - { - m_getstar_cmd = 0x24; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x1198) - { - m_getstar_cmd = 0x24; - GS_SAVE_REGS - } - /* background */ - if (space.device().safe_pc() == 0x19f8) - { - m_getstar_cmd = 0x26; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x1a05) - { - m_getstar_cmd = 0x26; - GS_SAVE_REGS - } - /* foreground */ - if (space.device().safe_pc() == 0x1abd) - { - m_getstar_cmd = 0x37; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x1acc) - { - m_getstar_cmd = 0x37; - GS_SAVE_REGS - } - if (space.device().safe_pc() == 0x1ad9) - { - m_getstar_cmd = 0x37; - /* do NOT update the registers because there are 2 writes before 2 reads ! */ - } - /* laser position */ - if (space.device().safe_pc() == 0x2792) - { - m_getstar_cmd = 0x38; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x27a1) - { - m_getstar_cmd = 0x38; - GS_SAVE_REGS - } - if (space.device().safe_pc() == 0x27ae) - { - m_getstar_cmd = 0x38; - /* do NOT update the registers because there are 2 writes before 2 reads ! */ - } - /* starting lives (for "test mode") */ - if (space.device().safe_pc() == 0x6ae2) - { - m_getstar_cmd = 0x23; - GS_RESET_REGS - } - if (space.device().safe_pc() == 0x6af3) - { - m_getstar_cmd = 0x23; - GS_SAVE_REGS - } - break; case GETSTARB1: /* "Test mode" doesn't compute the lives value : 6ADA: 3E 23 ld a,$23 -- cgit v1.2.3