shithub: pokecrystal

Download patch

ref: 01ba6bed889be703dbeaf8fa9be56f1b782606a1
parent: 5407d8de920b779d760d88153d8e314a687d100e
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Tue Jan 16 13:07:06 EST 2018

Move code out of data/

--- a/data/unused/dakutens.asm
+++ b/data/unused/dakutens.asm
@@ -1,4 +1,4 @@
-Dakutens: ; unused
+UnreferencedDakutens:
 	db "かが", "きぎ", "くぐ", "けげ", "こご"
 	db "さざ", "しじ", "すず", "せぜ", "そぞ"
 	db "ただ", "ちぢ", "つづ", "てで", "とど"
@@ -9,7 +9,7 @@
 	db "ハバ", "ヒビ", "フブ", "へべ", "ホボ"
 	db -1 ; end
 
-Handakutens: ; unused
+UnreferencedHandakutens:
 	db "はぱ", "ひぴ", "ふぷ", "へぺ", "ほぽ"
 	db "ハパ", "ヒピ", "フプ", "へぺ", "ホポ"
 	db -1 ; end
--- a/data/unused/gen_1_trainer_names.asm
+++ b/data/unused/gen_1_trainer_names.asm
@@ -1,72 +1,52 @@
-Unreferenced_GetGen1TrainerClassName: ; 50a28
-	ld hl, .Strings
-	ld a, [TrainerClass]
-	dec a
-	ld c, a
-	ld b, 0
-	add hl, bc
-	add hl, bc
-	ld a, [hli]
-	ld h, [hl]
-	ld l, a
-	ld de, StringBuffer1
-.copy
-	ld a, [hli]
-	ld [de], a
-	inc de
-	cp "@"
-	jr nz, .copy
-	ret
-
-.Strings: ; 50a42
+Gen1TrainerClassNames: ; 50a42
 ; Untranslated trainer class names from Red.
 	dw .Youngster
 	dw .BugCatcher
 	dw .Lass
-	dw OTClassName
+	dw OTClassName ; sailor
 	dw .JrTrainerM
 	dw .JrTrainerF
 	dw .Pokemaniac
 	dw .SuperNerd
-	dw OTClassName
-	dw OTClassName
+	dw OTClassName ; hiker
+	dw OTClassName ; biker
 	dw .Burglar
 	dw .Engineer
 	dw .Jack
-	dw OTClassName
+	dw OTClassName ; fisher
 	dw .Swimmer
-	dw OTClassName
-	dw OTClassName
+	dw OTClassName ; cue ball
+	dw OTClassName ; gambler
 	dw .Beauty
-	dw OTClassName
+	dw OTClassName ; psychic
 	dw .Rocker
 	dw .Juggler
-	dw OTClassName
-	dw OTClassName
+	dw OTClassName ; tamer
+	dw OTClassName ; bird keeper
 	dw .Blackbelt
-	dw OTClassName
+	dw OTClassName ; rival1
 	dw .ProfOak
 	dw .Chief
 	dw .Scientist
-	dw OTClassName
+	dw OTClassName ; giovanni
 	dw .Rocket
 	dw .CooltrainerM
 	dw .CooltrainerF
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
-	dw OTClassName
+	dw OTClassName ; bruno
+	dw OTClassName ; brock
+	dw OTClassName ; misty
+	dw OTClassName ; lt.surge
+	dw OTClassName ; erika
+	dw OTClassName ; koga
+	dw OTClassName ; blaine
+	dw OTClassName ; sabrina
+	dw OTClassName ; gentleman
+	dw OTClassName ; rival2
+	dw OTClassName ; rival3
+	dw OTClassName ; lorelei
+	dw OTClassName ; channeler
+	dw OTClassName ; agatha
+	dw OTClassName ; lance
 
 .Youngster:    db "たんパン@"
 .BugCatcher:   db "むしとり@"
--- a/engine/types.asm
+++ b/engine/types.asm
@@ -35,7 +35,7 @@
 	ld [hl], a
 	inc bc
 	add hl, bc
-	ld bc, 5
+	ld bc, NAME_LENGTH_JAPANESE - 1
 	jp ByteFill
 ; 5093a
 
@@ -91,9 +91,32 @@
 	ld h, [hl]
 	ld l, a
 	ld de, StringBuffer1
-	ld bc, 13
+	ld bc, MOVE_NAME_LENGTH
 	jp CopyBytes
 ; 5097b
 
 
 INCLUDE "data/types/names.asm"
+
+
+Unreferenced_GetGen1TrainerClassName: ; 50a28
+	ld hl, Gen1TrainerClassNames
+	ld a, [TrainerClass]
+	dec a
+	ld c, a
+	ld b, 0
+	add hl, bc
+	add hl, bc
+	ld a, [hli]
+	ld h, [hl]
+	ld l, a
+	ld de, StringBuffer1
+.copy
+	ld a, [hli]
+	ld [de], a
+	inc de
+	cp "@"
+	jr nz, .copy
+	ret
+
+INCLUDE "data/unused/gen_1_trainer_names.asm"
--- a/main.asm
+++ b/main.asm
@@ -253,7 +253,6 @@
 INCLUDE "engine/events/sacred_ash.asm"
 INCLUDE "engine/tempmon.asm"
 INCLUDE "engine/types.asm"
-INCLUDE "data/unused/gen_1_trainer_names.asm"
 INCLUDE "engine/mon_stats.asm"
 INCLUDE "engine/routines/initlist.asm"
 INCLUDE "engine/experience.asm"