From d42634ec2748926eed6ce277f0c5046e73f682cf Mon Sep 17 00:00:00 2001 From: Ian C Date: Wed, 11 Jan 2023 21:43:58 +0000 Subject: Fixed emulation of IM 2 --- z80.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/z80.c b/z80.c index 69231e6..506f998 100644 --- a/z80.c +++ b/z80.c @@ -48,6 +48,8 @@ static void InitTables() static void Z80_CheckInterrupt(Z80 *cpu) { + Z80Word vector; + /* Check interrupts */ if (PRIV->raise) @@ -99,7 +101,8 @@ static void Z80_CheckInterrupt(Z80 *cpu) case 2: PUSH(cpu->PC); - cpu->PC=(Z80Word)cpu->I*256+PRIV->devbyte; + vector=(Z80Word)cpu->I*256+PRIV->devbyte; + cpu->PC=PEEKW(vector); PRIV->memptr.w=cpu->PC; break; } -- cgit v1.2.3