From 740e7df6ab9b2bb45d93d0656e93134ee6b6de4e Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Fri, 24 May 2013 06:20:32 +0000 Subject: [PATCH] m6502: Redo the prefetch and reset the state on debugger PC change [O. Galibert] --- src/emu/cpu/m6502/m6502.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c index 8ffcf19b3a0..a6652aecb4a 100644 --- a/src/emu/cpu/m6502/m6502.c +++ b/src/emu/cpu/m6502/m6502.c @@ -76,7 +76,7 @@ void m6502_device::init() state_add(STATE_GENPCBASE, "GENPCBASE", PPC).noshow(); state_add(STATE_GENSP, "GENSP", SP).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", P).callimport().formatstr("%6s").noshow(); - state_add(M6502_PC, "PC", NPC); + state_add(M6502_PC, "PC", NPC).callimport(); state_add(M6502_A, "A", A); state_add(M6502_X, "X", X); state_add(M6502_Y, "Y", Y); @@ -446,6 +446,13 @@ void m6502_device::state_import(const device_state_entry &entry) case M6502_P: P = P | (F_B|F_E); break; + case M6502_PC: + PC = NPC; + irq_taken = false; + prefetch(); + PPC = NPC; + inst_state = IR | inst_state_base; + break; } }