mirror of
https://github.com/pret/pokered.git
synced 2024-10-22 22:55:31 +00:00
Use labels for HRAM and VRAM
This commit is contained in:
parent
453bb5c38e
commit
dd08b8dd6b
7 changed files with 308 additions and 247 deletions
|
@ -2,9 +2,6 @@ INCLUDE "charmap.asm"
|
||||||
|
|
||||||
INCLUDE "macros.asm"
|
INCLUDE "macros.asm"
|
||||||
|
|
||||||
INCLUDE "hram.asm"
|
|
||||||
INCLUDE "vram.asm"
|
|
||||||
|
|
||||||
INCLUDE "constants/hardware_constants.asm"
|
INCLUDE "constants/hardware_constants.asm"
|
||||||
INCLUDE "constants/oam_constants.asm"
|
INCLUDE "constants/oam_constants.asm"
|
||||||
INCLUDE "constants/misc_constants.asm"
|
INCLUDE "constants/misc_constants.asm"
|
||||||
|
|
|
@ -20,3 +20,12 @@ SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE
|
||||||
HP_BAR_GREEN EQU 0
|
HP_BAR_GREEN EQU 0
|
||||||
HP_BAR_YELLOW EQU 1
|
HP_BAR_YELLOW EQU 1
|
||||||
HP_BAR_RED EQU 2
|
HP_BAR_RED EQU 2
|
||||||
|
|
||||||
|
; hAutoBGTransferEnabled
|
||||||
|
TRANSFERTOP EQU 0
|
||||||
|
TRANSFERMIDDLE EQU 1
|
||||||
|
TRANSFERBOTTOM EQU 2
|
||||||
|
|
||||||
|
; hRedrawRowOrColumnMode
|
||||||
|
REDRAW_COL EQU 1
|
||||||
|
REDRAW_ROW EQU 2
|
||||||
|
|
484
hram.asm
484
hram.asm
|
@ -1,370 +1,404 @@
|
||||||
hDMARoutine EQU $FF80
|
SECTION "HRAM", HRAM
|
||||||
|
|
||||||
|
hDMARoutine:: ds 10
|
||||||
|
|
||||||
hSoftReset EQU $FF8A
|
|
||||||
; Initialized to 16.
|
; Initialized to 16.
|
||||||
; Decremented each input iteration if the player
|
; Decremented each input iteration if the player
|
||||||
; presses the reset sequence (A+B+SEL+START).
|
; presses the reset sequence (A+B+SEL+START).
|
||||||
; Soft reset when 0 is reached.
|
; Soft reset when 0 is reached.
|
||||||
|
hSoftReset:: db
|
||||||
|
|
||||||
; base tile ID to which offsets are added
|
UNION
|
||||||
hBaseTileID EQU $FF8B
|
hBaseTileID:: ; base tile ID to which offsets are added
|
||||||
|
hDexWeight::
|
||||||
|
hWarpDestinationMap::
|
||||||
|
hOAMTile::
|
||||||
|
hROMBankTemp::
|
||||||
|
hPreviousTileset::
|
||||||
|
hRLEByteValue::
|
||||||
|
db
|
||||||
|
|
||||||
; 3-byte BCD number
|
hSpriteIndexOrTextID:: ; DisplayTextID's argument
|
||||||
hItemPrice EQU $FF8B
|
hPartyMonIndex::
|
||||||
|
db
|
||||||
|
|
||||||
hDexWeight EQU $FF8B
|
hVRAMSlot::
|
||||||
|
db
|
||||||
|
|
||||||
hWarpDestinationMap EQU $FF8B
|
hFourTileSpriteCount::
|
||||||
|
hHalveItemPrices::
|
||||||
|
db
|
||||||
|
|
||||||
hOAMTile EQU $FF8B
|
NEXTU
|
||||||
|
hItemPrice:: ds 3 ; BCD number
|
||||||
|
|
||||||
hROMBankTemp EQU $FF8B
|
NEXTU
|
||||||
|
hSlideAmount:: db
|
||||||
hPreviousTileset EQU $FF8B
|
|
||||||
|
|
||||||
hEastWestConnectedMapWidth EQU $FF8B
|
|
||||||
|
|
||||||
hSlideAmount EQU $FF8B
|
|
||||||
|
|
||||||
hRLEByteValue EQU $FF8B
|
|
||||||
|
|
||||||
hSpriteWidth EQU $FF8B ; in tiles
|
|
||||||
hSpriteInterlaceCounter EQU $FF8B
|
|
||||||
hSpriteHeight EQU $FF8C ; in tiles
|
|
||||||
hSpriteOffset EQU $FF8D
|
|
||||||
|
|
||||||
; counters for blinking down arrow
|
|
||||||
hDownArrowBlinkCount1 EQU $FF8B
|
|
||||||
hDownArrowBlinkCount2 EQU $FF8C
|
|
||||||
|
|
||||||
hSpriteDataOffset EQU $FF8B
|
|
||||||
hSpriteIndex EQU $FF8C
|
|
||||||
|
|
||||||
hMapStride EQU $FF8B
|
|
||||||
hMapWidth EQU $FF8C
|
|
||||||
|
|
||||||
hNorthSouthConnectionStripWidth EQU $FF8B
|
|
||||||
hNorthSouthConnectedMapWidth EQU $FF8C
|
|
||||||
|
|
||||||
; DisplayTextID's argument
|
|
||||||
hSpriteIndexOrTextID EQU $FF8C
|
|
||||||
|
|
||||||
hPartyMonIndex EQU $FF8C
|
|
||||||
|
|
||||||
; the total number of tiles being shifted each time the pic slides by one tile
|
; the total number of tiles being shifted each time the pic slides by one tile
|
||||||
hSlidingRegionSize EQU $FF8C
|
hSlidingRegionSize:: db
|
||||||
|
|
||||||
; 2 bytes
|
|
||||||
hEnemySpeed EQU $FF8D
|
|
||||||
|
|
||||||
hVRAMSlot EQU $FF8D
|
|
||||||
|
|
||||||
hFourTileSpriteCount EQU $FF8E
|
|
||||||
|
|
||||||
; -1 = left
|
; -1 = left
|
||||||
; 0 = right
|
; 0 = right
|
||||||
hSlideDirection EQU $FF8D
|
hSlideDirection:: db
|
||||||
|
|
||||||
hSpriteFacingDirection EQU $FF8D
|
NEXTU
|
||||||
|
hSpriteInterlaceCounter::
|
||||||
|
hSpriteWidth:: db ; in tiles
|
||||||
|
hSpriteHeight:: db ; in tiles
|
||||||
|
hSpriteOffset:: db
|
||||||
|
|
||||||
hSpriteMovementByte2 EQU $FF8D
|
NEXTU
|
||||||
|
; counters for blinking down arrow
|
||||||
|
hDownArrowBlinkCount1:: db
|
||||||
|
hDownArrowBlinkCount2:: db
|
||||||
|
|
||||||
hSpriteImageIndex EQU $FF8D
|
NEXTU
|
||||||
|
hMapStride::
|
||||||
|
hEastWestConnectedMapWidth::
|
||||||
|
hNorthSouthConnectionStripWidth::
|
||||||
|
db
|
||||||
|
hMapWidth::
|
||||||
|
hNorthSouthConnectedMapWidth::
|
||||||
|
db
|
||||||
|
|
||||||
hLoadSpriteTemp1 EQU $FF8D
|
NEXTU
|
||||||
hLoadSpriteTemp2 EQU $FF8E
|
hSpriteDataOffset:: db
|
||||||
|
hSpriteIndex:: db
|
||||||
|
hSpriteImageIndex::
|
||||||
|
hSpriteFacingDirection::
|
||||||
|
hSpriteMovementByte2::
|
||||||
|
db
|
||||||
|
|
||||||
hHalveItemPrices EQU $FF8E
|
NEXTU
|
||||||
|
ds 2
|
||||||
|
hLoadSpriteTemp1:: db
|
||||||
|
hLoadSpriteTemp2:: db
|
||||||
|
|
||||||
hSpriteOffset2 EQU $FF8F
|
NEXTU
|
||||||
|
ds 2
|
||||||
|
hEnemySpeed:: dw
|
||||||
|
ENDU
|
||||||
|
|
||||||
hOAMBufferOffset EQU $FF90
|
UNION
|
||||||
|
hSpriteOffset2:: db
|
||||||
|
hOAMBufferOffset:: db
|
||||||
|
hSpriteScreenX:: db
|
||||||
|
hSpriteScreenY:: db
|
||||||
|
|
||||||
hSpriteScreenX EQU $FF91
|
NEXTU
|
||||||
hSpriteScreenY EQU $FF92
|
hFF8F:: db
|
||||||
|
hFF90:: db
|
||||||
|
hFF91:: db
|
||||||
|
hFF92:: db
|
||||||
|
ENDU
|
||||||
|
|
||||||
hFF8F EQU $FF8F
|
hTilePlayerStandingOn:: db
|
||||||
hFF90 EQU $FF90
|
|
||||||
hFF91 EQU $FF91
|
|
||||||
hFF92 EQU $FF92
|
|
||||||
|
|
||||||
hTilePlayerStandingOn EQU $FF93
|
hSpritePriority:: db
|
||||||
|
|
||||||
hSpritePriority EQU $FF94
|
UNION
|
||||||
|
;; Multiplication and division variables are meant
|
||||||
; 2 bytes
|
;; to overlap for back-to-back usage. Big endian.
|
||||||
hSignCoordPointer EQU $FF95
|
UNION
|
||||||
|
ds 1
|
||||||
hNPCMovementDirections2Index EQU $FF95
|
hMultiplicand:: ds 3
|
||||||
|
hMultiplier:: db
|
||||||
hSwapItemID EQU $FF95
|
ds 1
|
||||||
hSwapItemQuantity EQU $FF96
|
hMultiplyBuffer:: ds 4
|
||||||
|
NEXTU
|
||||||
; CalcPositionOfPlayerRelativeToNPC
|
hProduct:: ds 4
|
||||||
hNPCSpriteOffset EQU $FF95
|
NEXTU
|
||||||
|
hDividend:: ds 4
|
||||||
; temp value used when swapping bytes or words
|
hDivisor:: db
|
||||||
hSwapTemp EQU $FF95
|
hDivideBuffer:: ds 5
|
||||||
|
NEXTU
|
||||||
hExperience EQU $FF96 ; 3 bytes, big endian
|
hQuotient:: ds 4
|
||||||
|
hRemainder:: db
|
||||||
hMutateWY EQU $FF96
|
ENDU
|
||||||
hMutateWX EQU $FF97
|
|
||||||
|
|
||||||
; Multiplication and division variables are meant
|
|
||||||
; to overlap for back-to-back usage. Big endian.
|
|
||||||
|
|
||||||
hMultiplicand EQU $FF96 ; 3 bytes
|
|
||||||
hMultiplier EQU $FF99 ; 1 byte
|
|
||||||
hProduct EQU $FF95 ; 4 bytes
|
|
||||||
|
|
||||||
hDividend EQU $FF95 ; 4 bytes
|
|
||||||
hDivisor EQU $FF99 ; 1 byte
|
|
||||||
hQuotient EQU $FF95 ; 4 bytes
|
|
||||||
hRemainder EQU $FF99 ; 1 byte
|
|
||||||
|
|
||||||
hDivideBuffer EQU $FF9A
|
|
||||||
|
|
||||||
hMultiplyBuffer EQU $FF9B
|
|
||||||
|
|
||||||
|
NEXTU
|
||||||
; PrintNumber (big endian).
|
; PrintNumber (big endian).
|
||||||
hPastLeadingZeros EQU $FF95 ; last char printed
|
hPastLeadingZeros:: db ; last char printed
|
||||||
hNumToPrint EQU $FF96 ; 3 bytes
|
hNumToPrint:: ds 3
|
||||||
hPowerOf10 EQU $FF99 ; 3 bytes
|
hPowerOf10:: ds 3
|
||||||
hSavedNumToPrint EQU $FF9C ; 3 bytes
|
hSavedNumToPrint:: ds 3
|
||||||
|
|
||||||
|
NEXTU
|
||||||
|
hNPCMovementDirections2Index::
|
||||||
|
hNPCSpriteOffset::
|
||||||
; distance in steps between NPC and player
|
; distance in steps between NPC and player
|
||||||
hNPCPlayerYDistance EQU $FF95
|
hNPCPlayerYDistance::
|
||||||
hNPCPlayerXDistance EQU $FF96
|
db
|
||||||
|
hNPCPlayerXDistance::
|
||||||
hFindPathNumSteps EQU $FF97
|
db
|
||||||
|
hFindPathNumSteps:: db
|
||||||
; bit 0: set when the end of the path's Y coordinate matches the target's
|
; 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
|
; 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
|
; When both bits are set, the end of the path is at the target's position
|
||||||
; (i.e. the path has been found).
|
; (i.e. the path has been found).
|
||||||
hFindPathFlags EQU $FF98
|
hFindPathFlags:: db
|
||||||
|
hFindPathYProgress:: db
|
||||||
hFindPathYProgress EQU $FF99
|
hFindPathXProgress:: db
|
||||||
hFindPathXProgress EQU $FF9A
|
|
||||||
|
|
||||||
; 0 = from player to NPC
|
; 0 = from player to NPC
|
||||||
; 1 = from NPC to player
|
; 1 = from NPC to player
|
||||||
hNPCPlayerRelativePosPerspective EQU $FF9B
|
hNPCPlayerRelativePosPerspective:: db
|
||||||
|
ds 1
|
||||||
; bit 0:
|
; bit 0:
|
||||||
; 0 = target is to the south or aligned
|
; 0 = target is to the south or aligned
|
||||||
; 1 = target is to the north
|
; 1 = target is to the north
|
||||||
; bit 1:
|
; bit 1:
|
||||||
; 0 = target is to the east or aligned
|
; 0 = target is to the east or aligned
|
||||||
; 1 = target is to the west
|
; 1 = target is to the west
|
||||||
hNPCPlayerRelativePosFlags EQU $FF9D
|
hNPCPlayerRelativePosFlags:: db
|
||||||
|
|
||||||
|
NEXTU
|
||||||
|
hSwapItemID:: db
|
||||||
|
hSwapItemQuantity:: db
|
||||||
|
|
||||||
|
NEXTU
|
||||||
|
hSignCoordPointer:: dw
|
||||||
|
|
||||||
|
NEXTU
|
||||||
|
ds 1
|
||||||
|
hMutateWY:: db
|
||||||
|
hMutateWX:: db
|
||||||
|
|
||||||
|
NEXTU
|
||||||
|
; temp value used when swapping bytes or words
|
||||||
|
hSwapTemp:: db
|
||||||
|
hExperience:: ds 3 ; big endian
|
||||||
|
ENDU
|
||||||
|
|
||||||
|
UNION
|
||||||
|
hMoney:: ds 3 ; BCD number
|
||||||
|
NEXTU
|
||||||
; some code zeroes this for no reason when writing a coin amount
|
; some code zeroes this for no reason when writing a coin amount
|
||||||
hUnusedCoinsByte EQU $FF9F
|
hUnusedCoinsByte:: db
|
||||||
|
hCoins:: ds 2 ; BCD number
|
||||||
|
ENDU
|
||||||
|
|
||||||
hMoney EQU $FF9F ; 3-byte BCD number
|
hDivideBCDDivisor::
|
||||||
hCoins EQU $FFA0 ; 2-byte BCD number
|
hDivideBCDQuotient::
|
||||||
|
ds 3 ; BCD number
|
||||||
|
hDivideBCDBuffer::
|
||||||
|
ds 3 ; BCD number
|
||||||
|
|
||||||
hDivideBCDDivisor EQU $FFA2 ; 3-byte BCD number
|
ds 1
|
||||||
hDivideBCDQuotient EQU $FFA2 ; 3-byte BCD number
|
|
||||||
hDivideBCDBuffer EQU $FFA5 ; 3-byte BCD number
|
|
||||||
|
|
||||||
hSerialReceivedNewData EQU $FFA9
|
|
||||||
|
|
||||||
|
hSerialReceivedNewData:: db
|
||||||
; $01 = using external clock
|
; $01 = using external clock
|
||||||
; $02 = using internal clock
|
; $02 = using internal clock
|
||||||
; $ff = establishing connection
|
; $ff = establishing connection
|
||||||
hSerialConnectionStatus EQU $FFAA
|
hSerialConnectionStatus:: db
|
||||||
|
hSerialIgnoringInitialData:: db
|
||||||
|
hSerialSendData:: db
|
||||||
|
hSerialReceiveData:: db
|
||||||
|
|
||||||
hSerialIgnoringInitialData EQU $FFAB
|
; these values are copied to rSCX, rSCY, and rWY during V-blank
|
||||||
|
hSCX:: db
|
||||||
|
hSCY:: db
|
||||||
|
hWY:: db
|
||||||
|
|
||||||
hSerialSendData EQU $FFAC
|
hJoyLast:: db
|
||||||
|
hJoyReleased:: db
|
||||||
|
hJoyPressed:: db
|
||||||
|
hJoyHeld:: db
|
||||||
|
hJoy5:: db
|
||||||
|
hJoy6:: db
|
||||||
|
hJoy7:: db
|
||||||
|
|
||||||
hSerialReceiveData EQU $FFAD
|
hLoadedROMBank:: db
|
||||||
|
hSavedROMBank:: db
|
||||||
; these values are copied to SCX, SCY, and WY during V-blank
|
|
||||||
hSCX EQU $FFAE
|
|
||||||
hSCY EQU $FFAF
|
|
||||||
hWY EQU $FFB0
|
|
||||||
|
|
||||||
hJoyLast EQU $FFB1
|
|
||||||
hJoyReleased EQU $FFB2
|
|
||||||
hJoyPressed EQU $FFB3
|
|
||||||
hJoyHeld EQU $FFB4
|
|
||||||
hJoy5 EQU $FFB5
|
|
||||||
hJoy6 EQU $FFB6
|
|
||||||
hJoy7 EQU $FFB7
|
|
||||||
|
|
||||||
hLoadedROMBank EQU $FFB8
|
|
||||||
|
|
||||||
hSavedROMBank EQU $FFB9
|
|
||||||
|
|
||||||
; is automatic background transfer during V-blank enabled?
|
; is automatic background transfer during V-blank enabled?
|
||||||
; if nonzero, yes
|
; if nonzero, yes
|
||||||
; if zero, no
|
; if zero, no
|
||||||
hAutoBGTransferEnabled EQU $FFBA
|
hAutoBGTransferEnabled:: db
|
||||||
|
|
||||||
TRANSFERTOP EQU 0
|
|
||||||
TRANSFERMIDDLE EQU 1
|
|
||||||
TRANSFERBOTTOM EQU 2
|
|
||||||
|
|
||||||
; 00 = top third of background
|
; 00 = top third of background
|
||||||
; 01 = middle third of background
|
; 01 = middle third of background
|
||||||
; 02 = bottom third of background
|
; 02 = bottom third of background
|
||||||
hAutoBGTransferPortion EQU $FFBB
|
hAutoBGTransferPortion:: db
|
||||||
|
|
||||||
; the destination address of the automatic background transfer
|
; the destination address of the automatic background transfer
|
||||||
hAutoBGTransferDest EQU $FFBC ; 2 bytes
|
hAutoBGTransferDest:: dw
|
||||||
|
|
||||||
hRedrawMapViewRowOffset EQU $FFBE
|
hRedrawMapViewRowOffset:: db
|
||||||
|
|
||||||
; temporary storage for stack pointer during memory transfers that use pop
|
; temporary storage for stack pointer during memory transfers that use pop
|
||||||
; to increase speed
|
; to increase speed
|
||||||
hSPTemp EQU $FFBF ; 2 bytes
|
hSPTemp:: dw
|
||||||
|
|
||||||
; source address for VBlankCopyBgMap function
|
; source address for VBlankCopyBgMap function
|
||||||
; the first byte doubles as the byte that enabled the transfer.
|
; the first byte doubles as the byte that enabled the transfer.
|
||||||
; if it is 0, the transfer is disabled
|
; if it is 0, the transfer is disabled
|
||||||
; if it is not 0, the transfer is enabled
|
; if it is not 0, the transfer is enabled
|
||||||
; this means that XX00 is not a valid source address
|
; this means that XX00 is not a valid source address
|
||||||
hVBlankCopyBGSource EQU $FFC1 ; 2 bytes
|
hVBlankCopyBGSource:: dw
|
||||||
|
|
||||||
; destination address for VBlankCopyBgMap function
|
; destination address for VBlankCopyBgMap function
|
||||||
hVBlankCopyBGDest EQU $FFC3 ; 2 bytes
|
hVBlankCopyBGDest:: dw
|
||||||
|
|
||||||
; number of rows for VBlankCopyBgMap to copy
|
; number of rows for VBlankCopyBgMap to copy
|
||||||
hVBlankCopyBGNumRows EQU $FFC5
|
hVBlankCopyBGNumRows:: db
|
||||||
|
|
||||||
; size of VBlankCopy transfer in 16-byte units
|
; size of VBlankCopy transfer in 16-byte units
|
||||||
hVBlankCopySize EQU $FFC6
|
hVBlankCopySize:: db
|
||||||
|
|
||||||
; source address for VBlankCopy function
|
; source address for VBlankCopy function
|
||||||
hVBlankCopySource EQU $FFC7
|
hVBlankCopySource:: dw
|
||||||
|
|
||||||
; destination address for VBlankCopy function
|
; destination address for VBlankCopy function
|
||||||
hVBlankCopyDest EQU $FFC9
|
hVBlankCopyDest:: dw
|
||||||
|
|
||||||
; size of source data for VBlankCopyDouble in 8-byte units
|
; size of source data for VBlankCopyDouble in 8-byte units
|
||||||
hVBlankCopyDoubleSize EQU $FFCB
|
hVBlankCopyDoubleSize:: db
|
||||||
|
|
||||||
; source address for VBlankCopyDouble function
|
; source address for VBlankCopyDouble function
|
||||||
hVBlankCopyDoubleSource EQU $FFCC
|
hVBlankCopyDoubleSource:: dw
|
||||||
|
|
||||||
; destination address for VBlankCopyDouble function
|
; destination address for VBlankCopyDouble function
|
||||||
hVBlankCopyDoubleDest EQU $FFCE
|
hVBlankCopyDoubleDest:: dw
|
||||||
|
|
||||||
; controls whether a row or column of 2x2 tile blocks is redrawn in V-blank
|
; controls whether a row or column of 2x2 tile blocks is redrawn in V-blank
|
||||||
; 00 = no redraw
|
; 00 = no redraw
|
||||||
; 01 = redraw column
|
; 01 = redraw column
|
||||||
; 02 = redraw row
|
; 02 = redraw row
|
||||||
hRedrawRowOrColumnMode EQU $FFD0
|
hRedrawRowOrColumnMode:: db
|
||||||
|
|
||||||
REDRAW_COL EQU 1
|
hRedrawRowOrColumnDest:: dw
|
||||||
REDRAW_ROW EQU 2
|
|
||||||
|
|
||||||
hRedrawRowOrColumnDest EQU $FFD1
|
hRandomAdd:: db
|
||||||
|
hRandomSub:: db
|
||||||
|
|
||||||
hRandomAdd EQU $FFD3
|
hFrameCounter:: db ; decremented every V-blank (used for delays)
|
||||||
hRandomSub EQU $FFD4
|
|
||||||
|
|
||||||
hFrameCounter EQU $FFD5 ; decremented every V-blank (used for delays)
|
|
||||||
|
|
||||||
; V-blank sets this to 0 each time it runs.
|
; 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,
|
; 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.
|
; you can detect that the V-blank handler has run since then.
|
||||||
hVBlankOccurred EQU $FFD6
|
hVBlankOccurred:: db
|
||||||
|
|
||||||
; 00 = indoor
|
; 00 = indoor
|
||||||
; 01 = cave
|
; 01 = cave
|
||||||
; 02 = outdoor
|
; 02 = outdoor
|
||||||
; this is often set to 00 in order to turn off water and flower BG tile animations
|
; this is often set to 00 in order to turn off water and flower BG tile animations
|
||||||
hTilesetType EQU $FFD7
|
hTilesetType:: db
|
||||||
|
|
||||||
hMovingBGTilesCounter1 EQU $FFD8
|
hMovingBGTilesCounter1:: db
|
||||||
|
|
||||||
hCurrentSpriteOffset EQU $FFDA ; multiple of $10
|
ds 1
|
||||||
|
|
||||||
hItemCounter EQU $FFDB
|
hCurrentSpriteOffset:: db ; multiple of $10
|
||||||
|
|
||||||
hGymGateIndex EQU $FFDB
|
UNION
|
||||||
hGymGateAnswer EQU $FFDC
|
hPlayerFacing:: db
|
||||||
|
hPlayerYCoord:: db
|
||||||
|
hPlayerXCoord:: db
|
||||||
|
|
||||||
hGymTrashCanRandNumMask EQU $FFDB
|
NEXTU
|
||||||
|
|
||||||
hDexRatingNumMonsSeen EQU $FFDB
|
|
||||||
hDexRatingNumMonsOwned EQU $FFDC
|
|
||||||
|
|
||||||
; $00 = bag full
|
; $00 = bag full
|
||||||
; $01 = got item
|
; $01 = got item
|
||||||
; $80 = didn't meet required number of owned mons
|
; $80 = didn't meet required number of owned mons
|
||||||
; $FF = player cancelled
|
; $FF = player cancelled
|
||||||
hOaksAideResult EQU $FFDB
|
hOaksAideResult::
|
||||||
|
hOaksAideRequirement:: ; required number of owned mons
|
||||||
|
db
|
||||||
|
hOaksAideRewardItem:: db
|
||||||
|
hOaksAideNumMonsOwned:: db
|
||||||
|
|
||||||
hSavedCoordIndex EQU $FFDB
|
NEXTU
|
||||||
|
hVendingMachineItem:: db
|
||||||
|
hVendingMachinePrice:: ds 3 ; BCD number
|
||||||
|
|
||||||
hOaksAideRequirement EQU $FFDB ; required number of owned mons
|
NEXTU
|
||||||
hOaksAideRewardItem EQU $FFDC
|
hGymGateIndex:: db
|
||||||
hOaksAideNumMonsOwned EQU $FFDD
|
hGymGateAnswer:: db
|
||||||
|
|
||||||
hPlayerFacing EQU $FFDB
|
NEXTU
|
||||||
hPlayerYCoord EQU $FFDC
|
hDexRatingNumMonsSeen:: db
|
||||||
hPlayerXCoord EQU $FFDD
|
hDexRatingNumMonsOwned:: db
|
||||||
|
|
||||||
hMissableObjectIndex EQU $FFDB
|
NEXTU
|
||||||
|
hItemToRemoveID:: db
|
||||||
|
hItemToRemoveIndex:: db
|
||||||
|
|
||||||
hItemToRemoveID EQU $FFDB
|
NEXTU
|
||||||
hItemToRemoveIndex EQU $FFDC
|
hItemCounter::
|
||||||
|
hSavedCoordIndex::
|
||||||
|
hMissableObjectIndex::
|
||||||
|
hGymTrashCanRandNumMask::
|
||||||
|
db
|
||||||
|
|
||||||
hVendingMachineItem EQU $FFDB
|
NEXTU
|
||||||
hVendingMachinePrice EQU $FFDC ; 3-byte BCD number
|
hFFDB:: db
|
||||||
|
hFFDC:: db
|
||||||
|
ENDU
|
||||||
|
|
||||||
hFFDB EQU $FFDB
|
ds 1
|
||||||
hFFDC EQU $FFDC
|
|
||||||
|
|
||||||
hBackupGymGateIndex EQU $FFE0
|
hBackupGymGateIndex::
|
||||||
|
hUnlockedSilphCoDoors::
|
||||||
hUnlockedSilphCoDoors EQU $FFE0
|
db
|
||||||
|
|
||||||
; the first tile ID in a sequence of tile IDs that increase by 1 each step
|
; the first tile ID in a sequence of tile IDs that increase by 1 each step
|
||||||
hStartTileID EQU $FFE1
|
hStartTileID:: db
|
||||||
|
|
||||||
hNewPartyLength EQU $FFE4
|
ds 2
|
||||||
|
|
||||||
hIsHiddenMissableObject EQU $FFE5
|
hNewPartyLength:: db
|
||||||
|
|
||||||
hDividend2 EQU $FFE5
|
UNION
|
||||||
hDivisor2 EQU $FFE6
|
hDividend2:: db
|
||||||
hQuotient2 EQU $FFE7
|
hDivisor2:: db
|
||||||
|
hQuotient2:: db
|
||||||
|
|
||||||
hMapROMBank EQU $FFE8
|
NEXTU
|
||||||
|
hIsHiddenMissableObject:: db
|
||||||
|
ENDU
|
||||||
|
|
||||||
hSpriteVRAMSlotAndFacing EQU $FFE9
|
hMapROMBank:: db
|
||||||
|
|
||||||
hCoordsInFrontOfPlayerMatch EQU $FFEA
|
hSpriteVRAMSlotAndFacing:: db
|
||||||
|
|
||||||
hSpriteAnimFrameCounter EQU $FFEA
|
hCoordsInFrontOfPlayerMatch::
|
||||||
|
hSpriteAnimFrameCounter::
|
||||||
|
db
|
||||||
|
|
||||||
hSpriteScreenYCoord EQU $FFEB
|
UNION
|
||||||
hSpriteScreenXCoord EQU $FFEC
|
hSpriteScreenYCoord:: db
|
||||||
hSpriteMapYCoord EQU $FFED
|
hSpriteScreenXCoord:: db
|
||||||
hSpriteMapXCoord EQU $FFEE
|
hSpriteMapYCoord:: db
|
||||||
|
hSpriteMapXCoord:: db
|
||||||
|
|
||||||
hItemAlreadyFound EQU $FFEB
|
NEXTU
|
||||||
hDidntFindAnyHiddenObject EQU $FFEE
|
hItemAlreadyFound:: db
|
||||||
|
ds 2
|
||||||
|
hDidntFindAnyHiddenObject:: db
|
||||||
|
|
||||||
hSavedMapTextPtr EQU $FFEC
|
NEXTU
|
||||||
|
ds 1
|
||||||
|
hSavedMapTextPtr:: dw
|
||||||
|
ds 1
|
||||||
|
ENDU
|
||||||
|
|
||||||
hWhoseTurn EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn
|
ds 4
|
||||||
|
|
||||||
hClearLetterPrintingDelayFlags EQU $FFF4
|
hWhoseTurn:: db ; 0 on player's turn, 1 on enemy's turn
|
||||||
|
|
||||||
|
hClearLetterPrintingDelayFlags:: db
|
||||||
|
|
||||||
|
ds 1
|
||||||
|
|
||||||
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
|
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
|
||||||
; bit 1: menu is double spaced
|
; bit 1: menu is double spaced
|
||||||
hFlagsFFF6 EQU $FFF6
|
hFlagsFFF6:: db
|
||||||
|
|
||||||
hFieldMoveMonMenuTopMenuItemX EQU $FFF7
|
hFieldMoveMonMenuTopMenuItemX:: db
|
||||||
|
|
||||||
hDisableJoypadPolling EQU $FFF9
|
hJoyInput:: db
|
||||||
|
|
||||||
hJoyInput EQU $FFF8
|
hDisableJoypadPolling:: db
|
||||||
|
|
||||||
|
ds 5
|
||||||
|
|
|
@ -228,6 +228,9 @@ WRAM0
|
||||||
org $dfff
|
org $dfff
|
||||||
"Stack"
|
"Stack"
|
||||||
|
|
||||||
|
VRAM
|
||||||
|
"VRAM"
|
||||||
|
|
||||||
SRAM $0
|
SRAM $0
|
||||||
"Sprite Buffers"
|
"Sprite Buffers"
|
||||||
|
|
||||||
|
@ -239,3 +242,6 @@ SRAM $2
|
||||||
|
|
||||||
SRAM $3
|
SRAM $3
|
||||||
"Saved Boxes 2"
|
"Saved Boxes 2"
|
||||||
|
|
||||||
|
HRAM
|
||||||
|
"HRAM"
|
||||||
|
|
|
@ -376,7 +376,7 @@ ENDM
|
||||||
|
|
||||||
FacilitySpinnerArrows:
|
FacilitySpinnerArrows:
|
||||||
FACILITY_SPINNER EQU $20 * $10
|
FACILITY_SPINNER EQU $20 * $10
|
||||||
vFacilitySpinner EQU vTileset + FACILITY_SPINNER
|
vFacilitySpinner EQUS "vTileset + FACILITY_SPINNER"
|
||||||
|
|
||||||
spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner
|
spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner
|
||||||
spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10
|
spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10
|
||||||
|
@ -389,7 +389,7 @@ vFacilitySpinner EQU vTileset + FACILITY_SPINNER
|
||||||
|
|
||||||
GymSpinnerArrows:
|
GymSpinnerArrows:
|
||||||
GYM_SPINNER EQU $3c * $10
|
GYM_SPINNER EQU $3c * $10
|
||||||
vGymSpinner EQU vTileset + GYM_SPINNER
|
vGymSpinner EQUS "vTileset + GYM_SPINNER"
|
||||||
|
|
||||||
spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner
|
spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner
|
||||||
spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10
|
spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10
|
||||||
|
|
44
vram.asm
44
vram.asm
|
@ -1,21 +1,31 @@
|
||||||
vChars0 EQU $8000
|
SECTION "VRAM", VRAM
|
||||||
vChars1 EQU $8800
|
|
||||||
vChars2 EQU $9000
|
|
||||||
vBGMap0 EQU $9800
|
|
||||||
vBGMap1 EQU $9c00
|
|
||||||
|
|
||||||
; Battle/Menu
|
UNION
|
||||||
vSprites EQU vChars0
|
; generic
|
||||||
vFont EQU vChars1
|
vChars0:: ds $800
|
||||||
vFrontPic EQU vChars2
|
vChars1:: ds $800
|
||||||
vBackPic EQU vFrontPic + 7 * 7 * $10
|
vChars2:: ds $800
|
||||||
|
vBGMap0:: ds $400
|
||||||
|
vBGMap1:: ds $400
|
||||||
|
|
||||||
; Overworld
|
NEXTU
|
||||||
vNPCSprites EQU vChars0
|
; battle/menu
|
||||||
vNPCSprites2 EQU vChars1
|
vSprites:: ds $800
|
||||||
vTileset EQU vChars2
|
vFont:: ds $800
|
||||||
|
vFrontPic:: ds 7 * 7 * $10
|
||||||
|
vBackPic:: ds 7 * 7 * $10
|
||||||
|
|
||||||
; Title
|
NEXTU
|
||||||
vTitleLogo EQU vChars1
|
; overworld
|
||||||
vTitleLogo2 EQU vFrontPic + 7 * 7 * $10
|
vNPCSprites:: ds $800
|
||||||
|
vNPCSprites2:: ds $800
|
||||||
|
vTileset:: ds $800
|
||||||
|
|
||||||
|
NEXTU
|
||||||
|
; title
|
||||||
|
ds $800
|
||||||
|
vTitleLogo:: ds $800
|
||||||
|
ds 7 * 7 * $10
|
||||||
|
vTitleLogo2:: ds $1e0
|
||||||
|
|
||||||
|
ENDU
|
||||||
|
|
5
wram.asm
5
wram.asm
|
@ -3,6 +3,9 @@ INCLUDE "constants.asm"
|
||||||
INCLUDE "macros/wram.asm"
|
INCLUDE "macros/wram.asm"
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDE "vram.asm"
|
||||||
|
|
||||||
|
|
||||||
SECTION "WRAM Bank 0", WRAM0
|
SECTION "WRAM Bank 0", WRAM0
|
||||||
|
|
||||||
wUnusedC000::
|
wUnusedC000::
|
||||||
|
@ -3112,3 +3115,5 @@ wStack::
|
||||||
|
|
||||||
|
|
||||||
INCLUDE "sram.asm"
|
INCLUDE "sram.asm"
|
||||||
|
|
||||||
|
INCLUDE "hram.asm"
|
||||||
|
|
Loading…
Reference in a new issue