Mercurial > vba-clojure
diff src/gba/GBAGlobals.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/gba/GBAGlobals.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,208 @@ 1.4 +#ifndef VBA_GBA_GLOBALS_H 1.5 +#define VBA_GBA_GLOBALS_H 1.6 + 1.7 +#if _MSC_VER > 1000 1.8 +#pragma once 1.9 +#endif // _MSC_VER > 1000 1.10 + 1.11 +#include "../Port.h" 1.12 + 1.13 +#define VERBOSE_SWI 1 1.14 +#define VERBOSE_UNALIGNED_MEMORY 2 1.15 +#define VERBOSE_ILLEGAL_WRITE 4 1.16 +#define VERBOSE_ILLEGAL_READ 8 1.17 +#define VERBOSE_DMA0 16 1.18 +#define VERBOSE_DMA1 32 1.19 +#define VERBOSE_DMA2 64 1.20 +#define VERBOSE_DMA3 128 1.21 +#define VERBOSE_UNDEFINED 256 1.22 +#define VERBOSE_AGBPRINT 512 1.23 + 1.24 +// moved from armdis.cpp 1.25 +#define debuggerReadMemory(addr) \ 1.26 + READ32LE(&map[(addr) >> 24].address[(addr) & map[(addr) >> 24].mask]) 1.27 + 1.28 +#define debuggerReadHalfWord(addr) \ 1.29 + READ16LE(&map[(addr) >> 24].address[(addr) & map[(addr) >> 24].mask]) 1.30 + 1.31 +#define debuggerReadByte(addr) \ 1.32 + READ8LE(&map[(addr) >> 24].address[(addr) & map[(addr) >> 24].mask]) 1.33 + 1.34 +#define debuggerWriteMemory(addr, value) \ 1.35 + WRITE32LE((&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]), (value)) 1.36 + 1.37 +#define debuggerWriteHalfWord(addr, value) \ 1.38 + WRITE16LE((&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]), (value)) 1.39 + 1.40 +#define debuggerWriteByte(addr, value) \ 1.41 + WRITE8LE((&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]), (value)) 1.42 + 1.43 +// moved from GBA.h 1.44 +typedef struct 1.45 +{ 1.46 + u8 *address; 1.47 + u32 mask; 1.48 +} memoryMap; 1.49 + 1.50 +#ifndef NO_GBA_MAP 1.51 +extern memoryMap map[256]; 1.52 +#endif 1.53 + 1.54 +// moved from GBA.h 1.55 +typedef union 1.56 +{ 1.57 + struct 1.58 + { 1.59 +#ifdef WORDS_BIGENDIAN 1.60 + u8 B3; 1.61 + u8 B2; 1.62 + u8 B1; 1.63 + u8 B0; 1.64 +#else 1.65 + u8 B0; 1.66 + u8 B1; 1.67 + u8 B2; 1.68 + u8 B3; 1.69 +#endif 1.70 + } B; 1.71 + struct 1.72 + { 1.73 +#ifdef WORDS_BIGENDIAN 1.74 + u16 W1; 1.75 + u16 W0; 1.76 +#else 1.77 + u16 W0; 1.78 + u16 W1; 1.79 +#endif 1.80 + } W; 1.81 +#ifdef WORDS_BIGENDIAN 1.82 + volatile u32 I; 1.83 +#else 1.84 + u32 I; 1.85 +#endif 1.86 +} reg_pair; 1.87 + 1.88 +extern reg_pair reg[45]; 1.89 +extern u8 biosProtected[4]; 1.90 +extern bool8 ioReadable[0x400]; 1.91 +extern bool8 N_FLAG; 1.92 +extern bool8 C_FLAG; 1.93 +extern bool8 Z_FLAG; 1.94 +extern bool8 V_FLAG; 1.95 +extern bool8 armState; 1.96 +extern bool8 armIrqEnable; 1.97 +extern u32 armNextPC; 1.98 +extern int32 armMode; 1.99 +extern u32 stop; 1.100 +extern int32 saveType; 1.101 +extern bool8 useBios; 1.102 +extern bool8 skipBios; 1.103 +extern int32 frameSkip; 1.104 +extern u32 extButtons; 1.105 +extern bool8 capturePrevious; 1.106 +extern int32 captureNumber; 1.107 +extern bool8 speedup; 1.108 +extern bool8 synchronize; 1.109 +extern bool8 cpuDisableSfx; 1.110 +extern bool8 cpuIsMultiBoot; 1.111 +extern bool8 parseDebug; 1.112 +extern int32 layerSettings; 1.113 +extern int32 layerEnable; 1.114 +extern bool8 speedHack; 1.115 +extern bool8 memLagEnabled, memLagTempEnabled; 1.116 +extern bool8 useOldFrameTiming; 1.117 +extern int32 cpuSaveType; 1.118 +extern bool8 cpuEnhancedDetection; 1.119 +extern bool8 cheatsEnabled; 1.120 + 1.121 +extern int emulating; 1.122 + 1.123 +extern u8 *bios; 1.124 +extern u8 *rom; 1.125 +extern u8 *internalRAM; 1.126 +extern u8 *workRAM; 1.127 +extern u8 *paletteRAM; 1.128 +extern u8 *vram; 1.129 +extern u8 *pix; 1.130 +extern u8 *oam; 1.131 +extern u8 *ioMem; 1.132 + 1.133 +extern u16 DISPCNT; 1.134 +extern u16 DISPSTAT; 1.135 +extern u16 VCOUNT; 1.136 +extern u16 BG0CNT; 1.137 +extern u16 BG1CNT; 1.138 +extern u16 BG2CNT; 1.139 +extern u16 BG3CNT; 1.140 +extern u16 BG0HOFS; 1.141 +extern u16 BG0VOFS; 1.142 +extern u16 BG1HOFS; 1.143 +extern u16 BG1VOFS; 1.144 +extern u16 BG2HOFS; 1.145 +extern u16 BG2VOFS; 1.146 +extern u16 BG3HOFS; 1.147 +extern u16 BG3VOFS; 1.148 +extern u16 BG2PA; 1.149 +extern u16 BG2PB; 1.150 +extern u16 BG2PC; 1.151 +extern u16 BG2PD; 1.152 +extern u16 BG2X_L; 1.153 +extern u16 BG2X_H; 1.154 +extern u16 BG2Y_L; 1.155 +extern u16 BG2Y_H; 1.156 +extern u16 BG3PA; 1.157 +extern u16 BG3PB; 1.158 +extern u16 BG3PC; 1.159 +extern u16 BG3PD; 1.160 +extern u16 BG3X_L; 1.161 +extern u16 BG3X_H; 1.162 +extern u16 BG3Y_L; 1.163 +extern u16 BG3Y_H; 1.164 +extern u16 WIN0H; 1.165 +extern u16 WIN1H; 1.166 +extern u16 WIN0V; 1.167 +extern u16 WIN1V; 1.168 +extern u16 WININ; 1.169 +extern u16 WINOUT; 1.170 +extern u16 MOSAIC; 1.171 +extern u16 BLDMOD; 1.172 +extern u16 COLEV; 1.173 +extern u16 COLY; 1.174 +extern u16 DM0SAD_L; 1.175 +extern u16 DM0SAD_H; 1.176 +extern u16 DM0DAD_L; 1.177 +extern u16 DM0DAD_H; 1.178 +extern u16 DM0CNT_L; 1.179 +extern u16 DM0CNT_H; 1.180 +extern u16 DM1SAD_L; 1.181 +extern u16 DM1SAD_H; 1.182 +extern u16 DM1DAD_L; 1.183 +extern u16 DM1DAD_H; 1.184 +extern u16 DM1CNT_L; 1.185 +extern u16 DM1CNT_H; 1.186 +extern u16 DM2SAD_L; 1.187 +extern u16 DM2SAD_H; 1.188 +extern u16 DM2DAD_L; 1.189 +extern u16 DM2DAD_H; 1.190 +extern u16 DM2CNT_L; 1.191 +extern u16 DM2CNT_H; 1.192 +extern u16 DM3SAD_L; 1.193 +extern u16 DM3SAD_H; 1.194 +extern u16 DM3DAD_L; 1.195 +extern u16 DM3DAD_H; 1.196 +extern u16 DM3CNT_L; 1.197 +extern u16 DM3CNT_H; 1.198 +extern u16 TM0D; 1.199 +extern u16 TM0CNT; 1.200 +extern u16 TM1D; 1.201 +extern u16 TM1CNT; 1.202 +extern u16 TM2D; 1.203 +extern u16 TM2CNT; 1.204 +extern u16 TM3D; 1.205 +extern u16 TM3CNT; 1.206 +extern u16 P1; 1.207 +extern u16 IE; 1.208 +extern u16 IF; 1.209 +extern u16 IME; 1.210 + 1.211 +#endif // VBA_GBA_GLOBALS_H