From b947e0d25b249ddde1bb41175fcc5ee0b73df011 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 15 Mar 2009 15:29:35 +0000 Subject: [PATCH] Lua - added movie.active() function. Returns a bool value based on whether a move is loaded. --- changelog.txt | 1 + src/lua-engine.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/changelog.txt b/changelog.txt index 429debb6..3c063032 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.4 yet to be released--- +14-mar-2009 - adelikat - Lua - added movie.active() - returns a bool value based on whether a movie is currently loaded 14-mar-2009 - adelikat - Fixed Joypad.set, it uses 3 values instead of 2 now. True will take control of a button and make it on, False will take control and make it off, and Nil will not take control (allowing the user to press the button) 14-mar-2009 - adelikat - Fix major crash issue where NROM game savestates were writing erroneous information if a non NROM game was loaded prior 13-mar-2009 - adelikat - Closing game / Opening new game resets the frame counter diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index cd04b1d9..21082b7f 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -893,6 +893,9 @@ int fceu_lagcount(lua_State *L) { return 1; } +//fceu_lagged() +// +//Returns true if the game is currently on a lag frame int fceu_lagged (lua_State *L) { bool Lag_Frame = FCEUI_GetLagged(); @@ -934,6 +937,16 @@ static int movie_stop(lua_State *L) { } +// movie.active() +// +//returns a bool value is there is a movie currently opn +int movie_active (lua_State *L) { + + bool movieactive = (FCEUMOV_IsRecording() || FCEUMOV_IsPlaying()); + lua_pushboolean(L, movieactive); + return 1; +} + // Common code by the gui library: make sure the screen array is ready static void gui_prepare() { if (!gui_data) @@ -1837,6 +1850,7 @@ static const struct luaL_reg movielib[] = { {"mode", movie_mode}, {"rerecordcounting", movie_rerecordcounting}, {"stop", movie_stop}, + {"active", movie_active}, // {"record", movie_record}, // {"playback", movie_playback},