diff options
author | 2016-04-04 23:46:44 -0400 | |
---|---|---|
committer | 2016-04-04 23:46:44 -0400 | |
commit | ee12b7d2f74834cb9ca9dd8d6de7ba9d8c1f30e1 (patch) | |
tree | 18feb0ad0b3c6872533c73964440eb7f626a4174 | |
parent | 1046be89db453886ee98b72c846f6e42e8da3cfa (diff) |
Revert software-installed slot/image options when changing software
- Remove emu.h's stealth include of emuopts.h through mconfig.h; reduce dependency on emuopts.h in other headers and source files.
- MCFG_CPU_FORCE_NO_DRC is now a CPU configuration parameter rather than a global one; it still works to override the -drc option setting.
49 files changed, 106 insertions, 78 deletions
diff --git a/src/devices/bus/a1bus/a1bus.cpp b/src/devices/bus/a1bus/a1bus.cpp index c3ebc73c6de..5075233c2bd 100644 --- a/src/devices/bus/a1bus/a1bus.cpp +++ b/src/devices/bus/a1bus/a1bus.cpp @@ -7,7 +7,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "a1bus.h" diff --git a/src/devices/bus/a2bus/a2bus.cpp b/src/devices/bus/a2bus/a2bus.cpp index 5fd03495c87..2083a607690 100644 --- a/src/devices/bus/a2bus/a2bus.cpp +++ b/src/devices/bus/a2bus/a2bus.cpp @@ -71,7 +71,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "a2bus.h" diff --git a/src/devices/bus/a2bus/a2eauxslot.cpp b/src/devices/bus/a2bus/a2eauxslot.cpp index f1d4836d37b..c362c23abe5 100644 --- a/src/devices/bus/a2bus/a2eauxslot.cpp +++ b/src/devices/bus/a2bus/a2eauxslot.cpp @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "a2eauxslot.h" diff --git a/src/devices/bus/bml3/bml3bus.cpp b/src/devices/bus/bml3/bml3bus.cpp index 0438cc58997..620743dbe68 100644 --- a/src/devices/bus/bml3/bml3bus.cpp +++ b/src/devices/bus/bml3/bml3bus.cpp @@ -43,7 +43,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "bml3bus.h" diff --git a/src/devices/bus/coco/cococart.cpp b/src/devices/bus/coco/cococart.cpp index 66cbc1dc121..3e6b2ee2c6f 100644 --- a/src/devices/bus/coco/cococart.cpp +++ b/src/devices/bus/coco/cococart.cpp @@ -10,7 +10,6 @@ #include "emu.h" #include "cococart.h" -#include "emuopts.h" /*************************************************************************** PARAMETERS diff --git a/src/devices/bus/cpc/cpcexp.cpp b/src/devices/bus/cpc/cpcexp.cpp index 69ad0887282..43b35ac57f2 100644 --- a/src/devices/bus/cpc/cpcexp.cpp +++ b/src/devices/bus/cpc/cpcexp.cpp @@ -9,7 +9,6 @@ #include "emu.h" -#include "emuopts.h" #include "cpcexp.h" diff --git a/src/devices/bus/iq151/iq151.cpp b/src/devices/bus/iq151/iq151.cpp index 3d4ef7abe05..16839150b5a 100644 --- a/src/devices/bus/iq151/iq151.cpp +++ b/src/devices/bus/iq151/iq151.cpp @@ -8,7 +8,6 @@ #include "emu.h" #include "iq151.h" -#include "emuopts.h" #define LOG 0 diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp index 9b07bdce8e0..defba476704 100644 --- a/src/devices/bus/isa/isa.cpp +++ b/src/devices/bus/isa/isa.cpp @@ -7,7 +7,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "isa.h" diff --git a/src/devices/bus/kc/kc.cpp b/src/devices/bus/kc/kc.cpp index a5a46802998..05afba8ed7a 100644 --- a/src/devices/bus/kc/kc.cpp +++ b/src/devices/bus/kc/kc.cpp @@ -106,7 +106,6 @@ #include "emu.h" #include "kc.h" -#include "emuopts.h" #define LOG 0 diff --git a/src/devices/bus/macpds/macpds.cpp b/src/devices/bus/macpds/macpds.cpp index 61fae5f3a17..967655548e8 100644 --- a/src/devices/bus/macpds/macpds.cpp +++ b/src/devices/bus/macpds/macpds.cpp @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "macpds.h" diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp index 175139f19c2..a5df6ef18a2 100644 --- a/src/devices/bus/nubus/nubus.cpp +++ b/src/devices/bus/nubus/nubus.cpp @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "nubus.h" diff --git a/src/devices/bus/pc_kbd/pc_kbdc.cpp b/src/devices/bus/pc_kbd/pc_kbdc.cpp index 9f920c6d5dd..987c51eda63 100644 --- a/src/devices/bus/pc_kbd/pc_kbdc.cpp +++ b/src/devices/bus/pc_kbd/pc_kbdc.cpp @@ -14,7 +14,6 @@ The following basic program can be useful for identifying scancodes: #include "emu.h" -#include "emuopts.h" #include "pc_kbdc.h" diff --git a/src/devices/bus/ti99x/gromport.cpp b/src/devices/bus/ti99x/gromport.cpp index 9a836f970d1..0109c15708d 100644 --- a/src/devices/bus/ti99x/gromport.cpp +++ b/src/devices/bus/ti99x/gromport.cpp @@ -111,6 +111,7 @@ ***************************************************************************/ #include "gromport.h" +#include "emuopts.h" #include "image.h" #include "softlist.h" diff --git a/src/devices/bus/tvc/tvc.cpp b/src/devices/bus/tvc/tvc.cpp index 2ee28a2f3c0..db2ed411ad2 100644 --- a/src/devices/bus/tvc/tvc.cpp +++ b/src/devices/bus/tvc/tvc.cpp @@ -8,7 +8,6 @@ #include "emu.h" #include "tvc.h" -#include "emuopts.h" /*************************************************************************** diff --git a/src/devices/bus/x68k/x68kexp.cpp b/src/devices/bus/x68k/x68kexp.cpp index 39f1f74eec9..7019498fa23 100644 --- a/src/devices/bus/x68k/x68kexp.cpp +++ b/src/devices/bus/x68k/x68kexp.cpp @@ -5,7 +5,6 @@ */ #include "emu.h" -#include "emuopts.h" #include "x68kexp.h" //************************************************************************** diff --git a/src/devices/bus/z88/z88.cpp b/src/devices/bus/z88/z88.cpp index 62313b76dd3..062fdeade29 100644 --- a/src/devices/bus/z88/z88.cpp +++ b/src/devices/bus/z88/z88.cpp @@ -10,7 +10,6 @@ #include "emu.h" #include "z88.h" -#include "emuopts.h" /*************************************************************************** diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index 7e9628bc671..096dc2cbf5c 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -169,6 +169,7 @@ #include <stddef.h> #include "emu.h" #include "debugger.h" +#include "emuopts.h" #include "drcuml.h" #include "drcbex64.h" diff --git a/src/devices/cpu/drcbex86.cpp b/src/devices/cpu/drcbex86.cpp index 92b5f628939..4ff6a90774b 100644 --- a/src/devices/cpu/drcbex86.cpp +++ b/src/devices/cpu/drcbex86.cpp @@ -85,6 +85,7 @@ #include <stddef.h> #include "emu.h" #include "debugger.h" +#include "emuopts.h" #include "drcuml.h" #include "drcbex86.h" diff --git a/src/devices/cpu/drcuml.cpp b/src/devices/cpu/drcuml.cpp index 5c13c76b4c6..736301ff606 100644 --- a/src/devices/cpu/drcuml.cpp +++ b/src/devices/cpu/drcuml.cpp @@ -35,6 +35,7 @@ ***************************************************************************/ #include "emu.h" +#include "emuopts.h" #include "drcuml.h" #include "drcbec.h" #include "drcbex86.h" diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index 20d82bd3725..279f9404c50 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -316,7 +316,7 @@ void mips3_device::check_irqs() void mips3_device::device_start() { - m_isdrc = (mconfig().options().drc() && !mconfig().m_force_no_drc) ? true : false; + m_isdrc = allow_drc(); /* allocate the implementation-specific state from the full cache */ m_core = (internal_mips3_state *)m_cache.alloc_near(sizeof(internal_mips3_state)); diff --git a/src/devices/cpu/mips/mips3drc.cpp b/src/devices/cpu/mips/mips3drc.cpp index 7b6da3a1626..9995cdb105f 100644 --- a/src/devices/cpu/mips/mips3drc.cpp +++ b/src/devices/cpu/mips/mips3drc.cpp @@ -150,7 +150,7 @@ inline void mips3_device::save_fast_iregs(drcuml_block *block) void mips3_device::mips3drc_set_options(UINT32 options) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; m_drcoptions = options; } @@ -196,7 +196,7 @@ void mips3_device::add_fastram(offs_t start, offs_t end, UINT8 readonly, void *b void mips3_device::mips3drc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; if (m_hotspot_select < ARRAY_LENGTH(m_hotspot)) { m_hotspot[m_hotspot_select].pc = pc; diff --git a/src/devices/cpu/rsp/rsp.cpp b/src/devices/cpu/rsp/rsp.cpp index 246843fb6af..9fd2525e193 100644 --- a/src/devices/cpu/rsp/rsp.cpp +++ b/src/devices/cpu/rsp/rsp.cpp @@ -361,7 +361,7 @@ void rsp_device::resolve_cb() void rsp_device::device_start() { - m_isdrc = (mconfig().options().drc() && !mconfig().m_force_no_drc) ? true : false; + m_isdrc = allow_drc(); m_rsp_state = (internal_rsp_state *)m_cache.alloc_near(sizeof(internal_rsp_state)); if (LOG_INSTRUCTION_EXECUTION) diff --git a/src/devices/cpu/rsp/rspdrc.cpp b/src/devices/cpu/rsp/rspdrc.cpp index c581cfb3aba..ce334b91cc8 100644 --- a/src/devices/cpu/rsp/rspdrc.cpp +++ b/src/devices/cpu/rsp/rspdrc.cpp @@ -183,7 +183,7 @@ static void cfunc_write32(void *param) void rsp_device::rspdrc_set_options(UINT32 options) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; m_drcoptions = options; } @@ -307,7 +307,7 @@ void rsp_device::execute_run_drc() void rsp_device::rspdrc_flush_drc_cache() { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; m_cache_dirty = TRUE; } diff --git a/src/devices/cpu/sh2/sh2.cpp b/src/devices/cpu/sh2/sh2.cpp index 751349dbd0c..0201e8d8a44 100644 --- a/src/devices/cpu/sh2/sh2.cpp +++ b/src/devices/cpu/sh2/sh2.cpp @@ -193,7 +193,7 @@ sh2_device::sh2_device(const machine_config &mconfig, const char *tag, device_t , m_out_of_cycles(nullptr) , m_debugger_temp(0) { - m_isdrc = (mconfig.options().drc() && !mconfig.m_force_no_drc) ? true : false; + m_isdrc = allow_drc(); } @@ -225,7 +225,7 @@ sh2_device::sh2_device(const machine_config &mconfig, device_type type, const ch , m_nocode(nullptr) , m_out_of_cycles(nullptr) { - m_isdrc = (mconfig.options().drc() && !mconfig.m_force_no_drc) ? true : false; + m_isdrc = allow_drc(); } sh2a_device::sh2a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) diff --git a/src/devices/cpu/sh2/sh2drc.cpp b/src/devices/cpu/sh2/sh2drc.cpp index db732e57b40..e7b2460198a 100644 --- a/src/devices/cpu/sh2/sh2drc.cpp +++ b/src/devices/cpu/sh2/sh2drc.cpp @@ -11,7 +11,6 @@ #include "debugger.h" #include "sh2.h" #include "sh2comn.h" -#include "mconfig.h" extern unsigned DasmSH2(char *buffer, unsigned pc, UINT16 opcode); @@ -2946,7 +2945,7 @@ int sh2_device::generate_group_12(drcuml_block *block, compiler_state *compiler, void sh2_device::sh2drc_set_options(UINT32 options) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; m_drcoptions = options; } @@ -2958,7 +2957,7 @@ void sh2_device::sh2drc_set_options(UINT32 options) void sh2_device::sh2drc_add_pcflush(offs_t address) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; if (m_pcfsel < ARRAY_LENGTH(m_pcflushes)) m_pcflushes[m_pcfsel++] = address; diff --git a/src/emu/devcpu.cpp b/src/emu/devcpu.cpp index 00bac6ed1b0..43460235b19 100644 --- a/src/emu/devcpu.cpp +++ b/src/emu/devcpu.cpp @@ -9,6 +9,7 @@ ***************************************************************************/ #include "emu.h" +#include "emuopts.h" #include <ctype.h> @@ -25,7 +26,8 @@ cpu_device::cpu_device(const machine_config &mconfig, device_type type, const ch device_execute_interface(mconfig, *this), device_memory_interface(mconfig, *this), device_state_interface(mconfig, *this), - device_disasm_interface(mconfig, *this) + device_disasm_interface(mconfig, *this), + m_force_no_drc(false) { } @@ -37,3 +39,24 @@ cpu_device::cpu_device(const machine_config &mconfig, device_type type, const ch cpu_device::~cpu_device() { } + + +//------------------------------------------------- +// static_set_force_no_drc - configuration helper +// to disable DRC +//------------------------------------------------- + +void cpu_device::static_set_force_no_drc(device_t &device, bool value) +{ + downcast<cpu_device &>(device).m_force_no_drc = value; +} + + +//------------------------------------------------- +// allow_drc - return true if DRC is allowed +//------------------------------------------------- + +bool cpu_device::allow_drc() const +{ + return mconfig().options().drc() && !m_force_no_drc; +} diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h index 0a298a4ddf8..f34d5645b78 100644 --- a/src/emu/devcpu.h +++ b/src/emu/devcpu.h @@ -42,6 +42,11 @@ #define MCFG_CPU_PERIODIC_INT_REMOVE MCFG_DEVICE_PERIODIC_INT_REMOVE #define MCFG_CPU_IRQ_ACKNOWLEDGE_REMOVE MCFG_DEVICE_IRQ_ACKNOWLEDGE_REMOVE +// recompilation parameters +#define MCFG_CPU_FORCE_NO_DRC() \ + cpu_device::static_set_force_no_drc(*device, true); + + //************************************************************************** // MACROS @@ -66,10 +71,19 @@ class cpu_device : public device_t, { friend resource_pool_object<cpu_device>::~resource_pool_object(); +public: + // configuration helpers + static void static_set_force_no_drc(device_t &device, bool value); + bool allow_drc() const; + protected: // construction/destruction cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); virtual ~cpu_device(); + +private: + // configured state + bool m_force_no_drc; // whether or not to force DRC off }; diff --git a/src/emu/drivers/empty.cpp b/src/emu/drivers/empty.cpp index f012e376813..9b075c10308 100644 --- a/src/emu/drivers/empty.cpp +++ b/src/emu/drivers/empty.cpp @@ -9,6 +9,7 @@ **************************************************************************/ #include "emu.h" +#include "emuopts.h" #include "render.h" #include "ui/selgame.h" #include "ui/simpleselgame.h" diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index dfca2bde492..d480f94a284 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -255,24 +255,16 @@ bool emu_options::add_slot_options(const software_part *swpart) if (slot->fixed()) continue; - // first device? add the header as to be pretty - if (m_slot_options++ == 0) - add_entry(nullptr, "SLOT DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); - // retrieve info about the device instance const char *name = slot->device().tag() + 1; if (!exists(name)) { + // first device? add the header as to be pretty + if (m_slot_options++ == 0) + add_entry(nullptr, "SLOT DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); + // add the option - UINT32 flags = OPTION_STRING | OPTION_FLAG_DEVICE; - const char *defvalue = slot->default_option(); - if (defvalue != nullptr) - { - const device_slot_option *option = slot->option(defvalue); - if (option != nullptr && !option->selectable()) - flags |= OPTION_FLAG_INTERNAL; - } - add_entry(name, nullptr, flags, defvalue, true); + add_entry(name, nullptr, OPTION_STRING | OPTION_FLAG_DEVICE, slot->default_option(), true); } // allow software lists to supply their own defaults @@ -314,12 +306,21 @@ void emu_options::update_slot_options(const software_part *swpart) if (exists(name) && !slot->option_list().empty()) { std::string defvalue = slot->get_default_card_software(); - if (defvalue.length() > 0) + if (defvalue.empty()) { - set_default_value(name, defvalue.c_str()); - const device_slot_option *option = slot->option(defvalue.c_str()); - set_flag(name, ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); + // keep any non-default setting + if (priority(name) > OPTION_PRIORITY_DEFAULT) + continue; + + // reinstate the actual default value as configured + if (slot->default_option() != nullptr) + defvalue.assign(slot->default_option()); } + + // set the value and hide the option if not selectable + set_default_value(name, defvalue.c_str()); + const device_slot_option *option = slot->option(defvalue.c_str()); + set_flag(name, ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); } } while (add_slot_options(swpart)) { } @@ -344,10 +345,6 @@ void emu_options::add_device_options() image_interface_iterator iter(config.root_device()); for (const device_image_interface *image = iter.first(); image != nullptr; image = iter.next()) { - // first device? add the header as to be pretty - if (m_device_options++ == 0) - add_entry(nullptr, "IMAGE DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); - // retrieve info about the device instance std::ostringstream option_name; util::stream_format(option_name, "%s;%s", image->instance_name(), image->brief_instance_name()); @@ -356,7 +353,14 @@ void emu_options::add_device_options() // add the option if (!exists(image->instance_name())) + { + // first device? add the header as to be pretty + if (m_device_options++ == 0) + add_entry(nullptr, "IMAGE DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); + + // add the option add_entry(option_name.str().c_str(), nullptr, OPTION_STRING | OPTION_FLAG_DEVICE, nullptr, true); + } } } @@ -401,12 +405,10 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_ core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); // keep adding slot options until we stop seeing new stuff - m_slot_options = 0; while (add_slot_options(swpart)) core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); // add device options and reparse - m_device_options = 0; add_device_options(); if (name != nullptr && exists(name)) set_value(name, value, OPTION_PRIORITY_SUBCMD, error_string); @@ -560,6 +562,11 @@ void emu_options::set_system_name(const char *name) // remove any existing device options remove_device_options(); } + else + { + // revert device options set for the old software + revert(OPTION_PRIORITY_SUBCMD, OPTION_PRIORITY_SUBCMD); + } // get the new system const game_driver *cursystem = system(); diff --git a/src/emu/language.cpp b/src/emu/language.cpp index 8d4618c7be3..5c9686a646e 100644 --- a/src/emu/language.cpp +++ b/src/emu/language.cpp @@ -9,6 +9,7 @@ ***************************************************************************/ #include "emu.h" +#include "emuopts.h" static std::unordered_map<std::string, std::string> g_translation; diff --git a/src/emu/luaengine.cpp b/src/emu/luaengine.cpp index 8de543669d2..1f767413b50 100644 --- a/src/emu/luaengine.cpp +++ b/src/emu/luaengine.cpp @@ -16,6 +16,7 @@ #include "emu.h" #include "cheat.h" #include "drivenum.h" +#include "emuopts.h" #include "ui/ui.h" #include "luaengine.h" #include <mutex> diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp index 793da15c1a0..2bf2eaab3d6 100644 --- a/src/emu/mconfig.cpp +++ b/src/emu/mconfig.cpp @@ -25,7 +25,6 @@ machine_config::machine_config(const game_driver &gamedrv, emu_options &options) : m_minimum_quantum(attotime::zero), m_watchdog_vblank_count(0), m_watchdog_time(attotime::zero), - m_force_no_drc(false), m_default_layout(nullptr), m_gamedrv(gamedrv), m_options(options) diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index 412c2c12e82..582ea14d035 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -18,8 +18,6 @@ #ifndef __MCONFIG_H__ #define __MCONFIG_H__ -#include "emuopts.h" - //************************************************************************** // CONSTANTS //************************************************************************** @@ -72,7 +70,6 @@ public: std::string m_perfect_cpu_quantum; // tag of CPU to use for "perfect" scheduling INT32 m_watchdog_vblank_count; // number of VBLANKs until the watchdog kills us attotime m_watchdog_time; // length of time until the watchdog kills us - bool m_force_no_drc; // whether or not to force DRC off // other parameters const internal_layout * m_default_layout; // default layout for this machine @@ -202,10 +199,6 @@ References an external machine config. #define MCFG_QUANTUM_PERFECT_CPU(_cputag) \ config.m_perfect_cpu_quantum = owner->subtag(_cputag); -// recompilation parameters -#define MCFG_FORCE_NO_DRC() \ - config.m_force_no_drc = true; - // watchdog configuration #define MCFG_WATCHDOG_VBLANK_INIT(_count) \ config.m_watchdog_vblank_count = _count; diff --git a/src/emu/memory.cpp b/src/emu/memory.cpp index 331345ea63d..92ee2676342 100644 --- a/src/emu/memory.cpp +++ b/src/emu/memory.cpp @@ -174,6 +174,7 @@ #include <map> #include "emu.h" +#include "emuopts.h" #include "debug/debugcpu.h" diff --git a/src/emu/ui/ctrlmenu.cpp b/src/emu/ui/ctrlmenu.cpp index 0fc7304a550..3a82a9f5e9f 100644 --- a/src/emu/ui/ctrlmenu.cpp +++ b/src/emu/ui/ctrlmenu.cpp @@ -9,6 +9,7 @@ *********************************************************************/ #include "emu.h" +#include "emuopts.h" #include "ui/ui.h" #include "ui/menu.h" #include "ui/ctrlmenu.h" diff --git a/src/emu/ui/imgcntrl.cpp b/src/emu/ui/imgcntrl.cpp index 0b44f1f8e8c..883541786af 100644 --- a/src/emu/ui/imgcntrl.cpp +++ b/src/emu/ui/imgcntrl.cpp @@ -9,6 +9,7 @@ ***************************************************************************/ #include "emu.h" +#include "emuopts.h" #include "ui/ui.h" #include "ui/menu.h" #include "ui/imgcntrl.h" diff --git a/src/emu/ui/slotopt.cpp b/src/emu/ui/slotopt.cpp index 693c28a9ba8..35c9cab14a7 100644 --- a/src/emu/ui/slotopt.cpp +++ b/src/emu/ui/slotopt.cpp @@ -9,7 +9,7 @@ *********************************************************************/ #include "emu.h" - +#include "emuopts.h" #include "ui/ui.h" #include "ui/menu.h" #include "ui/slotopt.h" diff --git a/src/emu/ui/submenu.h b/src/emu/ui/submenu.h index 0f7bd233756..a47a84f4d5b 100644 --- a/src/emu/ui/submenu.h +++ b/src/emu/ui/submenu.h @@ -12,6 +12,7 @@ #ifndef __UI_SUBMENU_H__ #define __UI_SUBMENU_H__ +#include "emuopts.h" #include "ui/menu.h" //------------------------------------------------- diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp index c6aee563a63..f8ef33b0d39 100644 --- a/src/lib/util/options.cpp +++ b/src/lib/util/options.cpp @@ -146,13 +146,13 @@ void core_options::entry::set_flag(UINT32 mask, UINT32 flag) //------------------------------------------------- // revert - revert back to our default if we are -// at or below the given priority +// within the given priority range //------------------------------------------------- -void core_options::entry::revert(int priority) +void core_options::entry::revert(int priority_hi, int priority_lo) { - // if our priority is low enough, revert to the default - if (m_priority <= priority) + // if our priority is within the range, revert to the default + if (m_priority <= priority_hi && m_priority >= priority_lo) { m_data = m_defdata; m_priority = OPTION_PRIORITY_DEFAULT; @@ -465,11 +465,11 @@ bool core_options::parse_ini_file(util::core_file &inifile, int priority, int ig // priority back to their defaults //------------------------------------------------- -void core_options::revert(int priority) +void core_options::revert(int priority_hi, int priority_lo) { // iterate over options and revert to defaults if below the given priority for (entry &curentry : m_entrylist) - curentry.revert(priority); + curentry.revert(priority_hi, priority_lo); } diff --git a/src/lib/util/options.h b/src/lib/util/options.h index d2f016f1cdc..ff1cad115de 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -97,7 +97,7 @@ public: void set_description(const char *description); void set_flag(UINT32 mask, UINT32 flag); void mark_changed() { m_changed = true; } - void revert(int priority); + void revert(int priority_hi, int priority_lo); private: // internal state @@ -151,7 +151,7 @@ public: bool parse_ini_file(util::core_file &inifile, int priority, int ignore_priority, std::string &error_string); // reverting - void revert(int priority = OPTION_PRIORITY_MAXIMUM); + void revert(int priority_hi = OPTION_PRIORITY_MAXIMUM, int priority_lo = OPTION_PRIORITY_DEFAULT); // output std::string output_ini(const core_options *diff = nullptr) const; diff --git a/src/mame/drivers/aleck64.cpp b/src/mame/drivers/aleck64.cpp index c86157b6e6a..1463151de96 100644 --- a/src/mame/drivers/aleck64.cpp +++ b/src/mame/drivers/aleck64.cpp @@ -845,6 +845,7 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state ) MCFG_MIPS3_DCACHE_SIZE(8192) MCFG_MIPS3_SYSTEM_CLOCK(62500000) MCFG_CPU_PROGRAM_MAP(n64_map) + MCFG_CPU_FORCE_NO_DRC() MCFG_CPU_ADD("rsp", RSP, 62500000) MCFG_RSP_DP_REG_R_CB(DEVREAD32("rcp",n64_periphs, dp_reg_r)) @@ -853,6 +854,7 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state ) MCFG_RSP_SP_REG_W_CB(DEVWRITE32("rcp",n64_periphs, sp_reg_w)) MCFG_RSP_SP_SET_STATUS_CB(DEVWRITE32("rcp",n64_periphs, sp_set_status)) MCFG_CPU_PROGRAM_MAP(rsp_map) + MCFG_CPU_FORCE_NO_DRC() MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -872,8 +874,6 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) MCFG_N64_PERIPHS_ADD("rcp"); - - MCFG_FORCE_NO_DRC() MACHINE_CONFIG_END UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp index ee33848dd11..c26edd9b298 100644 --- a/src/mame/drivers/jaguar.cpp +++ b/src/mame/drivers/jaguar.cpp @@ -339,7 +339,6 @@ Notes: #include "machine/vt83c461.h" #include "sound/dac.h" #include "includes/jaguar.h" -#include "emuopts.h" #include "imagedev/snapquik.h" #include "sound/dac.h" #include "machine/eepromser.h" diff --git a/src/mame/drivers/n64.cpp b/src/mame/drivers/n64.cpp index 9c4e7d146ee..e3cefcdf6d6 100644 --- a/src/mame/drivers/n64.cpp +++ b/src/mame/drivers/n64.cpp @@ -418,12 +418,13 @@ static MACHINE_CONFIG_START( n64, n64_mess_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", VR4300BE, 93750000) - MCFG_FORCE_NO_DRC() + MCFG_CPU_FORCE_NO_DRC() MCFG_CPU_CONFIG(config) MCFG_CPU_PROGRAM_MAP(n64_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", n64_mess_state, n64_reset_poll) MCFG_CPU_ADD("rsp", RSP, 62500000) + MCFG_CPU_FORCE_NO_DRC() MCFG_RSP_DP_REG_R_CB(DEVREAD32("rcp",n64_periphs, dp_reg_r)) MCFG_RSP_DP_REG_W_CB(DEVWRITE32("rcp",n64_periphs, dp_reg_w)) MCFG_RSP_SP_REG_R_CB(DEVREAD32("rcp",n64_periphs, sp_reg_r)) @@ -464,8 +465,6 @@ static MACHINE_CONFIG_START( n64, n64_mess_state ) /* software lists */ MCFG_SOFTWARE_LIST_ADD("cart_list", "n64") - - MCFG_FORCE_NO_DRC() MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( n64dd, n64 ) diff --git a/src/mame/drivers/nc.cpp b/src/mame/drivers/nc.cpp index 576464351ed..0f76cf72df1 100644 --- a/src/mame/drivers/nc.cpp +++ b/src/mame/drivers/nc.cpp @@ -96,7 +96,6 @@ ******************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "cpu/z80/z80.h" #include "includes/nc.h" #include "machine/mc146818.h" /* for NC200 real time clock */ diff --git a/src/mame/includes/cybiko.h b/src/mame/includes/cybiko.h index 0c6ad30b5aa..5ccbc687a90 100644 --- a/src/mame/includes/cybiko.h +++ b/src/mame/includes/cybiko.h @@ -19,7 +19,6 @@ /* Core includes */ #include "emu.h" -#include "emuopts.h" #include "sound/speaker.h" /* Components */ diff --git a/src/mame/machine/m1comm.cpp b/src/mame/machine/m1comm.cpp index ceec0fc893b..acde86cc451 100644 --- a/src/mame/machine/m1comm.cpp +++ b/src/mame/machine/m1comm.cpp @@ -51,6 +51,8 @@ Notes: JP8 - Jumper, set to 1-2 (selects CLOCK SOURCE) */ +#include "emu.h" +#include "emuopts.h" #include "machine/m1comm.h" #define Z80_TAG "m1commcpu" diff --git a/src/mame/machine/m1comm.h b/src/mame/machine/m1comm.h index 56106dbe28f..366ad62a455 100644 --- a/src/mame/machine/m1comm.h +++ b/src/mame/machine/m1comm.h @@ -7,7 +7,6 @@ #define __M1COMM_SIMULATION__ -#include "emu.h" #include "cpu/z80/z80.h" #define MCFG_M1COMM_ADD(_tag ) \ diff --git a/src/mame/machine/s32comm.cpp b/src/mame/machine/s32comm.cpp index dad9c291527..8d5abf8e299 100644 --- a/src/mame/machine/s32comm.cpp +++ b/src/mame/machine/s32comm.cpp @@ -66,6 +66,8 @@ Sega System Multi32 Comm PCB 837-8792-91 15033.17 OutRunners, Stadium Cross */ +#include "emu.h" +#include "emuopts.h" #include "machine/s32comm.h" //#define __S32COMM_VERBOSE__ diff --git a/src/mame/machine/s32comm.h b/src/mame/machine/s32comm.h index 19b01110361..9c0ef0eae88 100644 --- a/src/mame/machine/s32comm.h +++ b/src/mame/machine/s32comm.h @@ -7,8 +7,6 @@ #define __S32COMM_SIMULATION__ -#include "emu.h" - #define MCFG_S32COMM_ADD(_tag ) \ MCFG_DEVICE_ADD(_tag, S32COMM, 0) |