Sorry about that FBX, I forgot about it.
// Samurai Shodown 5
static struct BurnRomInfo samsho5RomDesc[] = {
{"270-p1.bin", 0x400000, 0x4a2a09e6, 1 | BRF_ESS | BRF_PRG }, // 0 68K code
{"270-p2.bin", 0x400000, 0xe0c74c85, 1 | BRF_ESS | BRF_PRG }, // 1
{"270-c1.bin", 0x800000, 0x14FFFFAC, 3 | BRF_GRA }, // 2 Sprite data
{"270-c2.bin", 0x800000, 0x401F7299, 3 | BRF_GRA }, // 3
{"270-c3.bin", 0x800000, 0x1BFF0D0E, 3 | BRF_GRA }, // 4
{"270-c4.bin", 0x800000, 0x041560A5, 3 | BRF_GRA }, // 5
{"270-c5.bin", 0x800000, 0xBD30B52D, 3 | BRF_GRA }, // 6
{"270-c6.bin", 0x800000, 0x86A69C70, 3 | BRF_GRA }, // 7
{"270-c7.bin", 0x800000, 0xd28fbc3c, 3 | BRF_GRA }, // 8
{"270-c8.bin", 0x800000, 0x02C530A6, 3 | BRF_GRA }, // 9
{"270-m1d.bin", 0x020000, 0x18114FB1, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code
{"270-m1.bin" , 0x040000, 0xe4a5ab0c, 0 | BRF_PRG | BRF_OPT }, // 10
{"270-v1.bin" , 0x800000, 0x7541763a, 5 | BRF_SND }, // 11 Sound data
{"270-v2.bin" , 0x800000, 0x4e6e7d98, 5 | BRF_SND }, // 12
};
STDROMPICKEXT(samsho5, samsho5, neogeo);
STD_ROM_FN(samsho5);
static void samsho5Decrypt()
{
// Not needed due to the availability of the AES Cart dump
/* *((unsigned short*)(Neo68KROM + 0xE7EC2)) = 0x7CCC; // menu AES color text fix
*((unsigned short*)(Neo68KROM + 0xE7EC4)) = 0x1DC7;
*((unsigned short*)(Neo68KROM + 0xE7ECA)) = 0x2DB0;
*((unsigned short*)(Neo68KROM + 0xE7ECE)) = 0x4C90;
*((unsigned short*)(Neo68KROM + 0xE7ED2)) = 0x4C60;
*((unsigned short*)(Neo68KROM + 0xE7ED6)) = 0x6B30;
*((unsigned short*)(Neo68KROM + 0xE7EE2)) = 0x7CCC;
*((unsigned short*)(Neo68KROM + 0xE7EE4)) = 0x1BCE;
*((unsigned short*)(Neo68KROM + 0xE7EEA)) = 0x549D;
*((unsigned short*)(Neo68KROM + 0xE7EEE)) = 0x117D;
*((unsigned short*)(Neo68KROM + 0xE7EF2)) = 0x204C;
*((unsigned short*)(Neo68KROM + 0xE7EF6)) = 0x302C;
*((unsigned short*)(Neo68KROM + 0xE7F02)) = 0x7CCC;
*((unsigned short*)(Neo68KROM + 0xE7F04)) = 0x45B1;
*((unsigned short*)(Neo68KROM + 0xE7F06)) = 0x14A0;
*((unsigned short*)(Neo68KROM + 0xE7F08)) = 0x2290;
*((unsigned short*)(Neo68KROM + 0xE7F0A)) = 0x4390;
*((unsigned short*)(Neo68KROM + 0xE7F0C)) = 0x2280;
*((unsigned short*)(Neo68KROM + 0xE7F0E)) = 0x2170;
*((unsigned short*)(Neo68KROM + 0xE7F12)) = 0x0060;
*((unsigned short*)(Neo68KROM + 0xE7F16)) = 0x0050;
*((unsigned short*)(Neo68KROM + 0xE7F18)) = 0x0040;
*((unsigned short*)(Neo68KROM + 0xE7F1C)) = 0x0020;
*/
unsigned char* src = Neo68KROM+0x100000;
unsigned char* dst = (unsigned char*)malloc(0x700000);
int sec[] = {0xC,0xB,0x8,0x1,0x2,0x7,0x4, 0xD,0xA,0x3,0x0,0x9,0x6,0x5};
if (dst)
{
memcpy(dst,src,0x700000);
for(int i = 0; i < 14; ++i)
{
memcpy(src+i*0x80000,dst+sec[i]*0x80000,0x80000);
}
free(dst);
}
}
static int samsho5Init()
{
int nRet;
nNeoProtectionXor = 0x0f;
pNeoInitCallback = samsho5Decrypt;
nRet = NeoInit();
if (nRet == 0) {
PCM2DecryptVInfo Info = { 0x00A000, 0xFEB2C0, { 0xCB, 0x29, 0x7D, 0x43, 0xD2, 0x3A, 0xC2, 0xB4 } };
PCM2DecryptV(&Info);
}
return nRet;
}
struct BurnDriver BurnDrvSamSho5 = {
"samsho5", NULL, "neogeo", "2003",
"Samurai Shodown V - Samurai Spirits Zero\0", NULL, "Yuki Enterprise / SNK Playmore", "Neo Geo",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B | HARDWARE_SNK_SRAM,
NULL, samsho5RomInfo, samsho5RomName, neogeoInputInfo, neogeoDIPInfo,
samsho5Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
// Samurai Shodown 5 (AES Cart)
static struct BurnRomInfo samsho5hRomDesc[] = {
{"270-p1c.bin", 0x400000, 0xBF956089, 1 | BRF_ESS | BRF_PRG }, // 0 68K code
{"270-p2c.bin", 0x400000, 0x943A6B1D, 1 | BRF_ESS | BRF_PRG }, // 1
{"270-c1.bin", 0x800000, 0x14FFFFAC, 3 | BRF_GRA }, // 2 Sprite data
{"270-c2.bin", 0x800000, 0x401F7299, 3 | BRF_GRA }, // 3
{"270-c3.bin", 0x800000, 0x1BFF0D0E, 3 | BRF_GRA }, // 4
{"270-c4.bin", 0x800000, 0x041560A5, 3 | BRF_GRA }, // 5
{"270-c5.bin", 0x800000, 0xBD30B52D, 3 | BRF_GRA }, // 6
{"270-c6.bin", 0x800000, 0x86A69C70, 3 | BRF_GRA }, // 7
{"270-c7.bin", 0x800000, 0xd28fbc3c, 3 | BRF_GRA }, // 8
{"270-c8.bin", 0x800000, 0x02C530A6, 3 | BRF_GRA }, // 9
{"270-m1d.bin", 0x020000, 0x18114FB1, 4 | BRF_ESS | BRF_PRG }, // 10 Z80 code
{"270-m1c.bin", 0x080000, 0xCEDEBD3C, 0 | BRF_PRG | BRF_OPT }, // 10
{"270-v1.bin" , 0x800000, 0x7541763a, 5 | BRF_SND }, // 11 Sound data
{"270-v2.bin" , 0x800000, 0x4e6e7d98, 5 | BRF_SND }, // 12
};
STDROMPICKEXT(samsho5h, samsho5h, neogeo);
STD_ROM_FN(samsho5h);
struct BurnDriver BurnDrvsamsho5h = {
"samsho5h", "samsho5", "neogeo", "2003",
"Samurai Shodown V - Samurai Spirits Zero (Home)\0", "From AES Cart", "Yuki Enterprise / SNK Playmore", "Neo Geo",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B, // | HARDWARE_SNK_SRAM,
NULL, samsho5hRomInfo, samsho5hRomName, neogeoInputInfo, neogeoDIPInfo,
samsho5Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
// Samurai Shodown V Special / Samurai Spirits Zero Special
static struct BurnRomInfo samsh5spRomDesc[] = {
{"272-p1.bin", 0x400000, 0x9291794D, 1 | BRF_ESS | BRF_PRG }, // 0 68K code
{"272-p2.bin", 0x400000, 0xFA1A7DD8, 1 | BRF_ESS | BRF_PRG }, // 1
{"272-c1.bin", 0x800000, 0x4F97661A, 3 | BRF_GRA }, // 2 Sprite data
{"272-c2.bin", 0x800000, 0xA3AFDA4F, 3 | BRF_GRA }, // 3
{"272-c3.bin", 0x800000, 0x8C3C7502, 3 | BRF_GRA }, // 4
{"272-c4.bin", 0x800000, 0x32D5E2E2, 3 | BRF_GRA }, // 5
{"272-c5.bin", 0x800000, 0x6CE085BC, 3 | BRF_GRA }, // 6
{"272-c6.bin", 0x800000, 0x05C8DC8E, 3 | BRF_GRA }, // 7
{"272-c7.bin", 0x800000, 0x1417B742, 3 | BRF_GRA }, // 8
{"272-c8.bin", 0x800000, 0xD49773CD, 3 | BRF_GRA }, // 9
{"272-m1d.bin" , 0x080000, 0x451b14be, 4 | BRF_ESS | BRF_PRG }, // 9 Z80 code
{"272-m1.bin" , 0x080000, 0xADEEBF40, 0 | BRF_PRG | BRF_OPT }, // 9
{"272-v1.bin" , 0x800000, 0x76a94127, 5 | BRF_SND }, // 10
{"272-v2.bin" , 0x800000, 0x4ba507f1, 5 | BRF_SND }, // 11
};
STDROMPICKEXT(samsh5sp, samsh5sp, neogeo);
STD_ROM_FN(samsh5sp);
static void samsh5sp_unlock()
{
// Unlock fatalities from AES original cart.
// Code by wesker, converted to FBA code by BisonSAS
*((unsigned short*)(Neo68KROM + 0x00990)) = 0x33FC;
*((unsigned short*)(Neo68KROM + 0x00992)) = 0x0002;
*((unsigned short*)(Neo68KROM + 0x00994)) = 0x0010;
*((unsigned short*)(Neo68KROM + 0x00996)) = 0xE010;
*((unsigned short*)(Neo68KROM + 0x00998)) = 0x4EF9;
*((unsigned short*)(Neo68KROM + 0x0099A)) = 0x0004;
*((unsigned short*)(Neo68KROM + 0x0099C)) = 0x61BA;
*((unsigned short*)(Neo68KROM + 0x461B4)) = 0x4EF9;
*((unsigned short*)(Neo68KROM + 0x461B6)) = 0x0000;
*((unsigned short*)(Neo68KROM + 0x461B8)) = 0x0990;
}
static void samsh5sp_Decrypt()
{
// Descrambling Px by Vorador from speksnk
unsigned char* src = Neo68KROM+0x100000;
unsigned char* dst = (unsigned char*)malloc(0x700000);
unsigned int sec[] = {0x8,0x7,0xA,0x9,0xC,0x3, 0x0,0xB,0x6,0xD,0x2,0x5,0x4,0x1};
if (dst)
{
memcpy( dst, src, 0x700000 );
for(int i=0;i<14;i++)
{
memcpy(src+i*0x80000,dst+sec[i]*0x80000,0x80000);
}
free(dst);
}
// samsh5sp_unlock(); // Use cheat file instead
}
static int samsh5spInit()
{
int nRet;
nNeoProtectionXor = 0x0d;
pNeoInitCallback = samsh5sp_Decrypt;
nRet = NeoInit();
if (nRet == 0) {
PCM2DecryptVInfo Info = { 0x002000, 0xFFB440, { 0x4B, 0xA4, 0x63, 0x46, 0xF0, 0x91, 0xEA, 0x62 } };
PCM2DecryptV(&Info);
}
return nRet;
}
struct BurnDriver BurnDrvsamsh5sp = {
"samsh5sp", NULL, "neogeo", "2004",
"Samurai Shodown V Special - Samurai Spirits Zero Special\0", NULL, "Yuki Enterprise / SNK Playmore", "Neo Geo",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B | HARDWARE_SNK_SRAM,
NULL, samsh5spRomInfo, samsh5spRomName, neogeoInputInfo, neogeoDIPInfo,
samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};