Lua doesn't anymore remind the speed is *still* normal each time the script is edited. That uncovered a design bug, uncomment back the message no one saw because of the above, once some solution (and good use for it) is found.

This commit is contained in:
feos-tas 2014-03-15 22:04:04 +00:00
parent a9066961c7
commit b77c835d8a
1 changed files with 7 additions and 2 deletions

View File

@ -120,6 +120,7 @@ extern void AddRecentLuaFile(const char *filename);
#endif
extern bool turbo;
extern int32 fps_scale;
struct LuaSaveState {
std::string filename;
@ -274,6 +275,7 @@ static void FCEU_LuaOnStop()
gui_used = GUI_CLEAR;
//if (wasPaused && !FCEUI_EmulationPaused())
// FCEUI_ToggleEmulationPause();
if (fps_scale != 256) //thanks, we already know it's on normal speed
FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL); //TODO: Ideally lua returns the speed to the speed the user set before running the script
//rather than returning it to normal, and turbo off. Perhaps some flags and a FCEUD_GetEmulationSpeed function
turbo = false;
@ -5607,7 +5609,10 @@ void FCEU_LuaFrameBoundary()
} else {
FCEU_LuaOnStop();
FCEU_DispMessage("Script died of natural causes.\n",0);
//FCEU_DispMessage("Script died of natural causes.\n",0);
// weird sequence of functions calls the above message each time the script starts or stops,
// then this message is overrided by "emu speed" within the same frame, which hides this bug
// uncomment onse solution is found
}
// Past here, the nes actually runs, so any Lua code is called mid-frame. We must