luaengine: add emu.pause()/unpause() methods

Signed-off-by: Luca Bruno <lucab@debian.org>
This commit is contained in:
Luca Bruno 2014-12-01 22:33:55 +01:00
parent 3e9773574e
commit 08fdec9674
2 changed files with 20 additions and 0 deletions

View File

@ -216,6 +216,22 @@ int lua_engine::l_emu_romname(lua_State *L)
return 1;
}
//-------------------------------------------------
// emu_pause/emu_unpause - pause/unpause game
//-------------------------------------------------
int lua_engine::l_emu_pause(lua_State *L)
{
luaThis->machine().pause();
return 0;
}
int lua_engine::l_emu_unpause(lua_State *L)
{
luaThis->machine().resume();
return 0;
}
//-------------------------------------------------
// emu_keypost - post keys to natural keyboard
//-------------------------------------------------
@ -514,6 +530,8 @@ void lua_engine::initialize()
.addCFunction ("after", l_emu_after )
.addCFunction ("exit", l_emu_exit )
.addCFunction ("start", l_emu_start )
.addCFunction ("pause", l_emu_pause )
.addCFunction ("unpause", l_emu_unpause )
.beginClass <machine_manager> ("manager")
.addFunction ("machine", &machine_manager::machine)
.addFunction ("options", &machine_manager::options)

View File

@ -84,6 +84,8 @@ private:
static int l_emu_hook_output(lua_State *L);
static int l_emu_exit(lua_State *L);
static int l_emu_start(lua_State *L);
static int l_emu_pause(lua_State *L);
static int l_emu_unpause(lua_State *L);
void resume(void *L, INT32 param);
void report_errors(int status);