view src/gba/GBAGlobals.h @ 552:9068685e7d96

moduralized main-bootstrap-program
author Robert McIntyre <rlm@mit.edu>
date Thu, 30 Aug 2012 12:09:15 -0500
parents f9f4f1b99eed
children
line wrap: on
line source
1 #ifndef VBA_GBA_GLOBALS_H
2 #define VBA_GBA_GLOBALS_H
4 #if _MSC_VER > 1000
5 #pragma once
6 #endif // _MSC_VER > 1000
8 #include "../Port.h"
10 #define VERBOSE_SWI 1
11 #define VERBOSE_UNALIGNED_MEMORY 2
12 #define VERBOSE_ILLEGAL_WRITE 4
13 #define VERBOSE_ILLEGAL_READ 8
14 #define VERBOSE_DMA0 16
15 #define VERBOSE_DMA1 32
16 #define VERBOSE_DMA2 64
17 #define VERBOSE_DMA3 128
18 #define VERBOSE_UNDEFINED 256
19 #define VERBOSE_AGBPRINT 512
21 // moved from armdis.cpp
22 #define debuggerReadMemory(addr) \
23 READ32LE(&map[(addr) >> 24].address[(addr) & map[(addr) >> 24].mask])
25 #define debuggerReadHalfWord(addr) \
26 READ16LE(&map[(addr) >> 24].address[(addr) & map[(addr) >> 24].mask])
28 #define debuggerReadByte(addr) \
29 READ8LE(&map[(addr) >> 24].address[(addr) & map[(addr) >> 24].mask])
31 #define debuggerWriteMemory(addr, value) \
32 WRITE32LE((&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]), (value))
34 #define debuggerWriteHalfWord(addr, value) \
35 WRITE16LE((&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]), (value))
37 #define debuggerWriteByte(addr, value) \
38 WRITE8LE((&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]), (value))
40 // moved from GBA.h
41 typedef struct
42 {
43 u8 *address;
44 u32 mask;
45 } memoryMap;
47 #ifndef NO_GBA_MAP
48 extern memoryMap map[256];
49 #endif
51 // moved from GBA.h
52 typedef union
53 {
54 struct
55 {
56 #ifdef WORDS_BIGENDIAN
57 u8 B3;
58 u8 B2;
59 u8 B1;
60 u8 B0;
61 #else
62 u8 B0;
63 u8 B1;
64 u8 B2;
65 u8 B3;
66 #endif
67 } B;
68 struct
69 {
70 #ifdef WORDS_BIGENDIAN
71 u16 W1;
72 u16 W0;
73 #else
74 u16 W0;
75 u16 W1;
76 #endif
77 } W;
78 #ifdef WORDS_BIGENDIAN
79 volatile u32 I;
80 #else
81 u32 I;
82 #endif
83 } reg_pair;
85 extern reg_pair reg[45];
86 extern u8 biosProtected[4];
87 extern bool8 ioReadable[0x400];
88 extern bool8 N_FLAG;
89 extern bool8 C_FLAG;
90 extern bool8 Z_FLAG;
91 extern bool8 V_FLAG;
92 extern bool8 armState;
93 extern bool8 armIrqEnable;
94 extern u32 armNextPC;
95 extern int32 armMode;
96 extern u32 stop;
97 extern int32 saveType;
98 extern bool8 useBios;
99 extern bool8 skipBios;
100 extern int32 frameSkip;
101 extern u32 extButtons;
102 extern bool8 capturePrevious;
103 extern int32 captureNumber;
104 extern bool8 speedup;
105 extern bool8 synchronize;
106 extern bool8 cpuDisableSfx;
107 extern bool8 cpuIsMultiBoot;
108 extern bool8 parseDebug;
109 extern int32 layerSettings;
110 extern int32 layerEnable;
111 extern bool8 speedHack;
112 extern bool8 memLagEnabled, memLagTempEnabled;
113 extern bool8 useOldFrameTiming;
114 extern int32 cpuSaveType;
115 extern bool8 cpuEnhancedDetection;
116 extern bool8 cheatsEnabled;
118 extern int emulating;
120 extern u8 *bios;
121 extern u8 *rom;
122 extern u8 *internalRAM;
123 extern u8 *workRAM;
124 extern u8 *paletteRAM;
125 extern u8 *vram;
126 extern u8 *pix;
127 extern u8 *oam;
128 extern u8 *ioMem;
130 extern u16 DISPCNT;
131 extern u16 DISPSTAT;
132 extern u16 VCOUNT;
133 extern u16 BG0CNT;
134 extern u16 BG1CNT;
135 extern u16 BG2CNT;
136 extern u16 BG3CNT;
137 extern u16 BG0HOFS;
138 extern u16 BG0VOFS;
139 extern u16 BG1HOFS;
140 extern u16 BG1VOFS;
141 extern u16 BG2HOFS;
142 extern u16 BG2VOFS;
143 extern u16 BG3HOFS;
144 extern u16 BG3VOFS;
145 extern u16 BG2PA;
146 extern u16 BG2PB;
147 extern u16 BG2PC;
148 extern u16 BG2PD;
149 extern u16 BG2X_L;
150 extern u16 BG2X_H;
151 extern u16 BG2Y_L;
152 extern u16 BG2Y_H;
153 extern u16 BG3PA;
154 extern u16 BG3PB;
155 extern u16 BG3PC;
156 extern u16 BG3PD;
157 extern u16 BG3X_L;
158 extern u16 BG3X_H;
159 extern u16 BG3Y_L;
160 extern u16 BG3Y_H;
161 extern u16 WIN0H;
162 extern u16 WIN1H;
163 extern u16 WIN0V;
164 extern u16 WIN1V;
165 extern u16 WININ;
166 extern u16 WINOUT;
167 extern u16 MOSAIC;
168 extern u16 BLDMOD;
169 extern u16 COLEV;
170 extern u16 COLY;
171 extern u16 DM0SAD_L;
172 extern u16 DM0SAD_H;
173 extern u16 DM0DAD_L;
174 extern u16 DM0DAD_H;
175 extern u16 DM0CNT_L;
176 extern u16 DM0CNT_H;
177 extern u16 DM1SAD_L;
178 extern u16 DM1SAD_H;
179 extern u16 DM1DAD_L;
180 extern u16 DM1DAD_H;
181 extern u16 DM1CNT_L;
182 extern u16 DM1CNT_H;
183 extern u16 DM2SAD_L;
184 extern u16 DM2SAD_H;
185 extern u16 DM2DAD_L;
186 extern u16 DM2DAD_H;
187 extern u16 DM2CNT_L;
188 extern u16 DM2CNT_H;
189 extern u16 DM3SAD_L;
190 extern u16 DM3SAD_H;
191 extern u16 DM3DAD_L;
192 extern u16 DM3DAD_H;
193 extern u16 DM3CNT_L;
194 extern u16 DM3CNT_H;
195 extern u16 TM0D;
196 extern u16 TM0CNT;
197 extern u16 TM1D;
198 extern u16 TM1CNT;
199 extern u16 TM2D;
200 extern u16 TM2CNT;
201 extern u16 TM3D;
202 extern u16 TM3CNT;
203 extern u16 P1;
204 extern u16 IE;
205 extern u16 IF;
206 extern u16 IME;
208 #endif // VBA_GBA_GLOBALS_H