summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/luaengine.cpp
diff options
context:
space:
mode:
author feos <feos-theos@yandex.ru>2019-05-09 22:17:54 +0300
committer feos <feos-theos@yandex.ru>2019-05-09 22:17:54 +0300
commiteb909b0fcdc90da41ca8b5dc845ab24a59e1765e (patch)
treedc7e2dac9a8a9dc3c941db68343d3b6863306b22 /src/frontend/mame/luaengine.cpp
parent7fa0b1d2d14f882a74542fa6d45526e127413fff (diff)
explain emu.register_callback(callback, name), add emu.step()
Diffstat (limited to 'src/frontend/mame/luaengine.cpp')
-rwxr-xr-xsrc/frontend/mame/luaengine.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index 9bb1d031842..1aa29704db7 100755
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -736,6 +736,7 @@ void lua_engine::initialize()
* emu.start(driver_name) - start given driver_name
* emu.pause() - pause emulation
* emu.unpause() - unpause emulation
+ * emu.step() - advance one frame
* emu.keypost(keys) - post keys to natural keyboard
* emu.wait(len) - wait for len within coroutine
* emu.lang_translate(str) - get translation for str if available
@@ -748,7 +749,7 @@ void lua_engine::initialize()
* emu.register_frame(callback) - register callback at end of frame
* emu.register_frame_done(callback) - register callback after frame is drawn to screen (for overlays)
* emu.register_periodic(callback) - register periodic callback while program is running
- * emu.register_callback(callback, name) - TODO
+ * emu.register_callback(callback, name) - register callback to be used by MAME via lua_engine::call_plugin()
* emu.register_menu(event_callback, populate_callback, name) - register callbacks for plugin menu
* emu.show_menu(menu_name) - show menu by name and pause the machine
*
@@ -777,6 +778,10 @@ void lua_engine::initialize()
};
emu["pause"] = [this](){ return machine().pause(); };
emu["unpause"] = [this](){ return machine().resume(); };
+ emu["step"] = [this]() {
+ mame_machine_manager::instance()->ui().set_single_step(true);
+ machine().resume();
+ };
emu["register_prestart"] = [this](sol::function func){ register_function(func, "LUA_ON_PRESTART"); };
emu["register_start"] = [this](sol::function func){ register_function(func, "LUA_ON_START"); };
emu["register_stop"] = [this](sol::function func){ register_function(func, "LUA_ON_STOP"); };