summaryrefslogtreecommitdiff
path: root/z80_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'z80_private.h')
-rw-r--r--z80_private.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/z80_private.h b/z80_private.h
index c10b15f..58b9584 100644
--- a/z80_private.h
+++ b/z80_private.h
@@ -146,17 +146,19 @@ struct Z80
#define POKE(addr,val) do \
{ \
- if (cpu->memctrl[(addr)/256]) \
+ Z80Word ba=addr; \
+ Z80Word bv=val; \
+ if (cpu->memctrl[(ba)/256]) \
{ \
- cpu->memory[addr]=val; \
+ cpu->memory[ba]=bv; \
} \
} while (0)
#define POKEW(addr,val) do \
{ \
- Z80Word once=val; \
- Z80Word once_addr=addr; \
- POKE(once_addr,once); \
- POKE(once_addr+1,once>>8); \
+ Z80Word wa=addr; \
+ Z80Word wv=val; \
+ POKE(wa,wv); \
+ POKE(wa+1,wv>>8); \
} while(0)
#define FETCH_BYTE (cpu->memory[cpu->PC++])