diff --git a/src/auxlib.lua b/src/auxlib.lua index b7806f61..7eb03504 100644 --- a/src/auxlib.lua +++ b/src/auxlib.lua @@ -3,7 +3,6 @@ iuplua_open() local iupcontrolslua_open = package.loadlib("iupluacontrols51.dll", "iupcontrolslua_open") iupcontrolslua_open() - function emu.OnClose.iuplua() if(emu.OnCloseIup ~= nil) then emu.OnCloseIup(); diff --git a/src/driver.h b/src/driver.h index 62cf4599..4a68d250 100644 --- a/src/driver.h +++ b/src/driver.h @@ -163,7 +163,6 @@ void FCEUD_SetInput(bool fourscore, ESI port0, ESI port1, ESIFC fcexp); void FCEUD_MovieRecordTo(void); void FCEUD_MovieReplayFrom(void); void FCEUD_LuaRunFrom(void); -void FCEUD_UpdateLuaMenus(void); int32 FCEUI_GetDesiredFPS(void); void FCEUI_SaveSnapshot(void); diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index c8510466..c3070506 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -1674,14 +1674,3 @@ void FCEUD_LuaRunFrom(void) DialogBoxParam(fceu_hInstance, "IDD_LUA_ADD", hAppWnd, DlgLuaScriptDialog,(LPARAM) &success); } -void FCEUD_UpdateLuaMenus() -{ - MENUITEMINFO mii; - ZeroMemory( &mii, sizeof( mii)); - mii.cbSize = sizeof( mii); - mii.fMask = MIIM_STATE; - mii.fState = MFS_UNCHECKED; - SetMenuItemInfo (fceumenu, ID_FILE_RUNLUASCRIPT, FALSE, &mii); - if (!FCEU_LuaRunning()) mii.fState |= MFS_DISABLED; - SetMenuItemInfo (fceumenu, ID_FILE_STOPLUASCRIPT, FALSE, &mii); -} \ No newline at end of file diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 5be86f55..8b1f25f9 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -115,7 +115,6 @@ static void FCEU_LuaOnStop() { if (wasPaused && !FCEUI_EmulationPaused()) FCEUI_ToggleEmulationPause(); FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL); - FCEUD_UpdateLuaMenus(); } @@ -1463,7 +1462,7 @@ void FCEU_LuaFrameBoundary() { #endif } else { - FCEU_LuaOnStop(); + FCEU_LuaStop(); FCEU_DispMessage("Script died of natural causes.\n"); } @@ -1491,6 +1490,9 @@ int FCEU_LoadLuaCode(const char *filename) { luaScriptName = strdup(filename); } + //stop any lua we might already have had running + FCEU_LuaStop(); + if (!L) { #ifdef WIN32 @@ -1601,7 +1603,7 @@ void FCEU_ReloadLuaCode() */ void FCEU_LuaStop() { - // Kill it. + //already killed if (!L) return; //execute the user's shutdown callbacks @@ -1735,9 +1737,3 @@ void FCEU_LuaGui(uint8 *XBuf) { return; } -#ifndef WIN32 -// stub for now -void FCEUD_UpdateLuaMenus() -{ -} -#endif