view src/gba/GBA.h @ 301:1de6aada1cb7

inserted backwards jump into bootstrap program to fit it into item-pc space
author Robert McIntyre <rlm@mit.edu>
date Fri, 30 Mar 2012 23:39:58 -0500
parents 1ff2c546f5ad
children
line wrap: on
line source
1 #ifndef VBA_GBA_H
2 #define VBA_GBA_H
4 #if _MSC_VER > 1000
5 #pragma once
6 #endif // _MSC_VER > 1000
8 #include "zlib.h"
9 #include "../Port.h"
11 #if (defined(WIN32) && !defined(SDL))
12 #include "../win32/stdafx.h" // for HANDLE
13 //#include <windows.h> // for HANDLE
14 // NOTE: if you get this error:
15 // #error WINDOWS.H already included. MFC apps must not #include <windows.h>
16 // it is probably because stdafx.h is getting included at the wrong place
17 // (i.e. after anything else) in a file, or your precompiled headers are otherwise wrong
18 #endif
20 #define SAVE_GAME_VERSION_1 1
21 #define SAVE_GAME_VERSION_2 2
22 #define SAVE_GAME_VERSION_3 3
23 #define SAVE_GAME_VERSION_4 4
24 #define SAVE_GAME_VERSION_5 5
25 #define SAVE_GAME_VERSION_6 6
26 #define SAVE_GAME_VERSION_7 7
27 #define SAVE_GAME_VERSION_8 8
28 #define SAVE_GAME_VERSION_9 9
29 #define SAVE_GAME_VERSION_10 10
30 #define SAVE_GAME_VERSION_11 11
31 #define SAVE_GAME_VERSION_12 12
32 #define SAVE_GAME_VERSION_13 13
33 #define SAVE_GAME_VERSION SAVE_GAME_VERSION_13
35 #if (defined(WIN32) && !defined(SDL))
36 extern HANDLE mapROM; // shared memory handles
37 extern HANDLE mapWORKRAM;
38 extern HANDLE mapBIOS;
39 extern HANDLE mapIRAM;
40 extern HANDLE mapPALETTERAM;
41 extern HANDLE mapVRAM;
42 extern HANDLE mapOAM;
43 extern HANDLE mapPIX;
44 extern HANDLE mapIOMEM;
45 #endif
47 /*
48 extern reg_pair reg[45];
49 extern u8 biosProtected[4];
51 extern bool8 N_FLAG;
52 extern bool8 Z_FLAG;
53 extern bool8 C_FLAG;
54 extern bool8 V_FLAG;
55 extern bool8 armIrqEnable;
56 extern bool8 armState;
57 extern int32 armMode;
58 */
59 extern void (*cpuSaveGameFunc)(u32, u8);
61 extern bool8 freezeWorkRAM[0x40000];
62 extern bool8 freezeInternalRAM[0x8000];
63 extern bool CPUReadGSASnapshot(const char *);
64 extern bool CPUWriteGSASnapshot(const char *, const char *, const char *, const char *);
65 extern bool CPUWriteBatteryFile(const char *);
66 extern bool CPUReadBatteryFile(const char *);
67 extern bool CPUWriteBatteryToStream(gzFile);
68 extern bool CPUReadBatteryFromStream(gzFile);
69 extern bool CPUExportEepromFile(const char *);
70 extern bool CPUImportEepromFile(const char *);
71 extern bool CPUWritePNGFile(const char *);
72 extern bool CPUWriteBMPFile(const char *);
73 extern void CPUCleanUp();
74 extern void CPUUpdateRender();
75 extern void CPUUpdateRenderBuffers(bool force);
76 extern bool CPUReadMemState(char *, int);
77 extern bool CPUReadState(const char *);
78 extern bool CPUWriteMemState(char *, int);
79 extern bool CPUWriteState(const char *);
80 extern bool CPUReadStateFromStream(gzFile);
81 extern bool CPUWriteStateToStream(gzFile);
82 extern int CPULoadRom(const char *);
83 extern void CPUUpdateRegister(u32, u16);
84 extern void CPUWriteHalfWord(u32, u16);
85 extern void CPUWriteByte(u32, u8);
86 extern bool CPULoadBios(const char *, bool);
87 extern void CPUInit();
88 extern void CPUReset(bool userReset = false);
89 extern int CPULoop(int);
90 extern void CPUCheckDMA(int, int);
91 #ifdef PROFILING
92 extern void cpuProfil(char *buffer, int, u32, int);
93 extern void cpuEnableProfiling(int hz);
94 #endif
96 extern struct EmulatedSystem GBASystem;
97 extern struct EmulatedSystemCounters &GBASystemCounters;
99 #define R13_IRQ 18
100 #define R14_IRQ 19
101 #define SPSR_IRQ 20
102 #define R13_USR 26
103 #define R14_USR 27
104 #define R13_SVC 28
105 #define R14_SVC 29
106 #define SPSR_SVC 30
107 #define R13_ABT 31
108 #define R14_ABT 32
109 #define SPSR_ABT 33
110 #define R13_UND 34
111 #define R14_UND 35
112 #define SPSR_UND 36
113 #define R8_FIQ 37
114 #define R9_FIQ 38
115 #define R10_FIQ 39
116 #define R11_FIQ 40
117 #define R12_FIQ 41
118 #define R13_FIQ 42
119 #define R14_FIQ 43
120 #define SPSR_FIQ 44
122 #endif // VBA_GBA_H