Author Topic: King of Fighters 2003, The  (Read 27860 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #15 on: December 27, 2004, 11:14:11 PM »
Quote from: FerchogtX
Just to fix that, if you add the othe code the games that use scrambled s1 roms won't work XD

Actually, I'm using this exact code:
Code: [Select]
// 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);
} else {
// Extract data from the end of C ROMS
BurnUpdateProgress(0.0, "Generating text layer graphics...", 0);
NeoExtractSData(NeoSpriteROM, NeoTextROM + 0x020000, nSpriteSize, nNeoTextROMSize);

// Save "S" data
if (bsavedecrypteds1 == 1) {
FILE* fp = fopen("xxx_s_rom.bin", "wb");
if (fp) {
fwrite(NeoTextROM + 0x020000, 1, nNeoTextROMSize, fp);
fclose(fp);
}
}
}

/* Original code from mame - converted by FerchogtX */
switch (nNeoTextROMFixType) {
unsigned char *srom;
unsigned char *dst;

case 1:
/* Thanks also to HappyASR for the info */
srom = NeoTextROM + 0x20000;
dst  = (unsigned char *)malloc(0x20000);
if (dst) {
memcpy(dst, srom, 0x20000);
// descrambling the S1 by dorriGa
for (int j = 0; j < 0x20000 ; j += 0x000010) {
memcpy(srom + j, dst + j + 0x000008, 8);
memcpy(srom + j + 0x000008, dst + j, 8);
}
}
free(dst);
break;

case 2:
/* Thanks to Badzou for the info */
/* Descrambling S1 by dorriga */
srom = NeoTextROM + 0x20000;
dst  = (unsigned char*)malloc(0x80000);
memcpy(dst + 0x00000, srom + 0x60000, 0x20000);
memcpy(dst + 0x20000, srom + 0x40000, 0x20000);
memcpy(dst + 0x40000, srom + 0x20000, 0x20000);
memcpy(dst + 0x60000, srom + 0x00000, 0x20000);
memcpy(srom, dst, 0x80000);
free(dst);
break;

case 3:
/* Descrambling S1 by FerchogtX, based on DorriGa's code */
srom = NeoTextROM+0x20000;
dst = (unsigned char*)malloc(0x20000);
memcpy( dst+0x00000, srom+0x10000, 0x10000 );
memcpy( dst+0x10000, srom+0x00000, 0x10000 );
memcpy( srom, dst, 0x20000 );
free(dst);
break;

case 4:
/* Original code for MAME by fataku */
/* This is for kf2k1pla */
       srom = NeoTextROM+0x20000;
       for (int i=0;i<0x20000;i++)
       srom[i]=BITSWAP08(srom[i],3,2,4,5,1,6,0,7);
break;

case 5:
/* Original code taken from MAME */
/* This is for CTHD2003 */
srom = NeoTextROM+0x20000;
dst = (unsigned char*)malloc(0x10000);
memcpy(dst+0x00000,srom+0x10000,0x08000);
memcpy(dst+0x08000,srom+0x08000,0x08000);
memcpy(srom+0x08000,dst,0x10000);
free(dst);
break;
case 6:
// Converted by Jimmy_Page
srom = NeoTextROM+0x20000;
       for (int i=0;i<0x20000;i++)
       srom[i]=BITSWAP08(srom[i],7,6,0,4,3,2,1,5);
break;
case 7:
srom = NeoTextROM+0x20000;  
       for (int i=0;i srom[i]=BITSWAP08(srom[i]^0xd2,4,0,7,2,5,1,6,3 );
break;
case 8:
       // thanks to dorriGa and arnoldso for analyze the scramble
       srom = NeoTextROM+0x20000;
       dst = (unsigned char*)malloc(0x40000);
       int j;

       for (int i=0;i<0x40000;i++){
           j=BITSWAP24(i,23,22,21,20,19,18,17,9,8,10,11,0,5,4,3,2,1,6,7,13,16,12,14,15);
           dst[j]=srom[i];
       }
memcpy( srom, dst, 0x40000 );
free( dst );

break;

}
/* Save S1 roms */
if (bsavedecrypteds1 == 1) {
FILE* fp = fopen("xxx_s_rom.bin", "wb");
if (fp) {
fwrite(NeoTextROM + 0x020000, 1, nNeoTextROMSize, fp);
fclose(fp);
}
}
}

And the S descrambling works fine.


Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
King of Fighters 2003, The
« Reply #16 on: December 28, 2004, 07:57:12 PM »
You mean that ct2003sp s1 rom is working fine with your code? you are using the 256 KB s1 ROM... right?
See ya!!!!! :D

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #17 on: December 28, 2004, 10:02:39 PM »
Quote from: FerchogtX
You mean that ct2003sp s1 rom is working fine with your code? you are using the 256 KB s1 ROM... right?
See ya!!!!! :D

Well... the cthd2003sp S decryption doesn't work for me either, but the rest of those do.


Offline JiMMy_PaGe

  • Expert
  • *****
  • Posts: 60
  • Karma: +2/-0
    • SNK-NeoFighters
King of Fighters 2003, The
« Reply #18 on: December 28, 2004, 10:18:11 PM »
In fact ct2k3sp 256kb  s1 is a fake by someone....
The real s1 is the first 128kb chunk of it, and if u see the second chunk is the same as the first one (james33 said it some days before too) :D
Im using this code, but the s1 has a glitch on the game's logo:
Code: [Select]
   /*Original Code by Halrin, Converted by JiMMy_PaGe
            This is for cthd2003 super plus s1*/
case 8:
                                srom = NeoTextROM+0x20000;
                       dst  = (unsigned char*)malloc( 0x20000 );
                                int i, j;
                          memcpy( dst, srom, 0x20000 );
                              for( i = 0; i < 0x20000; i++ ){
               j= BITSWAP24( (i & 0x1ffff), 23, 22, 21, 20, 19, 18, 17,  3,
 0,  1,  4,  2, 13, 14, 15, 16,
 5,  6, 11, 10,  9,  8,  7, 12 );

                      j += (i >> 17) << 17;
                  srom[i] = dst[j];
                              }
                        free( dst );
                                break:

Offline fataku

  • Newbies
  • *
  • Posts: 22
  • Karma: +0/-0
  • Junior Member
King of Fighters 2003, The
« Reply #19 on: December 29, 2004, 12:38:00 PM »
Quote from: Jimmy_Page
In fact ct2k3sp 256kb  s1 is a fake by someone....
The real s1 is the first 128kb chunk of it, ...

 :rolleyes: you are WRONG

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
King of Fighters 2003, The
« Reply #20 on: December 29, 2004, 12:42:14 PM »
Quote from: fataku
:rolleyes: you are WRONG

I hate to admit it XD, but the s1 is of 256 KB, not 128, the real chip that stores this data in the bootleg has that size of data...
:( See ya!!!! :(

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline XorXe

  • Newbies
  • *
  • Posts: 34
  • Karma: +0/-0
  • Learning 4 Masters ^^
King of Fighters 2003, The
« Reply #21 on: December 29, 2004, 02:14:13 PM »
Hi guys i have a troubles only see the images







And i use the small version of k2k3fix.cpp

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #22 on: December 29, 2004, 02:39:24 PM »
Use a different bios (I'm assuming you're using the a Jap bios).  I bet it works perfectly with unibios or US/ASIA bios.


Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
King of Fighters 2003, The
« Reply #23 on: December 29, 2004, 06:47:30 PM »
have you tried with big version? tht's the one we all use and works just fine, just remember to do a clean compile after replacing the small version with the big one
See ya!!!! :D

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline JiMMy_PaGe

  • Expert
  • *****
  • Posts: 60
  • Karma: +2/-0
    • SNK-NeoFighters
King of Fighters 2003, The
« Reply #24 on: December 29, 2004, 08:46:02 PM »
Quote from: fataku
:rolleyes: you are WRONG

thats very strange  :confused:
Why a bootleg board would use two 128k s1 with the same data ?
But u always have good infos.... so i cant doubt from what u say  ;)
Any way i will keep using the first chunk of it.... because it works good
see ya

Offline PRican25

  • Newbies
  • *
  • Posts: 44
  • Karma: +0/-0
  • Balla Bori Balla
King of Fighters 2003, The
« Reply #25 on: December 29, 2004, 10:33:35 PM »
i'm getting probs trying to compile:
Code: [Select]
src/burn/neogeo/d_neogeo.cpp: In function `void cthd2003_c()':
src/burn/neogeo/d_neogeo.cpp:7579: warning: `void cthd2003_c()' was declared
   `extern' and later `static'
src/burn/neogeo/neogeo.h:33: warning: previous declaration of `void
   cthd2003_c()'
src/burn/neogeo/d_neogeo.cpp: In function `void cthd2003_c()':
src/burn/neogeo/d_neogeo.cpp:7581: warning: suggest parentheses around
   assignment used as truth value
src/burn/neogeo/d_neogeo.cpp: In function `void interleave_pdata()':
src/burn/neogeo/d_neogeo.cpp:8393: redefinition of `void interleave_pdata()'
src/burn/neogeo/d_neogeo.cpp:8154: `void interleave_pdata()' previously defined

   here
src/burn/neogeo/d_neogeo.cpp:8393: redefinition of `void interleave_pdata()'
src/burn/neogeo/d_neogeo.cpp:8154: `void interleave_pdata()' previously defined

   here
src/burn/neogeo/d_neogeo.cpp: In function `void kof2003_px_decrypt()':
src/burn/neogeo/d_neogeo.cpp:8464: call of overloaded `interleave_pdata()' is
   ambiguous
src/burn/neogeo/d_neogeo.cpp:8154: candidates are: void interleave_pdata()
src/burn/neogeo/d_neogeo.cpp:8393:                 void interleave_pdata()
src/burn/neogeo/d_neogeo.cpp: At global scope:
src/burn/neogeo/d_neogeo.cpp:8584: redefinition of `short unsigned int
   kof2003b_tbl[4096]'
src/burn/neogeo/d_neogeo.cpp:8480: `short unsigned int kof2003b_tbl[4096]'
   previously declared here
src/burn/neogeo/d_neogeo.cpp: In function `unsigned char
   kof2003bReadByteBankSwitch(unsigned int)':
src/burn/neogeo/d_neogeo.cpp:8588: redefinition of `unsigned char
   kof2003bReadByteBankSwitch(unsigned int)'
src/burn/neogeo/d_neogeo.cpp:8483: `unsigned char
   kof2003bReadByteBankSwitch(unsigned int)' previously defined here
src/burn/neogeo/d_neogeo.cpp:8588: redefinition of `unsigned char
   kof2003bReadByteBankSwitch(unsigned int)'
src/burn/neogeo/d_neogeo.cpp:8483: `unsigned char
   kof2003bReadByteBankSwitch(unsigned int)' previously defined here
src/burn/neogeo/d_neogeo.cpp: In function `short unsigned int
   kof2003bReadWordBankSwitch(unsigned int)':
src/burn/neogeo/d_neogeo.cpp:8594: redefinition of `short unsigned int
   kof2003bReadWordBankSwitch(unsigned int)'
src/burn/neogeo/d_neogeo.cpp:8488: `short unsigned int
   kof2003bReadWordBankSwitch(unsigned int)' previously defined here
src/burn/neogeo/d_neogeo.cpp:8594: redefinition of `short unsigned int
   kof2003bReadWordBankSwitch(unsigned int)'
src/burn/neogeo/d_neogeo.cpp:8488: `short unsigned int
   kof2003bReadWordBankSwitch(unsigned int)' previously defined here
src/burn/neogeo/d_neogeo.cpp: In function `void
   kof2003bWriteBankSwitch(unsigned int, short unsigned int, short unsigned
   int)':
src/burn/neogeo/d_neogeo.cpp:8599: redefinition of `void
   kof2003bWriteBankSwitch(unsigned int, short unsigned int, short unsigned
   int)'
src/burn/neogeo/d_neogeo.cpp:8493: `void kof2003bWriteBankSwitch(unsigned int,
   short unsigned int, short unsigned int)' previously defined here
src/burn/neogeo/d_neogeo.cpp:8599: redefinition of `void
   kof2003bWriteBankSwitch(unsigned int, short unsigned int, short unsigned
   int)'
src/burn/neogeo/d_neogeo.cpp:8493: `void kof2003bWriteBankSwitch(unsigned int,
   short unsigned int, short unsigned int)' previously defined here
src/burn/neogeo/d_neogeo.cpp: In function `void
   kof2003bWriteWordBankSwitch(unsigned int, short unsigned int)':
src/burn/neogeo/d_neogeo.cpp:8612: redefinition of `void
   kof2003bWriteWordBankSwitch(unsigned int, short unsigned int)'
src/burn/neogeo/d_neogeo.cpp:8506: `void kof2003bWriteWordBankSwitch(unsigned
   int, short unsigned int)' previously defined here
src/burn/neogeo/d_neogeo.cpp:8612: redefinition of `void
   kof2003bWriteWordBankSwitch(unsigned int, short unsigned int)'
src/burn/neogeo/d_neogeo.cpp:8506: `void kof2003bWriteWordBankSwitch(unsigned
   int, short unsigned int)' previously defined here
src/burn/neogeo/d_neogeo.cpp:8614: call of overloaded `kof2003bWriteBankSwitch(
   unsigned int&, short unsigned int&, short unsigned int&)' is ambiguous
src/burn/neogeo/d_neogeo.cpp:8493: candidates are: void
   kof2003bWriteBankSwitch(unsigned int, short unsigned int, short unsigned
   int)
src/burn/neogeo/d_neogeo.cpp:8599:                 void
   kof2003bWriteBankSwitch(unsigned int, short unsigned int, short unsigned
   int)
src/burn/neogeo/d_neogeo.cpp: In function `void
   kof2003bWriteByteBankSwitch(unsigned int, unsigned char)':
src/burn/neogeo/d_neogeo.cpp:8618: redefinition of `void
   kof2003bWriteByteBankSwitch(unsigned int, unsigned char)'
src/burn/neogeo/d_neogeo.cpp:8512: `void kof2003bWriteByteBankSwitch(unsigned
   int, unsigned char)' previously defined here
src/burn/neogeo/d_neogeo.cpp:8618: redefinition of `void
   kof2003bWriteByteBankSwitch(unsigned int, unsigned char)'
src/burn/neogeo/d_neogeo.cpp:8512: `void kof2003bWriteByteBankSwitch(unsigned
   int, unsigned char)' previously defined here
src/burn/neogeo/d_neogeo.cpp:8627: call of overloaded `kof2003bWriteBankSwitch(
   unsigned int&, short unsigned int&, short unsigned int&)' is ambiguous
src/burn/neogeo/d_neogeo.cpp:8493: candidates are: void
   kof2003bWriteBankSwitch(unsigned int, short unsigned int, short unsigned
   int)
src/burn/neogeo/d_neogeo.cpp:8599:                 void
   kof2003bWriteBankSwitch(unsigned int, short unsigned int, short unsigned
   int)
src/burn/neogeo/d_neogeo.cpp: In function `void kof2003bMapHandler()':
src/burn/neogeo/d_neogeo.cpp:8638: redefinition of `void kof2003bMapHandler()'
src/burn/neogeo/d_neogeo.cpp:8524: `void kof2003bMapHandler()' previously
   defined here
src/burn/neogeo/d_neogeo.cpp:8638: redefinition of `void kof2003bMapHandler()'
src/burn/neogeo/d_neogeo.cpp:8524: `void kof2003bMapHandler()' previously
   defined here
src/burn/neogeo/d_neogeo.cpp:8641: converting overloaded function `
   kof2003bReadWordBankSwitch' to type `short unsigned int (*)(unsigned int)'
   is ambiguous
src/burn/neogeo/d_neogeo.cpp:8488: candidates are: short unsigned int
   kof2003bReadWordBankSwitch(unsigned int)
src/burn/neogeo/d_neogeo.cpp:8594:                 short unsigned int
   kof2003bReadWordBankSwitch(unsigned int)
src/burn/neogeo/d_neogeo.cpp:8642: converting overloaded function `
   kof2003bReadByteBankSwitch' to type `unsigned char (*)(unsigned int)' is
   ambiguous
src/burn/neogeo/d_neogeo.cpp:8483: candidates are: unsigned char
   kof2003bReadByteBankSwitch(unsigned int)
src/burn/neogeo/d_neogeo.cpp:8588:                 unsigned char
   kof2003bReadByteBankSwitch(unsigned int)
src/burn/neogeo/d_neogeo.cpp:8645: converting overloaded function `
   kof2003bWriteWordBankSwitch' to type `void (*)(unsigned int, short unsigned
   int)' is ambiguous
src/burn/neogeo/d_neogeo.cpp:8506: candidates are: void
   kof2003bWriteWordBankSwitch(unsigned int, short unsigned int)
src/burn/neogeo/d_neogeo.cpp:8612:                 void
   kof2003bWriteWordBankSwitch(unsigned int, short unsigned int)
src/burn/neogeo/d_neogeo.cpp:8646: converting overloaded function `
   kof2003bWriteByteBankSwitch' to type `void (*)(unsigned int, unsigned char)'

   is ambiguous
src/burn/neogeo/d_neogeo.cpp:8512: candidates are: void
   kof2003bWriteByteBankSwitch(unsigned int, unsigned char)
src/burn/neogeo/d_neogeo.cpp:8618:                 void
   kof2003bWriteByteBankSwitch(unsigned int, unsigned char)
src/burn/neogeo/d_neogeo.cpp: In function `int kof2003bInit()':
src/burn/neogeo/d_neogeo.cpp:8659: call of overloaded `kof2003bMapHandler()' is

   ambiguous
src/burn/neogeo/d_neogeo.cpp:8524: candidates are: void kof2003bMapHandler()
src/burn/neogeo/d_neogeo.cpp:8638:                 void kof2003bMapHandler()
src/burn/neogeo/d_neogeo.cpp: In function `int svcchaosInit()':
src/burn/neogeo/d_neogeo.cpp:8818: call of overloaded `kof2003bMapHandler()' is

   ambiguous
src/burn/neogeo/d_neogeo.cpp:8524: candidates are: void kof2003bMapHandler()
src/burn/neogeo/d_neogeo.cpp:8638:                 void kof2003bMapHandler()
src/burn/neogeo/d_neogeo.cpp: In function `int svcndInit()':
src/burn/neogeo/d_neogeo.cpp:8871: call of overloaded `kof2003bMapHandler()' is

   ambiguous
src/burn/neogeo/d_neogeo.cpp:8524: candidates are: void kof2003bMapHandler()
src/burn/neogeo/d_neogeo.cpp:8638:                 void kof2003bMapHandler()
src/burn/neogeo/d_neogeo.cpp: In function `void svchoasa_p_decrypt()':
src/burn/neogeo/d_neogeo.cpp:8914: call of overloaded `interleave_pdata()' is
   ambiguous
src/burn/neogeo/d_neogeo.cpp:8154: candidates are: void interleave_pdata()
src/burn/neogeo/d_neogeo.cpp:8393:                 void interleave_pdata()
src/burn/neogeo/d_neogeo.cpp: In function `int svchaosaInit()':
src/burn/neogeo/d_neogeo.cpp:8933: call of overloaded `kof2003bMapHandler()' is

   ambiguous
src/burn/neogeo/d_neogeo.cpp:8524: candidates are: void kof2003bMapHandler()
src/burn/neogeo/d_neogeo.cpp:8638:                 void kof2003bMapHandler()
make: *** [d_neogeo.o] Error 1

i think the main prob is dealing with svcchaos drivers being after kof2003 drivers but if i put it before kof2003 drivers, i get an error dealing with `int kof2003bInit()': which due to svcchaos drivers being before kof2003b's :confused:

so as you can see, i'm lost on how exactly to get this working :(
« Last Edit: May 10, 2005, 12:54:59 PM by iq_132 »

Offline XorXe

  • Newbies
  • *
  • Posts: 34
  • Karma: +0/-0
  • Learning 4 Masters ^^
King of Fighters 2003, The
« Reply #26 on: December 30, 2004, 12:41:05 AM »
Quote from: iq_132
Use a different bios (I'm assuming you're using the a Jap bios).  I bet it works perfectly with unibios or US/ASIA bios.


I use Unibios 1.2 so i dont know how to add suport to Unibios 2.0 the problem fix whit unibios 2.0??, but i try to add unibios 2.0 in neogeo.zip and dont work only catch Unibios 1.2
 :confused:

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #27 on: December 30, 2004, 01:52:07 AM »
Quote from: Jimmy_Page
thats very strange  :confused:
Why a bootleg board would use two 128k s1 with the same data ?
But u always have good infos.... so i cant doubt from what u say  ;)
BTW, i think that u said on other forums (i dont remember where) that the s1 has 128kb, but i cant confirm...
Any way i will keep using the first chunk of it.... because it works good
see ya

Well, the bootlegger probably just used the cheapest/easiest to obtain chip and used it.

Quote from: PRican25
i'm getting probs trying to compile:
*snip*
i think the main prob is dealing with svcchaos drivers being after kof2003 drivers but if i put it before kof2003 drivers, i get an error dealing with `int kof2003bInit()': which due to svcchaos drivers being before kof2003b's :confused:

so as you can see, i'm lost on how exactly to get this working :(

Attach your neogeo folder (zipped, of course) and I'll see what I can do.

Quote from: XorXe
I use Unibios 1.2 so i dont know how to add suport to Unibios 2.0 the problem fix whit unibios 2.0??, but i try to add unibios 2.0 in neogeo.zip and dont work only catch Unibios 1.2
 :confused:


In d_neogeo.cpp

replace this:
Code: [Select]
{"uni-bios.12", 0x020000, 0x4FA698E9, 0xD0}, //  C Universe BIOS (v1.2)
with this:
Code: [Select]
// {"uni-bios.12", 0x020000, 0x4FA698E9, 0xD0}, //  C Universe BIOS (v1.2)
// {"uni-bios.13", 0x020000, 0xb24b44a0, 0xD0}, //  C Universe BIOS (v1.3)
{"uni-bios.20", 0x020000, 0x0c12c2ad, 0xD0}, //  C Universe BIOS (v2.0)


Offline PRican25

  • Newbies
  • *
  • Posts: 44
  • Karma: +0/-0
  • Balla Bori Balla
King of Fighters 2003, The
« Reply #28 on: December 30, 2004, 03:36:22 AM »
here you go IQ_132, i hope you can fix it :)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #29 on: December 30, 2004, 04:22:23 AM »
Here ya go, this should work :)