diff options
author | 2016-02-21 11:48:45 +0100 | |
---|---|---|
committer | 2016-02-21 11:48:45 +0100 | |
commit | cc24a339d8c0517259084b5c178d784626ba965c (patch) | |
tree | 9868e9687b5802ae0a3733712a3bbeb3bc75c953 /src/emu/clifront.cpp | |
parent | b5daabda5495dea5c50e17961ecfed2ea8619d76 (diff) |
Merge remote-tracking branch 'refs/remotes/mamedev/master'
Second attempt
Diffstat (limited to 'src/emu/clifront.cpp')
-rw-r--r-- | src/emu/clifront.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/emu/clifront.cpp b/src/emu/clifront.cpp index 05b0ace6116..2643fd3e5db 100644 --- a/src/emu/clifront.cpp +++ b/src/emu/clifront.cpp @@ -27,6 +27,8 @@ #include "osdepend.h" #include "softlist.h" +#include "ui/moptions.h" + #include <new> #include <ctype.h> @@ -97,6 +99,8 @@ int cli_frontend::execute(int argc, char **argv) { // wrap the core execution in a try/catch to field all fatal errors m_result = MAMERR_NONE; + machine_manager *manager = machine_manager::instance(m_options, m_osd); + try { // first parse options to be able to get software from it @@ -104,6 +108,8 @@ int cli_frontend::execute(int argc, char **argv) m_options.parse_command_line(argc, argv, option_errors); m_options.parse_standard_inis(option_errors); + + manager->start_luaengine(); if (*(m_options.software_name()) != 0) { @@ -148,7 +154,7 @@ int cli_frontend::execute(int argc, char **argv) strprintf(val, "%s:%s:%s", swlistdev->list_name(), m_options.software_name(), swpart->name()); // call this in order to set slot devices according to mounting - m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.c_str()); + m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.c_str(), swpart); break; } } @@ -209,9 +215,7 @@ int cli_frontend::execute(int argc, char **argv) throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name()); // otherwise just run the game - machine_manager *manager = machine_manager::instance(m_options, m_osd); m_result = manager->execute(); - global_free(manager); } } @@ -234,7 +238,7 @@ int cli_frontend::execute(int argc, char **argv) // print them out osd_printf_error("\n\"%s\" approximately matches the following\n" - "supported %s (best match first):\n\n", m_options.system_name(),emulator_info::get_gamesnoun()); + "supported machines (best match first):\n\n", m_options.system_name()); for (auto & matche : matches) if (matche != -1) osd_printf_error("%-18s%s\n", drivlist.driver(matche).name, drivlist.driver(matche).description); @@ -262,6 +266,7 @@ int cli_frontend::execute(int argc, char **argv) } _7z_file_cache_clear(); + global_free(manager); return m_result; } @@ -1586,7 +1591,7 @@ void cli_frontend::execute_commands(const char *exename) // showusage? if (strcmp(m_options.command(), CLICOMMAND_SHOWUSAGE) == 0) { - emulator_info::printf_usage(exename, emulator_info::get_gamenoun()); + osd_printf_info("Usage: %s [machine] [media] [software] [options]",exename); osd_printf_info("\n\nOptions:\n%s", m_options.output_help().c_str()); return; } @@ -1618,6 +1623,14 @@ void cli_frontend::execute_commands(const char *exename) // generate the updated INI file.puts(m_options.output_ini().c_str()); + + ui_options ui_opts; + emu_file file_ui(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); + if (file_ui.open("ui.ini") != FILERR_NONE) + throw emu_fatalerror("Unable to create file ui.ini\n"); + + // generate the updated INI + file_ui.puts(ui_opts.output_ini().c_str()); return; } @@ -1680,8 +1693,10 @@ void cli_frontend::execute_commands(const char *exename) void cli_frontend::display_help() { osd_printf_info("%s v%s\n%s\n\n", emulator_info::get_appname(),build_version,emulator_info::get_copyright_info()); - osd_printf_info("%s\n", emulator_info::get_disclaimer()); - emulator_info::printf_usage(emulator_info::get_appname(),emulator_info::get_gamenoun()); + osd_printf_info("This software reproduces, more or less faithfully, the behaviour of a wide range\n" + "of machines. But hardware is useless without software, so images of the ROMs and\n" + "other media which run on that hardware are also required.\n\n"); + osd_printf_info("Usage: %s [machine] [media] [software] [options]",emulator_info::get_appname()); osd_printf_info("\n\n" " %s -showusage for a brief list of options\n" " %s -showconfig for a list of configuration options\n" |