Consolidate use of FCEUGI* globals GI, CurGame, and FCEUGameInfo into a single

GameInfo var. Still not very pretty, but at least there's only one of them and
the code compiles on Linux now.
This commit is contained in:
radsaq 2006-08-20 19:40:15 +00:00
parent 2dee2b9f59
commit e7d5aa6d29
36 changed files with 146 additions and 156 deletions

View File

@ -32,12 +32,12 @@ int offsetStringToInt(unsigned int type, const char* offsetBuffer)
} }
else // CPU_BREAKPOINTS else // CPU_BREAKPOINTS
{ {
if (GI->type == GIT_NSF) { //NSF Breakpoint keywords if (GameInfo->type == GIT_NSF) { //NSF Breakpoint keywords
if (strcmp(offsetBuffer,"LOAD") == 0) return (NSFHeader.LoadAddressLow | (NSFHeader.LoadAddressHigh<<8)); if (strcmp(offsetBuffer,"LOAD") == 0) return (NSFHeader.LoadAddressLow | (NSFHeader.LoadAddressHigh<<8));
if (strcmp(offsetBuffer,"INIT") == 0) return (NSFHeader.InitAddressLow | (NSFHeader.InitAddressHigh<<8)); if (strcmp(offsetBuffer,"INIT") == 0) return (NSFHeader.InitAddressLow | (NSFHeader.InitAddressHigh<<8));
if (strcmp(offsetBuffer,"PLAY") == 0) return (NSFHeader.PlayAddressLow | (NSFHeader.PlayAddressHigh<<8)); if (strcmp(offsetBuffer,"PLAY") == 0) return (NSFHeader.PlayAddressLow | (NSFHeader.PlayAddressHigh<<8));
} }
else if (GI->type == GIT_FDS) { //FDS Breakpoint keywords else if (GameInfo->type == GIT_FDS) { //FDS Breakpoint keywords
if (strcmp(offsetBuffer,"NMI1") == 0) return (GetMem(0xDFF6) | (GetMem(0xDFF7)<<8)); if (strcmp(offsetBuffer,"NMI1") == 0) return (GetMem(0xDFF6) | (GetMem(0xDFF7)<<8));
if (strcmp(offsetBuffer,"NMI2") == 0) return (GetMem(0xDFF8) | (GetMem(0xDFF9)<<8)); if (strcmp(offsetBuffer,"NMI2") == 0) return (GetMem(0xDFF8) | (GetMem(0xDFF9)<<8));
if (strcmp(offsetBuffer,"NMI3") == 0) return (GetMem(0xDFFA) | (GetMem(0xDFFB)<<8)); if (strcmp(offsetBuffer,"NMI3") == 0) return (GetMem(0xDFFA) | (GetMem(0xDFFB)<<8));

View File

@ -116,7 +116,6 @@ public:
} }
}; };
extern FCEUGI *GI;
extern NSF_HEADER NSFHeader; extern NSF_HEADER NSFHeader;
///retrieves the core's DebuggerState ///retrieves the core's DebuggerState

View File

@ -3,8 +3,6 @@
#include "input.h" #include "input.h"
extern FCEUGI *CurGame;
extern CFGSTRUCT DriverConfig[]; extern CFGSTRUCT DriverConfig[];
extern ARGPSTRUCT DriverArgs[]; extern ARGPSTRUCT DriverArgs[];
extern char *DriverUsage; extern char *DriverUsage;

View File

@ -27,6 +27,7 @@
#include "sdl-video.h" #include "sdl-video.h"
#include "../common/cheat.h" #include "../common/cheat.h"
#include "../../fceu.h"
/** GLOBALS **/ /** GLOBALS **/
int NoWaiting=1; int NoWaiting=1;
@ -106,7 +107,7 @@ DoCheatSeq()
KillVideo(); KillVideo();
DoConsoleCheatConfig(); DoConsoleCheatConfig();
InitVideo(CurGame); InitVideo(GameInfo);
SilenceSound(0); SilenceSound(0);
} }
@ -445,7 +446,7 @@ ButtonConfigBegin()
static void static void
ButtonConfigEnd() ButtonConfigEnd()
{ {
extern FCEUGI *CurGame; extern FCEUGI *GameInfo;
// shutdown the joystick and video subsystems // shutdown the joystick and video subsystems
KillJoysticks(); KillJoysticks();
@ -453,7 +454,7 @@ ButtonConfigEnd()
// re-initialize joystick and video subsystems if they were active before // re-initialize joystick and video subsystems if they were active before
if(!bcpv) { if(!bcpv) {
InitVideo(CurGame); InitVideo(GameInfo);
} }
if(!bcpj) { if(!bcpj) {
InitJoysticks(); InitJoysticks();

View File

@ -28,6 +28,7 @@
#include "sdl.h" #include "sdl.h"
#include "sdl-opengl.h" #include "sdl-opengl.h"
#include "../common/vidblit.h" #include "../common/vidblit.h"
#include "../../fceu.h"
#include "sdl-icon.h" #include "sdl-icon.h"
#include "dface.h" #include "dface.h"
@ -322,7 +323,6 @@ void
ToggleFS() ToggleFS()
{ {
int error; int error;
extern FCEUGI *CurGame;
// shut down the current video system // shut down the current video system
KillVideo(); KillVideo();
@ -331,11 +331,11 @@ ToggleFS()
_fullscreen = !_fullscreen; _fullscreen = !_fullscreen;
// try to initialize the video // try to initialize the video
error = InitVideo(CurGame); error = InitVideo(GameInfo);
if(error) { if(error) {
// if we fail, just continue with what worked before // if we fail, just continue with what worked before
_fullscreen = !_fullscreen; _fullscreen = !_fullscreen;
InitVideo(CurGame); InitVideo(GameInfo);
} }
} }

View File

@ -15,6 +15,7 @@
#include "config.h" #include "config.h"
#include "../common/cheat.h" #include "../common/cheat.h"
#include "../../fceu.h"
#include "input.h" #include "input.h"
#include "dface.h" #include "dface.h"
@ -46,9 +47,6 @@ static void DriverKill(void);
static int DriverInitialize(FCEUGI *gi); static int DriverInitialize(FCEUGI *gi);
int gametype = 0; int gametype = 0;
FCEUGI *CurGame=NULL;
/** /**
* Prints an error string to STDOUT. * Prints an error string to STDOUT.
*/ */
@ -121,17 +119,14 @@ CloseStuff(int signum)
*/ */
int LoadGame(const char *path) int LoadGame(const char *path)
{ {
FCEUGI *tmp;
CloseGame(); CloseGame();
if(!(tmp = FCEUI_LoadGame(path, 1))) { if(!FCEUI_LoadGame(path, 1)) {
return 0; return 0;
} }
CurGame = tmp; ParseGIInput(GameInfo);
ParseGIInput(tmp);
RefreshThrottleFPS(); RefreshThrottleFPS();
if(!DriverInitialize(tmp)) { if(!DriverInitialize(GameInfo)) {
return(0); return(0);
} }
if(soundrecfn) { if(soundrecfn) {
@ -158,7 +153,7 @@ CloseGame()
FCEUI_CloseGame(); FCEUI_CloseGame();
DriverKill(); DriverKill();
isloaded = 0; isloaded = 0;
CurGame = 0; GameInfo = 0;
if(soundrecfn) { if(soundrecfn) {
FCEUI_EndWaveRecord(); FCEUI_EndWaveRecord();
@ -410,7 +405,7 @@ main(int argc,
} }
// loop playing the game // loop playing the game
while(CurGame) { while(GameInfo) {
DoFun(); DoFun();
} }
CloseGame(); CloseGame();

View File

@ -45,6 +45,7 @@
#include <netdb.h> #include <netdb.h>
#endif #endif
#include "../../fceu.h"
#include "../../utils/md5.h" #include "../../utils/md5.h"
#ifndef socklen_t #ifndef socklen_t
@ -159,13 +160,13 @@ int FCEUD_NetworkConnect(void)
uint8 md5out[16]; uint8 md5out[16];
md5_starts(&md5); md5_starts(&md5);
md5_update(&md5, CurGame->MD5, 16); md5_update(&md5, GameInfo->MD5, 16);
md5_update(&md5, (uint8 *)netgamekey, strlen(netgamekey)); md5_update(&md5, (uint8 *)netgamekey, strlen(netgamekey));
md5_finish(&md5, md5out); md5_finish(&md5, md5out);
memcpy(sendbuf + 4, md5out, 16); memcpy(sendbuf + 4, md5out, 16);
} }
else else
memcpy(sendbuf + 4, CurGame->MD5, 16); memcpy(sendbuf + 4, GameInfo->MD5, 16);
if(netpassword) if(netpassword)
{ {

View File

@ -211,11 +211,11 @@ void SaveCDLogFile(){ //todo make this button work before you've saved as
} }
void DoCDLogger(){ void DoCDLogger(){
if (!GI) { if (!GameInfo) {
FCEUD_PrintError("You must have a game loaded before you can use the Code Data Logger."); FCEUD_PrintError("You must have a game loaded before you can use the Code Data Logger.");
return; return;
} }
if (GI->type==GIT_NSF) { //todo: NSF support! if (GameInfo->type==GIT_NSF) { //todo: NSF support!
FCEUD_PrintError("Sorry, you can't yet use the Code Data Logger with NSFs."); FCEUD_PrintError("Sorry, you can't yet use the Code Data Logger with NSFs.");
return; return;
} }

View File

@ -488,11 +488,11 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
void ConfigCheats(HWND hParent) { void ConfigCheats(HWND hParent) {
if (!GI) { if (!GameInfo) {
FCEUD_PrintError("You must have a game loaded before you can manipulate cheats."); FCEUD_PrintError("You must have a game loaded before you can manipulate cheats.");
return; return;
} }
if (GI->type==GIT_NSF) { if (GameInfo->type==GIT_NSF) {
FCEUD_PrintError("Sorry, you can't cheat with NSFs."); FCEUD_PrintError("Sorry, you can't cheat with NSFs.");
return; return;
} }

View File

@ -26,7 +26,6 @@ extern HWND hAppWnd;
extern HINSTANCE fceu_hInstance; extern HINSTANCE fceu_hInstance;
extern int NoWaiting; extern int NoWaiting;
extern FCEUGI *GI;
void DSMFix(UINT msg); void DSMFix(UINT msg);
void StopSound(void); void StopSound(void);

View File

@ -974,7 +974,7 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
} }
//these messages only get handled when a game is loaded //these messages only get handled when a game is loaded
if (GI) { if (GameInfo) {
switch(uMsg) { switch(uMsg) {
case WM_VSCROLL: case WM_VSCROLL:
//mbg merge 7/18/06 changed pausing check //mbg merge 7/18/06 changed pausing check
@ -1354,6 +1354,6 @@ void DoDebug(uint8 halt) {
if (!debugger_open) hDebug = CreateDialog(fceu_hInstance,"DEBUGGER",NULL,DebuggerCallB); if (!debugger_open) hDebug = CreateDialog(fceu_hInstance,"DEBUGGER",NULL,DebuggerCallB);
if (hDebug) { if (hDebug) {
SetWindowPos(hDebug,HWND_TOP,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER); SetWindowPos(hDebug,HWND_TOP,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);
if (GI) UpdateDebugger(); if (GameInfo) UpdateDebugger();
} }
} }

View File

@ -65,7 +65,7 @@ static int screenmode=0;
void InputScreenChanged(int fs) void InputScreenChanged(int fs)
{ {
int x; int x;
if(GI) if(GameInfo)
{ {
for(x=0;x<2;x++) for(x=0;x<2;x++)
if(InputType[x]==SI_ZAPPER) if(InputType[x]==SI_ZAPPER)
@ -1181,7 +1181,7 @@ static BOOL CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
void ConfigInput(HWND hParent) void ConfigInput(HWND hParent)
{ {
DialogBox(fceu_hInstance,"INPUTCONFIG",hParent,InputConCallB); DialogBox(fceu_hInstance,"INPUTCONFIG",hParent,InputConCallB);
if(GI) if(GameInfo)
InitOtherInput(); InitOtherInput();
} }

View File

@ -31,7 +31,7 @@ typedef struct {
extern CFGSTRUCT InputConfig[]; extern CFGSTRUCT InputConfig[];
extern ARGPSTRUCT InputArgs[]; extern ARGPSTRUCT InputArgs[];
void ParseGIInput(FCEUGI *GI); void ParseGIInput(FCEUGI *GameInfo);
#define BUTTC_KEYBOARD 0x00 #define BUTTC_KEYBOARD 0x00
#define BUTTC_JOYSTICK 0x01 #define BUTTC_JOYSTICK 0x01

View File

@ -73,8 +73,6 @@ HINSTANCE fceu_hInstance;
HRESULT ddrval; HRESULT ddrval;
FCEUGI *GI=0;
// cheats, misc, nonvol, states, snaps, ..., base // cheats, misc, nonvol, states, snaps, ..., base
static char *DOvers[6]={0,0,0,0,0,0}; static char *DOvers[6]={0,0,0,0,0,0};
static char *defaultds[5]={"cheats","sav","fcs","snaps","movie"}; static char *defaultds[5]={"cheats","sav","fcs","snaps","movie"};
@ -486,9 +484,9 @@ int main(int argc,char *argv[])
doloopy: doloopy:
UpdateFCEUWindow(); UpdateFCEUWindow();
if(GI) if(GameInfo)
{ {
while(GI) while(GameInfo)
{ {
uint8 *gfx=0; uint8 *gfx=0;
int32 *sound=0; int32 *sound=0;
@ -507,7 +505,7 @@ doloopy:
if(closeGame) if(closeGame)
{ {
FCEUI_CloseGame(); FCEUI_CloseGame();
GI = 0; GameInfo = 0;
} }

View File

@ -685,7 +685,7 @@ void InputData(char *input){
void ChangeMemViewFocus(int newEditingMode, int StartOffset,int EndOffset){ void ChangeMemViewFocus(int newEditingMode, int StartOffset,int EndOffset){
SCROLLINFO si; SCROLLINFO si;
if (GI->type==GIT_NSF) { if (GameInfo->type==GIT_NSF) {
FCEUD_PrintError("Sorry, you can't yet use the Memory Viewer with NSFs."); FCEUD_PrintError("Sorry, you can't yet use the Memory Viewer with NSFs.");
return; return;
} }
@ -1469,11 +1469,11 @@ void DoMemView() {
WNDCLASSEX wndclass ; WNDCLASSEX wndclass ;
//static RECT al; //static RECT al;
if (!GI) { if (!GameInfo) {
FCEUD_PrintError("You must have a game loaded before you can use the Memory Viewer."); FCEUD_PrintError("You must have a game loaded before you can use the Memory Viewer.");
return; return;
} }
if (GI->type==GIT_NSF) { if (GameInfo->type==GIT_NSF) {
FCEUD_PrintError("Sorry, you can't yet use the Memory Viewer with NSFs."); FCEUD_PrintError("Sorry, you can't yet use the Memory Viewer with NSFs.");
return; return;
} }

View File

@ -260,13 +260,13 @@ int FCEUD_NetworkConnect(void)
uint8 md5out[16]; uint8 md5out[16];
md5_starts(&md5); md5_starts(&md5);
md5_update(&md5, GI->MD5, 16); md5_update(&md5, GameInfo->MD5, 16);
md5_update(&md5, (uint8*)netgamekey, strlen(netgamekey)); //mbg merge 7/17/06 added cast md5_update(&md5, (uint8*)netgamekey, strlen(netgamekey)); //mbg merge 7/17/06 added cast
md5_finish(&md5, md5out); md5_finish(&md5, md5out);
memcpy(sendbuf + 4, md5out, 16); memcpy(sendbuf + 4, md5out, 16);
} }
else else
memcpy(sendbuf + 4, GI->MD5, 16); memcpy(sendbuf + 4, GameInfo->MD5, 16);
if(netpassword) if(netpassword)
{ {
@ -414,7 +414,7 @@ static BOOL CALLBACK NetCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
SetDlgItemText(hwndDlg,250,"Connect"); SetDlgItemText(hwndDlg,250,"Connect");
FixCDis(hwndDlg,1); FixCDis(hwndDlg,1);
} }
else if(GI) else if(GameInfo)
{ {
GetSettings(hwndDlg); GetSettings(hwndDlg);
if(FCEUD_NetworkConnect()) if(FCEUD_NetworkConnect())

View File

@ -584,11 +584,11 @@ BOOL CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
void DoNTView() { void DoNTView() {
if (!GI) { if (!GameInfo) {
FCEUD_PrintError("You must have a game loaded before you can use the Name Table Viewer."); FCEUD_PrintError("You must have a game loaded before you can use the Name Table Viewer.");
return; return;
} }
if (GI->type==GIT_NSF) { if (GameInfo->type==GIT_NSF) {
FCEUD_PrintError("Sorry, you can't use the Name Table Viewer with NSFs."); FCEUD_PrintError("Sorry, you can't use the Name Table Viewer with NSFs.");
return; return;
} }

View File

@ -337,11 +337,11 @@ BOOL CALLBACK PPUViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
} }
void DoPPUView() { void DoPPUView() {
if(!GI) { if(!GameInfo) {
FCEUD_PrintError("You must have a game loaded before you can use the PPU Viewer."); FCEUD_PrintError("You must have a game loaded before you can use the PPU Viewer.");
return; return;
} }
if(GI->type==GIT_NSF) { if(GameInfo->type==GIT_NSF) {
FCEUD_PrintError("Sorry, you can't use the PPU Viewer with NSFs."); FCEUD_PrintError("Sorry, you can't use the PPU Viewer with NSFs.");
return; return;
} }

View File

@ -572,11 +572,11 @@ void ShowLogDirDialog(void){
void DoTracer(){ void DoTracer(){
if (!GI) { if (!GameInfo) {
FCEUD_PrintError("You must have a game loaded before you can use the Trace Logger."); FCEUD_PrintError("You must have a game loaded before you can use the Trace Logger.");
return; return;
} }
if (GI->type==GIT_NSF) { //todo: NSF support! if (GameInfo->type==GIT_NSF) { //todo: NSF support!
FCEUD_PrintError("Sorry, you can't yet use the Trace Logger with NSFs."); FCEUD_PrintError("Sorry, you can't yet use the Trace Logger with NSFs.");
return; return;
} }

View File

@ -21,7 +21,7 @@
#include "state.cpp" /* Save/Load state AS */ #include "state.cpp" /* Save/Load state AS */
extern char *md5_asciistr(uint8 digest[16]); extern char *md5_asciistr(uint8 digest[16]);
extern FCEUGI *FCEUGameInfo; extern FCEUGI *GameInfo;
extern int EnableRewind; extern int EnableRewind;
void DSMFix(UINT msg) void DSMFix(UINT msg)
@ -288,8 +288,7 @@ void HideFWindow(int h)
void ToggleHideMenu(void) void ToggleHideMenu(void)
{ {
extern FCEUGI *FCEUGameInfo; if(!fullscreen && (GameInfo || tog))
if(!fullscreen && (FCEUGameInfo || tog))
{ {
tog^=1; tog^=1;
HideMenu(tog); HideMenu(tog);
@ -304,7 +303,7 @@ void FCEUD_HideMenuToggle(void)
static void ALoad(char *nameo) static void ALoad(char *nameo)
{ {
if((GI=FCEUI_LoadGame(nameo,1))) if(FCEUI_LoadGame(nameo,1))
{ {
palyo=FCEUI_GetCurrentVidSystem(0,0); palyo=FCEUI_GetCurrentVidSystem(0,0);
UpdateMenu(); UpdateMenu();
@ -319,8 +318,8 @@ static void ALoad(char *nameo)
} }
else else
StopSound(); StopSound();
ParseGIInput(GI); ParseGIInput(GameInfo);
RedoMenuGI(GI); RedoMenuGI(GameInfo);
} }
void LoadNewGamey(HWND hParent, char *initialdir) void LoadNewGamey(HWND hParent, char *initialdir)
@ -668,14 +667,14 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
case 100:StopSound(); case 100:StopSound();
LoadNewGamey(hWnd, 0); LoadNewGamey(hWnd, 0);
break; break;
case 101:if(GI) case 101:if(GameInfo)
{ {
#ifdef FCEUDEF_DEBUGGER #ifdef FCEUDEF_DEBUGGER
//KillDebugger(); //mbg merge 7/18/06 removed as part of old debugger //KillDebugger(); //mbg merge 7/18/06 removed as part of old debugger
#endif #endif
FCEUI_CloseGame(); FCEUI_CloseGame();
GI=0; GameInfo=0;
RedoMenuGI(GI); RedoMenuGI(GameInfo);
} }
break; break;
case 110:FCEUD_SaveStateAs();break; case 110:FCEUD_SaveStateAs();break;
@ -719,18 +718,18 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
case WM_SYSCOMMAND: case WM_SYSCOMMAND:
if(GI && wParam == SC_SCREENSAVE && (goptions & GOO_DISABLESS)) if(GameInfo && wParam == SC_SCREENSAVE && (goptions & GOO_DISABLESS))
return(0); return(0);
if(wParam==SC_KEYMENU) if(wParam==SC_KEYMENU)
{ {
if(GI && InputType[2]==SIFC_FKB && cidisabled) if(GameInfo && InputType[2]==SIFC_FKB && cidisabled)
break; break;
if(lParam == VK_RETURN || fullscreen || tog) break; if(lParam == VK_RETURN || fullscreen || tog) break;
} }
goto proco; goto proco;
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
if(GI && InputType[2]==SIFC_FKB && cidisabled) if(GameInfo && InputType[2]==SIFC_FKB && cidisabled)
break; /* Hopefully this won't break DInput... */ break; /* Hopefully this won't break DInput... */
if(fullscreen || tog) if(fullscreen || tog)
@ -764,7 +763,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
goto proco; goto proco;
case WM_KEYDOWN: case WM_KEYDOWN:
if(GI) if(GameInfo)
{ {
/* Only disable command keys if a game is loaded(and the other /* Only disable command keys if a game is loaded(and the other
conditions are right, of course). */ conditions are right, of course). */
@ -1620,7 +1619,7 @@ static void UpdateReplayDialog(HWND hwndDlg)
SetWindowText(GetDlgItem(hwndDlg,307),"FCEU 0.98.10 (blip)"); SetWindowText(GetDlgItem(hwndDlg,307),"FCEU 0.98.10 (blip)");
} }
SetWindowText(GetDlgItem(hwndDlg,308),md5_asciistr(FCEUGameInfo->MD5)); SetWindowText(GetDlgItem(hwndDlg,308),md5_asciistr(GameInfo->MD5));
EnableWindow(GetDlgItem(hwndDlg,1),TRUE); // enable OK EnableWindow(GetDlgItem(hwndDlg,1),TRUE); // enable OK
doClear = 0; doClear = 0;
@ -1644,7 +1643,7 @@ static void UpdateReplayDialog(HWND hwndDlg)
SetWindowText(GetDlgItem(hwndDlg,305),""); SetWindowText(GetDlgItem(hwndDlg,305),"");
SetWindowText(GetDlgItem(hwndDlg,306),"Nothing (invalid movie)"); SetWindowText(GetDlgItem(hwndDlg,306),"Nothing (invalid movie)");
SetWindowText(GetDlgItem(hwndDlg,307),""); SetWindowText(GetDlgItem(hwndDlg,307),"");
SetWindowText(GetDlgItem(hwndDlg,308),md5_asciistr(FCEUGameInfo->MD5)); SetWindowText(GetDlgItem(hwndDlg,308),md5_asciistr(GameInfo->MD5));
SetDlgItemText(hwndDlg,1003,""); SetDlgItemText(hwndDlg,1003,"");
EnableWindow(GetDlgItem(hwndDlg,201),FALSE); EnableWindow(GetDlgItem(hwndDlg,201),FALSE);
SendDlgItemMessage(hwndDlg,201,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hwndDlg,201,BM_SETCHECK,BST_UNCHECKED,0);
@ -1752,7 +1751,7 @@ static BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
char md51 [256]; char md51 [256];
char md52 [256]; char md52 [256];
if(fcm) strcpy(md51, md5_asciistr(FCEUGameInfo->MD5)); if(fcm) strcpy(md51, md5_asciistr(GameInfo->MD5));
if(fcm) strcpy(md52, md5_asciistr(info.md5_of_rom_used)); if(fcm) strcpy(md52, md5_asciistr(info.md5_of_rom_used));
if(!fcm || strcmp(md51, md52)) if(!fcm || strcmp(md51, md52))
{ {
@ -1912,7 +1911,7 @@ static BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
char szMd5Text[35]; char szMd5Text[35];
GetDlgItemText(hwndDlg, 305, szMd5Text, 35); GetDlgItemText(hwndDlg, 305, szMd5Text, 35);
if(!strlen(szMd5Text) || !strcmp(szMd5Text, "unknown") || !strcmp(szMd5Text, "00000000000000000000000000000000") || !strcmp(szMd5Text, md5_asciistr(FCEUGameInfo->MD5))) if(!strlen(szMd5Text) || !strcmp(szMd5Text, "unknown") || !strcmp(szMd5Text, "00000000000000000000000000000000") || !strcmp(szMd5Text, md5_asciistr(GameInfo->MD5)))
SetTextColor(hdcStatic, RGB(0,0,0)); // use black color for a match (or no comparison) SetTextColor(hdcStatic, RGB(0,0,0)); // use black color for a match (or no comparison)
else else
SetTextColor(hdcStatic, RGB(255,0,0)); // use red for a mismatch SetTextColor(hdcStatic, RGB(255,0,0)); // use red for a mismatch

View File

@ -51,7 +51,7 @@
uint64 timestampbase; uint64 timestampbase;
FCEUGI *FCEUGameInfo = NULL; FCEUGI *GameInfo = NULL;
void (*GameInterface)(int h); void (*GameInterface)(int h);
void (*GameStateRestore)(int version); void (*GameStateRestore)(int version);
@ -221,29 +221,29 @@ static DECLFR(ARAMH)
static void CloseGame(void) static void CloseGame(void)
{ {
if(FCEUGameInfo) if(GameInfo)
{ {
if(FCEUnetplay) if(FCEUnetplay)
FCEUD_NetworkClose(); FCEUD_NetworkClose();
FCEUI_StopMovie(); FCEUI_StopMovie();
if(FCEUGameInfo->name) if(GameInfo->name)
{ {
free(FCEUGameInfo->name); free(GameInfo->name);
FCEUGameInfo->name=0; GameInfo->name=0;
} }
if(FCEUGameInfo->type!=GIT_NSF) if(GameInfo->type!=GIT_NSF)
FCEU_FlushGameCheats(0,0); FCEU_FlushGameCheats(0,0);
GameInterface(GI_CLOSE); GameInterface(GI_CLOSE);
ResetExState(0,0); ResetExState(0,0);
CloseGenie(); CloseGenie();
free(FCEUGameInfo); free(GameInfo);
FCEUGameInfo = 0; GameInfo = 0;
} }
} }
void ResetGameLoaded(void) void ResetGameLoaded(void)
{ {
if(FCEUGameInfo) CloseGame(); if(GameInfo) CloseGame();
GameStateRestore=0; GameStateRestore=0;
PPU_hook=0; PPU_hook=0;
GameHBIRQHook=0; GameHBIRQHook=0;
@ -278,17 +278,17 @@ FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode)
RewindStatus[0] = RewindStatus[1] = 0; RewindStatus[0] = RewindStatus[1] = 0;
RewindStatus[2] = RewindStatus[3] = 0; RewindStatus[2] = RewindStatus[3] = 0;
FCEUGameInfo = (FCEUGI*)malloc(sizeof(FCEUGI)); GameInfo = (FCEUGI*)malloc(sizeof(FCEUGI));
memset(FCEUGameInfo, 0, sizeof(FCEUGI)); memset(GameInfo, 0, sizeof(FCEUGI));
FCEUGameInfo->soundchan = 0; GameInfo->soundchan = 0;
FCEUGameInfo->soundrate = 0; GameInfo->soundrate = 0;
FCEUGameInfo->name=0; GameInfo->name=0;
FCEUGameInfo->type=GIT_CART; GameInfo->type=GIT_CART;
FCEUGameInfo->vidsys=GIV_USER; GameInfo->vidsys=GIV_USER;
FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=-1; GameInfo->input[0]=GameInfo->input[1]=-1;
FCEUGameInfo->inputfc=-1; GameInfo->inputfc=-1;
FCEUGameInfo->cspecial=0; GameInfo->cspecial=0;
FCEU_printf("Loading %s...\n\n",name); FCEU_printf("Loading %s...\n\n",name);
@ -324,7 +324,7 @@ FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode)
FCEU_ResetVidSys(); FCEU_ResetVidSys();
if(FCEUGameInfo->type!=GIT_NSF) if(GameInfo->type!=GIT_NSF)
if(FSettings.GameGenie) if(FSettings.GameGenie)
OpenGenie(); OpenGenie();
PowerNES(); PowerNES();
@ -332,7 +332,7 @@ FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode)
FCEUSS_CheckStates(); FCEUSS_CheckStates();
FCEUMOV_CheckMovies(); FCEUMOV_CheckMovies();
if(FCEUGameInfo->type!=GIT_NSF) if(GameInfo->type!=GIT_NSF)
{ {
FCEU_LoadGamePalette(); FCEU_LoadGamePalette();
FCEU_LoadGameCheats(0); FCEU_LoadGameCheats(0);
@ -343,7 +343,7 @@ FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode)
strcpy(lastLoadedGameName, name); strcpy(lastLoadedGameName, name);
return(FCEUGameInfo); return GameInfo;
} }
@ -505,7 +505,7 @@ void RestartMovieOrReset(int pow)
void ResetNES(void) void ResetNES(void)
{ {
FCEUMOV_AddCommand(FCEUNPCMD_RESET); FCEUMOV_AddCommand(FCEUNPCMD_RESET);
if(!FCEUGameInfo) return; if(!GameInfo) return;
GameInterface(GI_RESETM2); GameInterface(GI_RESETM2);
FCEUSND_Reset(); FCEUSND_Reset();
FCEUPPU_Reset(); FCEUPPU_Reset();
@ -538,7 +538,7 @@ void PowerNES(void)
{ {
if(!suppressAddPowerCommand) if(!suppressAddPowerCommand)
FCEUMOV_AddCommand(FCEUNPCMD_POWER); FCEUMOV_AddCommand(FCEUNPCMD_POWER);
if(!FCEUGameInfo) return; if(!GameInfo) return;
FCEU_CheatResetRAM(); FCEU_CheatResetRAM();
FCEU_CheatAddRAM(2,0,RAM); FCEU_CheatAddRAM(2,0,RAM);
@ -565,7 +565,7 @@ void PowerNES(void)
Needed for the NSF code and VS System code. Needed for the NSF code and VS System code.
*/ */
GameInterface(GI_POWER); GameInterface(GI_POWER);
if(FCEUGameInfo->type==GIT_VSUNI) if(GameInfo->type==GIT_VSUNI)
FCEU_VSUniPower(); FCEU_VSUniPower();
timestampbase=0; timestampbase=0;
@ -580,9 +580,9 @@ void FCEU_ResetVidSys(void)
{ {
int w; int w;
if(FCEUGameInfo->vidsys==GIV_NTSC) if(GameInfo->vidsys==GIV_NTSC)
w=0; w=0;
else if(FCEUGameInfo->vidsys==GIV_PAL) else if(GameInfo->vidsys==GIV_PAL)
w=1; w=1;
else else
w=FSettings.PAL; w=FSettings.PAL;
@ -642,7 +642,7 @@ void FCEUI_SetRenderedLines(int ntscf, int ntscl, int palf, int pall)
void FCEUI_SetVidSystem(int a) void FCEUI_SetVidSystem(int a)
{ {
FSettings.PAL=a?1:0; FSettings.PAL=a?1:0;
if(FCEUGameInfo) if(GameInfo)
{ {
FCEU_ResetVidSys(); FCEU_ResetVidSys();
FCEU_ResetPalette(); FCEU_ResetPalette();

View File

@ -57,7 +57,7 @@ extern void (*GameStateRestore)(int version);
#define GI_CLOSE 3 #define GI_CLOSE 3
#include "git.h" #include "git.h"
extern FCEUGI *FCEUGameInfo; extern FCEUGI *GameInfo;
extern int GameAttributes; extern int GameAttributes;
extern uint8 PAL; extern uint8 PAL;

View File

@ -723,7 +723,7 @@ static int SubLoad(FCEUFILE *fp)
FCEU_fread(diskdata[x],1,65500,fp); FCEU_fread(diskdata[x],1,65500,fp);
md5_update(&md5,diskdata[x],65500); md5_update(&md5,diskdata[x],65500);
} }
md5_finish(&md5,FCEUGameInfo->MD5); md5_finish(&md5,GameInfo->MD5);
return(1); return(1);
} }
@ -816,7 +816,7 @@ int FDSLoad(const char *name, FCEUFILE *fp)
free(fn); free(fn);
} }
FCEUGameInfo->type=GIT_FDS; GameInfo->type=GIT_FDS;
GameInterface=FDSGI; GameInterface=FDSGI;
SelectDisk=0; SelectDisk=0;

View File

@ -602,7 +602,7 @@ void FCEUI_SetDirOverride(int which, char *n)
if(which < FCEUIOD__COUNT) if(which < FCEUIOD__COUNT)
odirs[which]=n; odirs[which]=n;
if(FCEUGameInfo) /* Rebuild cache of present states/movies. */ if(GameInfo) /* Rebuild cache of present states/movies. */
{ {
if(which==FCEUIOD_STATE) if(which==FCEUIOD_STATE)
FCEUSS_CheckStates(); FCEUSS_CheckStates();

View File

@ -260,9 +260,9 @@ static void SetInput(void)
{ {
if(moo[x].crc32==iNESGameCRC32) if(moo[x].crc32==iNESGameCRC32)
{ {
FCEUGameInfo->input[0]=moo[x].input1; GameInfo->input[0]=moo[x].input1;
FCEUGameInfo->input[1]=moo[x].input2; GameInfo->input[1]=moo[x].input2;
FCEUGameInfo->inputfc=moo[x].inputfc; GameInfo->inputfc=moo[x].inputfc;
break; break;
} }
x++; x++;
@ -630,7 +630,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode)
md5_update(&md5,VROM,VROM_size<<13); md5_update(&md5,VROM,VROM_size<<13);
} }
md5_finish(&md5,iNESCart.MD5); md5_finish(&md5,iNESCart.MD5);
memcpy(FCEUGameInfo->MD5,iNESCart.MD5,sizeof(iNESCart.MD5)); memcpy(GameInfo->MD5,iNESCart.MD5,sizeof(iNESCart.MD5));
iNESCart.CRC32=iNESGameCRC32; iNESCart.CRC32=iNESGameCRC32;
@ -725,7 +725,7 @@ int iNesSave(){
FILE *fp; FILE *fp;
char name[2048]; char name[2048];
if(FCEUGameInfo->type != GIT_CART)return 0; if(GameInfo->type != GIT_CART)return 0;
if(GameInterface!=iNESGI)return 0; if(GameInterface!=iNESGI)return 0;
strcpy(name,LoadedRomFName); strcpy(name,LoadedRomFName);
@ -1207,7 +1207,7 @@ static void iNESPower(void)
NONE_init(); NONE_init();
ResetExState(0,0); ResetExState(0,0);
if(FCEUGameInfo->type == GIT_VSUNI) if(GameInfo->type == GIT_VSUNI)
AddExState(FCEUVSUNI_STATEINFO, ~0, 0, 0); AddExState(FCEUVSUNI_STATEINFO, ~0, 0, 0);
AddExState(WRAM, 8192, 0, "WRAM"); AddExState(WRAM, 8192, 0, "WRAM");
@ -1425,7 +1425,7 @@ static int NewiNES_Init(int num)
{ {
BMAPPING *tmp=bmap; BMAPPING *tmp=bmap;
if(FCEUGameInfo->type == GIT_VSUNI) if(GameInfo->type == GIT_VSUNI)
AddExState(FCEUVSUNI_STATEINFO, ~0, 0, 0); AddExState(FCEUVSUNI_STATEINFO, ~0, 0, 0);
while(tmp->init) while(tmp->init)

View File

@ -268,7 +268,7 @@ void FCEU_UpdateInput(void)
FCExp->Update(InputDataPtrFC,JPAttribFC); FCExp->Update(InputDataPtrFC,JPAttribFC);
} }
if(FCEUGameInfo->type==GIT_VSUNI) if(GameInfo->type==GIT_VSUNI)
if(coinon) coinon--; if(coinon) coinon--;
if(FCEUnetplay) if(FCEUnetplay)
@ -276,7 +276,7 @@ void FCEU_UpdateInput(void)
FCEUMOV_AddJoy(joy, BotMode); FCEUMOV_AddJoy(joy, BotMode);
if(FCEUGameInfo->type==GIT_VSUNI) if(GameInfo->type==GIT_VSUNI)
FCEU_VSUniSwap(&joy[0],&joy[1]); FCEU_VSUniSwap(&joy[0],&joy[1]);
} }
@ -330,7 +330,7 @@ static void FASTAPASS(1) SetInputStuff(int x)
switch(JPType[x]) switch(JPType[x])
{ {
case SI_GAMEPAD: case SI_GAMEPAD:
if(FCEUGameInfo->type==GIT_VSUNI) if(GameInfo->type==GIT_VSUNI)
JPorts[x] = &GPCVS; JPorts[x] = &GPCVS;
else else
JPorts[x]=&GPC; JPorts[x]=&GPC;
@ -391,7 +391,7 @@ void InitializeInput(void)
memset(joy,0,sizeof(joy)); memset(joy,0,sizeof(joy));
LastStrobe = 0; LastStrobe = 0;
if(FCEUGameInfo->type==GIT_VSUNI) if(GameInfo->type==GIT_VSUNI)
{ {
SetReadHandler(0x4016,0x4016,VSUNIRead0); SetReadHandler(0x4016,0x4016,VSUNIRead0);
SetReadHandler(0x4017,0x4017,VSUNIRead1); SetReadHandler(0x4017,0x4017,VSUNIRead1);
@ -678,7 +678,7 @@ static void CommandUnImpl(void)
static void CommandToggleDip(void) static void CommandToggleDip(void)
{ {
if (FCEUGameInfo->type==GIT_VSUNI) if (GameInfo->type==GIT_VSUNI)
FCEUI_VSUniToggleDIP(execcmd-EMUCMD_VSUNI_TOGGLE_DIP_0); FCEUI_VSUniToggleDIP(execcmd-EMUCMD_VSUNI_TOGGLE_DIP_0);
} }

View File

@ -157,7 +157,7 @@ static INPUTC ZAPVSC={ReadZapperVS,0,StrobeZapperVS,UpdateZapper,ZapperFrapper,D
INPUTC *FCEU_InitZapper(int w) INPUTC *FCEU_InitZapper(int w)
{ {
memset(&ZD[w],0,sizeof(ZAPPER)); memset(&ZD[w],0,sizeof(ZAPPER));
if(FCEUGameInfo->type == GIT_VSUNI) if(GameInfo->type == GIT_VSUNI)
return(&ZAPVSC); return(&ZAPVSC);
else else
return(&ZAPC); return(&ZAPC);

View File

@ -291,7 +291,7 @@ static DECLFR(Mapper157_read)
void Mapper157_init(void) void Mapper157_init(void)
{ {
FCEUGameInfo->cspecial = SIS_DATACH; GameInfo->cspecial = SIS_DATACH;
MapIRQHook=BarcodeIRQHook; MapIRQHook=BarcodeIRQHook;
SetWriteHandler(0x6000,0xFFFF,Mapper16_write); SetWriteHandler(0x6000,0xFFFF,Mapper16_write);
SetReadHandler(0x6000,0x7FFF,Mapper157_read); SetReadHandler(0x6000,0x7FFF,Mapper157_read);

View File

@ -154,7 +154,7 @@ void MovieFlushHeader(void)
write32le(rerecord_count, fp); write32le(rerecord_count, fp);
write32le(frameptr, fp); write32le(frameptr, fp);
fseek(fp, 32, SEEK_SET); fseek(fp, 32, SEEK_SET);
fwrite(FCEUGameInfo->MD5, 1, 16, fp); // write ROM checksum fwrite(GameInfo->MD5, 1, 16, fp); // write ROM checksum
write32le(FCEU_VERSION_NUMERIC, fp); // write emu version used write32le(FCEU_VERSION_NUMERIC, fp); // write emu version used
// write ROM name used // write ROM name used
@ -356,10 +356,10 @@ static void ResetInputTypes()
UsrInputType[1] = SI_GAMEPAD; UsrInputType[1] = SI_GAMEPAD;
UsrInputType[2] = SIFC_NONE; UsrInputType[2] = SIFC_NONE;
ParseGIInput(NULL/*FCEUGameInfo*/); ParseGIInput(NULL/*GameInfo*/);
extern int cspec, gametype; extern int cspec, gametype;
cspec=FCEUGameInfo->cspecial; cspec=GameInfo->cspecial;
gametype=FCEUGameInfo->type; gametype=GameInfo->type;
InitOtherInput(); InitOtherInput();
#endif #endif
@ -564,7 +564,7 @@ void FCEUI_SaveMovie(char *fname, uint8 flags, const char* metadata)
write32le(0, fp); // leave room for movie data size write32le(0, fp); // leave room for movie data size
write32le(0, fp); // leave room for savestate_offset write32le(0, fp); // leave room for savestate_offset
write32le(0, fp); // leave room for offset_to_controller_data write32le(0, fp); // leave room for offset_to_controller_data
fwrite(FCEUGameInfo->MD5, 1, 16, fp); // write ROM checksum fwrite(GameInfo->MD5, 1, 16, fp); // write ROM checksum
write32le(FCEU_VERSION_NUMERIC, fp); // write emu version used write32le(FCEU_VERSION_NUMERIC, fp); // write emu version used
fputs(FileBase, fp); // write ROM name used fputs(FileBase, fp); // write ROM name used
fputc(0, fp); fputc(0, fp);

View File

@ -198,9 +198,9 @@ int NSFLoad(FCEUFILE *fp)
for(x=0;x<8;x++) for(x=0;x<8;x++)
BSon|=NSFHeader.BankSwitch[x]; BSon|=NSFHeader.BankSwitch[x];
FCEUGameInfo->type=GIT_NSF; GameInfo->type=GIT_NSF;
FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=SI_GAMEPAD; GameInfo->input[0]=GameInfo->input[1]=SI_GAMEPAD;
FCEUGameInfo->cspecial=SIS_NSF; GameInfo->cspecial=SIS_NSF;
for(x=0;;x++) for(x=0;;x++)
{ {
@ -215,9 +215,9 @@ int NSFLoad(FCEUFILE *fp)
} }
if(NSFHeader.VideoSystem==0) if(NSFHeader.VideoSystem==0)
FCEUGameInfo->vidsys=GIV_NTSC; GameInfo->vidsys=GIV_NTSC;
else if(NSFHeader.VideoSystem==1) else if(NSFHeader.VideoSystem==1)
FCEUGameInfo->vidsys=GIV_PAL; GameInfo->vidsys=GIV_PAL;
GameInterface=NSFGI; GameInterface=NSFGI;

View File

@ -224,7 +224,7 @@ void FCEU_LoadGamePalette(void)
void FCEU_ResetPalette(void) void FCEU_ResetPalette(void)
{ {
if(FCEUGameInfo) if(GameInfo)
{ {
ChoosePalette(); ChoosePalette();
WritePalette(); WritePalette();
@ -233,11 +233,11 @@ void FCEU_ResetPalette(void)
static void ChoosePalette(void) static void ChoosePalette(void)
{ {
if(FCEUGameInfo->type==GIT_NSF) if(GameInfo->type==GIT_NSF)
palo=0; palo=0;
else if(ipalette) else if(ipalette)
palo=palettei; palo=palettei;
else if(ntsccol && !PAL && FCEUGameInfo->type!=GIT_VSUNI) else if(ntsccol && !PAL && GameInfo->type!=GIT_VSUNI)
{ {
palo=paletten; palo=paletten;
CalculatePalette(); CalculatePalette();
@ -252,7 +252,7 @@ void WritePalette(void)
for(x=0;x<7;x++) for(x=0;x<7;x++)
FCEUD_SetPalette(x,unvpalette[x].r,unvpalette[x].g,unvpalette[x].b); FCEUD_SetPalette(x,unvpalette[x].r,unvpalette[x].g,unvpalette[x].b);
if(FCEUGameInfo->type==GIT_NSF) if(GameInfo->type==GIT_NSF)
{ {
//for(x=0;x<128;x++) //for(x=0;x<128;x++)
// FCEUD_SetPalette(x,x,0,x); // FCEUD_SetPalette(x,x,0,x);
@ -276,7 +276,7 @@ static int controllength=0;
void FCEUI_NTSCDEC(void) void FCEUI_NTSCDEC(void)
{ {
if(ntsccol && FCEUGameInfo->type!=GIT_VSUNI &&!PAL && FCEUGameInfo->type!=GIT_NSF) if(ntsccol && GameInfo->type!=GIT_VSUNI &&!PAL && GameInfo->type!=GIT_NSF)
{ {
int which; int which;
if(controlselect) if(controlselect)
@ -298,7 +298,7 @@ void FCEUI_NTSCDEC(void)
void FCEUI_NTSCINC(void) void FCEUI_NTSCINC(void)
{ {
if(ntsccol && FCEUGameInfo->type!=GIT_VSUNI && !PAL && FCEUGameInfo->type!=GIT_NSF) if(ntsccol && GameInfo->type!=GIT_VSUNI && !PAL && GameInfo->type!=GIT_NSF)
if(controlselect) if(controlselect)
{ {
if(controllength) if(controllength)
@ -321,12 +321,12 @@ void FCEUI_NTSCINC(void)
void FCEUI_NTSCSELHUE(void) void FCEUI_NTSCSELHUE(void)
{ {
if(ntsccol && FCEUGameInfo->type!=GIT_VSUNI && !PAL && FCEUGameInfo->type!=GIT_NSF){controlselect=1;controllength=360;} if(ntsccol && GameInfo->type!=GIT_VSUNI && !PAL && GameInfo->type!=GIT_NSF){controlselect=1;controllength=360;}
} }
void FCEUI_NTSCSELTINT(void) void FCEUI_NTSCSELTINT(void)
{ {
if(ntsccol && FCEUGameInfo->type!=GIT_VSUNI && !PAL && FCEUGameInfo->type!=GIT_NSF){controlselect=2;controllength=360;} if(ntsccol && GameInfo->type!=GIT_VSUNI && !PAL && GameInfo->type!=GIT_NSF){controlselect=2;controllength=360;}
} }
void FCEU_DrawNTSCControlBars(uint8 *XBuf) void FCEU_DrawNTSCControlBars(uint8 *XBuf)

View File

@ -1282,7 +1282,7 @@ int FCEUPPU_Loop(int skip)
of this delay. of this delay.
*/ */
X6502_Run(12); X6502_Run(12);
if(FCEUGameInfo->type==GIT_NSF) if(GameInfo->type==GIT_NSF)
DoNSFFrame(); DoNSFFrame();
else else
{ {
@ -1319,7 +1319,7 @@ int FCEUPPU_Loop(int skip)
X6502_Run(16-kook); X6502_Run(16-kook);
kook ^= 1; kook ^= 1;
} }
if(FCEUGameInfo->type==GIT_NSF) if(GameInfo->type==GIT_NSF)
X6502_Run((256+85)*240); X6502_Run((256+85)*240);
#ifdef FRAMESKIP #ifdef FRAMESKIP
else if(skip) else if(skip)

View File

@ -154,10 +154,10 @@ static int NAME(FCEUFILE *fp)
namebuf[index]=0; namebuf[index]=0;
FCEU_printf("%s\n",namebuf); FCEU_printf("%s\n",namebuf);
if(!FCEUGameInfo->name) if(!GameInfo->name)
{ {
FCEUGameInfo->name=(uint8*)malloc(strlen(namebuf)+1); //mbg merge 7/17/06 added cast GameInfo->name=(uint8*)malloc(strlen(namebuf)+1); //mbg merge 7/17/06 added cast
strcpy((char*)FCEUGameInfo->name,namebuf); //mbg merge 7/17/06 added cast strcpy((char*)GameInfo->name,namebuf); //mbg merge 7/17/06 added cast
} }
return(1); return(1);
} }
@ -201,11 +201,11 @@ static int CTRL(FCEUFILE *fp)
better than nothing...maybe. better than nothing...maybe.
*/ */
if(t&1) FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=SI_GAMEPAD; if(t&1) GameInfo->input[0]=GameInfo->input[1]=SI_GAMEPAD;
else FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=SI_NONE; else GameInfo->input[0]=GameInfo->input[1]=SI_NONE;
if(t&2) FCEUGameInfo->input[1]=SI_ZAPPER; if(t&2) GameInfo->input[1]=SI_ZAPPER;
//else if(t&0x10) FCEUGameInfo->input[1]=SI_POWERPAD; //else if(t&0x10) GameInfo->input[1]=SI_POWERPAD;
return(1); return(1);
} }
@ -220,12 +220,12 @@ static int TVCI(FCEUFILE *fp)
char *stuffo[3]={"NTSC","PAL","NTSC and PAL"}; char *stuffo[3]={"NTSC","PAL","NTSC and PAL"};
if(t==0) if(t==0)
{ {
FCEUGameInfo->vidsys=GIV_NTSC; GameInfo->vidsys=GIV_NTSC;
FCEUI_SetVidSystem(0); FCEUI_SetVidSystem(0);
} }
else if(t==1) else if(t==1)
{ {
FCEUGameInfo->vidsys=GIV_PAL; GameInfo->vidsys=GIV_PAL;
FCEUI_SetVidSystem(1); FCEUI_SetVidSystem(1);
} }
FCEU_printf(" TV Standard Compatibility: %s\n",stuffo[t]); FCEU_printf(" TV Standard Compatibility: %s\n",stuffo[t]);
@ -555,7 +555,7 @@ int UNIFLoad(const char *name, FCEUFILE *fp)
for(x=0;x<16;x++) for(x=0;x<16;x++)
FCEU_printf("%02x",UNIFCart.MD5[x]); FCEU_printf("%02x",UNIFCart.MD5[x]);
FCEU_printf("\n"); FCEU_printf("\n");
memcpy(FCEUGameInfo->MD5,UNIFCart.MD5,sizeof(UNIFCart.MD5)); memcpy(GameInfo->MD5,UNIFCart.MD5,sizeof(UNIFCart.MD5));
} }
if(!InitializeBoard()) if(!InitializeBoard())

View File

@ -129,7 +129,7 @@ void FCEU_PutImageDummy(void)
#ifdef SHOWFPS #ifdef SHOWFPS
ShowFPS(); ShowFPS();
#endif #endif
if(FCEUGameInfo->type!=GIT_NSF) if(GameInfo->type!=GIT_NSF)
{ {
FCEU_DrawNTSCControlBars(XBuf); FCEU_DrawNTSCControlBars(XBuf);
FCEU_DrawSaveStates(XBuf); FCEU_DrawSaveStates(XBuf);
@ -186,7 +186,7 @@ void FCEU_PutImage(void)
DrawMessage(); DrawMessage();
} }
*/ */
if(FCEUGameInfo->type==GIT_NSF) if(GameInfo->type==GIT_NSF)
{ {
DrawNSF(XBuf); DrawNSF(XBuf);
/* Save snapshot after NSF screen is drawn. Why would we want to /* Save snapshot after NSF screen is drawn. Why would we want to
@ -212,7 +212,7 @@ void FCEU_PutImage(void)
ReallySnap(); ReallySnap();
dosnapsave=0; dosnapsave=0;
} }
if(FCEUGameInfo->type==GIT_VSUNI) if(GameInfo->type==GIT_VSUNI)
FCEU_VSUniDraw(XBuf); FCEU_VSUniDraw(XBuf);
FCEU_DrawSaveStates(XBuf); FCEU_DrawSaveStates(XBuf);
FCEU_DrawMovies(XBuf); FCEU_DrawMovies(XBuf);

View File

@ -337,9 +337,9 @@ void FCEU_VSUniCheck(uint64 md5partial, int *MapperNo, uint8 *Mirroring)
//puts(vs->name); //puts(vs->name);
*MapperNo = vs->mapper; *MapperNo = vs->mapper;
*Mirroring = vs->mirroring; *Mirroring = vs->mirroring;
FCEUGameInfo->type = GIT_VSUNI; GameInfo->type = GIT_VSUNI;
FCEUGameInfo->cspecial = SIS_VSUNISYSTEM; GameInfo->cspecial = SIS_VSUNISYSTEM;
FCEUGameInfo->inputfc = SIFC_NONE; GameInfo->inputfc = SIFC_NONE;
curppu = vs->ppu; curppu = vs->ppu;
curmd5 = md5partial; curmd5 = md5partial;
@ -360,12 +360,12 @@ void FCEU_VSUniCheck(uint64 md5partial, int *MapperNo, uint8 *Mirroring)
} }
if(vs->ioption & IOPTION_GUN) if(vs->ioption & IOPTION_GUN)
{ {
FCEUGameInfo->input[0] = SI_ZAPPER; GameInfo->input[0] = SI_ZAPPER;
FCEUGameInfo->input[1] = SI_NONE; GameInfo->input[1] = SI_NONE;
} }
else else
{ {
FCEUGameInfo->input[0] = FCEUGameInfo->input[1] = SI_GAMEPAD; GameInfo->input[0] = GameInfo->input[1] = SI_GAMEPAD;
} }
curvs = vs; curvs = vs;
return; return;