summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy/cpu-gb.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockboy/cpu-gb.h')
-rw-r--r--apps/plugins/rockboy/cpu-gb.h59
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
11union reg
12{
13 byte b[2][2];
14 word w[2];
15 un32 d; /* padding for alignment, carry */
16};
17
18struct 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
33extern struct cpu cpu;
34
35#ifdef DYNAREC
36struct 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
46extern struct dynarec_block *address_map[1<<HASH_SIGNIFICANT_LOWER_BITS];
47extern int blockclen;
48#endif
49
50void cpu_reset(void);
51void div_advance(int cnt);
52void timer_advance(int cnt);
53void lcdc_advance(int cnt);
54void sound_advance(int cnt);
55void cpu_timers(int cnt);
56int cpu_emulate(int cycles) ICODE_ATTR;
57int cpu_step(int max) ICODE_ATTR;
58
59#endif