pokered/ram/hram.asm

400 lines
7.3 KiB
NASM
Raw Normal View History

2020-07-07 01:13:17 +00:00
SECTION "HRAM", HRAM
2014-05-25 17:51:53 +00:00
; Initialized to 16.
; Decremented each input iteration if the player
; presses the reset sequence (A+B+SEL+START).
; Soft reset when 0 is reached.
2020-07-07 01:13:17 +00:00
hSoftReset:: db
2020-07-07 01:13:17 +00:00
UNION
hBaseTileID:: ; base tile ID to which offsets are added
hDexWeight::
hWarpDestinationMap::
hOAMTile::
hROMBankTemp::
hPreviousTileset::
hRLEByteValue::
db
2015-07-18 15:17:29 +00:00
2020-07-07 01:13:17 +00:00
hSpriteIndexOrTextID:: ; DisplayTextID's argument
hPartyMonIndex::
db
2015-07-24 03:48:35 +00:00
2020-07-07 01:13:17 +00:00
hVRAMSlot::
db
2015-07-18 15:17:29 +00:00
2020-07-07 01:13:17 +00:00
hFourTileSpriteCount::
hHalveItemPrices::
db
2015-07-18 15:17:29 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
hItemPrice:: ds 3 ; BCD number
2015-07-18 15:17:29 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
hSlideAmount:: db
2015-03-13 12:33:16 +00:00
2015-07-18 15:17:29 +00:00
; the total number of tiles being shifted each time the pic slides by one tile
2020-07-07 01:13:17 +00:00
hSlidingRegionSize:: db
2015-07-18 15:17:29 +00:00
; -1 = left
; 0 = right
2020-07-07 01:13:17 +00:00
hSlideDirection:: db
2020-07-07 01:13:17 +00:00
NEXTU
hSpriteInterlaceCounter::
hSpriteWidth:: db ; in tiles
hSpriteHeight:: db ; in tiles
hSpriteOffset:: db
2020-07-07 01:13:17 +00:00
NEXTU
; counters for blinking down arrow
hDownArrowBlinkCount1:: db
hDownArrowBlinkCount2:: db
NEXTU
hMapStride::
hEastWestConnectedMapWidth::
hNorthSouthConnectionStripWidth::
db
hMapWidth::
hNorthSouthConnectedMapWidth::
db
NEXTU
hSpriteDataOffset:: db
hSpriteIndex:: db
hSpriteImageIndex::
hSpriteFacingDirection::
hSpriteMovementByte2::
db
NEXTU
ds 2
hLoadSpriteTemp1:: db
hLoadSpriteTemp2:: db
NEXTU
ds 2
hEnemySpeed:: dw
ENDU
UNION
hSpriteOffset2:: db
hOAMBufferOffset:: db
hSpriteScreenX:: db
hSpriteScreenY:: db
NEXTU
hCollidingSpriteOffset:: db
hCollidingSpriteTempYValue:: db
hCollidingSpriteTempXValue:: db
hCollidingSpriteAdjustedDistance:: db
2020-07-07 01:13:17 +00:00
ENDU
hTilePlayerStandingOn:: db
hSpritePriority:: db
UNION
2020-11-05 21:55:39 +00:00
; Multiplication and division variables are meant
; to overlap for back-to-back usage. Big endian.
2020-07-07 01:13:17 +00:00
UNION
ds 1
hMultiplicand:: ds 3
hMultiplier:: db
ds 1
hMultiplyBuffer:: ds 4
NEXTU
hProduct:: ds 4
NEXTU
hDividend:: ds 4
hDivisor:: db
hDivideBuffer:: ds 5
NEXTU
hQuotient:: ds 4
hRemainder:: db
ENDU
NEXTU
; PrintNumber (big endian).
2020-07-07 01:13:17 +00:00
hPastLeadingZeros:: db ; last char printed
hNumToPrint:: ds 3
hPowerOf10:: ds 3
hSavedNumToPrint:: ds 3
NEXTU
hNPCMovementDirections2Index::
hNPCSpriteOffset::
2015-07-15 20:58:21 +00:00
; distance in steps between NPC and player
2020-07-07 01:13:17 +00:00
hNPCPlayerYDistance::
db
hNPCPlayerXDistance::
db
hFindPathNumSteps:: db
2015-07-15 20:58:21 +00:00
; bit 0: set when the end of the path's Y coordinate matches the target's
; bit 1: set when the end of the path's X coordinate matches the target's
; When both bits are set, the end of the path is at the target's position
; (i.e. the path has been found).
2020-07-07 01:13:17 +00:00
hFindPathFlags:: db
hFindPathYProgress:: db
hFindPathXProgress:: db
2015-07-15 20:58:21 +00:00
; 0 = from player to NPC
; 1 = from NPC to player
2020-07-07 01:13:17 +00:00
hNPCPlayerRelativePosPerspective:: db
ds 1
2015-07-15 20:58:21 +00:00
; bit 0:
; 0 = target is to the south or aligned
; 1 = target is to the north
; bit 1:
; 0 = target is to the east or aligned
; 1 = target is to the west
2020-07-07 01:13:17 +00:00
hNPCPlayerRelativePosFlags:: db
2015-07-17 08:21:40 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
hSwapItemID:: db
hSwapItemQuantity:: db
2015-02-07 10:43:08 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
hSignCoordPointer:: dw
2015-02-07 10:43:08 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
ds 1
hMutateWY:: db
hMutateWX:: db
2015-02-07 10:43:08 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
; temp value used when swapping bytes or words
hSwapTemp:: db
hExperience:: ds 3 ; big endian
ENDU
2015-02-07 10:43:08 +00:00
2020-07-07 01:13:17 +00:00
UNION
hMoney:: ds 3 ; BCD number
NEXTU
; some code zeroes this for no reason when writing a coin amount
hUnusedCoinsByte:: db
2023-11-22 15:12:40 +00:00
hCoins:: dw ; BCD number
2020-07-07 01:13:17 +00:00
ENDU
2014-08-09 05:39:13 +00:00
2020-07-07 01:13:17 +00:00
hDivideBCDDivisor::
hDivideBCDQuotient::
ds 3 ; BCD number
hDivideBCDBuffer::
ds 3 ; BCD number
2020-07-07 01:13:17 +00:00
ds 1
2015-08-09 05:32:44 +00:00
2020-07-07 01:13:17 +00:00
hSerialReceivedNewData:: db
; $01 = using external clock
; $02 = using internal clock
; $ff = establishing connection
hSerialConnectionStatus:: db
hSerialIgnoringInitialData:: db
hSerialSendData:: db
hSerialReceiveData:: db
; these values are copied to rSCX, rSCY, and rWY during V-blank
hSCX:: db
hSCY:: db
hWY:: db
hJoyLast:: db
hJoyReleased:: db
hJoyPressed:: db
hJoyHeld:: db
hJoy5:: db
hJoy6:: db
hJoy7:: db
hLoadedROMBank:: db
hSavedROMBank:: db
; is automatic background transfer during V-blank enabled?
; if nonzero, yes
; if zero, no
2020-07-07 01:13:17 +00:00
hAutoBGTransferEnabled:: db
; 00 = top third of background
; 01 = middle third of background
; 02 = bottom third of background
2020-07-07 01:13:17 +00:00
hAutoBGTransferPortion:: db
; the destination address of the automatic background transfer
2020-07-07 01:13:17 +00:00
hAutoBGTransferDest:: dw
2020-07-07 01:13:17 +00:00
hRedrawMapViewRowOffset:: db
; temporary storage for stack pointer during memory transfers that use pop
; to increase speed
2020-07-07 01:13:17 +00:00
hSPTemp:: dw
; source address for VBlankCopyBgMap function
; the first byte doubles as the byte that enabled the transfer.
; if it is 0, the transfer is disabled
; if it is not 0, the transfer is enabled
; this means that XX00 is not a valid source address
2020-07-07 01:13:17 +00:00
hVBlankCopyBGSource:: dw
; destination address for VBlankCopyBgMap function
2020-07-07 01:13:17 +00:00
hVBlankCopyBGDest:: dw
; number of rows for VBlankCopyBgMap to copy
2020-07-07 01:13:17 +00:00
hVBlankCopyBGNumRows:: db
; size of VBlankCopy transfer in 16-byte units
2020-07-07 01:13:17 +00:00
hVBlankCopySize:: db
; source address for VBlankCopy function
2020-07-07 01:13:17 +00:00
hVBlankCopySource:: dw
; destination address for VBlankCopy function
2020-07-07 01:13:17 +00:00
hVBlankCopyDest:: dw
; size of source data for VBlankCopyDouble in 8-byte units
2020-07-07 01:13:17 +00:00
hVBlankCopyDoubleSize:: db
; source address for VBlankCopyDouble function
2020-07-07 01:13:17 +00:00
hVBlankCopyDoubleSource:: dw
; destination address for VBlankCopyDouble function
2020-07-07 01:13:17 +00:00
hVBlankCopyDoubleDest:: dw
; controls whether a row or column of 2x2 tile blocks is redrawn in V-blank
; 00 = no redraw
; 01 = redraw column
; 02 = redraw row
2020-07-07 01:13:17 +00:00
hRedrawRowOrColumnMode:: db
2020-07-07 01:13:17 +00:00
hRedrawRowOrColumnDest:: dw
2020-07-07 01:13:17 +00:00
hRandomAdd:: db
hRandomSub:: db
2020-07-07 01:13:17 +00:00
hFrameCounter:: db ; decremented every V-blank (used for delays)
; V-blank sets this to 0 each time it runs.
; So, by setting it to a nonzero value and waiting for it to become 0 again,
; you can detect that the V-blank handler has run since then.
2020-07-07 01:13:17 +00:00
hVBlankOccurred:: db
; Controls which tiles are animated.
; 0 = no animations (breaks Surf)
; 1 = water tile $14 is animated
; 2 = water tile $14 and flower tile $03 are animated
hTileAnimations:: db
2014-09-14 18:29:18 +00:00
2020-07-07 01:13:17 +00:00
hMovingBGTilesCounter1:: db
2015-07-25 03:27:59 +00:00
2020-07-07 01:13:17 +00:00
ds 1
2020-07-07 01:13:17 +00:00
hCurrentSpriteOffset:: db ; multiple of $10
2015-07-24 21:57:49 +00:00
2020-07-07 01:13:17 +00:00
UNION
hPlayerFacing:: db
hPlayerYCoord:: db
hPlayerXCoord:: db
2015-07-26 02:26:54 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
2015-08-07 11:24:06 +00:00
; $00 = bag full
; $01 = got item
; $80 = didn't meet required number of owned mons
; $FF = player cancelled
2020-07-07 01:13:17 +00:00
hOaksAideResult::
hOaksAideRequirement:: ; required number of owned mons
db
hOaksAideRewardItem:: db
hOaksAideNumMonsOwned:: db
NEXTU
hVendingMachineItem:: db
hVendingMachinePrice:: ds 3 ; BCD number
NEXTU
hGymGateIndex:: db
hGymGateAnswer:: db
NEXTU
hDexRatingNumMonsSeen:: db
hDexRatingNumMonsOwned:: db
NEXTU
hItemToRemoveID:: db
hItemToRemoveIndex:: db
NEXTU
hItemCounter::
hSavedCoordIndex::
hMissableObjectIndex::
hGymTrashCanRandNumMask::
hInteractedWithBookshelf::
2020-07-07 01:13:17 +00:00
db
ENDU
ds 1
hBackupGymGateIndex::
hUnlockedSilphCoDoors::
db
2020-07-07 01:13:17 +00:00
; the first tile ID in a sequence of tile IDs that increase by 1 each step
hStartTileID:: db
2020-07-07 01:13:17 +00:00
ds 2
2020-07-07 01:13:17 +00:00
hNewPartyLength:: db
2015-07-24 03:48:35 +00:00
2020-07-07 01:13:17 +00:00
UNION
hDividend2:: db
hDivisor2:: db
hQuotient2:: db
2015-07-16 03:04:58 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
hIsHiddenMissableObject:: db
ENDU
2020-07-07 01:13:17 +00:00
hMapROMBank:: db
2015-07-15 20:58:21 +00:00
2020-07-07 01:13:17 +00:00
hSpriteVRAMSlotAndFacing:: db
2020-07-07 01:13:17 +00:00
hCoordsInFrontOfPlayerMatch::
hSpriteAnimFrameCounter::
db
2015-07-15 11:27:59 +00:00
2020-07-07 01:13:17 +00:00
UNION
hSpriteScreenYCoord:: db
hSpriteScreenXCoord:: db
hSpriteMapYCoord:: db
hSpriteMapXCoord:: db
2015-07-19 03:49:52 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
hItemAlreadyFound:: db
ds 2
hDidntFindAnyHiddenObject:: db
2015-07-15 11:27:59 +00:00
2020-07-07 01:13:17 +00:00
NEXTU
ds 1
hSavedMapTextPtr:: dw
ds 1
ENDU
2020-07-07 01:13:17 +00:00
ds 4
2020-07-07 01:13:17 +00:00
hWhoseTurn:: db ; 0 on player's turn, 1 on enemy's turn
2020-07-07 01:13:17 +00:00
hClearLetterPrintingDelayFlags:: db
2020-07-07 01:13:17 +00:00
ds 1
2015-02-08 00:24:16 +00:00
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
2015-02-08 02:37:40 +00:00
; bit 1: menu is double spaced
2021-02-14 00:48:34 +00:00
hUILayoutFlags:: db
2020-07-07 01:13:17 +00:00
hFieldMoveMonMenuTopMenuItemX:: db
2015-02-08 00:24:16 +00:00
2020-07-07 01:13:17 +00:00
hJoyInput:: db
2015-07-14 22:48:34 +00:00
2020-07-07 01:13:17 +00:00
hDisableJoypadPolling:: db
2015-08-12 09:16:56 +00:00
2020-07-07 01:13:17 +00:00
ds 5