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

Offline Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #30 on: March 08, 2005, 03:19:59 PM »
Quote from: Treble Winner
It's possible to patch out the memory test in Ghouls 'n' Ghosts. Here is the code from MAME's vidhrdw/cps1.c. Obviously the code is commented in MAME but here it is.

Code: [Select]
else if (strcmp(gamename, "ghouls" )==0)
{
/* Patch out self-test... it takes forever */
UINT16 *rom = (UINT16 *)memory_region(REGION_CPU1);
rom[0x61964/2] = 0x4ef9;
rom[0x61966/2] = 0x0000;
rom[0x61968/2] = 0x0400;
}


You can get the relevant rom location to patch from this.


Quote from: IQ 132
Btw, here's how I added that to FBA:

src/burn/capcom/dc_ghouls.cpp

Find:

Code:
  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,4,1); if (nRet!=0) return 1;
  BurnByteswap(CpsRom+0x080000,0x080000);
Add this after:

Code:
  if (!strcmp(BurnDrvGetTextA(DRV_NAME), "ghouls"))
  {
   /* Patch out self-test... it takes forever */
   unsigned short *rom = (unsigned short *)CpsRom;
   rom[0x61964/2] = 0x4ef9;
   rom[0x61966/2] = 0x0000;
   rom[0x61968/2] = 0x0400;
  }


Thx  :D  :D

[EDIT]

Works great, if you have any other self test bypass patches, feel free to write them :D

Offline bms888

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
  • Member
FBA Tips and Tricks
« Reply #31 on: March 09, 2005, 01:06:32 AM »
Anyone can tell me how to change this MAME code MRA16_RAM & MWA16_RAM to FBA,thx.

In that means, how to define MRA16_RAM & MWA16_RAM in FBA?

Offline XorXe

  • Newbies
  • *
  • Posts: 34
  • Karma: +0/-0
  • Learning 4 Masters ^^
FBA Tips and Tricks
« Reply #32 on: April 20, 2005, 12:58:14 AM »
Excuse me, anyone have a source of Fbavi to match in FBA v0.2.95.23

Edit:

Thanx i dont need anymore.

Offline Shoometsu

  • Jr. Member
  • **
  • Posts: 66
  • Karma: +0/-0
  • I finally have an avatar XD
Re: FBA Tips and Tricks
« Reply #33 on: May 26, 2005, 05:37:32 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 = [color=red]1; // Changed 2 to 1[/color]
}
}

what about if we disable the size check with the crc check? sometimes we have different crcs due to a size mismatch...

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;
}
}
} else {
if (List[nFind].nLen < ri.nLen) {
RomFind[i].nState = 3; // Too small
} else {
RomFind[i].nState = 4; // Too big
}
}

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
if (nLoadMenuShowX & CRCCHECK) {
RomFind[i].nState = 1;
} else {
RomFind[i].nState = 2;
}
}
}
} else {
if (nLoadMenuShowX & CRCCHECK) {
ri.nLen = List[nFind].nLen;
RomFind[i].nState = 1;
} else {
if (List[nFind].nLen < ri.nLen) {
RomFind[i].nState = 3; // Too small
} else {
RomFind[i].nState = 4; // Too big
}
}
}


note: this code considers that you have the disable crc check with checkbox option :wink:
<- Who are you?

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Re: FBA Tips and Tricks
« Reply #34 on: July 20, 2005, 11:02:42 PM »
Hi guys... I have something that maybe more of one will like (I'm loving my WINAPI manual XD):
In src\burner\win32\scrn.cpp:
Find:
Code: [Select]
int OnNotify(HWND, int, NMHDR* lpnmhdr);Add this after:
Code: [Select]
void StretchBitmap(HDC, HWND, HBITMAP);Find this:
Code: [Select]
static void OnPaint(HWND hWnd)
{
if (hWnd == hScrnWnd) {...
Add this before:
Code: [Select]
// This is for background image, performs the needed stretching
// for avoiding the use of more images for this :)
void StretchBitmap(HDC hDC, HWND hWnd, HBITMAP hBitmap)
{
HDC memDC; BITMAP bm; RECT re;

memDC = CreateCompatibleDC(hDC);
SelectObject(memDC, hBitmap);
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
GetClientRect(hWnd, &re);
if (bMenuEnabled) {
StretchBlt(hDC, 0, 25, re.right, re.bottom-25, memDC, 0, 0, 304, 224, SRCCOPY);
} else {
StretchBlt(hDC, 0, 0, re.right, re.bottom, memDC, 0, 0, 304, 224, SRCCOPY);
}
DeleteDC(memDC);
}
Now, replace the whole OnPaint function with this one:
Code: [Select]
static void OnPaint(HWND hWnd)
{
if (hWnd == hScrnWnd) {

// paint and validate client area
VidPaint(1);

// Win9x-ME plataforms has problems with the preview blitter option.
// Anyway this is a "hotfix" for this problem, this seems to be
// related to some options that only Win2000-XP builds can handle.
// This consists only in enable the posibility of loading a bitmap
// as a background for the aplication, something old I know, also
// performs an stretching to the image to fit the client size. Is
// the best I can do for this odd OSes (including mine XD)
// Almost forgot to mention... you have to disable the "Preview
// blitter" option to enable this only if you use win9x or ME OS.
if (!bDrvOkay && !bVidUsePlaceholder) {
HBITMAP hBitmap;
PAINTSTRUCT ps;
if (_tcslen(szPlaceHolder)) {
//hBitmap = LoadBitmap(hAppInst, szPlaceHolder);
hBitmap = (HBITMAP)LoadImage(hAppInst, szPlaceHolder, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
} else {
hBitmap = LoadBitmap(hAppInst, _T("BMP_SPLASH"));
}
HDC hDC = BeginPaint(hWnd, &ps);
StretchBitmap(hDC, hWnd, hBitmap);
}

// draw menu
if (!nVidFullscreen) {
RedrawWindow(hRebar, NULL, NULL, RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
}
}
do the same with the OnClose and OnDestroy functions (replace them with this):
Code: [Select]
static void OnClose(HWND)
{
HBITMAP hBitmap;

if (_tcslen(szPlaceHolder)) {
//hBitmap = LoadBitmap(hAppInst, szPlaceHolder);
hBitmap = (HBITMAP)LoadImage(hAppInst, szPlaceHolder, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
} else {
hBitmap = LoadBitmap(hAppInst, _T("BMP_SPLASH"));
}
DeleteObject(hBitmap);
PostQuitMessage(0); // Quit the program if the window is closed
}

static void OnDestroy(HWND)
{
HBITMAP hBitmap;

if (_tcslen(szPlaceHolder)) {
//hBitmap = LoadBitmap(hAppInst, szPlaceHolder);
hBitmap = (HBITMAP)LoadImage(hAppInst, szPlaceHolder, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
} else {
hBitmap = LoadBitmap(hAppInst, _T("BMP_SPLASH"));
}
DeleteObject(hBitmap);
VidExit(); // Stop using video with the Window
hScrnWnd = NULL; // Make sure handle is not used again
}
If you see the comment you will know that you have to disable the "Preview blitter" option to see the skin in win9x and ME, this has to work for this win versions and win2000 and XP... I'm not really sure if this goes with this last 2... but if anyone can test this on XP and 2000 I'll be thankfull, if you can test both using the preview blitter option and disabling it.
See ya!!!!! :biggrin:
« Last Edit: July 20, 2005, 11:17:15 PM by FerchogtX »

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
Re: FBA Tips and Tricks
« Reply #35 on: July 21, 2005, 11:12:44 PM »
Works perfectly on Win2k bro :)  I'll test on xp as soon as my other PC is networked again.


Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Re: FBA Tips and Tricks
« Reply #36 on: July 25, 2005, 08:07:21 PM »
Excellent thank man!!!
See ya!!!!! :biggrin:

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 CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Select from a Dialog Box a Skin (.BMP File)
« Reply #37 on: August 09, 2005, 02:28:14 PM »
Im back (with dsl connection thanx god!!! xD)...

I will post a add on for the FerchogtX HotFix that btw, its working on WinXP ^^
thanX FerchogtX ^^

This will Let you Select from a Dialog Box a Skin (.BMP File) from anywhere on your PC
this option will be accesible in the MISC Submenu of FBA ^^

Ok here we go!

In src\burner\win32\scrn.cpp:

Find:

Code: [Select]
static void OnPaint(HWND hWnd)
{
if (hWnd == hScrnWnd) {

// paint and validate client area
VidPaint(1);

Add this Before:

Code: [Select]
// =================================================================
// Start Select Placeholder Skin (.BMP) Code (by CaptainCPS-X)

// Function to Save the Selected Placeholder Skin to INI (path)
int FBASkinSelectInit(TCHAR* pszSkin)
{

if (pszSkin) {
_tcsncpy(szPlaceHolder, pszSkin, sizeof(szPlaceHolder) / sizeof(TCHAR));
}

return 0;
}

// Function to Bring up the Dialog box to load a skin!
static void MakeOfn()
{
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hScrnWnd;
ofn.lpstrFilter = _T("FB Alpha Placeholder Skin (*.bmp)\0*.bmp\0\0");
ofn.lpstrFile = szChoice;
ofn.nMaxFile = sizeof(szChoice) / sizeof(TCHAR);
ofn.lpstrInitialDir = _T(".\\skins");
ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY;
ofn.lpstrDefExt = _T("bmp");

return;
}

// This will call the Dialog Box Function and do everything else
int FBASkinLoad()
{
_stprintf(szChoice, _T("skin"));
MakeOfn();
ofn.lpstrTitle = _T("Select PlaceHolder Skin");
ofn.Flags |= OFN_OVERWRITEPROMPT;

int bOldPause = bRunPause;
bRunPause = 1;

int nRet = GetOpenFileName(&ofn);
bRunPause = bOldPause;

if (nRet == 0) {
return 1;
}
return FBASkinSelectInit(szChoice); // Save the selected Skin to INI (path)
}
// End Select Placeholder Skin (.BMP) Code
// =============================================================================

Find:
Code: [Select]
case MENU_LANGUAGE_SELECT:
if (UseDialogs()) {
FBALocaliseLoadTemplate();
POST_INITIALISE_MESSAGE;
}

Add this After:
Code: [Select]
case MENU_SKIN_SELECT:
if (UseDialogs()) {
FBASkinLoad();
POST_INITIALISE_MESSAGE;
}

In src\interface\interface.h:

Find:

Code: [Select]
extern TCHAR szPlaceHolder[MAX_PATH];
Add this After:

Code: [Select]
int FBASkinSelectInit(TCHAR* pszSkin);
int FBASkinLoad();

In src\burner\win32\resource.h:

Find:
Code: [Select]
#define MENU_LANGUAGE_SELECT            10307

Add this After:
Code: [Select]
#define MENU_SKIN_SELECT            10309

In src\burner\win32\app.rc:

Find:
Code: [Select]
        MENUITEM "Modeless menu",               MENU_MODELESS

Add this After:
Code: [Select]
        MENUITEM SEPARATOR
        MENUITEM "Select PlaceHolder Skin...",       MENU_SKIN_SELECT

And That's All!! ^^ I hope you like that so you dont have to edit the
 INI each time you want to put a different Skin (BMP)

Please tell me if you like it, or if it have a bug, its one of my first succeded coding ^^
(Im taking a self-teach with a huge C/C++/C# Book) and i hope i add more stuff
to FBA like a animated Skin (Gif Support) or a GFX Animation like Zsnes (Ex. snow falling etc)
^^...and a Show multiple preview images instead of the Title screen only...so more Dirs
will be added like MAME32....when you click on the preview image change so it
show ''title -> in game img -> etc...maybe a flyer showing....but well thats what i will
be trying to add by the moment ^^

SeeYaa!!
:-D

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Re: FBA Tips and Tricks
« Reply #38 on: August 09, 2005, 10:22:02 PM »
Hey!!! looks great! somewhere else had a code that enabled the posibility of loading a random skin... I hope that i can figure out that or either that appear sometime XD
See ya!!!!! :biggrin:

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 Cookie Monstruo

  • Newbies
  • *
  • Posts: 17
  • Karma: +0/-0
Re: FBA Tips and Tricks
« Reply #39 on: August 10, 2005, 12:17:13 PM »
is there a way to fix that thing where when you click outside the screen or you click on file, the sound makes a horrible buzzing noise because the sound just stops instead of going into a pause

Offline Badablek

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +0/-0
  • Member
Re: FBA Tips and Tricks
« Reply #40 on: August 10, 2005, 03:11:49 PM »
is there a way to fix that thing where when you click outside the screen or you click on file, the sound makes a horrible buzzing noise because the sound just stops instead of going into a pause

I don't know how to do that, but it's a good idea, if someone can make a fix for that ^^

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FBA Tips and Tricks
« Reply #41 on: August 11, 2005, 10:25:33 AM »
FerchogtX i want your help man i know you can do this...

I found out with the blitter preview deactivated and using a smaller image than 608 x 448
(in my case i usa that size) but if i select a 304 x 224 image it will not stretch...

I think i need a alternate code for this...so it will stretch any image size...

Code: [Select]
// This is for background image, performs the needed stretching
// for avoiding the use of more images for this :)
void StretchBitmap(HDC hDC, HWND hWnd, HBITMAP hBitmap)
{
HDC memDC; BITMAP bm; RECT re;

memDC = CreateCompatibleDC(hDC);
SelectObject(memDC, hBitmap);
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
GetClientRect(hWnd, &re);
if (bMenuEnabled) {
StretchBlt(hDC, 0, 25, re.right, re.bottom-25, memDC, 0, 0, 608, 448, SRCCOPY);
} else {
StretchBlt(hDC, 0, 0, re.right, re.bottom, memDC, 0, 0, 608, 448, SRCCOPY);
}
DeleteDC(memDC);


I hope you understand what i mean ^^ ...

Thanx in advance ...i tryied to do alternate code but doesnt work :-(

SeeYaa!!!

Offline JiMMy_PaGe

  • Expert
  • *****
  • Posts: 60
  • Karma: +2/-0
    • SNK-NeoFighters
Re: Select from a Dialog Box a Skin (.BMP File)
« Reply #42 on: August 15, 2005, 01:24:14 PM »
Im back (with dsl connection thanx god!!! xD)...

I will post a add on for the FerchogtX HotFix that btw, its working on WinXP ^^
thanX FerchogtX ^^

This will Let you Select from a Dialog Box a Skin (.BMP File) from anywhere on your PC
this option will be accesible in the MISC Submenu of FBA ^^

Ok here we go!

And That's All!! ^^ I hope you like that so you dont have to edit the
 INI each time you want to put a different Skin (BMP)

Please tell me if you like it, or if it have a bug, its one of my first succeded coding ^^
(Im taking a self-teach with a huge C/C++/C# Book) and i hope i add more stuff
to FBA like a animated Skin (Gif Support) or a GFX Animation like Zsnes (Ex. snow falling etc)
^^...and a Show multiple preview images instead of the Title screen only...so more Dirs
will be added like MAME32....when you click on the preview image change so it
show ''title -> in game img -> etc...maybe a flyer showing....but well thats what i will
be trying to add by the moment ^^

SeeYaa!!
:-D
Great code bro, congratulations  :wink:
I will test it tonight, thanks for the code  :biggrin:
C ya

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Re: FBA Tips and Tricks
« Reply #43 on: August 15, 2005, 10:17:52 PM »
FerchogtX i want your help man i know you can do this...

I found out with the blitter preview deactivated and using a smaller image than 608 x 448
(in my case i usa that size) but if i select a 304 x 224 image it will not stretch...

I think i need a alternate code for this...so it will stretch any image size...

Code: [Select]
// This is for background image, performs the needed stretching
// for avoiding the use of more images for this :)
void StretchBitmap(HDC hDC, HWND hWnd, HBITMAP hBitmap)
{
HDC memDC; BITMAP bm; RECT re;

memDC = CreateCompatibleDC(hDC);
SelectObject(memDC, hBitmap);
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
GetClientRect(hWnd, &re);
if (bMenuEnabled) {
StretchBlt(hDC, 0, 25, re.right, re.bottom-25, memDC, 0, 0, 608, 448, SRCCOPY);
} else {
StretchBlt(hDC, 0, 0, re.right, re.bottom, memDC, 0, 0, 608, 448, SRCCOPY);
}
DeleteDC(memDC);


I hope you understand what i mean ^^ ...

Thanx in advance ...i tryied to do alternate code but doesnt work :-(

SeeYaa!!!
Here a lil' explanation of how stretchBlt works:
This function stretches a bitmap to fill a desired area of screen in the function you have some parameters that can help you to understand how it works:
Code: [Select]
// Function:
StretchBlt(hDC, 0, 0, re.right, re.bottom, memDC, 0, 0, 608, 448, SRCCOPY);
1.- The handler for the DC object
2.- X Top corner of destination rectangle (client area)
3.- Y Top corner of destination rectangle
4.- X position in destination rectangle
5.- Y position in destination rectangle
6.- Handler for converted DC object
7.- X position of source image
8.- Y position of source image
9.- and 10.- Width and Height of the image
11.- Parameter for creating the image

Now with this I can tell you that if the image is smaller that the stablished size this will not work... in that case i suppose that you can use this instead, using of course your PAINTSTRUCT data... for instance
from:
Code: [Select]
StretchBlt(hDC, 0, 0, re.right, re.bottom, memDC, 0, 0, 608, 448, SRCCOPY);to:
Code: [Select]
StretchBlt(hDC, 0, 0, re.right, re.bottom, memDC, 0, 0, bm.width, bm.height, SRCCOPY);What does this mean? that you can use any size of image, StretchBlt will determine from the BITMAP structure which width and height does the bitmap has (remember that bm is the member of that structure)
This can be done for the bMenuEnabled case and the else statement and it should work
See ya!!!!!! :biggrin:

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 FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Re: FBA Tips and Tricks
« Reply #44 on: August 15, 2005, 10:24:16 PM »
Almost forgot, this can be added to your Dialog code:
Code: [Select]
case MENU_SKIN_UNLOAD:
_tcsncpy(szPlaceHolder, "", sizeof(szPlaceHolder) / sizeof(TCHAR));
MessageBox(hScrnWnd, _T("Reseting skin to default skin"), _T(APP_TITLE) _T(" Info"), MB_OK | MB_ICONINFORMATION);
POST_INITIALISE_MESSAGE;
break;
Code: [Select]
Dont forget to add the definition in resource.h
See ya!!!!!! :biggrin:
P.D. This will reset the skin if you aren't happy with the actual one without need of editiong manually the ini

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