diff --git a/changelog.txt b/changelog.txt index bdd7f823..e669c27c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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 diff --git a/src/drawing.cpp b/src/drawing.cpp index 06db044b..f73ca2be 100644 --- a/src/drawing.cpp +++ b/src/drawing.cpp @@ -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) { diff --git a/src/driver.h b/src/driver.h index abb59aef..47d90183 100644 --- a/src/driver.h +++ b/src/driver.h @@ -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(); diff --git a/src/drivers/win/help/fceux.chm b/src/drivers/win/help/fceux.chm index a472c37c..fa35ff1f 100644 Binary files a/src/drivers/win/help/fceux.chm and b/src/drivers/win/help/fceux.chm differ diff --git a/src/drivers/win/main.cpp b/src/drivers/win/main.cpp index 8b8645f5..812ccab8 100644 --- a/src/drivers/win/main.cpp +++ b/src/drivers/win/main.cpp @@ -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); } diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index de07fce0..99cc442d 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -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 diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index e5dd294d..86d0d61c 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -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); diff --git a/src/drivers/win/window.h b/src/drivers/win/window.h index a5e38ccb..09246889 100644 --- a/src/drivers/win/window.h +++ b/src/drivers/win/window.h @@ -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(); diff --git a/src/fceu.cpp b/src/fceu.cpp index d819f438..ff12f63d 100644 --- a/src/fceu.cpp +++ b/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); } diff --git a/vc/Help/fceux.hnd b/vc/Help/fceux.hnd index 43c80545..b73f403e 100644 Binary files a/vc/Help/fceux.hnd and b/vc/Help/fceux.hnd differ