From 079d1cc92fc3b0ec82bc1418c2b4045bfca84620 Mon Sep 17 00:00:00 2001 From: Narishma-gb <194818981+Narishma-gb@users.noreply.github.com> Date: Thu, 6 Aug 2026 22:48:33 +0200 Subject: [PATCH] Fix some text formatting, constants, unreferenced local labels (#596) --- data/text/text_2.asm | 1 + data/text/text_4.asm | 1 + engine/battle/animations.asm | 6 +++--- engine/battle/core.asm | 5 ++--- engine/battle/print_type.asm | 4 ++-- engine/events/pokemart.asm | 2 +- engine/menus/party_menu.asm | 2 +- engine/menus/text_box.asm | 6 +++--- engine/movie/title2.asm | 4 ++-- engine/overworld/movement.asm | 2 +- home/copy2.asm | 4 ++-- home/overworld.asm | 17 ++++++++--------- home/pokemon.asm | 4 ++-- scripts/OaksLab.asm | 2 +- scripts/PalletTown.asm | 2 +- scripts/SilphCo11F.asm | 12 ++++++------ text/FuchsiaGym_2.asm | 1 + text/OaksLab.asm | 2 ++ text/SilphCo11F.asm | 4 ++-- text/VermilionCity.asm | 1 + 20 files changed, 43 insertions(+), 39 deletions(-) diff --git a/data/text/text_2.asm b/data/text/text_2.asm index d62e0929b..917feb895 100644 --- a/data/text/text_2.asm +++ b/data/text/text_2.asm @@ -777,6 +777,7 @@ _FoundHiddenCoins2Text:: _DroppedHiddenCoinsText:: text_start + para "Oops! Dropped" line "some coins!" done diff --git a/data/text/text_4.asm b/data/text/text_4.asm index 28373f138..72f36edfa 100644 --- a/data/text/text_4.asm +++ b/data/text/text_4.asm @@ -141,6 +141,7 @@ _PoofText:: _ForgotAndText:: text_start + para "@" text_ram wLearnMoveMonName text " forgot" diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 30620065a..4486d8209 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -116,7 +116,7 @@ DrawFrameBlock: ld a, [hli] bit B_OAM_XFLIP, a jr nz, .disableHorizontalFlip -.enableHorizontalFlip +; enable horizontal flip set B_OAM_XFLIP, a jr .storeFlags2 .disableHorizontalFlip @@ -2493,14 +2493,14 @@ AnimationShakeEnemyHUD: ; Copy wTileMap to VRAM such that the row below the enemy HUD (in wTileMap) is ; lined up with row 0 of the window. - ld hl, vBGMap1 - $20 * 7 + ld hl, vBGMap1 - TILEMAP_WIDTH * 7 call BattleAnimCopyTileMapToVRAM ; Move the window so that the row below the enemy HUD (in BG map 0) lines up ; with the top row of the window on the screen. This makes it so that the window ; covers everything below the enemy HD with a copy that looks just like what ; was there before. - ld a, 7 * 8 + ld a, 7 * TILE_HEIGHT ldh [hWY], a ; Write OAM entries so that the copy of the back pic from the top of this diff --git a/engine/battle/core.asm b/engine/battle/core.asm index fc17ec441..9f2f34f22 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -3561,7 +3561,7 @@ CheckPlayerStatusConditions: ld [wPlayerNumAttacksLeft], a ld hl, GetPlayerAnimationType ; skip damage calculation (deal damage equal to last hit), ; DecrementPP and MoveHitTest - jp nz, .returnToHL ; redundant leftover code, the case wEnemyNumAttacksLeft == 0 + jp nz, .returnToHL ; redundant leftover code, the case wPlayerNumAttacksLeft == 0 ; is handled within CheckNumAttacksLeft jp .returnToHL @@ -6790,8 +6790,7 @@ _LoadTrainerPic: ld c, a jp LoadUncompressedSpriteData -; unreferenced -ResetCryModifiers: +ResetCryModifiers: ; unreferenced xor a ld [wFrequencyModifier], a ld [wTempoModifier], a diff --git a/engine/battle/print_type.asm b/engine/battle/print_type.asm index 6ebd41893..c22be3ef6 100644 --- a/engine/battle/print_type.asm +++ b/engine/battle/print_type.asm @@ -26,9 +26,9 @@ PrintType: ; erase "TYPE2/" if the mon only has 1 type EraseType2Text: ld a, ' ' - ld bc, $13 + ld bc, SCREEN_WIDTH - 1 add hl, bc - ld bc, $6 + ld bc, CHARLEN("TYPE2/") jp FillMemory PrintMoveType: diff --git a/engine/events/pokemart.asm b/engine/events/pokemart.asm index cb25ab4ce..d7885644f 100644 --- a/engine/events/pokemart.asm +++ b/engine/events/pokemart.asm @@ -67,7 +67,7 @@ DisplayPokemartDialogue_:: ld [wListMenuID], a call DisplayListMenuID jp c, .returnToMainPokemartMenu ; if the player closed the menu -.confirmItemSale ; if the player is trying to sell a specific item +; if the player is trying to sell a specific item, confirm the sale call IsKeyItem ld a, [wIsKeyItem] and a diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index 15fd62beb..2a3086424 100644 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -157,7 +157,7 @@ RedrawPartyMenu_:: ; if it does match ld de, .ableToEvolveText .placeEvolutionStoneString - ld bc, 20 + 9 ; down 1 row and right 9 columns + ld bc, SCREEN_WIDTH + 9 ; down 1 row and right 9 columns pop hl push hl add hl, bc diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm index e618b1d05..b8add148d 100644 --- a/engine/menus/text_box.asm +++ b/engine/menus/text_box.asm @@ -112,7 +112,7 @@ GetTextBoxIDText: GetAddressOfScreenCoords: push bc hlcoord 0, 0 - ld bc, 20 + ld bc, SCREEN_WIDTH .loop ; loop to add d rows to the base address ld a, d and a @@ -266,9 +266,9 @@ DisplayTwoOptionMenu: pop hl ld a, [hli] and a ; put blank line before first menu item? - ld bc, 20 + 2 + ld bc, SCREEN_WIDTH + 2 jr z, .noBlankLine - ld bc, 2 * 20 + 2 + ld bc, 2 * SCREEN_WIDTH + 2 .noBlankLine ld a, [hli] ld e, a diff --git a/engine/movie/title2.asm b/engine/movie/title2.asm index bc75015f5..5ec70dbb6 100644 --- a/engine/movie/title2.asm +++ b/engine/movie/title2.asm @@ -24,12 +24,12 @@ TitleScroll: ld e, 0 ; don't animate titleball and a - jr nz, .ok + jr nz, _TitleScroll ld bc, TitleScroll_Out ld d, $00 ld e, 0 ; don't animate titleball -.ok + ; fallthrough _TitleScroll: ld a, [bc] diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 73d8ddc8a..788e8a61d 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -29,7 +29,7 @@ UpdatePlayerSprite: ; check if down bit PLAYER_DIR_BIT_DOWN, a jr z, .checkIfUp - xor a ; ld a, SPRITE_FACING_DOWN + xor a ; SPRITE_FACING_DOWN jr .next .checkIfUp bit PLAYER_DIR_BIT_UP, a diff --git a/home/copy2.asm b/home/copy2.asm index 1ad9fbbac..e839f0f83 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -91,7 +91,7 @@ CopyVideoData:: cp 8 jr nc, .keepgoing -.done +; done ldh [hVBlankCopySize], a call DelayFrame ldh a, [hROMBankTemp] @@ -140,7 +140,7 @@ CopyVideoDataDouble:: cp 8 jr nc, .keepgoing -.done +; done ldh [hVBlankCopyDoubleSize], a call DelayFrame ldh a, [hROMBankTemp] diff --git a/home/overworld.asm b/home/overworld.asm index 0cf36b9f3..a49cf63bd 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -935,7 +935,7 @@ LoadTileBlockMap:: .noCarry dec b jr nz, .rowLoop -.northConnection +; north connection ld a, [wNorthConnectedMap] cp $ff jr z, .southConnection @@ -1132,7 +1132,7 @@ IsSpriteInFrontOfPlayer:: IsSpriteInFrontOfPlayer2:: lb bc, $3c, $40 ; Y and X position of player sprite ld a, [wSpritePlayerStateData1FacingDirection] -.checkIfPlayerFacingUp +; check if player facing up cp SPRITE_FACING_UP jr nz, .checkIfPlayerFacingDown ; facing up @@ -1400,7 +1400,7 @@ LoadCurrentMapView:: jr nz, .rowLoop ld hl, wSurroundingTiles ld bc, 0 -.adjustForYCoordWithinTileBlock +; adjust for Y coord within tile block ld a, [wYBlockCoord] and a jr z, .adjustForXCoordWithinTileBlock @@ -1898,7 +1898,7 @@ CollisionCheckOnWater:: call CheckForJumpingAndTilePairCollisions jr c, .collision predef GetTileAndCoordsInFrontOfPlayer ; get tile in front of player (puts it in c and [wTileInFrontOfPlayer]) - ld a, [wTileInFrontOfPlayer] ; tile in front of player + ld a, [wTileInFrontOfPlayer] cp $14 ; water tile jr z, .noCollision ; keep surfing if it's a water tile cp $32 ; either the left tile of the S.S. Anne boarding platform or the tile on eastern coastlines (depending on the current tileset) @@ -1939,11 +1939,10 @@ CollisionCheckOnWater:: jr .noCollision .checkIfVermilionDockTileset ld a, [wCurMapTileset] - cp SHIP_PORT ; Vermilion Dock tileset + cp SHIP_PORT jr nz, .noCollision ; keep surfing if it's not the boarding platform tile jr .stopSurfing ; if it is the boarding platform tile, stop surfing -; function to run the current map's script RunMapScript:: push hl push de @@ -1958,15 +1957,15 @@ RunMapScript:: pop de pop hl call RunNPCMovementScript - ld a, [wCurMap] ; current map number - call SwitchToMapRomBank ; change to the ROM bank the map's data is in + ld a, [wCurMap] + call SwitchToMapRomBank ld hl, wCurMapScriptPtr ld a, [hli] ld h, [hl] ld l, a ld de, .return push de - jp hl ; jump to script + jp hl .return ret diff --git a/home/pokemon.asm b/home/pokemon.asm index df984d00b..fa4054d94 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -279,8 +279,8 @@ HandlePartyMenuInput:: ret .swappingPokemon bit B_PAD_B, b - jr z, .handleSwap ; if not, handle swapping the pokemon -.cancelSwap ; if the B button was pressed + jr z, .handleSwap +; cancel swap if the B button was pressed farcall ErasePartyMenuCursors xor a ld [wMenuItemToSwap], a diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index 12b58c3f7..19d0ec096 100644 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -502,7 +502,7 @@ OaksLabPlayerWatchRivalExitScript: .turnPlayerDown cp $4 ret nz - xor a ; ld a, SPRITE_FACING_DOWN + xor a ; SPRITE_FACING_DOWN ld [wSpritePlayerStateData1FacingDirection], a .done ret diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm index de88945fe..b2845fe14 100644 --- a/scripts/PalletTown.asm +++ b/scripts/PalletTown.asm @@ -94,7 +94,7 @@ PalletTownOakNotSafeComeWithMeScript: ld a, [wStatusFlags5] bit BIT_SCRIPTED_NPC_MOVEMENT, a ret nz - xor a ; ld a, SPRITE_FACING_DOWN + xor a ; SPRITE_FACING_DOWN ld [wSpritePlayerStateData1FacingDirection], a ld a, TRUE ld [wOakWalkedToPlayer], a diff --git a/scripts/SilphCo11F.asm b/scripts/SilphCo11F.asm index a804ce6d5..c47a935bd 100644 --- a/scripts/SilphCo11F.asm +++ b/scripts/SilphCo11F.asm @@ -261,8 +261,8 @@ SilphCo11FGiovanniStartBattleScript: ld hl, wStatusFlags3 set BIT_TALKED_TO_TRAINER, [hl] set BIT_PRINT_END_BATTLE_TEXT, [hl] - ld hl, SilphCo10FGiovanniILostAgainText - ld de, SilphCo10FGiovanniILostAgainText + ld hl, SilphCo11FGiovanniILostAgainText + ld de, SilphCo11FGiovanniILostAgainText call SaveEndBattleTextPointers ldh a, [hSpriteIndex] ld [wSpriteIndex], a @@ -338,8 +338,8 @@ SilphCo11FGiovanniText: text_far _SilphCo11FGiovanniText text_end -SilphCo10FGiovanniILostAgainText: - text_far _SilphCo10FGiovanniILostAgainText +SilphCo11FGiovanniILostAgainText: + text_far _SilphCo11FGiovanniILostAgainText text_end SilphCo11FGiovanniYouRuinedOurPlansText: @@ -382,7 +382,7 @@ SilphCo11FRocket2AfterBattleText: text_far _SilphCo11FRocket2AfterBattleText text_end -SilphCo10FPorygonText: ; unreferenced +SilphCo11FPorygonText: ; unreferenced text_asm ld hl, .Text call PrintText @@ -391,5 +391,5 @@ SilphCo10FPorygonText: ; unreferenced jp TextScriptEnd .Text: - text_far _SilphCo10FPorygonText + text_far _SilphCo11FPorygonText text_end diff --git a/text/FuchsiaGym_2.asm b/text/FuchsiaGym_2.asm index 229e060cd..80f07cd48 100644 --- a/text/FuchsiaGym_2.asm +++ b/text/FuchsiaGym_2.asm @@ -33,6 +33,7 @@ _FuchsiaGymKogaReceivedTM06Text:: _FuchsiaGymKogaTM06ExplanationText:: text_start + para "TM06 contains" line "TOXIC!" diff --git a/text/OaksLab.asm b/text/OaksLab.asm index e839149e0..44b08a680 100644 --- a/text/OaksLab.asm +++ b/text/OaksLab.asm @@ -102,6 +102,7 @@ _OaksLabOak1DeliverParcelText:: _OaksLabOak1ParcelThanksText:: text_start + para "Ah! This is the" line "custom # BALL" cont "I ordered!" @@ -131,6 +132,7 @@ _OaksLabOak1ReceivedPokeballsText:: _OaksLabGivePokeballsExplanationText:: text_start + para "When a wild" line "#MON appears," cont "it's fair game." diff --git a/text/SilphCo11F.asm b/text/SilphCo11F.asm index 25607d0fa..394bf38c9 100644 --- a/text/SilphCo11F.asm +++ b/text/SilphCo11F.asm @@ -75,7 +75,7 @@ _SilphCo11FGiovanniText:: line "world of pain!" done -_SilphCo10FGiovanniILostAgainText:: +_SilphCo11FGiovanniILostAgainText:: text "Arrgh!!" line "I lost again!?" prompt @@ -129,7 +129,7 @@ _SilphCo11FRocket2AfterBattleText:: cont "#MON tough!" done -_SilphCo10FPorygonText:: +_SilphCo11FPorygonText:: text "The monitor has" line "#MON on it!" done diff --git a/text/VermilionCity.asm b/text/VermilionCity.asm index d850acbf3..1e8d94c5e 100644 --- a/text/VermilionCity.asm +++ b/text/VermilionCity.asm @@ -73,6 +73,7 @@ _VermilionCityMachopText:: _VermilionCityMachopStompingTheLandFlatText:: text_start + para "A MACHOP is" line "stomping the land" cont "flat."