Fix trainer sprite loading

Moved Yujirou to the end of the file and made the bank switching code more efficient, was swamp code before.
This commit is contained in:
May Evans 2023-04-02 21:37:57 +01:00
parent bd23dfa61e
commit fc597000fb
5 changed files with 11 additions and 13 deletions

View file

@ -27,7 +27,6 @@ ENDM
trainer_const BIKER ; $0A
trainer_const BURGLAR ; $0B
trainer_const ENGINEER ; $0C
trainer_const YUJIROU ; $0D, was unused juggler
trainer_const FISHER ; $0E
trainer_const SWIMMER ; $0F
trainer_const CUE_BALL ; $10
@ -62,4 +61,5 @@ ENDM
trainer_const CHANNELER ; $2D
trainer_const AGATHA ; $2E
trainer_const LANCE ; $2F
trainer_const YUJIROU ; $0D, was unused juggler, also not 0D but I can't be bothered to change everything
DEF NUM_TRAINERS EQU const_value - 1

View file

@ -11,7 +11,6 @@ TrainerNames::
db "BIKER@"
db "BURGLAR@"
db "ENGINEER@"
db "YUJIROU@"
db "FISHERMAN@"
db "SWIMMER@"
db "CUE BALL@"
@ -46,3 +45,4 @@ TrainerNames::
db "CHANNELER@"
db "AGATHA@"
db "LANCE@"
db "YUJIROU@"

View file

@ -11,7 +11,6 @@ TrainerDataPointers:
dw BikerData
dw BurglarData
dw EngineerData
dw YujirouData ; was unused juggler
dw FisherData
dw SwimmerData
dw CueBallData
@ -46,6 +45,7 @@ TrainerDataPointers:
dw ChannelerData
dw AgathaData
dw LanceData
dw YujirouData ; was unused juggler
; if first byte != $FF, then
; first byte is level (of all pokemon on this team)
@ -322,11 +322,6 @@ EngineerData:
db 21, MAGNEMITE, 0
db 18, MAGNEMITE, MAGNEMITE, MAGNETITE, 0
YujirouData: ; was unused juggler
db $FF, 7, KONYA, 7, RATTATA, 10, LICKITUNG, 0
; post-game rematch team (currently unused)
db $FF, 66, PERSIAN, 67, TAUROS, 67, MADAAMU, 66, BLISSEY, 67, SNORLAX, 70, LICKILICKY, 0
FisherData:
; SS Anne 2F Rooms
db 17, GOLDEEN, TENTACOOL, GOLDEEN, 0
@ -858,3 +853,8 @@ LanceData:
db $FF, 58, CROCKY, 57, KINGDRA, 57, AERODACTYL, 59, CHARIZARD, 59, CRYITHAN, 62, DRAGONITE, 0
; post-game rematch team (currently unused)
; db $FF, 78, CROCKY, 77, KINGDRA, 77, AERODACTYL, 79, EXEGGUTOR_A, 79, CRYITHAN, 82, DRAGONITE, 0
YujirouData: ; was unused juggler
db $FF, 7, KONYA, 7, RATTATA, 10, LICKITUNG, 0
; post-game rematch team (currently unused)
db $FF, 66, PERSIAN, 67, TAUROS, 67, MADAAMU, 66, BLISSEY, 67, SNORLAX, 70, LICKILICKY, 0

View file

@ -19,7 +19,6 @@ TrainerPicAndMoneyPointers::
pic_money BikerPic, 2000
pic_money BurglarPic, 9000
pic_money EngineerPic, 5000
pic_money YujirouPic, 9900 ; was unused juggler
pic_money FisherPic, 3500
pic_money SwimmerPic, 500
pic_money CueBallPic, 2500
@ -54,4 +53,5 @@ TrainerPicAndMoneyPointers::
pic_money ChannelerPic, 3000
pic_money AgathaPic, 9900
pic_money LancePic, 9900
pic_money YujirouPic, 9900 ; was unused juggler
assert_table_length NUM_TRAINERS

View file

@ -6954,11 +6954,9 @@ _LoadTrainerPic:
ld d, a ; de contains pointer to trainer pic
ld a, [wLinkState]
and a
;ld a, BANK("Pics 6") ; this is where all the trainer pics are (not counting Red's)
;jr z, .loadSprite
jr nz, .useRed ; New Trainer Pic code, credit to Rangi's Red*/Blue* hack
jr nz, .useRed
ld a, [wTrainerClass]
cp YUJIROU ; first trainer class in "Pics 10"
cp YUJIROU ; first trainer class in "Pics 10" - Rangi's code to load more trainer pics
ld a, Bank("Pics 10")
jr nc, .loadSprite
ld a, Bank("Pics 6")