From ba6fa16daf040b62f7d23ed4b0cc573bf274f306 Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Thu, 23 Feb 2017 08:42:33 -0500 Subject: [PATCH] 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. --- src/frontend/mame/clifront.cpp | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 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 + load_translation(m_options); + + manager->start_http_server(); + + manager->start_luaengine(); + + manager->start_context(); + + // We need to preprocess the config files once to determine the web server's configuration + // and file locations + if (m_options.read_config()) { - // 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(); + 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