Use more UNIONs for overlapping WRAM labels

This commit is contained in:
Rangi 2021-06-01 20:39:05 -04:00
parent 229126d940
commit 9c93fb0b75

262
wram.asm
View file

@ -33,8 +33,10 @@ wChannelSoundIDs:: ds NUM_CHANNELS
wChannelFlags1:: ds NUM_CHANNELS wChannelFlags1:: ds NUM_CHANNELS
wChannelFlags2:: ds NUM_CHANNELS wChannelFlags2:: ds NUM_CHANNELS
wChannelDutyCycles:: ds NUM_CHANNELS wChannelDutyCycles:: ds NUM_CHANNELS
wChannelDutyCyclePatterns:: ds NUM_CHANNELS wChannelDutyCyclePatterns:: ds NUM_CHANNELS
; reloaded at the beginning of a note. counts down until the vibrato begins. ; reloaded at the beginning of a note. counts down until the vibrato begins.
wChannelVibratoDelayCounters:: ds NUM_CHANNELS wChannelVibratoDelayCounters:: ds NUM_CHANNELS
wChannelVibratoExtents:: ds NUM_CHANNELS wChannelVibratoExtents:: ds NUM_CHANNELS
@ -44,6 +46,7 @@ wChannelVibratoRates:: ds NUM_CHANNELS
wChannelFrequencyLowBytes:: ds NUM_CHANNELS wChannelFrequencyLowBytes:: ds NUM_CHANNELS
; delay of the beginning of the vibrato from the start of the note ; delay of the beginning of the vibrato from the start of the note
wChannelVibratoDelayCounterReloadValues:: ds NUM_CHANNELS wChannelVibratoDelayCounterReloadValues:: ds NUM_CHANNELS
wChannelPitchSlideLengthModifiers:: ds NUM_CHANNELS wChannelPitchSlideLengthModifiers:: ds NUM_CHANNELS
wChannelPitchSlideFrequencySteps:: ds NUM_CHANNELS wChannelPitchSlideFrequencySteps:: ds NUM_CHANNELS
wChannelPitchSlideFrequencyStepsFractionalPart:: ds NUM_CHANNELS wChannelPitchSlideFrequencyStepsFractionalPart:: ds NUM_CHANNELS
@ -52,12 +55,14 @@ wChannelPitchSlideCurrentFrequencyHighBytes:: ds NUM_CHANNELS
wChannelPitchSlideCurrentFrequencyLowBytes:: ds NUM_CHANNELS wChannelPitchSlideCurrentFrequencyLowBytes:: ds NUM_CHANNELS
wChannelPitchSlideTargetFrequencyHighBytes:: ds NUM_CHANNELS wChannelPitchSlideTargetFrequencyHighBytes:: ds NUM_CHANNELS
wChannelPitchSlideTargetFrequencyLowBytes:: ds NUM_CHANNELS wChannelPitchSlideTargetFrequencyLowBytes:: ds NUM_CHANNELS
; Note delays are stored as 16-bit fixed-point numbers where the integer part ; Note delays are stored as 16-bit fixed-point numbers where the integer part
; is 8 bits and the fractional part is 8 bits. ; is 8 bits and the fractional part is 8 bits.
wChannelNoteDelayCounters:: ds NUM_CHANNELS wChannelNoteDelayCounters:: ds NUM_CHANNELS
wChannelLoopCounters:: ds NUM_CHANNELS wChannelLoopCounters:: ds NUM_CHANNELS
wChannelNoteSpeeds:: ds NUM_CHANNELS wChannelNoteSpeeds:: ds NUM_CHANNELS
wChannelNoteDelayCountersFractionalPart:: ds NUM_CHANNELS wChannelNoteDelayCountersFractionalPart:: ds NUM_CHANNELS
wChannelOctaves:: ds NUM_CHANNELS wChannelOctaves:: ds NUM_CHANNELS
; also includes fade for hardware channels that support it ; also includes fade for hardware channels that support it
wChannelVolumes:: ds NUM_CHANNELS wChannelVolumes:: ds NUM_CHANNELS
@ -335,70 +340,86 @@ wNPCMovementScriptBank:: db
ds 2 ds 2
wVermilionDockTileMapBuffer:: ; ds 5 * BG_MAP_WIDTH + SCREEN_WIDTH ; This union spans 180 bytes.
UNION
wVermilionDockTileMapBuffer:: ds 5 * BG_MAP_WIDTH + SCREEN_WIDTH
wVermilionDockTileMapBufferEnd::
wOaksAideRewardItemName:: ; ds ITEM_NAME_LENGTH NEXTU
wOaksAideRewardItemName:: ds ITEM_NAME_LENGTH
wElevatorWarpMaps:: ; ds 11 * 2 NEXTU
wElevatorWarpMaps:: ds 11 * 2
NEXTU
; List of bag items that has been filtered to a certain type of items, ; List of bag items that has been filtered to a certain type of items,
; such as drinks or fossils. ; such as drinks or fossils.
wFilteredBagItems:: ; ds 3 + 1 wFilteredBagItems:: ds 4
NEXTU
; Saved copy of OAM for the first frame of the animation to make it easy to ; Saved copy of OAM for the first frame of the animation to make it easy to
; flip back from the second frame. ; flip back from the second frame.
wMonPartySpritesSavedOAM:: ; ds $60 wMonPartySpritesSavedOAM:: ds $60
wTrainerCardBlkPacket:: ; ds $40 NEXTU
wTrainerCardBlkPacket:: ds $40
wHallOfFame:: ; ds HOF_TEAM NEXTU
wHallOfFame:: ds HOF_TEAM
wNPCMovementDirections:: ; ds $ff NEXTU
wNPCMovementDirections:: ds 180
wBoostExpByExpAll:: NEXTU
; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon... wDexRatingNumMonsSeen:: db
wAnimationType:: wDexRatingNumMonsOwned:: db
wDexRatingText:: db
NEXTU
; If a random number greater than this value is generated, then the player is ; If a random number greater than this value is generated, then the player is
; allowed to have three 7 symbols or bar symbols line up. ; allowed to have three 7 symbols or bar symbols line up.
; So, this value is actually the chance of NOT entering that mode. ; So, this value is actually the chance of NOT entering that mode.
; If the slot is lucky, it equals 250, giving a 5/256 (~2%) chance. ; If the slot is lucky, it equals 250, giving a 5/256 (~2%) chance.
; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance. ; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance.
wSlotMachineSevenAndBarModeChance:: wSlotMachineSevenAndBarModeChance:: db
wUnusedCC5B:: ds 2
wDexRatingNumMonsSeen:: db
wDexRatingNumMonsOwned:: db
wDexRatingText:: db
; ROM back to return to when the player is done with the slot machine ; ROM back to return to when the player is done with the slot machine
wSlotMachineSavedROMBank:: db wSlotMachineSavedROMBank:: db
ds 166
ds 26 wLuckySlotHiddenObjectIndex:: db
wAnimPalette:: db
ds 29
UNION
wNPCMovementDirections2:: ds 10
; used in Pallet Town scripted movement
wNumStepsToTake:: db
NEXTU NEXTU
; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
wAnimationType:: db
ds 29
wAnimPalette:: db
NEXTU
ds 60
; temporary buffer when swapping party mon data ; temporary buffer when swapping party mon data
wSwitchPartyMonTempBuffer:: ds 44 ; party_struct size wSwitchPartyMonTempBuffer:: ds 44 ; party_struct size
ENDU
ds 15
wRLEByteCount:: db
NEXTU
ds 120
; this is the end of the joypad states ; this is the end of the joypad states
; the list starts above this address and extends downwards in memory until here ; the list starts above this address and extends downwards in memory until here
; overloaded with below labels ; overloaded with below labels
wSimulatedJoypadStatesEnd:: wSimulatedJoypadStatesEnd::
NEXTU
wBoostExpByExpAll::
wUnusedCC5B:: db
ds 59
wNPCMovementDirections2:: ds 10
; used in Pallet Town scripted movement
wNumStepsToTake:: db
ds 48
wRLEByteCount:: db
wParentMenuItem:: wParentMenuItem::
; 0 = not added ; 0 = not added
; 1 = added ; 1 = added
@ -483,20 +504,15 @@ wPlayerMonMinimized:: db
ds 13 ds 13
UNION
wLuckySlotHiddenObjectIndex::
; number of hits by enemy in attacks like Double Slap, etc. ; number of hits by enemy in attacks like Double Slap, etc.
wEnemyNumHits:: db wEnemyNumHits:: ; db
; the amount of damage accumulated by the enemy while biding
NEXTU
; the amount of damage accumulated by the enemy while biding (2 bytes)
wEnemyBideAccumulatedDamage:: dw wEnemyBideAccumulatedDamage:: dw
ENDU
ds 8 ds 8
ENDU
wVermilionDockTileMapBufferEnd:: ; This union spans 39 bytes.
UNION UNION
wInGameTradeGiveMonSpecies:: db wInGameTradeGiveMonSpecies:: db
wInGameTradeTextPointerTablePointer:: dw wInGameTradeTextPointerTablePointer:: dw
@ -891,58 +907,62 @@ wNormalMaxPPList:: ds NUM_MOVES
ds 5 ds 5
ENDU ENDU
; buffer for transferring the random number list generated by the other gameboy
wSerialOtherGameboyRandomNumberListBlock:: ; ds $11
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
wTileMapBackup2:: ds 20 * 18
; Temporary storage area
wBuffer:: ; ds 30
wNamingScreenNameLength::
wEvoOldSpecies::
; lower nybble is x, upper nybble is y
wTownMapCoords::
; whether WriteMonMoves is being used to make a mon learn moves from day care
; non-zero if so
wLearningMovesFromDayCare::
wChangeMonPicEnemyTurnSpecies::
wHPBarMaxHP::
db
; non-zero when the player has chosen to submit the name
wNamingScreenSubmitName::
wChangeMonPicPlayerTurnSpecies::
wEvoNewSpecies::
db
UNION UNION
; buffer for transferring the random number list generated by the other gameboy
wSerialOtherGameboyRandomNumberListBlock:: ds $11
NEXTU
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
wTileMapBackup2:: ds SCREEN_WIDTH * SCREEN_HEIGHT
ENDU
; This union spans 30 bytes.
UNION
; Temporary storage area
wBuffer:: ds 30
NEXTU
wEvoOldSpecies:: db
wEvoNewSpecies:: db
wEvoMonTileOffset:: db
wEvoCancelled:: db
NEXTU
wNamingScreenNameLength:: db
; non-zero when the player has chosen to submit the name
wNamingScreenSubmitName:: db
; 0 = upper case
; 1 = lower case
wAlphabetCase:: db
ds 1
wNamingScreenLetter:: db
NEXTU
wChangeMonPicEnemyTurnSpecies:: db
wChangeMonPicPlayerTurnSpecies:: db
NEXTU
wHPBarMaxHP:: dw
wHPBarOldHP:: dw wHPBarOldHP:: dw
wHPBarNewHP:: dw wHPBarNewHP:: dw
wHPBarDelta:: db wHPBarDelta:: db
wHPBarTempHP:: dw wHPBarTempHP:: dw
ds 11 ds 11
wHPBarHPDifference:: db wHPBarHPDifference:: dw
NEXTU NEXTU
; 0 = upper case ; lower nybble is x, upper nybble is y
; 1 = lower case wTownMapCoords::
wAlphabetCase:: ; whether WriteMonMoves is being used to make a mon learn moves from day care
wEvoMonTileOffset:: ; non-zero if so
wLearningMovesFromDayCare::
db db
wEvoCancelled:: db ds 27
wNamingScreenLetter:: db
ENDU
ds 7
; the item that the AI used ; the item that the AI used
wAIItem:: db wAIItem:: db
wUsedItemOnWhichPokemon:: db wUsedItemOnWhichPokemon:: db
ENDU
; sound ID during battle animations ; sound ID during battle animations
wAnimSoundID:: db wAnimSoundID:: db
@ -1004,12 +1024,15 @@ wOnSGB:: db
wDefaultPaletteCommand:: db wDefaultPaletteCommand:: db
wPlayerHPBarColor:: ; dw UNION
wPlayerHPBarColor:: dw
NEXTU
; species of the mon whose palette is used for the whole screen ; species of the mon whose palette is used for the whole screen
wWholeScreenPaletteMonSpecies:: db wWholeScreenPaletteMonSpecies:: db
wEnemyHPBarColor:: db wEnemyHPBarColor:: db
ENDU
; 0: green ; 0: green
; 1: yellow ; 1: yellow
@ -1025,19 +1048,21 @@ wWhichPartyMenuHPBar::
wPalPacket:: wPalPacket::
db db
wPartyMenuBlkPacket:: ; ds $30 ; This union spans 49 bytes.
UNION
wPartyMenuBlkPacket:: ds $30
NEXTU
ds 29 ds 29
; storage buffer for various strings ; storage buffer for various strings
wcf4b:: ; ds 20 wcf4b:: ds 20
NEXTU
ds 29
; the total amount of exp a mon gained ; the total amount of exp a mon gained
wExpAmountGained:: dw wExpAmountGained:: dw
wGainBoostedExp:: db wGainBoostedExp:: db
ENDU
ds 17
wGymCityName:: ds 17 wGymCityName:: ds 17
@ -1164,12 +1189,15 @@ wTrainerPicPointer:: dw
ds 1 ds 1
wTempMoveNameBuffer:: ; ds 14 UNION
wTempMoveNameBuffer:: ds 14
NEXTU
; The name of the mon that is learning a move. ; The name of the mon that is learning a move.
wLearnMoveMonName:: ; ds NAME_LENGTH wLearnMoveMonName:: ds NAME_LENGTH
ENDU
ds 16 ds 2
; money received after battle = base money × level of highest-level enemy mon ; money received after battle = base money × level of highest-level enemy mon
wTrainerBaseMoney:: dw ; BCD wTrainerBaseMoney:: dw ; BCD
@ -1291,27 +1319,30 @@ wEnemyDisabledMove:: db
ds 1 ds 1
UNION
; the amount of damage accumulated by the player while biding ; the amount of damage accumulated by the player while biding
wPlayerBideAccumulatedDamage:: ; dw wPlayerBideAccumulatedDamage:: dw
wUnknownSerialCounter2:: ; dw NEXTU
wUnknownSerialCounter2:: dw
NEXTU
; number of hits by player in attacks like Double Slap, etc. ; number of hits by player in attacks like Double Slap, etc.
wPlayerNumHits:: db wPlayerNumHits:: db
ENDU
ds 3 ds 2
; non-zero when an item or move that allows escape from battle was used ; non-zero when an item or move that allows escape from battle was used
wEscapedFromBattle:: db wEscapedFromBattle:: db
; BCD number UNION
wAmountMoneyWon:: ; ds 3 wAmountMoneyWon:: ds 3 ; BCD
NEXTU
wObjectToHide:: db wObjectToHide:: db
wObjectToShow:: db wObjectToShow:: db
ENDU
ds 1
; the map you will start at when the debug bit is set ; the map you will start at when the debug bit is set
wDefaultMap:: wDefaultMap::
@ -1355,11 +1386,18 @@ wSaveFileStatus:: db
; number of tiles in current battle animation frame block ; number of tiles in current battle animation frame block
wNumFBTiles:: db wNumFBTiles:: db
wFlashScreenLongCounter:: UNION
wSpiralBallsBaseY:: wSpiralBallsBaseY:: db
wSpiralBallsBaseX:: db
NEXTU
; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8) ; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
; bit 7: direction; 0 = right, 1 = left ; bit 7: direction; 0 = right, 1 = left
wFallingObjectMovementByte:: wFallingObjectMovementByte:: db
wNumFallingObjects:: db
NEXTU
wFlashScreenLongCounter::
wNumShootingBalls:: wNumShootingBalls::
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa ; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
wTradedMonMovingRight:: wTradedMonMovingRight::
@ -1370,8 +1408,6 @@ wCoordAdjustmentAmount::
wUnusedD08A:: wUnusedD08A::
db db
wSpiralBallsBaseX::
wNumFallingObjects::
wSlideMonDelay:: wSlideMonDelay::
; generic counter variable for various animations ; generic counter variable for various animations
wAnimCounter:: wAnimCounter::
@ -1382,13 +1418,11 @@ wAnimCounter::
; 04: reverse the subanimation ; 04: reverse the subanimation
wSubAnimTransform:: wSubAnimTransform::
db db
ENDU
wEndBattleWinTextPointer:: dw wEndBattleWinTextPointer:: dw
wEndBattleLoseTextPointer:: dw wEndBattleLoseTextPointer:: dw
ds 2 ds 2
wEndBattleTextRomBank:: db wEndBattleTextRomBank:: db
ds 1 ds 1
@ -1396,16 +1430,19 @@ wEndBattleTextRomBank:: db
; the address _of the address_ of the current subanimation entry ; the address _of the address_ of the current subanimation entry
wSubAnimAddrPtr:: dw wSubAnimAddrPtr:: dw
UNION
; the address of the current subentry of the current subanimation ; the address of the current subentry of the current subanimation
wSubAnimSubEntryAddr:: ; dw wSubAnimSubEntryAddr:: dw
NEXTU
; If non-zero, the allow matches flag is always set. ; If non-zero, the allow matches flag is always set.
; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is ; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is
; the only way it can increase. Winning certain payout amounts will decrement it ; the only way it can increase. Winning certain payout amounts will decrement it
; or zero it. ; or zero it.
wSlotMachineAllowMatchesCounter:: db wSlotMachineAllowMatchesCounter:: db
ENDU
ds 3 ds 2
wOutwardSpiralTileMapPointer:: db wOutwardSpiralTileMapPointer:: db
@ -1637,8 +1674,10 @@ wPrize3:: db
ds 1 ds 1
wSerialRandomNumberListBlock:: ; ds $11 UNION
wSerialRandomNumberListBlock:: ds $11
NEXTU
wPrize1Price:: dw wPrize1Price:: dw
wPrize2Price:: dw wPrize2Price:: dw
wPrize3Price:: dw wPrize3Price:: dw
@ -1647,6 +1686,7 @@ wPrize3Price:: dw
; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex ; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
wLinkBattleRandomNumberList:: ds 10 wLinkBattleRandomNumberList:: ds 10
ENDU
wSerialPlayerDataBlock:: ; ds $1a8 wSerialPlayerDataBlock:: ; ds $1a8