From cfff2779062858ab2a4eda232e5532342f247e61 Mon Sep 17 00:00:00 2001 From: Tom <37988779+TwistedTom@users.noreply.github.com> Date: Tue, 14 Apr 2020 14:17:40 +0100 Subject: [PATCH] New neogeo bootleg (#6547) * added mslug5b * fix gfx/c + samples/v --- src/devices/bus/neogeo/boot_misc.cpp | 19 ++++++++++++ src/devices/bus/neogeo/boot_misc.h | 16 ++++++++++ src/devices/bus/neogeo/carts.cpp | 1 + src/devices/bus/neogeo/prot_misc.cpp | 28 +++++++++++++++++ src/devices/bus/neogeo/prot_misc.h | 5 +++- src/devices/bus/neogeo/slot.cpp | 1 + src/devices/bus/neogeo/slot.h | 1 + src/mame/drivers/neogeo.cpp | 45 +++++++++++++++++++++++++++- src/mame/mame.lst | 1 + 9 files changed, 115 insertions(+), 2 deletions(-) diff --git a/src/devices/bus/neogeo/boot_misc.cpp b/src/devices/bus/neogeo/boot_misc.cpp index b544fa93976..7adc89519e4 100644 --- a/src/devices/bus/neogeo/boot_misc.cpp +++ b/src/devices/bus/neogeo/boot_misc.cpp @@ -244,6 +244,25 @@ void neogeo_ms5plus_cart_device::device_add_mconfig(machine_config &config) } +/************************************************* + mslug5b + **************************************************/ + +DEFINE_DEVICE_TYPE(NEOGEO_MSLUG5B_CART, neogeo_mslug5b_cart_device, "neocart_mslug5b", "Neo Geo Metal Slug 5 Bootleg Cart") + +neogeo_mslug5b_cart_device::neogeo_mslug5b_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + neogeo_bootleg_cart_device(mconfig, NEOGEO_MSLUG5B_CART, tag, owner, clock) +{ +} + +void neogeo_mslug5b_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) +{ + m_prot->mslug5b_vx_decrypt(ym_region, ym_region_size); + m_prot->sx_decrypt(fix_region, fix_region_size, 2); + m_prot->mslug5b_cx_decrypt(spr_region, spr_region_size); +} + + /************************************************* kog **************************************************/ diff --git a/src/devices/bus/neogeo/boot_misc.h b/src/devices/bus/neogeo/boot_misc.h index 4943f64583b..d46bca46d51 100644 --- a/src/devices/bus/neogeo/boot_misc.h +++ b/src/devices/bus/neogeo/boot_misc.h @@ -161,6 +161,7 @@ private: DECLARE_DEVICE_TYPE(NEOGEO_MSLUG3B6_CART, neogeo_mslug3b6_cart_device) + /************************************************* ms5plus **************************************************/ @@ -186,6 +187,21 @@ private: DECLARE_DEVICE_TYPE(NEOGEO_MS5PLUS_CART, neogeo_ms5plus_cart_device) +/************************************************* + mslug5b + **************************************************/ + +class neogeo_mslug5b_cart_device : public neogeo_bootleg_cart_device +{ +public: + neogeo_mslug5b_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; + virtual int get_fixed_bank_type() override { return 0; } +}; + +DECLARE_DEVICE_TYPE(NEOGEO_MSLUG5B_CART, neogeo_mslug5b_cart_device) + + /************************************************* kog **************************************************/ diff --git a/src/devices/bus/neogeo/carts.cpp b/src/devices/bus/neogeo/carts.cpp index 94fbb70c34e..854a2248ae8 100644 --- a/src/devices/bus/neogeo/carts.cpp +++ b/src/devices/bus/neogeo/carts.cpp @@ -109,6 +109,7 @@ void neogeo_cart(device_slot_interface &device) device.option_add_internal("boot_samsho5b", NEOGEO_SAMSHO5B_CART); device.option_add_internal("boot_mslug3b6", NEOGEO_MSLUG3B6_CART); // this also uses a CMC42 for gfx device.option_add_internal("boot_ms5plus", NEOGEO_MS5PLUS_CART); // this also uses a CMC50 for gfx + audiocpu & NEOPCM2 for YM scramble + device.option_add_internal("boot_mslug5b", NEOGEO_MSLUG5B_CART); device.option_add_internal("boot_kog", NEOGEO_KOG_CART); device.option_add_internal("boot_kf10th", NEOGEO_KOF10TH_CART); diff --git a/src/devices/bus/neogeo/prot_misc.cpp b/src/devices/bus/neogeo/prot_misc.cpp index d145b78cdfb..a4fb1a0a4c4 100644 --- a/src/devices/bus/neogeo/prot_misc.cpp +++ b/src/devices/bus/neogeo/prot_misc.cpp @@ -304,6 +304,34 @@ uint32_t neoboot_prot_device::mslug5p_bank_base(uint16_t sel) } +/* Metal Slug 5 (bootleg) */ + +void neoboot_prot_device::mslug5b_vx_decrypt(uint8_t* ymsndrom, uint32_t ymsndrom_size) +{ + // only odd bytes are scrambled + int ym_size = ymsndrom_size; + uint8_t *rom = ymsndrom; + for (int i = 1; i < ym_size; i += 2) + rom[i] = bitswap<8>(rom[i], 3, 2, 4, 1, 5, 0, 6, 7); +} + +void neoboot_prot_device::mslug5b_cx_decrypt(uint8_t* sprrom, uint32_t sprrom_size) +{ + // rom a18/a19 lines are swapped + int cx_size = sprrom_size; + uint8_t *rom = sprrom; + std::vector buf(cx_size); + + memcpy(&buf[0], rom, cx_size); + + for (int i = 1; i < 128; i += 4) + { + memcpy(&rom[i * 0x80000], &buf[(i + 1) * 0x80000], 0x80000); + memcpy(&rom[(i + 1) * 0x80000], &buf[i * 0x80000], 0x80000); + } +} + + /* The King of Gladiator (The King of Fighters '97 bootleg) */ // The protection patching here may be incomplete - Thanks to Razoola for the info diff --git a/src/devices/bus/neogeo/prot_misc.h b/src/devices/bus/neogeo/prot_misc.h index e1525fc44f6..7005891be97 100644 --- a/src/devices/bus/neogeo/prot_misc.h +++ b/src/devices/bus/neogeo/prot_misc.h @@ -37,11 +37,14 @@ public: DECLARE_READ16_MEMBER(mslug5p_prot_r); //DECLARE_WRITE16_MEMBER(ms5plus_bankswitch_w); uint32_t mslug5p_bank_base(uint16_t sel); + + void mslug5b_vx_decrypt(uint8_t* ymsndrom, uint32_t ymsndrom_size); + void mslug5b_cx_decrypt(uint8_t* sprrom, uint32_t sprrom_size); void kog_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); void svcboot_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); - void svcboot_cx_decrypt(uint8_t*sprrom, uint32_t sprrom_size); + void svcboot_cx_decrypt(uint8_t* sprrom, uint32_t sprrom_size); void svcplus_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); void svcplus_px_hack(uint8_t* cpurom, uint32_t cpurom_size); void svcplusa_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); diff --git a/src/devices/bus/neogeo/slot.cpp b/src/devices/bus/neogeo/slot.cpp index a15fb9eab5d..b3b4ea4baa9 100644 --- a/src/devices/bus/neogeo/slot.cpp +++ b/src/devices/bus/neogeo/slot.cpp @@ -196,6 +196,7 @@ static const neogeo_slot slot_list[] = { NEOGEO_SAMSHO5B, "boot_samsho5b" }, { NEOGEO_MSLUG3B6, "boot_mslug3b6" }, { NEOGEO_MSLUG5P, "boot_ms5plus" }, + { NEOGEO_MSLUG5B, "boot_mslug5b" }, { NEOGEO_KOG, "boot_kog" }, { NEOGEO_SBP, "boot_sbp" }, { NEOGEO_KOF10TH, "boot_kf10th" }, diff --git a/src/devices/bus/neogeo/slot.h b/src/devices/bus/neogeo/slot.h index b52f0454145..b528d6f3005 100644 --- a/src/devices/bus/neogeo/slot.h +++ b/src/devices/bus/neogeo/slot.h @@ -68,6 +68,7 @@ enum NEOGEO_SAMSHO5B, NEOGEO_MSLUG3B6, NEOGEO_MSLUG5P, + NEOGEO_MSLUG5B, NEOGEO_KOG, NEOGEO_SBP, NEOGEO_KOF10TH, diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp index 5e5503bc002..c3bfe5991cc 100644 --- a/src/mame/drivers/neogeo.cpp +++ b/src/mame/drivers/neogeo.cpp @@ -643,6 +643,7 @@ public: void kof2k4se(machine_config &config); void mslug5(machine_config &config); void ms5plus(machine_config &config); + void mslug5b(machine_config &config); void svc(machine_config &config); void svcboot(machine_config &config); void svcplus(machine_config &config); @@ -2654,6 +2655,12 @@ void mvs_led_state::ms5plus(machine_config &config) cartslot_fixed(config, "boot_ms5plus"); } +void mvs_led_state::mslug5b(machine_config &config) +{ + mv1_fixed(config); + cartslot_fixed(config, "boot_mslug5b"); +} + void mvs_led_state::svc(machine_config &config) { mv1_fixed(config); @@ -11010,7 +11017,7 @@ ROM_START( matrimbl ) ROM_LOAD16_BYTE( "mart-c8.bin", 0x3000001, 0x800000, CRC(906cf267) SHA1(b0f2cf8887794d715f208751ddd1ed26b2c3ffdf) ) /* Plane 2,3 */ ROM_END -/* Metal Slug 5 bootleg */ +/* Metal Slug 5 bootlegs */ ROM_START( ms5plus ) ROM_REGION( 0x500000, "cslot1:maincpu", ROMREGION_BE|ROMREGION_16BIT ) @@ -11045,6 +11052,41 @@ ROM_START( ms5plus ) ROM_LOAD16_BYTE( "268-c8c.c8", 0x3000001, 0x800000, CRC(551d720e) SHA1(ebf69e334fcaba0fda6fd432fd0970283a365d12) ) /* Plane 2,3 */ /* mask rom TC5364205 */ ROM_END +/* clear cart, orange pcbs + prog board: no v encryption, uses a plcc epm7096lc84-15 for pcm, 16-bit v roms decoded by 2x 74hc245 + cha board: no c/m encryption, uses a soic palce16v8 for zmc, 5x 74hc273a for neo-273, 6x so44 m59pw064 64Mbit + 2x dip lh28f160 16MBit flash roms for gfx + all roms are erasable flash chips, mixture of 5v and 3.3v + produced sometime after early 2004 (going by youngest ic date code) */ +ROM_START( mslug5b ) + ROM_REGION( 0x500000, "cslot1:maincpu", ROMREGION_BE|ROMREGION_16BIT ) + ROM_LOAD16_WORD_SWAP( "ms5b-p1.bin", 0x000000, 0x100000, CRC(1376f43c) SHA1(7ca4a8b11c7effda2603d04e793cf664e7aa39bf) ) /* MX29F1615PC-10 16Mbit 2nd half empty */ + ROM_LOAD16_WORD_SWAP( "ms5b-p2.bin", 0x100000, 0x400000, CRC(4becfba0) SHA1(fd3708f6c8fa26133b29b4b033148dff54dc1e7d) ) /* LH28F320BJD-TTL80 32Mbit 3.3v */ + + /* Scrambled */ + NEO_SFIX_128K( "ms5b-s1.bin", CRC(3a427c9f) SHA1(6c6050640adb7148d42d35e3017cc171e53ae957) ) /* W29C011A-15 1Mbit */ + + /* Not encrypted */ + NEO_BIOS_AUDIO_128K( "ms5b-m1.bin", CRC(bf1601bc) SHA1(5e285c98c65acefd77e893247482af0d09f3e1e4) ) /* W29EE011-15 1Mbit */ + + /* Not encrypted, odd bytes scrambled */ + ROM_REGION( 0x1000000, "cslot1:ymsnd", 0 ) + ROM_LOAD( "ms5b-v1.bin", 0x000000, 0x400000, CRC(e3f9fd75) SHA1(8772d0936c45623763b92c55816d0e56dd8d2ef2) ) /* LH28F320BJD-TTL80 32Mbit 3.3v 2 bytes diff vs decrypted */ + ROM_LOAD( "ms5b-v2.bin", 0x400000, 0x400000, CRC(a53618f6) SHA1(002e37f3d45aa6153593c7939902e1a022de14c7) ) /* LH28F320BJD-TTL80 32Mbit 3.3v */ + ROM_LOAD( "ms5b-v3.bin", 0x800000, 0x400000, CRC(14f000ee) SHA1(b30df60964cc8480b78a4bc2d323cad59e44a0ae) ) /* LH28F320BJD-TTL80 32Mbit 3.3v */ + ROM_LOAD( "ms5b-v4.bin", 0xc00000, 0x400000, CRC(0ccee813) SHA1(4bc034f7f37da956b4116a2dea8a856b96e43c18) ) /* LH28F320BJD-TTL80 32Mbit 3.3v */ + + /* Not encrypted, a18/a19 lines swapped */ + ROM_REGION( 0x4000000, "cslot1:sprites", 0 ) + ROM_LOAD16_BYTE( "ms5b-c1.bin", 0x0000000, 0x800000, CRC(4b0e5998) SHA1(458486d579db118ec4ba4f9fce9d62fedfef949b) ) /* M59PW064 64Mbit 3.3v */ + ROM_LOAD16_BYTE( "ms5b-c2.bin", 0x0000001, 0x800000, CRC(022fc30b) SHA1(7178900acbb377c3de95338c8fae56e308327cab) ) /* M59PW064 64Mbit 3.3v */ + ROM_LOAD16_BYTE( "ms5b-c3.bin", 0x1000000, 0x800000, CRC(ead86d28) SHA1(e1db4f839972748f49dddfe3bd4b0cf2e0ddf074) ) /* M59PW064 64Mbit 3.3v */ + ROM_LOAD16_BYTE( "ms5b-c4.bin", 0x1000001, 0x800000, CRC(0be6be35) SHA1(34e20e55423cefd2b98c15061f86198b64727173) ) /* M59PW064 64Mbit 3.3v */ + ROM_LOAD16_BYTE( "ms5b-c5.bin", 0x2000000, 0x200000, CRC(2a23e569) SHA1(576370a24a8ef5ca0f8e7afa4ccdb0cb3ad9bdaa) ) /* LH28F160BJD-TTL80 16Mbit 3.3v */ + ROM_LOAD16_BYTE( "ms5b-c6.bin", 0x2000001, 0x200000, CRC(6eb6bc9e) SHA1(4e54d904b0ce34cca429b3c86ab8bf972c66336e) ) /* LH28F160BJD-TTL80 16Mbit 3.3v */ + ROM_LOAD16_BYTE( "ms5b-c7.bin", 0x3000000, 0x800000, CRC(57f4e53f) SHA1(813d98175288045c0750d45afe03c74973d70cee) ) /* M59PW064 64Mbit 3.3v */ + ROM_LOAD16_BYTE( "ms5b-c8.bin", 0x3000001, 0x800000, CRC(9d59ff7c) SHA1(ff90dc79598de0880df17624c76df81c92f267ce) ) /* M59PW064 64Mbit 3.3v */ +ROM_END + /* Puzzle Bobble / Bust-A-Move (Neo-Geo) bootleg */ ROM_START( pbobblenb ) @@ -11911,6 +11953,7 @@ GAME( 2004, kof2k4se, kof2002, kof2k4se, neogeo, mvs_led_state, empty_ini GAME( 2003, mslug5, neogeo, mslug5, neogeo, mvs_led_state, empty_init, ROT0, "SNK Playmore", "Metal Slug 5 (NGM-2680)", MACHINE_SUPPORTS_SAVE ) GAME( 2003, mslug5h, mslug5, mslug5, neogeo, mvs_led_state, empty_init, ROT0, "SNK Playmore", "Metal Slug 5 (NGH-2680)", MACHINE_SUPPORTS_SAVE ) /* Also found in later MVS carts */ GAME( 2003, ms5plus, mslug5, ms5plus, neogeo, mvs_led_state, empty_init, ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 2003, mslug5b, mslug5, mslug5b, neogeo, mvs_led_state, empty_init, ROT0, "bootleg", "Metal Slug 5 (bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 2003, svc, neogeo, svc, neogeo, mvs_led_state, empty_init, ROT0, "Playmore / Capcom", "SNK vs. Capcom - SVC Chaos (NGM-2690 ~ NGH-2690)", MACHINE_SUPPORTS_SAVE ) GAME( 2003, svcboot, svc, svcboot, neogeo, mvs_led_state, empty_init, ROT0, "bootleg", "SNK vs. Capcom - SVC Chaos (bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 2003, svcplus, svc, svcplus, neogeo, mvs_led_state, empty_init, ROT0, "bootleg", "SNK vs. Capcom - SVC Chaos Plus (bootleg set 1)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 8f7175362f2..fd1ea894d17 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -31296,6 +31296,7 @@ mslug3h // 0256 (c) 2000 SNK mslug4 // 0263 (c) 2002 Mega Enterprise mslug4h // 0263 (c) 2002 Mega Enterprise mslug5 // 0268 (c) 2003 Playmore +mslug5b // bootleg mslug5h // 0268 (c) 2003 Playmore mslugx // 0250 (c) 1999 SNK mutnat // 0014 (c) 1992 SNK