shithub: pokecrystal

Download patch

ref: 7a24703398aba3ab112ed770368805a17c601c03
parent: 9a3088e50cf58158cbfb8de5ad80170967d975dc
author: xCrystal <[email protected]>
date: Tue Jan 2 10:05:14 EST 2018

Clean up Predef function names

--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -1,4 +1,4 @@
-Predef_StartBattle: ; 8c20f
+DoBattleTransition: ; 8c20f
 	call .InitGFX
 	ld a, [rBGP]
 	ld [wBGP], a
@@ -16,7 +16,7 @@
 	ld a, [wJumptableIndex]
 	bit 7, a
 	jr nz, .done
-	call FlashyTransitionToBattle
+	call BattleTransitionJumptable
 	call DelayFrame
 	jr .loop
 
@@ -144,7 +144,7 @@
 INCBIN "gfx/overworld/trainer_battle_pokeball_tiles.2bpp"
 
 
-FlashyTransitionToBattle: ; 8c314
+BattleTransitionJumptable: ; 8c314
 	jumptable .dw, wJumptableIndex
 ; 8c323
 
--- a/engine/battle/start_battle.asm
+++ b/engine/battle/start_battle.asm
@@ -33,7 +33,7 @@
 	add hl, de
 	ld a, [hl]
 	ld [BattleMonLevel], a
-	predef Predef_StartBattle
+	predef DoBattleTransition
 	farcall _LoadBattleFontsHPBar
 	ld a, 1
 	ld [hBGMapMode], a
--- a/engine/cgb_layouts.asm
+++ b/engine/cgb_layouts.asm
@@ -6,7 +6,7 @@
 	ret
 ; 8d59
 
-Predef_LoadSGBLayoutCGB: ; 8d59
+LoadSGBLayoutCGB: ; 8d59
 	ld a, b
 	cp SCGB_RAM
 	jr nz, .not_ram
--- a/engine/events/bug_contest/display_stats.asm
+++ b/engine/events/bug_contest/display_stats.asm
@@ -101,7 +101,7 @@
 	text_jump UnknownText_0x1c10dd
 	db "@"
 
-Predef2F:
-Predef38:
-Predef39: ; cc0d5
+DummyPredef2F:
+DummyPredef38:
+DummyPredef39: ; cc0d5
 	ret
--- a/engine/events/mom_phone.asm
+++ b/engine/events/mom_phone.asm
@@ -257,7 +257,7 @@
 
 	db 0 ; unused
 
-Predef3A: ; fd1d0
+DummyPredef3A: ; fd1d0
 	ret
 ; fd1d1
 
--- a/engine/events/special.asm
+++ b/engine/events/special.asm
@@ -230,6 +230,5 @@
 	ld bc, PKMN_NAME_LENGTH
 	jp CopyBytes
 
-Predef1: ; 747a
-; not used
+DummyPredef1: ; 747a
 	ret
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -1362,7 +1362,7 @@
 	hlcoord 0, 15
 	ld b, 1
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	hlcoord 2, 16
 	ld de, .String_Stats_Trade
 	call PlaceString
@@ -1471,7 +1471,7 @@
 	hlcoord 0, 12
 	ld b, 4
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	farcall Link_WaitBGMap
 	ld hl, .Text_CantTradeLastMon
 	bccoord 1, 14
@@ -1493,7 +1493,7 @@
 	hlcoord 0, 12
 	ld b, 4
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	farcall Link_WaitBGMap
 	ld hl, .Text_Abnormal
 	bccoord 1, 14
@@ -1503,7 +1503,7 @@
 	hlcoord 0, 12
 	ld b, 4
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	hlcoord 1, 14
 	ld de, String_TooBadTheTradeWasCanceled
 	call PlaceString
@@ -1649,7 +1649,7 @@
 	hlcoord 0, 12
 	ld b, $4
 	ld c, $12
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	farcall Link_WaitBGMap
 	ld a, [wd002]
 	ld hl, PartySpecies
@@ -1678,7 +1678,7 @@
 	hlcoord 10, 7
 	ld b, 3
 	ld c, 7
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	ld de, String28eab
 	hlcoord 12, 8
 	call PlaceString
@@ -1718,7 +1718,7 @@
 	hlcoord 0, 12
 	ld b, 4
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	hlcoord 1, 14
 	ld de, String_TooBadTheTradeWasCanceled
 	call PlaceString
@@ -1735,7 +1735,7 @@
 	hlcoord 0, 12
 	ld b, 4
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	hlcoord 1, 14
 	ld de, String_TooBadTheTradeWasCanceled
 	call PlaceString
@@ -1965,7 +1965,7 @@
 	hlcoord 0, 12
 	ld b, 4
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	hlcoord 1, 14
 	ld de, String28ebd
 	call PlaceString
@@ -2002,7 +2002,7 @@
 	next "was canceled!@"
 
 
-Predef_LinkTextbox: ; 28eef
+LinkTextboxPredef: ; 28eef
 	ld d, h
 	ld e, l
 	farcall LinkTextbox
@@ -2025,11 +2025,11 @@
 	hlcoord 0, 0
 	ld b, 6
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	hlcoord 0, 8
 	ld b, 6
 	ld c, 18
-	call Predef_LinkTextbox
+	call LinkTextboxPredef
 	farcall PlaceTradePartnerNamesAndParty
 	ret
 ; 28f24
--- a/engine/link_trade.asm
+++ b/engine/link_trade.asm
@@ -181,7 +181,7 @@
 	hlcoord 4, 10
 	ld b, 1
 	ld c, 10
-	predef Predef_LinkTextbox
+	predef LinkTextboxPredef
 	hlcoord 5, 11
 	ld de, .Waiting
 	call PlaceString
--- a/engine/mon_stats.asm
+++ b/engine/mon_stats.asm
@@ -335,7 +335,7 @@
 	jr nz, .loop
 	ret
 
-Predef22: ; unreferenced predef
+UnreferencedPredef22:
 	push hl
 	push hl
 	ld hl, PartyMonNicknames
--- a/engine/pic_animation.asm
+++ b/engine/pic_animation.asm
@@ -1110,9 +1110,10 @@
 	ret
 ; d0669
 
-Predef48: ; d0669 Predef 48
+UnreferencedPredef48: ; d0669 Predef 48
 	ld a, $1
 	ld [wBoxAlignment], a
+
 HOF_AnimateFrontpic: ; d066e Predef 49
 	call AnimateMon_CheckIfPokemon
 	jr c, .fail
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -441,7 +441,7 @@
 	call Pokedex_GetSelectedMon
 	ld a, [wDexCurrentLocation]
 	ld e, a
-	predef _Area
+	predef Pokedex_GetArea
 	call Pokedex_BlackOutBG
 	call DelayFrame
 	xor a
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -2440,7 +2440,7 @@
 
 ; 91d11
 
-_Area: ; 91d11
+Pokedex_GetArea: ; 91d11
 ; e: Current landmark
 	ld a, [wTownMapPlayerIconLandmark]
 	push af
--- a/engine/predef.asm
+++ b/engine/predef.asm
@@ -31,7 +31,7 @@
 ; address, bank
 
 	add_predef LearnMove ; $0
-	add_predef Predef1
+	add_predef DummyPredef1
 	add_predef HealParty
 	add_predef FlagPredef
 	add_predef ComputeHPBarPixels
@@ -46,7 +46,7 @@
 	add_predef CalcPkmnStatC
 	add_predef CanLearnTMHMMove
 	add_predef GetTMHMMove
-	add_predef Predef_LinkTextbox ; $ 10
+	add_predef LinkTextboxPredef ; $ 10
 	add_predef PrintMoveDesc
 	add_predef UpdatePlayerHUD
 	add_predef PlaceGraphic
@@ -64,7 +64,7 @@
 	add_predef CopyPkmnToTempMon
 	add_predef ListMoves ; $20
 	add_predef PlaceNonFaintStatus
-	add_predef Predef22
+	add_predef UnreferencedPredef22
 	add_predef ListMovePP
 	add_predef GetGender
 	add_predef StatsScreenInit
@@ -77,18 +77,18 @@
 	add_predef PrintMonTypes
 	add_predef GetUnownLetter
 	add_predef LoadPoisonBGPals
-	add_predef Predef2F
+	add_predef DummyPredef2F
 	add_predef InitSGBBorder ; $30
-	add_predef Predef_LoadSGBLayout
-	add_predef _Area
+	add_predef LoadSGBLayout
+	add_predef Pokedex_GetArea
 	add_predef CheckContestMon
-	add_predef Predef_StartBattle
-	add_predef Predef35
-	add_predef Predef36
+	add_predef DoBattleTransition
+	add_predef DummyPredef35
+	add_predef DummyPredef36
 	add_predef PlayBattleAnim
-	add_predef Predef38 ; $38
-	add_predef Predef39
-	add_predef Predef3A
+	add_predef DummyPredef38 ; $38
+	add_predef DummyPredef39
+	add_predef DummyPredef3A
 	add_predef PartyMonItemName
 	add_predef GetMonFrontpic
 	add_predef GetMonBackpic
@@ -102,7 +102,7 @@
 	add_predef PlaceStatusString
 	add_predef LoadMonAnimation
 	add_predef AnimateFrontpic
-	add_predef Predef48 ; $48
+	add_predef UnreferencedPredef48 ; $48
 	add_predef HOF_AnimateFrontpic
 	dbw $ff, InexplicablyEmptyFunction ; ???
 ; 864c
--- a/engine/routines/placewaitingtext.asm
+++ b/engine/routines/placewaitingtext.asm
@@ -11,7 +11,7 @@
 	jr .proceed
 
 .notinbattle
-	predef Predef_LinkTextbox
+	predef LinkTextboxPredef
 
 .proceed
 	hlcoord 4, 11
--- a/engine/sgb_layouts.asm
+++ b/engine/sgb_layouts.asm
@@ -1,7 +1,6 @@
-Predef_LoadSGBLayout: ; 864c
-; LoadSGBLayout
+LoadSGBLayout: ; 864c
 	call CheckCGB
-	jp nz, Predef_LoadSGBLayoutCGB
+	jp nz, LoadSGBLayoutCGB
 
 	ld a, b
 	cp SCGB_RAM
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -1,5 +1,5 @@
-Predef35: ; 8c000
-Predef36:
+DummyPredef35: ; 8c000
+DummyPredef36:
 	ret
 
 UpdateTimeOfDayPal:: ; 8c001
--- a/home.asm
+++ b/home.asm
@@ -712,7 +712,7 @@
 	ret z
 
 .sgb
-	predef_jump Predef_LoadSGBLayout ; LoadSGBLayout
+	predef_jump LoadSGBLayout
 ; 334e
 
 SetHPPal:: ; 334e