diff options
author | 2016-01-06 08:33:28 +0100 | |
---|---|---|
committer | 2016-01-06 08:33:28 +0100 | |
commit | fdce729bcc9f20c2fa59c4aa8e66996eb75f98a7 (patch) | |
tree | 3f3664f0ebbf4f3f3736e573723a34382b54962e | |
parent | 93a2b263b35c0c7d2835ffd6a570a79af8e44688 (diff) | |
parent | b0a2383caee12e377c2cc5c31a842045bb8506c2 (diff) |
Merge branch 'h0tw1r3-master'
-rw-r--r-- | src/emu/emuopts.cpp | 1 | ||||
-rw-r--r-- | src/emu/emuopts.h | 4 | ||||
-rw-r--r-- | src/emu/luaengine.cpp | 5 | ||||
-rw-r--r-- | src/emu/mame.cpp | 3 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 11938000fe7..c27064b1521 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -185,6 +185,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_AUTOBOOT_COMMAND ";ab", nullptr, OPTION_STRING, "command to execute after machine boot" }, { OPTION_AUTOBOOT_DELAY, "2", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" }, { OPTION_AUTOBOOT_SCRIPT ";script", nullptr, OPTION_STRING, "lua script to execute after machine boot" }, + { OPTION_CONSOLE, "0", OPTION_BOOLEAN, "enable emulator LUA console" }, { nullptr } }; diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index 3bd7cd8afd6..09452859488 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -189,6 +189,8 @@ enum #define OPTION_AUTOBOOT_DELAY "autoboot_delay" #define OPTION_AUTOBOOT_SCRIPT "autoboot_script" +#define OPTION_CONSOLE "console" + //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -361,6 +363,8 @@ public: int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); } const char *autoboot_script() const { return value(OPTION_AUTOBOOT_SCRIPT); } + bool console() const { return bool_value(OPTION_CONSOLE); } + // FIXME: Couriersud: This should be in image_device_exit void remove_device_options(); diff --git a/src/emu/luaengine.cpp b/src/emu/luaengine.cpp index 98725e9ee40..aa3b523fbfd 100644 --- a/src/emu/luaengine.cpp +++ b/src/emu/luaengine.cpp @@ -9,6 +9,7 @@ ***************************************************************************/ #include <limits> +#include <thread> #include "lua.hpp" #include "luabridge/Source/LuaBridge/LuaBridge.h" #include <signal.h> @@ -860,14 +861,12 @@ void lua_engine::serve_lua() } while (1); } -/* static void *serve_lua(void *param) { lua_engine *engine = (lua_engine *)param; engine->serve_lua(); return NULL; } -*/ //------------------------------------------------- // lua_engine - constructor @@ -1024,6 +1023,8 @@ void lua_engine::initialize() void lua_engine::start_console() { + std::thread th(::serve_lua, this); + th.detach(); } //------------------------------------------------- diff --git a/src/emu/mame.cpp b/src/emu/mame.cpp index b952c7ef624..e18e41329ad 100644 --- a/src/emu/mame.cpp +++ b/src/emu/mame.cpp @@ -167,6 +167,9 @@ int machine_manager::execute() int error = MAMERR_NONE; m_lua->initialize(); + if (m_options.console()) { + m_lua->start_console(); + } while (error == MAMERR_NONE && !exit_pending) { m_new_driver_pending = nullptr; |