diff options
Diffstat (limited to 'src/emu/emuopts.c')
-rw-r--r-- | src/emu/emuopts.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index fa7e48f934d..ad955994899 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -202,6 +202,10 @@ const options_entry emu_options::s_option_entries[] = emu_options::emu_options() : core_options() +, m_coin_impulse(0) +, m_joystick_contradictory(false) +, m_sleep(true) +, m_refresh_speed(false) { add_entries(emu_options::s_option_entries); } @@ -380,6 +384,8 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_ result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); } while (num != options_count()); + update_cached_options(); + return result; } @@ -393,7 +399,9 @@ bool emu_options::parse_command_line(int argc, char *argv[], std::string &error_ { // parse as normal core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); - return parse_slot_devices(argc, argv, error_string, NULL, NULL); + bool result = parse_slot_devices(argc, argv, error_string, NULL, NULL); + update_cached_options(); + return result; } @@ -468,6 +476,8 @@ void emu_options::parse_standard_inis(std::string &error_string) // Re-evaluate slot options after loading ini files update_slot_options(); + + update_cached_options(); } @@ -570,3 +580,19 @@ const char *emu_options::sub_value(std::string &buffer, const char *name, const buffer.clear(); return buffer.c_str(); } + + +//------------------------------------------------- +// update_cached_options - to prevent tagmap +// lookups keep copies of frequently requested +// options in member variables. +//------------------------------------------------- + +void emu_options::update_cached_options() +{ + m_coin_impulse = int_value(OPTION_COIN_IMPULSE); + m_joystick_contradictory = bool_value(OPTION_JOYSTICK_CONTRADICTORY); + m_sleep = bool_value(OPTION_SLEEP); + m_refresh_speed = bool_value(OPTION_REFRESHSPEED); +} + |