summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--z80_decode.c16
-rw-r--r--z80_private.h1
2 files changed, 9 insertions, 8 deletions
diff --git a/z80_decode.c b/z80_decode.c
index 0a9ba00..f675fc5 100644
--- a/z80_decode.c
+++ b/z80_decode.c
@@ -443,14 +443,14 @@ do { \
cpu->AF.b.lo&=C_Z80; \
if ((REG)&(1<<B)) \
{ \
- if (B==7) cpu->AF.b.lo|=S_Z80; \
- cpu->AF.b.lo|=(REG & (B3_Z80|B5_Z80)); \
+ cpu->AF.b.lo|=S_Z80&REG; \
} \
else \
{ \
- cpu->AF.b.lo|=Z_Z80; \
- cpu->AF.b.lo|=P_Z80; \
+ cpu->AF.b.lo|=Z_Z80|P_Z80; \
} \
+ cpu->AF.b.lo|=H_Z80; \
+ SETHIDDEN(REG); \
} while(0)
#define BIT_MEMPTR(REG,B) \
@@ -458,14 +458,14 @@ do { \
cpu->AF.b.lo&=C_Z80; \
if ((REG)&(1<<B)) \
{ \
- if (B==7) cpu->AF.b.lo|=S_Z80; \
- cpu->AF.b.lo|=(PRIV->memptr.b.hi & (B3_Z80|B5_Z80)); \
+ cpu->AF.b.lo|=S_Z80&REG; \
} \
else \
{ \
- cpu->AF.b.lo|=Z_Z80; \
- cpu->AF.b.lo|=P_Z80; \
+ cpu->AF.b.lo|=Z_Z80|P_Z80; \
} \
+ cpu->AF.b.lo|=H_Z80; \
+ SETHIDDEN(PRIV->memptr.b.hi); \
} while(0)
#define BIT_SET(REG,B) (REG)|=(1<<B)
diff --git a/z80_private.h b/z80_private.h
index b052c04..2583766 100644
--- a/z80_private.h
+++ b/z80_private.h
@@ -118,6 +118,7 @@ extern Z80Byte Z80_MEMORY[];
#define B3_Z80 0x08
#define B5_Z80 0x20
+#define HIDDEN_Z80 (B3_Z80|B5_Z80)
#define SET(v,b) (v)|=b