annotate src/gb/gbGlobals.h @ 39:3e36553d0cbf

got some speedruns to work!
author Robert McIntyre <rlm@mit.edu>
date Mon, 05 Mar 2012 16:37:38 -0600
parents f9f4f1b99eed
children
rev   line source
rlm@1 1 #ifndef VBA_GB_GLOBALS_H
rlm@1 2 #define VBA_GB_GLOBALS_H
rlm@1 3
rlm@1 4 #if _MSC_VER > 1000
rlm@1 5 #pragma once
rlm@1 6 #endif // _MSC_VER > 1000
rlm@1 7
rlm@1 8 #include "../Port.h"
rlm@1 9
rlm@1 10 extern int32 gbRomSizeMask;
rlm@1 11 extern int32 gbRomSize;
rlm@1 12 extern int32 gbRamSize;
rlm@1 13 extern int32 gbRamSizeMask;
rlm@1 14
rlm@1 15 extern u8 * gbRom;
rlm@1 16 extern u8 * gbRam;
rlm@1 17 extern u8 * gbVram;
rlm@1 18 extern u8 * gbWram;
rlm@1 19 extern u8 * gbMemory;
rlm@1 20 extern u16 *gbLineBuffer;
rlm@1 21
rlm@1 22 extern u8 *gbMemoryMap[16];
rlm@1 23
rlm@1 24 inline u8 gbReadMemoryQuick(u16 address)
rlm@1 25 {
rlm@1 26 extern int32 gbEchoRAMFixOn;
rlm@1 27 if (gbEchoRAMFixOn)
rlm@1 28 {
rlm@1 29 if (address >= 0xe000 && address < 0xfe00)
rlm@1 30 {
rlm@1 31 address -= 0x2000;
rlm@1 32 }
rlm@1 33 }
rlm@1 34 return gbMemoryMap[address>>12][address&0xfff];
rlm@1 35 }
rlm@1 36
rlm@1 37 inline void gbWriteMemoryQuick(u16 address, u8 value)
rlm@1 38 {
rlm@1 39 extern int32 gbEchoRAMFixOn;
rlm@1 40 if (gbEchoRAMFixOn)
rlm@1 41 {
rlm@1 42 if (address >= 0xe000 && address < 0xfe00)
rlm@1 43 {
rlm@1 44 address -= 0x2000;
rlm@1 45 }
rlm@1 46 }
rlm@1 47 gbMemoryMap[address>>12][address&0xfff] = value;
rlm@1 48 }
rlm@1 49
rlm@1 50 inline u8 gbReadROMQuick(u32 address)
rlm@1 51 {
rlm@1 52 return gbRom[address];
rlm@1 53 }
rlm@1 54
rlm@1 55 extern int32 gbFrameSkip;
rlm@1 56 extern u16 gbColorFilter[32768];
rlm@1 57 extern int32 gbColorOption;
rlm@1 58 extern int32 gbPaletteOption;
rlm@1 59 extern int32 gbEmulatorType;
rlm@1 60 extern int32 gbBorderOn;
rlm@1 61 extern int32 gbBorderAutomatic;
rlm@1 62 extern int32 gbCgbMode;
rlm@1 63 extern int32 gbSgbMode;
rlm@1 64 extern int32 gbWindowLine;
rlm@1 65 extern int32 gbSpeed;
rlm@1 66 extern u8 gbBgp[4];
rlm@1 67 extern u8 gbObp0[4];
rlm@1 68 extern u8 gbObp1[4];
rlm@1 69 extern u16 gbPalette[128];
rlm@1 70
rlm@1 71 extern u8 register_LCDC;
rlm@1 72 extern u8 register_LY;
rlm@1 73 extern u8 register_SCY;
rlm@1 74 extern u8 register_SCX;
rlm@1 75 extern u8 register_WY;
rlm@1 76 extern u8 register_WX;
rlm@1 77 extern u8 register_VBK;
rlm@1 78
rlm@1 79 extern int emulating;
rlm@1 80
rlm@1 81 extern int32 gbBorderLineSkip;
rlm@1 82 extern int32 gbBorderRowSkip;
rlm@1 83 extern int32 gbBorderColumnSkip;
rlm@1 84 extern int32 gbDmaTicks;
rlm@1 85
rlm@1 86 extern bool8 useOldFrameTiming;
rlm@1 87 extern bool8 gbNullInputHackEnabled;
rlm@1 88 extern bool8 gbNullInputHackTempEnabled;
rlm@1 89
rlm@1 90 extern void gbRenderLine();
rlm@1 91 extern void gbDrawSprites();
rlm@1 92
rlm@1 93 extern u8 (*gbSerialFunction)(u8);
rlm@1 94
rlm@1 95 #endif // VBA_GB_GLOBALS_H