diff options
Diffstat (limited to 'apps/plugins/rockboy/cpu-gb.h')
-rw-r--r-- | apps/plugins/rockboy/cpu-gb.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/apps/plugins/rockboy/cpu-gb.h b/apps/plugins/rockboy/cpu-gb.h new file mode 100644 index 0000000000..937b477b53 --- /dev/null +++ b/apps/plugins/rockboy/cpu-gb.h | |||
@@ -0,0 +1,59 @@ | |||
1 | |||
2 | |||
3 | #ifndef __CPU_GB_H__ | ||
4 | #define __CPU_GB_H__ | ||
5 | |||
6 | |||
7 | |||
8 | #include "defs.h" | ||
9 | |||
10 | |||
11 | union reg | ||
12 | { | ||
13 | byte b[2][2]; | ||
14 | word w[2]; | ||
15 | un32 d; /* padding for alignment, carry */ | ||
16 | }; | ||
17 | |||
18 | struct cpu | ||
19 | { | ||
20 | #ifdef DYNAREC | ||
21 | union reg a,b,c,d,e,hl,f,sp,pc; | ||
22 | #else | ||
23 | union reg pc, sp, bc, de, hl, af; | ||
24 | #endif | ||
25 | int ime, ima; | ||
26 | int speed; | ||
27 | int halt; | ||
28 | int div, tim; | ||
29 | int lcdc; | ||
30 | int snd; | ||
31 | }; | ||
32 | |||
33 | extern struct cpu cpu; | ||
34 | |||
35 | #ifdef DYNAREC | ||
36 | struct dynarec_block { | ||
37 | union reg address; | ||
38 | void *block; | ||
39 | int length; | ||
40 | struct dynarec_block *next; | ||
41 | }; | ||
42 | |||
43 | #define HASH_SIGNIFICANT_LOWER_BITS 8 | ||
44 | #define HASH_BITMASK ((1<<HASH_SIGNIFICANT_LOWER_BITS)-1) | ||
45 | |||
46 | extern struct dynarec_block *address_map[1<<HASH_SIGNIFICANT_LOWER_BITS]; | ||
47 | extern int blockclen; | ||
48 | #endif | ||
49 | |||
50 | void cpu_reset(void); | ||
51 | void div_advance(int cnt); | ||
52 | void timer_advance(int cnt); | ||
53 | void lcdc_advance(int cnt); | ||
54 | void sound_advance(int cnt); | ||
55 | void cpu_timers(int cnt); | ||
56 | int cpu_emulate(int cycles) ICODE_ATTR; | ||
57 | int cpu_step(int max) ICODE_ATTR; | ||
58 | |||
59 | #endif | ||