SECTION "HRAM", HRAM

hOAMDMA::
	ds 10

hChecksum:: ds 3

hRTCHours:: db
hRTCMinutes:: db
hRTCSeconds:: db
hRTCDays:: db
	ds 2 ; TODO
hRTCStatusFlags:: db

	ds 2 ; TODO

hDebugMapViewerJumptable:: db

hVBlankCounter::
	db

hROMBank::
	db


hVBlank::
	db

hMapEntryMethod::
	db

hStartmenuCloseAndSelectHookEnable:: db

hStartmenuCloseAndSelectHookTemp:: db

hJoypadUp:: db
; Raw Joypad Up Event
; A pressed key was released
hJoypadDown:: db
; Raw Joypad Down Event
; An unpressed key was pressed
hJoypadState:: db
; Raw Joypad State
; State of all keys during current frame
hJoypadSum:: db
; Raw Joypad State Sum
; Sum of all keys that were pressed
; since hJoypadSum was last cleared

	ds 1; TODO
hJoyDown:: db
hJoyState:: db
hJoySum:: db

hInMenu:: db
; hJoySum will be updated from
; 00 - hJoyDown
; <> - hJoyState
; See GetJoypadDebounced

hJoypadState2:: db

UNION

hSeenTrainerDistance:: db
hSeenTrainerDirection:: db
hSeenTrainerObject:: db

NEXTU

hDebugMenuSoundMenuIndex:: db
hDebugMenuSoundID:: db
hDebugMenuSoundBank:: db

ENDU

	ds 3 ; TODO
hGraphicStartTile:: db
hMoveMon:: db

UNION

hTextBoxCursorBlinkInterval:: ds 2

NEXTU
hEventCollisionException:: db
hEventID:: db

NEXTU

hSpriteWidth::
hSpriteInterlaceCounter::
	db
hSpriteHeight::
	db

NEXTU

hItemPrice_Old:: ds 3

NEXTU

hConnectionStripLength:: db
hConnectedMapWidth:: db
hSpriteOffset:: db
NEXTU

hMapObjectIndex:: db
hObjectStructIndex:: db
hEnemyMonSpeed:: dw

NEXTU

hPokedexTempWeight:: dw

NEXTU

hTempCurBox:: db

ENDU

UNION

; hProduct: unchanged
; replace certain instances of hDividend with hQuotient
; 


; math-related values

UNION
; inputs to Multiply
	ds 1
hMultiplicand:: ds 3
hMultiplier::   db
NEXTU
; result of Multiply
hProduct::      ds 4
NEXTU
; inputs to Divide
hDividend::     ds 4
hDivisor::      db
NEXTU
; results of Divide
hQuotient::     ds 4
hRemainder::    db
ENDU

hMathBuffer::
	ds 5

NEXTU

hPrintNumLeadingDigit:: db ; digit one place-value up
hPrintNumDividend:: ds 3 ; big-endian
hPrintNumDivisor:: ds 3 ; big-endian
hPrintNumTemp:: ds 3 ; big-endian

NEXTU
	ds 1
hMutateWY:: db
hMutateWX:: db

ENDU

	ds 3 ; TODO

hFFC0:: ds 1

	ds 6

UNION
hUsedSpriteIndex:: db
hUsedSpriteTile:: db
hCurSpriteHorizTilesOccupied:: db
NEXTU
hCurSpriteXCoord:: db
hCurSpriteYCoord:: db
hCurSpriteXPixel:: db
hCurSpriteYPixel:: db
hCurSpriteTile:: db
hCurSpriteOAMFlags:: db
ENDU

hMoneyTemp:: ds 3

hLCDCPointer::
	db

hLYOverrideStart:: db
hLYOverrideEnd:: db
	ds 1 ; TODO


hSerialReceivedNewData:: db
hSerialConnectionStatus:: db
hSerialIgnoringInitialData:: db
hSerialSend:: db
hSerialReceive:: db


hSCX:: db
hSCY:: db
hWX:: db
hWY:: db

hOverworldFlashlightEffect:: db
; Influences draw distance of map around the player.
; Meant to go from 0 --> to desired distance
; or else graphical errors will occur.
; 0 - regular distance
; 1 - 14x14 tile block
; 2 - 10x10 tile block
; 3 -  6x 6 tile block
; 4 -  2x 2 tile block

hBGMapMode::
	db

hBGMapTransferPosition::
	db

hBGMapAddress::
	dw

hFFE2::
	db

hSPTemp::
	dw

hRedrawRowOrColumnMode:: db
; Used for redrawing BG in small updates
; instead of once completely for faster
; scrolling on overworld etc.
; Valid values:
; $00 - no redraw
; $01 - column redraw (move horizontally)
; $02 - row redraw    (move vertically)
; $03 - flashlight row redraw 0 (move up)
; $04 - flashlight row redraw 0 (move down)
; $05 - flashlight column redraw 0 (move left)
; $06 - flashlight column redraw 0 (move right)
; $07 - flashlight row redraw 1 (move up)
; $08 - flashlight row redraw 1 (move down)
; $09 - flashlight column redraw 1 (move left)
; $0A - flashlight column redraw 1 (move right)
; $0B - flashlight row redraw 2 (move up)
; $0C - flashlight row redraw 2 (move down)
; $0D - flashlight column redraw 2 (move left)
; $0E - flashlight column redraw 2 (move right)
; $0F - flashlight row redraw 3 (move up)
; $10 - flashlight row redraw 3 (move down)
; $11 - flashlight column redraw 3 (move left)
; $12 - flashlight column redraw 3 (move right)

hRedrawRowOrColumnDest:: ds 2

hMapAnims::
	db

hTileAnimFrame::
	db

hLastTalked::
	db

hFFEB:: db
hFFEC:: db
hFFED:: db

hFFEE::
	db

hRandomAdd:: db
hRandomSub:: db
hRTCRandom:: db

hBattleTurn:: db

hCurMapTextSubroutinePtr:: dw

	; TODO
