* fixed "Auto-resume old play session", for some reason NSFs don't allow loading savestate right after opening the ROM
* updated docs [[Split portion of a mixed commit.]]
This commit is contained in:
parent
2ab5891589
commit
e1ef50ac14
|
@ -1,3 +1,4 @@
|
|||
15-Dec-2012 - AnS - win32: added Config->Enable->Auto-resume old play session
|
||||
13-Dec-2012 - AnS - win32: added Emulation Speed->Set custom speed for FrameAdvance
|
||||
13-Dec-2012 - AnS - win32: added NES->Emulation Speed->Set FrameAdvance Delay
|
||||
13-Dec-2012 - AnS - win32: added NES->Emulation Speed->Set Custom Speed
|
||||
|
|
|
@ -413,7 +413,7 @@ void DrawTextTransWH(uint8 *dest, uint32 width, uint8 *textmsg, uint8 fgcolor, i
|
|||
if (max_w > 256) max_w = 256;
|
||||
if (max_h > 64) max_h = 64;
|
||||
|
||||
int ch, wid, nx, ny, max_x = x, offs;
|
||||
int ch = 0, wid = 0, nx = 0, ny = 0, max_x = x, offs = 0;
|
||||
int pixel_color;
|
||||
for(; *textmsg; ++textmsg)
|
||||
{
|
||||
|
|
|
@ -96,11 +96,11 @@ void FCEUI_SetRenderPlanes(bool sprites, bool bg);
|
|||
void FCEUI_GetRenderPlanes(bool& sprites, bool& bg);
|
||||
|
||||
//name=path and file to load. returns null if it failed
|
||||
FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode);
|
||||
FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode, bool silent = false);
|
||||
|
||||
//same as FCEUI_LoadGame, except that it can load from a tempfile.
|
||||
//name is the logical path to open; archiveFilename is the archive which contains name
|
||||
FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode);
|
||||
FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silent = false);
|
||||
|
||||
//general purpose emulator initialization. returns true if successful
|
||||
bool FCEUI_Initialize();
|
||||
|
|
Binary file not shown.
|
@ -760,7 +760,7 @@ int main(int argc,char *argv[])
|
|||
} else
|
||||
{
|
||||
if (AutoResumePlay && rom_name_when_closing_emulator && rom_name_when_closing_emulator[0])
|
||||
ALoad(rom_name_when_closing_emulator);
|
||||
ALoad(rom_name_when_closing_emulator, 0, true);
|
||||
if (eoptions & EO_FOAFTERSTART)
|
||||
LoadNewGamey(hAppWnd, 0);
|
||||
}
|
||||
|
|
|
@ -148,8 +148,8 @@ BEGIN
|
|||
MENUITEM SEPARATOR
|
||||
POPUP "PPU"
|
||||
BEGIN
|
||||
MENUITEM "New PPU", ID_NEWPPU
|
||||
MENUITEM "Old PPU", ID_OLDPPU
|
||||
MENUITEM "New PPU (slow!)", ID_NEWPPU
|
||||
END
|
||||
MENUITEM "&Directories...", MENU_DIRECTORIES
|
||||
MENUITEM "&GUI...", MENU_GUI_OPTIONS
|
||||
|
|
|
@ -1018,13 +1018,13 @@ void CloseGame()
|
|||
}
|
||||
}
|
||||
|
||||
bool ALoad(const char *nameo, char* innerFilename)
|
||||
bool ALoad(const char *nameo, char* innerFilename, bool silent)
|
||||
{
|
||||
int oldPaused = EmulationPaused;
|
||||
int oldPaused = EmulationPaused;
|
||||
|
||||
if (GameInfo) FCEUI_CloseGame();
|
||||
|
||||
if(FCEUI_LoadGameVirtual(nameo, 1))
|
||||
if (FCEUI_LoadGameVirtual(nameo, 1, silent))
|
||||
{
|
||||
pal_emulation = FCEUI_GetCurrentVidSystem(0, 0);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ void ByebyeWindow();
|
|||
void DoTimingConfigFix();
|
||||
int CreateMainWindow();
|
||||
void UpdateCheckedMenuItems();
|
||||
bool ALoad(const char* nameo, char* innerFilename=0);
|
||||
bool ALoad(const char* nameo, char* innerFilename = 0, bool silent = false);
|
||||
void LoadNewGamey(HWND hParent, const char *initialdir);
|
||||
int BrowseForFolder(HWND hParent, const char *htext, char *buf);
|
||||
void SetMainWindowStuff();
|
||||
|
|
27
src/fceu.cpp
27
src/fceu.cpp
|
@ -139,7 +139,7 @@ static void FCEU_CloseGame(void)
|
|||
{
|
||||
if (GameInfo)
|
||||
{
|
||||
if (AutoResumePlay)
|
||||
if (AutoResumePlay && (GameInfo->type != GIT_NSF))
|
||||
{
|
||||
// save "-resume" savestate
|
||||
FCEUSS_Save(FCEU_MakeFName(FCEUMKF_RESUMESTATE, 0, 0).c_str());
|
||||
|
@ -378,7 +378,7 @@ int NSFLoad(const char *name, FCEUFILE *fp);
|
|||
//char lastLoadedGameName [2048] = {0,}; // hack for movie WRAM clearing on record from poweron
|
||||
|
||||
//name should be UTF-8, hopefully, or else there may be trouble
|
||||
FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode)
|
||||
FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silent)
|
||||
{
|
||||
//----------
|
||||
//attempt to open the files
|
||||
|
@ -389,8 +389,10 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode)
|
|||
const char* romextensions[] = { "nes", "fds", 0 };
|
||||
fp = FCEU_fopen(name, 0, "rb", 0, -1, romextensions);
|
||||
|
||||
if (!fp) {
|
||||
FCEU_PrintError("Error opening \"%s\"!", name);
|
||||
if (!fp)
|
||||
{
|
||||
if (!silent)
|
||||
FCEU_PrintError("Error opening \"%s\"!", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -439,7 +441,8 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode)
|
|||
if (FDSLoad(name, fp))
|
||||
goto endlseq;
|
||||
|
||||
FCEU_PrintError("An error occurred while loading the file.");
|
||||
if (!silent)
|
||||
FCEU_PrintError("An error occurred while loading the file.");
|
||||
FCEU_fclose(fp);
|
||||
|
||||
delete GameInfo;
|
||||
|
@ -457,7 +460,8 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode)
|
|||
extern int loadDebugDataFailed;
|
||||
|
||||
if ((loadDebugDataFailed = loadPreferences(LoadedRomFName)))
|
||||
FCEU_printf("Couldn't load debugging data.\n");
|
||||
if (!silent)
|
||||
FCEU_printf("Couldn't load debugging data.\n");
|
||||
|
||||
// ################################## End of SP CODE ###########################
|
||||
#endif
|
||||
|
@ -482,13 +486,13 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode)
|
|||
DoDebuggerDataReload(); // Reloads data without reopening window
|
||||
#endif
|
||||
|
||||
if (AutoResumePlay)
|
||||
if (AutoResumePlay && (GameInfo->type != GIT_NSF))
|
||||
{
|
||||
// load "-resume" savestate
|
||||
if (FCEUSS_Load(FCEU_MakeFName(FCEUMKF_RESUMESTATE, 0, 0).c_str()))
|
||||
FCEU_DispMessage("Game resumed from savestate.", 0);
|
||||
FCEU_DispMessage("Old play session resumed.", 0);
|
||||
else
|
||||
FCEU_DispMessage("Couldn't resume game from savestate.", 0);
|
||||
FCEU_DispMessage("", 0);
|
||||
}
|
||||
|
||||
ResetScreenshotsCounter();
|
||||
|
@ -496,8 +500,9 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode)
|
|||
return GameInfo;
|
||||
}
|
||||
|
||||
FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode) {
|
||||
return FCEUI_LoadGameVirtual(name, OverwriteVidMode);
|
||||
FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode, bool silent)
|
||||
{
|
||||
return FCEUI_LoadGameVirtual(name, OverwriteVidMode, silent);
|
||||
}
|
||||
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue