#ifndef _DC_OFFSETS_H_
#define OFFSET__DC_OFFSETS_H_

#define OFFSET_Flags 					_CPU + 0
#define OFFSET_BranchSkip 				_CPU + 64
#define OFFSET_NMIActive 				_CPU + 65
#define OFFSET_IRQActive 				_CPU + 66
#define OFFSET_WaitingForInterrupt 		_CPU + 67
#define OFFSET_InDMA 					_CPU + 68
#define OFFSET_WhichEvent 				_CPU + 69
#define OFFSET_PCS 						_CPU + 48
#define OFFSET_PCBase 					_CPU + 52
#define OFFSET_PCAtOpcodeStart 			_CPU + 56
#define OFFSET_WaitAddress 				_CPU + 60
#define OFFSET_WaitCounter 				_CPU + 4
#define OFFSET_Cycles 					_CPU + 8
#define OFFSET_NextEvent 				_CPU + 12
#define OFFSET_V_Counter 				_CPU + 16
#define OFFSET_MemSpeed 				_CPU + 20
#define OFFSET_MemSpeedx2 				_CPU + 24
#define OFFSET_FastROMSpeed 			_CPU + 28
#define OFFSET_AutoSaveTimer 			_CPU + 32
#define OFFSET_SRAMModified 			_CPU + 70
#define OFFSET_NMITriggerPoint 			_CPU + 36
#define OFFSET_TriedInterleavedMode2 	_CPU + 72
#define OFFSET_BRKTriggered 			_CPU + 71
#define OFFSET_NMICycleCount 			_CPU + 40
#define OFFSET_IRQCycleCount 			_CPU + 44
#define OFFSET_PB 						_Registers + 0
#define OFFSET_DB 						_Registers + 1
#define OFFSET_PP 						_Registers + 2
#define OFFSET_PL 						_Registers + 2
#define OFFSET_PH 						_PL + 1
#define OFFSET_AA 						_Registers + 4
#define OFFSET_AL 						_Registers + 4
#define OFFSET_AH 						_AL + 1
#define OFFSET_DD 						_Registers + 6
#define OFFSET_DL 						_Registers + 6
#define OFFSET_DH 						_DL + 1
#define OFFSET_SS 						_Registers + 8
#define OFFSET_SL 						_Registers + 8
#define OFFSET_SH 						_SL + 1
#define OFFSET_XX 						_Registers + 10
#define OFFSET_XL 						_Registers + 10
#define OFFSET_XH 						_XL + 1
#define OFFSET_YY 						_Registers + 12
#define OFFSET_YL 						_Registers + 12
#define OFFSET_YH 						_YL + 1
#define OFFSET_PCR 						_Registers + 14
#define OFFSET_RAM 						_Memory + 0
#define OFFSET_ROM 						_Memory + 4
#define OFFSET_VRAM 					_Memory + 8
#define OFFSET_SRAM 					_Memory + 12
#define OFFSET_BWRAM 					_Memory + 16
#define OFFSET_FillRAM 					_Memory + 20
#define OFFSET_C4RAM 					_Memory + 24
#define OFFSET_HiROM 					_Memory + 28
#define OFFSET_LoROM 					_Memory + 29
#define OFFSET_SRAMMask 				_Memory + 32
#define OFFSET_SRAMSize 				_Memory + 36
#define OFFSET_Map 						_Memory + 40
#define OFFSET_WriteMap 				_Memory + 16424
#define OFFSET_MemorySpeed 				_Memory + 32808
#define OFFSET_BlockIsRAM 				_Memory + 36904
#define OFFSET_BlockIsROM 				_Memory + 41000
#define OFFSET_ROMFilename 				_Memory + 53368
#define OFFSET_APUPCS 					_IAPU + 0
#define OFFSET_APURAM 					_IAPU + 4
#define OFFSET_APUExecuting 			_IAPU + 52
#define OFFSET_APUDirectPage 			_IAPU + 8
#define OFFSET_APUBit 					_IAPU + 53
#define OFFSET_APUAddress 				_IAPU + 12
#define OFFSET_APUWaitAddress1 			_IAPU + 16
#define OFFSET_APUWaitAddress2 			_IAPU + 20
#define OFFSET_APUWaitCounter 			_IAPU + 24
#define OFFSET_APUShadowRAM 			_IAPU + 28
#define OFFSET_APUCachedSamples 		_IAPU + 32
#define OFFSET_APU_Carry 				_IAPU + 54
#define OFFSET_APU_Zero 				_IAPU + 55
#define OFFSET_APU_Overflow 			_IAPU + 56
#define OFFSET_APUTimerErrorCounter 	_IAPU + 36
#define OFFSET_APUCycles 				_APU + 0
#define OFFSET_APUShowROM 				_APU + 22
#define OFFSET_APUFlags 				_APU + 23
#define OFFSET_APUKeyedChannels 		_APU + 24
#define OFFSET_APUOutPorts 				_APU + 25
#define OFFSET_APUDSP 					_APU + 29
#define OFFSET_APUExtraRAM 				_APU + 157
#define OFFSET_APUTimer 				_APU + 4
#define OFFSET_APUTimerTarget 			_APU + 10
#define OFFSET_APUTimerEnabled 			_APU + 16
#define OFFSET_TimerValueWritten 		_APU + 19
#define OFFSET_CPUSpeed 				_ICPU + 0
#define OFFSET_CPUOpcodes 				_ICPU + 4
#define OFFSET__Carry 					_ICPU + 28
#define OFFSET__Zero 					_ICPU + 29
#define OFFSET__Negative 				_ICPU + 30
#define OFFSET__Overflow 				_ICPU + 31
#define OFFSET_ShiftedDB 				_ICPU + 12
#define OFFSET_ShiftedPB 				_ICPU + 8
#define OFFSET_CPUExecuting 			_ICPU + 32
#define OFFSET_Scanline 				_ICPU + 20
#define OFFSET_Frame 					_ICPU + 16
#define OFFSET_APUEnabled 				_Settings + 66
#define OFFSET_Shutdown 				_Settings + 67
#define OFFSET_SoundSkipMethod 			_Settings + 68
#define OFFSET_H_Max 					_Settings + 0
#define OFFSET_HBlankStart 				_Settings + 4
#define OFFSET_CyclesPercentage 		_Settings + 8
#define OFFSET_DisableIRQ 				_Settings + 69
#define OFFSET_Paused 					_Settings + 70
#define OFFSET_PAL 						_Settings + 82
#define OFFSET_SoundSync 				_Settings + 128
#define OFFSET_SA1Enabled 				_Settings + 110
#define OFFSET_SuperFXEnabled 			_Settings + 108
#define OFFSET_ApuP 					_APURegisters + 0
#define OFFSET_ApuYA 					_APURegisters + 2
#define OFFSET_ApuA 					_APURegisters + 2
#define OFFSET_ApuY 					_APURegisters + 3
#define OFFSET_ApuX 					_APURegisters + 4
#define OFFSET_ApuS 					_APURegisters + 5
#define OFFSET_ApuPC 					_APURegisters + 6
#define OFFSET_APUPCR 					_APURegisters + 6
#define OFFSET_BGMode 					_PPU + 2215
#define OFFSET_BG3Priority 				_PPU + 2216
#define OFFSET_Brightness 				_PPU + 2217
#define OFFSET_GHight 					_PPU + 40
#define OFFSET_GInc 					_PPU + 41
#define OFFSET_GAddress 				_PPU + 32
#define OFFSET_GMask1 					_PPU + 34
#define OFFSET_GFullGraphicCount 		_PPU + 36
#define OFFSET_GShift 					_PPU + 38
#define OFFSET_CGFLIP 					_PPU + 2825
#define OFFSET_CGDATA 					_PPU + 1688
#define OFFSET_FirstSprite 				_PPU + 2826
#define OFFSET_LastSprite 				_PPU + 2827
#define OFFSET_OBJ 						_PPU + 128
#define OFFSET_OAMPriorityRotation 		_PPU + 2828
#define OFFSET_OAMAddr 					_PPU + 2200
#define OFFSET_OAMFlip 					_PPU + 2830
#define OFFSET_OAMTileAddress 			_PPU + 2202
#define OFFSET_IRQVBeamPos 				_PPU + 2204
#define OFFSET_IRQHBeamPos 				_PPU + 2206
#define OFFSET_VBeamPosLatched 			_PPU + 2208
#define OFFSET_HBeamPosLatched 			_PPU + 2210
#define OFFSET_HBeamFlip 				_PPU + 2831
#define OFFSET_VBeamFlip 				_PPU + 2832
#define OFFSET_HVBeamCounterLatched 	_PPU + 2833
#define OFFSET_MatrixA 					_PPU + 1668
#define OFFSET_MatrixB 					_PPU + 1670
#define OFFSET_MatrixC 					_PPU + 1672
#define OFFSET_MatrixD 					_PPU + 1674
#define OFFSET_CentreX 					_PPU + 1676
#define OFFSET_CentreY 					_PPU + 1678
#define OFFSET_Joypad1ButtonReadPos 	_PPU + 2834
#define OFFSET_Joypad2ButtonReadPos 	_PPU + 2835
#define OFFSET_CGADD 					_PPU + 2836
#define OFFSET_FixedColourGreen 		_PPU + 2838
#define OFFSET_FixedColourRed 			_PPU + 2837
#define OFFSET_FixedColourBlue 			_PPU + 2839
#define OFFSET_SavedOAMAddr 			_PPU + 1664
#define OFFSET_ScreenHeight 			_PPU + 1666
#define OFFSET_WRAM 					_PPU + 0
#define OFFSET_BG_Forced 				_PPU + 2820
#define OFFSET_ForcedBlanking 			_PPU + 2821
#define OFFSET_OBJThroughMain 			_PPU + 2822
#define OFFSET_OBJThroughSub 			_PPU + 2823
#define OFFSET_OBJSizeSelect 			_PPU + 2824
#define OFFSET_OBJNameBase 				_PPU + 1680
#define OFFSET_OAMReadFlip 				_PPU + 2273
#define OFFSET_OAMData 					_PPU + 2274
#define OFFSET_VTimerEnabled 			_PPU + 2818
#define OFFSET_HTimerEnabled 			_PPU + 2819
#define OFFSET_HTimerPosition 			_PPU + 1682
#define OFFSET_Mosaic 					_PPU + 2222
#define OFFSET_BGMosaic 				_PPU + 2223
#define OFFSET_Mode7HFlip 				_PPU + 2227
#define OFFSET_Mode7VFlip 				_PPU + 2228
#define OFFSET_Mode7Repeat 				_PPU + 2229
#define OFFSET_Window1Left 				_PPU + 2230
#define OFFSET_Window1Right 			_PPU + 2231
#define OFFSET_Window2Left 				_PPU + 2232
#define OFFSET_Window2Right 			_PPU + 2233
#define OFFSET_ClipWindowOverlapLogic 	_PPU + 2240
#define OFFSET_ClipWindow1Enable 		_PPU + 2246
#define OFFSET_ClipWindow2Enable 		_PPU + 2252
#define OFFSET_ClipWindow1Inside 		_PPU + 2258
#define OFFSET_ClipWindow2Inside 		_PPU + 2264
#define OFFSET_RecomputeClipWindows 	_PPU + 2270
#define OFFSET_CGFLIPRead 				_PPU + 2271
#define OFFSET_OBJNameSelect 			_PPU + 1684
#define OFFSET_Need16x8Mulitply 		_PPU + 2218
#define OFFSET_Joypad3ButtonReadPos 	_PPU + 2219
#define OFFSET_MouseSpeed 				_PPU + 2220
#define OFFSET_RangeTimeOver 			_PPU + 2829
#define OFFSET_ColorsChanged 			_IPPU + 4325
#define OFFSET_HDMA 					_IPPU + 4326
#define OFFSET_HDMAStarted 				_IPPU + 4327
#define OFFSET_MaxBrightness 			_IPPU + 4328
#define OFFSET_LatchedBlanking 			_IPPU + 4329
#define OFFSET_OBJChanged 				_IPPU + 4330
#define OFFSET_RenderThisFrame 			_IPPU + 4331
#define OFFSET_SkippedFrames 			_IPPU + 12
#define OFFSET_FrameSkip 				_IPPU + 16
#define OFFSET_TileCache 				_IPPU + 20
#define OFFSET_TileCached 				_IPPU + 32
#define OFFSET_FirstVRAMRead 			_IPPU + 4324
#define OFFSET_Interlace 				_IPPU + 4334
#define OFFSET_DoubleWidthPixels 		_IPPU + 4336
#define OFFSET_RenderedScreenHeight 	_IPPU + 44
#define OFFSET_RenderedScreenWidth 		_IPPU + 48
#define OFFSET_Red 						_IPPU + 52
#define OFFSET_Green 					_IPPU + 1076
#define OFFSET_Blue 					_IPPU + 2100
#define OFFSET_XB 						_IPPU + 3124
#define OFFSET_ScreenColors 			_IPPU + 3812
#define OFFSET_PreviousLine 			_IPPU + 3128
#define OFFSET_CurrentLine 				_IPPU + 3132
#define OFFSET_Joypads 					_IPPU + 3140
#define OFFSET_SuperScope 				_IPPU + 3160
#define OFFSET_Mouse 					_IPPU + 3164
#define OFFSET_PrevMouseX 				_IPPU + 3172
#define OFFSET_PrevMouseY 				_IPPU + 3180
#define OFFSET_Clip 					_IPPU + 3188
#define OFFSET_SA1Opcodes 				_SA1 + 8
#define OFFSET_SA1_Carry 				_SA1 + 32836
#define OFFSET_SA1_Zero 				_SA1 + 32837
#define OFFSET_SA1_Negative 			_SA1 + 32838
#define OFFSET_SA1_Overflow 			_SA1 + 32839
#define OFFSET_SA1CPUExecuting 			_SA1 + 32840
#define OFFSET_SA1ShiftedPB 			_SA1 + 12
#define OFFSET_SA1ShiftedDB 			_SA1 + 16
#define OFFSET_SA1Flags 				_SA1 + 20
#define OFFSET_SA1Executing 			_SA1 + 32841
#define OFFSET_SA1NMIActive 			_SA1 + 32842
#define OFFSET_SA1IRQActive 			_SA1 + 32843
#define OFFSET_SA1WaitingForInterrupt 	_SA1 + 32844
#define OFFSET_SA1PCS 					_SA1 + 24
#define OFFSET_SA1PCBase 				_SA1 + 28
#define OFFSET_SA1PCAtOpcodeStart 		_SA1 + 36
#define OFFSET_SA1WaitAddress 			_SA1 + 40
#define OFFSET_SA1WaitCounter 			_SA1 + 44
#define OFFSET_SA1WaitByteAddress1 		_SA1 + 48
#define OFFSET_SA1WaitByteAddress2 		_SA1 + 52
#define OFFSET_SA1BWRAM 				_SA1 + 32
#define OFFSET_SA1Map 					_SA1 + 56
#define OFFSET_SA1WriteMap 				_SA1 + 16440
#define OFFSET_SA1op1 					_SA1 + 32828
#define OFFSET_SA1op2 					_SA1 + 32830
#define OFFSET_SA1arithmetic_op 		_SA1 + 32824
#define OFFSET_SA1sum 					_SA1 + 0
#define OFFSET_SA1overflow 				_SA1 + 32832
#define OFFSET_VirtualBitmapFormat 		_SA1 + 32833
#define OFFSET_SA1_in_char_dma 			_SA1 + 32834
#define OFFSET_SA1variable_bit_pos 		_SA1 + 32835
#define OFFSET_SA1PB 					_SA1Registers + 0
#define OFFSET_SA1DB 					_SA1Registers + 1
#define OFFSET_SA1PP 					_SA1Registers + 2
#define OFFSET_SA1PL 					_SA1Registers + 2
#define OFFSET_SA1PH 					_SA1PL + 1
#define OFFSET_SA1AA 					_SA1Registers + 4
#define OFFSET_SA1AL 					_SA1Registers + 4
#define OFFSET_SA1AH 					_SA1AL + 1
#define OFFSET_SA1DD 					_SA1Registers + 6
#define OFFSET_SA1DL 					_SA1Registers + 6
#define OFFSET_SA1DH 					_SA1DL + 1
#define OFFSET_SA1SS 					_SA1Registers + 8
#define OFFSET_SA1SL 					_SA1Registers + 8
#define OFFSET_SA1SH 					_SA1SL + 1
#define OFFSET_SA1XX 					_SA1Registers + 10
#define OFFSET_SA1XL 					_SA1Registers + 10
#define OFFSET_SA1XH 					_SA1XL + 1
#define OFFSET_SA1YY 					_SA1Registers + 12
#define OFFSET_SA1YL 					_SA1Registers + 12
#define OFFSET_SA1YH 					_SA1YL + 1
#define OFFSET_SA1PCR 					_SA1Registers + 14

#endif
