Lua - added FCEU.lagcount() function

This commit is contained in:
adelikat 2009-03-07 19:26:07 +00:00
parent 9ecb9f1821
commit e43366247a
4 changed files with 18 additions and 3 deletions

View File

@ -1,4 +1,5 @@
---version 2.0.4 yet to be released--- ---version 2.0.4 yet to be released---
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 04-mar-2009 - adelikat - win32 - Fix bug so that Escape can now be assigned as a hotkey
03-mar-2009 - adelikat - win32 - Fix Directory Overrides so to allow users to have no override. Also fixes directory override reset bug 03-mar-2009 - adelikat - win32 - Fix Directory Overrides so to allow users to have no override. Also fixes directory override reset bug
02-mar-2009 - adelikat - win32 - Drag & Drop for Memwatch dialog (.txt files) 02-mar-2009 - adelikat - win32 - Drag & Drop for Memwatch dialog (.txt files)

View File

@ -651,6 +651,16 @@ int movie_framecount(lua_State *L) {
return 1; return 1;
} }
//int fceu.lagcount()
//
// Gets the current lag count
int fceu_lagcount(lua_State *L) {
lua_pushinteger(L, FCEUI_GetLagCount());
return 1;
}
// string movie.mode() // string movie.mode()
// //
// "record", "playback" or nil // "record", "playback" or nil
@ -685,9 +695,6 @@ static int movie_stop(lua_State *L) {
} }
// Common code by the gui library: make sure the screen array is ready // Common code by the gui library: make sure the screen array is ready
static void gui_prepare() { static void gui_prepare() {
if (!gui_data) if (!gui_data)
@ -1533,6 +1540,7 @@ static const struct luaL_reg fceulib [] = {
{"exec_time", fceu_exec_time}, {"exec_time", fceu_exec_time},
{"setrenderplanes", fceu_setrenderplanes}, {"setrenderplanes", fceu_setrenderplanes},
{"message", fceu_message}, {"message", fceu_message},
{"lagcount", fceu_lagcount},
{NULL,NULL} {NULL,NULL}
}; };

View File

@ -421,6 +421,11 @@ int FCEUMOV_GetFrame(void)
return currFrameCounter; return currFrameCounter;
} }
int FCEUI_GetLagCount(void)
{
return lagCounter;
}
bool FCEUMOV_ShouldPause(void) bool FCEUMOV_ShouldPause(void)
{ {
if(pauseframe && currFrameCounter == pauseframe) if(pauseframe && currFrameCounter == pauseframe)

View File

@ -74,6 +74,7 @@ inline bool FCEUMOV_IsRecording() { return FCEUMOV_Mode(MOVIEMODE_RECORD); }
bool FCEUMOV_ShouldPause(void); bool FCEUMOV_ShouldPause(void);
int FCEUMOV_GetFrame(void); int FCEUMOV_GetFrame(void);
int FCEUI_GetLagCount(void);
int FCEUMOV_WriteState(std::ostream* os); int FCEUMOV_WriteState(std::ostream* os);
bool FCEUMOV_ReadState(std::istream* is, uint32 size); bool FCEUMOV_ReadState(std::istream* is, uint32 size);