fixed more compile issues with gcc
This commit is contained in:
parent
d9adfc4b69
commit
6733a2f8a3
|
@ -30,7 +30,7 @@ void UnlockConsole(void);
|
|||
void ToggleFS(); /* SDL */
|
||||
|
||||
int LoadGame(const char *path);
|
||||
int CloseGame(void);
|
||||
//int CloseGame(void);
|
||||
|
||||
void Giggles(int);
|
||||
void DoFun(void);
|
||||
|
|
|
@ -259,7 +259,7 @@ KeyboardCommands()
|
|||
|
||||
// F12 or Esc close game
|
||||
if(KEY(F12) || KEY(ESCAPE)) {
|
||||
CloseGame();
|
||||
FCEUI_CloseGame();
|
||||
}
|
||||
|
||||
// VS Unisystem games
|
||||
|
@ -389,7 +389,7 @@ UpdatePhysicalInput()
|
|||
while(SDL_PollEvent(&event)) {
|
||||
switch(event.type) {
|
||||
case SDL_QUIT:
|
||||
CloseGame();
|
||||
FCEUI_CloseGame();
|
||||
puts("Quit");
|
||||
break;
|
||||
default:
|
||||
|
|
79
src/fceu.cpp
79
src/fceu.cpp
|
@ -52,8 +52,49 @@
|
|||
//TODO - we really need some kind of global platform-specific options api
|
||||
#ifdef WIN32
|
||||
#include "drivers/win/main.h"
|
||||
#else
|
||||
#include "drivers/sdl/sdl.h"
|
||||
#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;
|
||||
|
||||
|
@ -239,44 +280,6 @@ static DECLFR(ARAMH)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -346,8 +346,9 @@ static void LoadFM2(MovieData& movieData, std::istream* fp, int size=INT_MAX, bo
|
|||
for(;;)
|
||||
{
|
||||
bool iswhitespace, isrecchar, isnewline;
|
||||
int c;
|
||||
if(size--<=0) goto bail;
|
||||
int c = fp->get();
|
||||
c = fp->get();
|
||||
if(c == -1)
|
||||
goto bail;
|
||||
iswhitespace = (c==' '||c=='\t');
|
||||
|
|
Loading…
Reference in New Issue