diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-05-31 11:46:13 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-05-31 11:46:13 -0400 |
commit | 1e58df98af9d45fa4d75922a274840e441685a37 (patch) | |
tree | 6f3a014df309f49d2da566a751df20d5feb5b8ee | |
parent | b3eadb3508d97f48bda3f14c15378df24942719a (diff) |
Improve some RAM formatting
-rw-r--r-- | data/battle_anims/subanimations.asm | 2 | ||||
-rw-r--r-- | engine/battle/core.asm | 2 | ||||
-rw-r--r-- | engine/items/item_effects.asm | 2 | ||||
-rw-r--r-- | home/names2.asm | 6 | ||||
-rw-r--r-- | layout.link | 2 | ||||
-rw-r--r-- | macros/asserts.asm | 8 | ||||
-rw-r--r-- | macros/wram.asm | 83 | ||||
-rw-r--r-- | sram.asm | 27 | ||||
-rw-r--r-- | wram.asm | 1356 |
9 files changed, 538 insertions, 950 deletions
diff --git a/data/battle_anims/subanimations.asm b/data/battle_anims/subanimations.asm index 530192f6..54d346a6 100644 --- a/data/battle_anims/subanimations.asm +++ b/data/battle_anims/subanimations.asm @@ -92,7 +92,7 @@ SubanimationPointers: ; subanim type, count ; REPT count ; db frame block id, base coordinate id, frame block mode -; endr +; ENDR subanim: MACRO db (\1 << 5) | \2 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 45dfdc6f..48104833 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6491,6 +6491,8 @@ LoadPlayerBackPic: ld de, RedPicBack .next ld a, BANK(RedPicBack) + ASSERT BANK(RedPicBack) == BANK(OldManPicBack) + ASSERT BANK(RedPicBack) == BANK(ProfOakPicBack) call UncompressSpriteFromDE predef ScaleSpriteByTwo ld hl, wOAMBuffer diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index f73fe997..7a499e28 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -2900,7 +2900,7 @@ IsKeyItem_:: ld hl, KeyItemFlags ld de, wBuffer ld bc, 15 ; only 11 bytes are actually used - assert 15 >= (NUM_ITEMS + 7) / 8 + ASSERT 15 >= (NUM_ITEMS + 7) / 8 call CopyData pop af dec a diff --git a/home/names2.asm b/home/names2.asm index 73aabb1c..b0be05df 100644 --- a/home/names2.asm +++ b/home/names2.asm @@ -20,11 +20,11 @@ GetName:: ; TM names are separate from item names. ; BUG: This applies to all names instead of just items. - assert NUM_POKEMON_INDEXES < HM01, \ + ASSERT NUM_POKEMON_INDEXES < HM01, \ "A bug in GetName will get TM/HM names for Pokémon above ${x:HM01}." - assert NUM_ATTACKS < HM01, \ + ASSERT NUM_ATTACKS < HM01, \ "A bug in GetName will get TM/HM names for moves above ${x:HM01}." - assert NUM_TRAINERS < HM01, \ + ASSERT NUM_TRAINERS < HM01, \ "A bug in GetName will get TM/HM names for trainers above ${x:HM01}." cp HM01 jp nc, GetMachineName diff --git a/layout.link b/layout.link index 40b00dee..605425e0 100644 --- a/layout.link +++ b/layout.link @@ -234,7 +234,7 @@ WRAM0 "OAM Buffer" WRAMX $1 "WRAM Bank 1" - org $dfff + org $df15 "Stack" VRAM $0 "VRAM" diff --git a/macros/asserts.asm b/macros/asserts.asm index 3e0a7a8b..946add28 100644 --- a/macros/asserts.asm +++ b/macros/asserts.asm @@ -118,10 +118,10 @@ ENDM end_grass_wildmons: MACRO IF CURRENT_GRASS_WILDMONS_RATE == 0 - assert 1 == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ + ASSERT 1 == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ "def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected 1 byte" ELSE - assert WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ + ASSERT WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ "def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes" ENDC ENDM @@ -136,10 +136,10 @@ ENDM end_water_wildmons: MACRO IF CURRENT_WATER_WILDMONS_RATE == 0 - assert 1 == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ + ASSERT 1 == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ "def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected 1 byte" ELSE - assert WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ + ASSERT WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ "def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes" ENDC ENDM diff --git a/macros/wram.asm b/macros/wram.asm index 10163692..6f463db9 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -61,19 +61,19 @@ battle_struct: MACRO ENDM spritestatedata1: MACRO -\1PictureID:: db -\1MovementStatus:: db -\1ImageIndex:: db -\1YStepVector:: db -\1YPixels:: db -\1XStepVector:: db -\1XPixels:: db +\1PictureID:: db +\1MovementStatus:: db +\1ImageIndex:: db +\1YStepVector:: db +\1YPixels:: db +\1XStepVector:: db +\1XPixels:: db \1IntraAnimFrameCounter:: db -\1AnimFrameCounter:: db -\1FacingDirection:: db -\1YAdjusted:: db -\1XAdjusted:: db -\1CollisionData:: db +\1AnimFrameCounter:: db +\1FacingDirection:: db +\1YAdjusted:: db +\1XAdjusted:: db +\1CollisionData:: db ds 3 \1End:: ENDM @@ -81,37 +81,44 @@ ENDM spritestatedata2: MACRO \1WalkAnimationCounter:: db ds 1 -\1YDisplacement:: db -\1XDisplacement:: db -\1MapY:: db -\1MapX:: db -\1MovementByte1:: db -\1GrassPriority:: db -\1MovementDelay:: db -\1OrigFacingDirection:: db +\1YDisplacement:: db +\1XDisplacement:: db +\1MapY:: db +\1MapX:: db +\1MovementByte1:: db +\1GrassPriority:: db +\1MovementDelay:: db +\1OrigFacingDirection:: db ds 3 -\1PictureID:: db -\1ImageBaseOffset:: db +\1PictureID:: db +\1ImageBaseOffset:: db ds 1 \1End:: ENDM +sprite_oam_struct: MACRO +\1YCoord:: db +\1XCoord:: db +\1TileID:: db +\1Attributes:: db +ENDM + animated_object: MACRO -\1Index:: db ; 0 -\1FramesetID:: db ; 1 -\1AnimSeqID:: db ; 2 -\1TileID:: db ; 3 -\1XCoord:: db ; 4 -\1YCoord:: db ; 5 -\1XOffset:: db ; 6 -\1YOffset:: db ; 7 -\1Duration:: db ; 8 -\1DurationOffset:: db ; 9 -\1FrameIndex:: db ; a -\1FieldB:: db ; b -\1FieldC:: db ; c -\1FieldD:: db ; d -\1FieldE:: db ; e -\1FieldF:: db ; f +\1Index:: db +\1FramesetID:: db +\1AnimSeqID:: db +\1TileID:: db +\1XCoord:: db +\1YCoord:: db +\1XOffset:: db +\1YOffset:: db +\1Duration:: db +\1DurationOffset:: db +\1FrameIndex:: db +\1FieldB:: db +\1FieldC:: db +\1FieldD:: db +\1FieldE:: db +\1FieldF:: db \1End:: ENDM @@ -1,4 +1,4 @@ -SECTION "Sprite Buffers", SRAM ; BANK 0 +SECTION "Sprite Buffers", SRAM sSpriteBuffer0:: ds SPRITEBUFFERSIZE sSpriteBuffer1:: ds SPRITEBUFFERSIZE @@ -9,40 +9,41 @@ sSpriteBuffer2:: ds SPRITEBUFFERSIZE sHallOfFame:: ds HOF_TEAM * HOF_TEAM_CAPACITY -SECTION "Save Data", SRAM ; BANK 1 +SECTION "Save Data", SRAM + ds $598 sPlayerName:: ds NAME_LENGTH -sMainData:: ds wMainDataEnd - wMainDataStart +sMainData:: ds wMainDataEnd - wMainDataStart sSpriteData:: ds wSpriteDataEnd - wSpriteDataStart -sPartyData:: ds wPartyDataEnd - wPartyDataStart -sCurBoxData:: ds wBoxDataEnd - wBoxDataStart -sTileAnimations:: ds 1 -sMainDataCheckSum:: ds 1 +sPartyData:: ds wPartyDataEnd - wPartyDataStart +sCurBoxData:: ds wBoxDataEnd - wBoxDataStart +sTileAnimations:: db +sMainDataCheckSum:: db ; The PC boxes will not fit into one SRAM bank, ; so they use multiple SECTIONs box_n = 0 boxes: MACRO -rept \1 +REPT \1 box_n = box_n + 1 sBox{d:box_n}:: ds wBoxDataEnd - wBoxDataStart -endr +ENDR ENDM -SECTION "Saved Boxes 1", SRAM ; BANK 2 +SECTION "Saved Boxes 1", SRAM ; sBox1 - sBox6 boxes 6 -sBank2AllBoxesChecksum:: ds 1 +sBank2AllBoxesChecksum:: db sBank2IndividualBoxChecksums:: ds 6 -SECTION "Saved Boxes 2", SRAM ; BANK 3 +SECTION "Saved Boxes 2", SRAM ; sBox7 - sBox12 boxes 6 -sBank3AllBoxesChecksum:: ds 1 +sBank3AllBoxesChecksum:: db sBank3IndividualBoxChecksums:: ds 6 ; All 12 boxes fit within 2 SRAM banks @@ -8,11 +8,9 @@ INCLUDE "vram.asm" SECTION "WRAM", WRAM0 -wUnusedC000:: - ds 1 +wUnusedC000:: db -wSoundID:: - ds 1 +wSoundID:: db wMuteAudioAndPauseMusic:: ; bit 7: whether sound has been muted @@ -23,14 +21,11 @@ wMuteAudioAndPauseMusic:: ; Store 0 to resume music. ds 1 -wDisableChannelOutputWhenSfxEnds:: - ds 1 +wDisableChannelOutputWhenSfxEnds:: db -wStereoPanning:: - ds 1 +wStereoPanning:: db -wSavedVolume:: - ds 1 +wSavedVolume:: db wChannelCommandPointers:: ds 16 @@ -117,35 +112,25 @@ wChannelVolumes:: ; also includes fade for hardware channels that support it ds 8 -wMusicWaveInstrument:: - ds 1 +wMusicWaveInstrument:: db -wSfxWaveInstrument:: - ds 1 +wSfxWaveInstrument:: db -wMusicTempo:: - ds 2 +wMusicTempo:: dw -wSfxTempo:: - ds 2 +wSfxTempo:: dw -wSfxHeaderPointer:: - ds 2 +wSfxHeaderPointer:: dw -wNewSoundID:: - ds 1 +wNewSoundID:: db -wAudioROMBank:: - ds 1 +wAudioROMBank:: db -wAudioSavedROMBank:: - ds 1 +wAudioSavedROMBank:: db -wFrequencyModifier:: - ds 1 +wFrequencyModifier:: db -wTempoModifier:: - ds 1 +wTempoModifier:: db wc0f3:: ds 1 wc0f4:: ds 1 @@ -179,9 +164,9 @@ wSpriteStateData1:: ; - F wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1 ; player is struct 0 ; wSprite02StateData1 - wSprite15StateData1 -for n, 1, NUM_SPRITESTATEDATA_STRUCTS - 1 +FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS - 1 wSprite{02d:n}StateData1:: spritestatedata1 wSprite{02d:n}StateData1 -endr +ENDR wSpritePikachuStateData1:: spritestatedata1 wSpritePikachuStateData1 ; pikachu is struct 15 wSpriteStateData2:: @@ -207,15 +192,15 @@ wSpriteStateData2:: ; - F wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2 ; player is struct 0 ; wSprite02StateData2 - wSprite15StateData2 -for n, 1, NUM_SPRITESTATEDATA_STRUCTS - 1 +FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS - 1 wSprite{02d:n}StateData2:: spritestatedata2 wSprite{02d:n}StateData2 -endr +ENDR wSpritePikachuStateData2:: spritestatedata2 wSpritePikachuStateData2 ; pikachu is struct 15 ; The high byte of a pointer to anywhere within wSpriteStateData1 can be incremented ; to reach within wSpriteStateData2, and vice-versa for decrementing. -assert HIGH(wSpriteStateData1) + 1 == HIGH(wSpriteStateData2) -assert LOW(wSpriteStateData1) == 0 +ASSERT HIGH(wSpriteStateData1) + 1 == HIGH(wSpriteStateData2) +ASSERT LOW(wSpriteStateData1) == 0 wSpriteDataEnd:: @@ -225,9 +210,9 @@ SECTION "OAM Buffer", WRAM0 wOAMBuffer:: ; buffer for OAM data. Copied to OAM by DMA ; wOAMBufferSprite00 - wOAMBufferSprite39 -for n, NUM_SPRITE_OAM_STRUCTS -wOAMBufferSprite{02d:n}:: ds 4 -endr +FOR n, NUM_SPRITE_OAM_STRUCTS +wOAMBufferSprite{02d:n}:: sprite_oam_struct wOAMBufferSprite{02d:n} +ENDR wOAMBufferEnd:: wTileMap:: @@ -269,47 +254,29 @@ wAnimatedObject7:: animated_object wAnimatedObject7 wAnimatedObject8:: animated_object wAnimatedObject8 wAnimatedObject9:: animated_object wAnimatedObject9 -wNumLoadedAnimatedObjects:: - ds 1 +wNumLoadedAnimatedObjects:: db wCurrentAnimatedObjectOAMBufferOffset:: ds 3 -wAnimatedObjectSpawnStateDataPointer:: - ds 2 -wAnimatedObjectFramesDataPointer:: - ds 2 -wAnimatedObjectJumptablePointer:: - ds 2 -wAnimatedObjectOAMDataPointer:: - ds 2 -wCurAnimatedObjectOAMAttributes:: - ds 1 -wCurrentAnimatedObjectVTileOffset:: - ds 1 -wCurrentAnimatedObjectXCoord:: - ds 1 -wCurrentAnimatedObjectYCoord:: - ds 1 -wCurrentAnimatedObjectXOffset:: - ds 1 -wCurrentAnimatedObjectYOffset:: - ds 1 -wAnimatedObjectGlobalYOffset:: - ds 1 -wAnimatedObjectGlobalXOffset:: - ds 1 +wAnimatedObjectSpawnStateDataPointer:: dw +wAnimatedObjectFramesDataPointer:: dw +wAnimatedObjectJumptablePointer:: dw +wAnimatedObjectOAMDataPointer:: dw +wCurAnimatedObjectOAMAttributes:: db +wCurrentAnimatedObjectVTileOffset:: db +wCurrentAnimatedObjectXCoord:: db +wCurrentAnimatedObjectYCoord:: db +wCurrentAnimatedObjectXOffset:: db +wCurrentAnimatedObjectYOffset:: db +wAnimatedObjectGlobalYOffset:: db +wAnimatedObjectGlobalXOffset:: db wAnimatedObjectsDataEnd:: ; Surfing minigame -wSurfingMinigameData:: - ds 1 -wSurfingMinigameRoutineNumber:: - ds 1 -wc5d2:: - ds 1 -wSurfingMinigameWaveFunctionNumber:: - ds 2 -wc5d5:: - ds 1 +wSurfingMinigameData:: db +wSurfingMinigameRoutineNumber:: db +wc5d2:: db +wSurfingMinigameWaveFunctionNumber:: dw +wc5d5:: db wSurfingMinigamePikachuHP:: ds 2 ; little-endian BCD wc5d8:: ; unused? @@ -321,32 +288,21 @@ wSurfingMinigameRadnessScore:: ds 2 ; little-endian BCD wSurfingMinigameTotalScore:: ds 2 ; little-endian BCD -wc5de:: - ds 1 -wc5df:: - ds 1 -wc5e0:: - ds 1 -wc5e1:: - ds 1 -wc5e2:: - ds 1 +wc5de:: db +wc5df:: db +wc5e0:: db +wc5e1:: db +wc5e2:: db wSurfingMinigamePikachuSpeed:: ds 2 ; little-endian wc5e5:: ds 3 ; big-endian -wSurfingMinigameWaveHeightBuffer:: - ds 2 -wSurfingMinigamePikachuObjectHeight:: - ds 1 -wc5eb:: - ds 1 -wc5ec:: - ds 1 -wc5ed:: - ds 1 -wc5ee:: - ds 1 +wSurfingMinigameWaveHeightBuffer:: dw +wSurfingMinigamePikachuObjectHeight:: db +wc5eb:: db +wc5ec:: db +wc5ed:: db +wc5ee:: db wSurfingMinigameBGMapReadBuffer:: ds 16 ds 24 @@ -354,28 +310,19 @@ wSurfingMinigameSCX:: ds 3 wSurfingMinigameWaveHeight:: ds SCREEN_WIDTH -wSurfingMinigameXOffset:: - ds 1 -wSurfingMinigameTrickFlags:: - ds 1 -wc630:: - ds 1 -wc631:: - ds 1 -wSurfingMinigameRoutineDelay:: - ds 1 -wSurfingMinigameIntroAnimationFinished:: - ds 1 +wSurfingMinigameXOffset:: db +wSurfingMinigameTrickFlags:: db +wc630:: db +wc631:: db +wSurfingMinigameRoutineDelay:: db +wSurfingMinigameIntroAnimationFinished:: db ; Yellow intro wYellowIntroCurrentScene:: -wc634:: - ds 1 +wc634:: db wYellowIntroSceneTimer:: -wc635:: - ds 1 -wYellowIntroAnimatedObjectStructPointer:: - ds 1 +wc635:: db +wYellowIntroAnimatedObjectStructPointer:: db wSurfingMinigameDataEnd:: ENDU @@ -392,28 +339,20 @@ wTempPic:: NEXTU wPrinterData:: -wPrinterSendState:: - ds 1 -wPrinterRowIndex:: - ds 1 +wPrinterSendState:: db +wPrinterRowIndex:: db ; Printer data header wPrinterDataHeader:: -wc6ea:: - ds 1 -wc6eb:: - ds 1 -wc6ec:: - ds 1 -wc6ed:: - ds 1 -wPrinterChecksum:: - dw +wc6ea:: db +wc6eb:: db +wc6ec:: db +wc6ed:: db +wPrinterChecksum:: dw UNION -wPrinterSerialReceived:: - ds 1 +wPrinterSerialReceived:: db wPrinterStatusReceived:: ; bit 7: set if error 1 (battery low) ; bit 6: set if error 4 (too hot or cold) @@ -421,8 +360,7 @@ wPrinterStatusReceived:: ; if this and the previous byte are both $ff: error 2 (connection error) ds 1 -wc6f2:: - ds 1 +wc6f2:: db wc6f3:: ds 13 wLYOverrides:: @@ -443,32 +381,22 @@ ENDU wPrinterSendDataSource1End:: -wPrinterHandshake:: - ds 1 -wPrinterStatusFlags:: - ds 1 -wHandshakeFrameDelay:: - ds 1 -wPrinterSerialFrameDelay:: - ds 1 -wPrinterSendByteOffset:: - dw -wPrinterDataSize:: - dw +wPrinterHandshake:: db +wPrinterStatusFlags:: db +wHandshakeFrameDelay:: db +wPrinterSerialFrameDelay:: db +wPrinterSendByteOffset:: dw +wPrinterDataSize:: dw wPrinterTileBuffer:: ds SCREEN_HEIGHT * SCREEN_WIDTH -wPrinterStatusIndicator:: - ds 2 -wcae2:: - ds 1 +wPrinterStatusIndicator:: dw +wcae2:: db wPrinterSettingsTempCopy:: ds 17 -wPrinterQueueLength:: - ds 1 +wPrinterQueueLength:: db wPrinterDataEnd:: -wPrinterPokedexEntryTextPointer:: - dw +wPrinterPokedexEntryTextPointer:: dw ds 2 wPrinterPokedexMonIsOwned:: ds 227 @@ -476,8 +404,7 @@ wPrinterPokedexMonIsOwned:: wcbdc:: ds 14 -wcbea:: - ds 2 +wcbea:: dw wcbec:: ds 16 @@ -488,10 +415,8 @@ wRedrawRowOrColumnSrcTiles:: ds SCREEN_WIDTH * 2 ; coordinates of the position of the cursor for the top menu item (id 0) -wTopMenuItemY:: - ds 1 -wTopMenuItemX:: - ds 1 +wTopMenuItemY:: db +wTopMenuItemX:: db wCurrentMenuItem:: ; the id of the currently selected menu item @@ -537,8 +462,7 @@ wBattleAndStartSavedMenuItem:: ; a sub-menu is shown. It's reset at the start of each battle. ds 1 -wPlayerMoveListIndex:: - ds 1 +wPlayerMoveListIndex:: db wPlayerMonNumber:: ; index in party of currently battling mon @@ -570,8 +494,7 @@ wMenuWatchMovingOutOfBounds:: ; allows the caller to scroll the entire menu up or down when this happens. ds 1 -wTradeCenterPointerTableIndex:: - ds 1 +wTradeCenterPointerTableIndex:: db ds 1 @@ -647,16 +570,13 @@ wCheckFor180DegreeTurn:: ds 1 -wMissableObjectIndex:: - ds 1 +wMissableObjectIndex:: db -wPredefID:: - ds 1 +wPredefID:: db wPredefRegisters:: ds 6 -wTrainerHeaderFlagBit:: - ds 1 +wTrainerHeaderFlagBit:: db ds 1 @@ -707,15 +627,12 @@ wAnimationType:: ; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon... UNION -wNPCMovementDirections:: - ds 1 +wNPCMovementDirections:: db -wDexRatingNumMonsOwned:: - ds 1 +wDexRatingNumMonsOwned:: db wDexRatingText:: -wTrainerCardBadgeAttributes:: - ds 1 +wTrainerCardBadgeAttributes:: db wSlotMachineSavedROMBank:: ; ROM back to return to when the player is done with the slot machine @@ -723,14 +640,12 @@ wSlotMachineSavedROMBank:: ds 26 -wAnimPalette:: - ds 1 +wAnimPalette:: db ds 29 NEXTU -wPikaPicUsedGFXCount:: - ds 1 +wPikaPicUsedGFXCount:: db wPikaPicUsedGFX:: ds 16 @@ -756,8 +671,7 @@ wNumStepsToTake:: ds 1 NEXTU -wPikaPicAnimObjectDataBufferSize:: - ds 1 +wPikaPicAnimObjectDataBufferSize:: db wPikaPicAnimObjectDataBuffer:: ; 4 structs each of length 8 @@ -775,8 +689,7 @@ ENDU ds 10 -wRLEByteCount:: - ds 1 +wRLEByteCount:: db wAddedToParty:: ; 0 = not added @@ -796,19 +709,15 @@ wCanEvolveFlags:: ; Other methods of evolution simply set it by calling TryEvolvingMon. ds 1 -wForceEvolution:: - ds 1 +wForceEvolution:: db ; if [wAILayer2Encouragement] != 1, the second AI layer is not applied -wAILayer2Encouragement:: - ds 1 +wAILayer2Encouragement:: db ds 1 ; current HP of player and enemy substitutes -wPlayerSubstituteHP:: - ds 1 -wEnemySubstituteHP:: - ds 1 +wPlayerSubstituteHP:: db +wEnemySubstituteHP:: db wTestBattlePlayerSelectedMove:: ; The player's selected move during a test battle. @@ -821,13 +730,10 @@ wMoveMenuType:: ; 0=regular, 1=mimic, 2=above message box (relearn, heal pp..) ds 1 -wPlayerSelectedMove:: - ds 1 -wEnemySelectedMove:: - ds 1 +wPlayerSelectedMove:: db +wEnemySelectedMove:: db -wLinkBattleRandomNumberListIndex:: - ds 1 +wLinkBattleRandomNumberListIndex:: db wAICount:: ; number of times remaining that AI action can occur @@ -835,8 +741,7 @@ wAICount:: ds 2 -wEnemyMoveListIndex:: - ds 1 +wEnemyMoveListIndex:: db wLastSwitchInEnemyMonHP:: ; The enemy mon's HP when it was switched in or when the current player mon @@ -848,15 +753,12 @@ wTotalPayDayMoney:: ; total amount of money made using Pay Day during the current battle ds 3 -wSafariEscapeFactor:: - ds 1 -wSafariBaitFactor:: - ds 1 +wSafariEscapeFactor:: db +wSafariBaitFactor:: db ds 1 -wTransformedEnemyMonOriginalDVs:: - ds 2 +wTransformedEnemyMonOriginalDVs:: dw wMonIsDisobedient:: ds 1 @@ -884,8 +786,7 @@ wLowHealthAlarmDisabled:: ; battle. ds 1 -wPlayerMonMinimized:: - ds 1 +wPlayerMonMinimized:: db ds 13 @@ -901,72 +802,51 @@ wEnemyBideAccumulatedDamage:: wInGameTradeGiveMonSpecies:: -wPlayerMonUnmodifiedLevel:: - ds 1 +wPlayerMonUnmodifiedLevel:: db wInGameTradeTextPointerTablePointer:: -wPlayerMonUnmodifiedMaxHP:: - ds 2 +wPlayerMonUnmodifiedMaxHP:: dw wInGameTradeTextPointerTableIndex:: -wPlayerMonUnmodifiedAttack:: - ds 1 -wInGameTradeGiveMonName:: - ds 1 -wPlayerMonUnmodifiedDefense:: - ds 2 -wPlayerMonUnmodifiedSpeed:: - ds 2 -wPlayerMonUnmodifiedSpecial:: - ds 2 +wPlayerMonUnmodifiedAttack:: db +wInGameTradeGiveMonName:: db +wPlayerMonUnmodifiedDefense:: dw +wPlayerMonUnmodifiedSpeed:: dw +wPlayerMonUnmodifiedSpecial:: dw ; stat modifiers for the player's current pokemon ; value can range from 1 - 13 ($1 to $D) ; 7 is normal wPlayerMonStatMods:: -wPlayerMonAttackMod:: - ds 1 -wPlayerMonDefenseMod:: - ds 1 -wPlayerMonSpeedMod:: - ds 1 -wPlayerMonSpecialMod:: - ds 1 +wPlayerMonAttackMod:: db +wPlayerMonDefenseMod:: db +wPlayerMonSpeedMod:: db +wPlayerMonSpecialMod:: db wInGameTradeReceiveMonName:: -wPlayerMonAccuracyMod:: - ds 1 -wPlayerMonEvasionMod:: - ds 1 +wPlayerMonAccuracyMod:: db +wPlayerMonEvasionMod:: db ds 2 wPlayerMonStatModsEnd:: ds 1 -wEnemyMonUnmodifiedLevel:: - ds 1 -wEnemyMonUnmodifiedMaxHP:: - ds 2 -wEnemyMonUnmodifiedAttack:: - ds 2 -wEnemyMonUnmodifiedDefense:: - ds 1 +wEnemyMonUnmodifiedLevel:: db +wEnemyMonUnmodifiedMaxHP:: dw +wEnemyMonUnmodifiedAttack:: dw +wEnemyMonUnmodifiedDefense:: db -wInGameTradeMonNick:: - ds 1 +wInGameTradeMonNick:: db -wEnemyMonUnmodifiedSpeed:: - ds 2 -wEnemyMonUnmodifiedSpecial:: - ds 1 +wEnemyMonUnmodifiedSpeed:: dw +wEnemyMonUnmodifiedSpecial:: db -wEngagedTrainerClass:: - ds 1 +wEngagedTrainerClass:: db wEngagedTrainerSet:: ; ds 1 @@ -975,21 +855,14 @@ wEngagedTrainerSet:: ; 7 is normal wEnemyMonStatMods:: -wEnemyMonAttackMod:: - ds 1 -wEnemyMonDefenseMod:: - ds 1 -wEnemyMonSpeedMod:: - ds 1 -wEnemyMonSpecialMod:: - ds 1 -wEnemyMonAccuracyMod:: - ds 1 -wEnemyMonEvasionMod:: - ds 1 +wEnemyMonAttackMod:: db +wEnemyMonDefenseMod:: db +wEnemyMonSpeedMod:: db +wEnemyMonSpecialMod:: db +wEnemyMonAccuracyMod:: db +wEnemyMonEvasionMod:: db -wInGameTradeReceiveMonSpecies:: - ds 1 +wInGameTradeReceiveMonSpecies:: db ds 1 wEnemyMonStatModsEnd:: @@ -1130,8 +1003,7 @@ wWhichTrade:: wTrainerSpriteOffset:: -wUnusedCD3D:: - ds 1 +wUnusedCD3D:: db wTitleScreenTimer:: @@ -1177,8 +1049,7 @@ wHiddenObjectFunctionRomBank:: wTrainerEngageDistance:: -wJigglypuffFacingDirections2:: - ds 1 +wJigglypuffFacingDirections2:: db wHUDGraphicsTiles:: ; 3 bytes @@ -1211,8 +1082,7 @@ wPlayerSpinWhileMovingUpOrDownAnimFrameDelay:: wHiddenObjectIndex:: -wTrainerFacingDirection:: - ds 1 +wTrainerFacingDirection:: db wHoFMonOrPlayer:: ; show mon or show player? @@ -1227,8 +1097,7 @@ wHiddenObjectY:: wTrainerScreenY:: -wOptionsCancelCursorX:: - ds 1 +wOptionsCancelCursorX:: db wDayCarePerLevelCost:: ; 2-byte BCD number (always set to $100) @@ -1248,41 +1117,34 @@ wNumFieldMoves:: wSlotMachineWheel1BottomTile:: -wTrainerScreenX:: - ds 1 +wTrainerScreenX:: db ; a lot of the uses for these values use more than the said address wHoFTeamNo:: wSlotMachineWheel1MiddleTile:: -wFieldMovesLeftmostXCoord:: - ds 1 +wFieldMovesLeftmostXCoord:: db wLastFieldMoveID:: ; unused -wSlotMachineWheel1TopTile:: - ds 1 +wSlotMachineWheel1TopTile:: db -wSlotMachineWheel2BottomTile:: - ds 1 +wSlotMachineWheel2BottomTile:: db -wSlotMachineWheel2MiddleTile:: - ds 1 +wSlotMachineWheel2MiddleTile:: db wTempCoins1:: ; 2 bytes ; temporary variable used to add payout amount to the player's coins -wSlotMachineWheel2TopTile:: - ds 1 +wSlotMachineWheel2TopTile:: db wBattleTransitionSpiralDirection:: ; 0 = outward, 1 = inward -wSlotMachineWheel3BottomTile:: - ds 1 +wSlotMachineWheel3BottomTile:: db wSlotMachineWheel3MiddleTile:: @@ -1327,8 +1189,7 @@ wCutTile:: wSlotMachineWheel2SlipCounter:: ; wheel 2 can "slip" while this is non-zero -wTradedEnemyMonOT:: - ds 1 +wTradedEnemyMonOT:: db wSavedPlayerScreenY:: @@ -1351,8 +1212,7 @@ wWhichAnimationOffsets:: ; 0 = cut animation, 1 = boulder dust animation ds 9 -wTradedEnemyMonOTID:: - ds 2 +wTradedEnemyMonOTID:: dw wStandingOnWarpPadOrHole:: ; 0 = neither @@ -1361,14 +1221,11 @@ wStandingOnWarpPadOrHole:: wOAMBaseTile:: -wGymTrashCanIndex:: - ds 1 +wGymTrashCanIndex:: db -wSymmetricSpriteOAMAttributes:: - ds 1 +wSymmetricSpriteOAMAttributes:: db -wMonPartySpriteSpecies:: - ds 1 +wMonPartySpriteSpecies:: db wLeftGBMonSpecies:: ; in the trade animation, the mon that leaves the left gameboy @@ -1461,16 +1318,14 @@ wLearningMovesFromDayCare:: wChangeMonPicEnemyTurnSpecies:: -wHPBarMaxHP:: - ds 1 +wHPBarMaxHP:: db wNamingScreenSubmitName:: ; non-zero when the player has chosen to submit the name wChangeMonPicPlayerTurnSpecies:: -wEvoNewSpecies:: - ds 1 +wEvoNewSpecies:: db wAlphabetCase:: ; 0 = upper case @@ -1478,34 +1333,27 @@ wAlphabetCase:: wEvoMonTileOffset:: -wHPBarOldHP:: - ds 1 +wHPBarOldHP:: db -wEvoCancelled:: - ds 1 +wEvoCancelled:: db wNamingScreenLetter:: -wHPBarNewHP:: - ds 2 -wHPBarDelta:: - ds 1 +wHPBarNewHP:: dw +wHPBarDelta:: db -wHPBarTempHP:: - ds 2 +wHPBarTempHP:: dw ds 11 -wHPBarHPDifference:: - ds 1 +wHPBarHPDifference:: db ds 7 wAIItem:: ; the item that the AI used ds 1 -wUsedItemOnWhichPokemon:: - ds 1 +wUsedItemOnWhichPokemon:: db wAnimSoundID:: ; sound ID during battle animations @@ -1553,8 +1401,7 @@ wTextPredefFlag:: ; to the current map's bank ds 1 -wPredefParentBank:: - ds 1 +wPredefParentBank:: db wSpriteIndex:: ds 1 @@ -1568,8 +1415,7 @@ wNPCMovementScriptSpriteOffset:: ; sprite offset of sprite being controlled by NPC movement script ds 1 -wScriptedNPCWalkCounter:: - ds 1 +wScriptedNPCWalkCounter:: db ds 1 @@ -1577,8 +1423,7 @@ wOnSGB:: ; if running on SGB, it's 1, else it's 0 ds 1 -wDefaultPaletteCommand:: - ds 1 +wDefaultPaletteCommand:: db wPlayerHPBarColor:: @@ -1586,8 +1431,7 @@ wWholeScreenPaletteMonSpecies:: ; species of the mon whose palette is used for the whole screen ds 1 -wEnemyHPBarColor:: - ds 1 +wEnemyHPBarColor:: db ; 0: green ; 1: yellow @@ -1595,8 +1439,7 @@ wEnemyHPBarColor:: wPartyMenuHPBarColors:: ds 6 -wStatusScreenHPBarColor:: - ds 1 +wStatusScreenHPBarColor:: db ds 7 @@ -1604,8 +1447,7 @@ wCopyingSGBTileData:: wWhichPartyMenuHPBar:: -wPalPacket:: - ds 1 +wPalPacket:: db wPartyMenuBlkPacket:: ; $30 bytes @@ -1624,8 +1466,7 @@ wcf4b:: ; storage buffer for various strings ds 2 -wGainBoostedExp:: - ds 1 +wGainBoostedExp:: db ds 17 @@ -1638,16 +1479,14 @@ wGymLeaderName:: wItemList:: ds 16 -wListPointer:: - ds 2 +wListPointer:: dw wUnusedCF8D:: ; 2 bytes ; used to store pointers, but never read ds 2 -wItemPrices:: - ds 2 +wItemPrices:: dw wcf91:: ds 1 ; used with a lot of things (too much to list here) @@ -1680,11 +1519,9 @@ wMoveMonType:: ; 3 = move from party to daycare ds 1 -wItemQuantity:: - ds 1 +wItemQuantity:: db -wMaxItemQuantity:: - ds 1 +wMaxItemQuantity:: db ; LoadMonData copies mon data here wLoadedMon:: party_struct wLoadedMon @@ -1716,11 +1553,9 @@ wAudioFadeOutControl:: ; audio, it zeroes this variable and starts playing the sound ID stored in it. ds 1 -wAudioFadeOutCounterReloadValue:: - ds 1 +wAudioFadeOutCounterReloadValue:: db -wAudioFadeOutCounter:: - ds 1 +wAudioFadeOutCounter:: db wLastMusicSoundID:: ; This is used to determine whether the default music is already playing when @@ -1741,36 +1576,22 @@ wUpdateSpritesEnabled:: ; other values aren't used ds 1 -wEnemyMoveNum:: - ds 1 -wEnemyMoveEffect:: - ds 1 -wEnemyMovePower:: - ds 1 -wEnemyMoveType:: - ds 1 -wEnemyMoveAccuracy:: - ds 1 -wEnemyMoveMaxPP:: - ds 1 -wPlayerMoveNum:: - ds 1 -wPlayerMoveEffect:: - ds 1 -wPlayerMovePower:: - ds 1 -wPlayerMoveType:: - ds 1 -wPlayerMoveAccuracy:: - ds 1 -wPlayerMoveMaxPP:: - ds 1 +wEnemyMoveNum:: db +wEnemyMoveEffect:: db +wEnemyMovePower:: db +wEnemyMoveType:: db +wEnemyMoveAccuracy:: db +wEnemyMoveMaxPP:: db +wPlayerMoveNum:: db +wPlayerMoveEffect:: db +wPlayerMovePower:: db +wPlayerMoveType:: db +wPlayerMoveAccuracy:: db +wPlayerMoveMaxPP:: db -wEnemyMonSpecies2:: - ds 1 -wBattleMonSpecies2:: - ds 1 +wEnemyMonSpecies2:: db +wBattleMonSpecies2:: db wEnemyMonNick:: ds NAME_LENGTH @@ -1818,13 +1639,11 @@ wBattleMonNick:: ds NAME_LENGTH wBattleMon:: battle_struct wBattleMon -wTrainerClass:: - ds 1 +wTrainerClass:: db ds 1 -wTrainerPicPointer:: - ds 2 +wTrainerPicPointer:: dw ds 1 wTempMoveNameBuffer:: @@ -1838,8 +1657,7 @@ wTrainerBaseMoney:: ; money received after battle = base money × level of highest-level enemy mon ds 2 -wMissableObjectCounter:: - ds 1 +wMissableObjectCounter:: db ds 1 @@ -1896,8 +1714,7 @@ wCriticalHitOrOHKO:: ; $ff = failed OHKO ds 1 -wMoveMissed:: - ds 1 +wMoveMissed:: db wPlayerStatsToDouble:: ; always 0 @@ -1943,22 +1760,17 @@ wEnemyStatsToHalve:: ; always 0 ds 1 -wEnemyBattleStatus1:: - ds 1 -wEnemyBattleStatus2:: - ds 1 -wEnemyBattleStatus3:: - ds 1 +wEnemyBattleStatus1:: db +wEnemyBattleStatus2:: db +wEnemyBattleStatus3:: db wPlayerNumAttacksLeft:: ; when the player is attacking multiple times, the number of attacks left ds 1 -wPlayerConfusedCounter:: - ds 1 +wPlayerConfusedCounter:: db -wPlayerToxicCounter:: - ds 1 +wPlayerToxicCounter:: db wPlayerDisabledMove:: ; high nibble: which move is disabled (1-4) @@ -1971,11 +1783,9 @@ wEnemyNumAttacksLeft:: ; when the enemy is attacking multiple times, the number of attacks left ds 1 -wEnemyConfusedCounter:: - ds 1 +wEnemyConfusedCounter:: db -wEnemyToxicCounter:: - ds 1 +wEnemyToxicCounter:: db wEnemyDisabledMove:: ; high nibble: which move is disabled (1-4) @@ -2002,11 +1812,9 @@ wEscapedFromBattle:: wAmountMoneyWon:: ; 3-byte BCD number -wObjectToHide:: - ds 1 +wObjectToHide:: db -wObjectToShow:: - ds 1 +wObjectToShow:: db ds 1 @@ -2035,10 +1843,8 @@ wSavedListScrollOffset:: ds 2 ; base coordinates of frame block -wBaseCoordX:: - ds 1 -wBaseCoordY:: - ds 1 +wBaseCoordX:: db +wBaseCoordY:: db ; low health alarm counter/enable ; high bit = enable, others = timer to cycle frequencies @@ -2048,8 +1854,7 @@ wFBTileCounter:: ; counts how many tiles of the current frame block have been drawn ds 1 -wMovingBGTilesCounter2:: - ds 1 +wMovingBGTilesCounter2:: db wSubAnimFrameDelay:: ; duration of each frame of the current subanimation in terms of screen refreshes @@ -2087,8 +1892,7 @@ wNewSlotMachineBallTile:: wCoordAdjustmentAmount:: ; how much to add to the X/Y coord -wUnusedD08A:: - ds 1 +wUnusedD08A:: db wSpiralBallsBaseX:: @@ -2107,16 +1911,13 @@ wSubAnimTransform:: ; 04: reverse the subanimation ds 1 -wEndBattleWinTextPointer:: - ds 2 +wEndBattleWinTextPointer:: dw -wEndBattleLoseTextPointer:: - ds 2 +wEndBattleLoseTextPointer:: dw ds 2 -wEndBattleTextRomBank:: - ds 1 +wEndBattleTextRomBank:: db ds 1 @@ -2136,8 +1937,7 @@ wSubAnimSubEntryAddr:: ds 2 -wOutwardSpiralTileMapPointer:: - ds 1 +wOutwardSpiralTileMapPointer:: db wPartyMenuAnimMonEnabled:: @@ -2145,8 +1945,7 @@ wTownMapSpriteBlinkingEnabled:: ; non-zero when enabled. causes nest locations to blink on and off. ; the town selection cursor will blink regardless of what this value is -wUnusedD09B:: - ds 1 +wUnusedD09B:: db wFBDestAddr:: ; current destination address in OAM for frame blocks (big endian) @@ -2185,14 +1984,10 @@ wSlideMonUpBottomRowLeftTile:: wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank -wSpriteCurPosX:: - ds 1 -wSpriteCurPosY:: - ds 1 -wSpriteWidth:: - ds 1 -wSpriteHeight:: - ds 1 +wSpriteCurPosX:: db +wSpriteCurPosY:: db +wSpriteWidth:: db +wSpriteHeight:: db wSpriteInputCurByte:: ; current input byte ds 1 @@ -2211,10 +2006,8 @@ wSpriteLoadFlags:: ; bit 0 determines used buffer (0 -> sSpriteBuffer1, 1 -> sSpriteBuffer2) ; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation) ds 1 -wSpriteUnpackMode:: - ds 1 -wSpriteFlipped:: - ds 1 +wSpriteUnpackMode:: db +wSpriteFlipped:: db wSpriteInputPtr:: ; pointer to next input byte @@ -2234,11 +2027,9 @@ wSpriteDecodeTable1Ptr:: wd0b5:: ds 1 ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things -wNameListType:: - ds 1 +wNameListType:: db -wPredefBank:: - ds 1 +wPredefBank:: db wMonHeader:: @@ -2248,39 +2039,26 @@ wMonHIndex:: ds 1 wMonHBaseStats:: -wMonHBaseHP:: - ds 1 -wMonHBaseAttack:: - ds 1 -wMonHBaseDefense:: - ds 1 -wMonHBaseSpeed:: - ds 1 -wMonHBaseSpecial:: - ds 1 +wMonHBaseHP:: db +wMonHBaseAttack:: db +wMonHBaseDefense:: db +wMonHBaseSpeed:: db +wMonHBaseSpecial:: db wMonHTypes:: -wMonHType1:: - ds 1 -wMonHType2:: - ds 1 +wMonHType1:: db +wMonHType2:: db -wMonHCatchRate:: - ds 1 -wMonHBaseEXP:: - ds 1 -wMonHSpriteDim:: - ds 1 -wMonHFrontSprite:: - ds 2 -wMonHBackSprite:: - ds 2 +wMonHCatchRate:: db +wMonHBaseEXP:: db +wMonHSpriteDim:: db +wMonHFrontSprite:: dw +wMonHBackSprite:: dw wMonHMoves:: ds NUM_MOVES -wMonHGrowthRate:: - ds 1 +wMonHGrowthRate:: db wMonHLearnset:: ; bit field @@ -2295,26 +2073,22 @@ wSavedTileAnimations:: ds 2 -wDamage:: - ds 2 +wDamage:: dw ds 2 -wRepelRemainingSteps:: - ds 1 +wRepelRemainingSteps:: db wMoves:: ; list of moves for FormatMovesString ds NUM_MOVES -wMoveNum:: - ds 1 +wMoveNum:: db wMovesString:: ds 56 -wUnusedD119:: - ds 1 +wUnusedD119:: db wWalkBikeSurfStateCopy:: ; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything @@ -2366,25 +2140,19 @@ wNumRunAttempts:: ; number of times the player has tried to run from battle ds 1 -wEvolutionOccurred:: - ds 1 +wEvolutionOccurred:: db -wVBlankSavedROMBank:: - ds 1 +wVBlankSavedROMBank:: db -wFarCopyDataSavedROMBank:: - ds 1 +wFarCopyDataSavedROMBank:: db -wIsKeyItem:: - ds 1 +wIsKeyItem:: db -wTextBoxID:: - ds 1 +wTextBoxID:: db wCurrentMapScriptFlags:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value -wCurEnemyLVL:: - ds 1 +wCurEnemyLVL:: db wItemListPointer:: ; pointer to list of items terminated by $FF @@ -2394,11 +2162,9 @@ wListCount:: ; number of entries in a list ds 1 -wLinkState:: - ds 1 +wLinkState:: db -wTwoOptionMenuID:: - ds 1 +wTwoOptionMenuID:: db wChosenMenuItem:: ; the id of the menu item the player ultimately chose @@ -2431,22 +2197,17 @@ wGymGateTileBlock:: ; a horizontal or vertical gate block ds 1 -wSavedSpriteScreenY:: - ds 1 +wSavedSpriteScreenY:: db -wSavedSpriteScreenX:: - ds 1 +wSavedSpriteScreenX:: db -wSavedSpriteMapY:: - ds 1 +wSavedSpriteMapY:: db -wSavedSpriteMapX:: - ds 1 +wSavedSpriteMapX:: db ds 5 -wWhichPrize:: - ds 1 +wWhichPrize:: db wIgnoreInputCounter:: ; counts downward each frame @@ -2461,26 +2222,20 @@ wNumberOfNoRandomBattleStepsLeft:: ; after a battle, you have at least 3 steps before a random battle can occur ds 1 -wPrize1:: - ds 1 -wPrize2:: - ds 1 -wPrize3:: - ds 1 +wPrize1:: db +wPrize2:: db +wPrize3:: db ds 1 wSerialRandomNumberListBlock:: ; the first 7 bytes are the preamble -wPrize1Price:: - ds 2 +wPrize1Price:: dw -wPrize2Price:: - ds 2 +wPrize2Price:: dw -wPrize3Price:: - ds 2 +wPrize3Price:: dw ds 1 @@ -2498,16 +2253,13 @@ wPseudoItemID:: ; that case, this would be ESCAPE_ROPE. ds 1 -wUnusedD153:: - ds 1 +wUnusedD153:: db ds 2 -wEvoStoneItemID:: - ds 1 +wEvoStoneItemID:: db -wSavedNPCMovementDirections2Index:: - ds 1 +wSavedNPCMovementDirections2Index:: db wPlayerName:: ds NAME_LENGTH @@ -2520,21 +2272,21 @@ wPartySpecies:: ds PARTY_LENGTH + 1 wPartyMons:: ; wPartyMon1 - wPartyMon6 -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}:: party_struct wPartyMon{d:n} -endr +ENDR wPartyMonOT:: ; wPartyMon1OT - wPartyMon6OT -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}OT:: ds NAME_LENGTH -endr +ENDR wPartyMonNicks:: ; wPartyMon1Nick - wPartyMon6Nick -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}Nick:: ds NAME_LENGTH -endr +ENDR wPartyMonNicksEnd:: wPartyDataEnd:: @@ -2551,8 +2303,7 @@ wPokedexSeen:: wPokedexSeenEnd:: -wNumBagItems:: - ds 1 +wNumBagItems:: db wBagItems:: ; item, quantity ds BAG_ITEM_CAPACITY * 2 @@ -2589,22 +2340,18 @@ wLetterPrintingDelayFlags:: ; bit 1: If 0, no delay. ds 1 -wPlayerID:: - ds 2 +wPlayerID:: dw -wMapMusicSoundID:: - ds 1 +wMapMusicSoundID:: db -wMapMusicROMBank:: - ds 1 +wMapMusicROMBank:: db wMapPalOffset:: ; offset subtracted from FadePal4 to get the background and object palettes for the current map ; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4 ds 1 -wCurMap:: - ds 1 +wCurMap:: db wCurrentTileBlockMapViewPointer:: ; pointer to the upper left corner of the current view in the tile block map @@ -2614,24 +2361,19 @@ wYCoord:: ; player's position on the current map ds 1 -wXCoord:: - ds 1 +wXCoord:: db wYBlockCoord:: ; player's y position (by block) ds 1 -wXBlockCoord:: - ds 1 +wXBlockCoord:: db -wLastMap:: - ds 1 +wLastMap:: db -wUnusedD366:: - ds 1 +wUnusedD366:: db -wCurMapTileset:: - ds 1 +wCurMapTileset:: db wCurMapHeight:: ; blocks @@ -2641,114 +2383,79 @@ wCurMapWidth:: ; blocks ds 1 -wMapDataPtr:: - ds 2 +wMapDataPtr:: dw -wMapTextPtr:: - ds 2 +wMapTextPtr:: dw -wMapScriptPtr:: - ds 2 +wMapScriptPtr:: dw wMapConnections:: ; connection byte ds 1 -wMapConn1Ptr:: - ds 1 +wMapConn1Ptr:: db -wNorthConnectionStripSrc:: - ds 2 +wNorthConnectionStripSrc:: dw -wNorthConnectionStripDest:: - ds 2 +wNorthConnectionStripDest:: dw -wNorthConnectionStripWidth:: - ds 1 +wNorthConnectionStripWidth:: db -wNorthConnectedMapWidth:: - ds 1 +wNorthConnectedMapWidth:: db -wNorthConnectedMapYAlignment:: - ds 1 +wNorthConnectedMapYAlignment:: db -wNorthConnectedMapXAlignment:: - ds 1 +wNorthConnectedMapXAlignment:: db -wNorthConnectedMapViewPointer:: - ds 2 +wNorthConnectedMapViewPointer:: dw -wMapConn2Ptr:: - ds 1 +wMapConn2Ptr:: db -wSouthConnectionStripSrc:: - ds 2 +wSouthConnectionStripSrc:: dw -wSouthConnectionStripDest:: - ds 2 +wSouthConnectionStripDest:: dw -wSouthConnectionStripWidth:: - ds 1 +wSouthConnectionStripWidth:: db -wSouthConnectedMapWidth:: - ds 1 +wSouthConnectedMapWidth:: db -wSouthConnectedMapYAlignment:: - ds 1 +wSouthConnectedMapYAlignment:: db -wSouthConnectedMapXAlignment:: - ds 1 +wSouthConnectedMapXAlignment:: db -wSouthConnectedMapViewPointer:: - ds 2 +wSouthConnectedMapViewPointer:: dw -wMapConn3Ptr:: - ds 1 +wMapConn3Ptr:: db -wWestConnectionStripSrc:: - ds 2 +wWestConnectionStripSrc:: dw -wWestConnectionStripDest:: - ds 2 +wWestConnectionStripDest:: dw -wWestConnectionStripHeight:: - ds 1 +wWestConnectionStripHeight:: db -wWestConnectedMapWidth:: - ds 1 +wWestConnectedMapWidth:: db -wWestConnectedMapYAlignment:: - ds 1 +wWestConnectedMapYAlignment:: db -wWestConnectedMapXAlignment:: - ds 1 +wWestConnectedMapXAlignment:: db -wWestConnectedMapViewPointer:: - ds 2 +wWestConnectedMapViewPointer:: dw -wMapConn4Ptr:: - ds 1 +wMapConn4Ptr:: db -wEastConnectionStripSrc:: - ds 2 +wEastConnectionStripSrc:: dw -wEastConnectionStripDest:: - ds 2 +wEastConnectionStripDest:: dw -wEastConnectionStripHeight:: - ds 1 +wEastConnectionStripHeight:: db -wEastConnectedMapWidth:: - ds 1 +wEastConnectedMapWidth:: db -wEastConnectedMapYAlignment:: - ds 1 +wEastConnectedMapYAlignment:: db -wEastConnectedMapXAlignment:: - ds 1 +wEastConnectedMapXAlignment:: db -wEastConnectedMapViewPointer:: - ds 2 +wEastConnectedMapViewPointer:: dw wSpriteSet:: ; sprite set for the current map (11 sprite picture ID's) @@ -2758,8 +2465,7 @@ wSpriteSetID:: ; sprite set ID for the current map ds 1 -wObjectDataPointerTemp:: - ds 2 +wObjectDataPointerTemp:: dw ds 2 @@ -2789,10 +2495,8 @@ wd436:: ds 1 wPikachuFollowCommandBufferSize:: ds 1 wPikachuFollowCommandBuffer:: ds 16 -wExpressionNumber:: - ds 1 -wPikaPicAnimNumber:: - ds 1 +wExpressionNumber:: db +wPikaPicAnimNumber:: db wPikachuMovementScriptBank:: ds 1 wPikachuMovementScriptAddress:: dw @@ -2888,10 +2592,8 @@ wNumSprites:: ; these two variables track the X and Y offset in blocks from the last special warp used ; they don't seem to be used for anything -wYOffsetSinceLastSpecialWarp:: - ds 1 -wXOffsetSinceLastSpecialWarp:: - ds 1 +wYOffsetSinceLastSpecialWarp:: db +wXOffsetSinceLastSpecialWarp:: db wMapSpriteData:: ; two bytes per sprite (movement byte 2, text ID) @@ -2931,15 +2633,13 @@ wPlayerDirection:: ; if the player is not moving, the last the direction in which the player moved ds 1 -wTilesetBank:: - ds 1 +wTilesetBank:: db wTilesetBlocksPtr:: ; maps blocks (4x4 tiles) to tiles ds 2 -wTilesetGfxPtr:: - ds 2 +wTilesetGfxPtr:: dw wTilesetCollisionPtr:: ; list of all walkable tiles @@ -2948,13 +2648,11 @@ wTilesetCollisionPtr:: wTilesetTalkingOverTiles:: ds 3 -wGrassTile:: - ds 1 +wGrassTile:: db ds 4 -wNumBoxItems:: - ds 1 +wNumBoxItems:: db wBoxItems:: ; item, quantity ds PC_ITEM_CAPACITY * 2 @@ -2969,8 +2667,7 @@ wNumHoFTeams:: ; number of HOF teams ds 1 -wUnusedD5A3:: - ds 1 +wUnusedD5A3:: db wPlayerCoins:: ds 2 ; BCD @@ -2993,217 +2690,119 @@ wMissableObjectList:: wGameProgressFlags:: ; $c8 bytes -wOaksLabCurScript:: - ds 1 -wPalletTownCurScript:: - ds 1 - ds 1 -wBluesHouseCurScript:: - ds 1 -wViridianCityCurScript:: - ds 1 - ds 2 -wPewterCityCurScript:: - ds 1 -wRoute3CurScript:: - ds 1 -wRoute4CurScript:: - ds 1 -wFanClubCurScript:: - ds 1 -wViridianGymCurScript:: - ds 1 -wPewterGymCurScript:: - ds 1 -wCeruleanGymCurScript:: - ds 1 -wVermilionGymCurScript:: - ds 1 -wCeladonGymCurScript:: - ds 1 -wRoute6CurScript:: - ds 1 -wRoute8CurScript:: - ds 1 -wRoute24CurScript:: - ds 1 -wRoute25CurScript:: - ds 1 -wRoute9CurScript:: - ds 1 -wRoute10CurScript:: - ds 1 -wMtMoon1FCurScript:: - ds 1 -wMtMoonB2FCurScript:: - ds 1 -wSSAnne1FRoomsCurScript:: - ds 1 -wSSAnne2FRoomsCurScript:: - ds 1 -wRoute22CurScript:: - ds 1 - ds 1 -wRedsHouse2FCurScript:: - ds 1 -wViridianMartCurScript:: - ds 1 -wRoute22GateCurScript:: - ds 1 -wCeruleanCityCurScript:: - ds 1 +wOaksLabCurScript:: db +wPalletTownCurScript:: db + ds 1 +wBluesHouseCurScript:: db +wViridianCityCurScript:: db + ds 2 +wPewterCityCurScript:: db +wRoute3CurScript:: db +wRoute4CurScript:: db +wFanClubCurScript:: db +wViridianGymCurScript:: db +wPewterGymCurScript:: db +wCeruleanGymCurScript:: db +wVermilionGymCurScript:: db +wCeladonGymCurScript:: db +wRoute6CurScript:: db +wRoute8CurScript:: db +wRoute24CurScript:: db +wRoute25CurScript:: db +wRoute9CurScript:: db +wRoute10CurScript:: db +wMtMoon1FCurScript:: db +wMtMoonB2FCurScript:: db +wSSAnne1FRoomsCurScript:: db +wSSAnne2FRoomsCurScript:: db +wRoute22CurScript:: db + ds 1 +wRedsHouse2FCurScript:: db +wViridianMartCurScript:: db +wRoute22GateCurScript:: db +wCeruleanCityCurScript:: db ds 7 -wSSAnneBowCurScript:: - ds 1 -wViridianForestCurScript:: - ds 1 -wMuseum1FCurScript:: - ds 1 -wRoute13CurScript:: - ds 1 -wRoute14CurScript:: - ds 1 -wRoute17CurScript:: - ds 1 -wRoute19CurScript:: - ds 1 -wRoute21CurScript:: - ds 1 -wSafariZoneGateCurScript:: - ds 1 -wRockTunnelB1FCurScript:: - ds 1 -wRockTunnel1FCurScript:: - ds 1 - ds 1 -wRoute11CurScript:: - ds 1 -wRoute12CurScript:: - ds 1 -wRoute15CurScript:: - ds 1 -wRoute16CurScript:: - ds 1 -wRoute18CurScript:: - ds 1 -wRoute20CurScript:: - ds 1 -wSSAnneB1FRoomsCurScript:: - ds 1 -wVermilionCityCurScript:: - ds 1 -wPokemonTower2FCurScript:: - ds 1 -wPokemonTower3FCurScript:: - ds 1 -wPokemonTower4FCurScript:: - ds 1 -wPokemonTower5FCurScript:: - ds 1 -wPokemonTower6FCurScript:: - ds 1 -wPokemonTower7FCurScript:: - ds 1 -wRocketHideoutB1FCurScript:: - ds 1 -wRocketHideoutB2FCurScript:: - ds 1 -wRocketHideoutB3FCurScript:: - ds 1 -wRocketHideoutB4FCurScript:: - ds 2 -wRoute6GateCurScript:: - ds 1 -wRoute8GateCurScript:: - ds 2 -wCinnabarIslandCurScript:: - ds 1 -wPokemonMansion1FCurScript:: - ds 2 -wPokemonMansion2FCurScript:: - ds 1 -wPokemonMansion3FCurScript:: - ds 1 -wPokemonMansionB1FCurScript:: - ds 1 -wVictoryRoad2FCurScript:: - ds 1 -wVictoryRoad3FCurScript:: - ds 1 -wCeladonCityCurScript:: - ds 1 -wFightingDojoCurScript:: - ds 1 -wSilphCo2FCurScript:: - ds 1 -wSilphCo3FCurScript:: - ds 1 -wSilphCo4FCurScript:: - ds 1 -wSilphCo5FCurScript:: - ds 1 -wSilphCo6FCurScript:: - ds 1 -wSilphCo7FCurScript:: - ds 1 -wSilphCo8FCurScript:: - ds 1 -wSilphCo9FCurScript:: - ds 1 -wHallOfFameCurScript:: - ds 1 -wChampionsRoomCurScript:: - ds 1 -wLoreleisRoomCurScript:: - ds 1 -wBrunosRoomCurScript:: - ds 1 -wAgathasRoomCurScript:: - ds 1 -wCeruleanCaveB1FCurScript:: - ds 1 -wVictoryRoad1FCurScript:: - ds 1 - ds 1 -wLancesRoomCurScript:: - ds 1 +wSSAnneBowCurScript:: db +wViridianForestCurScript:: db +wMuseum1FCurScript:: db +wRoute13CurScript:: db +wRoute14CurScript:: db +wRoute17CurScript:: db +wRoute19CurScript:: db +wRoute21CurScript:: db +wSafariZoneGateCurScript:: db +wRockTunnelB1FCurScript:: db +wRockTunnel1FCurScript:: db + ds 1 +wRoute11CurScript:: db +wRoute12CurScript:: db +wRoute15CurScript:: db +wRoute16CurScript:: db +wRoute18CurScript:: db +wRoute20CurScript:: db +wSSAnneB1FRoomsCurScript:: db +wVermilionCityCurScript:: db +wPokemonTower2FCurScript:: db +wPokemonTower3FCurScript:: db +wPokemonTower4FCurScript:: db +wPokemonTower5FCurScript:: db +wPokemonTower6FCurScript:: db +wPokemonTower7FCurScript:: db +wRocketHideoutB1FCurScript:: db +wRocketHideoutB2FCurScript:: db +wRocketHideoutB3FCurScript:: db +wRocketHideoutB4FCurScript:: db + ds 1 +wRoute6GateCurScript:: db +wRoute8GateCurScript:: db + ds 1 +wCinnabarIslandCurScript:: db +wPokemonMansion1FCurScript:: db + ds 1 +wPokemonMansion2FCurScript:: db +wPokemonMansion3FCurScript:: db +wPokemonMansionB1FCurScript:: db +wVictoryRoad2FCurScript:: db +wVictoryRoad3FCurScript:: db +wCeladonCityCurScript:: db +wFightingDojoCurScript:: db +wSilphCo2FCurScript:: db +wSilphCo3FCurScript:: db +wSilphCo4FCurScript:: db +wSilphCo5FCurScript:: db +wSilphCo6FCurScript:: db +wSilphCo7FCurScript:: db +wSilphCo8FCurScript:: db +wSilphCo9FCurScript:: db +wHallOfFameCurScript:: db +wChampionsRoomCurScript:: db +wLoreleisRoomCurScript:: db +wBrunosRoomCurScript:: db +wAgathasRoomCurScript:: db +wCeruleanCaveB1FCurScript:: db +wVictoryRoad1FCurScript:: db + ds 1 +wLancesRoomCurScript:: db ds 4 -wSilphCo10FCurScript:: - ds 1 -wSilphCo11FCurScript:: - ds 1 - ds 1 -wFuchsiaGymCurScript:: - ds 1 -wSaffronGymCurScript:: - ds 1 - ds 1 -wCinnabarGymCurScript:: - ds 1 -wGameCornerCurScript:: - ds 1 -wRoute16Gate1FCurScript:: - ds 1 -wBillsHouseCurScript:: - ds 1 -wRoute5GateCurScript:: - ds 1 -wPowerPlantCurScript:: -wRoute7GateCurScript:: -; overload - ds 1 - ds 1 -wSSAnne2FCurScript:: - ds 1 -wSeafoamIslandsB3FCurScript:: - ds 1 -wRoute23CurScript:: - ds 1 -wSeafoamIslandsB4FCurScript:: - ds 1 -wRoute18Gate1FCurScript:: - ds 1 - +wSilphCo10FCurScript:: db +wSilphCo11FCurScript:: db + ds 1 +wFuchsiaGymCurScript:: db +wSaffronGymCurScript:: db + ds 1 +wCinnabarGymCurScript:: db +wGameCornerCurScript:: db +wRoute16Gate1FCurScript:: db +wBillsHouseCurScript:: db +wRoute5GateCurScript:: db +wPowerPlantCurScript:: ; overload +wRoute7GateCurScript:: db + ds 1 +wSSAnne2FCurScript:: db +wSeafoamIslandsB3FCurScript:: db +wRoute23CurScript:: db +wSeafoamIslandsB4FCurScript:: db +wRoute18Gate1FCurScript:: db ds 78 wGameProgressFlagsEnd:: @@ -3212,8 +2811,7 @@ wGameProgressFlagsEnd:: wObtainedHiddenItemsFlags:: ds 14 -wObtainedHiddenCoinsFlags:: - ds 2 +wObtainedHiddenCoinsFlags:: dw wWalkBikeSurfState:: ; $00 = walking @@ -3244,11 +2842,9 @@ wEnemyMonOrTrainerClass:: ; trainer classes start at OPP_ID_OFFSET ds 1 -wPlayerJumpingYScreenCoordsIndex:: - ds 1 +wPlayerJumpingYScreenCoordsIndex:: db -wRivalStarter:: - ds 1 +wRivalStarter:: db IF DEF(_DEBUG) ; This byte gets set to NUM_POKEMON by DebugStart. @@ -3256,22 +2852,19 @@ wUnknownDebugByte:: ENDC ds 1 -wPlayerStarter:: - ds 1 +wPlayerStarter:: db wBoulderSpriteIndex:: ; sprite index of the boulder the player is trying to push ds 1 -wLastBlackoutMap:: - ds 1 +wLastBlackoutMap:: db wDestinationMap:: ; destination map (for certain types of special warps, not ordinary walking) ds 1 -wUnusedD71B:: - ds 1 +wUnusedD71B:: db wTileInFrontOfBoulderAndBoulderCollisionResult:: ; used to store the tile in front of the boulder when trying to push a boulder @@ -3286,8 +2879,7 @@ wWhichDungeonWarp:: ; which dungeon warp within the source map was used ds 1 -wUnusedD71F:: - ds 1 +wUnusedD71F:: db ds 8 @@ -3394,32 +2986,25 @@ wd736:: ; bit 7: player sprite spinning due to spin tiles (Rocket hideout / Viridian Gym) ds 1 -wCompletedInGameTradeFlags:: - ds 2 +wCompletedInGameTradeFlags:: dw ds 2 -wWarpedFromWhichWarp:: - ds 1 +wWarpedFromWhichWarp:: db -wWarpedFromWhichMap:: - ds 1 +wWarpedFromWhichMap:: db ds 2 -wCardKeyDoorY:: - ds 1 +wCardKeyDoorY:: db -wCardKeyDoorX:: - ds 1 +wCardKeyDoorX:: db ds 2 -wFirstLockTrashCanIndex:: - ds 1 +wFirstLockTrashCanIndex:: db -wSecondLockTrashCanIndex:: - ds 1 +wSecondLockTrashCanIndex:: db ds 2 @@ -3455,27 +3040,26 @@ wEnemyPartySpecies:: ds PARTY_LENGTH + 1 wEnemyMons:: ; wEnemyMon1 - wEnemyMon6 -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wEnemyMon{d:n}:: party_struct wEnemyMon{d:n} -endr +ENDR wEnemyMonOT:: ; wEnemyMon1OT - wEnemyMon6OT -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wEnemyMon{d:n}OT:: ds NAME_LENGTH -endr +ENDR wEnemyMonNicks:: ; wEnemyMon1Nick - wEnemyMon6Nick -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wEnemyMon{d:n}Nick:: ds NAME_LENGTH -endr +ENDR ENDU -wTrainerHeaderPtr:: - ds 2 +wTrainerHeaderPtr:: dw ds 6 @@ -3483,8 +3067,7 @@ wOpponentAfterWrongAnswer:: ; the trainer the player must face after getting a wrong answer in the Cinnabar ; gym quiz -wUnusedDA38:: - ds 1 +wUnusedDA38:: db wCurMapScript:: ; index of current map script, mostly used as index for function pointer array @@ -3493,22 +3076,15 @@ wCurMapScript:: ds 7 -wPlayTimeHours:: - ds 1 -wPlayTimeMaxed:: - ds 1 -wPlayTimeMinutes:: - ds 1 -wPlayTimeSeconds:: - ds 1 -wPlayTimeFrames:: - ds 1 +wPlayTimeHours:: db +wPlayTimeMaxed:: db +wPlayTimeMinutes:: db +wPlayTimeSeconds:: db +wPlayTimeFrames:: db -wSafariZoneGameOver:: - ds 1 +wSafariZoneGameOver:: db -wNumSafariBalls:: - ds 1 +wNumSafariBalls:: db wDayCareInUse:: @@ -3532,21 +3108,21 @@ wBoxSpecies:: ds MONS_PER_BOX + 1 wBoxMons:: ; wBoxMon1 - wBoxMon20 -for n, 1, MONS_PER_BOX + 1 +FOR n, 1, MONS_PER_BOX + 1 wBoxMon{d:n}:: box_struct wBoxMon{d:n} -endr +ENDR wBoxMonOT:: ; wBoxMon1OT - wBoxMon20OT -for n, 1, MONS_PER_BOX + 1 +FOR n, 1, MONS_PER_BOX + 1 wBoxMon{d:n}OT:: ds NAME_LENGTH -endr +ENDR wBoxMonNicks:: ; wBoxMon1Nick - wBoxMon20Nick -for n, 1, MONS_PER_BOX + 1 +FOR n, 1, MONS_PER_BOX + 1 wBoxMon{d:n}Nick:: ds NAME_LENGTH -endr +ENDR wBoxMonNicksEnd:: wBoxDataEnd:: @@ -3562,7 +3138,9 @@ wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PALETTE_SIZE SECTION "Stack", WRAMX -wStack:: +; the stack grows downward + ds $eb - 1 +wStack:: db INCLUDE "sram.asm" |