diff options
| author | Sylvie <35663410+Rangi42@users.noreply.github.com> | 2024-07-16 13:02:54 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-16 13:02:54 -0400 |
| commit | 8fafca714c07500d1d87bba224f12cf9cc2c8789 (patch) | |
| tree | 273ca88fcfcd80df9c318c9cb8d17a1f7aa240cb /engine/overworld | |
| parent | Build with RGBDS 0.8.0, though it is not yet required (diff) | |
| download | pokeyellow-8fafca714c07500d1d87bba224f12cf9cc2c8789.tar.gz pokeyellow-8fafca714c07500d1d87bba224f12cf9cc2c8789.tar.xz pokeyellow-8fafca714c07500d1d87bba224f12cf9cc2c8789.zip | |
Identify various flag labels and bit constants (#454)
Diffstat (limited to 'engine/overworld')
| -rw-r--r-- | engine/overworld/auto_movement.asm | 76 | ||||
| -rw-r--r-- | engine/overworld/cut.asm | 8 | ||||
| -rw-r--r-- | engine/overworld/emotion_bubbles.asm | 4 | ||||
| -rw-r--r-- | engine/overworld/field_move_messages.asm | 24 | ||||
| -rw-r--r-- | engine/overworld/hidden_objects.asm | 12 | ||||
| -rw-r--r-- | engine/overworld/ledges.asm | 8 | ||||
| -rw-r--r-- | engine/overworld/movement.asm | 22 | ||||
| -rw-r--r-- | engine/overworld/player_animations.asm | 32 | ||||
| -rw-r--r-- | engine/overworld/player_state.asm | 27 | ||||
| -rw-r--r-- | engine/overworld/push_boulder.asm | 38 | ||||
| -rw-r--r-- | engine/overworld/special_warps.asm | 30 | ||||
| -rw-r--r-- | engine/overworld/trainer_sight.asm | 4 |
12 files changed, 142 insertions, 143 deletions
diff --git a/engine/overworld/auto_movement.asm b/engine/overworld/auto_movement.asm index 53898371..8a45735f 100644 --- a/engine/overworld/auto_movement.asm +++ b/engine/overworld/auto_movement.asm @@ -1,12 +1,12 @@ PlayerStepOutFromDoor:: - ld hl, wd730 - res 1, [hl] + ld hl, wStatusFlags5 ; should this be wMovementFlags? + res BIT_EXITING_DOOR, [hl] call IsPlayerStandingOnDoorTile jr nc, .notStandingOnDoor ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a - ld hl, wd736 - set 1, [hl] + ld hl, wMovementFlags + set BIT_EXITING_DOOR, [hl] ld a, $1 ld [wSimulatedJoypadStatesIndex], a ld a, D_DOWN @@ -20,21 +20,21 @@ PlayerStepOutFromDoor:: ld [wUnusedOverrideSimulatedJoypadStatesIndex], a ld [wSimulatedJoypadStatesIndex], a ld [wSimulatedJoypadStatesEnd], a - ld hl, wd736 - res 0, [hl] - res 1, [hl] - ld hl, wd730 - res 7, [hl] + ld hl, wMovementFlags + res BIT_STANDING_ON_DOOR, [hl] + res BIT_EXITING_DOOR, [hl] + ld hl, wStatusFlags5 + res BIT_SCRIPTED_MOVEMENT_STATE, [hl] ret _EndNPCMovementScript:: - ld hl, wd730 - res 7, [hl] - ld hl, wd72e - res 7, [hl] - ld hl, wd736 - res 0, [hl] - res 1, [hl] + ld hl, wStatusFlags5 + res BIT_SCRIPTED_MOVEMENT_STATE, [hl] + ld hl, wStatusFlags4 + res BIT_INIT_SCRIPTED_MOVEMENT, [hl] + ld hl, wMovementFlags + res BIT_STANDING_ON_DOOR, [hl] + res BIT_EXITING_DOOR, [hl] xor a ld [wNPCMovementScriptSpriteOffset], a ld [wNPCMovementScriptPointerTableNum], a @@ -79,15 +79,15 @@ PalletMovementScript_OakMoveLeft: ld a, $3 ld [wNPCMovementScriptFunctionNum], a .done - ld hl, wFlags_D733 - set 1, [hl] + ld hl, wStatusFlags7 + set BIT_NO_MAP_MUSIC, [hl] ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ret PalletMovementScript_PlayerMoveLeft: - ld a, [wd730] - bit 0, a ; is an NPC being moved by a script? + ld a, [wStatusFlags5] + bit BIT_SCRIPTED_NPC_MOVEMENT, a ret nz ; return if Oak is still moving ld a, [wNumStepsToTake] ld [wSimulatedJoypadStatesIndex], a @@ -119,10 +119,10 @@ PalletMovementScript_WalkToLab: ld hl, wNPCMovementDirections2 ld de, RLEList_ProfOakWalkToLab call DecodeRLEList - ld hl, wd72e - res 7, [hl] - ld hl, wd730 - set 7, [hl] + ld hl, wStatusFlags4 + res BIT_INIT_SCRIPTED_MOVEMENT, [hl] + ld hl, wStatusFlags5 + set BIT_SCRIPTED_MOVEMENT_STATE, [hl] ld a, $4 ld [wNPCMovementScriptFunctionNum], a ret @@ -151,10 +151,10 @@ PalletMovementScript_Done: ld a, HS_PALLET_TOWN_OAK ld [wMissableObjectIndex], a predef HideObject - ld hl, wd730 - res 7, [hl] - ld hl, wd72e - res 7, [hl] + ld hl, wStatusFlags5 + res BIT_SCRIPTED_MOVEMENT_STATE, [hl] + ld hl, wStatusFlags4 + res BIT_INIT_SCRIPTED_MOVEMENT, [hl] jp EndNPCMovementScript PewterMuseumGuyMovementScriptPointerTable:: @@ -183,8 +183,8 @@ PewterMovementScript_WalkToMuseum: ld hl, wNPCMovementDirections2 ld de, RLEList_PewterMuseumGuy call DecodeRLEList - ld hl, wd72e - res 7, [hl] + ld hl, wStatusFlags4 + res BIT_INIT_SCRIPTED_MOVEMENT, [hl] ld a, $1 ld [wNPCMovementScriptFunctionNum], a ret @@ -207,10 +207,10 @@ PewterMovementScript_Done: ld a, [wSimulatedJoypadStatesIndex] and a ret nz - ld hl, wd730 - res 7, [hl] - ld hl, wd72e - res 7, [hl] + ld hl, wStatusFlags5 + res BIT_SCRIPTED_MOVEMENT_STATE, [hl] + ld hl, wStatusFlags4 + res BIT_INIT_SCRIPTED_MOVEMENT, [hl] jp EndNPCMovementScript PewterGymGuyMovementScriptPointerTable:: @@ -240,10 +240,10 @@ PewterMovementScript_WalkToGym: ld hl, wNPCMovementDirections2 ld de, RLEList_PewterGymGuy call DecodeRLEList - ld hl, wd72e - res 7, [hl] - ld hl, wd730 - set 7, [hl] + ld hl, wStatusFlags4 + res BIT_INIT_SCRIPTED_MOVEMENT, [hl] + ld hl, wStatusFlags5 + set BIT_SCRIPTED_MOVEMENT_STATE, [hl] ld a, $1 ld [wNPCMovementScriptFunctionNum], a ret diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 8ae9ed65..3e514672 100644 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -32,8 +32,8 @@ UsedCut: ld a, [wWhichPokemon] ld hl, wPartyMonNicks call GetPartyMonName - ld hl, wd730 - set 6, [hl] + ld hl, wStatusFlags5 + set BIT_NO_TEXT_DELAY, [hl] call GBPalWhiteOutWithDelay3 call ClearSprites call RestoreScreenTilesAndReloadTilePatterns @@ -49,8 +49,8 @@ UsedCut: ld hl, UsedCutText call PrintText call LoadScreenTilesFromBuffer2 - ld hl, wd730 - res 6, [hl] + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] ld a, $ff ld [wUpdateSpritesEnabled], a call InitCutAnimOAM diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 84b13f17..d25d5ff1 100644 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -15,8 +15,8 @@ EmotionBubble: push af ld a, $ff ld [wUpdateSpritesEnabled], a - ld a, [wd736] - bit 6, a ; are the last 4 OAM entries reserved for a shadow or fishing rod? + ld a, [wMovementFlags] + bit BIT_LEDGE_OR_FISHING, a ; are the last 4 OAM entries reserved for a shadow or fishing rod? ld hl, wShadowOAMSprite35Attributes ld de, wShadowOAMSprite39Attributes jr z, .next diff --git a/engine/overworld/field_move_messages.asm b/engine/overworld/field_move_messages.asm index d75ffc21..a9e29b63 100644 --- a/engine/overworld/field_move_messages.asm +++ b/engine/overworld/field_move_messages.asm @@ -1,6 +1,6 @@ -PrintStrengthTxt: - ld hl, wd728 - set 0, [hl] +PrintStrengthText: + ld hl, wStatusFlags1 + set BIT_STRENGTH_ACTIVE, [hl] ld hl, UsedStrengthText call PrintText ld hl, CanMoveBouldersText @@ -19,13 +19,13 @@ CanMoveBouldersText: text_end IsSurfingAllowed: -; Returns whether surfing is allowed in bit 1 of wd728. +; Returns whether surfing is allowed in BIT_SURF_ALLOWED of wStatusFlags1. ; Surfing isn't allowed on the Cycling Road or in the lowest level of the ; Seafoam Islands before the current has been slowed with boulders. - ld hl, wd728 - set 1, [hl] - ld a, [wd732] - bit 5, a + ld hl, wStatusFlags1 + set BIT_SURF_ALLOWED, [hl] + ld a, [wStatusFlags6] + bit BIT_ALWAYS_ON_BIKE, a jr nz, .forcedToRideBike ld a, [wCurMap] cp SEAFOAM_ISLANDS_B4F @@ -35,13 +35,13 @@ IsSurfingAllowed: ld hl, SeafoamIslandsB4FStairsCoords call ArePlayerCoordsInArray ret nc - ld hl, wd728 - res 1, [hl] + ld hl, wStatusFlags1 + res BIT_SURF_ALLOWED, [hl] ld hl, CurrentTooFastText jp PrintText .forcedToRideBike - ld hl, wd728 - res 1, [hl] + ld hl, wStatusFlags1 + res BIT_SURF_ALLOWED, [hl] ld hl, CyclingIsFunText jp PrintText diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm index 855328e7..2798864a 100644 --- a/engine/overworld/hidden_objects.asm +++ b/engine/overworld/hidden_objects.asm @@ -1,17 +1,17 @@ IsPlayerOnDungeonWarp:: xor a ld [wWhichDungeonWarp], a - ld a, [wd72d] - bit 4, a + ld a, [wStatusFlags3] + bit BIT_ON_DUNGEON_WARP, a ret nz call ArePlayerCoordsInArray ret nc ld a, [wCoordIndex] ld [wWhichDungeonWarp], a - ld hl, wd72d - set 4, [hl] - ld hl, wd732 - set 4, [hl] + ld hl, wStatusFlags3 + set BIT_ON_DUNGEON_WARP, [hl] + ld hl, wStatusFlags6 + set BIT_DUNGEON_WARP, [hl] ret ; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index 89e4ef57..73733e15 100644 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -1,6 +1,6 @@ HandleLedges:: - ld a, [wd736] - bit 6, a ; already jumping down ledge + ld a, [wMovementFlags] + bit BIT_LEDGE_OR_FISHING, a ret nz ld a, [wCurMapTileset] and a ; OVERWORLD @@ -41,8 +41,8 @@ HandleLedges:: ret z ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a - ld hl, wd736 - set 6, [hl] ; jumping down ledge + ld hl, wMovementFlags + set BIT_LEDGE_OR_FISHING, [hl] call StartSimulatingJoypadStates ld a, e ld [wSimulatedJoypadStatesEnd], a diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index afcb5907..1ca24f6a 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -60,8 +60,8 @@ UpdatePlayerSprite: bit 0, a jr nz, .notMoving .moving - ld a, [wd736] - bit 7, a ; is the player sprite spinning due to a spin tile? + ld a, [wMovementFlags] + bit BIT_SPINNING, a jr nz, .skipSpriteAnim ldh a, [hCurrentSpriteOffset] add $7 @@ -175,8 +175,8 @@ UpdateNPCSprite: jr nz, .next ; reached end of wNPCMovementDirections list ld [hl], a ; store $ff in movement byte 1, disabling scripted movement - ld hl, wd730 - res 0, [hl] + ld hl, wStatusFlags5 + res BIT_SCRIPTED_NPC_MOVEMENT, [hl] xor a ld [wSimulatedJoypadStatesIndex], a ld [wUnusedOverrideSimulatedJoypadStatesIndex], a @@ -409,8 +409,8 @@ MakeNPCFacePlayer: ; Check if the behaviour of the NPC facing the player when spoken to is ; disabled. This is only done when rubbing the S.S. Anne captain's back. - ld a, [wd72d] - bit 5, a + ld a, [wStatusFlags3] + bit BIT_NO_NPC_FACE_PLAYER, a jr nz, notYetMoving res 7, [hl] ld a, [wPlayerDirection] @@ -740,12 +740,12 @@ DoScriptedNPCMovement: ; a few times in the game. It is used when the NPC and player must walk together ; in sync, such as when the player is following the NPC somewhere. An NPC can't ; be moved in sync with the player using the other method. - ld a, [wd730] - bit 7, a + ld a, [wStatusFlags5] + bit BIT_SCRIPTED_MOVEMENT_STATE, a ret z - ld hl, wd72e - bit 7, [hl] - set 7, [hl] + ld hl, wStatusFlags4 + bit BIT_INIT_SCRIPTED_MOVEMENT, [hl] + set BIT_INIT_SCRIPTED_MOVEMENT, [hl] jp z, InitScriptedNPCMovement ld hl, wNPCMovementDirections2 ld a, [wNPCMovementDirections2Index] diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index bec59369..210599da 100644 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -5,15 +5,15 @@ EnterMapAnim:: call Delay3 push hl call GBFadeInFromWhite - ld hl, wFlags_D733 - bit 7, [hl] ; used fly out of battle? - res 7, [hl] + ld hl, wStatusFlags7 + bit BIT_USED_FLY, [hl] + res BIT_USED_FLY, [hl] jr nz, .flyAnimation ld a, SFX_TELEPORT_ENTER_1 call PlaySound - ld hl, wd732 - bit 4, [hl] ; used dungeon warp? - res 4, [hl] + ld hl, wStatusFlags6 + bit BIT_DUNGEON_WARP, [hl] + res BIT_DUNGEON_WARP, [hl] pop hl jr nz, .dungeonWarpAnimation call PlayerSpinWhileMovingDown @@ -122,8 +122,8 @@ _LeaveMapAnim:: .playerNotStandingOnWarpPadOrHole ld a, $4 call StopMusic - ld a, [wd732] - bit 6, a ; is the last used pokemon center the destination? + ld a, [wStatusFlags6] + bit BIT_ESCAPE_WARP, a jr z, .flyAnimation ; if going to the last used pokemon center ld hl, wPlayerSpinInPlaceAnimFrameDelay @@ -378,8 +378,8 @@ INCLUDE "data/tilesets/warp_pad_hole_tile_ids.asm" FishingAnim: ld c, 10 call DelayFrames - ld hl, wd736 - set 6, [hl] ; reserve the last 4 OAM entries + ld hl, wMovementFlags + set BIT_LEDGE_OR_FISHING, [hl] ld de, RedSprite ld hl, vNPCSprites tile $00 lb bc, BANK(RedSprite), 12 @@ -445,8 +445,8 @@ FishingAnim: .done call PrintText - ld hl, wd736 - res 6, [hl] ; unreserve the last 4 OAM entries + ld hl, wMovementFlags + res BIT_LEDGE_OR_FISHING, [hl] call LoadFontTilePatterns ret @@ -512,10 +512,10 @@ _HandleMidJump:: ldh [hJoyPressed], a ldh [hJoyReleased], a ld [wPlayerJumpingYScreenCoordsIndex], a - ld hl, wd736 - res 6, [hl] ; not jumping down a ledge any more - ld hl, wd730 - res 7, [hl] ; not simulating joypad states any more + ld hl, wMovementFlags + res BIT_LEDGE_OR_FISHING, [hl] + ld hl, wStatusFlags5 + res BIT_SCRIPTED_MOVEMENT_STATE, [hl] xor a ld [wJoyIgnore], a ret diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm index 80b132ac..4711bb5c 100644 --- a/engine/overworld/player_state.asm +++ b/engine/overworld/player_state.asm @@ -1,4 +1,4 @@ -; only used for setting bit 2 of wd736 upon entering a new map +; only used for setting BIT_STANDING_ON_WARP of wMovementFlags upon entering a new map IsPlayerStandingOnWarp:: ld a, [wNumberOfWarps] and a @@ -18,8 +18,8 @@ IsPlayerStandingOnWarp:: ld [wDestinationWarpID], a ld a, [hl] ; target map ldh [hWarpDestinationMap], a - ld hl, wd736 - set 2, [hl] ; standing on warp flag + ld hl, wMovementFlags + set BIT_STANDING_ON_WARP, [hl] ret .nextWarp1 inc hl @@ -32,8 +32,8 @@ IsPlayerStandingOnWarp:: ret CheckForceBikeOrSurf:: - ld hl, wd732 - bit 5, [hl] + ld hl, wStatusFlags6 + bit BIT_ALWAYS_ON_BIKE, [hl] ret nz ld hl, ForcedBikeOrSurfMaps ld a, [wYCoord] @@ -45,14 +45,14 @@ CheckForceBikeOrSurf:: .loop ld a, [hli] cp $ff - ret z ;if we reach FF then it's not part of the list - cp d ;compare to current map + ret z ; if we reach FF then it's not part of the list + cp d ; compare to current map jr nz, .incorrectMap ld a, [hli] - cp b ;compare y-coord + cp b ; compare y-coord jr nz, .incorrectY ld a, [hli] - cp c ;compare x-coord + cp c ; compare x-coord jr nz, .loop ; incorrect x-coord, check next item ld a, [wCurMap] cp SEAFOAM_ISLANDS_B3F @@ -64,9 +64,8 @@ CheckForceBikeOrSurf:: ld a, SCRIPT_SEAFOAMISLANDSB4F_MOVE_OBJECT ld [wSeafoamIslandsB4FCurScript], a jr z, .forceSurfing - ;force bike riding - ld hl, wd732 - set 5, [hl] + ld hl, wStatusFlags6 + set BIT_ALWAYS_ON_BIKE, [hl] ld a, $1 ld [wWalkBikeSurfState], a ld [wWalkBikeSurfStateCopy], a @@ -207,8 +206,8 @@ IsPlayerStandingOnDoorTileOrWarpTile:: lda_coord 8, 9 call IsInArray jr nc, .done - ld hl, wd736 - res 2, [hl] + ld hl, wMovementFlags + res BIT_STANDING_ON_WARP, [hl] .done pop bc pop de diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm index 96c506c0..7eee844c 100644 --- a/engine/overworld/push_boulder.asm +++ b/engine/overworld/push_boulder.asm @@ -1,9 +1,9 @@ TryPushingBoulder:: - ld a, [wd728] - bit 0, a ; using Strength? + ld a, [wStatusFlags1] + bit BIT_STRENGTH_ACTIVE, a ret z - ld a, [wFlags_0xcd60] - bit 1, a ; has boulder dust animation from previous push played yet? + ld a, [wMiscFlags] + bit BIT_BOULDER_DUST, a ret nz xor a ldh [hSpriteIndexOrTextID], a @@ -23,9 +23,9 @@ TryPushingBoulder:: ld a, [hl] cp BOULDER_MOVEMENT_BYTE_2 jp nz, ResetBoulderPushFlags - ld hl, wFlags_0xcd60 - bit 6, [hl] - set 6, [hl] ; indicate that the player has tried pushing + ld hl, wMiscFlags + bit BIT_TRIED_PUSH_BOULDER, [hl] + set BIT_TRIED_PUSH_BOULDER, [hl] ret z ; the player must try pushing twice before the boulder will move ldh a, [hJoyHeld] and D_RIGHT | D_LEFT | D_UP | D_DOWN @@ -44,30 +44,30 @@ TryPushingBoulder:: cp SPRITE_FACING_RIGHT jr z, .pushBoulderRight .pushBoulderDown - bit 7, b + bit BIT_D_DOWN, b ret z ld de, PushBoulderDownMovementData jr .done .pushBoulderUp - bit 6, b + bit BIT_D_UP, b ret z ld de, PushBoulderUpMovementData jr .done .pushBoulderLeft - bit 5, b + bit BIT_D_LEFT, b ret z ld de, PushBoulderLeftMovementData jr .done .pushBoulderRight - bit 4, b + bit BIT_D_RIGHT, b ret z ld de, PushBoulderRightMovementData .done call MoveSprite ld a, SFX_PUSH_BOULDER call PlaySound - ld hl, wFlags_0xcd60 - set 1, [hl] + ld hl, wMiscFlags + set BIT_BOULDER_DUST, [hl] ret PushBoulderUpMovementData: @@ -87,14 +87,14 @@ PushBoulderRightMovementData: db -1 ; end DoBoulderDustAnimation:: - ld a, [wd730] - bit 0, a + ld a, [wStatusFlags5] + bit BIT_SCRIPTED_NPC_MOVEMENT, a ret nz callfar AnimateBoulderDust call DiscardButtonPresses ld [wJoyIgnore], a call ResetBoulderPushFlags - set 7, [hl] ; [wFlags_0xcd60] + set BIT_PUSHED_BOULDER, [hl] ld a, [wBoulderSpriteIndex] ldh [hSpriteIndex], a call GetSpriteMovementByte2Pointer @@ -103,7 +103,7 @@ DoBoulderDustAnimation:: jp PlaySound ResetBoulderPushFlags: - ld hl, wFlags_0xcd60 - res 1, [hl] - res 6, [hl] + ld hl, wMiscFlags + res BIT_BOULDER_DUST, [hl] + res BIT_TRIED_PUSH_BOULDER, [hl] ret diff --git a/engine/overworld/special_warps.asm b/engine/overworld/special_warps.asm index 0cc2a474..303415c1 100644 --- a/engine/overworld/special_warps.asm +++ b/engine/overworld/special_warps.asm @@ -1,9 +1,9 @@ PrepareForSpecialWarp:: call LoadSpecialWarpData predef LoadTilesetHeader - ld hl, wd732 - bit 2, [hl] ; dungeon warp or fly warp? - res 2, [hl] + ld hl, wStatusFlags6 + bit BIT_FLY_OR_DUNGEON_WARP, [hl] + res BIT_FLY_OR_DUNGEON_WARP, [hl] jr z, .debugNewGameWarp ld a, [wDestinationMap] jr .next @@ -17,19 +17,19 @@ PrepareForSpecialWarp:: ld a, PALLET_TOWN .next ld b, a - ld a, [wd72d] - and a + ld a, [wStatusFlags3] + and a ; ??? jr nz, .next2 ld a, b .next2 - ld hl, wd732 - bit 4, [hl] ; dungeon warp + ld hl, wStatusFlags6 + bit BIT_DUNGEON_WARP, [hl] ret nz ld [wLastMap], a ret LoadSpecialWarpData: - ld a, [wd72d] + ld a, [wCableClubDestinationMap] cp TRADE_CENTER jr nz, .notTradeCenter ld hl, TradeCenterPlayerWarp @@ -48,7 +48,7 @@ LoadSpecialWarpData: ld hl, ColosseumFriendWarp jr .copyWarpData .notColosseum - ld a, [wd732] + ld a, [wStatusFlags6] bit BIT_DEBUG_MODE, a ; warp to wLastMap (PALLET_TOWN) for StartNewGameDebug jr nz, .notNewGameWarp @@ -70,17 +70,17 @@ LoadSpecialWarpData: jr .done .notNewGameWarp ld a, [wLastMap] ; this value is overwritten before it's ever read - ld hl, wd732 - bit 4, [hl] ; dungeon warp + ld hl, wStatusFlags6 + bit BIT_DUNGEON_WARP, [hl] jr nz, .usedDungeonWarp - bit 6, [hl] ; blacked out - res 6, [hl] + bit BIT_ESCAPE_WARP, [hl] + res BIT_ESCAPE_WARP, [hl] jr z, .otherDestination ld a, [wLastBlackoutMap] jr .usedFlyWarp .usedDungeonWarp - ld hl, wd72d - res 4, [hl] + ld hl, wStatusFlags3 + res BIT_ON_DUNGEON_WARP, [hl] ld a, [wDungeonWarpDestinationMap] ld b, a ld [wCurMap], a diff --git a/engine/overworld/trainer_sight.asm b/engine/overworld/trainer_sight.asm index 816dea7f..f32b558a 100644 --- a/engine/overworld/trainer_sight.asm +++ b/engine/overworld/trainer_sight.asm @@ -221,8 +221,8 @@ TrainerEngage: ld a, [wTrainerSpriteOffset] and a jr z, .noEngage - ld hl, wFlags_0xcd60 - set 0, [hl] + ld hl, wMiscFlags + set BIT_SEEN_BY_TRAINER, [hl] call EngageMapTrainer ld a, $ff .noEngage |
