summaryrefslogtreecommitdiff
path: root/wram.asm
diff options
context:
space:
mode:
Diffstat (limited to 'wram.asm')
-rwxr-xr-xwram.asm461
1 files changed, 428 insertions, 33 deletions
diff --git a/wram.asm b/wram.asm
index b2332f61..ed482c64 100755
--- a/wram.asm
+++ b/wram.asm
@@ -147,8 +147,9 @@ wFrequencyModifier::
wTempoModifier::
ds 1
- ds 13
-
+wc0f3:: ds 1
+wc0f4:: ds 1
+wc0f5:: ds 11
SECTION "Sprite State Data", WRAM0
@@ -190,7 +191,7 @@ wSprite11StateData1:: spritestatedata1 wSprite11StateData1
wSprite12StateData1:: spritestatedata1 wSprite12StateData1
wSprite13StateData1:: spritestatedata1 wSprite13StateData1
wSprite14StateData1:: spritestatedata1 wSprite14StateData1
-wSprite15StateData1:: spritestatedata1 wSprite15StateData1
+wSpritePikachuStateData1:: spritestatedata1 wSpritePikachuStateData1
wSpriteStateData2::
; more data for all sprites on the current map
@@ -228,7 +229,7 @@ wSprite11StateData2:: spritestatedata2 wSprite11StateData2
wSprite12StateData2:: spritestatedata2 wSprite12StateData2
wSprite13StateData2:: spritestatedata2 wSprite13StateData2
wSprite14StateData2:: spritestatedata2 wSprite14StateData2
-wSprite15StateData2:: spritestatedata2 wSprite15StateData2
+wSpritePikachuStateData2:: spritestatedata2 wSpritePikachuStateData2
wSpriteDataEnd::
@@ -239,10 +240,11 @@ SECTION "OAM Buffer", WRAM0
wOAMBuffer::
; buffer for OAM data. Copied to OAM by DMA
ds 4 * 40
+wOAMBufferEnd::
wTileMap::
; buffer for tiles that are visible on screen (20 columns by 18 rows)
- ds 20 * 18
+ ds SCREEN_HEIGHT * SCREEN_WIDTH
wSerialPartyMonsPatchList::
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
@@ -252,17 +254,248 @@ wTileMapBackup::
; (e.g. if menus are drawn on top)
; ds 20 * 18
- ds 200
+wAnimatedObjectsData::
+; Used by functions in BANK 3E
+; This looks similar to the address structure for Gen 2 OAM animations.
+
+wAnimatedObjectStartTileOffsets::
+ ds 10 * 2
+wAnimatedObjectDataStructs::
+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
+ ds 5
+\1End::
+ endm
+
+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::
+ ds 1
+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
+wAnimatedObjectsDataEnd::
wSerialEnemyMonsPatchList::
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
- ds 200
- ds 80
+; Surfing Minigame
+wSurfingMinigameData::
+ ds 1
+wSurfingMinigameRoutineNumber::
+ ds 1
+wc5d2::
+ ds 1
+wSurfingMinigameWaveFunctionNumber::
+ ds 2
+wc5d5::
+ ds 1
+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::
+ ds 1
+wc5df::
+ ds 1
+wc5e0::
+ ds 1
+wc5e1::
+ ds 1
+wc5e2::
+ ds 1
+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
+wSurfingMinigameBGMapReadBuffer::
+ ds 16
+
+ ds 24
+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
+
+wYellowIntroCurrentScene::
+wc634::
+ ds 1
+wYellowIntroSceneTimer::
+wc635::
+ ds 1
+wYellowIntroAnimatedObjectStructPointer::
+ ds 1
+wSurfingMinigameDataEnd::
+
+ ds 177
wTempPic::
+wPrinterData::
wOverworldMap::
- ds 1300
+ ; ds 1300
+wPrinterSendState::
+ ds 1
+wPrinterRowIndex::
+ ds 1
+
+; Printer data header
+wPrinterDataHeader::
+wc6ea::
+ ds 1
+wc6eb::
+ ds 1
+wc6ec::
+ ds 1
+wc6ed::
+ ds 1
+wPrinterChecksum::
+ dw
+
+UNION
+
+wPrinterSerialReceived::
+ ds 1
+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::
+ ds 1
+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::
+ ds 1
+wPrinterStatusFlags::
+ ds 1
+wHandshakeFrameDelay::
+ ds 1
+wPrinterSerialFrameDelay::
+ ds 1
+wPrinterSendByteOffset::
+ dw
+wPrinterDataSize::
+ dw
+wPrinterTileBuffer::
+ ds SCREEN_HEIGHT * SCREEN_WIDTH
+wPrinterStatusIndicator::
+ ds 2
+wcae2::
+ ds 1
+wPrinterSettingsTempCopy::
+ ds 17
+wPrinterQueueLength::
+ ds 1
+wPrinterDataEnd::
+
+wPrinterPokedexEntryTextPointer::
+ dw
+ ds 2
+wPrinterPokedexMonIsOwned::
+ ds 227
+
+wcbdc::
+ ds 14
+
+wcbea::
+ ds 2
+
+wcbec::
+ ds 16
+
wOverworldMapEnd::
wRedrawRowOrColumnSrcTiles::
@@ -399,9 +632,7 @@ wUnknownSerialCounter::
; 2 bytes
wEnteringCableClub::
- ds 1
-
- ds 1
+ ds 2
wWhichTradeMonSelectionMenu::
; $00 = player mons
@@ -490,19 +721,26 @@ wAnimationType::
; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
wNPCMovementDirections::
+
+wPikaPicUsedGFXCount::
ds 1
+wPikaPicUsedGFX::
wDexRatingNumMonsOwned::
ds 1
+
wDexRatingText::
+wTrainerCardBadgeAttributes::
ds 1
wSlotMachineSavedROMBank::
; ROM back to return to when the player is done with the slot machine
ds 1
- ds 26
+ ds 13
+wPikaPicUsedGFXEnd::
+ ds 13
wAnimPalette::
ds 1
@@ -511,13 +749,30 @@ wAnimPalette::
wNPCMovementDirections2::
+wPikaPicAnimObjectDataBufferSize::
+
wSwitchPartyMonTempBuffer::
; temporary buffer when swapping party mon data
- ds 10
+ ds 1
+
+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 9
wNumStepsToTake::
; used in Pallet Town scripted movement
- ds 49
+ ds 23
+wPikaPicAnimObjectDataBufferEnd:: ;ccb8
+ ds 26
wRLEByteCount::
ds 1
@@ -810,7 +1065,7 @@ wWhichBadge::
wPriceTemp::
; 3-byte BCD number
-wTitleMonSpecies::
+wTitleScreenScene::
wPlayerCharacterOAMTile::
@@ -823,7 +1078,7 @@ wCoordIndex::
wOptionsTextSpeedCursorX::
-wBoxNumString::
+wOptionsCursorLocation::
wTrainerInfoTextBoxWidthPlus1::
@@ -861,6 +1116,8 @@ wPlayerSpinInPlaceAnimFrameDelay::
wPlayerSpinWhileMovingUpOrDownAnimDeltaY::
+wBoxNumString::
+
wHiddenObjectFunctionArgument::
wWhichTrade::
@@ -871,6 +1128,8 @@ wTrainerSpriteOffset::
wUnusedCD3D::
ds 1
+wTitleScreenTimer::
+
wHUDPokeballGfxOffsetX::
; difference in X between the next ball and the current one
@@ -914,6 +1173,8 @@ wPlayerSpinWhileMovingUpOrDownAnimMaxY::
wHiddenObjectFunctionRomBank::
wTrainerEngageDistance::
+
+wJigglypuffFacingDirections2::
ds 1
wHUDGraphicsTiles::
@@ -948,6 +1209,7 @@ wPlayerSpinWhileMovingUpOrDownAnimFrameDelay::
wHiddenObjectIndex::
wTrainerFacingDirection::
+
ds 1
wHoFMonOrPlayer::
@@ -993,6 +1255,8 @@ wHoFTeamNo::
wSlotMachineWheel1MiddleTile::
wFieldMovesLeftmostXCoord::
+
+wcd42::
ds 1
wLastFieldMoveID::
@@ -1305,9 +1569,6 @@ wScriptedNPCWalkCounter::
ds 1
-wGBC::
- ds 1
-
wOnSGB::
; if running on SGB, it's 1, else it's 0
ds 1
@@ -1344,7 +1605,9 @@ wPalPacket::
wPartyMenuBlkPacket::
; $30 bytes
- ds 29
+ ds 9
+wPartyHPBarAttributes::
+ ds 20
wExpAmountGained::
; 2-byte big-endian number
@@ -1502,7 +1765,37 @@ wBattleMonSpecies2::
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
+ ds 1 ; NUM_MOVES - 3
wEnemyMonBaseStats:: ds 5
wEnemyMonActualCatchRate:: ds 1
@@ -1653,7 +1946,6 @@ wPlayerConfusedCounter::
wPlayerToxicCounter::
ds 1
-
wPlayerDisabledMove::
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
@@ -1670,7 +1962,6 @@ wEnemyConfusedCounter::
wEnemyToxicCounter::
ds 1
-
wEnemyDisabledMove::
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
@@ -1971,7 +2262,7 @@ wMonHBackSprite::
ds 2
wMonHMoves::
- ds NUM_MOVES
+ ds 4
wMonHGrowthRate::
ds 1
@@ -1987,7 +2278,6 @@ wSavedTilesetType::
ds 2
-
wDamage::
ds 2
@@ -2065,6 +2355,7 @@ wEvolutionOccurred::
wVBlankSavedROMBank::
ds 1
+wFarCopyDataSavedROMBank::
ds 1
wIsKeyItem::
@@ -2465,7 +2756,98 @@ wDestinationWarpID::
; if $ff, the player's coordinates are not updated when entering the map
ds 1
- 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::
+ ds 1
+wPikaPicAnimNumber::
+ ds 1
+
+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
wNumSigns::
; number of signs in the current map (up to 16)
@@ -2606,6 +2988,7 @@ wRoute3CurScript::
ds 1
wRoute4CurScript::
ds 1
+wFanClubCurScript::
ds 1
wViridianGymCurScript::
ds 1
@@ -2725,7 +3108,9 @@ wPokemonMansionB1FCurScript::
wVictoryRoad2FCurScript::
ds 1
wVictoryRoad3FCurScript::
- ds 2
+ ds 1
+wCeladonCityCurScript::
+ ds 1
wFightingDojoCurScript::
ds 1
wSilphCo2FCurScript::
@@ -2972,7 +3357,10 @@ wFlags_D733::
wBeatLorelei::
; 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
- ds 2
+ ds 1
+
+wd735::
+ ds 1
wd736::
; bit 0: check if the player is standing on a door and make him walk down a step if so
@@ -3010,6 +3398,7 @@ wSecondLockTrashCanIndex::
ds 1
ds 2
+
wEventFlags::
flag_array NUM_EVENTS
@@ -3020,14 +3409,14 @@ wGrassRate::
ds 1
wGrassMons::
- ;ds 20
+; ds 20
ds 11
; Overload wGrassMons
wSerialEnemyDataBlock::
ds 9
-wEnemyPartyCount:: ds 1
+wEnemyPartyCount:: ds 1
wEnemyPartyMons:: ds PARTY_LENGTH + 1
; Overload enemy party data
@@ -3114,11 +3503,17 @@ wBoxMon2:: ds BOX_STRUCT_LENGTH * (MONS_PER_BOX - 1)
wBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX
wBoxMonNicks:: ds NAME_LENGTH * MONS_PER_BOX
wBoxMonNicksEnd::
-
wBoxDataEnd::
+wGBCBasePalPointers:: ds NUM_ACTIVE_PALS * 2
+wGBCPal:: ds PAL_SIZE
+wLastBGP:: ds 1
+wLastOBP0:: ds 1
+wLastOBP1:: ds 1
+wdef5:: ds 1
+wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PAL_SIZE
-SECTION "Stack", WRAM0
+SECTION "Stack", WRAMX
wStack::