From bff1ab51d938835eae640d93f9e96479c786b483 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 29 Mar 2025 19:25:41 +0100 Subject: [PATCH] m6502: like z80, around 10% performance gain by checking unset devcb on every opcode --- src/devices/cpu/m6502/m6502.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp index 105ae863785..a18e920e6b3 100644 --- a/src/devices/cpu/m6502/m6502.cpp +++ b/src/devices/cpu/m6502/m6502.cpp @@ -480,14 +480,16 @@ void m6502_device::state_string_export(const device_state_entry &entry, std::str void m6502_device::prefetch_start() { sync = true; - sync_w(ASSERT_LINE); + if(!sync_w.isunset()) + sync_w(ASSERT_LINE); NPC = PC; } void m6502_device::prefetch_end() { sync = false; - sync_w(CLEAR_LINE); + if(!sync_w.isunset()) + sync_w(CLEAR_LINE); if((nmi_pending || ((irq_state || apu_irq_state) && !(P & F_I))) && !inhibit_interrupts) { irq_taken = true; @@ -499,7 +501,8 @@ void m6502_device::prefetch_end() void m6502_device::prefetch_end_noirq() { sync = false; - sync_w(CLEAR_LINE); + if(!sync_w.isunset()) + sync_w(CLEAR_LINE); PC++; }