summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/mameopts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/mameopts.cpp')
-rw-r--r--src/frontend/mame/mameopts.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp
index 84d1f6a313f..8541abaf515 100644
--- a/src/frontend/mame/mameopts.cpp
+++ b/src/frontend/mame/mameopts.cpp
@@ -16,6 +16,7 @@
#include "softlist_dev.h"
#include "zippath.h"
#include "hashfile.h"
+#include "clifront.h"
#include <ctype.h>
#include <stack>
@@ -354,6 +355,20 @@ bool mame_options::parse_command_line(emu_options &options, std::vector<std::str
: value_specifier_invalid_value();
};
+ // some auxillary verbs expect that slot options are specified; and to do this we need to figure
+ // out if this is necessary for this particular auxillary verb, and if so, set the system name
+ if (!options.command().empty()
+ && cli_frontend::parse_slot_options_for_auxverb(options.command())
+ && !options.command_arguments().empty())
+ {
+ std::string error_string;
+ options.set_value(OPTION_SYSTEMNAME, options.command_arguments()[0].c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+
+ const game_driver *system = mame_options::system(options);
+ if (!system)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "Unknown system '%s'", options.system_name());
+ }
+
// parse the slot devices
parse_slot_devices(options, value_specifier);