From 6d333bed5fde0c2da0a6a9df2ccae83933400e42 Mon Sep 17 00:00:00 2001 From: Rangi Date: Wed, 28 Oct 2020 10:21:10 -0400 Subject: [PATCH] Replace many '; unused' with '; unreferenced' --- audio/engine.asm | 6 +++--- data/battle/effect_command_pointers.asm | 4 ++-- data/sprite_anims/framesets.asm | 18 +++++++++--------- data/sprite_anims/oam.asm | 4 ++-- data/text/battle.asm | 2 +- engine/battle/effect_commands.asm | 6 ++---- engine/debug/color_picker.asm | 4 ++-- engine/events/diploma.asm | 3 ++- engine/events/mom_phone.asm | 7 +++++-- engine/events/overworld.asm | 2 +- engine/gfx/pic_animation.asm | 2 +- engine/menus/intro_menu.asm | 2 +- engine/menus/naming_screen.asm | 2 +- engine/menus/trainer_card.asm | 3 ++- engine/movie/intro.asm | 11 ++++++----- engine/overworld/map_setup.asm | 2 +- engine/overworld/player_movement.asm | 2 +- engine/overworld/scripting.asm | 5 +++-- engine/overworld/time.asm | 4 ++-- engine/pokegear/pokegear.asm | 4 ++-- engine/pokemon/bills_pc.asm | 2 +- engine/pokemon/evolve.asm | 2 +- home/map.asm | 3 ++- home/menu.asm | 2 +- home/text.asm | 13 ++++++++++--- home/tilemap.asm | 2 +- home/window.asm | 2 +- lib/mobile/main.asm | 2 +- maps/LakeOfRageMagikarpHouse.asm | 3 ++- maps/Route25.asm | 2 +- maps/Route34.asm | 1 - 31 files changed, 70 insertions(+), 57 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index bcd14ab8d95..d394067c38a 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -1615,9 +1615,9 @@ Music_JumpIf: ret MusicEE: +; unused ; conditional jump ; checks a byte in ram corresponding to the current channel -; doesn't seem to be set by any commands ; params: 2 ; ll hh ; pointer @@ -1667,15 +1667,15 @@ MusicEE: ret MusicF9: +; unused ; sets some flag -; seems to be unused ; params: 0 ld a, TRUE ld [wUnusedMusicF9Flag], a ret MusicE2: -; seems to have been dummied out +; unused ; params: 1 call GetMusicByte ld hl, CHANNEL_FIELD2C diff --git a/data/battle/effect_command_pointers.asm b/data/battle/effect_command_pointers.asm index d5c044d78ab..d1f747a1fc5 100644 --- a/data/battle/effect_command_pointers.asm +++ b/data/battle/effect_command_pointers.asm @@ -63,7 +63,7 @@ BattleCommandPointers: dw BattleCommand_Charge dw BattleCommand_CheckCharge dw BattleCommand_TrapTarget - dw BattleCommand3c + dw BattleCommand_Unused3C dw BattleCommand_Rampage dw BattleCommand_CheckRampage dw BattleCommand_ConstantDamage @@ -96,7 +96,7 @@ BattleCommandPointers: dw BattleCommand_Endure dw BattleCommand_CheckCurl dw BattleCommand_RolloutPower - dw BattleCommand5d + dw BattleCommand_Unused5D dw BattleCommand_FuryCutter dw BattleCommand_Attract dw BattleCommand_HappinessPower diff --git a/data/sprite_anims/framesets.asm b/data/sprite_anims/framesets.asm index 1052f6aadec..5a154acd82e 100644 --- a/data/sprite_anims/framesets.asm +++ b/data/sprite_anims/framesets.asm @@ -245,45 +245,45 @@ SpriteAnimFrameData: frame SPRITE_ANIM_OAMSET_MAGNET_TRAIN_RED_2, 8, OAM_X_FLIP dorestart -; unused +.Frameset_Unknown1: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_43, 8 frame SPRITE_ANIM_OAMSET_UNUSED_44, 8 dorestart -; unused +.Frameset_Unknown2: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_45, 8 frame SPRITE_ANIM_OAMSET_UNUSED_46, 8 dorestart -; unused +.Frameset_Unknown3: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_47, 8 frame SPRITE_ANIM_OAMSET_UNUSED_48, 8 dorestart -; unused +.Frameset_Unknown4: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_49, 1 frame SPRITE_ANIM_OAMSET_UNUSED_49, 1, OAM_X_FLIP frame SPRITE_ANIM_OAMSET_UNUSED_49, 1, OAM_X_FLIP, OAM_Y_FLIP frame SPRITE_ANIM_OAMSET_UNUSED_49, 1, OAM_Y_FLIP dorestart -; unused +.Frameset_Unknown5: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_4A, 32 endanim -; unused +.Frameset_Unknown6: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_4B, 32 endanim -; unused +.Frameset_Unknown7: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_4C, 32 endanim -; unused +.Frameset_Unknown8: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_4D, 32 endanim -; unused +.Frameset_Unknown9: ; unreferenced frame SPRITE_ANIM_OAMSET_UNUSED_4E, 3 dowait 3 dorestart diff --git a/data/sprite_anims/oam.asm b/data/sprite_anims/oam.asm index 84fb1fdcd7b..10e6ed1d9b7 100644 --- a/data/sprite_anims/oam.asm +++ b/data/sprite_anims/oam.asm @@ -181,7 +181,7 @@ SpriteAnimOAMData: dbsprite -1, 0, 0, 0, $00, 7 | Y_FLIP dbsprite 0, 0, 0, 0, $00, 7 | X_FLIP | Y_FLIP -; unused +.OAMData_Unknown1: ; unreferenced db 4 dbsprite -1, -1, 0, 0, $00, 0 | PRIORITY dbsprite 0, -1, 0, 0, $00, 0 | X_FLIP | PRIORITY @@ -305,7 +305,7 @@ SpriteAnimOAMData: dbsprite 1, 0, 4, 4, $17, 0 dbsprite 1, 1, 4, 4, $18, 0 -; unused +.OAMData_Unknown2: ; unreferenced db 36 dbsprite -3, -3, 0, 0, $00, 0 dbsprite -2, -3, 0, 0, $01, 0 diff --git a/data/text/battle.asm b/data/text/battle.asm index 072ab50d91e..a9836df4f59 100644 --- a/data/text/battle.asm +++ b/data/text/battle.asm @@ -349,7 +349,7 @@ BattleText_StringBuffer1GrewToLevel: sound_dex_fanfare_50_79 text_end - text_end ; unused + text_end ; unreferenced BattleText_WildMonIsEating: text "Wild @" diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index d3f9290fac7..14f1afd8251 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -5714,8 +5714,7 @@ BattleCommand_Charge: text_far _BattleDugText text_end -BattleCommand3c: -; unused +BattleCommand_Unused3C: ; unreferenced ret BattleCommand_TrapTarget: @@ -6489,8 +6488,7 @@ INCLUDE "engine/battle/move_effects/sandstorm.asm" INCLUDE "engine/battle/move_effects/rollout.asm" -BattleCommand5d: -; unused +BattleCommand_Unused5D: ; unreferenced ret INCLUDE "engine/battle/move_effects/fury_cutter.asm" diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm index c8545b73470..d14efc59fc6 100644 --- a/engine/debug/color_picker.asm +++ b/engine/debug/color_picker.asm @@ -1437,8 +1437,8 @@ DebugTileset_CalculatePalette: ld [hl], d ret -; unused +.dummy1: ; unreferenced ret -; unused +.dummy2: ; unreferenced ret diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index f0008b7fd2f..814c9644cc7 100644 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -87,4 +87,5 @@ INCBIN "gfx/diploma/page1.tilemap" DiplomaPage2Tilemap: INCBIN "gfx/diploma/page2.tilemap" - ret ; unused +Diploma_DummyFunction: ; unreferenced + ret diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm index f18685df83e..3ff5f2b3ea4 100644 --- a/engine/events/mom_phone.asm +++ b/engine/events/mom_phone.asm @@ -228,9 +228,12 @@ MomItsInYourRoomText: text_far _MomItsInYourRoomText text_end - db 0 ; unused + +DummyPredef3A_DummyData: ; unreferenced + db 0 DummyPredef3A: ret - ret ; unused +DummyPredef3A_DummyFunction: ; unreferenced + ret diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 258b13b1a3a..0ca4489307a 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -1722,7 +1722,7 @@ Script_GetOnBike_Register: special UpdatePlayerSprite end -; unused +Overworld_DummyFunction: ; unreferenced nop ret diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm index f2a59b75a26..90bb066205f 100644 --- a/engine/gfx/pic_animation.asm +++ b/engine/gfx/pic_animation.asm @@ -648,7 +648,7 @@ PokeAnim_ConvertAndApplyBitmask: .skip2 ret -; unused +.UnusedSizeData: ; unreferenced db 6, 5, 4 .GetTilemap: diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm index 2683fbe70a1..509777fb571 100644 --- a/engine/menus/intro_menu.asm +++ b/engine/menus/intro_menu.asm @@ -9,7 +9,7 @@ Intro_MainMenu: farcall MainMenu jp StartTitleScreen -; unused +IntroMenu_DummyFunction: ; unreferenced ret PrintDayOfWeek: diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index da15dc83c2c..0a436b273ac 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -1334,7 +1334,7 @@ MailComposition_TryAddLastCharacter: ld a, [wNamingScreenLastCharacter] jp MailComposition_TryAddCharacter -; unused +.add_dakuten ; unreferenced ld a, [wNamingScreenCurNameLength] and a ret z diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index 6a7477e14c3..8dead342933 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -296,7 +296,8 @@ TrainerCard_Page1_PrintDexCaught_GameTime: db "#DEX" next "PLAY TIME@" - db "@" ; unused +.Unused: ; unreferenced + db "@" .Badges: db " BADGESâ–¶@" diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 1da3576e3ff..623b92ed4d2 100644 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -21,7 +21,7 @@ CrystalIntro: call DelayFrame jp .loop -.ShutOffMusic: +.ShutOffMusic ld de, MUSIC_NONE call PlayMusic @@ -152,14 +152,14 @@ IntroScene2: cp $80 jr nc, .endscene cp $60 - jr nz, .DontPlaySound + jr nz, .nosound push af depixel 11, 11 call CrystalIntro_InitUnownAnim ld de, SFX_INTRO_UNOWN_1 call PlaySFX pop af -.DontPlaySound: +.nosound ld [wIntroSceneTimer], a xor a call CrystalIntro_UnownFade @@ -971,7 +971,8 @@ IntroScene20: xor a call Intro_Scene20_AppearUnown ret -; unused + +.AppearUnownPal2: ; unreferenced ld a, c and $1c srl a @@ -981,7 +982,7 @@ IntroScene20: call Intro_Scene20_AppearUnown ret -.finished +.finished: call NextIntroScene ret diff --git a/engine/overworld/map_setup.asm b/engine/overworld/map_setup.asm index 9a96d670019..e70f9ab7b98 100644 --- a/engine/overworld/map_setup.asm +++ b/engine/overworld/map_setup.asm @@ -82,7 +82,7 @@ LoadMapObjects: farcall InitializeVisibleSprites ret -; unused +MapSetup_DummyFunction: ; unreferenced ret ResetPlayerObjectAction: diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm index fcf147dd02b..4ef04d79b4d 100644 --- a/engine/overworld/player_movement.asm +++ b/engine/overworld/player_movement.asm @@ -311,7 +311,7 @@ DoPlayerMovement:: scf ret -; unused +.unused ; unreferenced xor a ret diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index 457b75a5dc7..9ba79f5e01d 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -2203,7 +2203,8 @@ Script_writeunusedbytebuffer: ld [wUnusedScriptByteBuffer], a ret - db closetext_command ; unused +UnusedClosetextScript: ; unreferenced + closetext Script_closetext: call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap @@ -2352,7 +2353,7 @@ Script_checksave: ld [wScriptVar], a ret -; unused +Script_checkver_duplicate: ; unreferenced ld a, [.gs_version] ld [wScriptVar], a ret diff --git a/engine/overworld/time.asm b/engine/overworld/time.asm index 0f3aa64b699..4299a69ab1f 100644 --- a/engine/overworld/time.asm +++ b/engine/overworld/time.asm @@ -220,12 +220,12 @@ CheckUnusedTwoDayTimer: call UpdateTimeRemaining ret -; unused +UnusedSetSwarmFlag: ; unreferenced ld hl, wDailyFlags1 set DAILYFLAGS1_FISH_SWARM_F, [hl] ret -; unused +UnusedCheckSwarmFlag: ; unreferenced and a ld hl, wDailyFlags1 bit DAILYFLAGS1_FISH_SWARM_F, [hl] diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 5dae168651c..90f90d07f10 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -1271,7 +1271,7 @@ PokegearPhoneContactSubmenu: dw .Call dw .Cancel -; unused +GetAMPMHours: ; unreferenced ldh a, [hHours] cp 12 jr c, .am @@ -1442,7 +1442,7 @@ UpdateRadioStation: ldh [hBGMapMode], a ret -; unused +LoadPokegearRadioChannelPointer: ; unreferenced ld [wPokegearRadioChannelBank], a ld a, [hli] ld [wPokegearRadioChannelAddr], a diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 8230ec7f3d6..a38e78e4a76 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -2475,7 +2475,7 @@ BillsPC_ChangeBoxSubmenu: call CopyName2 ret - hlcoord 11, 7 ; unused + hlcoord 11, 7 ; unreferenced .MenuHeader: db MENU_BACKUP_TILES ; flags diff --git a/engine/pokemon/evolve.asm b/engine/pokemon/evolve.asm index 1fbca90d5eb..16138de2273 100644 --- a/engine/pokemon/evolve.asm +++ b/engine/pokemon/evolve.asm @@ -327,7 +327,7 @@ EvolveAfterBattle_MasterLoop: inc hl jp .loop -; unused +.UnusedReturnToMap: ; unreferenced pop hl .ReturnToMap: pop de diff --git a/home/map.asm b/home/map.asm index 261e044d6a5..7bc67823d9b 100644 --- a/home/map.asm +++ b/home/map.asm @@ -2163,7 +2163,8 @@ GetMapEnvironment:: pop hl ret - ret ; unused +Map_DummyFunction:: ; unreferenced + ret GetAnyMapEnvironment:: push hl diff --git a/home/menu.asm b/home/menu.asm index cfa1cd444c0..41c39ede651 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -330,7 +330,7 @@ MenuTextbox:: pop hl jp PrintText -; unused +Menu_DummyFunction:: ; unreferenced ret LoadMenuTextbox:: diff --git a/home/text.asm b/home/text.asm index f6fd2746e9d..eb3a580992f 100644 --- a/home/text.asm +++ b/home/text.asm @@ -141,12 +141,15 @@ RadioTerminator:: PrintText:: call SetUpTextbox + ; fallthrough + BuenaPrintText:: push hl hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW call ClearBox pop hl + ; fallthrough PrintTextboxText:: bccoord TEXTBOX_INNERX, TEXTBOX_INNERY @@ -163,6 +166,7 @@ SetUpTextbox:: PlaceString:: push hl + ; fallthrough PlaceNextChar:: ld a, [de] @@ -173,7 +177,9 @@ PlaceNextChar:: pop hl ret - pop de ; unused +DummyChar:: ; unreferenced + pop de + ; fallthrough NextChar:: inc de @@ -319,12 +325,13 @@ PlaceKokoWa: print_name PlaceKokoWaText PlaceMoveTargetsName:: ldh a, [hBattleTurn] xor 1 - jr PlaceMoveUsersName.place + jr PlaceBattlersName PlaceMoveUsersName:: ldh a, [hBattleTurn] + ; fallthrough -.place: +PlaceBattlersName: push de and a jr nz, .enemy diff --git a/home/tilemap.asm b/home/tilemap.asm index 6338cd892d3..8f8d339dfbb 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -60,7 +60,7 @@ CGBOnly_CopyTilemapAtOnce:: CopyTilemapAtOnce:: jr _CopyTilemapAtOnce -; unused +CopyAttrmapAndTilemapToWRAMBank3: ; unreferenced farcall HDMATransferAttrmapAndTilemapToWRAMBank3 ret diff --git a/home/window.asm b/home/window.asm index 082ec40fc60..fa53b068e40 100644 --- a/home/window.asm +++ b/home/window.asm @@ -92,6 +92,6 @@ SafeUpdateSprites:: ldh [hOAMUpdate], a ret -; unused +SetCarryFlag:: ; unreferenced scf ret diff --git a/lib/mobile/main.asm b/lib/mobile/main.asm index ae170d4d1d4..770cc1c3e47 100644 --- a/lib/mobile/main.asm +++ b/lib/mobile/main.asm @@ -6858,7 +6858,7 @@ Function112d33: dec a jp .asm_112e46 -; unused +.asm_112d4c ; unreferenced ret .asm_112d4d diff --git a/maps/LakeOfRageMagikarpHouse.asm b/maps/LakeOfRageMagikarpHouse.asm index e79928a8226..c4d314e1f71 100644 --- a/maps/LakeOfRageMagikarpHouse.asm +++ b/maps/LakeOfRageMagikarpHouse.asm @@ -204,7 +204,8 @@ LakeOfRageMagikarpHouseUnusedRecordText: text_ram wStringBuffer4 text_end - text_end ; unused +LakeOfRageMagikarpHouseUnusedDummyText: ; unreferenced + text_end LakeOfRageMagikarpHouse_MapEvents: db 0, 0 ; filler diff --git a/maps/Route25.asm b/maps/Route25.asm index a20cb3f2175..4ddb215f178 100644 --- a/maps/Route25.asm +++ b/maps/Route25.asm @@ -423,7 +423,7 @@ BillsHouseSignText: line "BILL'S HOUSE" done -; unused +UnusedBillsHouseSignText: ; unreferenced text "BILL'S HOUSE" done diff --git a/maps/Route34.asm b/maps/Route34.asm index 491e5478ff2..a4f1155fd27 100644 --- a/maps/Route34.asm +++ b/maps/Route34.asm @@ -725,7 +725,6 @@ CooltrainerfKateAfterText: done Route34IlexForestSignText: -; unused text "ILEX FOREST" line "THROUGH THE GATE" done