Metal Slug 5 Plus FBA code is here,not patch,^_^.
// Metal Slug 5 Plus! (hack)
static struct BurnRomInfo ms5plusRomDesc[] = {
{"268-p1p.bin", 0x100000, 0x106B276F, 0x10}, // 0 68K code /* protected code */
{"268-p2p.bin", 0x200000, 0xD6A458E8, 0x10}, // 1
{"268-p3p.bin", 0x200000, 0x439EC031, 0x10}, // 2
{"268-s1p.bin", 0x020000, 0x21e04432, 1}, // 3 Text layer tiles /* scrambled */
{"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 Z80 code
{"268-v1.bin", 0x800000, 0x33c6305c, 2}, // 13 Sound data (encrypted)
{"268-v2.bin", 0x800000, 0x1afb848e, 2}, // 14
};
STDROMPICKEXT(ms5plus, ms5plus, neogeo);
STD_ROM_FN(ms5plus);
static unsigned short CartRAM[0x1000];
void __fastcall ms5plusWriteWordBankSwitch(unsigned int sekAddress, unsigned short wordValue)
{
if (sekAddress==0x2ffff4)
{
unsigned int offset=wordValue<<0x10;
SekMapMemory(Neo68KROM01+offset,0x200000,0x2fdfff,SM_ROM);
};
}
static void ms5plusMapHandler()
{
SekMapHandler(5, 0x2fe000, 0x2fffff, SM_WRITE);
SekSetWriteWordHandler(5, ms5plusWriteWordBankSwitch);
}
static void ms5p_px_fix()
{
// Reload last 2 roms (fixes FBA load problem)
BurnLoadRom(Neo68KROM01+0x100000, 1, 1);
BurnLoadRom(Neo68KROM01+0x300000, 2, 1);
}
static void ms5p_sx_fix()
{
int i, rom_size = 0x20000;
UINT8 *src = (UINT8*)(NeoTextROM+0x20000);
UINT8 *dst = (UINT8 *)malloc( rom_size );
memcpy( dst,src,rom_size );
// descrambling the S1
for( i=0; i memcpy(src+i, dst+i+0x08, 0x08);
memcpy(src+i+0x08, dst+i, 0x08);
}
free( dst );
}
static void ms5p_vx_fix()
{
const unsigned char ms5xor[0x08] = { 0xc3, 0xfd, 0x81, 0xac, 0x6d, 0xe7, 0xbf, 0x9e };
int i, ofst, rom_size = 0x1000000;
UINT8 *rom = YM2610ADPCMAROM;
UINT8 *buf = (UINT8 *)malloc( rom_size );
memcpy(buf, rom, rom_size);
for( i = 0; i < rom_size; i++)
{
ofst = (i & 0xfefffe) | ((i & 0x010000) >> 16) | ((i & 0x000001) << 16);
ofst ^= 0x4e001;
rom[ofst] = (buf[((i + 0xfe2cf6) & 0xffffff)] ^ ms5xor[(ofst & 0x07)]);
}
free( buf );
}
static void ms5plus_decrypt()
{
ms5p_px_fix();
ms5p_sx_fix();
ms5p_vx_fix();
}
static int ms5plusInit()
{
int nRet;
memset(CartRAM,0,0x2000);
nNeoProtectionXor = 0x19;
pNeoInitCallback = ms5plus_decrypt;
nRet = NeoInit();
if (!nRet)
ms5plusMapHandler();
return nRet;
}
struct BurnDriver BurnDrvms5plus = {
{"ms5plus", "Metal Slug 5 Plus! (hack)", "Hack of mslug5", "SNK Playmore", "Neo Geo", "2003", "mslug5", "neogeo"},
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B | HARDWARE_SNK_NEWBANKSYSTEM,
NULL, ms5plusRomInfo, ms5plusRomName, neogeoInputInfo, neogeoDIPInfo,
ms5plusInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};