diff options
Diffstat (limited to 'wram.asm')
-rw-r--r-- | wram.asm | 380 |
1 files changed, 356 insertions, 24 deletions
@@ -132,7 +132,9 @@ wFrequencyModifier:: db wTempoModifier:: db - ds 13 +wc0f3:: ds 1 +wc0f4:: ds 1 +wc0f5:: ds 11 SECTION "Sprite State Data", WRAM0 @@ -162,9 +164,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 wSpriteStateData2:: ; more data for all sprites on the current map @@ -189,9 +192,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. @@ -229,6 +233,97 @@ wSerialPartyMonsPatchList:: wSerialEnemyMonsPatchList:: ; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer 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 @@ -241,6 +336,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 wRedrawRowOrColumnSrcTiles:: @@ -459,11 +626,13 @@ wBoostExpByExpAll:: wAnimationType:: ; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon... +UNION wNPCMovementDirections:: db wDexRatingNumMonsOwned:: db -wDexRatingText:: db +wDexRatingText:: +wTrainerCardBadgeAttributes:: db wSlotMachineSavedROMBank:: ; ROM back to return to when the player is done with the slot machine @@ -475,6 +644,16 @@ wAnimPalette:: db ds 29 +NEXTU +wPikaPicUsedGFXCount:: db + +wPikaPicUsedGFX:: + ds 16 +wPikaPicUsedGFXEnd:: + + ds 43 +ENDU + UNION wNPCMovementDirections2:: ds 10 @@ -490,6 +669,22 @@ NEXTU wNumStepsToTake:: ; used in Pallet Town scripted movement ds 1 + +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 10 @@ -726,8 +921,6 @@ wHoFTeamIndex:: wSSAnneSmokeDriftAmount:: ; multiplied by 16 to get the number of times to go right by 2 pixels -wRivalStarterTemp:: - wBoxMonCounts:: ; 12 bytes ; array of the number of mons in each box @@ -750,7 +943,7 @@ wWhichBadge:: wPriceTemp:: ; 3-byte BCD number -wTitleMonSpecies:: +wTitleScreenScene:: wPlayerCharacterOAMTile:: @@ -763,6 +956,8 @@ wCoordIndex:: wOptionsTextSpeedCursorX:: +wOptionsCursorLocation:: + wTrainerInfoTextBoxWidthPlus1:: wSwappedMenuItem:: @@ -810,6 +1005,8 @@ wTrainerSpriteOffset:: wUnusedCD3D:: db +wTitleScreenTimer:: + wHUDPokeballGfxOffsetX:: ; difference in X between the next ball and the current one @@ -819,8 +1016,6 @@ wBattleTransitionCircleScreenQuadrantX:: wSSAnneSmokeX:: -wRivalStarterBallSpriteIndex:: - wDayCareNumLevelsGrown:: wOptionsBattleAnimCursorX:: @@ -852,7 +1047,9 @@ wPlayerSpinWhileMovingUpOrDownAnimMaxY:: wHiddenObjectFunctionRomBank:: -wTrainerEngageDistance:: db +wTrainerEngageDistance:: + +wJigglypuffFacingDirections2:: db wHUDGraphicsTiles:: ; 3 bytes @@ -1222,8 +1419,6 @@ wScriptedNPCWalkCounter:: db ds 1 -wGBC:: db - wOnSGB:: ; if running on SGB, it's 1, else it's 0 ds 1 @@ -1256,7 +1451,12 @@ wPalPacket:: db wPartyMenuBlkPacket:: ; $30 bytes - ds 29 + ds 9 + +wPartyHPBarAttributes:: + ds 6 + + ds 14 wExpAmountGained:: ; 2-byte big-endian number @@ -1395,7 +1595,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 5 wEnemyMonActualCatchRate:: ds 1 @@ -1910,7 +2144,7 @@ wEvolutionOccurred:: db wVBlankSavedROMBank:: db - ds 1 +wFarCopyDataSavedROMBank:: db wIsKeyItem:: db @@ -2251,7 +2485,94 @@ 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:: 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 wNumSigns:: ; number of signs in the current map (up to 16) @@ -2378,7 +2699,7 @@ wViridianCityCurScript:: db wPewterCityCurScript:: db wRoute3CurScript:: db wRoute4CurScript:: db - ds 1 +wFanClubCurScript:: db wViridianGymCurScript:: db wPewterGymCurScript:: db wCeruleanGymCurScript:: db @@ -2443,7 +2764,7 @@ wPokemonMansion3FCurScript:: db wPokemonMansionB1FCurScript:: db wVictoryRoad2FCurScript:: db wVictoryRoad3FCurScript:: db - ds 1 +wCeladonCityCurScript:: db wFightingDojoCurScript:: db wSilphCo2FCurScript:: db wSilphCo3FCurScript:: db @@ -2525,6 +2846,10 @@ wPlayerJumpingYScreenCoordsIndex:: db wRivalStarter:: db +IF DEF(_DEBUG) +; This byte gets set to NUM_POKEMON by DebugStart. +wUnknownDebugByte:: +ENDC ds 1 wPlayerStarter:: db @@ -2543,7 +2868,7 @@ wUnusedD71B:: db wTileInFrontOfBoulderAndBoulderCollisionResult:: ; 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) +; also used to store the result of the collision check ($ff for a collision and $00 for no collision) ds 1 wDungeonWarpDestinationMap:: @@ -2642,7 +2967,7 @@ wFlags_D733:: ; 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 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 ds 1 @@ -2802,13 +3127,20 @@ 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 -wStack:: - ds 1 + ds $eb - 1 +wStack:: db INCLUDE "sram.asm" |