From f1e86f85c04e68b74cc3a62954232878da816560 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 25 Jul 2023 21:34:53 +0200 Subject: m6502: don't clear input pins external state at device_reset --- src/devices/cpu/m6502/m6502.cpp | 15 ++++++--------- src/devices/cpu/m6502/m6502.h | 2 +- src/devices/cpu/m6502/m740.cpp | 12 ++---------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp index 1405023d73e..9e74e872141 100644 --- a/src/devices/cpu/m6502/m6502.cpp +++ b/src/devices/cpu/m6502/m6502.cpp @@ -29,8 +29,9 @@ m6502_device::m6502_device(const machine_config &mconfig, device_type type, cons cpu_device(mconfig, type, tag, owner, clock), sync_w(*this), program_config("program", ENDIANNESS_LITTLE, 8, 16), - sprogram_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16), PPC(0), NPC(0), PC(0), SP(0), TMP(0), TMP2(0), A(0), X(0), Y(0), P(0), IR(0), inst_state_base(0), mintf(nullptr), - inst_state(0), inst_substate(0), icount(0), nmi_state(false), irq_state(false), apu_irq_state(false), v_state(false), nmi_pending(false), irq_taken(false), sync(false), inhibit_interrupts(false), uses_custom_memory_interface(false) + sprogram_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16), + mintf(nullptr), + uses_custom_memory_interface(false) { } @@ -55,8 +56,6 @@ void m6502_device::init() space(AS_PROGRAM).specific(mintf->program14); } - XPC = 0; - state_add(STATE_GENPC, "GENPC", XPC).callexport().noshow(); state_add(STATE_GENPCBASE, "CURPC", XPC).callexport().noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", P).callimport().formatstr("%6s").noshow(); @@ -92,6 +91,8 @@ void m6502_device::init() set_icountptr(icount); + XPC = 0x0000; + PPC = 0x0000; PC = 0x0000; NPC = 0x0000; A = 0x00; @@ -121,10 +122,6 @@ void m6502_device::device_reset() inst_state = STATE_RESET; inst_substate = 0; inst_state_base = 0; - irq_state = false; - nmi_state = false; - apu_irq_state = false; - v_state = false; nmi_pending = false; irq_taken = false; sync = false; @@ -150,7 +147,7 @@ uint32_t m6502_device::execute_input_lines() const noexcept bool m6502_device::execute_input_edge_triggered(int inputnum) const noexcept { - return inputnum == NMI_LINE; + return inputnum == NMI_LINE || inputnum == V_LINE; } void m6502_device::do_adc_d(uint8_t val) diff --git a/src/devices/cpu/m6502/m6502.h b/src/devices/cpu/m6502/m6502.h index c16555a2493..0e0864f8881 100644 --- a/src/devices/cpu/m6502/m6502.h +++ b/src/devices/cpu/m6502/m6502.h @@ -130,7 +130,7 @@ protected: uint8_t Y; /* Y index register */ uint8_t P; /* Processor status */ uint8_t IR; /* Prefetched instruction register */ - int inst_state_base; /* Current instruction bank */ + int inst_state_base; /* Current instruction bank */ std::unique_ptr mintf; int inst_state, inst_substate; diff --git a/src/devices/cpu/m6502/m740.cpp b/src/devices/cpu/m6502/m740.cpp index 04b672ede56..4e42db0cb67 100644 --- a/src/devices/cpu/m6502/m740.cpp +++ b/src/devices/cpu/m6502/m740.cpp @@ -36,19 +36,11 @@ void m740_device::device_start() void m740_device::device_reset() { - inst_state_base = 0; - inst_state = STATE_RESET; - inst_substate = 0; - nmi_state = false; + m6502_device::device_reset(); + irq_state = false; m_irq_multiplex = 0; m_irq_vector = 0xfffc; - apu_irq_state = false; - irq_taken = false; - nmi_pending = false; - v_state = false; - sync = false; - inhibit_interrupts = false; SP = 0x00ff; } -- cgit v1.2.3