diff options
Diffstat (limited to 'src/mame/drivers/snesb.cpp')
-rw-r--r-- | src/mame/drivers/snesb.cpp | 147 |
1 files changed, 32 insertions, 115 deletions
diff --git a/src/mame/drivers/snesb.cpp b/src/mame/drivers/snesb.cpp index e26162aadc8..376ccaa3095 100644 --- a/src/mame/drivers/snesb.cpp +++ b/src/mame/drivers/snesb.cpp @@ -15,7 +15,6 @@ - Gundam Wing: Endless Duel - Legend - Rushing Beat - - Venom & Spider-Man - Separation Anxiety Not dumped: - Final Fight 3 @@ -23,15 +22,14 @@ TODO: - all games : (re)add PORT_DIPLOCATION - - kinstb : fix gfx glitches, missing texts + - kiinstb : fix gfx glitches, missing texts - ffight2b : remove hack for starting credits (RAM - mainly 0x7eadce where credits are stored - is filled with 0x55, so you are awarded 55 credits on a hard reset) - sblast2b : dipswitches - sblast2b : pressing start during gameplay changes the character used. Intentional? - - denseib,2: fix gfx glitches, missing texts + - denseib : fix gfx glitches, missing texts - legendsb : dipswitches - rushbets : everything - - venom : gfx glitches on second level *************************************************************************** @@ -169,7 +167,6 @@ public: void init_iron(); void init_denseib(); - void init_denseib2(); void init_kinstb(); void init_sblast2b(); void init_ffight2b(); @@ -759,23 +756,23 @@ static INPUT_PORTS_START( venom ) PORT_BIT( 0x000f, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -void snesb_state::kinstb(machine_config &config) -{ +MACHINE_CONFIG_START(snesb_state::kinstb) + /* basic machine hardware */ - _5A22(config, m_maincpu, 3580000*6); /* 2.68Mhz, also 3.58Mhz */ - m_maincpu->set_addrmap(AS_PROGRAM, &snesb_state::snesb_map); + MCFG_DEVICE_ADD("maincpu", _5A22, 3580000*6) /* 2.68Mhz, also 3.58Mhz */ + MCFG_DEVICE_PROGRAM_MAP(snesb_map) /* audio CPU */ // runs at 24.576 MHz / 12 = 2.048 MHz - SPC700(config, m_soundcpu, XTAL(24'576'000) / 12); - m_soundcpu->set_addrmap(AS_PROGRAM, &snesb_state::spc_mem); + MCFG_DEVICE_ADD("soundcpu", SPC700, XTAL(24'576'000) / 12) + MCFG_DEVICE_PROGRAM_MAP(spc_mem) - config.m_perfect_cpu_quantum = subtag("maincpu"); + MCFG_QUANTUM_PERFECT_CPU("maincpu") /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(DOTCLK_NTSC, SNES_HTOTAL, 0, SNES_SCR_WIDTH, SNES_VTOTAL_NTSC, 0, SNES_SCR_HEIGHT_NTSC); - m_screen->set_screen_update(FUNC(snes_state::screen_update)); + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_RAW_PARAMS(DOTCLK_NTSC, SNES_HTOTAL, 0, SNES_SCR_WIDTH, SNES_VTOTAL_NTSC, 0, SNES_SCR_HEIGHT_NTSC) + MCFG_SCREEN_UPDATE_DRIVER( snes_state, screen_update ) SNES_PPU(config, m_ppu, MCLK_NTSC); m_ppu->open_bus_callback().set([this] { return snes_open_bus_r(); }); // lambda because overloaded function name @@ -784,23 +781,22 @@ void snesb_state::kinstb(machine_config &config) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - SNES_SOUND(config, m_spc700); - m_spc700->add_route(0, "lspeaker", 1.00); - m_spc700->add_route(1, "rspeaker", 1.00); -} + MCFG_DEVICE_ADD("spc700", SNES_SOUND) + MCFG_SOUND_ROUTE(0, "lspeaker", 1.00) + MCFG_SOUND_ROUTE(1, "rspeaker", 1.00) +MACHINE_CONFIG_END void snesb_state::mcu_io_map(address_map &map) { } -void snesb_state::mk3snes(machine_config &config) -{ +MACHINE_CONFIG_START(snesb_state::mk3snes) kinstb(config); - i8751_device &mcu(I8751(config, "mcu", XTAL(8'000'000))); - mcu.set_addrmap(AS_IO, &snesb_state::mcu_io_map); -} + MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000)) + MCFG_DEVICE_IO_MAP(mcu_io_map) +MACHINE_CONFIG_END MACHINE_RESET_MEMBER( snesb_state, ffight2b ) @@ -812,11 +808,10 @@ MACHINE_RESET_MEMBER( snesb_state, ffight2b ) cpu0space.write_byte(0x7eadce, 0x00); } -void snesb_state::ffight2b(machine_config &config) -{ +MACHINE_CONFIG_START(snesb_state::ffight2b) kinstb(config); MCFG_MACHINE_RESET_OVERRIDE( snesb_state, ffight2b ) -} +MACHINE_CONFIG_END void snesb_state::init_kinstb() { @@ -939,68 +934,6 @@ void snesb_state::init_denseib() init_snes_hirom(); } -void snesb_state::init_denseib2() -{ - uint8_t *src = memregion("user7")->base(); - uint8_t *dst = memregion("user3")->base(); - - static const uint8_t address_tab_high[0x40] = { - 0x0b, 0x1d, 0x05, 0x15, 0x09, 0x19, 0x04, 0x13, 0x02, 0x1f, 0x07, 0x17, 0x0d, 0x11, 0x0a, 0x1a, - 0x14, 0x0e, 0x18, 0x06, 0x1e, 0x01, 0x10, 0x0c, 0x1b, 0x0f, 0x16, 0x00, 0x12, 0x08, 0x1c, 0x03, - 0x2b, 0x3d, 0x25, 0x35, 0x29, 0x39, 0x24, 0x33, 0x22, 0x3f, 0x27, 0x37, 0x2d, 0x31, 0x2a, 0x3a, - 0x34, 0x2e, 0x38, 0x26, 0x3e, 0x21, 0x30, 0x2c, 0x3b, 0x2f, 0x36, 0x20, 0x32, 0x28, 0x3c, 0x23 - }; - - static const uint8_t address_tab_low[0x40] = { - 0x14, 0x1d, 0x11, 0x3c, 0x0a, 0x29, 0x2d, 0x2e, 0x30, 0x32, 0x16, 0x36, 0x05, 0x25, 0x26, 0x37, - 0x20, 0x21, 0x27, 0x28, 0x33, 0x34, 0x23, 0x12, 0x1e, 0x1f, 0x3b, 0x24, 0x2c, 0x35, 0x38, 0x39, - 0x3d, 0x0c, 0x2a, 0x0d, 0x22, 0x18, 0x19, 0x1a, 0x03, 0x08, 0x04, 0x3a, 0x0b, 0x0f, 0x15, 0x17, - 0x1b, 0x13, 0x00, 0x1c, 0x2b, 0x01, 0x06, 0x2f, 0x07, 0x09, 0x02, 0x31, 0x10, 0x0e, 0x3f, 0x3e - }; - - static const uint8_t data_high[16] = { - 0x03, 0x04, 0x85, 0x01, 0x81, 0x87, 0x07, 0x05, 0x86, 0x00, 0x02, 0x82, 0x84, 0x83, 0x06, 0x80 - }; - - static const uint8_t data_low[16] = { - 0x30, 0x40, 0x58, 0x10, 0x18, 0x78, 0x70, 0x50, 0x68, 0x00, 0x20, 0x28, 0x48, 0x38, 0x60, 0x08 - }; - - for (int i = 0; i < 0x200000; i++) - { - int j = (address_tab_high[i >> 15] << 15) + (i & 0x7fc0) + address_tab_low[i & 0x3f]; - - dst[i] = data_high[src[j]>>4] | data_low[src[j]&0xf]; - - if (i >= 0x00000 && i < 0x10000) { - dst[i] = bitswap<8>(dst[i],2,1,3,0,7,4,5,6) ^ 0xff; - } - - if (i >= 0x10000 && i < 0x20000) { - dst[i] = bitswap<8>(dst[i],1,7,4,5,6,0,3,2); - } - - if (i >= 0x20000 && i < 0x30000) { - dst[i] = bitswap<8>(dst[i],0,2,6,7,5,3,4,1) ^ 0xff; - } - - if (i >= 0x30000 && i < 0x40000) { - dst[i] = bitswap<8>(dst[i],6,5,0,3,1,7,2,4) ^ 0xff; - } - } - - /* boot vector */ - dst[0xfffc] = 0x40; - dst[0xfffd] = 0xf7; - - /* extra inputs */ - m_maincpu->space(AS_PROGRAM).install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); - - init_snes_hirom(); -} - void snesb_state::init_legendsb() { u8 *rom = memregion("user3")->base(); @@ -1419,21 +1352,6 @@ ROM_START( denseib ) ROM_REGION(0x800, "user6", ROMREGION_ERASEFF) ROM_END -ROM_START( denseib2 ) - ROM_REGION( 0x200000, "user3", ROMREGION_ERASEFF ) - - ROM_REGION(0x100, "sound_ipl", 0) - ROM_LOAD("spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) - - ROM_REGION(0x800, "user6", ROMREGION_ERASEFF) - - ROM_REGION( 0x200000, "user7", 0 ) - ROM_LOAD( "u31.bin", 0x000000, 0x080000, CRC(834723a8) SHA1(3f56bba5017f77147e7d52618678f1e2eff4991b) ) - ROM_LOAD( "u32.bin", 0x080000, 0x080000, CRC(9748e86b) SHA1(68a62e0961d735602ae6ebd1aca5990c588ccbb1) ) - ROM_LOAD( "u33.bin", 0x100000, 0x080000, CRC(abcc6b61) SHA1(ef90f23b674f6dd36b3d60c9c395a1d4bc853798) ) - ROM_LOAD( "u34.bin", 0x180000, 0x080000, CRC(0a16ac96) SHA1(ddc11009d4b35a151aa7e357346f3ac109e112ef) ) -ROM_END - ROM_START( sblast2b ) ROM_REGION( 0x180000, "user3", ROMREGION_ERASEFF ) @@ -1537,14 +1455,13 @@ ROM_START( venom ) ROM_LOAD( "u34.bin", 0x280000, 0x0080000, CRC(7a09c9e0) SHA1(794965d5501ec0e21f1f3a8cb8fd66f913d42760) ) ROM_END -GAME( 199?, kinstb, 0, kinstb, kinstb, snesb_state, init_kinstb, ROT0, "bootleg", "Killer Instinct (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 199?, mk3snes, 0, mk3snes, kinstb, snesb_state, init_mk3snes, ROT0, "bootleg", "Mortal Kombat 3 (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, ffight2b, 0, ffight2b, ffight2b, snesb_state, init_ffight2b, ROT0, "bootleg", "Final Fight 2 (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, iron, 0, kinstb, iron, snesb_state, init_iron, ROT0, "bootleg", "Iron (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, denseib, 0, kinstb, denseib, snesb_state, init_denseib, ROT0, "bootleg", "Ghost Chaser Densei (SNES bootleg, set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, denseib2, denseib, kinstb, denseib, snesb_state, init_denseib2, ROT0, "bootleg", "Ghost Chaser Densei (SNES bootleg, set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1997, sblast2b, 0, kinstb, sblast2b, snesb_state, init_sblast2b, ROT0, "bootleg", "Sonic Blast Man 2 Special Turbo (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS) -GAME( 1996, endless, 0, kinstb, endless, snesb_state, init_endless, ROT0, "bootleg", "Gundam Wing: Endless Duel (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, legendsb, 0, kinstb, kinstb, snesb_state, init_legendsb, ROT0, "bootleg", "Legend (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1997, rushbets, 0, kinstb, kinstb, snesb_state, init_rushbets, ROT0, "bootleg", "Rushing Beat Shura (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1997, venom, 0, kinstb, venom, snesb_state, init_venom, ROT0, "bootleg", "Venom & Spider-Man - Separation Anxiety (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 199?, kinstb, 0, kinstb, kinstb, snesb_state, init_kinstb, ROT0, "bootleg", "Killer Instinct (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 199?, mk3snes, 0, mk3snes, kinstb, snesb_state, init_mk3snes, ROT0, "bootleg", "Mortal Kombat 3 (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, ffight2b, 0, ffight2b, ffight2b, snesb_state, init_ffight2b, ROT0, "bootleg", "Final Fight 2 (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, iron, 0, kinstb, iron, snesb_state, init_iron, ROT0, "bootleg", "Iron (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, denseib, 0, kinstb, denseib, snesb_state, init_denseib, ROT0, "bootleg", "Ghost Chaser Densei (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, sblast2b, 0, kinstb, sblast2b, snesb_state, init_sblast2b, ROT0, "bootleg", "Sonic Blast Man 2 Special Turbo (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS) +GAME( 1996, endless, 0, kinstb, endless, snesb_state, init_endless, ROT0, "bootleg", "Gundam Wing: Endless Duel (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, legendsb, 0, kinstb, kinstb, snesb_state, init_legendsb, ROT0, "bootleg", "Legend (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, rushbets, 0, kinstb, kinstb, snesb_state, init_rushbets, ROT0, "bootleg", "Rushing Beat Shura (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, venom, 0, kinstb, venom, snesb_state, init_venom, ROT0, "bootleg", "Venom & Spider-Man - Separation Anxiety (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) |