summaryrefslogtreecommitdiff
path: root/wram.asm
diff options
context:
space:
mode:
Diffstat (limited to 'wram.asm')
-rw-r--r--wram.asm363
1 files changed, 347 insertions, 16 deletions
diff --git a/wram.asm b/wram.asm
index da21cc43..ceb1e956 100644
--- a/wram.asm
+++ b/wram.asm
@@ -76,7 +76,9 @@ wAudioSavedROMBank:: db
wFrequencyModifier:: db
wTempoModifier:: db
- ds 13
+wc0f3:: ds 1
+wc0f4:: ds 1
+wc0f5:: ds 11
SECTION "Sprite State Data", WRAM0
@@ -105,9 +107,10 @@ wSpriteStateData1::
; - F
wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1 ; player is struct 0
; wSprite02StateData1 - wSprite15StateData1
-FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS
+FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS - 1
wSprite{02d:n}StateData1:: spritestatedata1 wSprite{02d:n}StateData1
ENDR
+wSpritePikachuStateData1:: spritestatedata1 wSpritePikachuStateData1 ; pikachu is struct 15
; more data for all sprites on the current map
; holds info for 16 sprites with $10 bytes each
@@ -131,9 +134,10 @@ wSpriteStateData2::
; - F
wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2 ; player is struct 0
; wSprite02StateData2 - wSprite15StateData2
-FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS
+FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS - 1
wSprite{02d:n}StateData2:: spritestatedata2 wSprite{02d:n}StateData2
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.
@@ -167,6 +171,97 @@ wSerialPartyMonsPatchList:: ds 200
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
wSerialEnemyMonsPatchList:: ds 200
+
+NEXTU
+wAnimatedObjectsData::
+; Used by functions in BANK 3E
+; This looks similar to the address structure for Gen 2 OAM animations.
+
+wAnimatedObjectStartTileOffsets::
+ ds 10 * 2
+
+wAnimatedObjectDataStructs::
+wAnimatedObject0:: animated_object wAnimatedObject0
+wAnimatedObject1:: animated_object wAnimatedObject1
+wAnimatedObject2:: animated_object wAnimatedObject2
+wAnimatedObject3:: animated_object wAnimatedObject3
+wAnimatedObject4:: animated_object wAnimatedObject4
+wAnimatedObject5:: animated_object wAnimatedObject5
+wAnimatedObject6:: animated_object wAnimatedObject6
+wAnimatedObject7:: animated_object wAnimatedObject7
+wAnimatedObject8:: animated_object wAnimatedObject8
+wAnimatedObject9:: animated_object wAnimatedObject9
+
+wNumLoadedAnimatedObjects:: db
+wCurrentAnimatedObjectOAMBufferOffset::
+ ds 3
+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:: db
+wSurfingMinigameRoutineNumber:: db
+wc5d2:: db
+wSurfingMinigameWaveFunctionNumber:: dw
+wc5d5:: db
+wSurfingMinigamePikachuHP::
+ ds 2 ; little-endian BCD
+wc5d8:: ; unused?
+ ds 1
+wSurfingMinigameRadnessMeter::
+; number of consecutive tricks
+ ds 1
+wSurfingMinigameRadnessScore::
+ ds 2 ; little-endian BCD
+wSurfingMinigameTotalScore::
+ ds 2 ; little-endian BCD
+wc5de:: db
+wc5df:: db
+wc5e0:: db
+wc5e1:: db
+wc5e2:: db
+wSurfingMinigamePikachuSpeed::
+ ds 2 ; little-endian
+wc5e5::
+ ds 3 ; big-endian
+wSurfingMinigameWaveHeightBuffer:: dw
+wSurfingMinigamePikachuObjectHeight:: db
+wc5eb:: db
+wc5ec:: db
+wc5ed:: db
+wc5ee:: db
+wSurfingMinigameBGMapReadBuffer::
+ ds 16
+ ds 24
+wSurfingMinigameSCX::
+ ds 3
+wSurfingMinigameWaveHeight::
+ ds SCREEN_WIDTH
+wSurfingMinigameXOffset:: db
+wSurfingMinigameTrickFlags:: db
+wc630:: db
+wc631:: db
+wSurfingMinigameRoutineDelay:: db
+wSurfingMinigameIntroAnimationFinished:: db
+
+; Yellow intro
+wYellowIntroCurrentScene::
+wc634:: db
+wYellowIntroSceneTimer::
+wc635:: db
+wYellowIntroAnimatedObjectStructPointer:: db
+wSurfingMinigameDataEnd::
ENDU
ds 80
@@ -177,6 +272,78 @@ wOverworldMapEnd::
NEXTU
wTempPic:: ds 7 * 7 tiles
+
+NEXTU
+wPrinterData::
+wPrinterSendState:: db
+wPrinterRowIndex:: db
+
+; Printer data header
+wPrinterDataHeader::
+wc6ea:: db
+wc6eb:: db
+wc6ec:: db
+wc6ed:: db
+wPrinterChecksum:: dw
+
+UNION
+
+wPrinterSerialReceived:: db
+wPrinterStatusReceived::
+; bit 7: set if error 1 (battery low)
+; bit 6: set if error 4 (too hot or cold)
+; bit 5: set if error 3 (paper jammed or empty)
+; if this and the previous byte are both $ff: error 2 (connection error)
+ ds 1
+
+wc6f2:: db
+wc6f3::
+ ds 13
+wLYOverrides::
+ ds $100
+wLYOverridesEnd::
+wLYOverridesBuffer::
+ ds $100
+wLYOverridesBufferEnd::
+
+NEXTU
+
+wPrinterSendDataSource1::
+; two 20-tile buffers
+ ds $140
+wPrinterSendDataSource2::
+ ds $140
+ENDU
+
+wPrinterSendDataSource1End::
+
+wPrinterHandshake:: db
+wPrinterStatusFlags:: db
+wHandshakeFrameDelay:: db
+wPrinterSerialFrameDelay:: db
+wPrinterSendByteOffset:: dw
+wPrinterDataSize:: dw
+wPrinterTileBuffer::
+ ds SCREEN_HEIGHT * SCREEN_WIDTH
+wPrinterStatusIndicator:: dw
+wcae2:: db
+wPrinterSettingsTempCopy::
+ ds 17
+wPrinterQueueLength:: db
+wPrinterDataEnd::
+
+wPrinterPokedexEntryTextPointer:: dw
+ ds 2
+wPrinterPokedexMonIsOwned::
+ ds 227
+
+wcbdc::
+ ds 14
+
+wcbea:: dw
+
+wcbec::
+ ds 16
ENDU
; the tiles of the row or column to be redrawn by RedrawRowOrColumn
@@ -326,6 +493,7 @@ wNPCMovementScriptBank:: db
ds 2
+UNION
wVermilionDockTileMapBuffer:: ; ds 5 * BG_MAP_WIDTH + SCREEN_WIDTH
wOaksAideRewardItemName:: ; ds ITEM_NAME_LENGTH
@@ -360,6 +528,7 @@ wDexRatingNumMonsSeen:: db
wDexRatingNumMonsOwned:: db
+wTrainerCardBadgeAttributes::
wDexRatingText:: db
; ROM back to return to when the player is done with the slot machine
@@ -371,6 +540,16 @@ wAnimPalette:: db
ds 29
+NEXTU
+wPikaPicUsedGFXCount:: db
+
+wPikaPicUsedGFX::
+ ds 16
+wPikaPicUsedGFXEnd::
+
+ ds 43
+ENDU
+
UNION
wNPCMovementDirections2:: ds 10
; used in Pallet Town scripted movement
@@ -379,6 +558,22 @@ 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
@@ -597,7 +792,6 @@ wInwardSpiralUpdateScreenCounter::
wHoFTeamIndex::
; multiplied by 16 to get the number of times to go right by 2 pixels
wSSAnneSmokeDriftAmount::
-wRivalStarterTemp::
wDexMaxSeenMon::
wPPRestoreItem::
wWereAnyMonsAsleep::
@@ -606,13 +800,14 @@ wNumShakes::
; the level of the mon at the time it entered day care
wDayCareStartLevel::
wWhichBadge::
-wTitleMonSpecies::
+wTitleScreenScene::
wPlayerCharacterOAMTile::
; the number of small stars OAM entries to move down
wMoveDownSmallStarsOAMCount::
wChargeMoveNum::
wCoordIndex::
wOptionsTextSpeedCursorX::
+wOptionsCursorLocation::
wTrainerInfoTextBoxWidthPlus1::
wSwappedMenuItem::
wHoFMonSpecies::
@@ -642,13 +837,13 @@ wUnusedCD3D::
; $ff sentinel values at each end
wFlyLocationsList:: ; ds NUM_CITY_MAPS + 2
+wTitleScreenTimer::
; difference in X between the next ball and the current one
wHUDPokeballGfxOffsetX::
; 0 = left half (X < 10)
; 1 = right half (X >= 10)
wBattleTransitionCircleScreenQuadrantX::
wSSAnneSmokeX::
-wRivalStarterBallSpriteIndex::
wDayCareNumLevelsGrown::
wOptionsBattleAnimCursorX::
wTrainerInfoTextBoxWidth::
@@ -665,6 +860,7 @@ wPlayerSpinInPlaceAnimFrameDelayDelta::
wPlayerSpinWhileMovingUpOrDownAnimMaxY::
wHiddenObjectFunctionRomBank::
wTrainerEngageDistance::
+wJigglypuffFacingDirections2::
db
wHUDGraphicsTiles:: ; ds 3
@@ -961,8 +1157,6 @@ wScriptedNPCWalkCounter:: db
ds 1
-wGBC:: db
-
; if running on SGB, it's 1, else it's 0
wOnSGB:: db
@@ -991,7 +1185,11 @@ wPalPacket::
wPartyMenuBlkPacket:: ; ds $30
- ds 29
+ ds 9
+
+wPartyHPBarAttributes:: ds 6
+
+ ds 14
; storage buffer for various strings
wcf4b:: ; ds 20
@@ -1110,7 +1308,41 @@ wBattleMonSpecies2:: db
wEnemyMonNick:: ds NAME_LENGTH
-wEnemyMon:: battle_struct wEnemyMon
+wEnemyMon::
+; The wEnemyMon struct reaches past 0xcfff,
+; the end of wram bank 0 on cgb.
+; This has no significance on dmg, where wram
+; isn't banked (c000-dfff is contiguous).
+; However, recent versions of rgbds have replaced
+; dmg-style wram with cgb wram banks.
+
+; Until this is fixed, this struct will have
+; to be declared manually.
+
+wEnemyMonSpecies:: db
+wEnemyMonHP:: dw
+wEnemyMonPartyPos::
+wEnemyMonBoxLevel:: db
+wEnemyMonStatus:: db
+wEnemyMonType::
+wEnemyMonType1:: db
+wEnemyMonType2:: db
+wEnemyMonCatchRate_NotReferenced:: db
+wEnemyMonMoves:: ds NUM_MOVES
+wEnemyMonDVs:: ds 2
+wEnemyMonLevel:: db
+wEnemyMonMaxHP:: dw
+wEnemyMonAttack:: dw
+wEnemyMonDefense:: dw
+wEnemyMonSpeed:: dw
+wEnemyMonSpecial:: dw
+wEnemyMonPP:: ds 3 ; NUM_MOVES - 1
+
+
+SECTION "WRAM Bank 1", WRAMX
+
+; continuing wEnemyMon from the previous section
+ ds 1 ; NUM_MOVES - 3
wEnemyMonBaseStats:: ds NUM_STATS
wEnemyMonActualCatchRate:: db
@@ -1533,7 +1765,7 @@ wEvolutionOccurred:: db
wVBlankSavedROMBank:: db
- ds 1
+wFarCopyDataSavedROMBank:: db
wIsKeyItem:: db
@@ -1761,7 +1993,94 @@ wWarpEntries:: ds 32 * 4 ; Y, X, warp ID, map ID
; if $ff, the player's coordinates are not updated when entering the map
wDestinationWarpID:: db
- ds 128
+wPikachuOverworldStateFlags:: ds 1
+wPikachuSpawnState:: ds 1
+wd432:: ds 1
+wd433:: ds 1
+wd434:: ds 1
+wd435:: ds 1
+wd436:: ds 1
+wPikachuFollowCommandBufferSize:: ds 1
+wPikachuFollowCommandBuffer:: ds 16
+
+wExpressionNumber:: db
+wPikaPicAnimNumber:: db
+
+wPikachuMovementScriptBank:: ds 1
+wPikachuMovementScriptAddress:: dw
+wPikachuMovementFlags::
+; bit 6 - spawn shadow
+; bit 7 - signal end of command
+ ds 1
+
+UNION
+wCurPikaMovementData::
+wCurPikaMovementParam1:: ds 1
+wCurPikaMovementFunc1:: ds 1
+wCurPikaMovementParam2:: ds 1
+wCurPikaMovementFunc2:: ds 1
+wd451:: ds 1
+wCurPikaMovementSpriteImageIdx:: ds 1
+wPikaSpriteX:: ds 1
+wPikaSpriteY:: ds 1
+wPikachuMovementXOffset:: ds 1
+wPikachuMovementYOffset:: ds 1
+wPikachuStepTimer:: ds 1
+wPikachuStepSubtimer:: ds 1
+ ds 5
+wCurPikaMovementDataEnd::
+
+NEXTU
+wPikaPicAnimPointer:: dw
+wPikaPicAnimPointerSetupFinished:: ds 1
+wPikaPicAnimCurGraphicID:: ds 1
+wPikaPicAnimTimer:: ds 2
+wPikaPicAnimDelay:: ds 1
+wPikaPicPikaDrawStartX:: ds 1
+wPikaPicPikaDrawStartY:: ds 1
+
+wCurPikaPicAnimObject::
+wCurPikaPicAnimObjectVTileOffset:: db
+wCurPikaPicAnimObjectXOffset:: db
+wCurPikaPicAnimObjectYOffset:: db
+wCurPikaPicAnimObjectScriptIdx:: db
+wCurPikaPicAnimObjectFrameIdx:: db
+wCurPikaPicAnimObjectFrameTimer:: db
+ ds 1
+wCurPikaPicAnimObjectEnd::
+
+ ds 18
+ENDU
+
+wPikachuHappiness:: ds 1
+wPikachuMood:: ds 1
+wd472:: ds 1
+wd473:: ds 1
+
+ ds 1
+
+wd475:: ds 1
+
+ ds 4
+
+wd47a:: ds 1
+
+ ds 24
+
+wd492:: ds 1
+
+ ds 1
+
+wSurfingMinigameHiScore:: ds 2 ; 4-digit BCD little-endian
+ ds 1
+
+wPrinterSettings:: ds 1
+wUnknownSerialFlag_d499:: ds 1
+wPrinterConnectionOpen:: ds 1
+wPrinterOpcode:: ds 1
+wd49c:: ds 1
+
+ ds 19
; number of signs in the current map (up to 16)
wNumSigns:: db
@@ -1862,7 +2181,7 @@ wViridianCityCurScript:: db
wPewterCityCurScript:: db
wRoute3CurScript:: db
wRoute4CurScript:: db
- ds 1
+wFanClubCurScript:: db
wViridianGymCurScript:: db
wPewterGymCurScript:: db
wCeruleanGymCurScript:: db
@@ -1927,7 +2246,7 @@ wPokemonMansion3FCurScript:: db
wPokemonMansionB1FCurScript:: db
wVictoryRoad2FCurScript:: db
wVictoryRoad3FCurScript:: db
- ds 1
+wCeladonCityCurScript:: db
wFightingDojoCurScript:: db
wSilphCo2FCurScript:: db
wSilphCo3FCurScript:: db
@@ -2001,6 +2320,10 @@ wPlayerJumpingYScreenCoordsIndex:: db
wRivalStarter:: db
+IF DEF(_DEBUG)
+; This byte gets set to NUM_POKEMON by DebugStart.
+wUnknownDebugByte::
+ENDC
ds 1
wPlayerStarter:: db
@@ -2251,11 +2574,19 @@ wBoxMonNicksEnd::
wBoxDataEnd::
+wGBCBasePalPointers:: ds NUM_ACTIVE_PALS * 2
+wGBCPal:: ds PALETTE_SIZE
+wLastBGP:: ds 1
+wLastOBP0:: ds 1
+wLastOBP1:: ds 1
+wdef5:: ds 1
+wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PALETTE_SIZE
+
-SECTION "Stack", WRAM0
+SECTION "Stack", WRAMX
; the stack grows downward
- ds $100 - 1
+ ds $eb - 1
wStack:: db