summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--z80_decode.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/z80_decode.c b/z80_decode.c
index 2385ac8..aecd26a 100644
--- a/z80_decode.c
+++ b/z80_decode.c
@@ -542,7 +542,7 @@ do { \
*/
#define LDI \
do { \
- Z80Byte b; \
+ Z80Byte b,a1; \
\
b=PEEK(cpu->HL.w); \
POKE(cpu->DE.w,b); \
@@ -558,12 +558,14 @@ do { \
else \
CLRFLAG(P_Z80); \
\
- SETHIDDEN(cpu->AF.b.hi+b); \
+ a1=cpu->AF.b.hi+b; \
+ if (a1&2) SETFLAG(B5_Z80); else CLRFLAG(B5_Z80); \
+ if (a1&B3_Z80) SETFLAG(B3_Z80); else CLRFLAG(B3_Z80); \
} while(0)
#define LDD \
do { \
- Z80Byte b; \
+ Z80Byte b,a1; \
\
b=PEEK(cpu->HL.w); \
POKE(cpu->DE.w,b); \
@@ -579,7 +581,9 @@ do { \
else \
CLRFLAG(P_Z80); \
\
- SETHIDDEN(cpu->AF.b.hi+b); \
+ a1=cpu->AF.b.hi+b; \
+ if (a1&2) SETFLAG(B5_Z80); else CLRFLAG(B5_Z80); \
+ if (a1&B3_Z80) SETFLAG(B3_Z80); else CLRFLAG(B3_Z80); \
} while(0)
#define CPI \