summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2025-04-11 15:21:07 +0200
committer hap <happppp@users.noreply.github.com>2025-04-11 15:21:15 +0200
commit74877969c18275966e6f72ee5690f1768b03c958 (patch)
treebcdfadb5fa1d2b373d4a269fd16e0d6ec20cdd8e
parent14644cb8459e8e695334d17b2cfcfcda63342bac (diff)
misc cpu: no need to check debug enabled flag manually
-rw-r--r--src/devices/cpu/adsp2100/adsp2100.cpp2
-rw-r--r--src/devices/cpu/am29000/am29000.cpp2
-rw-r--r--src/devices/cpu/arm7/arm7.cpp2
-rw-r--r--src/devices/cpu/arm7/arm7drc.hxx4
-rw-r--r--src/devices/cpu/asap/asap.cpp2
-rw-r--r--src/devices/cpu/cosmac/cosmac.cpp2
-rw-r--r--src/devices/cpu/dsp16/dsp16.cpp4
-rw-r--r--src/devices/cpu/dsp56156/dsp56ops.hxx3
-rw-r--r--src/devices/cpu/dspp/dspp.cpp2
-rw-r--r--src/devices/cpu/dspp/dsppdrc.cpp2
-rw-r--r--src/devices/cpu/e132xs/e132xsdrc.cpp2
-rw-r--r--src/devices/cpu/e132xs/e132xsdrc_ops.hxx4
-rw-r--r--src/devices/cpu/esrip/esrip.cpp2
-rw-r--r--src/devices/cpu/h8/h8.cpp2
-rw-r--r--src/devices/cpu/i8008/i8008.cpp2
-rw-r--r--src/devices/cpu/ie15/ie15.cpp4
-rw-r--r--src/devices/cpu/m6502/m6502.cpp2
-rw-r--r--src/devices/cpu/m6502/m6502mcu.ipp2
-rw-r--r--src/devices/cpu/m68000/m68000.cpp2
-rw-r--r--src/devices/cpu/m68000/m68000mcu.cpp2
-rw-r--r--src/devices/cpu/m88000/m88000.cpp2
-rw-r--r--src/devices/cpu/mb86235/mb86235drc.cpp2
-rw-r--r--src/devices/cpu/mcs40/mcs40.cpp2
-rw-r--r--src/devices/cpu/mcs96/mcs96ops.lst4
-rw-r--r--src/devices/cpu/mips/mips3drc.cpp4
-rw-r--r--src/devices/cpu/mips/r4000.cpp2
-rw-r--r--src/devices/cpu/palm/palm.cpp2
-rw-r--r--src/devices/cpu/powerpc/ppcdrc.cpp4
-rw-r--r--src/devices/cpu/rsp/rsp.cpp2
-rw-r--r--src/devices/cpu/sh/sh.cpp2
-rw-r--r--src/devices/cpu/sh/sh2.cpp2
-rw-r--r--src/devices/cpu/sh/sh4.cpp10
-rw-r--r--src/devices/cpu/sh/sh4comn.cpp2
-rw-r--r--src/devices/cpu/sharc/sharcdrc.cpp2
-rw-r--r--src/devices/cpu/sparc/sparc.cpp2
-rw-r--r--src/devices/cpu/tms32031/32031ops.hxx4
-rw-r--r--src/devices/cpu/tms32031/tms32031.cpp2
-rw-r--r--src/devices/cpu/tms34010/tms34010.cpp2
-rw-r--r--src/devices/cpu/unsp/unspdrc.cpp2
-rw-r--r--src/devices/cpu/upd7725/upd7725.cpp2
-rw-r--r--src/devices/cpu/xavix2/xavix2.cpp2
41 files changed, 53 insertions, 54 deletions
diff --git a/src/devices/cpu/adsp2100/adsp2100.cpp b/src/devices/cpu/adsp2100/adsp2100.cpp
index 179fd234948..817cd2c6bea 100644
--- a/src/devices/cpu/adsp2100/adsp2100.cpp
+++ b/src/devices/cpu/adsp2100/adsp2100.cpp
@@ -1181,7 +1181,7 @@ void adsp21xx_device::execute_run()
return;
}
- bool check_debugger = ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ const bool check_debugger = debugger_enabled();
check_irqs();
diff --git a/src/devices/cpu/am29000/am29000.cpp b/src/devices/cpu/am29000/am29000.cpp
index b66c5163e1e..d4039c18916 100644
--- a/src/devices/cpu/am29000/am29000.cpp
+++ b/src/devices/cpu/am29000/am29000.cpp
@@ -628,7 +628,7 @@ void am29000_cpu_device::fetch_decode()
void am29000_cpu_device::execute_run()
{
- uint32_t call_debugger = (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
+ const bool call_debugger = debugger_enabled();
external_irq_check();
diff --git a/src/devices/cpu/arm7/arm7.cpp b/src/devices/cpu/arm7/arm7.cpp
index e3d33465412..46ffa46e41a 100644
--- a/src/devices/cpu/arm7/arm7.cpp
+++ b/src/devices/cpu/arm7/arm7.cpp
@@ -1068,7 +1068,7 @@ void arm7_cpu_device::device_start()
state_add(STATE_GENFLAGS, "GENFLAGS", m_r[eCPSR]).formatstr("%13s").noshow();
- if (machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (debugger_enabled())
{
using namespace std::placeholders;
machine().debugger().console().register_command("translate_insn", CMDFLAG_NONE, 1, 1, std::bind(&arm7_cpu_device::translate_insn_command, this, _1));
diff --git a/src/devices/cpu/arm7/arm7drc.hxx b/src/devices/cpu/arm7/arm7drc.hxx
index 02d596b6e5a..9afdf5e7c88 100644
--- a/src/devices/cpu/arm7/arm7drc.hxx
+++ b/src/devices/cpu/arm7/arm7drc.hxx
@@ -1027,7 +1027,7 @@ void arm7_cpu_device::static_generate_memory_accessor(int size, bool istlb, bool
}
/* general case: assume paging and perform a translation */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
{
for (int ramnum = 0; ramnum < ARM7_MAX_FASTRAM; ramnum++)
{
@@ -1266,7 +1266,7 @@ void arm7_cpu_device::generate_sequence_instruction(drcuml_block &block, compile
UML_MAPVAR(block, MAPVAR_CYCLES, compiler.cycles); // mapvar CYCLES,compiler.cycles
/* if we are debugging, call the debugger */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
UML_MOV(block, uml::mem(&R15), desc->pc); // mov [pc],desc->pc
save_fast_iregs(block);
diff --git a/src/devices/cpu/asap/asap.cpp b/src/devices/cpu/asap/asap.cpp
index 5ef08e161ad..703250e7b8f 100644
--- a/src/devices/cpu/asap/asap.cpp
+++ b/src/devices/cpu/asap/asap.cpp
@@ -528,7 +528,7 @@ void asap_device::execute_run()
check_irqs();
// core execution loop
- if ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
{
do
{
diff --git a/src/devices/cpu/cosmac/cosmac.cpp b/src/devices/cpu/cosmac/cosmac.cpp
index 87b1bf3ed10..eb1b73397ac 100644
--- a/src/devices/cpu/cosmac/cosmac.cpp
+++ b/src/devices/cpu/cosmac/cosmac.cpp
@@ -911,7 +911,7 @@ inline void cosmac_device::run_state()
inline void cosmac_device::debug()
{
- if ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) && m_state == cosmac_state::STATE_0_FETCH)
+ if (debugger_enabled() && m_state == cosmac_state::STATE_0_FETCH)
{
debugger_instruction_hook(R[P]);
}
diff --git a/src/devices/cpu/dsp16/dsp16.cpp b/src/devices/cpu/dsp16/dsp16.cpp
index dadd93d07cb..288c52d1fe8 100644
--- a/src/devices/cpu/dsp16/dsp16.cpp
+++ b/src/devices/cpu/dsp16/dsp16.cpp
@@ -638,7 +638,7 @@ void dsp16_device_base::program_map(address_map &map)
template <bool Debugger, bool Caching> inline void dsp16_device_base::execute_some_rom()
{
- assert(bool(machine().debug_flags & DEBUG_FLAG_ENABLED) == Debugger);
+ assert(debugger_enabled() == Debugger);
for (bool mode_change = false; !mode_change && m_core->icount_remaining(); m_core->decrement_icount())
{
assert((cache::LOAD == m_cache_mode) == Caching);
@@ -1127,7 +1127,7 @@ template <bool Debugger, bool Caching> inline void dsp16_device_base::execute_so
template <bool Debugger> inline void dsp16_device_base::execute_some_cache()
{
- assert(bool(machine().debug_flags & DEBUG_FLAG_ENABLED) == Debugger);
+ assert(debugger_enabled() == Debugger);
for (bool mode_change = false; !mode_change && m_core->icount_remaining(); m_core->decrement_icount())
{
u16 const op(m_cache[m_cache_ptr]);
diff --git a/src/devices/cpu/dsp56156/dsp56ops.hxx b/src/devices/cpu/dsp56156/dsp56ops.hxx
index 1072a163c7a..b58fbeb105c 100644
--- a/src/devices/cpu/dsp56156/dsp56ops.hxx
+++ b/src/devices/cpu/dsp56156/dsp56ops.hxx
@@ -1004,8 +1004,7 @@ static void execute_one(dsp56156_core* cpustate)
/* For MAME */
cpustate->ppc = PC;
- if (cpustate->device->machine().debug_flags & DEBUG_FLAG_CALL_HOOK) // FIXME: if this was a member, the helper would work
- cpustate->device->debug()->instruction_hook(PC);
+ cpustate->device->debug()->instruction_hook(PC);
cpustate->op = ROPCODE(PC);
/* The words we're going to be working with */
diff --git a/src/devices/cpu/dspp/dspp.cpp b/src/devices/cpu/dspp/dspp.cpp
index 9679de25b96..0a82905bec1 100644
--- a/src/devices/cpu/dspp/dspp.cpp
+++ b/src/devices/cpu/dspp/dspp.cpp
@@ -679,7 +679,7 @@ void dspp_device::execute_run()
return;
}
- bool check_debugger = ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ const bool check_debugger = debugger_enabled();
do
{
diff --git a/src/devices/cpu/dspp/dsppdrc.cpp b/src/devices/cpu/dspp/dsppdrc.cpp
index 8134417748d..a010133cce9 100644
--- a/src/devices/cpu/dspp/dsppdrc.cpp
+++ b/src/devices/cpu/dspp/dsppdrc.cpp
@@ -409,7 +409,7 @@ void dspp_device::generate_sequence_instruction(drcuml_block &block, compiler_st
UML_MAPVAR(block, MAPVAR_CYCLES, compiler->cycles); // mapvar CYCLES,compiler->cycles
/* if we are debugging, call the debugger */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
UML_MOV(block, mem(&m_core->m_pc), desc->pc); // mov [pc],desc->pc
//save_fast_iregs(block); // <save fastregs>
diff --git a/src/devices/cpu/e132xs/e132xsdrc.cpp b/src/devices/cpu/e132xs/e132xsdrc.cpp
index 0f70aed2658..4af9fd00fb1 100644
--- a/src/devices/cpu/e132xs/e132xsdrc.cpp
+++ b/src/devices/cpu/e132xs/e132xsdrc.cpp
@@ -849,7 +849,7 @@ void hyperstone_device::generate_sequence_instruction(drcuml_block &block, compi
#endif
// if we are debugging, call the debugger
- if (machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (debugger_enabled())
{
//save_fast_iregs(block);
UML_DEBUG(block, desc->pc);
diff --git a/src/devices/cpu/e132xs/e132xsdrc_ops.hxx b/src/devices/cpu/e132xs/e132xsdrc_ops.hxx
index 072c695f3be..4b9745e6973 100644
--- a/src/devices/cpu/e132xs/e132xsdrc_ops.hxx
+++ b/src/devices/cpu/e132xs/e132xsdrc_ops.hxx
@@ -635,7 +635,7 @@ void hyperstone_device::generate_trap_exception_or_int(drcuml_block &block, uml:
const uint32_t clear_flags = T_MASK | M_MASK;
const uint32_t update_sr = FP_MASK | FL_MASK | set_flags | clear_flags;
- if ((TYPE != IS_INT) && (machine().debug_flags & DEBUG_FLAG_ENABLED))
+ if ((TYPE != IS_INT) && debugger_enabled())
{
if (!trapno.is_int_register())
{
@@ -3918,7 +3918,7 @@ void hyperstone_device::generate_dbr(drcuml_block &block, compiler_state &compil
#endif
// if we are debugging, call the debugger
- if (machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (debugger_enabled())
{
//save_fast_iregs(block);
UML_DEBUG(block, delayslot->pc);
diff --git a/src/devices/cpu/esrip/esrip.cpp b/src/devices/cpu/esrip/esrip.cpp
index b78928cb3c4..7a50020d05d 100644
--- a/src/devices/cpu/esrip/esrip.cpp
+++ b/src/devices/cpu/esrip/esrip.cpp
@@ -1750,7 +1750,7 @@ void esrip_device::execute_set_input(int inputnum, int state)
void esrip_device::execute_run()
{
- int calldebugger = (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
+ const bool calldebugger = debugger_enabled();
uint8_t status;
/* I think we can get away with placing this outside of the loop */
diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp
index 0b5c9cb0a10..6e0991a991d 100644
--- a/src/devices/cpu/h8/h8.cpp
+++ b/src/devices/cpu/h8/h8.cpp
@@ -357,7 +357,7 @@ void h8_device::execute_run()
while(m_icount > m_bcount) {
if(m_inst_state < 0x10000) {
m_PPC = m_NPC;
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if(debugger_enabled())
debugger_instruction_hook(m_NPC);
}
do_exec_full();
diff --git a/src/devices/cpu/i8008/i8008.cpp b/src/devices/cpu/i8008/i8008.cpp
index 2c997f30c4f..9e6e92d6863 100644
--- a/src/devices/cpu/i8008/i8008.cpp
+++ b/src/devices/cpu/i8008/i8008.cpp
@@ -261,7 +261,7 @@ void i8008_device::execute_run()
inline void i8008_device::illegal(uint8_t opcode)
{
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
logerror("I8008 illegal instruction %04X $%02X\n", m_PC.w.l, opcode);
}
diff --git a/src/devices/cpu/ie15/ie15.cpp b/src/devices/cpu/ie15/ie15.cpp
index d3db6f0ef1b..d3f512c9711 100644
--- a/src/devices/cpu/ie15/ie15.cpp
+++ b/src/devices/cpu/ie15/ie15.cpp
@@ -186,7 +186,7 @@ uint32_t ie15_cpu_device::execute_max_cycles() const noexcept
void ie15_cpu_device::execute_run()
{
// Removing the hook entirely is considerably faster than calling it for every instruction if the debugger is disabled entirely
- if (machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (debugger_enabled())
{
do
{
@@ -205,7 +205,7 @@ void ie15_cpu_device::execute_run()
inline void ie15_cpu_device::illegal(uint8_t opcode)
{
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
logerror("IE15 illegal instruction %04X $%02X\n", m_PC.w.l, opcode);
}
diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp
index a18e920e6b3..e72fd74459a 100644
--- a/src/devices/cpu/m6502/m6502.cpp
+++ b/src/devices/cpu/m6502/m6502.cpp
@@ -394,7 +394,7 @@ void m6502_device::execute_run()
if(inst_state < 0xff00) {
PPC = NPC;
inst_state = IR | inst_state_base;
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if(debugger_enabled())
debugger_instruction_hook(pc_to_external(NPC));
}
do_exec_full();
diff --git a/src/devices/cpu/m6502/m6502mcu.ipp b/src/devices/cpu/m6502/m6502mcu.ipp
index 36039f0b693..d4fd6833f54 100644
--- a/src/devices/cpu/m6502/m6502mcu.ipp
+++ b/src/devices/cpu/m6502/m6502mcu.ipp
@@ -55,7 +55,7 @@ void m6502_mcu_device_base<Base>::execute_run()
if(this->inst_state < 0xff00) {
this->PPC = this->NPC;
this->inst_state = this->IR | this->inst_state_base;
- if(this->machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if(this->debugger_enabled())
this->debugger_instruction_hook(this->NPC);
}
this->do_exec_full();
diff --git a/src/devices/cpu/m68000/m68000.cpp b/src/devices/cpu/m68000/m68000.cpp
index fea5849f6b1..4864c9980ea 100644
--- a/src/devices/cpu/m68000/m68000.cpp
+++ b/src/devices/cpu/m68000/m68000.cpp
@@ -124,7 +124,7 @@ void m68000_device::execute_run()
m_ipc = m_pc - 2;
m_irdi = m_ird;
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if(debugger_enabled())
debugger_instruction_hook(m_ipc);
}
(this->*(m_handlers_f[m_inst_state]))();
diff --git a/src/devices/cpu/m68000/m68000mcu.cpp b/src/devices/cpu/m68000/m68000mcu.cpp
index c793b36f862..39c084e4914 100644
--- a/src/devices/cpu/m68000/m68000mcu.cpp
+++ b/src/devices/cpu/m68000/m68000mcu.cpp
@@ -34,7 +34,7 @@ void m68000_mcu_device::execute_run()
m_ipc = m_pc - 2;
m_irdi = m_ird;
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if(debugger_enabled())
debugger_instruction_hook(m_ipc);
}
(this->*(m_handlers_f[m_inst_state]))();
diff --git a/src/devices/cpu/m88000/m88000.cpp b/src/devices/cpu/m88000/m88000.cpp
index 73351cfdf2f..efa63be77fd 100644
--- a/src/devices/cpu/m88000/m88000.cpp
+++ b/src/devices/cpu/m88000/m88000.cpp
@@ -1394,7 +1394,7 @@ void mc88100_device::exception(unsigned vector, bool const trap)
m_fip = m_cr[VBR] | (vector << 3) | IP_V;
// notify debugger
- if (machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (debugger_enabled())
{
if (vector == E_INTERRUPT)
debug()->interrupt_hook(INPUT_LINE_IRQ0, m_xip & IP_A);
diff --git a/src/devices/cpu/mb86235/mb86235drc.cpp b/src/devices/cpu/mb86235/mb86235drc.cpp
index 468ac24ad8f..e45b07ba0a8 100644
--- a/src/devices/cpu/mb86235/mb86235drc.cpp
+++ b/src/devices/cpu/mb86235/mb86235drc.cpp
@@ -528,7 +528,7 @@ void mb86235_device::generate_sequence_instruction(drcuml_block &block, compiler
UML_MAPVAR(block, MAPVAR_CYCLES, compiler.cycles); // mapvar CYCLES,compiler.cycles
/* if we are debugging, call the debugger */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
UML_MOV(block, mem(&m_core->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(block); // <save fastregs>
diff --git a/src/devices/cpu/mcs40/mcs40.cpp b/src/devices/cpu/mcs40/mcs40.cpp
index 52005f3f0d5..bf9b6a310d6 100644
--- a/src/devices/cpu/mcs40/mcs40.cpp
+++ b/src/devices/cpu/mcs40/mcs40.cpp
@@ -580,7 +580,7 @@ inline void mcs40_cpu_device_base::do_a1()
if (cycle::OP == m_cycle)
{
m_pcbase = rom_bank() | m_rom_addr;
- if (machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (debugger_enabled())
debugger_instruction_hook(pc());
if (m_stop_latch)
{
diff --git a/src/devices/cpu/mcs96/mcs96ops.lst b/src/devices/cpu/mcs96/mcs96ops.lst
index b6242a35a70..72db19afc0f 100644
--- a/src/devices/cpu/mcs96/mcs96ops.lst
+++ b/src/devices/cpu/mcs96/mcs96ops.lst
@@ -16,7 +16,7 @@ fetch
check_irq();
}
PPC = PC;
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if(debugger_enabled())
debugger_instruction_hook(PC);
OP1 = read_pc();
if(OP1 == 0xfe) {
@@ -27,7 +27,7 @@ fetch
fetch_noirq
PPC = PC;
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if(debugger_enabled())
debugger_instruction_hook(PC);
OP1 = read_pc();
if(OP1 == 0xfe) {
diff --git a/src/devices/cpu/mips/mips3drc.cpp b/src/devices/cpu/mips/mips3drc.cpp
index 6800f6fa11b..f682da6b212 100644
--- a/src/devices/cpu/mips/mips3drc.cpp
+++ b/src/devices/cpu/mips/mips3drc.cpp
@@ -848,7 +848,7 @@ void mips3_device::static_generate_memory_mode_checks(drcuml_block &block, uml::
void mips3_device::static_generate_fastram_accessor(drcuml_block &block, int &label, int size, bool iswrite, bool ismasked)
{
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
{
for (int ramnum = 0; ramnum < m_fastram_select; ramnum++)
{
@@ -1364,7 +1364,7 @@ void mips3_device::generate_sequence_instruction(drcuml_block &block, compiler_s
}
/* if we are debugging, call the debugger */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
UML_MOV(block, mem(&m_core->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(block);
diff --git a/src/devices/cpu/mips/r4000.cpp b/src/devices/cpu/mips/r4000.cpp
index f606bd49c10..47e2cd784a7 100644
--- a/src/devices/cpu/mips/r4000.cpp
+++ b/src/devices/cpu/mips/r4000.cpp
@@ -1110,7 +1110,7 @@ void r4000_base_device::cpu_exception(u32 exception, u16 const vector)
if (exception == EXCEPTION_INT)
{
- if (machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (debugger_enabled())
{
// notify the debugger of the first pending hardware interrupt
u32 const iphw = CAUSE & SR & CAUSE_IPHW;
diff --git a/src/devices/cpu/palm/palm.cpp b/src/devices/cpu/palm/palm.cpp
index 30ffa404afa..071c0d9a6fc 100644
--- a/src/devices/cpu/palm/palm.cpp
+++ b/src/devices/cpu/palm/palm.cpp
@@ -115,7 +115,7 @@ void palm_device::execute_run()
m_program_level(m_il > 0);
// notify the debugger
- if (m_il && (machine().debug_flags & DEBUG_FLAG_ENABLED))
+ if (m_il && debugger_enabled())
debug()->interrupt_hook(m_il - 1, m_r[m_il][0] & ~1);
}
diff --git a/src/devices/cpu/powerpc/ppcdrc.cpp b/src/devices/cpu/powerpc/ppcdrc.cpp
index f61cee42424..b9c7484f1f9 100644
--- a/src/devices/cpu/powerpc/ppcdrc.cpp
+++ b/src/devices/cpu/powerpc/ppcdrc.cpp
@@ -1063,7 +1063,7 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite
UML_AND(block, I0, I0, 0x7fffffff); // and i0,i0,0x7fffffff
UML_XOR(block, I0, I0, (mode & MODE_LITTLE_ENDIAN) ? (8 - size) : 0); // xor i0,i0,8-size
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
for (ramnum = 0; ramnum < PPC_MAX_FASTRAM; ramnum++)
if (m_fastram[ramnum].base != nullptr && (!iswrite || !m_fastram[ramnum].readonly))
{
@@ -1711,7 +1711,7 @@ void ppc_device::generate_sequence_instruction(drcuml_block &block, compiler_sta
}
/* if we are debugging, call the debugger */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
UML_MOV(block, mem(&m_core->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(block); // <save fastregs>
diff --git a/src/devices/cpu/rsp/rsp.cpp b/src/devices/cpu/rsp/rsp.cpp
index 6b3b339ced0..f39d79b21bb 100644
--- a/src/devices/cpu/rsp/rsp.cpp
+++ b/src/devices/cpu/rsp/rsp.cpp
@@ -209,7 +209,7 @@ void rsp_device::set_cop0_reg(int reg, uint32_t data)
void rsp_device::unimplemented_opcode(uint32_t op)
{
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
std::ostringstream string;
rsp_disassembler rspd;
diff --git a/src/devices/cpu/sh/sh.cpp b/src/devices/cpu/sh/sh.cpp
index f6478f289e4..08054e047fe 100644
--- a/src/devices/cpu/sh/sh.cpp
+++ b/src/devices/cpu/sh/sh.cpp
@@ -2502,7 +2502,7 @@ void sh_common_execution::generate_sequence_instruction(drcuml_block &block, com
}
/* if we are debugging, call the debugger */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
UML_MOV(block, mem(&m_sh2_state->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(block);
diff --git a/src/devices/cpu/sh/sh2.cpp b/src/devices/cpu/sh/sh2.cpp
index 72c6ebcbfad..ae8acd76ee4 100644
--- a/src/devices/cpu/sh/sh2.cpp
+++ b/src/devices/cpu/sh/sh2.cpp
@@ -691,7 +691,7 @@ void sh2_device::static_generate_memory_accessor(int size, int iswrite, const ch
UML_LABEL(block, label++); // label:
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
{
for (auto & elem : m_fastram)
{
diff --git a/src/devices/cpu/sh/sh4.cpp b/src/devices/cpu/sh/sh4.cpp
index 926e4843787..0e83680dc64 100644
--- a/src/devices/cpu/sh/sh4.cpp
+++ b/src/devices/cpu/sh/sh4.cpp
@@ -452,7 +452,7 @@ inline void sh34_base_device::LDCSR(const uint16_t opcode)
// important to store the value now so that it doesn't get affected by the bank change
uint32_t reg = m_sh2_state->r[REG_N];
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
sh4_syncronize_register_bank((m_sh2_state->sr & sRB) >> 29);
if ((m_sh2_state->r[REG_N] & sRB) != (m_sh2_state->sr & sRB))
@@ -468,7 +468,7 @@ inline void sh34_base_device::LDCMSR(const uint16_t opcode)
uint32_t old = m_sh2_state->sr;
m_sh2_state->ea = m_sh2_state->r[REG_N];
m_sh2_state->sr = read_long(m_sh2_state->ea) & SH34_FLAGS;
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
sh4_syncronize_register_bank((old & sRB) >> 29);
if ((old & sRB) != (m_sh2_state->sr & sRB))
sh4_change_register_bank(m_sh2_state->sr & sRB ? 1 : 0);
@@ -482,7 +482,7 @@ inline void sh34_base_device::RTE()
{
m_sh2_state->m_delay = m_sh2_state->ea = m_sh2_state->m_spc;
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
sh4_syncronize_register_bank((m_sh2_state->sr & sRB) >> 29);
if ((m_sh2_state->m_ssr & sRB) != (m_sh2_state->sr & sRB))
sh4_change_register_bank(m_sh2_state->m_ssr & sRB ? 1 : 0);
@@ -512,7 +512,7 @@ inline void sh34_base_device::TRAPA(uint32_t i)
m_sh2_state->m_sgr = m_sh2_state->r[15];
m_sh2_state->sr |= MD;
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
sh4_syncronize_register_bank((m_sh2_state->sr & sRB) >> 29);
if (!(m_sh2_state->sr & sRB))
sh4_change_register_bank(1);
@@ -2814,7 +2814,7 @@ void sh34_base_device::static_generate_memory_accessor(int size, int iswrite, co
UML_LABEL(block, label++); // label:
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
{
for (auto & elem : m_fastram)
{
diff --git a/src/devices/cpu/sh/sh4comn.cpp b/src/devices/cpu/sh/sh4comn.cpp
index b8c59aa7ee5..aa424099012 100644
--- a/src/devices/cpu/sh/sh4comn.cpp
+++ b/src/devices/cpu/sh/sh4comn.cpp
@@ -363,7 +363,7 @@ void sh34_base_device::sh4_exception_process(int exception, uint32_t vector)
//printf("stored m_spc %08x m_ssr %08x m_sgr %08x\n", m_spc, m_ssr, m_sgr);
m_sh2_state->sr |= MD;
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
sh4_syncronize_register_bank((m_sh2_state->sr & sRB) >> 29);
if (!(m_sh2_state->sr & sRB))
sh4_change_register_bank(1);
diff --git a/src/devices/cpu/sharc/sharcdrc.cpp b/src/devices/cpu/sharc/sharcdrc.cpp
index a2671db7a76..39d56646e22 100644
--- a/src/devices/cpu/sharc/sharcdrc.cpp
+++ b/src/devices/cpu/sharc/sharcdrc.cpp
@@ -1030,7 +1030,7 @@ void adsp21062_device::generate_sequence_instruction(drcuml_block &block, compil
UML_MAPVAR(block, MAPVAR_CYCLES, compiler.cycles); // mapvar CYCLES,compiler.cycles
/* if we are debugging, call the debugger */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
UML_MOV(block, mem(&m_core->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(block); // <save fastregs>
diff --git a/src/devices/cpu/sparc/sparc.cpp b/src/devices/cpu/sparc/sparc.cpp
index fc24573d88b..9bdd1bfbad5 100644
--- a/src/devices/cpu/sparc/sparc.cpp
+++ b/src/devices/cpu/sparc/sparc.cpp
@@ -4510,7 +4510,7 @@ void sparc_base_device::run_loop()
void sparc_base_device::execute_run()
{
- bool debug = machine().debug_flags & DEBUG_FLAG_ENABLED;
+ const bool debug = debugger_enabled();
if (m_bp_reset_in)
{
diff --git a/src/devices/cpu/tms32031/32031ops.hxx b/src/devices/cpu/tms32031/32031ops.hxx
index b9ae91e762c..f419c85c943 100644
--- a/src/devices/cpu/tms32031/32031ops.hxx
+++ b/src/devices/cpu/tms32031/32031ops.hxx
@@ -71,7 +71,7 @@
void tms3203x_device::illegal(uint32_t op)
{
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
logerror("Illegal op @ %06X: %08X (tbl=%03X)\n", m_pc - 1, op, op >> 21);
machine().debug_break();
@@ -5492,7 +5492,7 @@ inline void tms3203x_device::execute_delayed(uint32_t newpc)
{
m_delayed = true;
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
{
execute_one();
execute_one();
diff --git a/src/devices/cpu/tms32031/tms32031.cpp b/src/devices/cpu/tms32031/tms32031.cpp
index 72eddd31de3..afa635c1b61 100644
--- a/src/devices/cpu/tms32031/tms32031.cpp
+++ b/src/devices/cpu/tms32031/tms32031.cpp
@@ -961,7 +961,7 @@ void tms3203x_device::execute_run()
}
// non-debug case
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
{
while (m_icount > 0)
{
diff --git a/src/devices/cpu/tms34010/tms34010.cpp b/src/devices/cpu/tms34010/tms34010.cpp
index 105cc0af14e..cc2d2481a0c 100644
--- a/src/devices/cpu/tms34010/tms34010.cpp
+++ b/src/devices/cpu/tms34010/tms34010.cpp
@@ -877,7 +877,7 @@ void tms340x0_device::execute_run()
/* check interrupts first */
m_executing = true;
check_interrupt();
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if (!debugger_enabled())
{
do
{
diff --git a/src/devices/cpu/unsp/unspdrc.cpp b/src/devices/cpu/unsp/unspdrc.cpp
index 8034e79f4a3..a8162b82b22 100644
--- a/src/devices/cpu/unsp/unspdrc.cpp
+++ b/src/devices/cpu/unsp/unspdrc.cpp
@@ -610,7 +610,7 @@ void unsp_device::generate_sequence_instruction(drcuml_block &block, compiler_st
UML_MAPVAR(block, MAPVAR_PC, desc->pc);
/* if we are debugging, call the debugger */
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (debugger_enabled())
{
//save_fast_iregs(block);
UML_DEBUG(block, desc->pc);
diff --git a/src/devices/cpu/upd7725/upd7725.cpp b/src/devices/cpu/upd7725/upd7725.cpp
index 9744286beb8..5f20a7b8c3a 100644
--- a/src/devices/cpu/upd7725/upd7725.cpp
+++ b/src/devices/cpu/upd7725/upd7725.cpp
@@ -305,7 +305,7 @@ void necdsp_device::execute_run()
do
{
// call debugger hook if necessary
- if (device_t::machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (debugger_enabled())
{
debugger_instruction_hook(regs.pc);
}
diff --git a/src/devices/cpu/xavix2/xavix2.cpp b/src/devices/cpu/xavix2/xavix2.cpp
index 558e7404ffa..748f1b848c9 100644
--- a/src/devices/cpu/xavix2/xavix2.cpp
+++ b/src/devices/cpu/xavix2/xavix2.cpp
@@ -191,7 +191,7 @@ void xavix2_device::execute_run()
if(!m_ei_count)
m_pc = check_interrupt(m_pc);
}
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if(debugger_enabled())
debugger_instruction_hook(m_pc);
u32 opcode = m_program_cache.read_byte(m_pc) << 24;