Good,everybody!
It's my nADPCMByteswap code,maybe small, just 1 - 4, not 1 - 7,^_^.
// This is for matrimbl and clones
if (nADPCMByteswap == 1) {
/* Here only 2 sample ROMs have byteswap,
so we divide the function in two processes */
unsigned char* rom = YM2610ADPCMAROM;
BurnByteswap(rom+0x400000, 0x400000); // V2
BurnByteswap(rom+0xC00000, 0x400000); // V4
}
// This is for svcboot/svcplus/svcplusa/svcsplus and clones
if (nADPCMByteswap == 2) {
// load the roms in the correct order
int sec[] = { 0x01, 0x00, 0x03, 0x02 }; // part 2->1->4->3
int i, rom_size = 0x1000000;
unsigned char* rom = YM2610ADPCMAROM;
unsigned char* buf = (unsigned char*)malloc( rom_size );
memcpy( buf, rom, rom_size);
for( i=0; i<4; i++){
memcpy( rom+i*0x400000, buf+sec[i]*0x400000, 0x400000);
}
BurnByteswap(rom, rom_size);
free( buf );
}
// This is for kofsp2k4 & kfs2k4pl
if (nADPCMByteswap == 3) {
// load the roms in the correct order
unsigned char* rom = YM2610ADPCMAROM;
unsigned char* buf = (unsigned char*)malloc( 0x1000000 );
memcpy(buf+0x000000, rom+0x800000, 0x800000); // V2->V1
memcpy(buf+0x800000, rom+0x000000, 0x800000); // V1->V2
memcpy(rom, buf, 0x1000000);
free( buf );
}
// Descramble samsh5bl's V roms (data lines are bitswaped)
if (nADPCMByteswap == 4) {
// Thanks to fataku for the driver
int i, rom_size = 0x1000000;
unsigned char* rom = YM2610ADPCMAROM;
for( i=0; i rom[i] = BITSWAP08(rom[i],0,1,5,4,3,2,6,7);
}
}