summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2017-02-23 08:42:33 -0500
committer Vas Crabb <cuavas@users.noreply.github.com>2017-02-24 01:02:17 +1100
commitba6fa16daf040b62f7d23ed4b0cc573bf274f306 (patch)
treeae4d61e653a594124b902b290ff16749d0ae1397 /src
parent264faf913ebf5782a677b629cef7bf814d4a6bcd (diff)
The recent softlist cleanup broke -console; this fixes it
The reason is that the LUA console, HTTP server and other features relied on the command line arguments being "pre-parsed". Part of the softlist cleanup was to sanitize where command line parsing occurs. This change moves the setup of the LUA console (and other capabilities such as the HTTP server) to the correct place in the new order.
Diffstat (limited to 'src')
-rw-r--r--src/frontend/mame/clifront.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index 450a8384b0f..dfb48b724e9 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -214,29 +214,37 @@ void cli_frontend::start_execution(mame_machine_manager *manager,int argc, char
// if we have a command, execute that
if (*(m_options.command()) != 0)
+ {
execute_commands(exename.c_str());
+ return;
+ }
// otherwise, check for a valid system
- else
- {
- // We need to preprocess the config files once to determine the web server's configuration
- // and file locations
- if (m_options.read_config())
- {
- m_options.revert(OPTION_PRIORITY_INI);
- mame_options::parse_standard_inis(m_options, option_errors);
- }
- if (!option_errors.empty())
- osd_printf_error("Error in command line:\n%s\n", strtrimspace(option_errors).c_str());
+ load_translation(m_options);
- // if we can't find it, give an appropriate error
- const game_driver *system = mame_options::system(m_options);
- if (system == nullptr && *(m_options.system_name()) != 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
+ manager->start_http_server();
+
+ manager->start_luaengine();
+
+ manager->start_context();
- // otherwise just run the game
- m_result = manager->execute();
+ // We need to preprocess the config files once to determine the web server's configuration
+ // and file locations
+ if (m_options.read_config())
+ {
+ m_options.revert(OPTION_PRIORITY_INI);
+ mame_options::parse_standard_inis(m_options, option_errors);
}
+ if (!option_errors.empty())
+ osd_printf_error("Error in command line:\n%s\n", strtrimspace(option_errors).c_str());
+
+ // if we can't find it, give an appropriate error
+ const game_driver *system = mame_options::system(m_options);
+ if (system == nullptr && *(m_options.system_name()) != 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
+
+ // otherwise just run the game
+ m_result = manager->execute();
}
//-------------------------------------------------
@@ -255,14 +263,6 @@ int cli_frontend::execute(int argc, char **argv)
std::string option_errors;
mame_options::parse_standard_inis(m_options, option_errors);
- load_translation(m_options);
-
- manager->start_http_server();
-
- manager->start_luaengine();
-
- manager->start_context();
-
start_execution(manager, argc, argv, option_errors);
}
// handle exceptions of various types