diff --git a/changelog.txt b/changelog.txt index 2d528a52..acc74646 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.4 yet to be released--- +08-mar-2009 - adelikat - Lua - added FCEU.lagged() function 08-mar-2009 - adelikat - Lua - added zapper.read() function 07-mar-2009 - adelikat - Lua - added FCEU.lagcount() function 04-mar-2009 - adelikat - win32 - Fix bug so that Escape can now be assigned as a hotkey diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 8910b910..da472aea 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -689,6 +689,12 @@ int fceu_lagcount(lua_State *L) { return 1; } +int fceu_lagged (lua_State *L) { + + bool Lag_Frame = FCEUI_GetLagged(); + lua_pushboolean(L, Lag_Frame); + return 1; +} // string movie.mode() // @@ -1570,6 +1576,7 @@ static const struct luaL_reg fceulib [] = { {"setrenderplanes", fceu_setrenderplanes}, {"message", fceu_message}, {"lagcount", fceu_lagcount}, + {"lagged", fceu_lagged}, {NULL,NULL} }; diff --git a/src/movie.cpp b/src/movie.cpp index 8da780bc..899dc60f 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -426,6 +426,12 @@ int FCEUI_GetLagCount(void) return lagCounter; } +bool FCEUI_GetLagged(void) +{ + if (lagFlag) return true; + else return false; +} + bool FCEUMOV_ShouldPause(void) { if(pauseframe && currFrameCounter == pauseframe) diff --git a/src/movie.h b/src/movie.h index 07e7526f..0583f5d7 100644 --- a/src/movie.h +++ b/src/movie.h @@ -75,6 +75,7 @@ inline bool FCEUMOV_IsRecording() { return FCEUMOV_Mode(MOVIEMODE_RECORD); } bool FCEUMOV_ShouldPause(void); int FCEUMOV_GetFrame(void); int FCEUI_GetLagCount(void); +bool FCEUI_GetLagged(void); int FCEUMOV_WriteState(std::ostream* os); bool FCEUMOV_ReadState(std::istream* is, uint32 size);