z80: reset m_ref when PC is changed through state_import

This commit is contained in:
hap 2024-07-18 19:09:01 +02:00
parent a21f91f704
commit 05b1ce44fe
2 changed files with 12 additions and 10 deletions

View File

@ -615,13 +615,13 @@ void z80_device::device_start()
m_im = 0;
m_i = 0;
m_nmi_state = 0;
m_nmi_pending = 0;
m_nmi_pending = false;
m_irq_state = 0;
m_wait_state = 0;
m_busrq_state = 0;
m_busack_state = 0;
m_after_ei = 0;
m_after_ldair = 0;
m_after_ei = false;
m_after_ldair = false;
m_ea = 0;
space(AS_PROGRAM).cache(m_args);
@ -789,12 +789,14 @@ void z80_device::state_import(const device_state_entry &entry)
{
switch (entry.index())
{
case STATE_GENPC:
m_prvpc = m_pc;
break;
case STATE_GENPCBASE:
m_pc = m_prvpc;
[[fallthrough]];
case STATE_GENPC:
m_prvpc = m_pc;
m_ref = 0xffff00;
m_after_ei = false;
m_after_ldair = false;
break;
case Z80_R:

View File

@ -160,13 +160,13 @@ protected:
u8 m_im;
u8 m_i;
u8 m_nmi_state; // nmi pin state
u8 m_nmi_pending; // nmi pending
bool m_nmi_pending; // nmi pending
u8 m_irq_state; // irq pin state
int m_wait_state; // wait pin state
int m_busrq_state; // bus request pin state
u8 m_busack_state; // bus acknowledge pin state
u8 m_after_ei; // are we in the EI shadow?
u8 m_after_ldair; // same, but for LD A,I or LD A,R
bool m_after_ei; // are we in the EI shadow?
bool m_after_ldair; // same, but for LD A,I or LD A,R
u32 m_ea;
int m_icount;