fixed more compile issues with gcc

This commit is contained in:
punkrockguy318 2008-06-17 16:59:16 +00:00
parent d9adfc4b69
commit 6733a2f8a3
4 changed files with 47 additions and 43 deletions

View File

@ -30,7 +30,7 @@ void UnlockConsole(void);
void ToggleFS(); /* SDL */ void ToggleFS(); /* SDL */
int LoadGame(const char *path); int LoadGame(const char *path);
int CloseGame(void); //int CloseGame(void);
void Giggles(int); void Giggles(int);
void DoFun(void); void DoFun(void);

View File

@ -259,7 +259,7 @@ KeyboardCommands()
// F12 or Esc close game // F12 or Esc close game
if(KEY(F12) || KEY(ESCAPE)) { if(KEY(F12) || KEY(ESCAPE)) {
CloseGame(); FCEUI_CloseGame();
} }
// VS Unisystem games // VS Unisystem games
@ -389,7 +389,7 @@ UpdatePhysicalInput()
while(SDL_PollEvent(&event)) { while(SDL_PollEvent(&event)) {
switch(event.type) { switch(event.type) {
case SDL_QUIT: case SDL_QUIT:
CloseGame(); FCEUI_CloseGame();
puts("Quit"); puts("Quit");
break; break;
default: default:

View File

@ -52,8 +52,49 @@
//TODO - we really need some kind of global platform-specific options api //TODO - we really need some kind of global platform-specific options api
#ifdef WIN32 #ifdef WIN32
#include "drivers/win/main.h" #include "drivers/win/main.h"
#else
#include "drivers/sdl/sdl.h"
#endif #endif
static void CloseGame(void)
{
if(GameInfo)
{
if(FCEUnetplay)
{
FCEUD_NetworkClose();
}
FCEUI_StopMovie();
if(GameInfo->name)
{
free(GameInfo->name);
GameInfo->name=0;
}
if(GameInfo->type!=GIT_NSF)
{
FCEU_FlushGameCheats(0,0);
}
GameInterface(GI_CLOSE);
ResetExState(0,0);
//mbg 5/9/08 - clear screen when game is closed
//http://sourceforge.net/tracker/index.php?func=detail&aid=1787298&group_id=13536&atid=113536
extern uint8 *XBuf;
if(XBuf)
memset(XBuf,0,256*256);
CloseGenie();
delete GameInfo;
GameInfo = 0;
}
}
uint64 timestampbase; uint64 timestampbase;
@ -239,44 +280,6 @@ static DECLFR(ARAMH)
return RAM[A&0x7FF]; return RAM[A&0x7FF];
} }
static void CloseGame(void)
{
if(GameInfo)
{
if(FCEUnetplay)
{
FCEUD_NetworkClose();
}
FCEUI_StopMovie();
if(GameInfo->name)
{
free(GameInfo->name);
GameInfo->name=0;
}
if(GameInfo->type!=GIT_NSF)
{
FCEU_FlushGameCheats(0,0);
}
GameInterface(GI_CLOSE);
ResetExState(0,0);
//mbg 5/9/08 - clear screen when game is closed
//http://sourceforge.net/tracker/index.php?func=detail&aid=1787298&group_id=13536&atid=113536
extern uint8 *XBuf;
if(XBuf)
memset(XBuf,0,256*256);
CloseGenie();
delete GameInfo;
GameInfo = 0;
}
}
void ResetGameLoaded(void) void ResetGameLoaded(void)
{ {

View File

@ -345,9 +345,10 @@ static void LoadFM2(MovieData& movieData, std::istream* fp, int size=INT_MAX, bo
bool bail = false; bool bail = false;
for(;;) for(;;)
{ {
bool iswhitespace, isrecchar, isnewline; bool iswhitespace, isrecchar, isnewline;
int c;
if(size--<=0) goto bail; if(size--<=0) goto bail;
int c = fp->get(); c = fp->get();
if(c == -1) if(c == -1)
goto bail; goto bail;
iswhitespace = (c==' '||c=='\t'); iswhitespace = (c==' '||c=='\t');