Author Topic: King of Fighters 10th Anniversary Edition Emulation Infos  (Read 52295 times)

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #90 on: April 13, 2005, 02:48:19 AM »
Quote from: FerchogtX
IQ... where to call this?
Code: [Select]
void NeoUpdateTextOne(int nOffset, const unsigned char byteValue);This line goes also in neorun.cpp or we have to add the driver exactly as it is in the TXT? just this doubt here XD
See ya!!!!!! :D
P.D. Thanks BDiamond!!!!!!!!

I only put it in neogeo.h like it says and it works fine . it never said to put it in neorun.cpp .


But this driver the extra moves to iori, kensou, terry no longer work .
« Last Edit: May 10, 2005, 12:31:01 PM by iq_132 »
IQ Forum Member

Offline iq_132

  • Administrator
  • *****
  • Posts: 3725
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #91 on: April 13, 2005, 07:11:36 AM »
Quote from: FerchogtX
IQ... where to call this?
Code: [Select]
void NeoUpdateTextOne(int nOffset, const unsigned char byteValue);This line goes also in neorun.cpp or we have to add the driver exactly as it is in the TXT? just this doubt here XD
See ya!!!!!! :D
P.D. Thanks BDiamond!!!!!!!!

Neogeo.h

You may have to change it to extern void NeoUpdateTextOne...
« Last Edit: May 10, 2005, 12:31:11 PM by iq_132 »


Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #92 on: April 13, 2005, 12:58:10 PM »
Thanks IQ! worked.
BTW you can change this:
Code: [Select]

memcpy(src, dst + 0x700000, 0x100000);
memcpy(src + 0x100000, dst, 0x600000);

into this:
Code: [Select]

memcpy(src + 0x000000, dst + 0x600000, 0x100000);
memcpy(src + 0x100000, dst + 0x000000, 0x600000);

That will enable the changed moves
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: 3725
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #93 on: April 13, 2005, 04:28:35 PM »
Here's BDiamond's updated driver (from his RomShare post).


Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #94 on: April 13, 2005, 11:27:10 PM »
Quote from: FerchogtX
Thanks IQ! worked.
BTW you can change this:
Code: [Select]

memcpy(src, dst + 0x700000, 0x100000);
memcpy(src + 0x100000, dst, 0x600000);

into this:
Code: [Select]

memcpy(src + 0x000000, dst + 0x600000, 0x100000);
memcpy(src + 0x100000, dst + 0x000000, 0x600000);

That will enable the changed moves
See ya!!!!! :D


Cool thanks :)
IQ Forum Member

Offline Xeon

  • Newbies
  • *
  • Posts: 45
  • Karma: +0/-0
  • Member
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #95 on: April 14, 2005, 03:10:05 AM »
just a little question, whats are the emulation differences between BDiamond's driver and Ferchogtx's+bms fixed code?

thanks in advance.

Offline iq_132

  • Administrator
  • *****
  • Posts: 3725
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #96 on: April 14, 2005, 07:45:18 AM »
Well, the major differences are:

BD is properly emulating most everything, the extra bits of ram, the bankswitch, the "on-the-fly" S Data of the game, etc
(the only problem is something minor causing the background to be "stuck"

Ferch and BMS's driver doesn't emulate a few of the ram areas, it kludges the S data, and the bankswitches aren't quite right.
(though this driver is gameplay-wise less buggy than BD's, it is emulation-wise a much crappier driver)


Offline Xeon

  • Newbies
  • *
  • Posts: 45
  • Karma: +0/-0
  • Member
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #97 on: April 14, 2005, 12:56:52 PM »
Quote from: iq_132
Well, the major differences are:

BD is properly emulating most everything, the extra bits of ram, the bankswitch, the "on-the-fly" S Data of the game, etc
(the only problem is something minor causing the background to be "stuck"

Ferch and BMS's driver doesn't emulate a few of the ram areas, it kludges the S data, and the bankswitches aren't quite right.
(though this driver is gameplay-wise less buggy than BD's, it is emulation-wise a much crappier driver)

 i see thanks :). know anything about the ingame differences (like new moves and stuff)?

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #98 on: April 14, 2005, 09:47:22 PM »
Quote from: iq_132
Well, the major differences are:

BD is properly emulating most everything, the extra bits of ram, the bankswitch, the "on-the-fly" S Data of the game, etc
(the only problem is something minor causing the background to be "stuck"

Ferch and BMS's driver doesn't emulate a few of the ram areas, it kludges the S data, and the bankswitches aren't quite right.
(though this driver is gameplay-wise less buggy than BD's, it is emulation-wise a much crappier driver)


With stuck you mean... static backgrounds? or GFX errors? or what exactly? just for know  :confused:
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 James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #99 on: April 15, 2005, 12:19:58 AM »
The background is the same on every stage of the game .
IQ Forum Member

Offline BlackDiamond

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
  • Junior Member
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #100 on: April 15, 2005, 08:48:37 PM »
the only thing missing in my driver is the byte version of the bankswitch handler i removed because i assumed the game only using word access here (and actually, it do use byte access)
so, here is the driver as it should have remained (the fbaxxx one without commentaries)
Code: [Select]
// The King of Fighters 10th Anniversary (hack/bootleg)

static struct BurnRomInfo kof10thRomDesc[] = {
{ "kof10-p1.bin",  0x800000, 0xB1FD0C43, 1 | BRF_ESS | BRF_PRG }, //  0 68K code

{ "kof10-c1a.bin", 0x400000, 0x3BBC0364, 3 | BRF_GRA }, //  1 Sprite data
{ "kof10-c2a.bin", 0x400000, 0x91230075, 3 | BRF_GRA }, //  2
{ "kof10-c1b.bin", 0x400000, 0xB5ABFC28, 3 | BRF_GRA }, //  3
{ "kof10-c2b.bin", 0x400000, 0x6CC4C6E1, 3 | BRF_GRA }, //  4
{ "kof10-c3a.bin", 0x400000, 0x5B3D4A16, 3 | BRF_GRA }, //  5
{ "kof10-c4a.bin", 0x400000, 0xC6F3419B, 3 | BRF_GRA }, //  6
{ "kof10-c3b.bin", 0x400000, 0x9D2BBA19, 3 | BRF_GRA }, //  7
{ "kof10-c4b.bin", 0x400000, 0x5A4050CB, 3 | BRF_GRA }, //  8
{ "kof10-c5a.bin", 0x400000, 0xA289D1E1, 3 | BRF_GRA }, //  9
{ "kof10-c6a.bin", 0x400000, 0xE6494B5D, 3 | BRF_GRA }, //  10
{ "kof10-c5b.bin", 0x400000, 0x404FFF02, 3 | BRF_GRA }, //  11
{ "kof10-c6b.bin", 0x400000, 0xF2CCFC9E, 3 | BRF_GRA }, //  12
{ "kof10-c7a.bin", 0x400000, 0xBE79C5A8, 3 | BRF_GRA }, //  13
{ "kof10-c8a.bin", 0x400000, 0xA5952CA4, 3 | BRF_GRA }, //  14
{ "kof10-c7b.bin", 0x400000, 0x3FDB3542, 3 | BRF_GRA }, //  15
{ "kof10-c8b.bin", 0x400000, 0x661B7A52, 3 | BRF_GRA }, //  16

{ "kf10-m1.bin",   0x020000, 0xF6FAB859, 4 | BRF_ESS | BRF_PRG }, //  17 Z80 code

{ "kf10-v1.bin",   0x800000, 0x0FC9A58D, 5 | BRF_SND }, //  18 Sound data
{ "kf10-v2.bin",   0x800000, 0xB8C475A4, 5 | BRF_SND }, //  19
};

STDROMPICKEXT(kof10th, kof10th, neogeo);
STD_ROM_FN(kof10th);

static unsigned char *kof10thExtraRAMA = NULL;
static unsigned char *kof10thExtraRAMB = NULL;

static void kof10thCallback()
{
UINT8*src = Neo68KROM;
UINT8*dst = (UINT8*)malloc(0x800000);
int i, j;

if (dst) {
memcpy(dst, src, 0x800000);
memcpy(src, dst + 0x700000, 0x100000);
memcpy(src + 0x100000, dst, 0x600000);

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

((unsigned short*)Neo68KROM)[ 0x000124 / 2] = 0x000d; // Run code that gives XOR for RAM moves and forces SoftDIPs
((unsigned short*)Neo68KROM)[ 0x000126 / 2] = 0xf7a8;
((unsigned short*)Neo68KROM)[ 0x700124 / 2] = 0x000d;
((unsigned short*)Neo68KROM)[ 0x700126 / 2] = 0xf7a8;

((unsigned short*)Neo68KROM)[ 0x008bf4 / 2] = 0x4ef9; // Run code to change 8x8 tiles (needed for neogeo logo tiles)
((unsigned short*)Neo68KROM)[ 0x008bf6 / 2] = 0x000d;
((unsigned short*)Neo68KROM)[ 0x008bf8 / 2] = 0xf980;
((unsigned short*)Neo68KROM)[ 0x708bf4 / 2] = 0x4ef9;
((unsigned short*)Neo68KROM)[ 0x708bf6 / 2] = 0x000d;
((unsigned short*)Neo68KROM)[ 0x708bf8 / 2] = 0xf980;
}

static void kof10thMapBank()
{
SekMapMemory(Neo68KROM + nNeo68KROMBank, 0x200000, 0x2FDFFF, SM_ROM);
}

static void kof10thBankswitch(unsigned int nBank)
{
nBank = 0x100000 + ((nBank & 7) << 20);
if (nBank >= 0x700000) {
nBank = 0x100000;
}

if (nBank != nNeo68KROMBank) {
nNeo68KROMBank = nBank;
kof10thMapBank();
}
}

static void __fastcall kof10thWriteWordCustom(unsigned int sekAddress, unsigned short wordValue)
{
if (kof10thExtraRAMB[ 0x1FFC]) {
NeoUpdateTextOne(0x20000 + ((sekAddress >> 1) & 0x1FFFF), BITSWAP08(wordValue, 7, 6, 0, 4, 3, 2, 1, 5));
} else {
*(unsigned short*)(kof10thExtraRAMA + (sekAddress & 0x01FFFF)) = wordValue;
}
}

static void __fastcall kof10thWriteByteBankswitch(unsigned int sekAddress, unsigned char byteValue)
{
if (sekAddress >= 0x2FE000) {
sekAddress ^= 1;
kof10thExtraRAMB[ sekAddress & 0x1FFF] = byteValue;
if (sekAddress == 0x2FFFF0)
kof10thBankswitch(byteValue);
else if (sekAddress == 0x2FFFF8 && kof10thExtraRAMB[ sekAddress & 0x1FFE] != byteValue) {
SekMapMemory(Neo68KROM + ((byteValue & 1) ? 0x700400 : 0x000400) , 0x000400, 0x0DFFFF, SM_ROM);
}
}
}

static void __fastcall kof10thWriteWordBankswitch(unsigned int sekAddress, unsigned short wordValue)
{
if (sekAddress >= 0x2FE000) {
*(unsigned short*)(kof10thExtraRAMB + (sekAddress & 0x01FFE)) = wordValue;
if (sekAddress == 0x2FFFF0)
kof10thBankswitch(wordValue);
else if (sekAddress == 0x2FFFF8 && *(unsigned short*)(kof10thExtraRAMB + (sekAddress & 0x1FFE)) != wordValue) {
SekMapMemory(Neo68KROM + ((wordValue & 1) ? 0x700400 : 0x000400) , 0x000400, 0x0DFFFF, SM_ROM);
}
}
}

int kof10thScan(int nAction, int* /*pnMin*/)
{
struct BurnArea ba;

if (nAction & ACB_MEMORY_RAM) {
ba.Data = kof10thExtraRAMA;
ba.nLen = 0x00020000;
ba.nAddress = 0;
ba.szName = "Extra RAM A";
BurnAcb(&ba);

ba.Data = kof10thExtraRAMB;
ba.nLen = 0x00002000;
ba.nAddress = 0;
ba.szName = "Extra RAM B";
BurnAcb(&ba);

ba.Data = NeoTextROM + 0x00020000;
ba.nLen = nNeoTextROMSize;
ba.nAddress = 0;
ba.szName = "8x8 Text Tile RAM";
BurnAcb(&ba);
}

return 0;
}

static int kof10thInit()
{
int nRet;

//nNeoTextRAMSize = 0x20000; // Extra RAM A

pNeoInitCallback = kof10thCallback;
pNeoBankswitchCallback = kof10thMapBank;
pNeoScanCallback = kof10thScan;

nRet = NeoInit();

if (nRet == 0) {
kof10thExtraRAMA = Neo68KROM + 0x7E0000;
kof10thExtraRAMB = Neo68KROM + 0x1FE000;
memset(kof10thExtraRAMA, 0, 0x20000);
memset(kof10thExtraRAMB, 0, 0x2000);

SekOpen(0);

kof10thMapBank();

SekMapMemory(kof10thExtraRAMB, 0x2FE000, 0x2FFFFF, SM_ROM);
SekMapHandler(4, 0x240000, 0x2FFFFF, SM_WRITE); // 68K bankswitch
SekSetWriteWordHandler(4, kof10thWriteWordBankswitch);
SekSetWriteByteHandler(4, kof10thWriteByteBankswitch);

SekMapHandler(5, 0x200000, 0x23FFFF, SM_WRITE);
SekSetWriteWordHandler(5, kof10thWriteWordCustom);

// Memory maps
SekMapMemory(kof10thExtraRAMA, 0x0E0000, 0x0FFFFF, SM_ROM);

nNeo68KROMBank = 1;
kof10thBankswitch(0);

SekClose();
}

return nRet;
}

struct BurnDriver BurnDrvKof10th = {
"kof10th", NULL, "neogeo", "2004",
"The King of Fighters 10th Anniversary\0", "Bootleg/Hack", "SNK / Playmore", "Neo Geo",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_BOOTLEG | BDF_CLONE, 2, HARDWARE_SNK_NEOGEO,
NULL, kof10thRomInfo, kof10thRomName, neogeoInputInfo, neogeoDIPInfo,
kof10thInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
« Last Edit: May 10, 2005, 12:32:35 PM by iq_132 »

Offline iq_132

  • Administrator
  • *****
  • Posts: 3725
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #101 on: April 16, 2005, 02:37:03 AM »
Wow! It's perfect! Thanks again BD :)


Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #102 on: April 16, 2005, 06:49:57 AM »
Thanks BD :) Now I wonder how to convert that to Mame code .
IQ Forum Member

Offline BlackDiamond

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
  • Junior Member
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #103 on: April 16, 2005, 01:27:57 PM »
you should change this:
Code: [Select]
static void __fastcall kof10thWriteByteBankswitch(unsigned int sekAddress, unsigned char byteValue)
{
if (sekAddress >= 0x2FE000) {
sekAddress ^= 1;
kof10thExtraRAMB[ sekAddress & 0x1FFF] = byteValue;
if (sekAddress == 0x2FFFF0)
kof10thBankswitch(byteValue);
else if (sekAddress == 0x2FFFF8 && kof10thExtraRAMB[ sekAddress & 0x1FFE] != byteValue) {
SekMapMemory(Neo68KROM + ((byteValue & 1) ? 0x700400 : 0x000400) , 0x000400, 0x0DFFFF, SM_ROM);
}
}
}

static void __fastcall kof10thWriteWordBankswitch(unsigned int sekAddress, unsigned short wordValue)
{
if (sekAddress >= 0x2FE000) {
*(unsigned short*)(kof10thExtraRAMB + (sekAddress & 0x01FFE)) = wordValue;
if (sekAddress == 0x2FFFF0)
kof10thBankswitch(wordValue);
else if (sekAddress == 0x2FFFF8 && *(unsigned short*)(kof10thExtraRAMB + (sekAddress & 0x1FFE)) != wordValue) {
SekMapMemory(Neo68KROM + ((wordValue & 1) ? 0x700400 : 0x000400) , 0x000400, 0x0DFFFF, SM_ROM);
}
}
}
into this:
Code: [Select]
static void __fastcall kof10thWriteByteBankswitch(unsigned int sekAddress, unsigned char byteValue)
{
if (sekAddress >= 0x2FE000) {
sekAddress ^= 1;
if (sekAddress == 0x2FFFF0)
kof10thBankswitch(byteValue);
else if (sekAddress == 0x2FFFF8 && kof10thExtraRAMB[ sekAddress & 0x1FFE] != byteValue) {
SekMapMemory(Neo68KROM + ((byteValue & 1) ? 0x700400 : 0x000400) , 0x000400, 0x0DFFFF, SM_ROM);
}
kof10thExtraRAMB[ sekAddress & 0x1FFF] = byteValue;
}
}

static void __fastcall kof10thWriteWordBankswitch(unsigned int sekAddress, unsigned short wordValue)
{
if (sekAddress >= 0x2FE000) {
if (sekAddress == 0x2FFFF0)
kof10thBankswitch(wordValue);
else if (sekAddress == 0x2FFFF8 && *(unsigned short*)(kof10thExtraRAMB + (sekAddress & 0x1FFE)) != wordValue) {
SekMapMemory(Neo68KROM + ((wordValue & 1) ? 0x700400 : 0x000400) , 0x000400, 0x0DFFFF, SM_ROM);
}
*(unsigned short*)(kof10thExtraRAMB + (sekAddress & 0x01FFE)) = wordValue;
}
}
i just noticed this when working on fba for xbox. with the fisrt version of the code, the SekMapMemory functions are never reached.
« Last Edit: May 10, 2005, 12:33:18 PM by iq_132 »

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
King of Fighters 10th Anniversary Edition Emulation Infos
« Reply #104 on: April 16, 2005, 01:42:27 PM »
Great stuff thanks BD :D
IQ Forum Member