Author Topic: _[ FinalBurn Alpha: Tips and Tricks ]_  (Read 55063 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
_[ FinalBurn Alpha: Tips and Tricks ]_
« on: November 12, 2004, 02:04:10 PM »
Add any misc. tips or tricks you have for FBA code to this thread.


Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
FBA Tips and Tricks
« Reply #1 on: November 12, 2004, 02:05:49 PM »
How to completely disable CRC checking.

SRC/BURNER/BZIP.CPP

find this:
Code: [Select]
if (List[nFind].nLen == ri.nLen) {
if (ri.nCrc) { // If we know the CRC
if (List[nFind].nCrc != ri.nCrc) { // Length okay, but CRC wrong
RomFind[i].nState = 2;
}
}

replace with this:
Code: [Select]
if (List[nFind].nLen == ri.nLen) {
if (ri.nCrc) { // If we know the CRC
if (List[nFind].nCrc != ri.nCrc) { // Length okay, but CRC wrong
RomFind[i].nState = 1; // Changed 2 to 1
}
}
« Last Edit: August 01, 2006, 10:39:36 AM by iq_132 »


Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
FBA Tips and Tricks
« Reply #2 on: November 12, 2004, 02:26:53 PM »
Here's the source to add avi support to FBA (version 029498).

Just extract the files to your fba source directory.

All credits to Gangta (for the original avi source), JAVH (for these files), and the FBA team for the original FBA source.


Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
FBA Tips and Tricks
« Reply #3 on: November 12, 2004, 02:36:13 PM »
How to disable the splash screen.

SRC\BURNER\MAIN.CPP

find this:

// #define DONT_DISPLAY_SPLASH

replace with this:

#define DONT_DISPLAY_SPLASH

(just remove the two // in front of it)


Offline Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #4 on: November 13, 2004, 03:48:02 AM »
Remove the preset bug

Indp.cpp (src\burner)

Replace this :

Code: [Select]

int UsePreset(bool bMakeDefault)
{
int nGi, nPci, nAnalog = 0;
char szFilename[MAX_PATH] = "config\\preset\\";


with this :

Code: [Select]

int UsePreset(bool bMakeDefault)
{
int nGi, nPci, nAnalog = 0;
char szFilename[MAX_PATH] = "config\\presets\\";

Offline Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #5 on: November 13, 2004, 04:00:31 AM »
Disable the "Auto-Disable NumLock" when you start FBA (really annoying for me)

main.cpp (src\burner)

Find this :

Code: [Select]

bNumlockStatus = SetNumLock(false);

return 0;
}

static int AppExit()
{
SetNumLock(bNumlockStatus);


Replace with this :

Code: [Select]

// bNumlockStatus = SetNumLock(false);

return 0;
}

static int AppExit()
{
// SetNumLock(bNumlockStatus);


And if you don't want a warning when compiling (bool bNumLockStatus defined but not used), you can also replace this :

Code: [Select]

static bool bNumlockStatus;


with this :

Code: [Select]

//static bool bNumlockStatus;


And (you can also delete this part, quote it with // if you want to re-add this function)

Code: [Select]

bool SetNumLock(bool bState)
{
BYTE keyState[256];

GetKeyboardState(keyState);
if ((bState && !(keyState[VK_NUMLOCK] & 1)) || (!bState && (keyState[

VK_NUMLOCK] & 1))) {
keybd_event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY, 0 );

keybd_event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,

0);
}

return keyState[VK_NUMLOCK] & 1;
}


with this :

Code: [Select]

//bool SetNumLock(bool bState)
//{
// BYTE keyState[256];
//
// GetKeyboardState(keyState);
// if ((bState && !(keyState[VK_NUMLOCK] & 1)) || (!bState && (keyState[VK_NUMLOCK] & 1))) {
// keybd_event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY, 0 );
//
// keybd_event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
// }
//
// return keyState[VK_NUMLOCK] & 1;
//}

Offline Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #6 on: November 13, 2004, 04:07:56 AM »
Disable the mangling (did i spell it right IQ ?? :D ) (not a check box to disable it, just disable it for "life")

sel.cpp (src\burner)

Find this :

Code: [Select]
if (strnicmp(szOldName, "the ", 4) == 0) {
int x = 0, y = 0;
while (szOldName[x] && szOldName[x] != '(') {
x++;
}
y = x;
while (y && szOldName[y - 1] == ' ') {
y--;
}
strncpy(pszName, szOldName + 4, y - 4);
sprintf(pszName + y - 4, ", the %s", szOldName + x);
} else {
strcpy(pszName, szOldName);
}

Replace with this (or remove it)

Code: [Select]
// if (strnicmp(szOldName, "the ", 4) == 0) {
// int x = 0, y = 0;
// while (szOldName[x] && szOldName[x] != '(') {
// x++;
// }
// y = x;
// while (y && szOldName[y - 1] == ' ') {
// y--;
// }
// strncpy(pszName, szOldName + 4, y - 4);
// sprintf(pszName + y - 4, ", the %s", szOldName + x);
// } else {
strcpy(pszName, szOldName);
// }

No more King of fighters 94', The  :rolleyes:

you can also add a checkbox to enable/disable the mangling, ©iq_132  ;)

Offline Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #7 on: November 13, 2004, 04:36:33 AM »
Add 4 extra rompath (already added in the original FBA, but only 4 rompath can be set with the Win32 interface, the 4 extra rompath have to be set by editing the ini file....really annoying)

app.rc (src\burner)

Find this

Code: [Select]

IDD_ROMSDIR DIALOGEX 0, 0, 271, 120
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Edit ROM paths"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "OK", IDOK, 215, 100, 50, 14
    GROUPBOX    "", IDC_STATIC, 3, 0, 264, 94
    RTEXT           "Path #1:", IDC_STATIC, 9, 11, 32, 12, SS_CENTERIMAGE
    CONTROL         "", IDC_STATIC, "Static", SS_WHITERECT, 44, 10, 158, 14, WS_EX_STATICEDGE
    CONTROL         "", IDC_ROMSDIR_EDIT1, "Edit", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 45, 13, 154, 10
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR1, 209, 10, 50, 14
    RTEXT           "Path #2:", IDC_STATIC, 9, 32, 32, 12, SS_CENTERIMAGE
    CONTROL         "", IDC_STATIC, "Static", SS_WHITERECT, 44, 31, 158, 14, WS_EX_STATICEDGE
    CONTROL         "", IDC_ROMSDIR_EDIT2, "Edit", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 45, 34, 154, 10
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR2, 209, 31, 50, 14
    RTEXT           "Path #3:", IDC_STATIC, 9, 53, 32, 12, SS_CENTERIMAGE
    CONTROL         "", IDC_STATIC, "Static", SS_WHITERECT, 44, 52, 158, 14, WS_EX_STATICEDGE
    CONTROL         "", IDC_ROMSDIR_EDIT3, "Edit", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 45, 55, 154, 10
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR3, 209, 52, 50, 14
    RTEXT           "Path #4:", IDC_STATIC, 9, 74, 32, 12, SS_CENTERIMAGE
    CONTROL         "", IDC_STATIC, "Static", SS_WHITERECT, 44, 73, 158, 14, WS_EX_STATICEDGE
    CONTROL         "", IDC_ROMSDIR_EDIT4, "Edit", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 45, 76, 154, 10
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR4, 209, 73, 50, 14
    PUSHBUTTON    "Cancel", IDCANCEL, 160, 100, 50, 14
END


with this :

Code: [Select]

IDD_ROMSDIR DIALOGEX 0, 0, 271, 220
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Configuration des répertoires"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,215,200,50,14
    GROUPBOX        "",IDC_STATIC,3,0,264,188
    RTEXT           "#1:",IDC_STATIC,9,11,32,12,SS_CENTERIMAGE
    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,44,10,158,14,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ROMSDIR_EDIT1,45,13,154,10,ES_AUTOHSCROLL | NOT
                    WS_BORDER
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR1,209,10,50,14
    RTEXT           "#2:",IDC_STATIC,9,32,32,12,SS_CENTERIMAGE
    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,44,31,158,14,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ROMSDIR_EDIT2,45,34,154,10,ES_AUTOHSCROLL | NOT
                    WS_BORDER
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR2,209,31,50,14
    RTEXT           "#3:",IDC_STATIC,9,53,32,12,SS_CENTERIMAGE
    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,44,52,158,14,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ROMSDIR_EDIT3,45,55,154,10,ES_AUTOHSCROLL | NOT
                    WS_BORDER
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR3,209,52,50,14
    RTEXT           "#4:",IDC_STATIC,9,74,32,12,SS_CENTERIMAGE
    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,44,73,158,14,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ROMSDIR_EDIT4,45,76,154,10,ES_AUTOHSCROLL | NOT
                    WS_BORDER
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR4,209,73,50,14
    RTEXT           "#5:",IDC_STATIC,9,95,32,12,SS_CENTERIMAGE
    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,44,94,158,14,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ROMSDIR_EDIT5,45,97,154,10,ES_AUTOHSCROLL | NOT
                    WS_BORDER
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR5,209,94,50,14
    RTEXT           "#6:",IDC_STATIC,9,116,32,12,SS_CENTERIMAGE
    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,44,115,158,14,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ROMSDIR_EDIT6,45,118,154,10,ES_AUTOHSCROLL | NOT
                    WS_BORDER
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR6,209,115,50,14
    RTEXT           "#7:",IDC_STATIC,9,137,32,12,SS_CENTERIMAGE
    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,44,136,158,14,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ROMSDIR_EDIT7,45,139,154,10,ES_AUTOHSCROLL | NOT
                    WS_BORDER
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR7,209,136,50,14
    RTEXT           "#8:",IDC_STATIC,9,158,32,12,SS_CENTERIMAGE
    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,44,157,158,14,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ROMSDIR_EDIT8,45,160,154,10,ES_AUTOHSCROLL | NOT
                    WS_BORDER
    PUSHBUTTON      "Browse...",IDC_ROMSDIR_BR8,209,157,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,160,200,50,14
END


AND (the extra rompath are added but not activated, so we'll activate them now)

roms.cpp (src\burner)

Replace this :

Code: [Select]

case WM_COMMAND:

if (LOWORD(wParam) == IDOK) {

for (int i = 0; i < 4; i++) {
if (GetDlgItemText(hDlg, IDC_ROMSDIR_EDIT1 + i, buffer, sizeof(buffer)) && lstrcmp(szAppRomPaths[i], buffer)) {
chOk = true;
lstrcpy(szAppRomPaths[i], buffer);
}
}


with this :

Code: [Select]

case WM_COMMAND:

if (LOWORD(wParam) == IDOK) {

for (int i = 0; i < 8; i++) {
if (GetDlgItemText(hDlg, IDC_ROMSDIR_EDIT1 + i, buffer, sizeof(buffer)) && lstrcmp(szAppRomPaths[i], buffer)) {
chOk = true;
lstrcpy(szAppRomPaths[i], buffer);
}
}

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
FBA Tips and Tricks
« Reply #8 on: November 14, 2004, 09:13:28 PM »
Nice stuff badablek ;)


Here's the code to fix loading of irregular P roms (ms5plus, etc)
Code changes by Netbug

Replace this whole section in neogeo.cpp:

int NeoLoadCode(int nOffset, int nNum, unsigned char* pDest)
{
...
}

Code: [Select]
// This function loads the 68K ROMs (netbug)
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 Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #9 on: November 15, 2004, 04:56:22 AM »
Remove lagging when playing CPS1 after CPS2 (can't remember who gave this some days ago before all threads go to trash, a big thanks to him)

cps_run.cpp (src\burn\capcom)

Find this :

Code: [Select]


int CpsRunInit()
{
nGigawing = 0;
nLagObjectPalettes = 0;


Add this :

Code: [Select]


int CpsRunInit()
{
nCpsCyclesSegment[0] = 0;
nGigawing = 0;
nLagObjectPalettes = 0;


As far as I remember, you said to put this code nCpsCyclesSegment[0] = 0; in the reset routine of CPS games, but this works only if you press F3 after loading the game, so I put it in the Init routine of CPS games (maybe I'm wrong as I can't remember exactly  ;) )

Remove the "No sound" bug for some CPS1 games (Ghouls 'n' ghost, etc....), like for CPS1/CPS2 lagging, can't remember who gave this piece of code, I only remember that Gogoackman started a thread 'bout that, but the FBA team said I was incorrect (400% overclock, but hey it's working ^^)

Find this :

Code: [Select]

// Run sound chips for this section

if (Cps1Qs == 1) {
nStart = i << 8;
nEnd = (i + 1) << 8;

QsndSectRun(nStart,nEnd);
} else {
for (int j = 0; j < 4; j++) {
nStart = ((i << 2) + j) << 6;
nEnd = ((i << 2) + j + 1) << 6;

nCpsCyclesSegment[1] = (((i << 2) + j + 1) * nCpsZ80Cycles) >> 4;

nCpsCyclesDone[1] += ZetRun(nCpsCyclesSegment[1] - nCpsCyclesDone[1]);

PsmSect(nStart, nEnd);


Replace with this :

Code: [Select]

// Run sound chips for this section

if (Cps1Qs == 1) {
nStart = i << 8;
nEnd = (i + 1) << 8;

QsndSectRun(nStart,nEnd);
} else {
for (int j = 0; j < 4; j++) {
nStart = ((i << 2) + j) << 6;
nEnd = ((i << 2) + j + 1) << 6;

nCpsCyclesSegment[1] = ((((i << 2) + j + 1) << 2) * nCpsZ80Cycles) >> 4; //fix cps1 sound

nCpsCyclesDone[1] += ZetRun(nCpsCyclesSegment[1] - nCpsCyclesDone[1]);

PsmSect(nStart, nEnd);

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
FBA Tips and Tricks
« Reply #10 on: November 15, 2004, 05:03:15 AM »
Here's the thread with gogo's post ;)
http://www.ojko.com/phpbb/viewtopic.php?t=2141


Offline Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #11 on: November 15, 2004, 05:19:03 AM »
This is it  :D

But I'm surprised, first time I tried this piece of code, I was unable to compile FBA........now it's working  :confused:

The most important is that it's working very well now  :cool:

IQ, little question, some CPS1 games are really sloooooooooooooow to load (Ghouls 'n' Ghost for example), is there any trick in order to bypass the hardware test ???

Offline NJ7

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-6
  • Member
FBA Tips and Tricks
« Reply #12 on: November 15, 2004, 11:50:18 AM »
Sorry, but I'm sure you're gonna have to go through the hardware test....that's the way that game is in any emulator....

Offline Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #13 on: November 15, 2004, 12:48:03 PM »
:(

it would be great to have some "speed up the hardware test" like we have on any PC motherboard ^^
the most important is that we can play those great games, even if the loading is irritating  :D

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
FBA Tips and Tricks
« Reply #14 on: November 15, 2004, 05:31:40 PM »
Couldn't you just hold the turbo button down??