summaryrefslogtreecommitdiff
path: root/z80_decode.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2023-01-02 13:15:42 +0000
committerIan C <ianc@noddybox.co.uk>2023-01-02 13:15:42 +0000
commitdf871d0ec225a2001b36d0e788895bd7f25976bd (patch)
tree1f62ecace0f49f235d07f9341d58e0b708757d89 /z80_decode.c
parentf2746bc3a3504dd0929ed4cfeb116c33eaa137bf (diff)
Fixed BIT (i[xy]+d),b
Diffstat (limited to 'z80_decode.c')
-rw-r--r--z80_decode.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/z80_decode.c b/z80_decode.c
index 3247cc2..004682f 100644
--- a/z80_decode.c
+++ b/z80_decode.c
@@ -440,11 +440,12 @@ do { \
#define BIT(REG,B) \
do { \
+ Z80Byte b=(REG)&(1<<B); \
cpu->AF.b.lo&=C_Z80; \
cpu->AF.b.lo|=H_Z80; \
- if ((REG)&(1<<B)) \
+ if (b) \
{ \
- cpu->AF.b.lo|=S_Z80&REG; \
+ cpu->AF.b.lo|=S_Z80&b; \
} \
else \
{ \
@@ -455,11 +456,12 @@ do { \
#define BIT_MEMPTR(REG,B) \
do { \
+ Z80Byte b=(REG)&(1<<B); \
cpu->AF.b.lo&=C_Z80; \
cpu->AF.b.lo|=H_Z80; \
- if ((REG)&(1<<B)) \
+ if (b) \
{ \
- cpu->AF.b.lo|=S_Z80&REG; \
+ cpu->AF.b.lo|=S_Z80&b; \
} \
else \
{ \