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

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« on: November 09, 2004, 06:14:47 AM »
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.

Code: [Select]
// 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
};


Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 2003, The
« Reply #1 on: November 09, 2004, 10:06:50 AM »
Nice info :) And it is a good start .
IQ Forum Member

Offline hotaru

  • Newbies
  • *
  • Posts: 17
  • Karma: +0/-0
  • lampyridae lunaticus
King of Fighters 2003, The
« Reply #2 on: November 09, 2004, 01:22:36 PM »
that info was posted on the one and only bbs.romshare.net ;)

Offline DethXec

  • Newbies
  • *
  • Posts: 43
  • Karma: +0/-0
  • Neo·FBA |dev|
    • Another dot in the Universe
King of Fighters 2003, The
« Reply #3 on: December 01, 2004, 09:13:37 PM »
News about this driver?

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #4 on: December 24, 2004, 11:21:11 PM »
I got it working :D

You need to follow the instructions.htm to the letter.  I've tested and retested this.  It does work, and the instructions are correct.
If it doesn't work for you, try it again, because you've done something wrong.

*note that there are two versions of the driver.  The instructions explain the diff.
Also, if you've seen Jimmy_Page's recent build of FBA, this is the code he's using.


*btw, Merry Christmas everyone :D


Offline JiMMy_PaGe

  • Expert
  • *****
  • Posts: 60
  • Karma: +2/-0
    • SNK-NeoFighters
King of Fighters 2003, The
« Reply #5 on: December 25, 2004, 01:21:03 AM »
I thinks its a good xmas present for the people xDDDDD
Thanks again iq, ur codes rocks
Btw, all roms are working on fba now, dont u think its time to someone realease the mv0 proto bank code? Ur code rocks, but i think mv0 proto code will be better :D :D
See ya and thanks again bro for all ur help before this release :D

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 2003, The
« Reply #6 on: December 25, 2004, 10:09:35 PM »
Nice :D  But for some reason the Zoom effect does not seem to work ,
IQ Forum Member

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #7 on: December 26, 2004, 04:34:15 AM »
Which version of the kf2k3fix.cpp are you using James?
I haven't played this one much (I don't like the kof series much :|), so I don't know when/where the zoom effects are.


Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 2003, The
« Reply #8 on: December 26, 2004, 08:18:50 PM »
I used the smaller one .The zoom effect happens right when it goes to the fight just after you have made your player selection
IQ Forum Member

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #9 on: December 26, 2004, 09:09:12 PM »
This zoom effect?


Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 2003, The
« Reply #10 on: December 26, 2004, 11:11:18 PM »
Yes :D
IQ Forum Member

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The
« Reply #11 on: December 26, 2004, 11:26:51 PM »
That's strange... I'm using the small version and took that video when running it...


Offline DsNo

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +9/-0
  • Junior Member
King of Fighters 2003, The
« Reply #12 on: December 27, 2004, 03:51:26 AM »
Quote from: iq_132
That's strange... I'm using the small version and took that video when running it...

I'm using the small version too. That's perfectly work!!

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 2003, The
« Reply #13 on: December 27, 2004, 10:46:37 AM »
Yes it seems so But I notice it more in Mame though.
IQ Forum Member

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
King of Fighters 2003, The
« Reply #14 on: December 27, 2004, 08:28:39 PM »
Correction for the text fix type code in IQ's html:
Look for this:
Code: [Select]
BurnLoadRom(NeoTextROM + 0x020000, pInfo->nTextOffset, 1);Add this after:
Code: [Select]
/* Original code for MAME by fataku */
if (nNeoTextROMFixType == 1) {
       unsigned char* srom = NeoTextROM+0x20000;
       for (int i=0;i < 0x20000;i++) {
        srom[i]=BITSWAP08(srom[i],3,2,4,5,1,6,0,7);
       }
}
/* Original code from mame traduced by FerchogtX */
if (nNeoTextROMFixType == 2) {
/* Descrambling S1 by FerchogtX, bassed on DorriGa's code */
unsigned char* srom = NeoTextROM+0x20000;
unsigned char* dst = (unsigned char*)malloc(0x20000);
memcpy( dst+0x00000, srom+0x10000, 0x10000 );
memcpy( dst+0x10000, srom+0x00000, 0x10000 );
memcpy( srom, dst, 0x20000 );
free(dst);
}
/* Thanks also to HappyASR for the info */
if (nNeoTextROMFixType == 3) {
unsigned char* srom = NeoTextROM+0x20000;
unsigned char* 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);
}
/* Thanks to Badzou for the info */
if (nNeoTextROMFixType == 4) {
/* Descrambling S1 by dorriga */
unsigned char* srom = NeoTextROM+0x20000;
unsigned char* 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);
}
// Converted by Jimmy_Page (www.neofighters.com)
if (nNeoTextROMFixType == 5) {
       unsigned char* srom = NeoTextROM+0x20000;
       for (int i=0;i < 0x20000;i++) {
        srom[i]=BITSWAP08(srom[i],7,6,0,4,3,2,1,5);
       }
}
NOW look for this:
Code: [Select]
// Extract data from the end of C ROMS
BurnUpdateProgress(0.0, "Generating text layer graphics...", 0);
NeoExtractSData(NeoSpriteROM, NeoTextROM + 0x020000, nSpriteSize, nNeoTextROMSize);
add only this one after (because is only used by svc)
Code: [Select]
// Original conversion by IQ_132 (This is for svcchaos, kof2003, and clones)
if (nNeoTextROMFixType == 6) {
unsigned char* srom = NeoTextROM+0x20000;
for( int i=0;i < nNeoTextROMSize;i++ ){
srom[i]=BITSWAP08(srom[i]^0xd2,4,0,7,2,5,1,6,3);
}
}
Just to fix that, if you add the othe code the games that use scrambled s1 roms won't work XD
See ya!!!! :D
P.D. Great, Great, GREAT WORK IQ!!!!!! an hurray for this!!!!
hip hip HURRAYYYY!!!!!!  :D  :D
« Last Edit: May 10, 2005, 12:54:17 PM by iq_132 »

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...