Hmm.. On some forum I was reading, someone (I don't remember who) said that maybe the P roms where interleaved.
What I mean by this is that byte 1 comes from p1.bin, byte 2 comes from p2.bin, byte 3 comes from p1.bin, byte 4 comes from p2.bin and so on.
I'm quite positive now that they are. If you save the rom generated by this code and open it in a hex editor, you'll see (though a bit scrambled) the standard neo-geo P rom header.
Also, I'm quite positive that the p3d is loaded either after the p1 & p2, or OVER the dummy sections at the end. It should be loaded as the second mb of the P data.
Now.. on to the 271-bios. I'm almost positive this is loaded like the bios used by irritating maze. Not like an SMA rom (used by garou, kof2k, etc).
Here's my preliminary Driver.
THIS DOES NOT WORK
It's just here to provide information.
// The King of Fighters 2003
static struct BurnRomInfo kof2003RomDesc[] = {
{"271-p1.bin", 0x400000, 0xb9da070c, 0x10}, // 0 68K code
{"271-p2.bin", 0x400000, 0xda3118c4, 0x10}, // 1
{"271-c1d.bin", 0x1000000, 0xC29ACD28, 1}, // 2 Sprite data
{"271-c2d.bin", 0x1000000, 0x328E80B1, 1}, // 3
{"271-c3d.bin", 0x1000000, 0x020A11F1, 1}, // 4
{"271-c4d.bin", 0x1000000, 0x991B5ED2, 1}, // 5
{"271-c5d.bin", 0x1000000, 0xc2de8b66, 1}, // 6 // Contains S data Only
{"271-c6d.bin", 0x1000000, 0x3ff750db, 1}, // 7 // Contains S data Only
{"271-m1d.bin", 0x080000, 0x0E86AF8F, 0x10}, // 8 Z80 code
{"271-v1d.bin", 0x1000000, 0x2058EC5E, 2}, // 9 Sound data
// {"271-p3.bin", 0x100000, 0x5cefd0d2, 0x10}, // 10 encrypted - Don't load
{"271-p3d.bin", 0x100000, 0x59d376da, 0x10}, // 10 decrypted
};
STDROMPICKEXT(kof2003, kof2003, neogeo);
STD_ROM_FN(kof2003);
static void interleave_ps()
{
// Interleave P1 and P2 (not quite correct)
int j=0,i;
unsigned char* src = Neo68KROM01;
unsigned char* dst = (unsigned char*)malloc(0x800000);
for (i=0;i<0x800000;i=i+2){
dst[i+0]=src[j];
dst[i+1]=src[j+0x400000];
j=j++;
}
memcpy(Neo68KROM01,dst,0x800000);
// Load P3d in one of the dummy sections (the last 1mb)
BurnLoadRom(Neo68KROM01+0x700000, 10, 0);
// Make P3d -> 2nd mb
src = Neo68KROM01+0x100000;
dst = (unsigned char*)malloc(0x700000);
int sec[] = {0x600000,0x000000,0x100000,0x200000,0x300000, 0x400000,0x500000};
if (dst)
{
memcpy(dst,src,0x700000);
for(i = 0; i < 7; ++i)
{
memcpy(src+i*0x100000,dst+sec[i],0x100000);
}
}
free(dst);
}
static int kof2003Init()
{
pNeoInitCallback=interleave_ps;
return NeoInit();
}
struct BurnDriver BurnDrvkof2003 = {
{"kof2003", "The King of Fighters 2003", "Preliminary Driver - Not Working", "SNK Playmore Corporation", "Neo Geo", "2003", NULL, "neogeo"},
0, 2, HARDWARE_SNK_NEOGEO,
NULL, kof2003RomInfo, kof2003RomName, neogeoInputInfo, neogeoDIPInfo,
kof2003Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};