diff --git a/src/cpu/z80/z80.cpp b/src/cpu/z80/z80.cpp index e11bebec1..38732ea58 100644 --- a/src/cpu/z80/z80.cpp +++ b/src/cpu/z80/z80.cpp @@ -193,6 +193,7 @@ unsigned char Z80Vector = 0xff; int z80_ICount; static Z80_Regs Z80; UINT32 EA; +int z80_hold_hack; static UINT8 SZ[256]; /* zero and sign flags */ static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ @@ -3324,6 +3325,11 @@ static void take_interrupt(void) // else // irq_vector = (*Z80.irq_callback)(0); + if (z80_hold_hack) { + z80_hold_hack = 0; + Z80.irq_state = 0; + } + // LOG(("Z80 #%d single int. irq_vector $%02x\n", cpu_getactivecpu(), irq_vector)); /* Interrupt mode 2. Call [Z80.i:databyte] */ @@ -3473,6 +3479,7 @@ void Z80Init() /* Reset registers to their initial values */ memset(&Z80, 0, sizeof(Z80)); + z80_hold_hack = 0; // Z80.daisy = config; // Z80.irq_callback = irqcallback; IX = IY = 0xffff; /* IX and IY are FFFF after a reset! */ @@ -3485,6 +3492,7 @@ void Z80Reset() //int (*irq_callback)(int irqline); memset(&Z80, 0, sizeof(Z80)); + z80_hold_hack = 0; PC = 0x0000; I = 0; diff --git a/src/cpu/z80/z80.h b/src/cpu/z80/z80.h index 09476bbd8..f2994bf86 100644 --- a/src/cpu/z80/z80.h +++ b/src/cpu/z80/z80.h @@ -71,6 +71,7 @@ extern unsigned char Z80Vector; extern int z80_ICount; extern UINT32 EA; +extern int z80_hold_hack; typedef unsigned char (__fastcall *Z80ReadIoHandler)(unsigned int a); typedef void (__fastcall *Z80WriteIoHandler)(unsigned int a, unsigned char v); diff --git a/src/cpu/z80_intf.cpp b/src/cpu/z80_intf.cpp index 7780de6ab..b6207d0b8 100644 --- a/src/cpu/z80_intf.cpp +++ b/src/cpu/z80_intf.cpp @@ -687,10 +687,11 @@ void ZetSetIRQLine(const INT32 line, const INT32 status) Z80Execute(0); break; case CPU_IRQSTATUS_HOLD: + z80_hold_hack = 1; Z80SetIrqLine(line, 1); - Z80Execute(100); - Z80SetIrqLine(0, 0); - Z80Execute(0); + //Z80Execute(100); + //Z80SetIrqLine(0, 0); + //Z80Execute(0); break; } }