fix FS#8187 - charging breaks sleep timer. Now if the timer goes off and the player...
[Rockbox.git] / apps / plugins / rockboy / cpuregs.h
blobd741320d220b23630e4ac0f2687001d9f4becaef
1 #ifndef __CPUREGS_H__
3 #define __CPUREGS_H__
7 #include "defs.h"
8 #include "cpu-gb.h"
10 #define LB(r) ((r).b[LO][LO])
11 #define HB(r) ((r).b[LO][HI])
12 #define W(r) ((r).w[LO])
13 #define DW(r) ((r).d)
15 #ifdef DYNAREC
16 #define A LB(cpu.a)
17 #define B LB(cpu.b)
18 #define C LB(cpu.c)
19 #define D LB(cpu.d)
20 #define E LB(cpu.e)
21 #define F LB(cpu.f)
22 #define H HB(cpu.hl)
23 #define L LB(cpu.hl)
25 #define xAF ((A<<8)|F)
26 #define xBC ((B<<8)|C)
27 #define xDE ((D<<8)|E)
28 #define AF ((A<<8)|F)
29 #define BC ((B<<8)|C)
30 #define DE ((D<<8)|E)
32 #define HL W(cpu.hl)
33 #define xHL DW(cpu.hl)
35 #else
36 #define A HB(cpu.af)
37 #define F LB(cpu.af)
38 #define B HB(cpu.bc)
39 #define C LB(cpu.bc)
40 #define D HB(cpu.de)
41 #define E LB(cpu.de)
42 #define H HB(cpu.hl)
43 #define L LB(cpu.hl)
45 #define AF W(cpu.af)
46 #define BC W(cpu.bc)
47 #define DE W(cpu.de)
48 #define HL W(cpu.hl)
49 #define xAF DW(cpu.af)
50 #define xBC DW(cpu.bc)
51 #define xDE DW(cpu.de)
52 #define xHL DW(cpu.hl)
54 #endif
55 #define PC W(cpu.pc)
56 #define SP W(cpu.sp)
58 #define xPC DW(cpu.pc)
59 #define xSP DW(cpu.sp)
61 #define IMA cpu.ima
62 #define IME cpu.ime
63 #define IF R_IF
64 #define IE R_IE
66 #define FZ 0x80
67 #define FN 0x40
68 #define FH 0x20
69 #define FC 0x10
70 #define FL 0x0F /* low unused portion of flags */
73 #endif /* __CPUREGS_H__ */