shithub: pokecrystal

Download patch

ref: bde9ffff6e8d174d6c76cea3f0c42f903b38abd1
parent: fb2ac9e210be5ed47377c8a6a72e533edd64c1fa
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Fri Mar 2 14:39:16 EST 2018

Improve some code labels

--- a/constants/item_constants.asm
+++ b/constants/item_constants.asm
@@ -283,12 +283,13 @@
 	add_hm WHIRLPOOL    ; f8
 	add_hm WATERFALL    ; f9
 NUM_HMS = const_value - HM01
-	const ITEM_FA       ; fa
 
 	add_mt FLAMETHROWER
 	add_mt THUNDERBOLT
 	add_mt ICE_BEAM
 NUM_TM_HM_TUTOR = __enum__ + -1
+
+	const ITEM_FA       ; fa
 
 USE_SCRIPT_VAR EQU $00
 ITEM_FROM_MEM  EQU $ff
--- a/engine/clock_reset.asm
+++ b/engine/clock_reset.asm
@@ -220,8 +220,8 @@
 	ret
 ; 20160 (8:4160)
 
-; unused
 .unreferenced ; 20160
+; unused
 	ld a, [wBuffer3]
 	ld b, a
 	call Coord2Tile
@@ -243,10 +243,12 @@
 	ret
 ; 2017c (8:417c)
 
-String_2017c: ; 2017c
+UnreferencedString_HourJP: ; 2017c
+; unused
 	db "じ@" ; HR
 ; 2017e
 
-String_2017e: ; 2017e
+UnreferencedString_MinuteJP: ; 2017e
+; unused
 	db "ふん@" ; MIN
 ; 20181
--- a/engine/crystal_intro.asm
+++ b/engine/crystal_intro.asm
@@ -482,11 +482,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_365ad
+	ld hl, IntroPalette2
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_365ad
+	ld hl, IntroPalette2
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -555,11 +555,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_e5edd
+	ld hl, IntroPalette1
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_e5edd
+	ld hl, IntroPalette1
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -621,11 +621,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_365ad
+	ld hl, IntroPalette2
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_365ad
+	ld hl, IntroPalette2
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -728,12 +728,12 @@
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
 
-	ld hl, Palette_e5edd
+	ld hl, IntroPalette1
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
 
-	ld hl, Palette_e5edd
+	ld hl, IntroPalette1
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -886,11 +886,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_365ad
+	ld hl, IntroPalette2
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_365ad
+	ld hl, IntroPalette2
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -1013,11 +1013,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_e5edd
+	ld hl, IntroPalette1
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_e5edd
+	ld hl, IntroPalette1
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -1122,11 +1122,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_e77dd
+	ld hl, IntroPalette5
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_e77dd
+	ld hl, IntroPalette5
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -1196,11 +1196,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_e6d6d
+	ld hl, IntroPalette4
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_e6d6d
+	ld hl, IntroPalette4
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -1270,11 +1270,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_e77dd
+	ld hl, IntroPalette5
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_e77dd
+	ld hl, IntroPalette5
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -1440,11 +1440,11 @@
 	push af
 	ld a, BANK(wBGPals1)
 	ld [rSVBK], a
-	ld hl, Palette_e679d
+	ld hl, IntroPalette3
 	ld de, wBGPals1
 	ld bc, 16 palettes
 	call CopyBytes
-	ld hl, Palette_e679d
+	ld hl, IntroPalette3
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
@@ -2086,7 +2086,7 @@
 INCBIN "gfx/intro/003.tilemap.lz"
 ; e5edd
 
-Palette_e5edd: ; e5edd
+IntroPalette1: ; e5edd
 INCLUDE "gfx/intro/intro_1.pal"
 ; e5f5d
 
@@ -2122,7 +2122,7 @@
 INCBIN "gfx/intro/007.tilemap.lz"
 ; e65ad
 
-Palette_365ad: ; e65ad
+IntroPalette2: ; e65ad
 INCLUDE "gfx/intro/intro_2.pal"
 ; e662d
 
@@ -2138,7 +2138,7 @@
 INCBIN "gfx/intro/015.tilemap.lz"
 ; e679d
 
-Palette_e679d: ; e679d
+IntroPalette3: ; e679d
 INCLUDE "gfx/intro/intro_3.pal"
 ; e681d
 
@@ -2154,7 +2154,7 @@
 INCBIN "gfx/intro/011.tilemap.lz"
 ; e6d6d
 
-Palette_e6d6d: ; e6d6d
+IntroPalette4: ; e6d6d
 INCLUDE "gfx/intro/intro_4.pal"
 ; e6ded
 
@@ -2182,7 +2182,7 @@
 INCBIN "gfx/intro/013.tilemap.lz"
 ; e77dd
 
-Palette_e77dd: ; e77dd
+IntroPalette5: ; e77dd
 INCLUDE "gfx/intro/intro_5.pal"
 
 IntroUnownBackGFX: ; e785d
--- a/engine/crystal_layouts.asm
+++ b/engine/crystal_layouts.asm
@@ -54,7 +54,7 @@
 
 MG_Mobile_Layout_LoadPals: ; 49351 (12:5351)
 	ld de, wBGPals1
-	ld hl, Palette_493e1
+	ld hl, Palette_MysteryGiftMobile
 	ld bc, 5 palettes
 	ld a, BANK(wBGPals1)
 	call FarCopyWRAM
@@ -111,7 +111,7 @@
 	ret
 ; 493e1 (12:53e1)
 
-Palette_493e1: ; 493e1
+Palette_MysteryGiftMobile: ; 493e1
 INCLUDE "gfx/mystery_gift/mg_mobile.pal"
 ; 49409
 
--- a/engine/debug.asm
+++ b/engine/debug.asm
@@ -181,13 +181,13 @@
 	push af
 	ld a, BANK(wBGPals2)
 	ld [rSVBK], a
-	ld hl, Palette_819f4
+	ld hl, Palette_DebugBG
 	ld de, wBGPals2
 	ld bc, 16 palettes
 	call CopyBytes
 	ld a, 1 << rBGPI_AUTO_INCREMENT
 	ld [rBGPI], a
-	ld hl, Palette_819f4
+	ld hl, Palette_DebugBG
 	ld c, 8 palettes
 	xor a
 .asm_819c8
@@ -196,7 +196,7 @@
 	jr nz, .asm_819c8
 	ld a, 1 << rOBPI_AUTO_INCREMENT
 	ld [rOBPI], a
-	ld hl, Palette_81a34
+	ld hl, Palette_DebugOB
 	ld c, 8 palettes
 .asm_819d6
 	ld a, [hli]
@@ -216,10 +216,10 @@
 	ret
 ; 819f4
 
-Palette_819f4: ; 819f4
+Palette_DebugBG: ; 819f4
 INCLUDE "gfx/debug/bg.pal"
 
-Palette_81a34: ; 81a34
+Palette_DebugOB: ; 81a34
 INCLUDE "gfx/debug/ob.pal"
 ; 81a74
 
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -1334,7 +1334,7 @@
 	dec a
 	jr nz, .loop2
 .skip
-	ld de, String_1709a4
+	ld de, String_MysteryJP
 	ld a, NAME_LENGTH_JAPANESE
 .compare_loop
 	push af
@@ -1375,8 +1375,8 @@
 	ret
 ; 1709a4 (5c:49a4)
 
-String_1709a4: ; 1709a4
-	db "なぞナゾ@@"
+String_MysteryJP: ; 1709a4
+	db "なぞナゾ@@" ; MYSTERY
 
 Function1709aa: ; 1709aa (5c:49aa) BattleTowerAction $0f
 	ld a, [rSVBK]
@@ -1400,7 +1400,7 @@
 	jr nc, .invalid
 	ld e, a
 	ld d, 0
-	ld hl, Jumptable_1709e7
+	ld hl, .jumptable
 	add hl, de
 	add hl, de
 	ld a, [hli]
@@ -1417,7 +1417,7 @@
 	ret
 ; 1709e7 (5c:49e7)
 
-Jumptable_1709e7: ; 1709e7
+.jumptable: ; 1709e7
 	dw .NoAction
 	dw .NoAction
 	dw .DoAction1
@@ -1519,11 +1519,11 @@
 ; 170a9c
 
 Function170a9c: ; 170a9c (5c:4a9c) BattleTowerAction $11
-	ld c, $0
+	ld c, FALSE
 	jr asm_170aa2
 
 Function170aa0: ; 170aa0 (5c:4aa0) BattleTowerAction $12
-	ld c, $1
+	ld c, TRUE
 asm_170aa2: ; 170aa2 (5c:4aa2)
 	ld a, $5
 	call GetSRAMBank
--- a/engine/link_trade.asm
+++ b/engine/link_trade.asm
@@ -11,7 +11,7 @@
 ; 16d42e
 
 Function16d42e: ; 16d42e
-	ld hl, Tilemap_16d465
+	ld hl, Tilemap_MobileTradeBorderFullscreen
 	decoord 0, 0
 	ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
 	call CopyBytes
@@ -34,13 +34,13 @@
 	ret
 ; 16d465
 
-Tilemap_16d465:
+Tilemap_MobileTradeBorderFullscreen:
 INCBIN "gfx/trade/border_mobile_fullscreen.tilemap"
 
-Tilemap_16d5cd:
+Tilemap_CableTradeBorderTop:
 INCBIN "gfx/trade/border_cable_top.tilemap"
 
-Tilemap_16d5f5:
+Tilemap_CableTradeBorderBottom:
 INCBIN "gfx/trade/border_cable_bottom.tilemap"
 
 _LinkTextbox: ; 16d61d
@@ -152,11 +152,11 @@
 
 Function16d6ae: ; 16d6ae
 	call Function16d42e
-	ld hl, Tilemap_16d5cd
+	ld hl, Tilemap_CableTradeBorderTop
 	decoord 0, 0
 	ld bc, 2 * SCREEN_WIDTH
 	call CopyBytes
-	ld hl, Tilemap_16d5f5
+	ld hl, Tilemap_CableTradeBorderBottom
 	decoord 0, 16
 	ld bc, 2 * SCREEN_WIDTH
 	call CopyBytes
--- a/engine/mystery_gift.asm
+++ b/engine/mystery_gift.asm
@@ -1420,7 +1420,7 @@
 	call WaitBGMap
 	call Function1057d7
 	hlcoord 3, 8
-	ld de, String_10572e
+	ld de, String_PressAToLink_BToCancel_JP
 	call PlaceString
 	call WaitBGMap
 	call Function10578c
@@ -1451,9 +1451,9 @@
 	ld a, c
 	ld [wd265], a
 	ld hl, Text_CardNotRegistered
-	jr c, asm_105726
+	jr c, PrintTextAndExit_JP
 	ld hl, Text_ListedCardAsNumber
-	jr asm_105726
+	jr PrintTextAndExit_JP
 
 Function1056eb: ; 1056eb (41:56eb)
 	ld c, 16
@@ -1487,7 +1487,7 @@
 Function105712: ; 105712 (41:5712)
 	call Function105777
 	ld hl, Text_MGLinkCanceled
-	jr asm_105726
+	jr PrintTextAndExit_JP
 
 Function10571a: ; 10571a (41:571a)
 	call Function105777
@@ -1495,7 +1495,7 @@
 	call PrintText
 	jp Function105688
 
-asm_105726: ; 105726 (41:5726)
+PrintTextAndExit_JP: ; 105726 (41:5726)
 	call PrintText
 	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
@@ -1502,11 +1502,11 @@
 	ret
 ; 10572e (41:572e)
 
-String_10572e: ; 10572e
-	db   "エーボタン¯おすと"
+String_PressAToLink_BToCancel_JP: ; 10572e
+	db   "エーボタン<WO>おすと"
 	next "つうしん<PKMN>おこなわれるよ!"
-	next "ビーボタン¯おすと"
-	next "つうしん¯ちゅうし します"
+	next "ビーボタン<WO>おすと"
+	next "つうしん<WO>ちゅうし します"
 	db   "@"
 
 ; 10575e
--- a/engine/pokedex/pokedex_2.asm
+++ b/engine/pokedex/pokedex_2.asm
@@ -211,7 +211,8 @@
 	call FarString
 	ret
 
-String_44331: ; 44331
+UnreferencedPOKeString: ; 44331
+; unused
 	db "#@"
 
 GetDexEntryPointer: ; 44333
--- a/engine/start_menu.asm
+++ b/engine/start_menu.asm
@@ -1595,7 +1595,7 @@
 	lb bc, 5, SCREEN_WIDTH - 2
 	call ClearBox
 	hlcoord 1, 12
-	ld de, String_1316b
+	ld de, String_MoveWhere
 	call PlaceString
 	jp .joy_loop
 .b_button
@@ -1771,7 +1771,7 @@
 	db D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON
 ; 1316b
 
-String_1316b: ; 1316b
+String_MoveWhere: ; 1316b
 	db "Where?@"
 ; 13172
 
@@ -1871,13 +1871,13 @@
 	xor a
 	ld [hBGMapMode], a
 	hlcoord 0, 10
-	ld de, String_132ba
+	ld de, String_MoveType_Top
 	call PlaceString
 	hlcoord 0, 11
-	ld de, String_132c2
+	ld de, String_MoveType_Bottom
 	call PlaceString
 	hlcoord 12, 12
-	ld de, String_132ca
+	ld de, String_MoveAtk
 	call PlaceString
 	ld a, [wCurMove]
 	ld b, a
@@ -1900,7 +1900,7 @@
 	jr .description
 
 .no_power
-	ld de, String_132cf
+	ld de, String_MoveNoPower
 	call PlaceString
 
 .description
@@ -1911,16 +1911,16 @@
 	ret
 ; 132ba
 
-String_132ba: ; 132ba
+String_MoveType_Top: ; 132ba
 	db "┌─────┐@"
 ; 132c2
-String_132c2: ; 132c2
+String_MoveType_Bottom: ; 132c2
 	db "│TYPE/└@"
 ; 132ca
-String_132ca: ; 132ca
+String_MoveAtk: ; 132ca
 	db "ATK/@"
 ; 132cf
-String_132cf: ; 132cf
+String_MoveNoPower: ; 132cf
 	db "---@"
 ; 132d3