diff options
Diffstat (limited to 'engine/overworld')
-rwxr-xr-x | engine/overworld/cable_club_npc.asm | 12 | ||||
-rwxr-xr-x | engine/overworld/card_key.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/cinnabar_lab.asm | 14 | ||||
-rwxr-xr-x | engine/overworld/cut.asm | 54 | ||||
-rwxr-xr-x | engine/overworld/cut2.asm | 8 | ||||
-rwxr-xr-x | engine/overworld/doors.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/elevator.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/emotion_bubbles.asm | 6 | ||||
-rwxr-xr-x | engine/overworld/healing_machine.asm | 18 | ||||
-rwxr-xr-x | engine/overworld/hidden_items.asm | 18 | ||||
-rw-r--r-- | engine/overworld/item.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/ledges.asm | 2 | ||||
-rw-r--r-- | engine/overworld/movement.asm | 56 | ||||
-rwxr-xr-x | engine/overworld/npc_movement.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/oaks_aide.asm | 14 | ||||
-rwxr-xr-x | engine/overworld/player_animations.asm | 22 | ||||
-rwxr-xr-x | engine/overworld/pokecenter.asm | 2 | ||||
-rwxr-xr-x | engine/overworld/pokemart.asm | 8 | ||||
-rwxr-xr-x | engine/overworld/ssanne.asm | 2 | ||||
-rwxr-xr-x | engine/overworld/trainers.asm | 24 |
20 files changed, 139 insertions, 141 deletions
diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm index bdab41a6..86a7ab7d 100755 --- a/engine/overworld/cable_club_npc.asm +++ b/engine/overworld/cable_club_npc.asm @@ -5,7 +5,7 @@ CableClubNPC: ; 71c5 (1:71c5) bit 5, a ; received pokedex? jp nz, .receivedPokedex ; if the player hasn't received the pokedex - ld c, $3c + ld c, 60 call DelayFrames ld hl, CableClubNPCMakingPreparationsText call PrintText @@ -72,24 +72,24 @@ CableClubNPC: ; 71c5 (1:71c5) ld hl, wUnknownSerialCounter ld a, [hli] inc a - jr nz, Func_72a8 ; 0x726b $3b + jr nz, Func_72a8 ld a, [hl] inc a - jr nz, Func_72a8 ; 0x726f $37 + jr nz, Func_72a8 ld b, $a .asm_7273 call DelayFrame call Serial_SendZeroByte dec b - jr nz, .asm_7273 ; 0x727a $f7 + jr nz, .asm_7273 call CloseLinkConnection ld hl, CableClubNPCLinkClosedBecauseOfInactivityText call PrintText - jr Func_7298 ; 0x7285 $11 + jr Func_7298 .failedToEstablishConnection ld hl, CableClubNPCAreaReservedFor2FriendsLinkedByCableText call PrintText - jr Func_7298 ; 0x728d $9 + jr Func_7298 .choseNo call CloseLinkConnection ld hl, CableClubNPCPleaseComeAgainText diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm index c4df0d51..94c1868c 100755 --- a/engine/overworld/card_key.asm +++ b/engine/overworld/card_key.asm @@ -27,7 +27,7 @@ PrintCardKeyText: ; 52673 (14:6673) jr z, .noCardKey call GetCoordsInFrontOfPlayer push de - ld a, $1 + tx_pre_id CardKeySuccessText ld [H_DOWNARROWBLINKCNT2], a call PrintPredefTextID pop de @@ -54,7 +54,7 @@ PrintCardKeyText: ; 52673 (14:6673) ld a, (SFX_1f_57 - SFX_Headers_1f) / 3 jp PlaySound .noCardKey - ld a, $2 + tx_pre_id CardKeyFailText ld [H_DOWNARROWBLINKCNT2], a jp PrintPredefTextID diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm index eefa2176..a23348db 100755 --- a/engine/overworld/cinnabar_lab.asm +++ b/engine/overworld/cinnabar_lab.asm @@ -2,16 +2,16 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) ld hl, wd730 set 6, [hl] xor a - ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wCurrentMenuItem], a ld a, $3 - ld [wMenuWatchedKeys], a ; wMenuWatchedKeys + ld [wMenuWatchedKeys], a ld a, [wcd37] dec a - ld [wMaxMenuItem], a ; wMaxMenuItem + ld [wMaxMenuItem], a ld a, $2 - ld [wTopMenuItemY], a ; wTopMenuItemY + ld [wTopMenuItemY], a ld a, $1 - ld [wTopMenuItemX], a ; wTopMenuItemX + ld [wTopMenuItemX], a ld a, [wcd37] dec a ld bc, $2 @@ -30,7 +30,7 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) bit 1, a jr nz, .asm_610a7 ld hl, wcc5b - ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld a, [wCurrentMenuItem] ld d, $0 ld e, a add hl, de @@ -55,7 +55,7 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) ld hl, LabFossil_610ae call PrintText call YesNoChoice - ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld a, [wCurrentMenuItem] and a jr nz, .asm_610a7 ld hl, LabFossil_610b3 diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 7b92bca3..26a65b5b 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -1,7 +1,7 @@ UsedCut: ; ef54 (3:6f54) xor a ld [wcd6a], a - ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET + ld a, [W_CURMAPTILESET] and a ; OVERWORLD jr z, .asm_ef6b cp GYM @@ -9,28 +9,28 @@ UsedCut: ; ef54 (3:6f54) ld a, [wTileInFrontOfPlayer] cp $50 ; gym cut tree jr nz, .asm_ef77 - jr asm_ef82 + jr .asm_ef82 .asm_ef6b dec a ld a, [wTileInFrontOfPlayer] cp $3d ; cut tree - jr z, asm_ef82 + jr z, .asm_ef82 cp $52 ; grass - jr z, asm_ef82 + jr z, .asm_ef82 .asm_ef77 - ld hl, NothingToCutText + ld hl, .NothingToCutText jp PrintText -NothingToCutText: ; ef7d (3:6f7d) +.NothingToCutText TX_FAR _NothingToCutText db "@" -asm_ef82: ; ef82 (3:6f82) +.asm_ef82 ld [wcd4d], a ld a, $1 ld [wcd6a], a - ld a, [wWhichPokemon] ; wWhichPokemon - ld hl, wPartyMonNicks ; wPartyMonNicks + ld a, [wWhichPokemon] + ld hl, wPartyMonNicks call GetPartyMonName ld hl, wd730 set 6, [hl] @@ -54,7 +54,7 @@ asm_ef82: ; ef82 (3:6f82) ld a, $ff ld [wUpdateSpritesEnabled], a call AnimateCutTree - ld de, CutTreeBlockSwaps ; $7100 + ld de, CutTreeBlockSwaps call Func_f09f call RedrawMapView callba Func_79e96 @@ -75,15 +75,15 @@ AnimateCutTree: ; eff7 (3:6ff7) xor a ld [wcd50], a ld a, $e4 - ld [rOBP1], a ; $ff49 + ld [rOBP1], a ld a, [wcd4d] cp $52 jr z, .asm_f020 - ld de, Overworld_GFX + $2d0 ; $42d0 ; cuttable tree sprite top row + ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row ld hl, vChars1 + $7c0 ld bc, (BANK(Overworld_GFX) << 8) + $02 call CopyVideoData - ld de, Overworld_GFX + $3d0 ; $43d0 ; cuttable tree sprite bottom row + ld de, Overworld_GFX + $3d0 ; cuttable tree sprite bottom row ld hl, vChars1 + $7e0 ld bc, (BANK(Overworld_GFX) << 8) + $02 call CopyVideoData @@ -111,7 +111,7 @@ AnimateCutTree: ; eff7 (3:6ff7) ret LoadCutTreeAnimationTilePattern: ; f04c (3:704c) - ld de, AnimationTileset2 + $60 ; $474e ; tile depicting a leaf + ld de, AnimationTileset2 + $60 ; tile depicting a leaf ld bc, (BANK(AnimationTileset2) << 8) + $01 jp CopyVideoData @@ -173,7 +173,7 @@ BoulderDustAnimationOffsets: ; f097 (3:7097) Func_f09f: ; f09f (3:709f) push de - ld a, [W_CURMAPWIDTH] ; wd369 + ld a, [W_CURMAPWIDTH] add $6 ld c, a ld b, $0 @@ -185,27 +185,27 @@ Func_f09f: ; f09f (3:709f) add hl, bc ld a, [wSpriteStateData1 + 9] and a - jr z, .asm_f0c7 - cp $4 - jr z, .asm_f0cf - cp $8 - jr z, .asm_f0d7 - ld a, [W_XBLOCKCOORD] ; wd364 + jr z, .down + cp SPRITE_FACING_UP + jr z, .up + cp SPRITE_FACING_LEFT + jr z, .left + ld a, [W_XBLOCKCOORD] and a jr z, .asm_f0e0 jr .asm_f0ec -.asm_f0c7 - ld a, [W_YBLOCKCOORD] ; wd363 +.down + ld a, [W_YBLOCKCOORD] and a jr z, .asm_f0e0 jr .asm_f0df -.asm_f0cf - ld a, [W_YBLOCKCOORD] ; wd363 +.up + ld a, [W_YBLOCKCOORD] and a jr z, .asm_f0e1 jr .asm_f0e0 -.asm_f0d7 - ld a, [W_XBLOCKCOORD] ; wd364 +.left + ld a, [W_XBLOCKCOORD] and a jr z, .asm_f0e6 jr .asm_f0e0 diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm index de2b9d55..9cb011b4 100755 --- a/engine/overworld/cut2.asm +++ b/engine/overworld/cut2.asm @@ -15,9 +15,9 @@ Func_79e96: ; 79e96 (1e:5e96) ld [wd08a], a ld c, $2 call AdjustOAMBlockXPos2 - ld a, [rOBP1] ; $ff49 + ld a, [rOBP1] xor $64 - ld [rOBP1], a ; $ff49 + ld [rOBP1], a call DelayFrame pop bc dec c @@ -65,9 +65,9 @@ Func_79eed: ; 79eed (1e:5eed) ld [wd08a], a ld c, $1 call AdjustOAMBlockXPos2 - ld a, [rOBP1] ; $ff49 + ld a, [rOBP1] xor $64 - ld [rOBP1], a ; $ff49 + ld [rOBP1], a call DelayFrame pop bc dec c diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm index ac345af9..641c021f 100755 --- a/engine/overworld/doors.asm +++ b/engine/overworld/doors.asm @@ -1,8 +1,8 @@ ; returns whether the player is standing on a door tile in carry IsPlayerStandingOnDoorTile: ; 1a609 (6:6609) push de - ld hl, DoorTileIDPointers ; $662c - ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET + ld hl, DoorTileIDPointers + ld a, [W_CURMAPTILESET] ld de, $3 call IsInArray pop de diff --git a/engine/overworld/elevator.asm b/engine/overworld/elevator.asm index 3a23d410..f5b1d14c 100755 --- a/engine/overworld/elevator.asm +++ b/engine/overworld/elevator.asm @@ -10,7 +10,7 @@ ShakeElevator: ; 7bf15 (1e:7f15) ld d, a ld e, $1 ; number of times to play collision sfx - ld b, $64 + ld b, 100 .asm_7bf30 ld a, e xor $fe @@ -22,7 +22,7 @@ ShakeElevator: ; 7bf15 (1e:7f15) ld a, (SFX_02_5b - SFX_Headers_02) / 3 call PlayMusic pop bc - ld c, $2 + ld c, 2 call DelayFrames dec b jr nz, .asm_7bf30 diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 7106063b..01b3ae85 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -2,7 +2,7 @@ EmotionBubble: ; 17c47 (5:7c47) ld a, [wcd50] ld c, a ld b, $0 - ld hl, EmotionBubblesPointerTable ; $7caf + ld hl, EmotionBubblesPointerTable add hl, bc add hl, bc ld e, [hl] @@ -45,10 +45,10 @@ EmotionBubble: ; 17c47 (5:7c47) ld a, [hl] add $8 ld c, a - ld de, EmotionBubblesOAM ; $7cb5 + ld de, EmotionBubblesOAM xor a call WriteOAMBlock - ld c, $3c + ld c, 60 call DelayFrames pop af ld [wUpdateSpritesEnabled], a diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index 90d306c3..d00bbc05 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -1,5 +1,5 @@ AnimateHealingMachine: ; 70433 (1c:4433) - ld de, PokeCenterFlashingMonitorAndHealBall ; $44b7 + ld de, PokeCenterFlashingMonitorAndHealBall ld hl, vChars0 + $7c0 ld bc, (BANK(PokeCenterFlashingMonitorAndHealBall) << 8) + $03 call CopyVideoData @@ -8,12 +8,12 @@ AnimateHealingMachine: ; 70433 (1c:4433) push af ld [hl], $ff push hl - ld a, [rOBP1] ; $ff49 + ld a, [rOBP1] push af ld a, $e0 - ld [rOBP1], a ; $ff49 + ld [rOBP1], a ld hl, wOAMBuffer + $84 - ld de, PokeCenterOAMData ; $44d7 + ld de, PokeCenterOAMData call Func_70503 ld a, $4 ld [wMusicHeaderPointer], a @@ -24,18 +24,18 @@ AnimateHealingMachine: ; 70433 (1c:4433) ld a, [wMusicHeaderPointer] and a jr nz, .asm_70464 - ld a, [wPartyCount] ; wPartyCount + ld a, [wPartyCount] ld b, a .asm_7046e call Func_70503 ld a, (SFX_02_4a - SFX_Headers_02) / 3 call PlaySound - ld c, $1e + ld c, 30 call DelayFrames dec b jr nz, .asm_7046e ld a, [wc0ef] - cp $1f + cp BANK(Music1f_UpdateMusic) ld [wc0f0], a jr nz, .asm_70495 ld a, $ff @@ -53,10 +53,10 @@ AnimateHealingMachine: ; 70433 (1c:4433) ld a, [wc026] cp MUSIC_PKMN_HEALED jr z, .asm_704a2 - ld c, $20 + ld c, 32 call DelayFrames pop af - ld [rOBP1], a ; $ff49 + ld [rOBP1], a pop hl pop af ld [hl], a diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm index 17288a17..868f118f 100755 --- a/engine/overworld/hidden_items.asm +++ b/engine/overworld/hidden_items.asm @@ -16,15 +16,13 @@ HiddenItems: ; 76688 (1d:6688) ld a, [wWhichTrade] ; item ID ld [wd11e], a call GetItemName - ld a, $24 - jp PrintPredefTextID + tx_pre_jump FoundHiddenItemText INCLUDE "data/hidden_item_coords.asm" FoundHiddenItemText: ; 7675b (1d:675b) -; XXX where is the pointer to this? TX_FAR _FoundHiddenItemText - db $8 + TX_ASM ld a, [wWhichTrade] ; item ID ld b, a ld c, 1 @@ -36,8 +34,8 @@ FoundHiddenItemText: ; 7675b (1d:675b) ld b, $1 predef FlagActionPredef ld a, (SFX_02_3b - SFX_Headers_02) / 3 - call PlaySoundWaitForCurrent ; play sound - call WaitForSoundToFinish ; wait for sound to finish playing + call PlaySoundWaitForCurrent + call WaitForSoundToFinish jp TextScriptEnd .BagFull call WaitForTextScrollButtonPress ; wait for button press @@ -113,10 +111,10 @@ HiddenCoins: ; 76799 (1d:6799) ld a, [wPlayerCoins + 1] cp $99 jr nz, .RoomInCoinCase - ld a, $2c + tx_pre_id DroppedHiddenCoinsText jr .done .RoomInCoinCase - ld a, $2b + tx_pre_id FoundHiddenCoinsText .done jp PrintPredefTextID @@ -146,10 +144,10 @@ Func_76857: ; 76857 (1d:6857) cp $ff ; end of the list? ret z ; if so, we're done here cp b - jr nz, .asm_76877 ; 0x7686b $a + jr nz, .asm_76877 ld a, [hli] cp d - jr nz, .asm_76878 ; 0x7686f $7 + jr nz, .asm_76878 ld a, [hli] cp e jr nz, .loop diff --git a/engine/overworld/item.asm b/engine/overworld/item.asm index a49fc268..b00405bf 100644 --- a/engine/overworld/item.asm +++ b/engine/overworld/item.asm @@ -1,7 +1,7 @@ PickupItem: call EnableAutoTextBoxDrawing - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + ld a, [H_DOWNARROWBLINKCNT2] ld b, a ld hl, W_MISSABLEOBJECTLIST .missableObjectsListLoop @@ -18,7 +18,7 @@ PickupItem: ld [$ffdb], a ld hl, W_MAPSPRITEEXTRADATA - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + ld a, [H_DOWNARROWBLINKCNT2] dec a add a ld d, 0 diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index b8c19181..3a183c0f 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -2,7 +2,7 @@ HandleLedges: ; 1a672 (6:6672) ld a, [wd736] bit 6, a ; already jumping down ledge ret nz - ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET + ld a, [W_CURMAPTILESET] and a ; OVERWORLD ret nz predef GetTileAndCoordsInFrontOfPlayer diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index c4482700..dac03f3a 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -22,39 +22,39 @@ UpdatePlayerSprite: ; 4e31 (1:4e31) .lowerLeftTileIsMapTile call DetectCollisionBetweenSprites ld h, $c1 - ld a, [wWalkCounter] ; wcfc5 + ld a, [wWalkCounter] and a jr nz, .asm_4e90 ld a, [wd528] bit 2, a - jr z, .asm_4e65 - xor a - jr .asm_4e86 -.asm_4e65 + jr z, .notDown + xor a ; ld a, SPRITE_FACING_DOWN + jr .done +.notDown bit 3, a - jr z, .asm_4e6d - ld a, $4 - jr .asm_4e86 -.asm_4e6d + jr z, .notUp + ld a, SPRITE_FACING_UP + jr .done +.notUp bit 1, a - jr z, .asm_4e75 - ld a, $8 - jr .asm_4e86 -.asm_4e75 + jr z, .notLeft + ld a, SPRITE_FACING_LEFT + jr .done +.notLeft bit 0, a - jr z, .asm_4e7d - ld a, $c - jr .asm_4e86 -.asm_4e7d + jr z, .notRight + ld a, SPRITE_FACING_RIGHT + jr .done +.notRight xor a ld [wSpriteStateData1 + 7], a ld [wSpriteStateData1 + 8], a jr .asm_4eab -.asm_4e86 +.done ld [wSpriteStateData1 + 9], a ld a, [wFontLoaded] bit 0, a - jr nz, .asm_4e7d + jr nz, .notRight .asm_4e90 ld a, [wd736] bit 7, a @@ -108,7 +108,7 @@ Func_4ed1: ; 4ed1 (1:4ed1) swap a dec a add a - ld hl, W_MAPSPRITEDATA ; wd4e4 + ld hl, W_MAPSPRITEDATA add l ld l, a ld a, [hl] ; read movement byte 2 @@ -138,7 +138,7 @@ Func_4ed1: ; 4ed1 (1:4ed1) jp z, UpdateSpriteMovementDelay ; c1x1 == 2 cp $3 jp z, UpdateSpriteInWalkingAnimation ; c1x1 == 3 - ld a, [wWalkCounter] ; wcfc5 + ld a, [wWalkCounter] and a ret nz ; don't do anything yet if player is currently moving (redundant, already tested in CheckSpriteAvailability) call InitializeSpriteScreenPosition @@ -212,7 +212,7 @@ Func_4ed1: ; 4ed1 (1:4ed1) cp $2 jr z, .moveRight ; movement byte 2 = $2 only allows left or right .moveUp - ld de, -2*20 ; $ffd8 + ld de, -2*20 add hl, de ; move tile pointer two rows up ld de, $ff00 ld bc, $804 @@ -440,7 +440,7 @@ InitializeSpriteScreenPosition: ; 50bd (1:50bd) ld a, [H_CURRENTSPRITEOFFSET] add $4 ld l, a - ld a, [W_YCOORD] ; wd361 + ld a, [W_YCOORD] ld b, a ld a, [hl] ; c2x4 (Y position + 4) sub b ; relative to player position @@ -449,7 +449,7 @@ InitializeSpriteScreenPosition: ; 50bd (1:50bd) dec h ld [hli], a ; c1x4 (screen Y position) inc h - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] ld b, a ld a, [hli] ; c2x6 (X position + 4) sub b ; relative to player position @@ -475,7 +475,7 @@ CheckSpriteAvailability: ; 50dc (1:50dc) add $4 ld l, a ld b, [hl] ; c2x4: Y pos (+4) - ld a, [W_YCOORD] ; wd361 + ld a, [W_YCOORD] cp b jr z, .skipYVisibilityTest jr nc, .spriteInvisible ; above screen region @@ -485,7 +485,7 @@ CheckSpriteAvailability: ; 50dc (1:50dc) .skipYVisibilityTest inc l ld b, [hl] ; c2x5: X pos (+4) - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] cp b jr z, .skipXVisibilityTest jr nc, .spriteInvisible ; left of screen region @@ -503,7 +503,7 @@ CheckSpriteAvailability: ; 50dc (1:50dc) ld a, [hld] cp d jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom right tile) - ld bc, -20 ; $ffec + ld bc, -20 add hl, bc ; go back one row of tiles ld a, [hli] cp d @@ -521,7 +521,7 @@ CheckSpriteAvailability: ; 50dc (1:50dc) jr .done .spriteVisible ld c, a - ld a, [wWalkCounter] ; wcfc5 + ld a, [wWalkCounter] and a jr nz, .done ; if player is currently walking, we're done call UpdateSpriteImage diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index 84e39853..73a3fdfb 100755 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -52,7 +52,7 @@ ProfOakMovementScriptPointerTable: ; 1a442 (6:6442) dw Func_1a4f4 Func_1a44c: ; 1a44c (6:644c) - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] sub $a ld [wcca1], a jr z, .asm_1a475 @@ -63,7 +63,7 @@ Func_1a44c: ; 1a44c (6:644c) call FillMemory ld [hl], $ff ld a, [wSpriteIndex] - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a ld de, wNPCMovementDirections2 call MoveSprite ld a, $1 diff --git a/engine/overworld/oaks_aide.asm b/engine/overworld/oaks_aide.asm index 68135287..00f6ea82 100755 --- a/engine/overworld/oaks_aide.asm +++ b/engine/overworld/oaks_aide.asm @@ -1,10 +1,10 @@ -OaksAideScript ; 0x59035 +OaksAideScript: ; 0x59035 ld hl, OaksAideHiText call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_59086 ; 0x59042 $42 + jr nz, .asm_59086 ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits @@ -13,8 +13,8 @@ OaksAideScript ; 0x59035 ld b, a ld a, [$ffdb] cp b - jr z, .asm_59059 ; 0x59055 $2 - jr nc, .asm_5907c ; 0x59057 $23 + jr z, .asm_59059 + jr nc, .asm_5907c .asm_59059 ld hl, OaksAideHereYouGoText call PrintText @@ -26,17 +26,17 @@ OaksAideScript ; 0x59035 ld hl, OaksAideGotItemText call PrintText ld a, $1 - jr .asm_5908e ; 0x59071 $1b + jr .asm_5908e .BagFull ld hl, OaksAideNoRoomText call PrintText xor a - jr .asm_5908e ; 0x5907a $12 + jr .asm_5908e .asm_5907c ld hl, OaksAideUhOhText call PrintText ld a, $80 - jr .asm_5908e ; 0x59084 $8 + jr .asm_5908e .asm_59086 ld hl, OaksAideComeBackText call PrintText diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index 6602cedd..d68e4e57 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -58,7 +58,7 @@ EnterMapAnim: ; 70510 (1c:4510) ld a, 12 ld [hli], a ; wFlyAnimCounter ld [hl], $8 ; wFlyAnimBirdSpriteImageIndex (facing right) - ld de, FlyAnimationEnterScreenCoords ; $4592 + ld de, FlyAnimationEnterScreenCoords call DoFlyAnimation call LoadPlayerSpriteGraphics jr .restoreDefaultMusic @@ -154,7 +154,7 @@ _LeaveMapAnim: ; 705ba (1c:45ba) ld a, $c ld [hli], a ; wFlyAnimCounter ld [hl], $c ; wFlyAnimBirdSpriteImageIndex (facing right) - ld de, FlyAnimationScreenCoords1 ; $464f + ld de, FlyAnimationScreenCoords1 call DoFlyAnimation ld c, 40 call DelayFrames @@ -162,7 +162,7 @@ _LeaveMapAnim: ; 705ba (1c:45ba) ld a, 11 ld [hli], a ; wFlyAnimCounter ld [hl], $8 ; wFlyAnimBirdSpriteImageIndex (facing left) - ld de, FlyAnimationScreenCoords2 ; $4667 + ld de, FlyAnimationScreenCoords2 call DoFlyAnimation call GBFadeOutToWhite jp RestoreFacingDirectionAndYScreenPos @@ -248,11 +248,11 @@ DoFlyAnimation: ; 706ae (1c:46ae) ret LoadBirdSpriteGraphics: ; 706d7 (1c:46d7) - ld de, BirdSprite ; $4d80 + ld de, BirdSprite ld hl, vNPCSprites ld bc, (BANK(BirdSprite) << 8) + $0c call CopyVideoData - ld de, BirdSprite + $c0 ; $4e40 ; moving amination sprite + ld de, BirdSprite + $c0 ; moving amination sprite ld hl, vNPCSprites2 ld bc, (BANK(BirdSprite) << 8) + $0c jp CopyVideoData @@ -379,28 +379,28 @@ IsPlayerStandingOnWarpPadOrHole: ; 70787 (1c:4787) db $FF Func_707b6: ; 707b6 (1c:47b6) - ld c, $a + ld c, 10 call DelayFrames ld hl, wd736 set 6, [hl] - ld de, RedSprite ; $4180 + ld de, RedSprite ld hl, vNPCSprites ld bc, (BANK(RedSprite) << 8) + $0c call CopyVideoData ld a, $4 - ld hl, RedFishingTiles ; $4866 + ld hl, RedFishingTiles call LoadAnimSpriteGfx ld a, [wSpriteStateData1 + 2] ld c, a ld b, $0 - ld hl, FishingRodGfxProperties ; $4856 + ld hl, FishingRodGfxProperties add hl, bc ld de, wOAMBuffer + $9c ld bc, $4 call CopyData - ld c, $64 + ld c, 100 call DelayFrames - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] and a ld hl, NoNibbleText jr z, .asm_70836 diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm index 3c640d8e..5b2e4cbb 100755 --- a/engine/overworld/pokecenter.asm +++ b/engine/overworld/pokecenter.asm @@ -43,7 +43,7 @@ DisplayPokemonCenterDialogue_: ; 6fe6 (1:6fe6) .done ld hl, PokemonCenterFarewellText call PrintText - jp UpdateSprites ; move sprites + jp UpdateSprites PokemonCenterWelcomeText: ; 705d (1:705d) TX_FAR _PokemonCenterWelcomeText diff --git a/engine/overworld/pokemart.asm b/engine/overworld/pokemart.asm index 8325b93f..fa93e1db 100755 --- a/engine/overworld/pokemart.asm +++ b/engine/overworld/pokemart.asm @@ -1,7 +1,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) ld a,[wListScrollOffset] ld [wd07e],a - call UpdateSprites ; move sprites + call UpdateSprites xor a ld [wcf0a],a ; flag that is set if something is sold or bought .loop @@ -36,7 +36,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) ld [wcf93],a ld a,$02 ld [wd11b],a - callab Func_39bd5 + callab InitList ld a,[wNumBagItems] and a jp z,.bagEmpty @@ -113,7 +113,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) ld [wcf93],a ld a,$03 ld [wd11b],a - callab Func_39bd5 + callab InitList ld hl,PokemartBuyingGreetingText call PrintText call SaveScreenTilesToBuffer1 ; save screen @@ -204,7 +204,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) call PrintText ld a,$01 ld [wUpdateSpritesEnabled],a - call UpdateSprites ; move sprites + call UpdateSprites ld a,[wd07e] ld [wListScrollOffset],a ret diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm index f1a8ecf9..4cac4957 100755 --- a/engine/overworld/ssanne.asm +++ b/engine/overworld/ssanne.asm @@ -84,7 +84,7 @@ LoadSmokeTileFourTimes: ; 79fc0 (1e:5fc0) ret LoadSmokeTile: ; 79fd4 (1e:5fd4) - ld de, SSAnneSmokePuffTile ; $5fdd + ld de, SSAnneSmokePuffTile ld bc, (BANK(SSAnneSmokePuffTile) << 8) + $01 jp CopyVideoData diff --git a/engine/overworld/trainers.asm b/engine/overworld/trainers.asm index 4aaab3ed..2b08997b 100755 --- a/engine/overworld/trainers.asm +++ b/engine/overworld/trainers.asm @@ -77,7 +77,7 @@ _SetSpritePosition2: ; 5685d (15:685d) TrainerWalkUpToPlayer: ; 56881 (15:6881) ld a, [wSpriteIndex] swap a - ld [wTrainerSpriteOffset], a ; wWhichTrade + ld [wTrainerSpriteOffset], a call ReadTrainerScreenPosition ld a, [wTrainerFacingDirection] and a @@ -164,7 +164,7 @@ GetSpriteDataPointer: ; 56903 (15:6903) TrainerEngage: ; 5690f (15:690f) push hl push de - ld a, [wTrainerSpriteOffset] ; wWhichTrade + ld a, [wTrainerSpriteOffset] add $2 ld d, $0 ld e, a @@ -175,7 +175,7 @@ TrainerEngage: ; 5690f (15:690f) jr nz, .spriteOnScreen ; test if sprite is on screen jp .noEngage .spriteOnScreen - ld a, [wTrainerSpriteOffset] ; wWhichTrade + ld a, [wTrainerSpriteOffset] add $9 ld d, $0 ld e, a @@ -218,7 +218,7 @@ TrainerEngage: ; 5690f (15:690f) jp .noEngage .engage call CheckPlayerIsInFrontOfSprite - ld a, [wTrainerSpriteOffset] ; wWhichTrade + ld a, [wTrainerSpriteOffset] and a jr z, .noEngage ld hl, wFlags_0xcd60 @@ -226,14 +226,14 @@ TrainerEngage: ; 5690f (15:690f) call EngageMapTrainer ld a, $ff .noEngage: ; 56988 (15:6988) - ld [wTrainerSpriteOffset], a ; wWhichTrade + ld [wTrainerSpriteOffset], a pop de pop hl ret ; reads trainer's Y position to wTrainerScreenY and X position to wTrainerScreenX ReadTrainerScreenPosition: ; 5698e (15:698e) - ld a, [wTrainerSpriteOffset] ; wWhichTrade + ld a, [wTrainerSpriteOffset] add $4 ld d, $0 ld e, a @@ -241,7 +241,7 @@ ReadTrainerScreenPosition: ; 5698e (15:698e) add hl, de ld a, [hl] ld [wTrainerScreenY], a - ld a, [wTrainerSpriteOffset] ; wWhichTrade + ld a, [wTrainerSpriteOffset] add $6 ld d, $0 ld e, a @@ -291,10 +291,10 @@ CheckSpriteCanSeePlayer: ; 569af (15:69af) ; tests if the player is in front of the sprite (rather than behind it) CheckPlayerIsInFrontOfSprite: ; 569e3 (15:69e3) - ld a, [W_CURMAP] ; W_CURMAP + ld a, [W_CURMAP] cp POWER_PLANT - jp z, .engage ; XXX not sure why bypass this for power plant (maybe to get voltorb fake items to work?) - ld a, [wTrainerSpriteOffset] ; wWhichTrade + jp z, .engage ; bypass this for power plant to get voltorb fake items to work + ld a, [wTrainerSpriteOffset] add $4 ld d, $0 ld e, a @@ -306,7 +306,7 @@ CheckPlayerIsInFrontOfSprite: ; 569e3 (15:69e3) ld a, $c .notOnTopmostTile ld [wTrainerScreenY], a - ld a, [wTrainerSpriteOffset] ; wWhichTrade + ld a, [wTrainerSpriteOffset] add $6 ld d, $0 ld e, a @@ -345,5 +345,5 @@ CheckPlayerIsInFrontOfSprite: ; 569e3 (15:69e3) .noEngage xor a .done - ld [wTrainerSpriteOffset], a ; wWhichTrade + ld [wTrainerSpriteOffset], a ret |