Author Topic: King of Fighters 2003, The (2004, EX, Hero) Drivers  (Read 24741 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The (2004, EX, Hero) Drivers
« Reply #30 on: December 14, 2004, 04:00:38 AM »
Does this make the characters shrink?? or are we going to need a different P?


Offline bms888

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
  • Member
King of Fighters 2003, The (2004, EX, Hero) Drivers
« Reply #31 on: December 14, 2004, 04:15:08 AM »
Quote from: iq_132
Does this make the characters shrink?? or are we going to need a different P?


not need a different P,just use Flycboy data's 271-p1up.bin 1MB E3A57A9C.

p2 & p3 use kof2003 EX Hero,^_^

{"271-p1up.bin" , 0x100000, 0xE3A57A9C, 0x10}, // 0 68K code /* has protection */

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 2003, The (2004, EX, Hero) Drivers
« Reply #32 on: December 14, 2004, 04:19:12 AM »
Ok, thanks :)


Offline bms888

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
  • Member
King of Fighters 2003, The (2004, EX, Hero) Drivers
« Reply #33 on: December 14, 2004, 04:20:47 AM »
my FBA code here:

Code: [Select]

// The King of Fighters 2003 Ultra Plus (bootleg)

static struct BurnRomInfo kof2k3upRomDesc[] = {
// {"271-p1up.bin" , 0x800000,  0x87294c01, 0x10}, //  0 68K code
{"271-p1up.bin" , 0x100000,  0xE3A57A9C, 0x10}, //  0 68K code /* has protection */
{"271-p1bl.bin" , 0x400000,  0x92ed6ee3, 0x10}, //  2 /* same as 271-p1bl.bin from kof2003b */
{"271h-p3.bin"  , 0x200000,  0x0d0a5861, 0x10}, //  1

{"271-s1up.bin" , 0x020000,  0xe5708c0c,    1}, //  3 Text layer tiles

{"271-c1d.bin" , 0x1000000, 0xc29acd28,    1}, //  4 Sprite data
{"271-c2d.bin" , 0x1000000, 0x328e80b1,    1}, //  5
{"271-c3d.bin" , 0x1000000, 0x020a11f1,    1}, //  6
{"271-c4d.bin" , 0x1000000, 0x991b5ed2,    1}, //  7
{"271-c5d.bin" , 0x1000000, 0xc2de8b66,    1}, //  8 /* The last 2 CxD roms contains S1-ROM */
{"271-c6d.bin" , 0x1000000, 0x3ff750db,    1}, //  9 /* data (1 MB) only, no sprite data */

{"271-m1d.bin" , 0x080000,  0x0e86af8f, 0x10}, //  10 Z80 code

{"271-v1d.bin" , 0x1000000, 0x2058ec5e,    2}, //  11 Sound data
};

STDROMPICKEXT(kof2k3up, kof2k3up, neogeo);
STD_ROM_FN(kof2k3up);

static void kof2k3up_px_decrypt()
{
int i;
UINT8 *src = (UINT8 *)(Neo68KROM01);
unsigned short *tmp = (unsigned short *)malloc(0x2000);
unsigned short *rom = (unsigned short *)(src+0xfe000);
memcpy(tmp,src+0xd0610,0x2000);
for ( i=0; i<0x2000/2; i++)
rom[i] = tmp[BITSWAP16(i,15,14,13,12,11,10,9,8,7,6,0,4,3,2,1,5)];
free(tmp);
}

static void kof2k3up_sx_decrypt()
{
UINT8 *srom = (UINT8 *)(NeoTextROM + 0x020000);
for (int i=0;i<0x20000;i++) {
srom[i]=BITSWAP08(srom[i],7,6,0,4,3,2,1,5);
}
}

static int kof2k3upInit()
{
memset(kof2003b_tbl,0,0x2000);

pNeoInitCallback = kof2k3up_px_decrypt;
pNeoInitCallbackgfx = kof2k3up_sx_decrypt;
pNeoInitCallbackmap = kof2003bMapHandler;
return NeoInit();
}

struct BurnDriver BurnDrvkof2k3up = {
{"kof2k3up", "The King of Fighters 2003 Ultra Plus (bootleg)", NULL, "SNK Playmore Corporation", "Neo Geo", "2003", "kof2003", "neogeo"},
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_LOCKED, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_NEWBANKSYSTEM | HARDWARE_SNK_ALTERNATE_TEXT,
NULL, kof2k3upRomInfo, kof2k3upRomName, neogeoInputInfo, neogeoDIPInfo,
kof2k3upInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};

Offline bms888

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
  • Member
King of Fighters 2003, The (2004, EX, Hero) Drivers
« Reply #34 on: December 14, 2004, 04:24:57 AM »
P roms > 3,maybe you need add this code to your neogeo.cpp

thanks for netbug,^_^

Bug fixed loading the 68K ROMs(p files>3,such as ms5plus and so on ) for all NeoGeo games as follows:
in neogeo.cpp

Code: [Select]
// This function loads the 68K ROMs
int NeoLoadCode(int nOffset, int nNum, unsigned char* pDest)
{
int nRomSize = 0;
unsigned char* pROM = pDest;
struct BurnRomInfo ri;

// Load the ROMs
for (int i = 0; i < nNum; i++) {
ri.nType = 0;
ri.nLen = 0;
BurnDrvGetRomInfo(&ri,nOffset+i);
nRomSize =ri.nLen;

if (BurnLoadRom(pROM, nOffset + i, 1)) {
return 1;
}

pROM +=nRomSize;

BurnDrvGetRomInfo(&ri, nOffset + i);
// Swap the blocks in the ROM if needed.
if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SWAPP && i && ri.nLen == 0x400000) {
for (unsigned int k = 0; k < (ri.nLen >> 1); k++) {
unsigned char n = pROM[k];
pROM[k] = pROM[k + (ri.nLen >> 1)];
pROM[k + (ri.nLen >> 1)] = n;
}
}

// Swap the blocks in the ROM if needed.
if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SWAPP && nRomSize == 0x200000) {
for (int j = 0; j < nNum; j++) {
for (int k = 0; k < (nRomSize >> 1); k++) {
unsigned char n = pDest[k];
pDest[k] = pDest[k + (nRomSize >> 1)];
pDest[k + (nRomSize >> 1)] = n;
}
}
}
}

return 0;
}

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: King of Fighters 2003, The (2004, EX, Hero) Drivers
« Reply #35 on: July 06, 2005, 01:33:20 PM »
Here's an updated version of the 2k4ex bankswitch :)

Code: [Select]
static unsigned short CartRAMEX[2]; // store 4 bytes (2 words)

// Special bankswitch for King of Fighters 2004 Ex (Hero) [Hack]
// Heavily modified by IQ_132 - http://neosource.1emu.net
void __fastcall kof2k4exWriteWordBankSwitch(unsigned int sekAddress, unsigned short wordValue)
{
int offset=(sekAddress-0x2ffff0)/2,bankaddress;
CartRAMEX[offset]=(wordValue)|(~0xFFFF&CartRAMEX[offset]);
bankaddress=CartRAMEX[0]|(CartRAMEX[1]<<8)+0x100000;
SekMapMemory(Neo68KROM+bankaddress,0x200000,0x2fdfff,SM_ROM);
}

unsigned short __fastcall kof2k4exReadWordBankSwitch(unsigned int sekAddress)
{
return CartRAMEX[(sekAddress-0x2ffff0)/2];
}

static int kof2k4exInit()
{
int nRet;

memset(CartRAMEX, 0, 0x02);

nRet=NeoInit();
if (nRet == 0) {
// Install BankSwitch handler
SekMapHandler(5,    0x2ffff0, 0x2ffff3,  SM_READ);
SekMapHandler(5, 0x2ffff0, 0x2ffff3, SM_WRITE);
SekSetReadWordHandler(5,   kof2k4exReadWordBankSwitch);
SekSetWriteWordHandler(5, kof2k4exWriteWordBankSwitch);
}
return nRet;
}

It does require this:
Code: [Select]
| HARDWARE_SNK_CUSTOM_BANKING,or this: (depending on which you are using in your build)
Code: [Select]
| HARDWARE_SNK_NEWBANKSYSTEM,


Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: King of Fighters 2003, The (2004, EX, Hero) Drivers
« Reply #36 on: August 15, 2005, 01:27:52 AM »
Worked on this a bit more, it's a bit smaller.

Code: [Select]
// Special bankswitch for King of Fighters 2004 Ex Hero [Hack]
// Heavily modified by IQ_132 - http://neosource.1emu.net
void __fastcall kof2k4exWriteWordBankSwitch(unsigned int sekAddress, unsigned short wordValue)
{
CartRAM[(sekAddress-0x2ffff0)/2] = wordValue;
int bankaddress = (CartRAM[0] & 0x00ff) + (CartRAM[1] << 8) + 0x100000;
SekMapMemory(Neo68KROM+bankaddress, 0x200000, 0x2fdfff, SM_ROM);
}

unsigned short __fastcall kof2k4exReadWordBankSwitch(unsigned int sekAddress)
{
return CartRAM[(sekAddress-0x2ffff0)/2];
}


Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: King of Fighters 2003, The (2004, EX, Hero) Drivers
« Reply #37 on: August 15, 2005, 01:49:04 AM »
Cool! ThanX IQ!! ^^

SeeYaa!!
:-D