From 2d4370855a24850ccb906701821241ebe55e442b Mon Sep 17 00:00:00 2001 From: Barry Harris <44396066+barry65536@users.noreply.github.com> Date: Tue, 23 Oct 2018 19:12:27 +0100 Subject: [PATCH] Promote mtwinsb to working Move to fcrash.cpp, hook up scroll registers and other misc bits --- src/mame/drivers/cps1.cpp | 26 +------ src/mame/drivers/fcrash.cpp | 136 ++++++++++++++++++++++++++++++++++++ src/mame/includes/cps1.h | 6 ++ src/mame/mame.lst | 2 +- src/mame/video/cps1.cpp | 1 - 5 files changed, 144 insertions(+), 27 deletions(-) diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp index a104c6fd590..f9845ef0642 100644 --- a/src/mame/drivers/cps1.cpp +++ b/src/mame/drivers/cps1.cpp @@ -1602,7 +1602,7 @@ INPUT_PORTS_END - 0xff14ab.w : energy (player 1) - 0xff156b.w : energy (player 2) */ -static INPUT_PORTS_START( mtwins ) +INPUT_PORTS_START( mtwins ) PORT_INCLUDE( cps1_3b ) PORT_MODIFY("IN0") @@ -5874,29 +5874,6 @@ ROM_START( mtwins ) ROM_LOAD( "iob1.11e", 0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) ) ROM_END -ROM_START( mtwinsb ) // board marked MGT-026 - ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ - ROM_LOAD16_BYTE( "1-prg-27c4001.bin", 0x00001, 0x80000, CRC(8938a029) SHA1(50104d2afaec8d69d317780c071a4f2248e23e62) ) - ROM_LOAD16_BYTE( "2-prg-27c4001.bin", 0x00000, 0x80000, CRC(7d5b8a97) SHA1(d3e456061a569765d400fc7c9b43e4fdacf17951) ) - - ROM_REGION( 0x200000, "gfx", 0 ) // identical to the original, but differently arranged - ROMX_LOAD( "g4.bin", 0x000004, 0x40000, CRC(11493e55) SHA1(0e45f53b034d66ce8d029346d4d88e46021df1a7), ROM_SKIP(7) ) - ROM_CONTINUE( 0x000000, 0x40000) - ROMX_LOAD( "g3.bin", 0x000005, 0x40000, CRC(feda0f8b) SHA1(59c740478791ce95bf06feeda5173cc283a1eaea), ROM_SKIP(7) ) - ROM_CONTINUE( 0x000001, 0x40000) - ROMX_LOAD( "g2.bin", 0x000006, 0x40000, CRC(745f0eba) SHA1(1cb07be5df7cc43b5aa236f114d303bf92436c74), ROM_SKIP(7) ) - ROM_CONTINUE( 0x000002, 0x40000) - ROMX_LOAD( "g1.bin", 0x000007, 0x40000, CRC(8069026f) SHA1(3d5e9b36a349328bcd93d83d8d2fe3cd40e68a3b), ROM_SKIP(7) ) - ROM_CONTINUE( 0x000003, 0x40000) - - ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ - ROM_LOAD( "4-snd-z80-27c512.bin", 0x00000, 0x08000, CRC(4d4255b7) SHA1(81a76b58043af7252a854b7efc4109957ef0e679) ) // identical to the original - ROM_CONTINUE( 0x10000, 0x08000 ) - - ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ - ROM_LOAD( "3-snd-27c208.bin", 0x00000, 0x40000, CRC(a0c3de92) SHA1(5135cd982564f898f799ff1bc2bb2a75154be0cd) ) // identical to the original, but one single bigger ROM -ROM_END - /* B-Board 89625B-1 */ ROM_START( chikij ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ @@ -13105,7 +13082,6 @@ GAME( 1990, mercsur1, mercs, cps1_10MHz, mercs, cps_state, init_cps1, GAME( 1990, mercsj, mercs, cps1_10MHz, mercs, cps_state, init_cps1, ROT270, "Capcom", "Senjou no Ookami II (Japan 900302)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, mtwins, 0, cps1_10MHz, mtwins, cps_state, init_cps1, ROT0, "Capcom", "Mega Twins (World 900619)", MACHINE_SUPPORTS_SAVE ) // "ETC" - (c) Capcom U.S.A. but World "warning" GAME( 1990, chikij, mtwins, cps1_10MHz, mtwins, cps_state, init_cps1, ROT0, "Capcom", "Chiki Chiki Boys (Japan 900619)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, mtwinsb, mtwins, cps1_10MHz, mtwins, cps_state, init_cps1, ROT0, "Capcom", "Mega Twins (bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // severe GFX problems due to different bootleg hardware GAME( 1990, msword, 0, cps1_10MHz, msword, cps_state, init_cps1, ROT0, "Capcom", "Magic Sword: Heroic Fantasy (World 900725)", MACHINE_SUPPORTS_SAVE ) // 25.07.1990 "OTHER COUNTRY" GAME( 1990, mswordr1, msword, cps1_10MHz, msword, cps_state, init_cps1, ROT0, "Capcom", "Magic Sword: Heroic Fantasy (World 900623)", MACHINE_SUPPORTS_SAVE ) // 23.06.1990 "OTHER COUNTRY" GAME( 1990, mswordu, msword, cps1_10MHz, msword, cps_state, init_cps1, ROT0, "Capcom", "Magic Sword: Heroic Fantasy (USA 900725)", MACHINE_SUPPORTS_SAVE ) // 25.07.1990 "U.S.A." diff --git a/src/mame/drivers/fcrash.cpp b/src/mame/drivers/fcrash.cpp index 97d98393e6b..ee13dc22be2 100644 --- a/src/mame/drivers/fcrash.cpp +++ b/src/mame/drivers/fcrash.cpp @@ -277,6 +277,37 @@ WRITE16_MEMBER(cps_state::knightsb_layer_w) } } +WRITE16_MEMBER(cps_state::mtwinsb_layer_w) +{ + m_cps_a_regs[0x06 / 2] = 0x9100; // bit of a hack - the game never writes this, but does need it + + switch (offset) + { + case 0x00: + m_cps_a_regs[0x0e / 2] = data; + break; + case 0x01: + m_cps_a_regs[0x0c / 2] = data - 0x3e; + break; + case 0x02: + m_cps_a_regs[0x12 / 2] = data; + m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */ + break; + case 0x03: + m_cps_a_regs[0x10 / 2] = data - 0x3c; + break; + case 0x04: + m_cps_a_regs[0x16 / 2] = data; + break; + case 0x05: + m_cps_a_regs[0x14 / 2] = data - 0x40; + break; + default: + logerror("%s: Unknown layer cmd %X %X\n",machine().describe_context(),offset<<1,data); + + } +} + WRITE16_MEMBER(cps_state::punipic_layer_w) { switch (offset) @@ -718,6 +749,20 @@ void cps_state::fcrash_map(address_map &map) map(0xff0000, 0xffffff).ram(); } +void cps_state::mtwinsb_map(address_map &map) +{ + map(0x000000, 0x3fffff).rom(); + map(0x800000, 0x800001).portr("IN1"); + map(0x800006, 0x800007).w(FUNC(cps_state::cps1_soundlatch_w)); + map(0x800018, 0x80001f).r(FUNC(cps_state::cps1_dsw_r)); + map(0x800030, 0x800037).w(FUNC(cps_state::cps1_coinctrl_w)); + map(0x800100, 0x80013f).w(FUNC(cps_state::cps1_cps_a_w)).share("cps_a_regs"); + map(0x800140, 0x80017f).rw(FUNC(cps_state::cps1_cps_b_r), FUNC(cps_state::cps1_cps_b_w)).share("cps_b_regs"); + map(0x980000, 0x98000b).w(FUNC(cps_state::mtwinsb_layer_w)); + map(0x900000, 0x92ffff).ram().w(FUNC(cps_state::cps1_gfxram_w)).share("gfxram"); + map(0xff0000, 0xffffff).ram().share("mainram"); +} + void cps_state::punipic_map(address_map &map) { map(0x000000, 0x3fffff).rom(); @@ -1530,6 +1575,21 @@ MACHINE_START_MEMBER(cps_state,kodb) m_sprite_x_offset = 0; } +MACHINE_START_MEMBER(cps_state, mtwinsb) +{ + m_layer_enable_reg = 0x12; + m_layer_mask_reg[0] = 0x14; + m_layer_mask_reg[1] = 0x16; + m_layer_mask_reg[2] = 0x18; + m_layer_mask_reg[3] = 0x1a; + m_layer_scroll1x_offset = 0x00; + m_layer_scroll2x_offset = 0x00; + m_layer_scroll3x_offset = 0x00; + m_sprite_base = 0x1000; + m_sprite_list_end_marker = 0x8000; + m_sprite_x_offset = 0; +} + MACHINE_START_MEMBER(cps_state, cawingbl) { MACHINE_START_CALL_MEMBER(fcrash); @@ -1720,6 +1780,47 @@ MACHINE_CONFIG_START(cps_state::kodb) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) MACHINE_CONFIG_END +MACHINE_CONFIG_START(cps_state::mtwinsb) + + /* basic machine hardware */ + MCFG_DEVICE_ADD("maincpu", M68000, 10000000) + MCFG_DEVICE_PROGRAM_MAP(mtwinsb_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cps_state, cps1_interrupt) + MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(cps_state, cps1_int_ack) + + MCFG_DEVICE_ADD("audiocpu", Z80, 3579545) + MCFG_DEVICE_PROGRAM_MAP(sgyxz_sound_map) + + MCFG_MACHINE_START_OVERRIDE(cps_state, mtwinsb) + + /* video hardware */ + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(60) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) + MCFG_SCREEN_SIZE(64*8, 32*8) + MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 ) + MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_fcrash) + MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, cps_state, screen_vblank_cps1)) + MCFG_SCREEN_PALETTE("palette") + + MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_cps1) + MCFG_PALETTE_ADD("palette", 0xc00) + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_8_ADD("soundlatch2") + + MCFG_DEVICE_ADD("2151", YM2151, XTAL(3'579'545)) + MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) + MCFG_SOUND_ROUTE(0, "mono", 0.35) + MCFG_SOUND_ROUTE(1, "mono", 0.35) + + MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(16'000'000)/4/4, okim6295_device::PIN7_HIGH) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) +MACHINE_CONFIG_END + MACHINE_CONFIG_START(cps_state::sf2mdt) /* basic machine hardware */ @@ -2306,6 +2407,38 @@ void cps_state::init_dinopic() } +// ************************************************************************* MTWINSB + +ROM_START( mtwinsb ) // board marked MGT-026 + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "1-prg-27c4001.bin", 0x00001, 0x80000, CRC(8938a029) SHA1(50104d2afaec8d69d317780c071a4f2248e23e62) ) + ROM_LOAD16_BYTE( "2-prg-27c4001.bin", 0x00000, 0x80000, CRC(7d5b8a97) SHA1(d3e456061a569765d400fc7c9b43e4fdacf17951) ) + + ROM_REGION( 0x200000, "gfx", 0 ) // identical to the original, but differently arranged + ROMX_LOAD( "g4.bin", 0x000004, 0x40000, CRC(11493e55) SHA1(0e45f53b034d66ce8d029346d4d88e46021df1a7), ROM_SKIP(7) ) + ROM_CONTINUE( 0x000000, 0x40000) + ROMX_LOAD( "g3.bin", 0x000005, 0x40000, CRC(feda0f8b) SHA1(59c740478791ce95bf06feeda5173cc283a1eaea), ROM_SKIP(7) ) + ROM_CONTINUE( 0x000001, 0x40000) + ROMX_LOAD( "g2.bin", 0x000006, 0x40000, CRC(745f0eba) SHA1(1cb07be5df7cc43b5aa236f114d303bf92436c74), ROM_SKIP(7) ) + ROM_CONTINUE( 0x000002, 0x40000) + ROMX_LOAD( "g1.bin", 0x000007, 0x40000, CRC(8069026f) SHA1(3d5e9b36a349328bcd93d83d8d2fe3cd40e68a3b), ROM_SKIP(7) ) + ROM_CONTINUE( 0x000003, 0x40000) + + ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ + ROM_LOAD( "4-snd-z80-27c512.bin", 0x00000, 0x08000, CRC(4d4255b7) SHA1(81a76b58043af7252a854b7efc4109957ef0e679) ) // identical to the original + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ + ROM_LOAD( "3-snd-27c208.bin", 0x00000, 0x40000, CRC(a0c3de92) SHA1(5135cd982564f898f799ff1bc2bb2a75154be0cd) ) // identical to the original, but one single bigger ROM +ROM_END + +void cps_state::init_mtwinsb() +{ + m_bootleg_sprite_ram = std::make_unique(0x2000); + m_maincpu->space(AS_PROGRAM).install_ram(0x990000, 0x993fff, m_bootleg_sprite_ram.get()); + init_cps1(); +} + // ************************************************************************* SGYXZ @@ -3195,8 +3328,11 @@ GAME( 1990, ffightbl, ffight, fcrash, fcrash, cps_state, init_cps1, GAME( 1990, ffightbla, ffight, fcrash, fcrash, cps_state, init_cps1, ROT0, "bootleg", "Final Fight (bootleg on Final Crash PCB)", MACHINE_SUPPORTS_SAVE ) // same as Final Crash without the modified gfx GAME( 1991, kodb, kod, kodb, kodb, cps_state, init_kodb, ROT0, "bootleg (Playmark)", "The King of Dragons (bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // 910731 "ETC" + GAME( 1991, knightsb, knights, knightsb, knights, cps_state, init_dinopic, ROT0, "bootleg", "Knights of the Round (bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // 911127 - based on World version +GAME( 1993, mtwinsb, mtwins, mtwinsb, mtwins, cps_state, init_mtwinsb, ROT0, "David Inc. (bootleg)", "Twins (Mega Twins bootleg)", MACHINE_SUPPORTS_SAVE ) // based on World version + GAME( 1993, punipic, punisher, punipic, punisher, cps_state, init_punipic, ROT0, "bootleg", "The Punisher (bootleg with PIC16c57, set 1)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930422 ETC GAME( 1993, punipic2, punisher, punipic, punisher, cps_state, init_punipic, ROT0, "bootleg", "The Punisher (bootleg with PIC16c57, set 2)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930422 ETC GAME( 1993, punipic3, punisher, punipic, punisher, cps_state, init_punipic3, ROT0, "bootleg", "The Punisher (bootleg with PIC16c57, set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930422 ETC diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h index 1870b3aec3b..70a8d5e9a8c 100644 --- a/src/mame/includes/cps1.h +++ b/src/mame/includes/cps1.h @@ -206,6 +206,7 @@ public: void init_cawingbl(); void init_dinopic(); void init_knightsb(); + void init_mtwinsb(); void init_punipic(); void init_punipic3(); void init_sf2m1(); @@ -221,6 +222,7 @@ public: DECLARE_MACHINE_START(dinopic); DECLARE_MACHINE_START(knightsb); DECLARE_MACHINE_START(kodb); + DECLARE_MACHINE_START(mtwinsb); DECLARE_MACHINE_START(punipic); DECLARE_MACHINE_START(sf2mdt); DECLARE_MACHINE_START(slampic); @@ -230,6 +232,7 @@ public: DECLARE_WRITE16_MEMBER(dinopic_layer2_w); DECLARE_WRITE16_MEMBER(knightsb_layer_w); DECLARE_WRITE16_MEMBER(kodb_layer_w); + DECLARE_WRITE16_MEMBER(mtwinsb_layer_w); DECLARE_WRITE16_MEMBER(punipic_layer_w); DECLARE_WRITE16_MEMBER(sf2mdt_layer_w); DECLARE_WRITE16_MEMBER(sf2mdta_layer_w); @@ -269,6 +272,7 @@ public: void sf2mdt(machine_config &config); void sf2m1(machine_config &config); void kodb(machine_config &config); + void mtwinsb(machine_config &config); void varthb(machine_config &config); void sgyxz(machine_config &config); void wofabl(machine_config &config); @@ -295,6 +299,7 @@ public: void knightsb_z80map(address_map &map); void kodb_sound_map(address_map &map); void main_map(address_map &map); + void mtwinsb_map(address_map &map); void punipic_map(address_map &map); void qsound_decrypted_opcodes_map(address_map &map); void qsound_main_map(address_map &map); @@ -508,6 +513,7 @@ extern gfx_decode_entry const gfx_cps1[]; INPUT_PORTS_EXTERN( dino ); INPUT_PORTS_EXTERN( knights ); +INPUT_PORTS_EXTERN( mtwins ); INPUT_PORTS_EXTERN( punisher ); INPUT_PORTS_EXTERN( sf2 ); INPUT_PORTS_EXTERN( slammast ); diff --git a/src/mame/mame.lst b/src/mame/mame.lst index c3eca005d36..d0afdc0c492 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -10181,7 +10181,6 @@ mswordj // 23/06/1990 (c) 1990 (Japan) mswordr1 // 23/06/1990 (c) 1990 (World) mswordu // 25/07/1990 (c) 1990 (USA) mtwins // 19/06/1990 (c) 1990 (World) -mtwinsb // bootleg nemo // 30/11/1990 (c) 1990 (World) nemoj // 20/11/1990 (c) 1990 (Japan) nemor1 // 09/11/1990 (c) 1990 (World) @@ -12733,6 +12732,7 @@ ffightbl // bootleg ffightbla // bootleg knightsb // bootleg kodb // bootleg +mtwinsb // bootleg punipic // bootleg punipic2 // bootleg punipic3 // bootleg diff --git a/src/mame/video/cps1.cpp b/src/mame/video/cps1.cpp index a6df5578acb..485aa610a23 100644 --- a/src/mame/video/cps1.cpp +++ b/src/mame/video/cps1.cpp @@ -1462,7 +1462,6 @@ static const struct CPS1config cps1_config_table[]= {"mswordj", CPS_B_13, mapper_MS24B }, // wrong, this set uses MS22B, dumped but equations still not added {"mtwins", CPS_B_14, mapper_CK24B }, {"chikij", CPS_B_14, mapper_CK24B }, // wrong, this set uses CK22B, dumped but equations still not added - {"mtwinsb", CPS_B_14, mapper_CK24B }, // wrong, bootleg hardware {"nemo", CPS_B_15, mapper_NM24B }, {"nemor1", CPS_B_15, mapper_NM24B }, {"nemoj", CPS_B_15, mapper_NM24B }, // wrong, this set uses NM22B, still not dumped