shithub: pokered

Download patch

ref: 7990b5f632b66508e1be2b79677360d0709b3749
parent: b6d32d9022e43f56dc2797cac4879f61542f3b9e
author: Bryan Bishop <kanzure@gmail.com>
date: Tue Jan 10 07:06:48 EST 2012

call $31cc -> call LoadTrainerHeader

hg-commit-id: ad7efeae25ae


--- a/pokered.asm
+++ b/pokered.asm
@@ -1140,8 +1140,70 @@
 HiddenPrefix:
 	db "HM"
 
-INCBIN "baserom.gbc",$3040,$3493 - $3040
+INCBIN "baserom.gbc",$3040,$31cc - $3040
+LoadTrainerHeader: ; 0x31cc
+    call $3157
+    xor a
+    call $3193
+    ld a, $2
+    call $3193
+    ld a, [$cc55]
+    ld c, a
+    ld b, $2
+    call $31c7
+    ld a, c
+    and a
+    jr z, .asm_c2964 ; 0x31e3 $8
+    ld a, $6
+    call $3193
+    jp $3c49
+.asm_c2964 ; 0x31ed
+    ld a, $4
+    call $3193
+    call PrintText
+    ld a, $a
+    call $3193
+    push de
+    ld a, $8
+    call $3193
+    pop de
+    call $3354
+    ld hl, $d733
+    set 4, [hl]
+    ld hl, $cd60
+    bit 0, [hl]
+    ret nz
+    call $336a
+    ld hl, $da39
+    inc [hl]
+    jp $325d
+    call $3306
+    ld a, [$cf13]
+    cp $ff
+    jr nz, .asm_76c22 ; 0x3221 $8
+    xor a
+    ld [$cf13], a
+    ld [$cc55], a
+    ret
+.asm_76c22 ; 0x322b
+    ld hl, $d733
+    set 3, [hl]
+    ld [$cd4f], a
+    xor a
+    ld [$cd50], a
+    ld a, $4c
+    call $3e6d
+    ld a, $f0
+    ld [$cd6b], a
+    xor a
+    ldh [$b4], a
+    call $32cf
+    ld hl, $da39
+    inc [hl]
+    ret
 
+INCBIN "baserom.gbc",$324c,$247
+
 Function3493: ; 3493
 ; XXX what does this do
 ; related to Pokémon Tower and ghosts
@@ -1567,8 +1629,22 @@
 	ld a,$45
 	jp Predef
 
-INCBIN "baserom.gbc",$3df9,$3e48 - $3df9
+INCBIN "baserom.gbc",$3df9,$3e2e - $3df9
 
+GiveItem: ; 0x3e2e
+    ld a, b
+    ld [$d11e], a
+    ld [$cf91], a
+    ld a, c
+    ld [$cf96], a
+    ld hl, $d31d
+    call $2bcf
+    ret nc
+    call $2fcf
+    call $3826
+    scf
+    ret
+
 GivePokemon: ; 0x3e48
     ld a, b
     ld [$cf91], a
@@ -6617,7 +6693,7 @@
 SilphCo4Text2: ; 0x19dea
     db $08 ; asm
     ld hl, $5dae
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$19df4,$19e03 - $19df4
@@ -6624,7 +6700,7 @@
 SilphCo4Text3: ; 0x19e03
     db $08 ; asm
     ld hl, $5dba
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$19e0d,$19e1c - $19e0d
@@ -6631,7 +6707,7 @@
 SilphCo4Text4: ; 0x19e1c
     db $08 ; asm
     ld hl, $5dc6
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$19e26,$f
@@ -6691,7 +6767,7 @@
 SilphCo5Text2: ; 0x1a01a
     db $08 ; asm
     ld hl, $5fd2
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$1a024,$1a033 - $1a024
@@ -6698,7 +6774,7 @@
 SilphCo5Text3: ; 0x1a033
     db $08 ; asm
     ld hl, $5fde
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$1a03d,$1a04c - $1a03d
@@ -6705,7 +6781,7 @@
 SilphCo5Text4: ; 0x1a04c
     db $08 ; asm
     ld hl, $5fea
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$1a056,$1a065 - $1a056
@@ -6712,7 +6788,7 @@
 SilphCo5Text5: ; 0x1a065
     db $08 ; asm
     ld hl, $5ff6
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$1a06f,$f
@@ -6824,7 +6900,7 @@
 SilphCo6Text6: ; 0x1a2b0
     db $08 ; asm
     ld hl, $620a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$1a2ba,$1a2c9 - $1a2ba
@@ -6831,7 +6907,7 @@
 SilphCo6Text7: ; 0x1a2c9
     db $08 ; asm
     ld hl, $6216
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$1a2d3,$1a2e2 - $1a2d3
@@ -6838,7 +6914,7 @@
 SilphCo6Text8: ; 0x1a2e2
     db $08 ; asm
     ld hl, $6222
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$1a2ec,$f
@@ -15856,7 +15932,7 @@
 Mansion1Text1: ; 0x44341
     db $08 ; asm
     ld hl, $4334
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$4434b,$59
@@ -15923,7 +15999,7 @@
     ld [$4d21], sp
     ld b, l
 .asm_bcf23 ; 0x44582
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$44588,$69
@@ -16055,25 +16131,25 @@
 VictoryRoad3Text1: ; 0x44a69
     db $08 ; asm
     ld hl, $4a38
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad3Text2: ; 0x44a73
     db $08 ; asm
     ld hl, $4a44
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad3Text3: ; 0x44a7d
     db $08 ; asm
     ld hl, $4a50
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad3Text4: ; 0x44a87
     db $08 ; asm
     ld hl, $4a5c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$44a91,$3c
@@ -16122,31 +16198,31 @@
 RocketHideout1Text1: ; 0x44c5f
     db $08 ; asm
     ld hl, $4c22
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RocketHideout1Text2: ; 0x44c69
     db $08 ; asm
     ld hl, $4c2e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RocketHideout1Text3: ; 0x44c73
     db $08 ; asm
     ld hl, $4c3a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RocketHideout1Text4: ; 0x44c7d
     db $08 ; asm
     ld hl, $4c46
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RocketHideout1Text5: ; 0x44c87
     db $08 ; asm
     ld hl, $4c52
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$44c91,$56
@@ -16194,7 +16270,7 @@
 RocketHideout2Text1: ; 0x450de
     db $08 ; asm
     ld hl, $50d1
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$450e8,$f
@@ -16240,7 +16316,7 @@
 RocketHideout3Text1: ; 0x4531b
     db $08 ; asm
     ld hl, $5302
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$45325,$45334 - $45325
@@ -16247,7 +16323,7 @@
 RocketHideout3Text2: ; 0x45334
     db $08 ; asm
     ld hl, $530e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$4533e,$f
@@ -16315,7 +16391,7 @@
 RocketHideout4Text2: ; 0x45589
     db $08 ; asm
     ld hl, $5515
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$45593,$455a2 - $45593
@@ -16322,7 +16398,7 @@
 RocketHideout4Text3: ; 0x455a2
     db $08 ; asm
     ld hl, $5521
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$455ac,$455bb - $455ac
@@ -16329,7 +16405,7 @@
 RocketHideout4Text4: ; 0x455bb
     db $08 ; asm
     ld hl, $552d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$455c5,$2c
@@ -16863,7 +16939,7 @@
 UnknownDungeon3Text1: ; 0x45f1c
     db $08 ; asm
     ld hl, $5f0f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$45f26,$10
@@ -16899,49 +16975,49 @@
 RockTunnel2Text1: ; 0x46075
     db $08 ; asm
     ld hl, $6014
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RockTunnel2Text2: ; 0x4607f
     db $08 ; asm
     ld hl, $6020
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RockTunnel2Text3: ; 0x46089
     db $08 ; asm
     ld hl, $602c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RockTunnel2Text4: ; 0x46093
     db $08 ; asm
     ld hl, $6038
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RockTunnel2Text5: ; 0x4609d
     db $08 ; asm
     ld hl, $6044
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RockTunnel2Text6: ; 0x460a7
     db $08 ; asm
     ld hl, $6050
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RockTunnel2Text7: ; 0x460b1
     db $08 ; asm
     ld hl, $605c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 RockTunnel2Text8: ; 0x460bb
     db $08 ; asm
     ld hl, $6068
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$460c5,$78
@@ -17118,7 +17194,7 @@
 SeafoamIslands5Text3: ; 0x46893
     db $08 ; asm
     ld hl, $6886
-    call $31cc
+    call LoadTrainerHeader
     ld a, $4
     ld [$d668], a
     jp $24d7
@@ -17933,7 +18009,7 @@
 CeladonGymText2: ; 0x48a81
     db $08 ; asm
     ld hl, $49bc
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$48a8b,$48a9a - $48a8b
@@ -17940,7 +18016,7 @@
 CeladonGymText3: ; 0x48a9a
     db $08 ; asm
     ld hl, $49c8
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$48aa4,$48ab3 - $48aa4
@@ -17947,7 +18023,7 @@
 CeladonGymText4: ; 0x48ab3
     db $08 ; asm
     ld hl, $49d4
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$48abd,$48acc - $48abd
@@ -17954,7 +18030,7 @@
 CeladonGymText5: ; 0x48acc
     db $08 ; asm
     ld hl, $49e0
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$48ad6,$48ae5 - $48ad6
@@ -17961,7 +18037,7 @@
 CeladonGymText6: ; 0x48ae5
     db $08 ; asm
     ld hl, $49ec
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$48aef,$48afe - $48aef
@@ -17968,7 +18044,7 @@
 CeladonGymText7: ; 0x48afe
     db $08 ; asm
     ld hl, $49f8
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$48b08,$48b17 - $48b08
@@ -17975,7 +18051,7 @@
 CeladonGymText8: ; 0x48b17
     db $08 ; asm
     ld hl, $4a04
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$48b21,$f
@@ -19172,43 +19248,43 @@
 MtMoon1Text1: ; 0x49a52
     db $08 ; asm
     ld hl, $59fd
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon1Text2: ; 0x49a5c
     db $08 ; asm
     ld hl, $5a09
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon1Text3: ; 0x49a66
     db $08 ; asm
     ld hl, $5a15
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon1Text4: ; 0x49a70
     db $08 ; asm
     ld hl, $5a21
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon1Text5: ; 0x49a7a
     db $08 ; asm
     ld hl, $5a2d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon1Text6: ; 0x49a84
     db $08 ; asm
     ld hl, $5a39
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon1Text7: ; 0x49a8e
     db $08 ; asm
     ld hl, $5a45
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$49a98,$69
@@ -19301,25 +19377,25 @@
 MtMoon3Text2: ; 0x49ec1
     db $08 ; asm
     ld hl, $5e48
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon3Text3: ; 0x49ecb
     db $08 ; asm
     ld hl, $5e54
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon3Text4: ; 0x49ed5
     db $08 ; asm
     ld hl, $5e60
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon3Text5: ; 0x49edf
     db $08 ; asm
     ld hl, $5e6c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 MtMoon3Text6: ; 0x49ee9
@@ -20352,61 +20428,61 @@
 Route20Text1: ; 0x50db3
     db $08 ; asm
     ld hl, $4d3a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text2: ; 0x50dbd
     db $08 ; asm
     ld hl, $4d46
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text3: ; 0x50dc7
     db $08 ; asm
     ld hl, $4d52
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text4: ; 0x50dd1
     db $08 ; asm
     ld hl, $4d5e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text5: ; 0x50ddb
     db $08 ; asm
     ld hl, $4d6a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text6: ; 0x50de5
     db $08 ; asm
     ld hl, $4d76
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text7: ; 0x50def
     db $08 ; asm
     ld hl, $4d82
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text8: ; 0x50df9
     db $08 ; asm
     ld hl, $4d8e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text9: ; 0x50e03
     db $08 ; asm
     ld hl, $4d9a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route20Text10: ; 0x50e0d
     db $08 ; asm
     ld hl, $4da6
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$50e17,$96
@@ -20498,37 +20574,37 @@
 Route24Text2: ; 0x51535
     db $08 ; asm
     ld hl, $545b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route24Text3: ; 0x5153f
     db $08 ; asm
     ld hl, $5467
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route24Text4: ; 0x51549
     db $08 ; asm
     ld hl, $5473
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route24Text5: ; 0x51553
     db $08 ; asm
     ld hl, $547f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route24Text6: ; 0x5155d
     db $08 ; asm
     ld hl, $548b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route24Text7: ; 0x51567
     db $08 ; asm
     ld hl, $5497
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$51571,$516ab - $51571
@@ -20535,55 +20611,55 @@
 Route25Text1: ; 0x516ab
     db $08 ; asm
     ld hl, $563e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route25Text2: ; 0x516b5
     db $08 ; asm
     ld hl, $564a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route25Text3: ; 0x516bf
     db $08 ; asm
     ld hl, $5656
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route25Text4: ; 0x516c9
     db $08 ; asm
     ld hl, $5662
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route25Text5: ; 0x516d3
     db $08 ; asm
     ld hl, $566e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route25Text6: ; 0x516dd
     db $08 ; asm
     ld hl, $567a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route25Text7: ; 0x516e7
     db $08 ; asm
     ld hl, $5686
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route25Text8: ; 0x516f1
     db $08 ; asm
     ld hl, $5692
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route25Text9: ; 0x516fb
     db $08 ; asm
     ld hl, $569e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$51705,$87
@@ -20605,37 +20681,37 @@
 VictoryRoad2Text1: ; 0x5187e
     db $08 ; asm
     ld hl, $5835
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad2Text2: ; 0x51888
     db $08 ; asm
     ld hl, $5841
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad2Text3: ; 0x51892
     db $08 ; asm
     ld hl, $584d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad2Text4: ; 0x5189c
     db $08 ; asm
     ld hl, $5859
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad2Text5: ; 0x518a6
     db $08 ; asm
     ld hl, $5865
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad2Text6: ; 0x518b0
     db $08 ; asm
     ld hl, $5871
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$518ba,$5b
@@ -20796,7 +20872,7 @@
 SilphCo7Text5: ; 0x51e50
     db $08 ; asm
     ld hl, $5d5d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$51e5a,$51e69 - $51e5a
@@ -20803,7 +20879,7 @@
 SilphCo7Text6: ; 0x51e69
     db $08 ; asm
     ld hl, $5d69
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$51e73,$51e82 - $51e73
@@ -20810,7 +20886,7 @@
 SilphCo7Text7: ; 0x51e82
     db $08 ; asm
     ld hl, $5d75
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$51e8c,$51e9b - $51e8c
@@ -20817,7 +20893,7 @@
 SilphCo7Text8: ; 0x51e9b
     db $08 ; asm
     ld hl, $5d81
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$51ea5,$51eb4 - $51ea5
@@ -20878,7 +20954,7 @@
 Mansion2Text1: ; 0x52064
     db $08 ; asm
     ld hl, $6057
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5206e,$f
@@ -20930,13 +21006,13 @@
 Mansion3Text1: ; 0x522af
     db $08 ; asm
     ld hl, $6296
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Mansion3Text2: ; 0x522b9
     db $08 ; asm
     ld hl, $62a2
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$522c3,$23
@@ -20976,13 +21052,13 @@
 Mansion4Text1: ; 0x52461
     db $08 ; asm
     ld hl, $6448
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Mansion4Text2: ; 0x5246b
     db $08 ; asm
     ld hl, $6454
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$52475,$1e
@@ -21525,7 +21601,7 @@
 Route3Text2: ; 0x5558b
     db $08 ; asm
     ld hl, $5525
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55595,$555a4 - $55595
@@ -21532,7 +21608,7 @@
 Route3Text3: ; 0x555a4
     db $08 ; asm
     ld hl, $5531
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$555ae,$555bd - $555ae
@@ -21539,7 +21615,7 @@
 Route3Text4: ; 0x555bd
     db $08 ; asm
     ld hl, $553d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$555c7,$555d6 - $555c7
@@ -21546,7 +21622,7 @@
 Route3Text5: ; 0x555d6
     db $08 ; asm
     ld hl, $5549
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$555e0,$555ef - $555e0
@@ -21553,7 +21629,7 @@
 Route3Text6: ; 0x555ef
     db $08 ; asm
     ld hl, $5555
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$555f9,$55608 - $555f9
@@ -21560,7 +21636,7 @@
 Route3Text7: ; 0x55608
     db $08 ; asm
     ld hl, $5561
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55612,$55621 - $55612
@@ -21567,7 +21643,7 @@
 Route3Text8: ; 0x55621
     db $08 ; asm
     ld hl, $556d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5562b,$5563a - $5562b
@@ -21574,7 +21650,7 @@
 Route3Text9: ; 0x5563a
     db $08 ; asm
     ld hl, $5579
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55644,$f
@@ -21592,7 +21668,7 @@
 Route4Text2: ; 0x5568f
     db $08 ; asm
     ld hl, $567d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55699,$f
@@ -21643,7 +21719,7 @@
     ld [$4b21], sp
     ld d, a
 .asm_4fe87 ; 0x5578c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55792,$87
@@ -21656,7 +21732,7 @@
 Route13Text1: ; 0x558ca
     db $08 ; asm
     ld hl, $5851
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$558d4,$558e3 - $558d4
@@ -21663,7 +21739,7 @@
 Route13Text2: ; 0x558e3
     db $08 ; asm
     ld hl, $585d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$558ed,$558fc - $558ed
@@ -21670,7 +21746,7 @@
 Route13Text3: ; 0x558fc
     db $08 ; asm
     ld hl, $5869
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55906,$55915 - $55906
@@ -21677,7 +21753,7 @@
 Route13Text4: ; 0x55915
     db $08 ; asm
     ld hl, $5875
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5591f,$5592e - $5591f
@@ -21684,7 +21760,7 @@
 Route13Text5: ; 0x5592e
     db $08 ; asm
     ld hl, $5881
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55938,$55947 - $55938
@@ -21691,7 +21767,7 @@
 Route13Text6: ; 0x55947
     db $08 ; asm
     ld hl, $588d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55951,$55960 - $55951
@@ -21698,7 +21774,7 @@
 Route13Text7: ; 0x55960
     db $08 ; asm
     ld hl, $5899
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5596a,$55979 - $5596a
@@ -21705,7 +21781,7 @@
 Route13Text8: ; 0x55979
     db $08 ; asm
     ld hl, $58a5
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55983,$55992 - $55983
@@ -21712,7 +21788,7 @@
 Route13Text9: ; 0x55992
     db $08 ; asm
     ld hl, $58b1
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5599c,$559ab - $5599c
@@ -21719,7 +21795,7 @@
 Route13Text10: ; 0x559ab
     db $08 ; asm
     ld hl, $58bd
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$559b5,$f
@@ -21742,7 +21818,7 @@
 Route14Text1: ; 0x55a7b
     db $08 ; asm
     ld hl, $5a02
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55a85,$55a94 - $55a85
@@ -21749,7 +21825,7 @@
 Route14Text2: ; 0x55a94
     db $08 ; asm
     ld hl, $5a0e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55a9e,$55aad - $55a9e
@@ -21756,7 +21832,7 @@
 Route14Text3: ; 0x55aad
     db $08 ; asm
     ld hl, $5a1a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55ab7,$55ac6 - $55ab7
@@ -21763,7 +21839,7 @@
 Route14Text4: ; 0x55ac6
     db $08 ; asm
     ld hl, $5a26
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55ad0,$55adf - $55ad0
@@ -21770,7 +21846,7 @@
 Route14Text5: ; 0x55adf
     db $08 ; asm
     ld hl, $5a32
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55ae9,$55af8 - $55ae9
@@ -21777,7 +21853,7 @@
 Route14Text6: ; 0x55af8
     db $08 ; asm
     ld hl, $5a3e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55b02,$55b11 - $55b02
@@ -21784,7 +21860,7 @@
 Route14Text7: ; 0x55b11
     db $08 ; asm
     ld hl, $5a4a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55b1b,$55b2a - $55b1b
@@ -21791,7 +21867,7 @@
 Route14Text8: ; 0x55b2a
     db $08 ; asm
     ld hl, $5a56
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55b34,$55b43 - $55b34
@@ -21798,7 +21874,7 @@
 Route14Text9: ; 0x55b43
     db $08 ; asm
     ld hl, $5a62
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55b4d,$55b5c - $55b4d
@@ -21805,7 +21881,7 @@
 Route14Text10: ; 0x55b5c
     db $08 ; asm
     ld hl, $5a6e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55b66,$f
@@ -21818,7 +21894,7 @@
 Route17Text1: ; 0x55c2c
     db $08 ; asm
     ld hl, $5bb3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55c36,$55c45 - $55c36
@@ -21825,7 +21901,7 @@
 Route17Text2: ; 0x55c45
     db $08 ; asm
     ld hl, $5bbf
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55c4f,$55c5e - $55c4f
@@ -21832,7 +21908,7 @@
 Route17Text3: ; 0x55c5e
     db $08 ; asm
     ld hl, $5bcb
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55c68,$55c77 - $55c68
@@ -21839,7 +21915,7 @@
 Route17Text4: ; 0x55c77
     db $08 ; asm
     ld hl, $5bd7
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55c81,$55c90 - $55c81
@@ -21846,7 +21922,7 @@
 Route17Text5: ; 0x55c90
     db $08 ; asm
     ld hl, $5be3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55c9a,$55ca9 - $55c9a
@@ -21853,7 +21929,7 @@
 Route17Text6: ; 0x55ca9
     db $08 ; asm
     ld hl, $5bef
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55cb3,$55cc2 - $55cb3
@@ -21860,7 +21936,7 @@
 Route17Text7: ; 0x55cc2
     db $08 ; asm
     ld hl, $5bfb
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55ccc,$55cdb - $55ccc
@@ -21867,7 +21943,7 @@
 Route17Text8: ; 0x55cdb
     db $08 ; asm
     ld hl, $5c07
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55ce5,$55cf4 - $55ce5
@@ -21874,7 +21950,7 @@
 Route17Text9: ; 0x55cf4
     db $08 ; asm
     ld hl, $5c13
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55cfe,$55d0d - $55cfe
@@ -21881,7 +21957,7 @@
 Route17Text10: ; 0x55d0d
     db $08 ; asm
     ld hl, $5c1f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55d17,$f
@@ -21919,61 +21995,61 @@
 Route19Text1: ; 0x55dec
     db $08 ; asm
     ld hl, $5d73
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text2: ; 0x55df6
     db $08 ; asm
     ld hl, $5d7f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text3: ; 0x55e00
     db $08 ; asm
     ld hl, $5d8b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text4: ; 0x55e0a
     db $08 ; asm
     ld hl, $5d97
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text5: ; 0x55e14
     db $08 ; asm
     ld hl, $5da3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text6: ; 0x55e1e
     db $08 ; asm
     ld hl, $5daf
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text7: ; 0x55e28
     db $08 ; asm
     ld hl, $5dbb
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text8: ; 0x55e32
     db $08 ; asm
     ld hl, $5dc7
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text9: ; 0x55e3c
     db $08 ; asm
     ld hl, $5dd3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route19Text10: ; 0x55e46
     db $08 ; asm
     ld hl, $5ddf
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55e50,$96
@@ -21986,55 +22062,55 @@
 Route21Text1: ; 0x55f83
     db $08 ; asm
     ld hl, $5f16
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route21Text2: ; 0x55f8d
     db $08 ; asm
     ld hl, $5f22
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route21Text3: ; 0x55f97
     db $08 ; asm
     ld hl, $5f2e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route21Text4: ; 0x55fa1
     db $08 ; asm
     ld hl, $5f3a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route21Text5: ; 0x55fab
     db $08 ; asm
     ld hl, $5f46
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route21Text6: ; 0x55fb5
     db $08 ; asm
     ld hl, $5f52
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route21Text7: ; 0x55fbf
     db $08 ; asm
     ld hl, $5f5e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route21Text8: ; 0x55fc9
     db $08 ; asm
     ld hl, $5f6a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 Route21Text9: ; 0x55fd3
     db $08 ; asm
     ld hl, $5f76
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$55fdd,$87
@@ -22313,19 +22389,19 @@
 SilphCo8Text2: ; 0x565c8
     db $08 ; asm
     ld hl, $6585
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo8Text3: ; 0x565d2
     db $08 ; asm
     ld hl, $6591
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo8Text4: ; 0x565dc
     db $08 ; asm
     ld hl, $659d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$565e6,$2d
@@ -22849,7 +22925,7 @@
 Route6Text2: ; 0x59139
     db $08 ; asm
     ld hl, $50e3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59143,$5914d - $59143
@@ -22856,7 +22932,7 @@
 Route6Text3: ; 0x5914d
     db $08 ; asm
     ld hl, $50ef
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59157,$59166 - $59157
@@ -22863,7 +22939,7 @@
 Route6Text4: ; 0x59166
     db $08 ; asm
     ld hl, $50fb
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59170,$5917f - $59170
@@ -22870,7 +22946,7 @@
 Route6Text5: ; 0x5917f
     db $08 ; asm
     ld hl, $5107
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59189,$59198 - $59189
@@ -22877,7 +22953,7 @@
 Route6Text6: ; 0x59198
     db $08 ; asm
     ld hl, $5113
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$591a2,$f
@@ -22890,7 +22966,7 @@
 Route8Text2: ; 0x59269
     db $08 ; asm
     ld hl, $51ef
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59273,$59282 - $59273
@@ -22897,7 +22973,7 @@
 Route8Text3: ; 0x59282
     db $08 ; asm
     ld hl, $51fb
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5928c,$5929b - $5928c
@@ -22904,7 +22980,7 @@
 Route8Text4: ; 0x5929b
     db $08 ; asm
     ld hl, $5207
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$592a5,$592b4 - $592a5
@@ -22911,7 +22987,7 @@
 Route8Text5: ; 0x592b4
     db $08 ; asm
     ld hl, $5213
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$592be,$592cd - $592be
@@ -22918,7 +22994,7 @@
 Route8Text6: ; 0x592cd
     db $08 ; asm
     ld hl, $521f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$592d7,$592e6 - $592d7
@@ -22925,7 +23001,7 @@
 Route8Text7: ; 0x592e6
     db $08 ; asm
     ld hl, $522b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$592f0,$592ff - $592f0
@@ -22932,7 +23008,7 @@
 Route8Text8: ; 0x592ff
     db $08 ; asm
     ld hl, $5237
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59309,$59318 - $59309
@@ -22939,7 +23015,7 @@
 Route8Text9: ; 0x59318
     db $08 ; asm
     ld hl, $5243
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59322,$f
@@ -22952,7 +23028,7 @@
 Route10Text1: ; 0x593ac
     db $08 ; asm
     ld hl, $5363
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$593b6,$593c5 - $593b6
@@ -22959,7 +23035,7 @@
 Route10Text2: ; 0x593c5
     db $08 ; asm
     ld hl, $536f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$593cf,$593de - $593cf
@@ -22966,7 +23042,7 @@
 Route10Text3: ; 0x593de
     db $08 ; asm
     ld hl, $537b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$593e8,$593f7 - $593e8
@@ -22973,7 +23049,7 @@
 Route10Text4: ; 0x593f7
     db $08 ; asm
     ld hl, $5387
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59401,$59410 - $59401
@@ -22980,7 +23056,7 @@
 Route10Text5: ; 0x59410
     db $08 ; asm
     ld hl, $5393
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5941a,$59429 - $5941a
@@ -22987,7 +23063,7 @@
 Route10Text6: ; 0x59429
     db $08 ; asm
     ld hl, $539f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59433,$f
@@ -23006,7 +23082,7 @@
 Route11Text2: ; 0x5950d
     db $08 ; asm
     ld hl, $5487
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59517,$59526 - $59517
@@ -23013,7 +23089,7 @@
 Route11Text3: ; 0x59526
     db $08 ; asm
     ld hl, $5493
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59530,$5953f - $59530
@@ -23020,7 +23096,7 @@
 Route11Text4: ; 0x5953f
     db $08 ; asm
     ld hl, $549f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59549,$59558 - $59549
@@ -23027,7 +23103,7 @@
 Route11Text5: ; 0x59558
     db $08 ; asm
     ld hl, $54ab
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59562,$59571 - $59562
@@ -23034,7 +23110,7 @@
 Route11Text6: ; 0x59571
     db $08 ; asm
     ld hl, $54b7
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5957b,$5958a - $5957b
@@ -23041,7 +23117,7 @@
 Route11Text7: ; 0x5958a
     db $08 ; asm
     ld hl, $54c3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59594,$595a3 - $59594
@@ -23048,7 +23124,7 @@
 Route11Text8: ; 0x595a3
     db $08 ; asm
     ld hl, $54cf
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$595ad,$595bc - $595ad
@@ -23055,7 +23131,7 @@
 Route11Text9: ; 0x595bc
     db $08 ; asm
     ld hl, $54db
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$595c6,$595d5 - $595c6
@@ -23062,7 +23138,7 @@
 Route11Text10: ; 0x595d5
     db $08 ; asm
     ld hl, $54e7
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$595df,$f
@@ -23081,7 +23157,7 @@
 Route12Text2: ; 0x596f5
     db $08 ; asm
     ld hl, $5691
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$596ff,$5970e - $596ff
@@ -23088,7 +23164,7 @@
 Route12Text3: ; 0x5970e
     db $08 ; asm
     ld hl, $569d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59718,$59727 - $59718
@@ -23095,7 +23171,7 @@
 Route12Text4: ; 0x59727
     db $08 ; asm
     ld hl, $56a9
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59731,$59740 - $59731
@@ -23102,7 +23178,7 @@
 Route12Text5: ; 0x59740
     db $08 ; asm
     ld hl, $56b5
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5974a,$59759 - $5974a
@@ -23109,7 +23185,7 @@
 Route12Text6: ; 0x59759
     db $08 ; asm
     ld hl, $56c1
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59763,$59772 - $59763
@@ -23116,7 +23192,7 @@
 Route12Text7: ; 0x59772
     db $08 ; asm
     ld hl, $56cd
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5977c,$5978b - $5977c
@@ -23123,7 +23199,7 @@
 Route12Text8: ; 0x5978b
     db $08 ; asm
     ld hl, $56d9
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59795,$f
@@ -23169,7 +23245,7 @@
     ld [$4b21], sp
     ld e, b
 .asm_31ef8 ; 0x59892
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59898,$96
@@ -23182,7 +23258,7 @@
 Route16Text1: ; 0x59a18
     db $08 ; asm
     ld hl, $59cf
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59a22,$59a31 - $59a22
@@ -23189,7 +23265,7 @@
 Route16Text2: ; 0x59a31
     db $08 ; asm
     ld hl, $59db
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59a3b,$59a4a - $59a3b
@@ -23196,7 +23272,7 @@
 Route16Text3: ; 0x59a4a
     db $08 ; asm
     ld hl, $59e7
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59a54,$59a63 - $59a54
@@ -23203,7 +23279,7 @@
 Route16Text4: ; 0x59a63
     db $08 ; asm
     ld hl, $59f3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59a6d,$59a7c - $59a6d
@@ -23210,7 +23286,7 @@
 Route16Text5: ; 0x59a7c
     db $08 ; asm
     ld hl, $59ff
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59a86,$59a95 - $59a86
@@ -23217,7 +23293,7 @@
 Route16Text6: ; 0x59a95
     db $08 ; asm
     ld hl, $5a0b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59a9f,$f
@@ -23241,7 +23317,7 @@
 Route18Text1: ; 0x59b0f
     db $08 ; asm
     ld hl, $5aea
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59b19,$59b28 - $59b19
@@ -23248,7 +23324,7 @@
 Route18Text2: ; 0x59b28
     db $08 ; asm
     ld hl, $5af6
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59b32,$59b41 - $59b32
@@ -23255,7 +23331,7 @@
 Route18Text3: ; 0x59b41
     db $08 ; asm
     ld hl, $5b02
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59b4b,$f
@@ -23424,25 +23500,25 @@
 SilphCo2Text2: ; 0x59e02
     db $08 ; asm
     ld hl, $5d90
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo2Text3: ; 0x59e0c
     db $08 ; asm
     ld hl, $5d9c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo2Text4: ; 0x59e16
     db $08 ; asm
     ld hl, $5da8
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo2Text5: ; 0x59e20
     db $08 ; asm
     ld hl, $5db4
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$59e2a,$3c
@@ -23504,7 +23580,7 @@
 SilphCo3Text2: ; 0x5a003
     db $08 ; asm
     ld hl, $5fcc
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5a00d,$5a01c - $5a00d
@@ -23511,7 +23587,7 @@
 SilphCo3Text3: ; 0x5a01c
     db $08 ; asm
     ld hl, $5fd8
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5a026,$f
@@ -23566,13 +23642,13 @@
 SilphCo10Text1: ; 0x5a1ab
     db $08 ; asm
     ld hl, $6192
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo10Text2: ; 0x5a1b5
     db $08 ; asm
     ld hl, $619e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo10Text3: ; 0x5a1bf
@@ -23632,7 +23708,7 @@
 LanceText1: ; 0x5a3a4
     db $08 ; asm
     ld hl, $6397
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5a3ae,$17
@@ -23970,7 +24046,7 @@
 PewterGymText2: ; 0x5c4c6
     db $08 ; asm
     ld hl, $4441
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5c4d0,$5c4df - $5c4d0
@@ -24155,7 +24231,7 @@
 CeruleanGymText2: ; 0x5c7df
     db $08 ; asm
     ld hl, $4758
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5c7e9,$5c7f8 - $5c7e9
@@ -24162,7 +24238,7 @@
 CeruleanGymText3: ; 0x5c7f8
     db $08 ; asm
     ld hl, $4764
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5c802,$5c811 - $5c802
@@ -24438,7 +24514,7 @@
 VermilionGymText2: ; 0x5cb90
     db $08 ; asm
     ld hl, $4af8
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5cb9a,$5cba9 - $5cb9a
@@ -24445,7 +24521,7 @@
 VermilionGymText3: ; 0x5cba9
     db $08 ; asm
     ld hl, $4b04
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5cbb3,$5cbc2 - $5cbb3
@@ -24452,7 +24528,7 @@
 VermilionGymText4: ; 0x5cbc2
     db $08 ; asm
     ld hl, $4b10
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5cbcc,$5cbdb - $5cbcc
@@ -24634,7 +24710,7 @@
 FightingDojoText2: ; 0x5cea2
     db $08 ; asm
     ld hl, $4e13
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5ceac,$5cebb - $5ceac
@@ -24641,7 +24717,7 @@
 FightingDojoText3: ; 0x5cebb
     db $08 ; asm
     ld hl, $4e1f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5cec5,$5ced4 - $5cec5
@@ -24648,7 +24724,7 @@
 FightingDojoText4: ; 0x5ced4
     db $08 ; asm
     ld hl, $4e2b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5cede,$5ceed - $5cede
@@ -24655,7 +24731,7 @@
 FightingDojoText5: ; 0x5ceed
     db $08 ; asm
     ld hl, $4e37
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5cef7,$5cf06 - $5cef7
@@ -24798,43 +24874,43 @@
 SaffronGymText2: ; 0x5d187
     db $08 ; asm
     ld hl, $50c3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SaffronGymText3: ; 0x5d191
     db $08 ; asm
     ld hl, $50cf
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SaffronGymText4: ; 0x5d19b
     db $08 ; asm
     ld hl, $50db
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SaffronGymText5: ; 0x5d1a5
     db $08 ; asm
     ld hl, $50e7
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SaffronGymText6: ; 0x5d1af
     db $08 ; asm
     ld hl, $50f3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SaffronGymText7: ; 0x5d1b9
     db $08 ; asm
     ld hl, $50ff
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SaffronGymText8: ; 0x5d1c3
     db $08 ; asm
     ld hl, $510b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SaffronGymText9: ; 0x5d1cd
@@ -25355,19 +25431,19 @@
 SilphCo9Text2: ; 0x5d8f4
     db $08 ; asm
     ld hl, $5893
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo9Text3: ; 0x5d8fe
     db $08 ; asm
     ld hl, $589f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SilphCo9Text4: ; 0x5d908
     db $08 ; asm
     ld hl, $58ab
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5d912,$2d
@@ -25412,13 +25488,13 @@
 VictoryRoad1Text1: ; 0x5da86
     db $08 ; asm
     ld hl, $5a6d
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 VictoryRoad1Text2: ; 0x5da90
     db $08 ; asm
     ld hl, $5a79
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$5da9a,$1e
@@ -25614,19 +25690,19 @@
 PokemonTower3Text1: ; 0x60712
     db $08 ; asm
     ld hl, $46ed
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower3Text2: ; 0x6071c
     db $08 ; asm
     ld hl, $46f9
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower3Text3: ; 0x60726
     db $08 ; asm
     ld hl, $4705
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$60730,$2d
@@ -25665,19 +25741,19 @@
 PokemonTower4Text1: ; 0x60840
     db $08 ; asm
     ld hl, $481b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower4Text2: ; 0x6084a
     db $08 ; asm
     ld hl, $4827
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower4Text3: ; 0x60854
     db $08 ; asm
     ld hl, $4833
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$6085e,$2d
@@ -25723,7 +25799,7 @@
 PokemonTower5Text2: ; 0x609df
     db $08 ; asm
     ld hl, $49a9
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$609e9,$609f8 - $609e9
@@ -25730,7 +25806,7 @@
 PokemonTower5Text3: ; 0x609f8
     db $08 ; asm
     ld hl, $49b5
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$60a02,$60a11 - $60a02
@@ -25737,7 +25813,7 @@
 PokemonTower5Text4: ; 0x60a11
     db $08 ; asm
     ld hl, $49c1
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$60a1b,$60a2a - $60a1b
@@ -25744,7 +25820,7 @@
 PokemonTower5Text5: ; 0x60a2a
     db $08 ; asm
     ld hl, $49cd
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$60a34,$14
@@ -25785,19 +25861,19 @@
 PokemonTower6Text1: ; 0x60be4
     db $08 ; asm
     ld hl, $4bbf
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower6Text2: ; 0x60bee
     db $08 ; asm
     ld hl, $4bcb
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower6Text3: ; 0x60bf8
     db $08 ; asm
     ld hl, $4bd7
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$60c02,$59
@@ -25839,19 +25915,19 @@
 PokemonTower7Text1: ; 0x60e6c
     db $08 ; asm
     ld hl, $4e47
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower7Text2: ; 0x60e76
     db $08 ; asm
     ld hl, $4e53
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower7Text3: ; 0x60e80
     db $08 ; asm
     ld hl, $4e5f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 PokemonTower7Text4: ; 0x60e8a
@@ -25977,19 +26053,19 @@
 ViridianForestText2: ; 0x6116c
     db $08 ; asm
     ld hl, $5142
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 ViridianForestText3: ; 0x61176
     db $08 ; asm
     ld hl, $514e
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 ViridianForestText4: ; 0x61180
     db $08 ; asm
     ld hl, $515a
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$6118a,$2d
@@ -26207,7 +26283,7 @@
 SSAnne5Text4: ; 0x616f9
     db $08 ; asm
     ld hl, $56d1
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$61703,$61712 - $61703
@@ -26214,7 +26290,7 @@
 SSAnne5Text5: ; 0x61712
     db $08 ; asm
     ld hl, $56dd
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$6171c,$f
@@ -26378,25 +26454,25 @@
 SSAnne8Text1: ; 0x619d6
     db $08 ; asm
     ld hl, $59a5
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne8Text2: ; 0x619e0
     db $08 ; asm
     ld hl, $59b1
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne8Text3: ; 0x619ea
     db $08 ; asm
     ld hl, $59bd
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne8Text4: ; 0x619f4
     db $08 ; asm
     ld hl, $59c9
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$619fe,$0
@@ -26481,25 +26557,25 @@
 SSAnne9Text1: ; 0x61bb5
     db $08 ; asm
     ld hl, $5b84
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne9Text2: ; 0x61bbf
     db $08 ; asm
     ld hl, $5b90
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne9Text3: ; 0x61bc9
     db $08 ; asm
     ld hl, $5b9c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne9Text4: ; 0x61bd3
     db $08 ; asm
     ld hl, $5ba8
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne9Text5: ; 0x61bdd
@@ -26616,37 +26692,37 @@
 SSAnne10Text1: ; 0x61dcd
     db $08 ; asm
     ld hl, $5d84
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne10Text2: ; 0x61dd7
     db $08 ; asm
     ld hl, $5d90
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne10Text3: ; 0x61de1
     db $08 ; asm
     ld hl, $5d9c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne10Text4: ; 0x61deb
     db $08 ; asm
     ld hl, $5da8
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne10Text5: ; 0x61df5
     db $08 ; asm
     ld hl, $5db4
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 SSAnne10Text6: ; 0x61dff
     db $08 ; asm
     ld hl, $5dc0
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$61e09,$0
@@ -26829,7 +26905,7 @@
 SilphCo11Text4: ; 0x6233a
     db $08 ; asm
     ld hl, $62c3
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$62344,$62353 - $62344
@@ -26836,7 +26912,7 @@
 SilphCo11Text5: ; 0x62353
     db $08 ; asm
     ld hl, $62cf
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$6235d,$23
@@ -27875,7 +27951,7 @@
 ViridianGymText2: ; 0x74af3
     db $08 ; asm
     ld hl, $4a08
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$74afd,$74b0c - $74afd
@@ -27882,7 +27958,7 @@
 ViridianGymText3: ; 0x74b0c
     db $08 ; asm
     ld hl, $4a14
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$74b16,$74b25 - $74b16
@@ -27889,7 +27965,7 @@
 ViridianGymText4: ; 0x74b25
     db $08 ; asm
     ld hl, $4a20
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$74b2f,$74b3e - $74b2f
@@ -27896,7 +27972,7 @@
 ViridianGymText5: ; 0x74b3e
     db $08 ; asm
     ld hl, $4a2c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$74b48,$74b57 - $74b48
@@ -27903,7 +27979,7 @@
 ViridianGymText6: ; 0x74b57
     db $08 ; asm
     ld hl, $4a38
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$74b61,$74b70 - $74b61
@@ -27910,7 +27986,7 @@
 ViridianGymText7: ; 0x74b70
     db $08 ; asm
     ld hl, $4a44
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$74b7a,$74b89 - $74b7a
@@ -27917,7 +27993,7 @@
 ViridianGymText8: ; 0x74b89
     db $08 ; asm
     ld hl, $4a50
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$74b93,$74ba2 - $74b93
@@ -27924,7 +28000,7 @@
 ViridianGymText9: ; 0x74ba2
     db $08 ; asm
     ld hl, $4a5c
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$74bac,$74bbb - $74bac
@@ -28375,7 +28451,7 @@
 FuchsiaGymText2: ; 0x755a4
     db $08 ; asm
     ld hl, $54eb
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$755ae,$755bd - $755ae
@@ -28382,7 +28458,7 @@
 FuchsiaGymText3: ; 0x755bd
     db $08 ; asm
     ld hl, $54f7
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$755c7,$755d6 - $755c7
@@ -28389,7 +28465,7 @@
 FuchsiaGymText4: ; 0x755d6
     db $08 ; asm
     ld hl, $5503
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$755e0,$755ef - $755e0
@@ -28396,7 +28472,7 @@
 FuchsiaGymText5: ; 0x755ef
     db $08 ; asm
     ld hl, $550f
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$755f9,$75608 - $755f9
@@ -28403,7 +28479,7 @@
 FuchsiaGymText6: ; 0x75608
     db $08 ; asm
     ld hl, $551b
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$75612,$75621 - $75612
@@ -28410,7 +28486,7 @@
 FuchsiaGymText7: ; 0x75621
     db $08 ; asm
     ld hl, $5527
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$7562b,$7563a - $7562b
@@ -29084,7 +29160,7 @@
 LoreliText1: ; 0x76262
     db $08 ; asm
     ld hl, $6255
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$7626c,$14
@@ -29124,7 +29200,7 @@
 BrunoText1: ; 0x763b9
     db $08 ; asm
     ld hl, $63ac
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$763c3,$14
@@ -29164,7 +29240,7 @@
 AgathaText1: ; 0x76516
     db $08 ; asm
     ld hl, $6509
-    call $31cc
+    call LoadTrainerHeader
     jp $24d7
 
 INCBIN "baserom.gbc",$76520,$14