fixed the BT_OTrainer Labels

This commit is contained in:
JimB16 2015-08-26 03:11:19 +02:00
parent 2f4a0179fe
commit 4cd354ec32
3 changed files with 34 additions and 24 deletions

View File

@ -3,15 +3,22 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000
push af push af
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
; Fill BT_OTrainer with zeros
xor a xor a
ld hl, w3_d100 ld hl, BT_OTrainer
ld bc, $00e0 ld bc, BT_OTrainerEnd - BT_OTrainer
call ByteFill call ByteFill
; Write $ff into the Item-Slots
ld a, $ff ld a, $ff
ld [w3_d100 + $0c], a ld [BT_OTPkmn1Item], a
ld [w3_d100 + $47], a ld [BT_OTPkmn2Item], a
ld [w3_d100 + $82], a ld [BT_OTPkmn3Item], a
ld de, w3_d100
; Set BT_OTTrainer as start address to write the following data to
ld de, BT_OTrainer
ld a, [hRandomAdd] ld a, [hRandomAdd]
ld b, a ld b, a
.asm_1f8022 ; loop to find a random trainer .asm_1f8022 ; loop to find a random trainer
@ -110,22 +117,22 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
ld b, a ld b, a
ld a, [hld] ld a, [hld]
ld c, a ld c, a
ld a, [w3_d100 + $0b] ld a, [BT_OTPkmn1]
cp b cp b
jr z, .FindARandomBattleTowerPkmn jr z, .FindARandomBattleTowerPkmn
ld a, [w3_d100 + $0c] ld a, [BT_OTPkmn1Item]
cp c cp c
jr z, .FindARandomBattleTowerPkmn jr z, .FindARandomBattleTowerPkmn
ld a, [w3_d100 + $46] ld a, [BT_OTPkmn2]
cp b cp b
jr z, .FindARandomBattleTowerPkmn jr z, .FindARandomBattleTowerPkmn
ld a, [w3_d100 + $47] ld a, [BT_OTPkmn2Item]
cp c cp c
jr z, .FindARandomBattleTowerPkmn jr z, .FindARandomBattleTowerPkmn
ld a, [w3_d100 + $81] ld a, [BT_OTPkmn3]
cp b cp b
jr z, .FindARandomBattleTowerPkmn jr z, .FindARandomBattleTowerPkmn
ld a, [w3_d100 + $82] ld a, [BT_OTPkmn3Item]
cp c cp c
jr z, .FindARandomBattleTowerPkmn jr z, .FindARandomBattleTowerPkmn
ld a, [sBTPkmnPrevTrainer1] ld a, [sBTPkmnPrevTrainer1]
@ -178,11 +185,11 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
ld [sBTPkmnPrevPrevTrainer2], a ld [sBTPkmnPrevPrevTrainer2], a
ld a, [sBTPkmnPrevTrainer3] ld a, [sBTPkmnPrevTrainer3]
ld [sBTPkmnPrevPrevTrainer3], a ld [sBTPkmnPrevPrevTrainer3], a
ld a, [w3_d100 + $0b] ld a, [BT_OTPkmn1]
ld [sBTPkmnPrevTrainer1], a ld [sBTPkmnPrevTrainer1], a
ld a, [w3_d100 + $46] ld a, [BT_OTPkmn2]
ld [sBTPkmnPrevTrainer2], a ld [sBTPkmnPrevTrainer2], a
ld a, [w3_d100 + $81] ld a, [BT_OTPkmn3]
ld [sBTPkmnPrevTrainer3], a ld [sBTPkmnPrevTrainer3], a
call CloseSRAM call CloseSRAM
ret ret

View File

@ -23170,9 +23170,9 @@ Function1704a2: ; 1704a2
push af push af
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
ld hl, LYOverrides ld hl, $d100 ; this is NOT LYOverrides
ld de, $c608 ld de, $c608
ld bc, $00e0 ld bc, BT_OTrainerEnd - BT_OTrainer
call CopyBytes call CopyBytes
pop af pop af
ld [rSVBK], a ld [rSVBK], a

View File

@ -2600,22 +2600,25 @@ SECTION "WRAM 3", WRAMX, BANK [3]
ds $100 ds $100
BT_OTrainer::
w3_d100:: ; BattleTower OpponentTrainer-Data (lengt = 0xe0) w3_d100:: ; BattleTower OpponentTrainer-Data (lengt = 0xe0)
ds $6 ds $6
BT_OTTrainerPkmn1:: ; w3_d10b ds $5
BT_OTPkmn1:: ; w3_d10b
ds $1 ds $1
BT_OTTrainerPkmn1Item:: BT_OTPkmn1Item::
ds $3b-1 ds $3b-1
BT_OTTrainerPkmn2:: ; w3_d146 BT_OTPkmn2:: ; w3_d146
ds $1 ds $1
BT_OTTrainerPkmn2Item:: BT_OTPkmn2Item::
ds $3b-1 ds $3b-1
BT_OTTrainerPkmn3:: ; w3_d181 BT_OTPkmn3:: ; w3_d181
ds $1 ds $1
BT_OTTrainerPkmn3Item:: BT_OTPkmn3Item::
ds $3b-1 ds $3b-1
ds $29 ds $24
BT_OTrainerEnd::
ds $620 ds $620