summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runall1
-rw-r--r--rundoc1
-rw-r--r--runprelim1
-rw-r--r--z80.c2
-rw-r--r--z80_decode.c22
5 files changed, 16 insertions, 11 deletions
diff --git a/runall b/runall
index f23b3ed..beb0971 100644
--- a/runall
+++ b/runall
@@ -2,3 +2,4 @@ i emucpm.hex
l zexall.com 0x100
#D zexall.lbl
r 0x100
+q
diff --git a/rundoc b/rundoc
index b8dfd9b..59c657c 100644
--- a/rundoc
+++ b/rundoc
@@ -4,3 +4,4 @@ l zexdoc.com 0x100
r 0x100
#p 0x100
#n
+q
diff --git a/runprelim b/runprelim
index 03c42c3..3dba17e 100644
--- a/runprelim
+++ b/runprelim
@@ -1,3 +1,4 @@
i emucpm.hex
l prelim.com 0x100
r 0x100
+q
diff --git a/z80.c b/z80.c
index 5843b0f..69231e6 100644
--- a/z80.c
+++ b/z80.c
@@ -200,7 +200,7 @@ void Z80Reset(Z80 *cpu)
PRIV->raise=FALSE;
PRIV->nmi=FALSE;
- PRIV->memptr.w = 0xffff;
+ PRIV->memptr.w = 0x0000;
}
diff --git a/z80_decode.c b/z80_decode.c
index bc2a627..23cf44f 100644
--- a/z80_decode.c
+++ b/z80_decode.c
@@ -590,6 +590,10 @@ do { \
b=PEEK(cpu->HL.w); \
\
CMP8(b); \
+ Z80Byte a1=cpu->AF.b.hi-b-(IS_H?1:0); \
+ \
+ if (a1&2) SETFLAG(B5_Z80); else CLRFLAG(B5_Z80); \
+ if (a1&B3_Z80) SETFLAG(B3_Z80); else CLRFLAG(B3_Z80); \
\
if (c) \
SETFLAG(C_Z80); \
@@ -613,7 +617,11 @@ do { \
b=PEEK(cpu->HL.w); \
\
CMP8(b); \
+ Z80Byte a1=cpu->AF.b.hi-b-(IS_H?1:0); \
\
+ if (a1&2) SETFLAG(B5_Z80); else CLRFLAG(B5_Z80); \
+ if (a1&B3_Z80) SETFLAG(B3_Z80); else CLRFLAG(B3_Z80); \
+\
if (c) \
SETFLAG(C_Z80); \
else \
@@ -1596,17 +1604,14 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
case 0xb0: /* LDIR */
TSTATE(16);
- if (cpu->BC.w!=1)
- {
- PRIV->memptr.w=cpu->PC-1;
- }
-
LDI;
if (cpu->BC.w)
{
TSTATE(5);
cpu->PC-=2;
+ SETHIDDEN((cpu->PC)>>8);
+ PRIV->memptr.w=cpu->PC+1;
}
break;
@@ -1650,17 +1655,14 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
case 0xb8: /* LDDR */
TSTATE(16);
- if (cpu->BC.w!=1)
- {
- PRIV->memptr.w=cpu->PC-1;
- }
-
LDD;
if (cpu->BC.w)
{
TSTATE(5);
cpu->PC-=2;
+ SETHIDDEN((cpu->PC)>>8);
+ PRIV->memptr.w=cpu->PC+1;
}
break;