diff --git a/changelog.txt b/changelog.txt index 94de6097..aa1ac0e1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ +20-april-2010 - adelikat - New lua functions movie.ispoweron() and movie.isfromsavestate() 20-april-2010 - adelikat - Win32 - Drag & Drop - if dropping a .fcm with no ROM loaded, prompt for one (same functionality that was added to .fm2 files) 08-april-2010 - ugetab - Win32 - Added conditional debugging option 'K', for bank PC is on 07-april-2010 - adelikat - fix bug that caused zapper.read() to crash when movie playback ends diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 6e5d7c97..170c3868 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -2563,6 +2563,27 @@ static int movie_replay (lua_State *L) { return 0; } +//movie.ispoweron +// +//If movie is recorded from power-on +static int movie_ispoweron (lua_State *L) { + if (FCEUMOV_IsRecording() && FCEUMOV_IsPlaying()) + return (currMovieData.savestate.size() == 0); + else + return 0; +} + +//movie.isfromsavestate() +// +//If movie is recorded from a savestate +static int movie_isfromsavestate (lua_State *L) { + if (FCEUMOV_IsRecording() && FCEUMOV_IsPlaying()) + return (currMovieData.savestate.size() != 0); + else + return 0; +} + + #define LUA_SCREEN_WIDTH 256 #define LUA_SCREEN_HEIGHT 224 @@ -4445,6 +4466,8 @@ static const struct luaL_reg movielib[] = { // {"playback", movie_playback}, {"playbeginning", movie_replay}, {"getreadonly", movie_getreadonly}, + {"ispoweron", movie_ispoweron}, //If movie recorded from power-on + {"isfromsavestate", movie_isfromsavestate}, //If movie is recorded from savestate {NULL,NULL} };