From 52d944a701d685ae8a91fe2f38485c4c61827d88 Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 25 Sep 2006 23:47:34 +0000 Subject: A few fixes --- src/z80.c | 3 +++ src/zx81.c | 21 ++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/z80.c b/src/z80.c index be50494..36c5793 100644 --- a/src/z80.c +++ b/src/z80.c @@ -83,6 +83,9 @@ static void Z80_CheckInterrupt(Z80 *cpu) TSTATE(2); + cpu->IFF1=0; + cpu->IFF2=0; + switch(cpu->IM) { default: diff --git a/src/zx81.c b/src/zx81.c index 35a6558..9fcc6e1 100644 --- a/src/zx81.c +++ b/src/zx81.c @@ -174,14 +174,14 @@ static void RomPatch(void) static const Z80Byte save[]= { 0xed, 0xf0, /* ED F0 illegal op */ - 0xc3, 0x08, 0x02, /* JP $0207 */ + 0xc3, 0x07, 0x02, /* JP $0207 */ 0xff /* End of patch */ }; static const Z80Byte load[]= { 0xed, 0xf1, /* ED F0 illegal op */ - 0xc3, 0x08, 0x02, /* JP $0207 */ + 0xc3, 0x07, 0x02, /* JP $0207 */ 0xff /* End of patch */ }; @@ -343,9 +343,9 @@ static void ULA_Video_Shifter(Z80 *z80, Z80Byte val) if (!scr_enable) return; - /* Extra check due to out dodgy ULA emulation + /* Extra check due possibly dodgy ULA emulation */ - if (ULA.y>=0 && ULA.y=0 && ULA.yR&0x40)) { Z80Interrupt(z80,0xff); + ULA.y++; + ULA.c=(ULA.c+1)%8; + ULA.x=0; /* Debug("INTERRUPT\n"); */ } } @@ -464,7 +467,7 @@ void ZX81Init(Z80 *z80) /* Memory size (1 or 16K) */ if (IConfig(CONF_MEMSIZE)==16) - RAMLEN=0x2000; + RAMLEN=0x4000; else RAMLEN=0x400; @@ -606,7 +609,7 @@ Z80Byte ZX81ReadPort(Z80 *z80, Z80Word port) GFXClear(white); ULA.x=0; - ULA.y=0; + ULA.y=-1; ULA.c=7; ULA.release=FALSE; @@ -621,7 +624,7 @@ Z80Byte ZX81ReadPort(Z80 *z80, Z80Word port) ULA.release=FALSE; } - /* If NMI on, turn off the HSYNC generator + /* If NMI off, turn off the HSYNC generator */ if (!nmigen) { -- cgit v1.2.3