mirror of
https://github.com/dborth/fceugx.git
synced 2025-01-07 14:28:18 +01:00
minor bugfixes
This commit is contained in:
parent
734a557da5
commit
cfbbe9a21d
@ -53,15 +53,18 @@ extern uint8 FDSBIOS[8192];
|
|||||||
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);
|
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char * nesrom = NULL;
|
static uint8 *xbsave=NULL;
|
||||||
|
static int fskipc = 0;
|
||||||
|
static int videoReset = 0;
|
||||||
|
static int currentMode = 0;
|
||||||
|
static int ResetRequested = 0;
|
||||||
int ConfigRequested = 0;
|
int ConfigRequested = 0;
|
||||||
int ShutdownRequested = 0;
|
int ShutdownRequested = 0;
|
||||||
int ResetRequested = 0;
|
|
||||||
int ExitRequested = 0;
|
int ExitRequested = 0;
|
||||||
char appPath[1024];
|
char appPath[1024];
|
||||||
FreeTypeGX *fontSystem;
|
FreeTypeGX *fontSystem;
|
||||||
uint8 *xbsave=NULL;
|
|
||||||
int frameskip = 0;
|
int frameskip = 0;
|
||||||
|
unsigned char * nesrom = NULL;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Shutdown / Reboot / Exit
|
* Shutdown / Reboot / Exit
|
||||||
@ -274,6 +277,8 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
MainMenu(MENU_GAME);
|
MainMenu(MENU_GAME);
|
||||||
|
|
||||||
|
videoReset = -1;
|
||||||
|
currentMode = GCSettings.render;
|
||||||
ConfigRequested = 0;
|
ConfigRequested = 0;
|
||||||
SwitchAudioMode(0);
|
SwitchAudioMode(0);
|
||||||
|
|
||||||
@ -286,7 +291,7 @@ int main(int argc, char *argv[])
|
|||||||
setFrameTimer(); // set frametimer method before emulation
|
setFrameTimer(); // set frametimer method before emulation
|
||||||
SetPalette();
|
SetPalette();
|
||||||
|
|
||||||
static int fskipc=0;
|
fskipc=0;
|
||||||
|
|
||||||
while(1) // emulation loop
|
while(1) // emulation loop
|
||||||
{
|
{
|
||||||
@ -313,10 +318,21 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if(ConfigRequested)
|
if(ConfigRequested)
|
||||||
{
|
{
|
||||||
TakeScreenshot();
|
if((GCSettings.render != 0 && videoReset == -1) || videoReset == 0)
|
||||||
ResetVideo_Menu();
|
{
|
||||||
ConfigRequested = 0;
|
TakeScreenshot();
|
||||||
break; // leave emulation loop
|
ResetVideo_Menu();
|
||||||
|
ConfigRequested = 0;
|
||||||
|
GCSettings.render = currentMode;
|
||||||
|
break; // leave emulation loop
|
||||||
|
}
|
||||||
|
else if(videoReset == -1)
|
||||||
|
{
|
||||||
|
GCSettings.render = 2;
|
||||||
|
videoReset = 2;
|
||||||
|
ResetVideo_Emu();
|
||||||
|
}
|
||||||
|
videoReset--;
|
||||||
}
|
}
|
||||||
} // emulation loop
|
} // emulation loop
|
||||||
} // main loop
|
} // main loop
|
||||||
|
@ -182,10 +182,29 @@ LoadRAMAuto (int method, bool silent)
|
|||||||
if(method == METHOD_AUTO)
|
if(method == METHOD_AUTO)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char filepath[1024];
|
char filepath[MAXPATHLEN];
|
||||||
|
char fullpath[MAXPATHLEN];
|
||||||
|
char filepath2[MAXPATHLEN];
|
||||||
|
char fullpath2[MAXPATHLEN];
|
||||||
|
|
||||||
|
// look for Auto save file
|
||||||
if(!MakeFilePath(filepath, FILE_RAM, method, romFilename, 0))
|
if(!MakeFilePath(filepath, FILE_RAM, method, romFilename, 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return LoadRAM(filepath, method, silent);
|
if (LoadRAM(filepath, method, silent))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// look for file with no number or Auto appended
|
||||||
|
if(!MakeFilePath(filepath2, action, method, romFilename, -1))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(LoadRAM(filepath2, method, silent))
|
||||||
|
{
|
||||||
|
// rename this file - append Auto
|
||||||
|
sprintf(fullpath, "%s%s", rootdir, filepath); // add device to path
|
||||||
|
sprintf(fullpath2, "%s%s", rootdir, filepath2); // add device to path
|
||||||
|
rename(fullpath2, fullpath); // rename file (to avoid duplicates)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -211,16 +211,30 @@ bool MakeFilePath(char filepath[], int type, int method, char * filename, int fi
|
|||||||
if(type == FILE_RAM) sprintf(ext, "sav");
|
if(type == FILE_RAM) sprintf(ext, "sav");
|
||||||
else sprintf(ext, "fcs");
|
else sprintf(ext, "fcs");
|
||||||
|
|
||||||
if(filenum >= 0)
|
if(filenum >= -1)
|
||||||
{
|
{
|
||||||
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
|
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
|
||||||
{
|
{
|
||||||
filename[26] = 0; // truncate filename
|
if(filenum > 9)
|
||||||
sprintf(file, "%s%i.%s", filename, filenum, ext);
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if(filenum == -1)
|
||||||
|
{
|
||||||
|
filename[27] = 0; // truncate filename
|
||||||
|
sprintf(file, "%s.%s", filename, ext);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filename[26] = 0; // truncate filename
|
||||||
|
sprintf(file, "%s%i.%s", filename, filenum, ext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(filenum == 0)
|
if(filenum == -1)
|
||||||
|
sprintf(file, "%s.%s", filename, ext);
|
||||||
|
else if(filenum == 0)
|
||||||
sprintf(file, "%s Auto.%s", filename, ext);
|
sprintf(file, "%s Auto.%s", filename, ext);
|
||||||
else
|
else
|
||||||
sprintf(file, "%s %i.%s", filename, filenum, ext);
|
sprintf(file, "%s %i.%s", filename, filenum, ext);
|
||||||
@ -394,8 +408,11 @@ int BrowserLoadSz(int method)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// add device to filepath
|
// add device to filepath
|
||||||
sprintf(filepath, "%s%s", rootdir, szpath);
|
if(method != METHOD_DVD)
|
||||||
memcpy(szpath, filepath, MAXPATHLEN);
|
{
|
||||||
|
sprintf(filepath, "%s%s", rootdir, szpath);
|
||||||
|
memcpy(szpath, filepath, MAXPATHLEN);
|
||||||
|
}
|
||||||
|
|
||||||
int szfiles = SzParse(szpath, method);
|
int szfiles = SzParse(szpath, method);
|
||||||
if(szfiles)
|
if(szfiles)
|
||||||
|
@ -42,7 +42,7 @@ extern char rootdir[10];
|
|||||||
extern char romFilename[];
|
extern char romFilename[];
|
||||||
extern int nesGameType;
|
extern int nesGameType;
|
||||||
|
|
||||||
bool MakeFilePath(char filepath[], int type, int method, char * filename = NULL, int filenum = -1);
|
bool MakeFilePath(char filepath[], int type, int method, char * filename = NULL, int filenum = -2);
|
||||||
int UpdateDirName(int method);
|
int UpdateDirName(int method);
|
||||||
int OpenGameList();
|
int OpenGameList();
|
||||||
int autoLoadMethod();
|
int autoLoadMethod();
|
||||||
|
@ -536,7 +536,7 @@ InitGCVideo ()
|
|||||||
// configure VI
|
// configure VI
|
||||||
VIDEO_Configure (vmode);
|
VIDEO_Configure (vmode);
|
||||||
|
|
||||||
screenheight = vmode->xfbHeight;
|
screenheight = 480;
|
||||||
screenwidth = vmode->fbWidth;
|
screenwidth = vmode->fbWidth;
|
||||||
|
|
||||||
// Allocate the video buffers
|
// Allocate the video buffers
|
||||||
|
@ -609,8 +609,7 @@ static void OnScreenKeyboard(char * var, u32 maxlen)
|
|||||||
|
|
||||||
if(save)
|
if(save)
|
||||||
{
|
{
|
||||||
strncpy(var, keyboard.kbtextstr, 100);
|
snprintf(var, maxlen, "%s", keyboard.kbtextstr);
|
||||||
var[100] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HaltGui();
|
HaltGui();
|
||||||
|
@ -258,7 +258,7 @@ decodePrefsData (int method)
|
|||||||
verMinor >= 0 && verMinor <= 9 &&
|
verMinor >= 0 && verMinor <= 9 &&
|
||||||
verPoint >= 0 && verPoint <= 9))
|
verPoint >= 0 && verPoint <= 9))
|
||||||
result = false;
|
result = false;
|
||||||
else if(verMajor <= 3) // less than version 3.0.0
|
else if(verMajor < 3) // less than version 3.0.0
|
||||||
result = false; // reset settings
|
result = false; // reset settings
|
||||||
else if(verMajor > curMajor || verMinor > curMinor || verPoint > curPoint) // some future version
|
else if(verMajor > curMajor || verMinor > curMinor || verPoint > curPoint) // some future version
|
||||||
result = false; // reset settings
|
result = false; // reset settings
|
||||||
|
Loading…
Reference in New Issue
Block a user