hram.asm 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. hSoftReset EQU $FF8A
  2. ; Initialized to 16.
  3. ; Decremented each input iteration if the player
  4. ; presses the reset sequence (A+B+SEL+START).
  5. ; Soft reset when 0 is reached.
  6. ; base tile ID to which offsets are added
  7. hBaseTileID EQU $FF8B
  8. ; 3-byte BCD number
  9. hItemPrice EQU $FF8B
  10. hDexWeight EQU $FF8B
  11. hWarpDestinationMap EQU $FF8B
  12. hOAMTile EQU $FF8B
  13. hROMBankTemp EQU $FF8B
  14. hPreviousTileset EQU $FF8B
  15. hEastWestConnectedMapWidth EQU $FF8B
  16. hSlideAmount EQU $FF8B
  17. hRLEByteValue EQU $FF8B
  18. H_SPRITEWIDTH EQU $FF8B ; in tiles
  19. H_SPRITEINTERLACECOUNTER EQU $FF8B
  20. H_SPRITEHEIGHT EQU $FF8C ; in tiles
  21. H_SPRITEOFFSET EQU $FF8D
  22. ; counters for blinking down arrow
  23. H_DOWNARROWBLINKCNT1 EQU $FF8B
  24. H_DOWNARROWBLINKCNT2 EQU $FF8C
  25. H_SPRITEDATAOFFSET EQU $FF8B
  26. H_SPRITEINDEX EQU $FF8C
  27. hMapStride EQU $FF8B
  28. hMapWidth EQU $FF8C
  29. hNorthSouthConnectionStripWidth EQU $FF8B
  30. hNorthSouthConnectedMapWidth EQU $FF8C
  31. ; DisplayTextID's argument
  32. hSpriteIndexOrTextID EQU $FF8C
  33. hPartyMonIndex EQU $FF8C
  34. ; the total number of tiles being shifted each time the pic slides by one tile
  35. hSlidingRegionSize EQU $FF8C
  36. ; 2 bytes
  37. hEnemySpeed EQU $FF8D
  38. hVRAMSlot EQU $FF8D
  39. hFourTileSpriteCount EQU $FF8E
  40. ; -1 = left
  41. ; 0 = right
  42. hSlideDirection EQU $FF8D
  43. hSpriteFacingDirection EQU $FF8D
  44. hSpriteMovementByte2 EQU $FF8D
  45. hSpriteImageIndex EQU $FF8D
  46. hLoadSpriteTemp1 EQU $FF8D
  47. hLoadSpriteTemp2 EQU $FF8E
  48. hHalveItemPrices EQU $FF8E
  49. hSpriteOffset2 EQU $FF8F
  50. hOAMBufferOffset EQU $FF90
  51. hSpriteScreenX EQU $FF91
  52. hSpriteScreenY EQU $FF92
  53. hTilePlayerStandingOn EQU $FF93
  54. hSpritePriority EQU $FF94
  55. ; 2 bytes
  56. hSignCoordPointer EQU $FF95
  57. hNPCMovementDirections2Index EQU $FF95
  58. ; CalcPositionOfPlayerRelativeToNPC
  59. hNPCSpriteOffset EQU $FF95
  60. ; temp value used when swapping bytes
  61. hSwapTemp EQU $FF95
  62. hExperience EQU $FF96 ; 3 bytes, big endian
  63. ; Multiplication and division variables are meant
  64. ; to overlap for back-to-back usage. Big endian.
  65. H_MULTIPLICAND EQU $FF96 ; 3 bytes
  66. H_MULTIPLIER EQU $FF99 ; 1 byte
  67. H_PRODUCT EQU $FF95 ; 4 bytes
  68. H_DIVIDEND EQU $FF95 ; 4 bytes
  69. H_DIVISOR EQU $FF99 ; 1 byte
  70. H_QUOTIENT EQU $FF95 ; 4 bytes
  71. H_REMAINDER EQU $FF99 ; 1 byte
  72. H_DIVIDEBUFFER EQU $FF9A
  73. H_MULTIPLYBUFFER EQU $FF9B
  74. ; PrintNumber (big endian).
  75. H_PASTLEADINGZEROES EQU $FF95 ; last char printed
  76. H_NUMTOPRINT EQU $FF96 ; 3 bytes
  77. H_POWEROFTEN EQU $FF99 ; 3 bytes
  78. H_SAVEDNUMTOPRINT EQU $FF9C ; 3 bytes
  79. ; distance in steps between NPC and player
  80. hNPCPlayerYDistance EQU $FF95
  81. hNPCPlayerXDistance EQU $FF96
  82. hFindPathNumSteps EQU $FF97
  83. ; bit 0: set when the end of the path's Y coordinate matches the target's
  84. ; bit 1: set when the end of the path's X coordinate matches the target's
  85. ; When both bits are set, the end of the path is at the target's position
  86. ; (i.e. the path has been found).
  87. hFindPathFlags EQU $FF98
  88. hFindPathYProgress EQU $FF99
  89. hFindPathXProgress EQU $FF9A
  90. ; 0 = from player to NPC
  91. ; 1 = from NPC to player
  92. hNPCPlayerRelativePosPerspective EQU $FF9B
  93. ; bit 0:
  94. ; 0 = target is to the south or aligned
  95. ; 1 = target is to the north
  96. ; bit 1:
  97. ; 0 = target is to the east or aligned
  98. ; 1 = target is to the west
  99. hNPCPlayerRelativePosFlags EQU $FF9D
  100. ; some code zeroes this for no reason when writing a coin amount
  101. hUnusedCoinsByte EQU $FF9F
  102. hMoney EQU $FF9F ; 3-byte BCD number
  103. hCoins EQU $FFA0 ; 2-byte BCD number
  104. hDivideBCDDivisor EQU $FFA2 ; 3-byte BCD number
  105. hDivideBCDQuotient EQU $FFA2 ; 3-byte BCD number
  106. hDivideBCDBuffer EQU $FFA5 ; 3-byte BCD number
  107. hSerialReceivedNewData EQU $FFA9
  108. ; $01 = using external clock
  109. ; $02 = using internal clock
  110. ; $ff = establishing connection
  111. hSerialConnectionStatus EQU $FFAA
  112. hSerialIgnoringInitialData EQU $FFAB
  113. hSerialSendData EQU $FFAC
  114. hSerialReceiveData EQU $FFAD
  115. ; these values are copied to SCX, SCY, and WY during V-blank
  116. hSCX EQU $FFAE
  117. hSCY EQU $FFAF
  118. hWY EQU $FFB0
  119. hJoyLast EQU $FFB1
  120. hJoyReleased EQU $FFB2
  121. hJoyPressed EQU $FFB3
  122. hJoyHeld EQU $FFB4
  123. hJoy5 EQU $FFB5
  124. hJoy6 EQU $FFB6
  125. hJoy7 EQU $FFB7
  126. H_LOADEDROMBANK EQU $FFB8
  127. hSavedROMBank EQU $FFB9
  128. ; is automatic background transfer during V-blank enabled?
  129. ; if nonzero, yes
  130. ; if zero, no
  131. H_AUTOBGTRANSFERENABLED EQU $FFBA
  132. TRANSFERTOP EQU 0
  133. TRANSFERMIDDLE EQU 1
  134. TRANSFERBOTTOM EQU 2
  135. ; 00 = top third of background
  136. ; 01 = middle third of background
  137. ; 02 = bottom third of background
  138. H_AUTOBGTRANSFERPORTION EQU $FFBB
  139. ; the destination address of the automatic background transfer
  140. H_AUTOBGTRANSFERDEST EQU $FFBC ; 2 bytes
  141. ; temporary storage for stack pointer during memory transfers that use pop
  142. ; to increase speed
  143. H_SPTEMP EQU $FFBF ; 2 bytes
  144. ; source address for VBlankCopyBgMap function
  145. ; the first byte doubles as the byte that enabled the transfer.
  146. ; if it is 0, the transfer is disabled
  147. ; if it is not 0, the transfer is enabled
  148. ; this means that XX00 is not a valid source address
  149. H_VBCOPYBGSRC EQU $FFC1 ; 2 bytes
  150. ; destination address for VBlankCopyBgMap function
  151. H_VBCOPYBGDEST EQU $FFC3 ; 2 bytes
  152. ; number of rows for VBlankCopyBgMap to copy
  153. H_VBCOPYBGNUMROWS EQU $FFC5
  154. ; size of VBlankCopy transfer in 16-byte units
  155. H_VBCOPYSIZE EQU $FFC6
  156. ; source address for VBlankCopy function
  157. H_VBCOPYSRC EQU $FFC7
  158. ; destination address for VBlankCopy function
  159. H_VBCOPYDEST EQU $FFC9
  160. ; size of source data for VBlankCopyDouble in 8-byte units
  161. H_VBCOPYDOUBLESIZE EQU $FFCB
  162. ; source address for VBlankCopyDouble function
  163. H_VBCOPYDOUBLESRC EQU $FFCC
  164. ; destination address for VBlankCopyDouble function
  165. H_VBCOPYDOUBLEDEST EQU $FFCE
  166. ; controls whether a row or column of 2x2 tile blocks is redrawn in V-blank
  167. ; 00 = no redraw
  168. ; 01 = redraw column
  169. ; 02 = redraw row
  170. hRedrawRowOrColumnMode EQU $FFD0
  171. REDRAW_COL EQU 1
  172. REDRAW_ROW EQU 2
  173. hRedrawRowOrColumnDest EQU $FFD1
  174. hRandomAdd EQU $FFD3
  175. hRandomSub EQU $FFD4
  176. H_FRAMECOUNTER EQU $FFD5 ; decremented every V-blank (used for delays)
  177. ; V-blank sets this to 0 each time it runs.
  178. ; So, by setting it to a nonzero value and waiting for it to become 0 again,
  179. ; you can detect that the V-blank handler has run since then.
  180. H_VBLANKOCCURRED EQU $FFD6
  181. ; 00 = indoor
  182. ; 01 = cave
  183. ; 02 = outdoor
  184. ; this is often set to 00 in order to turn off water and flower BG tile animations
  185. hTilesetType EQU $FFD7
  186. hMovingBGTilesCounter1 EQU $FFD8
  187. H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10
  188. hItemCounter EQU $FFDB
  189. hGymGateIndex EQU $FFDB
  190. hGymTrashCanRandNumMask EQU $FFDB
  191. hDexRatingNumMonsSeen EQU $FFDB
  192. hDexRatingNumMonsOwned EQU $FFDC
  193. ; $00 = bag full
  194. ; $01 = got item
  195. ; $80 = didn't meet required number of owned mons
  196. ; $FF = player cancelled
  197. hOaksAideResult EQU $FFDB
  198. hOaksAideRequirement EQU $FFDB ; required number of owned mons
  199. hOaksAideRewardItem EQU $FFDC
  200. hOaksAideNumMonsOwned EQU $FFDD
  201. hItemToRemoveID EQU $FFDB
  202. hItemToRemoveIndex EQU $FFDC
  203. hVendingMachineItem EQU $FFDB
  204. hVendingMachinePrice EQU $FFDC ; 3-byte BCD number
  205. ; the first tile ID in a sequence of tile IDs that increase by 1 each step
  206. hStartTileID EQU $FFE1
  207. hNewPartyLength EQU $FFE4
  208. hDividend2 EQU $FFE5
  209. hDivisor2 EQU $FFE6
  210. hQuotient2 EQU $FFE7
  211. hSpriteVRAMSlotAndFacing EQU $FFE9
  212. hCoordsInFrontOfPlayerMatch EQU $FFEA
  213. hSpriteAnimFrameCounter EQU $FFEA
  214. H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn
  215. ; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
  216. ; bit 1: menu is double spaced
  217. hFlags_0xFFF6 EQU $FFF6
  218. hFieldMoveMonMenuTopMenuItemX EQU $FFF7
  219. hDisableJoypadPolling EQU $FFF9
  220. hJoyInput EQU $FFF8