shithub: pokecrystal

Download patch

ref: 6d333bed5fde0c2da0a6a9df2ccae83933400e42
parent: 446f1846b1c614ab1538d1ce11aa2781c22717f2
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Wed Oct 28 06:21:10 EDT 2020

Replace many '; unused' with '; unreferenced'

--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -1615,9 +1615,9 @@
 	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,8 +1667,8 @@
 	ret
 
 MusicF9:
+; unused
 ; sets some flag
-; seems to be unused
 ; params: 0
 	ld a, TRUE
 	ld [wUnusedMusicF9Flag], a
@@ -1675,7 +1675,7 @@
 	ret
 
 MusicE2:
-; seems to have been dummied out
+; unused
 ; params: 1
 	call GetMusicByte
 	ld hl, CHANNEL_FIELD2C
--- a/data/battle/effect_command_pointers.asm
+++ b/data/battle/effect_command_pointers.asm
@@ -63,7 +63,7 @@
 	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 @@
 	dw BattleCommand_Endure
 	dw BattleCommand_CheckCurl
 	dw BattleCommand_RolloutPower
-	dw BattleCommand5d
+	dw BattleCommand_Unused5D
 	dw BattleCommand_FuryCutter
 	dw BattleCommand_Attract
 	dw BattleCommand_HappinessPower
--- a/data/sprite_anims/framesets.asm
+++ b/data/sprite_anims/framesets.asm
@@ -245,22 +245,22 @@
 	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
@@ -267,23 +267,23 @@
 	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
--- a/data/sprite_anims/oam.asm
+++ b/data/sprite_anims/oam.asm
@@ -181,7 +181,7 @@
 	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 @@
 	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
--- a/data/text/battle.asm
+++ b/data/text/battle.asm
@@ -349,7 +349,7 @@
 	sound_dex_fanfare_50_79
 	text_end
 
-	text_end ; unused
+	text_end ; unreferenced
 
 BattleText_WildMonIsEating:
 	text "Wild @"
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -5714,8 +5714,7 @@
 	text_far _BattleDugText
 	text_end
 
-BattleCommand3c:
-; unused
+BattleCommand_Unused3C: ; unreferenced
 	ret
 
 BattleCommand_TrapTarget:
@@ -6489,8 +6488,7 @@
 
 INCLUDE "engine/battle/move_effects/rollout.asm"
 
-BattleCommand5d:
-; unused
+BattleCommand_Unused5D: ; unreferenced
 	ret
 
 INCLUDE "engine/battle/move_effects/fury_cutter.asm"
--- a/engine/debug/color_picker.asm
+++ b/engine/debug/color_picker.asm
@@ -1437,8 +1437,8 @@
 	ld [hl], d
 	ret
 
-; unused
+.dummy1: ; unreferenced
 	ret
 
-; unused
+.dummy2: ; unreferenced
 	ret
--- a/engine/events/diploma.asm
+++ b/engine/events/diploma.asm
@@ -87,4 +87,5 @@
 DiplomaPage2Tilemap:
 INCBIN "gfx/diploma/page2.tilemap"
 
-	ret ; unused
+Diploma_DummyFunction: ; unreferenced
+	ret
--- a/engine/events/mom_phone.asm
+++ b/engine/events/mom_phone.asm
@@ -228,9 +228,12 @@
 	text_far _MomItsInYourRoomText
 	text_end
 
-	db 0 ; unused
 
+DummyPredef3A_DummyData: ; unreferenced
+	db 0
+
 DummyPredef3A:
 	ret
 
-	ret ; unused
+DummyPredef3A_DummyFunction: ; unreferenced
+	ret
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -1722,7 +1722,7 @@
 	special UpdatePlayerSprite
 	end
 
-; unused
+Overworld_DummyFunction: ; unreferenced
 	nop
 	ret
 
--- a/engine/gfx/pic_animation.asm
+++ b/engine/gfx/pic_animation.asm
@@ -648,7 +648,7 @@
 .skip2
 	ret
 
-; unused
+.UnusedSizeData: ; unreferenced
 	db 6, 5, 4
 
 .GetTilemap:
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -9,7 +9,7 @@
 	farcall MainMenu
 	jp StartTitleScreen
 
-; unused
+IntroMenu_DummyFunction: ; unreferenced
 	ret
 
 PrintDayOfWeek:
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -1334,7 +1334,7 @@
 	ld a, [wNamingScreenLastCharacter]
 	jp MailComposition_TryAddCharacter
 
-; unused
+.add_dakuten ; unreferenced
 	ld a, [wNamingScreenCurNameLength]
 	and a
 	ret z
--- a/engine/menus/trainer_card.asm
+++ b/engine/menus/trainer_card.asm
@@ -296,7 +296,8 @@
 	db   "#DEX"
 	next "PLAY TIME@"
 
-	db "@" ; unused
+.Unused: ; unreferenced
+	db "@"
 
 .Badges:
 	db "  BADGES▶@"
--- a/engine/movie/intro.asm
+++ b/engine/movie/intro.asm
@@ -21,7 +21,7 @@
 	call DelayFrame
 	jp .loop
 
-.ShutOffMusic:
+.ShutOffMusic
 	ld de, MUSIC_NONE
 	call PlayMusic
 
@@ -152,7 +152,7 @@
 	cp $80
 	jr nc, .endscene
 	cp $60
-	jr nz, .DontPlaySound
+	jr nz, .nosound
 	push af
 	depixel 11, 11
 	call CrystalIntro_InitUnownAnim
@@ -159,7 +159,7 @@
 	ld de, SFX_INTRO_UNOWN_1
 	call PlaySFX
 	pop af
-.DontPlaySound:
+.nosound
 	ld [wIntroSceneTimer], a
 	xor a
 	call CrystalIntro_UnownFade
@@ -971,7 +971,8 @@
 	xor a
 	call Intro_Scene20_AppearUnown
 	ret
-; unused
+
+.AppearUnownPal2: ; unreferenced
 	ld a, c
 	and $1c
 	srl a
@@ -981,7 +982,7 @@
 	call Intro_Scene20_AppearUnown
 	ret
 
-.finished
+.finished:
 	call NextIntroScene
 	ret
 
--- a/engine/overworld/map_setup.asm
+++ b/engine/overworld/map_setup.asm
@@ -82,7 +82,7 @@
 	farcall InitializeVisibleSprites
 	ret
 
-; unused
+MapSetup_DummyFunction: ; unreferenced
 	ret
 
 ResetPlayerObjectAction:
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -311,7 +311,7 @@
 	scf
 	ret
 
-; unused
+.unused ; unreferenced
 	xor a
 	ret
 
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -2203,7 +2203,8 @@
 	ld [wUnusedScriptByteBuffer], a
 	ret
 
-	db closetext_command ; unused
+UnusedClosetextScript: ; unreferenced
+	closetext
 
 Script_closetext:
 	call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
@@ -2352,7 +2353,7 @@
 	ld [wScriptVar], a
 	ret
 
-; unused
+Script_checkver_duplicate: ; unreferenced
 	ld a, [.gs_version]
 	ld [wScriptVar], a
 	ret
--- a/engine/overworld/time.asm
+++ b/engine/overworld/time.asm
@@ -220,12 +220,12 @@
 	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]
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -1271,7 +1271,7 @@
 	dw .Call
 	dw .Cancel
 
-; unused
+GetAMPMHours: ; unreferenced
 	ldh a, [hHours]
 	cp 12
 	jr c, .am
@@ -1442,7 +1442,7 @@
 	ldh [hBGMapMode], a
 	ret
 
-; unused
+LoadPokegearRadioChannelPointer: ; unreferenced
 	ld [wPokegearRadioChannelBank], a
 	ld a, [hli]
 	ld [wPokegearRadioChannelAddr], a
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -2475,7 +2475,7 @@
 	call CopyName2
 	ret
 
-	hlcoord 11, 7 ; unused
+	hlcoord 11, 7 ; unreferenced
 
 .MenuHeader:
 	db MENU_BACKUP_TILES ; flags
--- a/engine/pokemon/evolve.asm
+++ b/engine/pokemon/evolve.asm
@@ -327,7 +327,7 @@
 	inc hl
 	jp .loop
 
-; unused
+.UnusedReturnToMap: ; unreferenced
 	pop hl
 .ReturnToMap:
 	pop de
--- a/home/map.asm
+++ b/home/map.asm
@@ -2163,7 +2163,8 @@
 	pop hl
 	ret
 
-	ret ; unused
+Map_DummyFunction:: ; unreferenced
+	ret
 
 GetAnyMapEnvironment::
 	push hl
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -330,7 +330,7 @@
 	pop hl
 	jp PrintText
 
-; unused
+Menu_DummyFunction:: ; unreferenced
 	ret
 
 LoadMenuTextbox::
--- a/home/text.asm
+++ b/home/text.asm
@@ -141,6 +141,8 @@
 
 PrintText::
 	call SetUpTextbox
+	; fallthrough
+
 BuenaPrintText::
 	push hl
 	hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
@@ -147,6 +149,7 @@
 	lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW
 	call ClearBox
 	pop hl
+	; fallthrough
 
 PrintTextboxText::
 	bccoord TEXTBOX_INNERX, TEXTBOX_INNERY
@@ -163,6 +166,7 @@
 
 PlaceString::
 	push hl
+	; fallthrough
 
 PlaceNextChar::
 	ld a, [de]
@@ -173,7 +177,9 @@
 	pop hl
 	ret
 
-	pop de ; unused
+DummyChar:: ; unreferenced
+	pop de
+	; fallthrough
 
 NextChar::
 	inc de
@@ -319,12 +325,13 @@
 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
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -60,7 +60,7 @@
 CopyTilemapAtOnce::
 	jr _CopyTilemapAtOnce
 
-; unused
+CopyAttrmapAndTilemapToWRAMBank3: ; unreferenced
 	farcall HDMATransferAttrmapAndTilemapToWRAMBank3
 	ret
 
--- a/home/window.asm
+++ b/home/window.asm
@@ -92,6 +92,6 @@
 	ldh [hOAMUpdate], a
 	ret
 
-; unused
+SetCarryFlag:: ; unreferenced
 	scf
 	ret
--- a/lib/mobile/main.asm
+++ b/lib/mobile/main.asm
@@ -6858,7 +6858,7 @@
 	dec a
 	jp .asm_112e46
 
-; unused
+.asm_112d4c ; unreferenced
 	ret
 
 .asm_112d4d
--- a/maps/LakeOfRageMagikarpHouse.asm
+++ b/maps/LakeOfRageMagikarpHouse.asm
@@ -204,7 +204,8 @@
 	text_ram wStringBuffer4
 	text_end
 
-	text_end ; unused
+LakeOfRageMagikarpHouseUnusedDummyText: ; unreferenced
+	text_end
 
 LakeOfRageMagikarpHouse_MapEvents:
 	db 0, 0 ; filler
--- a/maps/Route25.asm
+++ b/maps/Route25.asm
@@ -423,7 +423,7 @@
 	line "BILL'S HOUSE"
 	done
 
-; unused
+UnusedBillsHouseSignText: ; unreferenced
 	text "BILL'S HOUSE"
 	done
 
--- a/maps/Route34.asm
+++ b/maps/Route34.asm
@@ -725,7 +725,6 @@
 	done
 
 Route34IlexForestSignText:
-; unused
 	text "ILEX FOREST"
 	line "THROUGH THE GATE"
 	done