shithub: pokecrystal

Download patch

ref: c3c18dd19643ea48170bb3d0c5be5c9fe16e473e
parent: 91774f206e97d67cb8f16f5afeec03ce9c7e28ca
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sun Jun 21 14:33:31 EDT 2020

Comment more ROM labels as unreferenced

(Some unreferenced labels are above code which is still used via fallthrough!)

--- a/constants/map_setup_constants.asm
+++ b/constants/map_setup_constants.asm
@@ -25,7 +25,7 @@
 	const map_fade_music_and_palettes    ; 06
 	const map_play_music_bike            ; 07
 	const map_force_music                ; 08
-	const map_fade_in_music              ; 09
+	const map_fade_in_to_music           ; 09
 	const map_load_block_data            ; 0a
 	const map_load_connection_block_data ; 0b
 	const map_save_screen                ; 0c
--- a/data/maps/setup_scripts.asm
+++ b/data/maps/setup_scripts.asm
@@ -37,7 +37,7 @@
 	db map_spawn_in_facing_down
 	db map_refresh_sprites
 	db map_play_music_bike
-	db map_fade_in_music
+	db map_fade_in_to_music
 	db map_fade_in_palettes
 	db map_activate_anims
 	db map_load_wild_mon_data
--- a/data/text/common_1.asm
+++ b/data/text/common_1.asm
@@ -215,32 +215,32 @@
 
 ; Mobile Adapter
 
-UnknownText_0x1bc384::
+UnknownText_0x1bc384:: ; unreferenced
 	text "There is nothing"
 	line "connected."
 	done
 
-UnknownText_0x1bc3a1::
+UnknownText_0x1bc3a1:: ; unreferenced
 	text "Check cell phone"
 	line "adapter."
 	done
 
-UnknownText_0x1bc3bc::
+UnknownText_0x1bc3bc:: ; unreferenced
 	text "Check CDMA"
 	line "adapter."
 	done
 
-UnknownText_0x1bc3d1::
+UnknownText_0x1bc3d1:: ; unreferenced
 	text "Check DOCOMO PHS"
 	line "adapter."
 	done
 
-UnknownText_0x1bc3ec::
+UnknownText_0x1bc3ec:: ; unreferenced
 	text "Check DDI PHS"
 	line "adapter."
 	done
 
-UnknownText_0x1bc404::
+UnknownText_0x1bc404:: ; unreferenced
 	text "Check unlimited"
 	line "battle mobile"
 	cont "adapter."
@@ -1258,17 +1258,17 @@
 	text "Closing link."
 	done
 
-UnknownText_0x1bd232::
+UnknownText_0x1bd232:: ; unreferenced
 	text "Clear the time"
 	line "limit?"
 	done
 
-UnknownText_0x1bd249::
+UnknownText_0x1bd249:: ; unreferenced
 	text "The time limit was"
 	line "cleared."
 	done
 
-UnknownText_0x1bd266::
+UnknownText_0x1bd266:: ; unreferenced
 	text "Pick which packet"
 	line "as an error?"
 	done
--- a/data/text/common_2.asm
+++ b/data/text/common_2.asm
@@ -889,18 +889,15 @@
 	line "from the MAILBOX."
 	prompt
 
-; unreferenced
-_YesPromptText::
+_YesPromptText:: ; unreferenced
 	text "Yes"
 	prompt
 
-; unreferenced
-_NoPromptText::
+_NoPromptText:: ; unreferenced
 	text "No"
 	prompt
 
-; unreferenced
-_AnimationTypeText::
+_AnimationTypeText:: ; unreferenced
 	text_decimal wcf64, 1, 3
 	text " @"
 	text_ram wStringBuffer1
@@ -911,8 +908,7 @@
 
 	text_end ; unreferenced
 
-; unreferenced
-_MonNumberText::
+_MonNumberText:: ; unreferenced
 	text "#MON number?"
 	done
 
@@ -1352,8 +1348,7 @@
 	line "OAK's PC closed."
 	done
 
-; unreferenced
-_TrainerRankingExplanationText::
+_TrainerRankingExplanationText:: ; unreferenced
 	text "Triple-theme"
 	line "trainer ranking!"
 
@@ -1364,8 +1359,7 @@
 	para ""
 	done
 
-; unreferenced
-_TrainerRankingNoDataText::
+_TrainerRankingNoDataText:: ; unreferenced
 	text "There is no"
 	line "ranking data."
 
--- a/engine/events/odd_egg.asm
+++ b/engine/events/odd_egg.asm
@@ -22,7 +22,7 @@
 	jr z, .done
 .not_done
 
-	; Break when [hRandom] <= de.
+	; Break when the random word <= the next probability in de.
 	ldh a, [hRandomSub]
 	cp d
 	jr c, .done
--- a/engine/events/std_scripts.asm
+++ b/engine/events/std_scripts.asm
@@ -14,7 +14,7 @@
 	add_stdscript TownMapScript
 	add_stdscript WindowScript
 	add_stdscript TVScript
-	add_stdscript HomepageScript
+	add_stdscript HomepageScript ; unused
 	add_stdscript Radio1Script
 	add_stdscript Radio2Script
 	add_stdscript TrashCanScript
--- a/engine/menus/debug.asm
+++ b/engine/menus/debug.asm
@@ -297,15 +297,15 @@
 	hlcoord 1, 3
 	lb bc, 7, 18
 	ld a, DEBUGTEST_WHITE
-	call Bank20_FillBoxWithByte
+	call DebugColor_FillBoxWithByte
 	hlcoord 11, 0
 	lb bc, 2, 3
 	ld a, DEBUGTEST_LIGHT
-	call Bank20_FillBoxWithByte
+	call DebugColor_FillBoxWithByte
 	hlcoord 16, 0
 	lb bc, 2, 3
 	ld a, DEBUGTEST_DARK
-	call Bank20_FillBoxWithByte
+	call DebugColor_FillBoxWithByte
 	call Function81bc0
 	call Function81bf4
 	ld a, [wcf66]
@@ -880,7 +880,7 @@
 	jr nz, .asm_81ee3
 	ret
 
-Bank20_FillBoxWithByte:
+DebugColor_FillBoxWithByte:
 ; For some reason, we have another copy of FillBoxWithByte here
 .row
 	push bc
--- a/engine/overworld/map_setup.asm
+++ b/engine/overworld/map_setup.asm
@@ -69,7 +69,7 @@
 	dba FadeMapMusicAndPalettes ; 06
 	dba PlayMapMusicBike ; 07
 	dba ForceMapMusic ; 08
-	dba FadeInMusic ; 09
+	dba FadeInToMusic ; 09
 	dba LoadBlockData ; 0a (callback 1)
 	dba LoadConnectionBlockData ; 0b
 	dba SaveScreen ; 0c
--- a/gfx/tilesets.asm
+++ b/gfx/tilesets.asm
@@ -190,10 +190,10 @@
 TilesetDarkCaveGFX::
 INCBIN "gfx/tilesets/dark_cave.2bpp.lz"
 
-UnusedTilesetJohtoMeta::
+UnusedTilesetJohtoMeta:: ; unreferenced
 INCBIN "data/tilesets/unused_johto_metatiles.bin"
 
-UnusedTilesetJohtoColl::
+UnusedTilesetJohtoColl:: ; unreferenced
 INCLUDE "data/tilesets/unused_johto_collision.asm"
 
 
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -286,12 +286,12 @@
 	ld [wVolume], a
 	ret
 
-Unused_FadeOutMusic::
+FadeOutToMusic:: ; unreferenced
 	ld a, 4
 	ld [wMusicFade], a
 	ret
 
-FadeInMusic::
+FadeInToMusic::
 	ld a, 4 | (1 << MUSIC_FADE_IN_F)
 	ld [wMusicFade], a
 	ret
--- a/home/copy.asm
+++ b/home/copy.asm
@@ -117,7 +117,7 @@
 	ldh a, [hFarByte]
 	ret
 
-GetFarWRAMWord::
+GetFarWRAMWord:: ; unreferenced
 	ldh [hTempBank], a
 	ldh a, [rSVBK]
 	push af
--- a/home/farcall.asm
+++ b/home/farcall.asm
@@ -24,6 +24,7 @@
 	ldh a, [hTempBank]
 	rst Bankswitch
 	call FarCall_JumpToHL
+	; fallthrough
 
 ReturnFarCall::
 ; We want to retain the contents of f.
--- a/home/gfx.asm
+++ b/home/gfx.asm
@@ -337,6 +337,7 @@
 	ldh a, [rLCDC]
 	bit rLCDC_ENABLE, a
 	jp nz, Request2bpp
+	; fallthrough
 
 Copy2bpp:
 ; copy c 2bpp tiles from b:de to hl
@@ -366,6 +367,7 @@
 	ldh a, [rLCDC]
 	bit rLCDC_ENABLE, a
 	jp nz, Request1bpp
+	; fallthrough
 
 Copy1bpp::
 ; copy c 1bpp tiles from b:de to hl
--- a/home/joypad.asm
+++ b/home/joypad.asm
@@ -261,9 +261,8 @@
 	ld [wInputType], a
 	ret
 
-JoyTitleScreenInput::
+JoyTitleScreenInput:: ; unreferenced
 .loop
-
 	call DelayFrame
 
 	push bc
@@ -270,10 +269,12 @@
 	call JoyTextDelay
 	pop bc
 
+; Save data can be deleted by pressing Up + B + Select.
 	ldh a, [hJoyDown]
 	cp D_UP | SELECT | B_BUTTON
 	jr z, .keycombo
 
+; Press Start or A to start the game.
 	ldh a, [hJoyLast]
 	and START | A_BUTTON
 	jr nz, .keycombo
--- a/home/map.asm
+++ b/home/map.asm
@@ -1109,7 +1109,7 @@
 	text_far _ObjectEventText
 	text_end
 
-BGEvent::
+BGEvent:: ; unreferenced
 	jumptext BGEventText
 
 BGEventText::
@@ -1116,7 +1116,7 @@
 	text_far _BGEventText
 	text_end
 
-CoordinatesEvent::
+CoordinatesEvent:: ; unreferenced
 	jumptext CoordinatesEventText
 
 CoordinatesEventText::
@@ -2047,7 +2047,7 @@
 	rst Bankswitch
 	ret
 
-GetMapAttributesBank::
+GetMapAttributesBank:: ; unreferenced
 	ld a, [wMapGroup]
 	ld b, a
 	ld a, [wMapNumber]
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -282,8 +282,9 @@
 	ld c, a
 	ld a, [wMenuBorderTopCoord]
 	ld b, a
+	; fallthrough
 
-Coord2Attr::
+Coord2Attr:: ; unreferenced
 ; Return the address of wAttrmap(c, b) in hl.
 	xor a
 	ld h, a
@@ -835,7 +836,7 @@
 	ld a, [wMenuCursorBuffer]
 	ret
 
-InterpretMobileMenu::
+InterpretMobileMenu:: ; unreferenced
 	ldh a, [hROMBank]
 	ld [wMenuData_2DMenuItemStringsBank], a
 	farcall _InterpretMobileMenu
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -16,6 +16,7 @@
 	ldh a, [hCGBPalUpdate]
 	and a
 	ret z
+	; fallthrough
 
 ForceUpdateCGBPals::
 	ldh a, [rSVBK]
--- a/home/sine.asm
+++ b/home/sine.asm
@@ -1,4 +1,4 @@
-Cosine::
+Cosine:: ; unreferenced
 ; a = d * cos(a * pi/32)
 	add %010000 ; cos(x) = sin(x + pi/2)
 	; fallthrough
--- a/hram.asm
+++ b/hram.asm
@@ -149,7 +149,6 @@
 
 hLastTalked:: db
 
-hRandom::
 hRandomAdd:: db
 hRandomSub:: db
 
--- a/mobile/mobile_22.asm
+++ b/mobile/mobile_22.asm
@@ -519,9 +519,9 @@
 
 Function8942b:
 	ld de, vTiles0 tile $02
-	ld hl, CardLargeSpriteGFX
-	ld bc, 8 tiles
-	ld a, BANK(CardLargeSpriteGFX)
+	ld hl, CardLargeSpriteAndFolderGFX
+	ld bc, 8 tiles ; just the large card sprite
+	ld a, BANK(CardLargeSpriteAndFolderGFX)
 	call FarCopyBytes
 	ld de, vTiles0 tile $0a
 	ld hl, CardSpriteGFX
@@ -544,10 +544,10 @@
 	ret
 
 Function89455:
-	ld hl, CardLargeSpriteGFX
+	ld hl, CardLargeSpriteAndFolderGFX
 	ld de, vTiles2 tile $0c
-	ld bc, (8 + 65) tiles
-	ld a, BANK(CardLargeSpriteGFX) ; aka BANK(CardFolderGFX)
+	ld bc, (8 + 65) tiles ; large card sprite + folder
+	ld a, BANK(CardLargeSpriteAndFolderGFX)
 	call FarCopyBytes
 	ret
 
--- a/mobile/mobile_5e.asm
+++ b/mobile/mobile_5e.asm
@@ -10,10 +10,8 @@
 MobileCard2GFX::
 INCBIN "gfx/mobile/card_2.2bpp"
 
-CardLargeSpriteGFX::
+CardLargeSpriteAndFolderGFX::
 INCBIN "gfx/mobile/card_large_sprite.2bpp"
-
-CardFolderGFX::
 INCBIN "gfx/mobile/card_folder.2bpp"
 
 CardSpriteGFX::