Final Burn Neo > FBN Development

Driver: Crouching Tiger Hidden Dragon 2003 Super Plus! (hack)

<< < (3/3)

FerchogtX:

--- Quote from: KingHanco ---Hmmm...

That weard.

RomCenter people at their forum told me not all the Kawaks roms aren't compatible with FBA.

I couldn't get some of those roms to work and I thought their right about that.

I shouldv'e ask you instead. :)

Some of those roms I get blue wires screen and I try all swaps to get to work. No luck at all.

Yes not all the CRC aren't the same thing. Different levels of same and different dumps.

Have you been to the CAESAR website yet??? There are some things that I learn from there.
--- End quote ---

Well, is hard to believe but, RomCenter people is wrong, all kawaks sets worrk on fba, im gonna explain you:
-FBA is open source, what doees this mean? that fba can be modified by its original program code or source, if you know a lil of programing or have time to read and use your intuition, you can add features to the program you are compiling, in this case FBA, so, you can add WORKING drivers into fba, and even mnore if you invest a lil' of your time and patient.

-Some games need extra configuratiosn, such as the standard fix functions (swaps), in other cases, inits, that needs to know about tha protection involved of the game to be emulated, this can vary (for example, kof2002 p2 protection, of the Neo-PVC protection or bankswitches). sometimes you van get some sets easily working, sometimes you'll need help (such the help that halrin gave to all of us releasing Neo-PVC codes).

As you can see if you want you can make run whatever you want, sometimes you'll need help (like me in this case) but if the program (or emu) is open src, this open a world of posibilities in modifying the prgram itself
See ya!!!!! :D
P.D. Not all that RomCenter people says is the truth, try another version of romcenter (like 2.52 or 2.60) i have that program too and I never had problems with CRC stuff

FerchogtX:
ok... here a fix for ct2003sp, i finally got the way
Driver:

--- Code: ---// Crouching Tiger Hidden Dragon 2003 Super Plus (bootleg / hack)

static struct BurnRomInfo ct2003spRomDesc[] = {
{"5003-p1sp.bin", 0x100000, 0x96ee06bc, 1 | BRF_ESS | BRF_PRG }, // 0 68K code
{"5003-p2sp.bin", 0x200000, 0x2332ee0c, 1 | BRF_ESS | BRF_PRG }, // 1
{"5003-p3sp.bin", 0x200000, 0x017919aa, 1 | BRF_ESS | BRF_PRG }, // 2

{"5003-s1sp.bin", 0x040000, 0x6c355ab4, 2 | BRF_GRA }, // 3 Text layer tiles

{ "5003-c1.bin", ? 0x800000, 0x68F54B67, 3 | BRF_GRA }, // 4 Sprite data
{ "5003-c2.bin", ? 0x800000, 0x2F8849D5, 3 | BRF_GRA }, // 5
{ "5003-c3.bin", ? 0x800000, 0xAC4AFF71, 3 | BRF_GRA }, // 6
{ "5003-c4.bin", ? 0x800000, 0xAFEF5D66, 3 | BRF_GRA }, // 7
{ "5003-c5.bin", ? 0x800000, 0xC7C1AE50, 3 | BRF_GRA }, // 8
{ "5003-c6.bin", ? 0x800000, 0x613197F9, 3 | BRF_GRA }, // 9
{ "5003-c7.bin", ? 0x800000, 0x64DDFE0F, 3 | BRF_GRA }, // 10
{ "5003-c8.bin", ? 0x800000, 0x917A1439, 3 | BRF_GRA }, // 11

{ "5003-m1.bin", ? 0x020000, 0x1A8C274B, 4 | BRF_ESS | BRF_PRG }, // 12 Z80 code

{ "262-v1.bin", ?  0x400000, 0x83D49ECF, 5 | BRF_SND }, // 13 Sound data
{ "262-v2.bin", ?  0x400000, 0x003F1843, 5 | BRF_SND }, // 14
{ "262-v3.bin", ?  0x400000, 0x2AE38DBE, 5 | BRF_SND }, // 15
{ "262-v4.bin", ?  0x400000, 0x26EC4DD9, 5 | BRF_SND }, // 16
};

STDROMPICKEXT(ct2003sp, ct2003sp, neogeo);
STD_ROM_FN(ct2003sp);

static void ct2003spDecrypt()
{
unsigned char* pTemp = (unsigned char*)malloc(0x500000);
if (pTemp) {
unsigned int nBank[] = {0x400000,0x000000,0x100000,0x200000,0x300000};
memcpy(pTemp, Neo68KROM, 0x500000);

for (int i = 0; i < 5; i++) {
memcpy(Neo68KROM + i * 0x100000, pTemp + nBank[i], 0x100000);
}
free(pTemp);
}

extern unsigned char* NeoZ80ROM;
unsigned char* tmp = (unsigned char*)malloc(0x020000);

memcpy(tmp + 0 * 0x8000, NeoZ80ROM + 0 * 0x8000, 0x8000);
memcpy(tmp + 1 * 0x8000, NeoZ80ROM + 2 * 0x8000, 0x8000);
memcpy(tmp + 2 * 0x8000, NeoZ80ROM + 1 * 0x8000, 0x8000);
memcpy(tmp + 3 * 0x8000, NeoZ80ROM + 3 * 0x8000, 0x8000);
memcpy(NeoZ80ROM, tmp, 0x20000);
free(tmp);

DoPerm(0);
}

static int ct2003spInit()
{
int nRet;
pNeoInitCallback = ct2003spDecrypt;
pNeoBankswitchCallback = NeoMapBank;
nNeoTextROMFixType = 4;

  nRet = NeoInit();
if (nRet == 0) {
SekOpen(0);

// Install bankswitch handler
// There is some 68K issues in the character sellect screen
// on this game, overclocking the 68K CPU prevents it.
SekMapHandler(4, 0x200000, 0x2FFFFF, SM_WRITE);
SekSetWriteWordHandler(4, cthd2003WriteWordBankswitch);
SekSetWriteByteHandler(4, cthd2003WriteByteBankswitch);
cthd2003Bankswitch(0);

SekClose();
}
return nRet;
}

struct BurnDriver BurnDrvct2003sp = {
"ct2003sp", "cthd2003", "neogeo", "2003",
"Crouching Tiger Hidden Dragon 2003 Super Plus\0", "Hack of \"Crouching Tiger Hidden Dragon 2003\"", "Phenixsoft", "Neo Geo",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_BOOTLEG | BDF_CLONE, 2, HARDWARE_SNK_NEOGEO,
NULL, ct2003spRomInfo, ct2003spRomName, neogeoInputInfo, neogeoDIPInfo,
ct2003spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
--- End code ---
In neorun.cpp you must have this (with the whole int definitions):

--- Code: ---// Load Text layer tiledata
{
// Load boardROM data
BurnLoadRom(NeoTextROM, 0x00080 + 0x14, 1);

if (pInfo->nTextOffset != -1) {
// Load S ROM data
BurnLoadRom(NeoTextROM + 0x020000, pInfo->nTextOffset, 1);

switch (nNeoTextROMFixType) {
// Original code for MAME by fataku
case 1: {
for ( int i = 0; i < 0x20000; i++ ) {
(NeoTextROM+0x20000)[i] = BITSWAP08((NeoTextROM+0x20000)[i],3,2,4,5,1,6,0,7);
}
break;
}
// Original code from mame traduced by FerchogtX
case 2: {
unsigned char* tmp = (unsigned char*)malloc(0x20000);
memcpy( tmp + 0x000000, NeoTextROM + 0x020000 + 0x010000, 0x010000 );
memcpy( tmp + 0x010000, NeoTextROM + 0x020000 + 0x000000, 0x010000 );
memcpy( NeoTextROM + 0x20000, tmp, 0x020000 );
free( tmp );
break;
}
// Thanks also to HappyASR for the info
case 3: {
unsigned char* tmp = (unsigned char*)malloc(0x20000);
if (tmp) {
memcpy( tmp, NeoTextROM + 0x20000, 0x20000 );
// descrambling the S1 by dorriGa
for ( int j = 0; j < 0x20000; j += 0x000010 ) {
memcpy( NeoTextROM + 0x20000 + j, tmp + j + 0x000008, 8);
memcpy( NeoTextROM + 0x20000 + j + 0x000008, tmp + j, 8);
}
}
free( tmp );
break;
}
// Original code by HalRIN
case 4: {
unsigned char* tmp = (unsigned char*)malloc(0x40000);
int i, ofst;

memcpy( tmp, NeoTextROM + 0x20000, 0x40000 );
for( i = 0; i < 0x40000; i++ ) {
ofst = BITSWAP24((i & 0x1ffff),23,22,21,20,19,18,17,3,0,1,4,2,
13,14,16,15,5,6,11,10,9,8,7,12);
ofst += (i >> 17) << 17;
(NeoTextROM+0x20000)[i] = tmp[ofst];
}
memcpy( tmp, NeoTextROM + 0x20000, 0x40000 );
memcpy( NeoTextROM + 0x20000 + 0x08000, tmp + 0x10000, 0x8000 );
memcpy( NeoTextROM + 0x20000 + 0x10000, tmp + 0x08000, 0x8000 );
memcpy( NeoTextROM + 0x20000 + 0x28000, tmp + 0x30000, 0x8000 );
memcpy( NeoTextROM + 0x20000 + 0x30000, tmp + 0x28000, 0x8000 );
free( tmp );
break;
}
// Converted by Jimmy_Page (www.neofighters.com)
case 5: {
for ( int i = 0; i < 0x20000; i++ ) {
(NeoTextROM+0x20000)[i] = BITSWAP08((NeoTextROM+0x20000)[i],7,6,0,4,3,2,1,5);
}
break;
}
// Thanks to IQ_132, this is to keep saving the descrambled data when needed
case 6: {
kof2002b_gfx_decrypt(NeoTextROM + 0x20000, 0x20000);
break;
}
}
} else {
// Extract data from the end of C ROMS
BurnUpdateProgress(0.0, _T("Generating text layer graphics..."), 0);
NeoExtractSData(NeoSpriteROM, NeoTextROM + 0x020000, nSpriteSize, nNeoTextROMSize);

// Original convertion by IQ_132 (This is for svcchaos, kof2003 and clones)
if (nNeoTextROMFixType == 7) {
for( int i = 0; i < nNeoTextROMSize; i++ ) {
(NeoTextROM+0x20000)[i] = BITSWAP08((NeoTextROM+0x20000)[i]^0xd2,4,0,7,2,5,1,6,3);
}
}
}
}
--- End code ---
and finally: neo_text.cpp
Look for this:

--- Code: ---if (nNeoTextROMSize > 0x020000) {
if (BurnDrvGetHardwareCode() & HARDWARE_SNK_ALTERNATE_TEXT) {
nBankswitch = 2;

// Precompute lookup-tables
for (int x = nMinX; x < nMaxX; x++) {
nBankLookupAddress[x] = (x / 6) << 5;
nBankLookupShift[x] = (5 - (x % 6)) << 1;
}

} else {
nBankswitch = 1;
}
}
--- End code ---
Replace with this:

--- Code: ---if (nNeoTextROMSize > 0x020000 && nNeoTextROMSize != 0x040000) {
if (BurnDrvGetHardwareCode() & HARDWARE_SNK_ALTERNATE_TEXT) {
nBankswitch = 2;

// Precompute lookup-tables
for (int x = nMinX; x < nMaxX; x++) {
nBankLookupAddress[x] = (x / 6) << 5;
nBankLookupShift[x] = (5 - (x % 6)) << 1;
}

} else {
nBankswitch = 1;
}
}
--- End code ---
Now ct2003sp runs perfectly
See ya!!!!! :D

bms888:
Nice job,FerchogtX!

iq_132:
Nice :)  But wouldn't this be much easier?


--- Code: ---if (nNeoTextROMSize > 0x040000) {
if (BurnDrvGetHardwareCode() & HARDWARE_SNK_ALTERNATE_TEXT) {
nBankswitch = 2;

// Precompute lookup-tables
for (int x = nMinX; x < nMaxX; x++) {
nBankLookupAddress[x] = (x / 6)

FerchogtX:
That breaks suport for 128 KB extracted data from C-ROMs (at least that i did before and got probs with other games)
See ya!!!! :D

Navigation

[0] Message Index

[*] Previous page

Go to full version