summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-06-01 22:53:56 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2021-06-01 22:56:09 -0400
commit0bb0c76abf63b8cf86874fab2621a65b6b293b94 (patch)
tree512c4204d012fd4e6d34455bf395a7245dad1565
parent7d4ec90538d297ebbfd65d82213d9c13c3527379 (diff)
parent9c93fb0b7559e9d657a91d2b508ecebe58eee544 (diff)
Merge remote-tracking branch 'remotes/pokered/master'
-rw-r--r--wram.asm305
1 files changed, 173 insertions, 132 deletions
diff --git a/wram.asm b/wram.asm
index c089f659..57f6b1d0 100644
--- a/wram.asm
+++ b/wram.asm
@@ -33,8 +33,10 @@ wChannelSoundIDs:: ds NUM_CHANNELS
wChannelFlags1:: ds NUM_CHANNELS
wChannelFlags2:: ds NUM_CHANNELS
+
wChannelDutyCycles:: ds NUM_CHANNELS
wChannelDutyCyclePatterns:: ds NUM_CHANNELS
+
; reloaded at the beginning of a note. counts down until the vibrato begins.
wChannelVibratoDelayCounters:: ds NUM_CHANNELS
wChannelVibratoExtents:: ds NUM_CHANNELS
@@ -44,6 +46,7 @@ wChannelVibratoRates:: ds NUM_CHANNELS
wChannelFrequencyLowBytes:: ds NUM_CHANNELS
; delay of the beginning of the vibrato from the start of the note
wChannelVibratoDelayCounterReloadValues:: ds NUM_CHANNELS
+
wChannelPitchSlideLengthModifiers:: ds NUM_CHANNELS
wChannelPitchSlideFrequencySteps:: ds NUM_CHANNELS
wChannelPitchSlideFrequencyStepsFractionalPart:: ds NUM_CHANNELS
@@ -52,12 +55,14 @@ wChannelPitchSlideCurrentFrequencyHighBytes:: ds NUM_CHANNELS
wChannelPitchSlideCurrentFrequencyLowBytes:: ds NUM_CHANNELS
wChannelPitchSlideTargetFrequencyHighBytes:: ds NUM_CHANNELS
wChannelPitchSlideTargetFrequencyLowBytes:: ds NUM_CHANNELS
+
; Note delays are stored as 16-bit fixed-point numbers where the integer part
; is 8 bits and the fractional part is 8 bits.
wChannelNoteDelayCounters:: ds NUM_CHANNELS
wChannelLoopCounters:: ds NUM_CHANNELS
wChannelNoteSpeeds:: ds NUM_CHANNELS
wChannelNoteDelayCountersFractionalPart:: ds NUM_CHANNELS
+
wChannelOctaves:: ds NUM_CHANNELS
; also includes fade for hardware channels that support it
wChannelVolumes:: ds NUM_CHANNELS
@@ -478,96 +483,86 @@ wNPCMovementScriptBank:: db
ds 2
+; This union spans 180 bytes.
UNION
-wVermilionDockTileMapBuffer:: ; ds 5 * BG_MAP_WIDTH + SCREEN_WIDTH
+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,
; 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
; flip back from the second frame.
-wMonPartySpritesSavedOAM:: ; ds $60
+wMonPartySpritesSavedOAM:: ds $60
-wTrainerCardBlkPacket:: ; ds $40
+NEXTU
+wTrainerCardBlkPacket:: ds $40
+
+NEXTU
+wHallOfFame:: ds HOF_TEAM
-wHallOfFame:: ; ds HOF_TEAM
+NEXTU
+wNPCMovementDirections:: ds 180
-wNPCMovementDirections:: ; ds $ff
+NEXTU
+wDexRatingNumMonsSeen:: db
+wDexRatingNumMonsOwned:: db
+wDexRatingText:: db
-wBoostExpByExpAll::
-; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
-wAnimationType::
+NEXTU
; 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.
; 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.
; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance.
-wSlotMachineSevenAndBarModeChance::
-wUnusedCC5B::
-wDexRatingNumMonsSeen:: db
-
-wDexRatingNumMonsOwned:: db
-
-wTrainerCardBadgeAttributes::
-wDexRatingText:: db
-
+wSlotMachineSevenAndBarModeChance:: db
+ ds 2
; ROM back to return to when the player is done with the slot machine
wSlotMachineSavedROMBank:: db
+ ds 166
+wLuckySlotHiddenObjectIndex:: db
- ds 26
-
+NEXTU
+; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
+wAnimationType:: db
+ ds 29
wAnimPalette:: db
- ds 29
+NEXTU
+ ds 60
+; temporary buffer when swapping party mon data
+wSwitchPartyMonTempBuffer:: ds 44 ; party_struct size
NEXTU
-wPikaPicUsedGFXCount:: db
-wPikaPicUsedGFX:: ds $10
-wPikaPicUsedGFXEnd::
+ ds 120
+; this is the end of the joypad states
+; the list starts above this address and extends downwards in memory until here
+; overloaded with below labels
+wSimulatedJoypadStatesEnd::
- ds 43
-ENDU
+NEXTU
+wBoostExpByExpAll::
+wUnusedCC5B:: db
+
+ ds 59
-UNION
wNPCMovementDirections2:: ds 10
; used in Pallet Town scripted movement
wNumStepsToTake:: db
-NEXTU
-; temporary buffer when swapping party mon data
-wSwitchPartyMonTempBuffer:: ds 44 ; party_struct size
-
-NEXTU
-wPikaPicAnimObjectDataBufferSize:: db
-
-wPikaPicAnimObjectDataBuffer::
-; 4 structs each of length 8
-; 0: buffer index
-; 1: script index
-; 2: frame index
-; 3: frame timer
-; 4: vtile offset
-; 5: x offset
-; 6: y offset
-; 7: unused
- ds 4 * 8
-wPikaPicAnimObjectDataBufferEnd::
-ENDU
-
- ds 15
+ ds 48
wRLEByteCount:: db
-; this is the end of the joypad states
-; the list starts above this address and extends downwards in memory until here
-; overloaded with below labels
-wSimulatedJoypadStatesEnd::
-
wParentMenuItem::
; 0 = not added
; 1 = added
@@ -652,20 +647,42 @@ wPlayerMonMinimized:: db
ds 13
-UNION
-wLuckySlotHiddenObjectIndex::
; number of hits by enemy in attacks like Double Slap, etc.
-wEnemyNumHits:: db
-
-NEXTU
-; the amount of damage accumulated by the enemy while biding (2 bytes)
+wEnemyNumHits:: ; db
+; the amount of damage accumulated by the enemy while biding
wEnemyBideAccumulatedDamage:: dw
-ENDU
ds 8
-wVermilionDockTileMapBufferEnd::
+NEXTU
+ ds 2
+wTrainerCardBadgeAttributes:: ds 6 * 9 + 1
+
+NEXTU
+wPikaPicUsedGFXCount:: db
+
+wPikaPicUsedGFX:: ds 8 * 2
+wPikaPicUsedGFXEnd::
+
+ ds 43
+
+wPikaPicAnimObjectDataBufferSize:: db
+
+wPikaPicAnimObjectDataBuffer::
+; 4 structs each of length 8
+; 0: buffer index
+; 1: script index
+; 2: frame index
+; 3: frame timer
+; 4: vtile offset
+; 5: x offset
+; 6: y offset
+; 7: unused
+ ds 4 * 8
+wPikaPicAnimObjectDataBufferEnd::
+ENDU
+; This union spans 39 bytes.
UNION
wInGameTradeGiveMonSpecies:: db
wInGameTradeTextPointerTablePointer:: dw
@@ -946,10 +963,6 @@ wBadgeOrFaceTiles:: ds NUM_BADGES + 1
wTempObtainedBadgesBooleans:: ds NUM_BADGES
NEXTU
-wTitleScreenScene:: db
-wTitleScreenTimer:: db
-
-NEXTU
wUnusedCD3D:: db
; the number of credits mons that have been displayed so far
wNumCreditsMonsDisplayed:: db
@@ -999,6 +1012,10 @@ wSwappedMenuItem::
wRodResponse::
wOptionsCursorLocation::
db
+
+NEXTU
+wTitleScreenScene:: db
+wTitleScreenTimer:: db
ENDU
; 0 = neither
@@ -1065,58 +1082,62 @@ wNormalMaxPPList:: ds NUM_MOVES
ds 5
ENDU
+UNION
; buffer for transferring the random number list generated by the other gameboy
-wSerialOtherGameboyRandomNumberListBlock:: ; ds $11
-
+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 20 * 18
+wTileMapBackup2:: ds SCREEN_WIDTH * SCREEN_HEIGHT
+ENDU
+; This union spans 30 bytes.
+UNION
; Temporary storage area
-wBuffer:: ; ds 30
+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
+NEXTU
+wEvoOldSpecies:: db
+wEvoNewSpecies:: db
+wEvoMonTileOffset:: db
+wEvoCancelled:: db
+NEXTU
+wNamingScreenNameLength:: db
; non-zero when the player has chosen to submit the name
-wNamingScreenSubmitName::
-wChangeMonPicPlayerTurnSpecies::
-wEvoNewSpecies::
- db
+wNamingScreenSubmitName:: db
+; 0 = upper case
+; 1 = lower case
+wAlphabetCase:: db
+ ds 1
+wNamingScreenLetter:: db
-UNION
+NEXTU
+wChangeMonPicEnemyTurnSpecies:: db
+wChangeMonPicPlayerTurnSpecies:: db
+
+NEXTU
+wHPBarMaxHP:: dw
wHPBarOldHP:: dw
wHPBarNewHP:: dw
wHPBarDelta:: db
wHPBarTempHP:: dw
ds 11
-wHPBarHPDifference:: db
+wHPBarHPDifference:: dw
NEXTU
-; 0 = upper case
-; 1 = lower case
-wAlphabetCase::
-wEvoMonTileOffset::
+; 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::
db
-wEvoCancelled:: db
-
-wNamingScreenLetter:: db
-ENDU
-
- ds 7
+ ds 27
; the item that the AI used
wAIItem:: db
-
wUsedItemOnWhichPokemon:: db
+ENDU
; sound ID during battle animations
wAnimSoundID:: db
@@ -1176,12 +1197,15 @@ wOnSGB:: db
wDefaultPaletteCommand:: db
-wPlayerHPBarColor:: ; dw
+UNION
+wPlayerHPBarColor:: dw
+NEXTU
; species of the mon whose palette is used for the whole screen
wWholeScreenPaletteMonSpecies:: db
wEnemyHPBarColor:: db
+ENDU
; 0: green
; 1: yellow
@@ -1197,23 +1221,25 @@ wWhichPartyMenuHPBar::
wPalPacket::
db
-wPartyMenuBlkPacket:: ; ds $30
-
- ds 9
-
-wPartyHPBarAttributes:: ds PARTY_LENGTH
-
- ds 14
+; This union spans 49 bytes.
+UNION
+wPartyMenuBlkPacket:: ds $30
+NEXTU
+ ds 29
; storage buffer for various strings
-wcf4b:: ; ds 20
+wcf4b:: ds 20
+NEXTU
+ ds 29
; the total amount of exp a mon gained
wExpAmountGained:: dw
-
wGainBoostedExp:: db
- ds 17
+NEXTU
+ ds 9
+wPartyHPBarAttributes:: ds PARTY_LENGTH
+ENDU
wGymCityName:: ds 17
@@ -1340,12 +1366,15 @@ wTrainerPicPointer:: dw
ds 1
-wTempMoveNameBuffer:: ; ds 14
+UNION
+wTempMoveNameBuffer:: ds 14
+NEXTU
; 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
wTrainerBaseMoney:: dw ; BCD
@@ -1467,27 +1496,30 @@ wEnemyDisabledMove:: db
ds 1
+UNION
; 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.
wPlayerNumHits:: db
+ENDU
- ds 3
+ ds 2
; non-zero when an item or move that allows escape from battle was used
wEscapedFromBattle:: db
-; BCD number
-wAmountMoneyWon:: ; ds 3
+UNION
+wAmountMoneyWon:: ds 3 ; BCD
+NEXTU
wObjectToHide:: db
-
wObjectToShow:: db
-
- ds 1
+ENDU
; the map you will start at when the debug bit is set
wDefaultMap::
@@ -1531,11 +1563,18 @@ wSaveFileStatus:: db
; number of tiles in current battle animation frame block
wNumFBTiles:: db
-wFlashScreenLongCounter::
-wSpiralBallsBaseY::
+UNION
+wSpiralBallsBaseY:: db
+wSpiralBallsBaseX:: db
+
+NEXTU
; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
; bit 7: direction; 0 = right, 1 = left
-wFallingObjectMovementByte::
+wFallingObjectMovementByte:: db
+wNumFallingObjects:: db
+
+NEXTU
+wFlashScreenLongCounter::
wNumShootingBalls::
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
wTradedMonMovingRight::
@@ -1546,8 +1585,6 @@ wCoordAdjustmentAmount::
wUnusedD08A::
db
-wSpiralBallsBaseX::
-wNumFallingObjects::
wSlideMonDelay::
; generic counter variable for various animations
wAnimCounter::
@@ -1558,13 +1595,11 @@ wAnimCounter::
; 04: reverse the subanimation
wSubAnimTransform::
db
+ENDU
wEndBattleWinTextPointer:: dw
-
wEndBattleLoseTextPointer:: dw
-
ds 2
-
wEndBattleTextRomBank:: db
ds 1
@@ -1572,16 +1607,19 @@ wEndBattleTextRomBank:: db
; the address _of the address_ of the current subanimation entry
wSubAnimAddrPtr:: dw
+UNION
; 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.
; 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
; or zero it.
wSlotMachineAllowMatchesCounter:: db
+ENDU
- ds 3
+ ds 2
wOutwardSpiralTileMapPointer:: db
@@ -1813,8 +1851,10 @@ wPrize3:: db
ds 1
-wSerialRandomNumberListBlock:: ; ds $11
+UNION
+wSerialRandomNumberListBlock:: ds $11
+NEXTU
wPrize1Price:: dw
wPrize2Price:: dw
wPrize3Price:: dw
@@ -1823,6 +1863,7 @@ wPrize3Price:: dw
; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
wLinkBattleRandomNumberList:: ds 10
+ENDU
wSerialPlayerDataBlock:: ; ds $1a8