I donno, give this a try maybe. extern unsigned char* YM2610ADPCMAROM;
static void neo_pcm2_playmore2002(int value)
{
unsigned int addrs[7][2]={
{0x000000,0xA5000}, //kof2002
{0xFFCE20,0x01000}, //matrimelee
{0xFE2CF6,0x4E001}, //mslug5
{0xFEB2C0,0x0A000}, //samsho5
{0xFFAC28,0xC2000}, //svcchaos
{0xFF14EA,0xA7001}, //kof2003
{0xFFB440,0x02000}, //samsh5sp
};
unsigned int xordata[7][8]={
{0xF9,0xE0,0x5D,0xF3,0xEA,0x92,0xBE,0xEF}, //kof2002
{0xC4,0x83,0xA8,0x5F,0x21,0x27,0x64,0xAF}, //matrimelee
{0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //mslug5
{0xCB,0x29,0x7D,0x43,0xD2,0x3A,0xC2,0xB4}, //samsho5
{0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //svcchaos
{0x4B,0xA4,0x63,0x46,0xF0,0x91,0xEA,0x62}, //kof2003
{0x4B,0xA4,0x63,0x46,0xF0,0x91,0xEA,0x62}, //samsh5sp
};
value = value-1;
UINT8 *rom = YM2610ADPCMAROM;
UINT8 *buf = (UINT8*)malloc(0x1000000);
int ofst;
memcpy(buf,rom,0x1000000);
for(int i=0; i<0x1000000; i++)
{
ofst = (i & 0xfefffe) | ((i & 0x010000) >> 16) | ((i & 0x000001) << 16);
ofst ^= addrs[value][1];
rom[ofst] = (buf[((i + addrs[value][0]) & 0xffffff)] ^ xordata[value][(ofst & 0x07)]);
}
free(buf);
}
static int kof2002Init()
{
int nRet;
nNeoProtectionxor = 0xec
pNeoInitCallback = kof2002Decrypt;
nRet = NeoInit();
if (nRet == 0) {
neo_pcm2_playmore2002(1);
}
return nRet;
}