better CPU_IRQSTATUS_HOLD for z80

This commit is contained in:
dinkc64 2015-12-31 20:10:08 +00:00
parent e4afffbba4
commit 5b58bf5529
3 changed files with 13 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;
}
}