diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index 02a10327..cf1e8c16 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -622,7 +622,8 @@ void UpdateDebugger() return; //but if the debugger IS visible, then focus it - SetActiveWindow(hDebug); + ShowWindow(hDebug, SW_SHOWNORMAL); + SetForegroundWindow(hDebug); char str[512] = {0}, str2[512] = {0}, chr[8]; int tmp,ret,i; diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index a8d7a310..45355af6 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -802,7 +802,7 @@ BEGIN END MESSAGELOG DIALOGEX 33, 38, 197, 229 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Message Log" FONT 9, "MS Shell Dlg", 0, 0, 0x0 BEGIN diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 9cb3d502..3baf3354 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -2642,6 +2642,15 @@ int emu_lagged (lua_State *L) { return 1; } +//emu_setlagflag(bool value) +// +//Returns true if the game is currently on a lag frame +int emu_setlagflag(lua_State *L) +{ + FCEUI_SetLagFlag(lua_toboolean(L, 1) == 1); + return 0; +} + // boolean emu.emulating() int emu_emulating(lua_State *L) { lua_pushboolean(L, GameInfo != NULL); @@ -5199,6 +5208,7 @@ static const struct luaL_reg emulib [] = { {"framecount", emu_framecount}, {"lagcount", emu_lagcount}, {"lagged", emu_lagged}, + {"setlagflag", emu_setlagflag}, {"emulating", emu_emulating}, {"registerbefore", emu_registerbefore}, {"registerafter", emu_registerafter}, diff --git a/src/movie.cpp b/src/movie.cpp index f816a278..b945d1d5 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -498,8 +498,14 @@ int FCEUI_GetLagCount(void) bool FCEUI_GetLagged(void) { - if (lagFlag) return true; - else return false; + if (lagFlag) + return true; + else + return false; +} +void FCEUI_SetLagFlag(bool value) +{ + lagFlag = (value) ? 1 : 0; } bool FCEUMOV_ShouldPause(void) diff --git a/src/movie.h b/src/movie.h index be58e3a1..114b5388 100644 --- a/src/movie.h +++ b/src/movie.h @@ -82,6 +82,7 @@ bool FCEUMOV_ShouldPause(void); int FCEUMOV_GetFrame(void); int FCEUI_GetLagCount(void); bool FCEUI_GetLagged(void); +void FCEUI_SetLagFlag(bool value); int FCEUMOV_WriteState(EMUFILE* os); bool FCEUMOV_ReadState(EMUFILE* is, uint32 size);