diff src/gb/gbGlobals.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/gb/gbGlobals.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,95 @@
     1.4 +#ifndef VBA_GB_GLOBALS_H
     1.5 +#define VBA_GB_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 +extern int32 gbRomSizeMask;
    1.14 +extern int32 gbRomSize;
    1.15 +extern int32 gbRamSize;
    1.16 +extern int32 gbRamSizeMask;
    1.17 +
    1.18 +extern u8 * gbRom;
    1.19 +extern u8 * gbRam;
    1.20 +extern u8 * gbVram;
    1.21 +extern u8 * gbWram;
    1.22 +extern u8 * gbMemory;
    1.23 +extern u16 *gbLineBuffer;
    1.24 +
    1.25 +extern u8 *gbMemoryMap[16];
    1.26 +
    1.27 +inline u8 gbReadMemoryQuick(u16 address)
    1.28 +{
    1.29 +	extern int32 gbEchoRAMFixOn;
    1.30 +	if (gbEchoRAMFixOn)
    1.31 +	{
    1.32 +		if (address >= 0xe000 && address < 0xfe00)
    1.33 +		{
    1.34 +			address -= 0x2000;
    1.35 +		}
    1.36 +	}
    1.37 +	return gbMemoryMap[address>>12][address&0xfff];
    1.38 +}
    1.39 +
    1.40 +inline void gbWriteMemoryQuick(u16 address, u8 value)
    1.41 +{
    1.42 +	extern int32 gbEchoRAMFixOn;
    1.43 +	if (gbEchoRAMFixOn)
    1.44 +	{
    1.45 +		if (address >= 0xe000 && address < 0xfe00)
    1.46 +		{
    1.47 +			address -= 0x2000;
    1.48 +		}
    1.49 +	}
    1.50 +	gbMemoryMap[address>>12][address&0xfff] = value;
    1.51 +}
    1.52 +
    1.53 +inline u8 gbReadROMQuick(u32 address)
    1.54 +{
    1.55 +	return gbRom[address];
    1.56 +}
    1.57 +
    1.58 +extern int32 gbFrameSkip;
    1.59 +extern u16   gbColorFilter[32768];
    1.60 +extern int32 gbColorOption;
    1.61 +extern int32 gbPaletteOption;
    1.62 +extern int32 gbEmulatorType;
    1.63 +extern int32 gbBorderOn;
    1.64 +extern int32 gbBorderAutomatic;
    1.65 +extern int32 gbCgbMode;
    1.66 +extern int32 gbSgbMode;
    1.67 +extern int32 gbWindowLine;
    1.68 +extern int32 gbSpeed;
    1.69 +extern u8    gbBgp[4];
    1.70 +extern u8    gbObp0[4];
    1.71 +extern u8    gbObp1[4];
    1.72 +extern u16   gbPalette[128];
    1.73 +
    1.74 +extern u8 register_LCDC;
    1.75 +extern u8 register_LY;
    1.76 +extern u8 register_SCY;
    1.77 +extern u8 register_SCX;
    1.78 +extern u8 register_WY;
    1.79 +extern u8 register_WX;
    1.80 +extern u8 register_VBK;
    1.81 +
    1.82 +extern int emulating;
    1.83 +
    1.84 +extern int32 gbBorderLineSkip;
    1.85 +extern int32 gbBorderRowSkip;
    1.86 +extern int32 gbBorderColumnSkip;
    1.87 +extern int32 gbDmaTicks;
    1.88 +
    1.89 +extern bool8 useOldFrameTiming;
    1.90 +extern bool8 gbNullInputHackEnabled;
    1.91 +extern bool8 gbNullInputHackTempEnabled;
    1.92 +
    1.93 +extern void gbRenderLine();
    1.94 +extern void gbDrawSprites();
    1.95 +
    1.96 +extern u8 (*gbSerialFunction)(u8);
    1.97 +
    1.98 +#endif // VBA_GB_GLOBALS_H