fix crash when specifying --source on command line
[rofl0r-gnuboy.git] / cpuregs.h
blob0d09908cc3b4f171112c9077759d9cdceeadb143
3 #ifndef __CPUREGS_H__
5 #define __CPUREGS_H__
9 #include "defs.h"
10 #include "cpu.h"
12 #define LB(r) ((r).b[LO][LO])
13 #define HB(r) ((r).b[LO][HI])
14 #define W(r) ((r).w[LO])
15 #define DW(r) ((r).d)
17 #define A HB(cpu.af)
18 #define F LB(cpu.af)
19 #define B HB(cpu.bc)
20 #define C LB(cpu.bc)
21 #define D HB(cpu.de)
22 #define E LB(cpu.de)
23 #define H HB(cpu.hl)
24 #define L LB(cpu.hl)
26 #define AF W(cpu.af)
27 #define BC W(cpu.bc)
28 #define DE W(cpu.de)
29 #define HL W(cpu.hl)
31 #define PC W(cpu.pc)
32 #define SP W(cpu.sp)
34 #define xAF DW(cpu.af)
35 #define xBC DW(cpu.bc)
36 #define xDE DW(cpu.de)
37 #define xHL DW(cpu.hl)
39 #define xPC DW(cpu.pc)
40 #define xSP DW(cpu.sp)
42 #define IMA cpu.ima
43 #define IME cpu.ime
44 #define IF R_IF
45 #define IE R_IE
47 #define FZ 0x80
48 #define FN 0x40
49 #define FH 0x20
50 #define FC 0x10
51 #define FL 0x0F /* low unused portion of flags */
54 #endif /* __CPUREGS_H__ */