summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/devcpu.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-04-04 23:46:44 -0400
committer AJR <ajrhacker@users.noreply.github.com>2016-04-04 23:46:44 -0400
commitee12b7d2f74834cb9ca9dd8d6de7ba9d8c1f30e1 (patch)
tree18feb0ad0b3c6872533c73964440eb7f626a4174 /src/emu/devcpu.cpp
parent1046be89db453886ee98b72c846f6e42e8da3cfa (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.
Diffstat (limited to 'src/emu/devcpu.cpp')
-rw-r--r--src/emu/devcpu.cpp25
1 files changed, 24 insertions, 1 deletions
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;
+}