This is for Metal Slug 5 (Original set). Note that the P rom I'm using for this set has the Neo-PVC encryption removed.
It's essentially the bootleg with parts 3 & 4 swapped and a 2 byte difference.
BTW, if you save the RAM from Nebula, the AES patch has already been applied.
// Metal Slug 5
static struct BurnRomInfo mslug5RomDesc[] = {
// These use the neo-pvc code which is currently unemulated
// {"268-p1.bin", 0x400000, 0xd0466792, 0x10}, // 0 68K code
// {"268-p2.bin", 0x400000, 0xfbf6b61e, 0x10}, // 1
// So use a P1 with the neo-pvc protection removed
{"268-p1d.bin",0x800000, 0x2ECC772D, 0x10}, // 0 (Saved from Kawaks' RAM)
{"268-c1.bin", 0x800000, 0x27d59de8, 1}, // 2 Sprite data
{"268-c2.bin", 0x800000, 0xe600dee1, 1}, // 3
{"268-c3.bin", 0x800000, 0xb650f098, 1}, // 4
{"268-c4.bin", 0x800000, 0x10499589, 1}, // 5
{"268-c5.bin", 0x800000, 0x19352405, 1}, // 6
{"268-c6.bin", 0x800000, 0xb1531523, 1}, // 7
{"268-c7.bin", 0x800000, 0xfe2c1338, 1}, // 8
{"268-c8.bin", 0x800000, 0xecce3141, 1}, // 9
// {"268-m1.bin", 0x040000, 0x88c11f51, 0x10}, // 10 Z80 code (Encrypted)
{"268-m1d.bin", 0x040000, 0x6866d696, 0x10}, // 10
// These use the Neo-PCM2 2002 (Playmore) chip
// {"268-v1.bin", 0x800000, 0x33c6305c, 2}, // 11 Sound data (Encrypted)
// {"268-v2.bin", 0x800000, 0x1afb848e, 2}, // 12
{"268-v1d.bin", 0x800000, 0x14848c5c, 2}, // 11 Sound data
{"268-v2d.bin", 0x800000, 0x696cce3b, 2}, // 12
};
STDROMPICKEXT(mslug5, mslug5, neogeo);
STD_ROM_FN(mslug5);
static void mslug5_patch()
{
// Code by IQ_132 - Thanks to HappyASR for the info
for (int i = 0; i < 0x100000; i=i+2)
{
if (*((unsigned short*)(Neo68KROM01 + i + 0)) == 0x33FC)
{
if (*((unsigned short*)(Neo68KROM01 + i + 6)) == 0xfff0) {
for (int j = i; j < (i+8); j=j+2)
{
*((unsigned short*)(Neo68KROM01 + j)) = 0x4e71;
}
}
}
if (*((unsigned short*)(Neo68KROM01 + i + 0 )) == 0x5247)
{
if (*((unsigned short*)(Neo68KROM01 + i + 6 )) == 0x33c7)
{
*((unsigned short*)(Neo68KROM01 + i + 0 )) = 0x33c7;
*((unsigned short*)(Neo68KROM01 + i + 2 )) = 0x002f;
*((unsigned short*)(Neo68KROM01 + i + 4 )) = 0xfff0;
*((unsigned short*)(Neo68KROM01 + i + 6 )) = 0x5247;
*((unsigned short*)(Neo68KROM01 + i + 8 )) = 0xe14f;
*((unsigned short*)(Neo68KROM01 + i + 10)) = 0xe94f;
}
}
}
*((unsigned short*)(Neo68KROM01 + 0x0122A)) = 0x4e71; // AES Patch
*((unsigned short*)(Neo68KROM01 + 0x0122C)) = 0x4e71; // AES Patch
*((unsigned short*)(Neo68KROM01 + 0x18430)) = 0x0001;
*((unsigned short*)(Neo68KROM01 + 0x18434)) = 0xFFF0;
}
static int mslug5Init()
{
pNeoInitCallback=mslug5_patch; // Remove Protections
nNeoProtectionXor = 0x19;
return NeoInit();
}
struct BurnDriver BurnDrvmslug5 = {
{"mslug5", "Metal Slug 5", NULL, "SNK Playmore Corporation", "Neo Geo", "2003", NULL, "neogeo"},
BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B,
NULL, mslug5RomInfo, mslug5RomName, neogeoInputInfo, neogeoDIPInfo,
mslug5Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
This is for the original bootleg metal slug 5 release.
// Metal Slug 5 (Bootleg)
static struct BurnRomInfo mslug5bRomDesc[] = {
//(original release, bootleg)
{"268-p1b.bin", 0x800000, 0x3f1cf3d2, 0x10}, // 0 68K code
{"268-c1d.bin", 0x800000, 0x969c0d62, 1}, // 1 Sprite data
{"268-c2d.bin", 0x800000, 0xc69ae867, 1}, // 2
{"268-c3d.bin", 0x800000, 0xd7beaeaf, 1}, // 3
{"268-c4d.bin", 0x800000, 0xe1b1131b, 1}, // 4 (899fb2af is good CRC)
{"268-c5d.bin", 0x800000, 0x2fa1a5ad, 1}, // 5
{"268-c6d.bin", 0x800000, 0x6de89589, 1}, // 6
{"268-c7d.bin", 0x800000, 0x97bd0c0a, 1}, // 7
{"268-c8d.bin", 0x800000, 0xc0d5bc20, 1}, // 8
{"268-m1.bin", 0x020000, 0x6FA01C9A, 0x10}, // 9 Z80 code
{"268-v1.bin", 0x400000, 0xc3540e0d, 2}, // 10 Sound data
{"268-v2.bin", 0x400000, 0x077bd2f4, 2}, // 11
{"268-v3.bin", 0x400000, 0x39b14567, 2}, // 12
{"268-v4.bin", 0x400000, 0x969ff3b2, 2}, // 13
};
STDROMPICKEXT(mslug5b, mslug5b, neogeo);
STD_ROM_FN(mslug5b);
static void mslug5b_decrypt()
{
// Patch out protections
mslug5_patch();
// Swap 3rd & 4th MB
unsigned char* src = Neo68KROM01+0x200000;
unsigned char* dst = (unsigned char*)malloc(0x200000);
memcpy(dst+0x000000, src+0x100000, 0x100000);
memcpy(dst+0x100000, src+0x000000, 0x100000);
memcpy(src+0x000000, dst+0x000000, 0x200000);
free(dst);
}
static int mslug5bInit()
{
pNeoInitCallback=mslug5b_decrypt; // Remove Protections
nNeoTextROMSize = 0x020000;
return NeoInit();
}
struct BurnDriver BurnDrvmslug5b = {
{"mslug5b", "Metal Slug 5 (Bootleg)", NULL, "SNK Playmore Corporation", "Neo Geo", "2003", "mslug5", "neogeo"},
BDF_GAME_WORKING | BDF_BOOTLEG | BDF_CLONE, 2, HARDWARE_SNK_NEOGEO,
NULL, mslug5bRomInfo, mslug5bRomName, neogeoInputInfo, neogeoDIPInfo,
mslug5bInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
For ms5plus, make sure you have Ferchogtx's nNeoTextROMFixType code in your build. Otherwise, you'll get an error when compiling. (I'll link to the code when it's posted again)
// Metal Slug 5 (Plus)
static struct BurnRomInfo ms5plusRomDesc[] = {
{"268-p1p.bin", 0x100000, 0x106B276F, 0x10}, // 0 68K code // protected
{"268-p2p.bin", 0x200000, 0xD6A458E8, 0x10}, // 1
{"268-p3p.bin", 0x200000, 0x439EC031, 0x10}, // 2
{"268-s1p.bin", 0x020000, 0x21E04432, 1}, // 3 Text data
{"268-c1.bin", 0x800000, 0x27d59de8, 1}, // 4 Sprite data
{"268-c2.bin", 0x800000, 0xe600dee1, 1}, // 5
{"268-c3.bin", 0x800000, 0xb650f098, 1}, // 6
{"268-c4.bin", 0x800000, 0x10499589, 1}, // 7
{"268-c5.bin", 0x800000, 0x19352405, 1}, // 8
{"268-c6.bin", 0x800000, 0xb1531523, 1}, // 9
{"268-c7.bin", 0x800000, 0xfe2c1338, 1}, // 10
{"268-c8.bin", 0x800000, 0xecce3141, 1}, // 11
{"268-m1d.bin", 0x040000, 0x6866d696, 0x10}, // 12 Decrypted Z80 code
{"268-v1.bin", 0x800000, 0x14848c5c, 2}, // 13 Sound data
{"268-v2.bin", 0x800000, 0x696cce3b, 2}, // 14
};
STDROMPICKEXT(ms5plus, ms5plus, neogeo);
STD_ROM_FN(ms5plus);
static void ms5plus_patch()
{
// Driver by IQ_132 - http://neosource.1emu.net/
// Patch out protections (Thanks to HappyASR)
*((unsigned short*)(Neo68KROM01 + 0xF0A02)) = 0x0001;
*((unsigned short*)(Neo68KROM01 + 0xF0A08)) = 0x4E75;
*((unsigned short*)(Neo68KROM01 + 0xF1004)) = 0xE85F;
*((unsigned short*)(Neo68KROM01 + 0xF1006)) = 0x5307;
*((unsigned short*)(Neo68KROM01 + 0xF1008)) = 0x33C7;
*((unsigned short*)(Neo68KROM01 + 0xF100A)) = 0x002F;
*((unsigned short*)(Neo68KROM01 + 0xF100C)) = 0xFFF0;
*((unsigned short*)(Neo68KROM01 + 0xF100E)) = 0x4E75;
// Reload last 2 roms (fixes FBA load problem)
BurnLoadRom(Neo68KROM01+0x100000, 1, 0);
BurnLoadRom(Neo68KROM01+0x300000, 2, 0);
}
static int ms5plusInit()
{
pNeoInitCallback=ms5plus_patch;
nNeoTextROMFixType=1;
nNeoProtectionXor = 0x19;
return NeoInit();
}
struct BurnDriver BurnDrvms5plus = {
{"ms5plus", "Metal Slug 5 (Plus)", NULL, "SNK Playmore Corporation", "Neo Geo", "2003", "mslug5", "neogeo"},
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B,
NULL, ms5plusRomInfo, ms5plusRomName, neogeoInputInfo, neogeoDIPInfo,
ms5plusInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};