Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
+ T +

Old Pro patch for FBA-XXX

Recommended Posts

iq, I can't thank you enough. You're a genius. :lol:

 

With some minor modications, the above code works beautifully. I haven't tested all the sets that this should fix yet but I will later today and all being well should have an updated build ready this evening.

 

Also, you guys might be interested to know that Iriez has graciously allowed me to host future builds of FBA-XXX Pro on xbins as a complete package. Which means no more having to patch the FBA-XXX XBE (which I know many people are having trouble finding now). Of course I will continue to post a patch here for those who prefer doing it this way. ;)

 

BTW, do you post your source ever?

I'd like to take a look at it if you do smile.gif

Check PM. :)

Share this post


Link to post
Share on other sites

That's great news about Xbins. Lots of people have trouble finding the 26/08 version of FBAXXX these days since Gogo's site is gone and it's not on Xbins.

Share this post


Link to post
Share on other sites

UPDATE:

 

The following sets are now correct and working (no more substitute C ROMs):

 

- kog

- lans2004

- svcboot

- svcplus

- svcplusa

- svcsplus

- samsh5bl

 

All credit goes to iq_132. I wouldn't have figured this out in a million years. :lol:. The build is still in patch form only at the moment.

 

 

As a point of interest the only remaining sets that aren't working or using substitute ROMs are as follows:

 

svcchaos - freezes during loading. (must be to do with the size of the P/C ROMs since svchaosa works fine using the exact same code.)

kof2003 - reset loop after HW test. (again kof2003a is fine)

kof2002b/kf2k2pls/kf2k2pla - C ROM code uses NeoSpriteROM.

kof2k3up - P ROM code. (don't remember exactly. will check)

Share this post


Link to post
Share on other sites
svcchaos - freezes during loading. (must be to do with the size of the P/C ROMs since svchaosa works fine using the exact same code.)

kof2003 - reset loop after HW test. (again kof2003a is fine)

kof2002b/kf2k2pls/kf2k2pla - C ROM code uses NeoSpriteROM.

kof2k3up - P ROM code. (don't remember exactly. will check)

I'll see what I can do with these tonight. ;)

Share this post


Link to post
Share on other sites

// King Of Fighters 2002, The (bootleg)

static struct BurnRomInfo kof2002bRomDesc[] = {
{ "265-p1.bin",  0x100000, 0x9EDE7323, 1 | BRF_ESS | BRF_PRG },  //  0 68K code
{ "265-p2b.bin", 0x400000, 0x6DBEE4DF, 1 | BRF_ESS | BRF_PRG },  //  1

//	{ "2k2-s1b.bin", 0x020000, 0x2255F5BF, 2 | BRF_GRA },    //  2 Text data


{ "2k2-c1b.bin", 0x800000, 0xF25D3D66, 3 | BRF_GRA },    //  3 Sprite data
{ "2k2-c2b.bin", 0x800000, 0xE3E66F1D, 3 | BRF_GRA },    //  4
{ "2k2-c3b.bin", 0x800000, 0x8732FA30, 3 | BRF_GRA },    //  5
{ "2k2-c4b.bin", 0x800000, 0x0989FD40, 3 | BRF_GRA },    //  6
{ "2k2-c5b.bin", 0x800000, 0x60635CD2, 3 | BRF_GRA },    //  7
{ "2k2-c6b.bin", 0x800000, 0xBD736824, 3 | BRF_GRA },    //  8
{ "2k2-c7b.bin", 0x800000, 0x2DA8D8CF, 3 | BRF_GRA },    //  9
{ "2k2-c8b.bin", 0x800000, 0x2048404A, 3 | BRF_GRA },    //  10

{ "265-m1_decrypted.bin", 0x020000, 0x1c661a4b, 4 | BRF_ESS | BRF_PRG },  //  11 Z80 code

{ "265-v1.bin",   0x800000, 0x15E8F3F5, 5 | BRF_SND },    // 16
{ "265-v2.bin",   0x800000, 0xDA41D6F9, 5 | BRF_SND },    // 17
};

STDROMPICKEXT(kof2002b, kof2002b, neogeo);
STD_ROM_FN(kof2002b);

static int kof2002bInit()
{
int nRet;
nPCM2=true;

pNeoInitCallback = PCM2DecryptP;

nRet = NeoInit();

if (nRet == 0) {
 PCM2DecryptVInfo Info = { 0x0A5000, 0x000000, { 0xF9, 0xE0, 0x5D, 0xF3, 0xEA, 0x92, 0xBE, 0xEF } };

 PCM2DecryptV(&Info);
}

InitSpritePaging(PAGEFILE, nPCM2spritesize, 256*1024, 76);

InitPageAndFrameTables();

NeoInitSprites();

return nRet;
}

struct BurnDriver BurnDrvkof2002b = {
"kof2002b", "kof2002", "neogeo", "2002",
"King of Fighters 2002, The - Challenge to Ultimate Battle (bootleg)\0", "needs decrypted C ROMs for now", "Eolith / Playmore Corporation", "Neo-Geo",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO,
NULL, kof2002bRomInfo, kof2002bRomName, neogeoInputInfo, neogeoDIPInfo,
kof2002bInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};

 

 

Put this in neo_decrypt.cpp

void kof2002b_gfx_decrypt(unsigned char* src, int size)
{
int t[8][10] =
{
 { 0, 8, 7, 3, 4, 5, 6, 2, 1 },
 { 1, 0, 8, 4, 5, 3, 7, 6, 2 },
 { 2, 1, 0, 3, 4, 5, 8, 7, 6 },
 { 6, 2, 1, 5, 3, 4, 0, 8, 7 },
 { 7, 6, 2, 5, 3, 4, 1, 0, 8 },
 { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
 { 2, 1, 0, 4, 5, 3, 6, 7, 8 },
 { 8, 0, 7, 3, 4, 5, 6, 2, 1 },
};

unsigned char* dst = (unsigned char*)malloc(0x10000);

for (int i = 0; i < size; i+=0x10000)
{
 memcpy(dst, src+i,0x10000);

 for (int j = 0; j < 0x200; j++)
 {
	 int *n = t[(j % 0x40) / 8];
	 int ofst = BITSWAP16(j, 15, 14, 13, 12, 11, 10, 9, n[0], n[1], 
     n[2], n[3], n[4], n[5], n[6], n[7], n[8]);
	 memcpy(src+i+ofst*128, dst+j*128, 128);
 }
}
free(dst);
}

 

neogeo.h

extern void kof2002b_gfx_decrypt(unsigned char* src, int size);

 

neogeo.cpp after the cx decrypt code for svcboot

  if (!strcmp(BurnDrvGetTextA(DRV_NAME), "kof2002b"))
 {
	 kof2002b_gfx_decrypt(SpriteBuf, (dwBytesDone - nSpriteSize));
 }

Share this post


Link to post
Share on other sites

wow, great work guys and nice that Iriez is allowing you to post fba-xxx pro in xbins ;)

Share this post


Link to post
Share on other sites

kof2k3up fix:

 

change your kof2002b_px_decrypt code to this:

static void kof2003b_px_decrypt()
{
/* Descrambling Px by X-or */
unsigned char* src = Neo68KROM;
unsigned char* dst = (unsigned char*)malloc(0x800000);

unsigned int sec[]= {0x700000, 0x000000, 0x100000, 0x200000, 0x300000, 0x400000, 0x500000, 0x600000};
if (dst) {
 memcpy(dst, src, 0x800000);
 for(int i = 0; i < 8; ++i) {
	 memcpy(src + i * 0x100000, dst + sec[i], 0x100000);
 }
 free(dst);
}
}

 

And use this for your kof2k3up decrypt

 

static void kof2k3upDecrypt()
{
kof2003b_px_decrypt();

unsigned char *src = Neo68KROM + 0xfe000;
unsigned char *dst = Neo68KROM + 0xd0610;

for( int i = 0; i < 0x2000 / 2; i++ ) {
 int ofst = (i & 0xff00) + BITSWAP08( (i & 0x00ff), 7, 6, 0, 4, 3, 2, 1, 5 );
 memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 2 );
}
}

Share this post


Link to post
Share on other sites

Does anyone else get scrambled text with lans2004? The games seems to run OK except for that.

Share this post


Link to post
Share on other sites
Does anyone else get scrambled text with lans2004?  The games seems to run OK except for that.

lans2004 was using the wrong S ROM. Will be fixed in the next update. Thanks for reporting. ;)

Share this post


Link to post
Share on other sites

UPDATE:

 

- Corrected lans2004 S ROM.

 

- Enabled new C decryption code for cthd2003/ct2k3a/ct2k3sp (by iq_132)

 

- kof2002b/kf2k2pls/kf2k2pla now working with correct ROMs (by iq_132)

 

- kof2k3up now working with correct ROMs (by iq_132)

 

- Some other small but important tweaks and updates.

 

 

 

EDIT: FBA-XXX Pro v1.01 has now been officially released and is available in the usual places. Also I've started a new discussion thread here:

 

http://www.1emulation.com/forums/index.php?showtopic=17031

 

So if possible, to avoid confusion, could the next mod that reads this please close this one. Thank you. ;)

Edited by + T +

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...