diff src/gba/GBA.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/GBA.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,122 @@
     1.4 +#ifndef VBA_GBA_H
     1.5 +#define VBA_GBA_H
     1.6 +
     1.7 +#if _MSC_VER > 1000
     1.8 +#pragma once
     1.9 +#endif // _MSC_VER > 1000
    1.10 +
    1.11 +#include "zlib.h"
    1.12 +#include "../Port.h"
    1.13 +
    1.14 +#if (defined(WIN32) && !defined(SDL))
    1.15 +#include "../win32/stdafx.h" // for HANDLE
    1.16 +//#include <windows.h> // for HANDLE
    1.17 +// NOTE: if you get this error:
    1.18 +// #error WINDOWS.H already included.  MFC apps must not #include <windows.h>
    1.19 +// it is probably because stdafx.h is getting included at the wrong place
    1.20 +// (i.e. after anything else) in a file, or your precompiled headers are otherwise wrong
    1.21 +#endif
    1.22 +
    1.23 +#define SAVE_GAME_VERSION_1 1
    1.24 +#define SAVE_GAME_VERSION_2 2
    1.25 +#define SAVE_GAME_VERSION_3 3
    1.26 +#define SAVE_GAME_VERSION_4 4
    1.27 +#define SAVE_GAME_VERSION_5 5
    1.28 +#define SAVE_GAME_VERSION_6 6
    1.29 +#define SAVE_GAME_VERSION_7 7
    1.30 +#define SAVE_GAME_VERSION_8 8
    1.31 +#define SAVE_GAME_VERSION_9 9
    1.32 +#define SAVE_GAME_VERSION_10 10
    1.33 +#define SAVE_GAME_VERSION_11 11
    1.34 +#define SAVE_GAME_VERSION_12 12
    1.35 +#define SAVE_GAME_VERSION_13 13
    1.36 +#define SAVE_GAME_VERSION  SAVE_GAME_VERSION_13
    1.37 +
    1.38 +#if (defined(WIN32) && !defined(SDL))
    1.39 +extern HANDLE mapROM;        // shared memory handles
    1.40 +extern HANDLE mapWORKRAM;
    1.41 +extern HANDLE mapBIOS;
    1.42 +extern HANDLE mapIRAM;
    1.43 +extern HANDLE mapPALETTERAM;
    1.44 +extern HANDLE mapVRAM;
    1.45 +extern HANDLE mapOAM;
    1.46 +extern HANDLE mapPIX;
    1.47 +extern HANDLE mapIOMEM;
    1.48 +#endif
    1.49 +
    1.50 +/*
    1.51 +extern reg_pair reg[45];
    1.52 +extern u8       biosProtected[4];
    1.53 +
    1.54 +extern bool8 N_FLAG;
    1.55 +extern bool8 Z_FLAG;
    1.56 +extern bool8 C_FLAG;
    1.57 +extern bool8 V_FLAG;
    1.58 +extern bool8 armIrqEnable;
    1.59 +extern bool8 armState;
    1.60 +extern int32 armMode;
    1.61 +*/
    1.62 +extern void  (*cpuSaveGameFunc)(u32, u8);
    1.63 +
    1.64 +extern bool8 freezeWorkRAM[0x40000];
    1.65 +extern bool8 freezeInternalRAM[0x8000];
    1.66 +extern bool CPUReadGSASnapshot(const char *);
    1.67 +extern bool CPUWriteGSASnapshot(const char *, const char *, const char *, const char *);
    1.68 +extern bool CPUWriteBatteryFile(const char *);
    1.69 +extern bool CPUReadBatteryFile(const char *);
    1.70 +extern bool CPUWriteBatteryToStream(gzFile);
    1.71 +extern bool CPUReadBatteryFromStream(gzFile);
    1.72 +extern bool CPUExportEepromFile(const char *);
    1.73 +extern bool CPUImportEepromFile(const char *);
    1.74 +extern bool CPUWritePNGFile(const char *);
    1.75 +extern bool CPUWriteBMPFile(const char *);
    1.76 +extern void CPUCleanUp();
    1.77 +extern void CPUUpdateRender();
    1.78 +extern void CPUUpdateRenderBuffers(bool force);
    1.79 +extern bool CPUReadMemState(char *, int);
    1.80 +extern bool CPUReadState(const char *);
    1.81 +extern bool CPUWriteMemState(char *, int);
    1.82 +extern bool CPUWriteState(const char *);
    1.83 +extern bool CPUReadStateFromStream(gzFile);
    1.84 +extern bool CPUWriteStateToStream(gzFile);
    1.85 +extern int CPULoadRom(const char *);
    1.86 +extern void CPUUpdateRegister(u32, u16);
    1.87 +extern void CPUWriteHalfWord(u32, u16);
    1.88 +extern void CPUWriteByte(u32, u8);
    1.89 +extern bool CPULoadBios(const char *, bool);
    1.90 +extern void CPUInit();
    1.91 +extern void CPUReset(bool userReset = false);
    1.92 +extern void CPULoop(int);
    1.93 +extern void CPUCheckDMA(int, int);
    1.94 +#ifdef PROFILING
    1.95 +extern void cpuProfil(char *buffer, int, u32, int);
    1.96 +extern void cpuEnableProfiling(int hz);
    1.97 +#endif
    1.98 +
    1.99 +extern struct EmulatedSystem GBASystem;
   1.100 +extern struct EmulatedSystemCounters &GBASystemCounters;
   1.101 +
   1.102 +#define R13_IRQ  18
   1.103 +#define R14_IRQ  19
   1.104 +#define SPSR_IRQ 20
   1.105 +#define R13_USR  26
   1.106 +#define R14_USR  27
   1.107 +#define R13_SVC  28
   1.108 +#define R14_SVC  29
   1.109 +#define SPSR_SVC 30
   1.110 +#define R13_ABT  31
   1.111 +#define R14_ABT  32
   1.112 +#define SPSR_ABT 33
   1.113 +#define R13_UND  34
   1.114 +#define R14_UND  35
   1.115 +#define SPSR_UND 36
   1.116 +#define R8_FIQ   37
   1.117 +#define R9_FIQ   38
   1.118 +#define R10_FIQ  39
   1.119 +#define R11_FIQ  40
   1.120 +#define R12_FIQ  41
   1.121 +#define R13_FIQ  42
   1.122 +#define R14_FIQ  43
   1.123 +#define SPSR_FIQ 44
   1.124 +
   1.125 +#endif // VBA_GBA_H