Final Burn Neo > FBN Development

The King of Fighters Special Edition 2004 (hack & Plus drivers)

(1/5) > >>

FerchogtX:
Maye this can help you to add this games, they use it's original lyouts, at least the normal version does, i'm not sire about the plus bootleg, Thanks to KanyEr0 for the infos...

--- Code: ---// The King of Fighters Special Edition 2004 (hack)
// ================================================================================
/* Hack of The KIng of Fighters 2002 like cthd2003, but this cart only have a litle
   disorder in the 68K... p1 is p2 and is scrambled and p2 and p3 are the 1st and
   2nd chunks of p1 respectivectly, only 4 C-ROMs, s1, v-ROMs, m1 and p-ROMs have
   changed, the others come from kof2k2nd set... not really a good hack BTW */
// ================================================================================
static struct BurnRomInfo kofse2k4RomDesc[] = {
{"2k4-p2.bin", 0x080000, 0x21a84084, 0x10}, //  0 68K code
{"2k4-p3.bin", 0x080000, 0xfebb484e, 0x10}, //  1
{"2k4-p1.bin", 0x400000, 0xe6c50566, 0x10}, //  2

{"2k4-s1.bin", 0x020000, 0xa3c9b2d8,    1}, //  3 Text data

{"2k4-c1.bin", 0x800000, 0x7a050288,    1}, //  4 Sprite data
{"2k4-c2.bin", 0x800000, 0xe924afcf,    1}, //  5
{"2k4-c3.bin", 0x800000, 0x959fad0b,    1}, //  6  (Same as kof2k2nd)
{"2k4-c4.bin", 0x800000, 0xefe6a468,    1}, //  7  (Same as kof2k2nd)
{"2k4-c5.bin", 0x800000, 0x74bba7c6,    1}, //  8  (Same as kof2k2nd)
{"2k4-c6.bin", 0x800000, 0xe20d2216,    1}, //  9  (Same as kof2k2nd)
{"2k4-c7.bin", 0x800000, 0xfa705b2b,    1}, //  10 Text data removed
{"2k4-c8.bin", 0x800000, 0x2c912ff9,    1}, //  11 Text data removed

{"2k4-m1.bin", 0x020000, 0x5a47d9ad, 0x10}, //  12 Z80 code

{"2k4-v1.bin", 0x800000, 0xb887d287,    2}, //  13 Sound data
{"2k4-v2.bin", 0x800000, 0x8ad2edbd,    2}, //  14 (seems that the original is watermarked...)
};

STDROMPICKEXT(kofse2k4, kofse2k4, neogeo);
STD_ROM_FN(kofse2k4);

static void kofse2k4Decrypt()
{
// Original code by IQ_132 (http://neosource.1emu.net/)
unsigned char* src = Neo68KROM01+0x100000;
unsigned char* dst = (unsigned char*)malloc(0x400000);
int sec[] = {0x300000,0x200000,0x100000,0x000000};
if (dst)
{
memcpy(dst,src,0x400000);
for(int i=0; i<4; ++i) {
memcpy(src+i*0x100000,dst+sec[i],0x100000);
}
free(dst);
}
}

static int kofse2k4Init()
{
pNeoInitCallback = kofse2k4Decrypt;
nADPCMByteswap = 5;
return NeoInit();
}

struct BurnDriver BurnDrvkofse2k4 = {
{"kofse2k4", "The King of Fighters Special Edition 2004 (hack)", "Hack of kof2002", "Dragon Co.", "Neo Geo", "2004", "kof2002", "neogeo"},
BDF_GAME_WORKING | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO,
NULL, kofse2k4RomInfo, kofse2k4RomName, neogeoInputInfo, neogeoDIPInfo,
kofse2k4Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};

// The King of Fighters Special Edition 2004 Plus! (hack)

static struct BurnRomInfo kfs2k4plRomDesc[] = {
{"2k4-p1p.bin",0x200000, 0xed97c684, 0x10}, //  0 68K code (scrambled)
{"2k4-p2p.bin",0x400000, 0xe6c50566, 0x10}, //  1 (is the same as 2k4-p1.bin)

{"2k4-s1p.bin",0x020000, 0xcc0ab564,    1}, //  2 Text data (scrambled)

{"2k4-c1.bin", 0x800000, 0x7a050288,    1}, //  3 Sprite data
{"2k4-c2.bin", 0x800000, 0xe924afcf,    1}, //  4
{"2k4-c3.bin", 0x800000, 0x959fad0b,    1}, //  5
{"2k4-c4.bin", 0x800000, 0xefe6a468,    1}, //  6
{"2k4-c5.bin", 0x800000, 0x74bba7c6,    1}, //  7
{"2k4-c6.bin", 0x800000, 0xe20d2216,    1}, //  8
{"2k4-c7.bin", 0x800000, 0xfa705b2b,    1}, //  9
{"2k4-c8.bin", 0x800000, 0x2c912ff9,    1}, //  10

{"2k4-m1.bin", 0x020000, 0x5a47d9ad, 0x10}, //  11 Z80 code

{"2k4-v1.bin", 0x800000, 0xb887d287,    2}, //  12 Sound data
{"2k4-v2.bin", 0x800000, 0x8ad2edbd,    2}, //  13
};

STDROMPICKEXT(kfs2k4pl, kfs2k4pl, neogeo);
STD_ROM_FN(kfs2k4pl);

static void kfs2k4plDecrypt()
{
// Thanks to KanyEr0 for the info, init by FerchogtX
unsigned char *src = Neo68KROM01;
unsigned char *dst = (unsigned char*)malloc(0x600000);
/* P1-ROM is scrambled in 128 chunks, so we load them
  in the correct places, the second MB isn't loaded
  because has only repeated data */
memcpy( dst+0x000000, src+0x1A0000, 0x020000 ); // 128 KB
memcpy( dst+0x020000, src+0x080000, 0x020000 ); // 128 KB
memcpy( dst+0x040000, src+0x140000, 0x020000 ); // 128 KB
memcpy( dst+0x060000, src+0x000000, 0x020000 ); // 128 KB
memcpy( dst+0x080000, src+0x180000, 0x020000 ); // 128 KB
memcpy( dst+0x0A0000, src+0x0A0000, 0x020000 ); // 128 KB
memcpy( dst+0x0C0000, src+0x100000, 0x020000 ); // 128 KB
memcpy( dst+0x0E0000, src+0x040000, 0x020000 ); // 128 KB
/* Now we descramble P2-ROM and load it after the
  1st MB of P1-ROM, is the same as kofse2k4's P1-ROM */
memcpy( dst+0x100000, src+0x500000, 0x100000 ); // 1 MB
memcpy( dst+0x200000, src+0x400000, 0x100000 ); // 1 MB
memcpy( dst+0x300000, src+0x300000, 0x100000 ); // 1 MB
memcpy( dst+0x400000, src+0x200000, 0x100000 ); // 1 MB
/* Finally, the whole ROM is copied in memory with
  the correct data */
memcpy( src, dst, 0x600000 ); // last MB is dummy data
free(dst);
}

static int kfs2k4plInit()
{
pNeoInitCallback = kfs2k4plDecrypt;
nADPCMByteswap = 7;
nNeoTextROMFixType = 3;
return NeoInit();
}

struct BurnDriver BurnDrvkfs2k4pl = {
{"kfs2k4pl", "The King of Fighters Special Edition 2004 Plus! (hack)", "Hack of kofse2k4", "Dragon Co.", "Neo Geo", "2004", "kofse2k4", "neogeo"},
BDF_GAME_WORKING | BDF_BOOTLEG | BDF_CLONE, 2, HARDWARE_SNK_NEOGEO,
NULL, kfs2k4plRomInfo, kfs2k4plRomName, neogeoInputInfo, neogeoDIPInfo,
kfs2k4plInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
--- End code ---
in neogeo.h add this:

--- Code: ---extern int nADPCMByteswap;
--- End code ---
in neo_run.cpp look for this:

--- Code: ---int nNeoSRAMProtection = -1;
--- End code ---
add this after:

--- Code: ---int nADPCMByteswap = 0; // Simple byteswap for svcboot and clones/matrim and clones
--- End code ---
now look for this:

--- Code: ---if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SWAPV) {
for (int i = 0; i < 0x00200000; i++) {
unsigned char n = YM2610ADPCMAROM[i];
YM2610ADPCMAROM[i] = YM2610ADPCMAROM[0x00200000 + i];
YM2610ADPCMAROM[0x00200000 + i] = n;
}
}
}
--- End code ---
or look for any IQ_132 PCM2 codes and add this after:

--- Code: --- // This is for kofse2k4
if (nADPCMByteswap == 5) {
// load the roms in the correct order
BurnLoadRom(YM2610ADPCMAROM+0x000000, 14, 1); // V2->V1
BurnLoadRom(YM2610ADPCMAROM+0x800000, 13, 1); // V1->V2
}
// This is for kfs2k4pl
if (nADPCMByteswap == 7) {
// load the roms in the correct order
BurnLoadRom(YM2610ADPCMAROM+0x000000, 13, 1); // V2->V1
BurnLoadRom(YM2610ADPCMAROM+0x800000, 12, 1); // V1->V2
}
--- End code ---
in neoexit() function add this:

--- Code: ---nADPCMByteswap  = 0;
--- End code ---
for NeoTextROMFixType refer to the according thread in the forum
See ya!!!!! :D
P.D. The roms can be found in a chinisse forum called PPX BBS... i don't know if i can post the url here so, search by yourself

James33:
Dam I know the forum But i cannot read it :( So it looks like I have to wait longer .

JiMMy_PaGe:
Good work ferchogtx ! :D :D
BTW, i tried to create a code for it too, but when i saw alot equal 128kb chunks i give it out lol, thanks for the code bro  ;)
See ya  :cool:

JiMMy_PaGe:
Here's a small modification i made on iq's code, to run the p1 on the first part:

--- Code: --- {"2k4-p1.bin", 0x400000, 0xe6c50566, 0x10}, //  0 68K code
        {"2k4-p2.bin", 0x080000, 0x21a84084, 0x10}, //  1
{"2k4-p3.bin", 0x080000, 0xfebb484e, 0x10}, //  2
--- End code ---



--- Code: ---static void kofse2k4Decrypt()
/* Converted to FBA code by IQ_132 (bbs.romshare.net)
 Small modification by JiMMy_PaGe (www.neofighters.com.br)*/
{
unsigned char* src = Neo68KROM01;
unsigned char* dst = (unsigned char*)malloc(0x500000);

int sec[] = {0x400000,0x300000,0x200000,0x100000,0x000000};
if (dst)
{
memcpy(dst,src,0x500000);

for(int i = 0; i < 5; ++i)
{
memcpy(src+i*0x100000,dst+sec[i],0x100000);
}
free(dst);
}
}
--- End code ---

bms888:
Good,everybody!

It's my nADPCMByteswap code,maybe small, just 1 - 4, not  1 - 7,^_^.


--- Code: ---
// 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; iV1
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

Navigation

[0] Message Index

[#] Next page

Go to full version