diff options
author | 2011-03-05 04:23:33 +0000 | |
---|---|---|
committer | 2011-03-05 04:23:33 +0000 | |
commit | 658745f3f042ea56852334ad9718eabb3fa7fba1 (patch) | |
tree | f41c36290e8f504135a87514892ba907ab3eca7a /src | |
parent | 0ac68b758f7058dfe64d406c10b909b0beb89fd3 (diff) |
Fix -no<option> for booleans
Fix crash when running with -log
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/machine.c | 2 | ||||
-rw-r--r-- | src/lib/util/options.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/emu/machine.c b/src/emu/machine.c index 01c9d19fc77..0ffcfcfcd96 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -361,7 +361,7 @@ int running_machine::run(bool firstrun) // if we have a logfile, set up the callback if (m_options.log()) { - m_logfile = auto_alloc(this, emu_file(NULL, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS)); + m_logfile = auto_alloc(this, emu_file(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS)); file_error filerr = m_logfile->open("error.log"); assert_always(filerr == FILERR_NONE, "unable to open log file"); add_logerror_callback(logfile_callback); diff --git a/src/lib/util/options.c b/src/lib/util/options.c index 3b7fcfa200d..6b08cfb505e 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -618,9 +618,16 @@ void core_options::append_entry(core_options::entry &newentry) m_entrylist_tailptr = &newentry.m_next; // if we have names, add them to the map + astring tempstr; for (int name = 0; name < ARRAY_LENGTH(newentry.m_name); name++) if (newentry.m_name[name]) + { m_entrymap.add(newentry.m_name[name], &newentry); + + // for boolean options add a "no" variant as well + if (newentry.type() == OPTION_BOOLEAN) + m_entrymap.add(tempstr.cpy("no").cat(newentry.m_name[name]), &newentry); + } } |