aboutsummaryrefslogtreecommitdiffstats
path: root/ram
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
committerdannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
commita02a98ee7ada1a658e28698484058be2796dc0df (patch)
tree945986054565bd8b5212fc755415096050d1d3a8 /ram
parentUse long option flags for rgbgfx, same as tools/gfx (diff)
parentUse `const_skip` (diff)
downloadpokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.gz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.xz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'ram')
-rw-r--r--ram/hram.asm3
-rw-r--r--ram/wram.asm241
2 files changed, 76 insertions, 168 deletions
diff --git a/ram/hram.asm b/ram/hram.asm
index cddda407..8f6e03f0 100644
--- a/ram/hram.asm
+++ b/ram/hram.asm
@@ -16,7 +16,7 @@ hPreviousTileset::
hRLEByteValue::
db
-hSpriteIndexOrTextID:: ; DisplayTextID's argument
+hTextID:: ; DisplayTextID's argument
hPartyMonIndex::
db
@@ -397,6 +397,7 @@ hClearLetterPrintingDelayFlags:: db
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
; bit 1: menu is double spaced
+; bit 2: text is single spaced
hUILayoutFlags:: db
hFieldMoveMonMenuTopMenuItemX:: db
diff --git a/ram/wram.asm b/ram/wram.asm
index d7acee2c..a28d3c39 100644
--- a/ram/wram.asm
+++ b/ram/wram.asm
@@ -1,6 +1,6 @@
SECTION "Audio RAM", WRAM0
-wUnusedC000:: db
+wUnusedMusicByte:: db
wSoundID:: db
@@ -542,8 +542,8 @@ NEXTU
wSimulatedJoypadStatesEnd::
NEXTU
-wBoostExpByExpAll::
-wUnusedCC5B:: db
+wUnusedFlag::
+wBoostExpByExpAll:: db
ds 59
@@ -736,20 +736,17 @@ ENDU
ds 1
wNPCMovementDirections2Index::
-wUnusedCD37::
+wUnusedLinkMenuByte::
; number of items in wFilteredBagItems list
wFilteredBagItemsCount:: db
; the next simulated joypad state is at wSimulatedJoypadStatesEnd plus this value minus 1
; 0 if the joypad state is not being simulated
wSimulatedJoypadStatesIndex:: db
-
; written to but nothing ever reads it
-wUnusedCD39:: db
-
+wUnusedSimulatedJoypadStatesMask:: db
; written to but nothing ever reads it
-wUnusedCD3A:: db
-
+wUnusedOverrideSimulatedJoypadStatesIndex:: db
; mask indicating which real button presses can override simulated ones
; XXX is it ever not 0?
wOverrideSimulatedJoypadStatesMask:: db
@@ -955,7 +952,7 @@ wBadgeOrFaceTiles:: ds NUM_BADGES + 1
wTempObtainedBadgesBooleans:: ds NUM_BADGES
NEXTU
-wUnusedCD3D:: db
+wUnusedCreditsByte:: db
; the number of credits mons that have been displayed so far
wNumCreditsMonsDisplayed:: db
@@ -1027,12 +1024,7 @@ wLeftGBMonSpecies:: db
; in the trade animation, the mon that leaves the right gameboy
wRightGBMonSpecies:: db
-; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaneously)
-; bit 1: boulder dust animation (from using Strength) pending
-; bit 3: using generic PC
-; bit 5: don't play sound when A or B is pressed in menu
-; bit 6: tried pushing against boulder once (you need to push twice before it will move)
-wFlags_0xcd60:: db
+wMiscFlags:: db
ds 9
@@ -1058,16 +1050,29 @@ wDownscaledMonSize::
wNumMovesMinusOne:: db
UNION
-wcd6d:: ds NAME_BUFFER_LENGTH ; buffer for various data
+; storage buffer for various name strings
+wNameBuffer:: ds NAME_BUFFER_LENGTH
NEXTU
- ds 4
-; temp variable used to print a move's current PP on the status screen
+; data copied from Moves for one move
+wMoveData:: ds MOVE_LENGTH
+wPPUpCountAndMaxPP:: db
+
+NEXTU
+; amount of money made from one use of Pay Day
+wPayDayMoney:: ds 3
+
+NEXTU
+; evolution data for one mon
+wEvoDataBuffer:: ds 4 * 3 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
+
+NEXTU
+wBattleMenuCurrentPP:: db
+ ds 3
wStatusScreenCurrentPP:: db
ds 6
; list of normal max PP (without PP up) values
wNormalMaxPPList:: ds NUM_MOVES
- ds 5
ENDU
UNION
@@ -1146,7 +1151,7 @@ wBoughtOrSoldItemInMart:: db
; $02 - draw
wBattleResult:: db
-; bit 0: if set, DisplayTextID automatically draws a text box
+; bit 0: if set, prevents DisplayTextID from automatically drawing a text box
wAutoTextBoxDrawingControl:: db
; used in some overworld scripts to vary scripted movement
@@ -1241,11 +1246,14 @@ wItemList:: ds 16
wListPointer:: dw
; used to store pointers, but never read
-wUnusedCF8D:: dw
+wUnusedNamePointer:: dw
wItemPrices:: dw
-wcf91:: db ; used with a lot of things (too much to list here)
+wCurPartySpecies::
+wCurItem::
+wCurListMenuItem::
+ db
; which pokemon you selected
wWhichPokemon:: db
@@ -1422,38 +1430,15 @@ wMoveMissed:: db
; always 0
wPlayerStatsToDouble:: db
-
; always 0
wPlayerStatsToHalve:: db
-; bit 0 - bide
-; bit 1 - thrash / petal dance
-; bit 2 - attacking multiple times (e.g. double kick)
-; bit 3 - flinch
-; bit 4 - charging up for attack
-; bit 5 - using multi-turn move (e.g. wrap)
-; bit 6 - invulnerable to normal attack (using fly/dig)
-; bit 7 - confusion
wPlayerBattleStatus1:: db
-
-; bit 0 - X Accuracy effect
-; bit 1 - protected by "mist"
-; bit 2 - focus energy effect
-; bit 4 - has a substitute
-; bit 5 - need to recharge
-; bit 6 - rage
-; bit 7 - leech seeded
wPlayerBattleStatus2:: db
-
-; bit 0 - toxic
-; bit 1 - light screen
-; bit 2 - reflect
-; bit 3 - transformed
wPlayerBattleStatus3:: db
; always 0
wEnemyStatsToDouble:: db
-
; always 0
wEnemyStatsToHalve:: db
@@ -1573,7 +1558,7 @@ wOptionsInitialized::
wNewSlotMachineBallTile::
; how much to add to the X/Y coord
wCoordAdjustmentAmount::
-wUnusedD08A::
+wUnusedWaterDropletsByte::
db
wSlideMonDelay::
@@ -1618,7 +1603,7 @@ wPartyMenuAnimMonEnabled::
; non-zero when enabled. causes nest locations to blink on and off.
; the town selection cursor will blink regardless of what this value is
wTownMapSpriteBlinkingEnabled::
-wUnusedD09B:: db
+wUnusedMoveAnimByte:: db
; current destination address in OAM for frame blocks (big endian)
wFBDestAddr:: dw
@@ -1681,8 +1666,10 @@ wSpriteDecodeTable0Ptr:: dw
; pointer to differential decoding table (assuming initial value 1)
wSpriteDecodeTable1Ptr:: dw
-wd0b5:: db ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things
-
+; input for GetMonHeader
+wCurSpecies::
+; input for GetName
+wNameListIndex:: db
wNameListType:: db
wPredefBank:: db
@@ -1729,7 +1716,7 @@ wMoveNum:: db
wMovesString:: ds 56
-wUnusedD119:: db
+wUnusedCurMapTilesetCopy:: db
; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
wWalkBikeSurfStateCopy:: db
@@ -1747,19 +1734,22 @@ wCapturedMonSpecies:: db
; which will be the first mon sent out.
wFirstMonsNotOutYet:: db
-wPokeBallCaptureCalcTemp::
-; lower nybble: number of shakes
-; upper nybble: number of animations to play
-wPokeBallAnimData::
+wNamedObjectIndex::
+wTempByteValue::
+wNumSetBits::
+wTypeEffectiveness::
+wMoveType::
+wPokedexNum::
+wTempTMHM::
wUsingPPUp::
wMaxPP::
+wMoveGrammar::
; 0 for player, non-zero for enemy
wCalculateWhoseStats::
-wTypeEffectiveness::
-wMoveType::
-wNumSetBits::
-; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
-wd11e::
+wPokeBallCaptureCalcTemp::
+; lower nybble: number of shakes
+; upper nybble: number of animations to play
+wPokeBallAnimData::
db
; When this value is non-zero, the player isn't allowed to exit the party menu
@@ -1779,9 +1769,12 @@ wIsKeyItem:: db
wTextBoxID:: db
-wCurrentMapScriptFlags:: db ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value
+; bit 5: set when maps first load; can be reset to re-run a script
+; bit 6: set when maps first load; can be reset to re-run a script (used less often than bit 5)
+; bit 7: set when using an elevator map's menu; triggers the shaking animation
+wCurrentMapScriptFlags:: db
-wCurEnemyLVL:: db
+wCurEnemyLevel:: db
; pointer to list of items terminated by $FF
wItemListPointer:: dw
@@ -1827,7 +1820,7 @@ wSavedSpriteMapX:: db
wWhichPrize:: db
; counts downward each frame
-; when it hits 0, bit 5 (ignore input bit) of wd730 is reset
+; when it hits 0, BIT_DISABLE_JOYPAD of wStatusFlags5 is reset
wIgnoreInputCounter:: db
; counts down once every step
@@ -1864,7 +1857,7 @@ wSerialPlayerDataBlock:: ; ds $1a8
; that case, this would be ESCAPE_ROPE.
wPseudoItemID:: db
-wUnusedD153:: db
+wUnusedAlreadyOwnedFlag:: db
ds 2
@@ -1922,31 +1915,12 @@ wPlayerMoney:: ds 3 ; BCD
wRivalName:: ds NAME_LENGTH
-; bit 7 = battle animation
-; 0: On
-; 1: Off
-; bit 6 = battle style
-; 0: Shift
-; 1: Set
-; bits 5-4 = sound
-; 00: Mono
-; 01: Earphone1
-; 10: Earphone2
-; 11: Earphone3
-; bits 2-0 = text speed (number of frames to delay after printing a letter)
-; 1: Fast
-; 3: Medium
-; 5: Slow
wOptions:: db
wObtainedBadges:: flag_array NUM_BADGES
ds 1
-; bit 0: If 0, limit the delay to 1 frame. Note that this has no effect if
-; the delay has been disabled entirely through bit 1 of this variable
-; or bit 6 of wd730.
-; bit 1: If 0, no delay.
wLetterPrintingDelayFlags:: db
wPlayerID:: dw
@@ -1972,8 +1946,7 @@ wYBlockCoord:: db
wXBlockCoord:: db
wLastMap:: db
-
-wUnusedD366:: db
+wUnusedLastMapWidth:: db
wCurMapHeader::
wCurMapTileset:: db
@@ -2160,7 +2133,7 @@ wCurrentBoxNum:: db
; number of HOF teams
wNumHoFTeams:: db
-wUnusedD5A3:: db
+wUnusedMapVariable:: db
wPlayerCoins:: dw ; BCD
@@ -2347,7 +2320,8 @@ wLastBlackoutMap:: db
; destination map (for certain types of special warps, not ordinary walking)
wDestinationMap:: db
-wUnusedD71B:: db
+; initialized to $ff, but nothing ever reads it
+wUnusedPlayerDataByte:: db
; used to store the tile in front of the boulder when trying to push a boulder
; also used to store the result of the collision check ($ff for a collision and $00 for no collision)
@@ -2359,92 +2333,26 @@ wDungeonWarpDestinationMap:: db
; which dungeon warp within the source map was used
wWhichDungeonWarp:: db
-wUnusedD71F:: db
+wUnusedCardKeyGateID:: db
ds 8
-; bit 0: using Strength outside of battle
-; bit 1: set by IsSurfingAllowed when surfing's allowed, but the caller resets it after checking the result
-; bit 3: received Old Rod
-; bit 4: received Good Rod
-; bit 5: received Super Rod
-; bit 6: gave one of the Saffron guards a drink
-; bit 7: set by ItemUseCardKey, which is leftover code from a previous implementation of the Card Key
-wd728:: db
-
+wStatusFlags1:: db
ds 1
-
-; redundant because it matches wObtainedBadges
-; used to determine whether to show name on statue and in two NPC text scripts
-wBeatGymFlags:: db
-
+wBeatGymFlags:: db ; redundant because it matches wObtainedBadges
ds 1
-
-; bit 0: if not set, the 3 minimum steps between random battles have passed
-; bit 1: prevent audio fade out
-wd72c:: db
-
-; This variable is used for temporary flags and as the destination map when
-; warping to the Trade Center or Colosseum.
-; bit 0: sprite facing directions have been initialised in the Trade Center
-; bit 3: do scripted warp (used to warp back to Lavender Town from the top of the pokemon tower)
-; bit 4: on a dungeon warp
-; bit 5: don't make NPCs face the player when spoken to
-; Bits 6 and 7 are set by scripts when starting major battles in the storyline,
-; but they do not appear to affect anything. Bit 6 is reset after all battles
-; and bit 7 is reset after trainer battles (but it's only set before trainer
-; battles anyway).
-wd72d:: db
-
-; bit 0: the player has received Lapras in the Silph Co. building
-; bit 1: set in various places, but doesn't appear to have an effect
-; bit 2: the player has healed pokemon at a pokemon center at least once
-; bit 3: the player has a received a pokemon from Prof. Oak
-; bit 4: disable battles
-; bit 5: set when a battle ends and when the player blacks out in the overworld due to poison
-; bit 6: using the link feature
-; bit 7: set if scripted NPC movement has been initialised
-wd72e:: db
-
+wStatusFlags2:: db
+wCableClubDestinationMap::
+wStatusFlags3:: db
+wStatusFlags4:: db
ds 1
-
-; bit 0: NPC sprite being moved by script
-; bit 5: ignore joypad input
-; bit 6: print text with no delay between each letter
-; bit 7: set if joypad states are being simulated in the overworld or an NPC's movement is being scripted
-wd730:: db
-
+wStatusFlags5:: db
ds 1
-
-; bit 0: play time being counted
-; bit 1: debug mode (unused and incomplete in non-debug builds)
-; bit 2: the target warp is a fly warp (bit 3 set or blacked out) or a dungeon warp (bit 4 set)
-; bit 3: used warp pad, escape rope, dig, teleport, or fly, so the target warp is a "fly warp"
-; bit 4: jumped into hole (Pokemon Mansion, Seafoam Islands, Victory Road) or went down waterfall (Seafoam Islands), so the target warp is a "dungeon warp"
-; bit 5: currently being forced to ride bike (cycling road)
-; bit 6: map destination is [wLastBlackoutMap] (usually the last used pokemon center, but could be the player's house)
-wd732:: db
-
-; bit 0: running a test battle (unused in non-debug builds)
-; bit 1: prevent music from changing when entering new map
-; bit 2: skip the joypad check in CheckWarpsNoCollision (used for the forced warp down the waterfall in the Seafoam Islands)
-; bit 3: trainer wants to battle
-; bit 4: use variable [wCurMapScript] instead of the provided index for next frame's map script (used to start battle when talking to trainers)
-; bit 7: used fly out of battle
-wFlags_D733:: db
-
-; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby
-; the game uses this to tell when Elite 4 events need to be reset
-wBeatLorelei:: db
-
+wStatusFlags6:: db
+wStatusFlags7:: db
+wElite4Flags:: db
ds 1
-
-; bit 0: check if the player is standing on a door and make him walk down a step if so
-; bit 1: the player is currently stepping down from a door
-; bit 2: standing on a warp
-; bit 6: jumping down a ledge / fishing animation
-; bit 7: player sprite spinning due to spin tiles (Rocket hideout / Viridian Gym)
-wd736:: db
+wMovementFlags:: db
wCompletedInGameTradeFlags:: dw
@@ -2517,8 +2425,7 @@ wTrainerHeaderPtr:: dw
; the trainer the player must face after getting a wrong answer in the Cinnabar
; gym quiz
-wOpponentAfterWrongAnswer::
-wUnusedDA38:: db
+wOpponentAfterWrongAnswer:: db
; index of current map script, mostly used as index for function pointer array
; mostly copied from map-specific map script pointer and written back later