Partial interpretation of battle tower trainer data

This commit is contained in:
PikalaxALT
2015-11-24 15:18:44 -05:00
parent 6c248953b7
commit f599e477fc
9 changed files with 2838 additions and 1458 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -288,13 +288,13 @@ SaveGameData_: ; 14c10
callba BackupPartyMonMail callba BackupPartyMonMail
callba BackupMobileEventIndex callba BackupMobileEventIndex
callba SaveRTC callba SaveRTC
ld a, BANK(sSaveType) ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank call GetSRAMBank
ld a, [sSaveType] ld a, [sBattleTowerChallengeState]
cp $4 cp $4
jr nz, .ok jr nz, .ok
xor a xor a
ld [sSaveType], a ld [sBattleTowerChallengeState], a
.ok .ok
call CloseSRAM call CloseSRAM
ret ret
@@ -438,10 +438,10 @@ Unknown_14d2c: ; 14d2c
; 14d5c ; 14d5c
Function14d5c: ; 14d5c Function14d5c: ; 14d5c
ld a, BANK(sSaveType) ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank call GetSRAMBank
xor a xor a
ld [sSaveType], a ld [sBattleTowerChallengeState], a
jp CloseSRAM jp CloseSRAM
; 14d68 ; 14d68
@@ -788,13 +788,13 @@ LoadPlayerData: ; 14fd7 (5:4fd7)
ld bc, wMapDataEnd - wMapData ld bc, wMapDataEnd - wMapData
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ld a, BANK(sSaveType) ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank call GetSRAMBank
ld a, [sSaveType] ld a, [sBattleTowerChallengeState]
cp $4 cp $4
jr nz, .not_4 jr nz, .not_4
ld a, $3 ld a, $3
ld [sSaveType], a ld [sBattleTowerChallengeState], a
.not_4 .not_4
call CloseSRAM call CloseSRAM
ret ret

View File

@@ -27,7 +27,7 @@ BattleTower1F_MapScriptHeader:
end end
.priorityjump1: .priorityjump1:
priorityjump UnknownScript_0x9e555 priorityjump BattleTower_LeftWithoutSaving
writebyte BATTLE_TOWER_ACTION_04 writebyte BATTLE_TOWER_ACTION_04
special BattleTowerAction special BattleTowerAction
writebyte BATTLE_TOWER_ACTION_06 writebyte BATTLE_TOWER_ACTION_06
@@ -119,7 +119,7 @@ Script_GivePlayerHisPrize: ; 0x9e47a
special BattleTowerAction special BattleTowerAction
writebyte BATTLE_TOWER_ACTION_1B writebyte BATTLE_TOWER_ACTION_1B
special BattleTowerAction special BattleTowerAction
if_equal $12, Script_YourPackIsStuffedFull if_equal POTION, Script_YourPackIsStuffedFull
itemtotext $0, $1 itemtotext $0, $1
giveitem ITEM_FROM_MEM, 5 giveitem ITEM_FROM_MEM, 5
writetext Text_PlayerGotFive writetext Text_PlayerGotFive
@@ -236,9 +236,9 @@ UnknownScript_0x9e550:
loadmovesprites loadmovesprites
end end
UnknownScript_0x9e555: BattleTower_LeftWithoutSaving:
loadfont loadfont
writetext UnknownText_0x9ee18 writetext Text_BattleTower_LeftWithoutSaving
closetext closetext
jump UnknownScript_0x9e4b0 jump UnknownScript_0x9e4b0
@@ -610,7 +610,7 @@ Text_BattleTowerRules: ; 0x9ed72
line "placed on them." line "placed on them."
done done
UnknownText_0x9ee18: Text_BattleTower_LeftWithoutSaving:
text "Excuse me!" text "Excuse me!"
line "You didn't SAVE" line "You didn't SAVE"

File diff suppressed because it is too large Load Diff

View File

@@ -175,7 +175,7 @@ Function118125: ; 118125
cp [hl] cp [hl]
jr nz, .asm_11813e jr nz, .asm_11813e
xor a xor a
ld [UnknBGPals], a ld [w3_d000], a
pop af pop af
ld [rSVBK], a ld [rSVBK], a
call Function118452 call Function118452
@@ -197,33 +197,37 @@ Function118180: ; 118180
ld de, $a89c ld de, $a89c
ld bc, $0016 ld bc, $0016
call CopyBytes call CopyBytes
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
ld de, $d202
ld de, w3_d202
ld c, $96 ld c, $96
callba Function17d0b3 callba CheckStringForErrors_IgnoreTerminator
jr c, .asm_1181d0 jr c, .return_d3
ld de, $d202
ld bc, $0196 ld de, w3_d202
callba Function17d1e1 lb bc, 1, $96
jr c, .asm_1181d0 callba CheckStringContainsLessThanBNextCharacters
ld hl, $d202 jr c, .return_d3
ld hl, w3_d202
ld de, $a8b2 ld de, $a8b2
ld bc, $0096 ld bc, $0096
call CopyBytes call CopyBytes
.asm_1181c9 .reset_banks
pop af pop af
ld [rSVBK], a ld [rSVBK], a
call CloseSRAM call CloseSRAM
ret ret
.asm_1181d0 .return_d3
ld a, $d3 ld a, $d3
ld [wc300], a ld [wc300], a
ld [ScriptVar], a ld [ScriptVar], a
jr .asm_1181c9 jr .reset_banks
; 1181da ; 1181da
Function1181da: ; 1181da Function1181da: ; 1181da
@@ -7549,8 +7553,8 @@ Function11b6b4: ; 11b6b4
.asm_11b70f .asm_11b70f
ld de, $c63d ld de, $c63d
ld bc, $0105 lb bc, 1, 5
callba Function17d1e1 callba CheckStringContainsLessThanBNextCharacters
jr nc, .asm_11b723 jr nc, .asm_11b723
callba Function17d187 callba Function17d187
@@ -7563,8 +7567,8 @@ Function11b6b4: ; 11b6b4
.asm_11b736 .asm_11b736
ld de, $c642 ld de, $c642
ld bc, $0105 lb bc, 1, 5
callba Function17d1e1 callba CheckStringContainsLessThanBNextCharacters
jr nc, .asm_11b74a jr nc, .asm_11b74a
callba Function17d199 callba Function17d199
@@ -7577,8 +7581,8 @@ Function11b6b4: ; 11b6b4
.asm_11b75d .asm_11b75d
ld de, $c647 ld de, $c647
ld bc, $0221 lb bc, 2, $21
callba Function17d1e1 callba CheckStringContainsLessThanBNextCharacters
jr c, .asm_11b770 jr c, .asm_11b770
ld a, b ld a, b
cp $2 cp $2
@@ -7596,8 +7600,8 @@ Function11b6b4: ; 11b6b4
.asm_11b789 .asm_11b789
ld de, $c668 ld de, $c668
ld bc, $0105 lb bc, 1, 5
callba Function17d1e1 callba CheckStringContainsLessThanBNextCharacters
jr nc, .asm_11b79d jr nc, .asm_11b79d
callba Function17d1c9 callba Function17d1c9

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ Function17c000: ; 17c000
call DisableLCD call DisableLCD
ld hl, VTiles2 ld hl, VTiles2
ld bc, $310 ld bc, $31 tiles
xor a xor a
call ByteFill call ByteFill
@@ -61,7 +61,7 @@ Function17c000: ; 17c000
ld hl, MobileSelectGFX ld hl, MobileSelectGFX
ld de, VTiles0 tile $30 ld de, VTiles0 tile $30
ld bc, $200 ld bc, $20 tiles
call CopyBytes call CopyBytes
ld a, 1 ld a, 1
@@ -69,12 +69,12 @@ Function17c000: ; 17c000
ld hl, HaveWantGFX ld hl, HaveWantGFX
ld de, VTiles2 ld de, VTiles2
ld bc, $800 ld bc, $80 tiles
call CopyBytes call CopyBytes
ld hl, HaveWantGFX + $800 ld hl, HaveWantGFX + $800
ld de, VTiles1 ld de, VTiles1
ld bc, $100 ld bc, $10 tiles
call CopyBytes call CopyBytes
xor a xor a
@@ -226,46 +226,48 @@ CheckStringForErrors: ; 17d073
ret ret
; 17d0b3 ; 17d0b3
Function17d0b3: ; 17d0b3 CheckStringForErrors_IgnoreTerminator: ; 17d0b3
.asm_17d0b3 ; Find control chars
.loop
ld a, [de] ld a, [de]
inc de inc de
and a and a
jr z, .asm_17d0ee jr z, .next
cp $60 cp "<DEXEND>" + 1
jr nc, .asm_17d0ee jr nc, .next
cp $4e cp "<NEXT>"
jr z, .asm_17d0ee jr z, .next
cp $50 cp "@"
jr z, .asm_17d0ee jr z, .next
cp $5
jr c, .asm_17d0ec
cp $14
jr c, .asm_17d0ee
cp $19
jr c, .asm_17d0ec
cp $1d
jr c, .asm_17d0ee
cp $26
jr c, .asm_17d0ec
cp $35
jr c, .asm_17d0ee
cp $3a
jr c, .asm_17d0ec
cp $3f
jr c, .asm_17d0ee
cp $40
jr c, .asm_17d0ec
cp $49
jr c, .asm_17d0ee
.asm_17d0ec cp $5
jr c, .end
cp "<PLAY_G>"
jr c, .next
cp $19
jr c, .end
cp $1d
jr c, .next
cp "%" + 1
jr c, .end
cp $35
jr c, .next
cp "<GREEN>" + 1
jr c, .end
cp "<ENEMY>"
jr c, .next
cp "<ENEMY>" + 1
jr c, .end
cp "<MOM>"
jr c, .next
.end
scf scf
ret ret
.asm_17d0ee .next
dec c dec c
jr nz, .asm_17d0b3 jr nz, .loop
and a and a
ret ret
; 17d0f3 ; 17d0f3
@@ -380,22 +382,22 @@ Function17d1c9: ; 17d1c9
ret ret
; 17d1e1 ; 17d1e1
Function17d1e1: ; 17d1e1 CheckStringContainsLessThanBNextCharacters: ; 17d1e1
.asm_17d1e1 .loop
ld a, [de] ld a, [de]
inc de inc de
cp $4e cp "<NEXT>"
jr nz, .asm_17d1ea jr nz, .next_char
dec b dec b
jr z, .asm_17d1ef jr z, .done
.asm_17d1ea .next_char
dec c dec c
jr nz, .asm_17d1e1 jr nz, .loop
and a and a
ret ret
.asm_17d1ef .done
scf scf
ret ret
; 17d1f1 ; 17d1f1
@@ -440,18 +442,18 @@ Function17d1f1: ; 17d1f1
Special_Menu_ChallengeExplanationCancel: ; 17d224 Special_Menu_ChallengeExplanationCancel: ; 17d224
ld a, [ScriptVar] ld a, [ScriptVar]
and a and a
jr nz, .asm_17d234 jr nz, .English
ld a, $4 ld a, $4
ld [ScriptVar], a ld [ScriptVar], a
ld hl, MenuDataHeader_17d26a ; Japanese Menu, where you can choose 'News' as an option ld hl, MenuDataHeader_17d26a ; Japanese Menu, where you can choose 'News' as an option
jr .asm_17d23c jr .Load_Interpret
.asm_17d234 .English
ld a, $4 ld a, $4
ld [ScriptVar], a ld [ScriptVar], a
ld hl, MenuDataHeader_ChallengeExplanationCancel ; English Menu ld hl, MenuDataHeader_ChallengeExplanationCancel ; English Menu
.asm_17d23c .Load_Interpret
call LoadMenuDataHeader call LoadMenuDataHeader
call Function17d246 call Function17d246
call WriteBackup call WriteBackup
@@ -460,25 +462,25 @@ Special_Menu_ChallengeExplanationCancel: ; 17d224
Function17d246: ; 17d246 Function17d246: ; 17d246
call InterpretMenu2 call InterpretMenu2
jr c, .asm_17d264 jr c, .Exit
ld a, [ScriptVar] ld a, [ScriptVar]
cp $5 cp $5
jr nz, .asm_17d25d jr nz, .UseMenuSelection2
ld a, [MenuSelection2] ld a, [MenuSelection2]
cp $3 cp $3
ret z ret z
jr c, .asm_17d25d jr c, .UseMenuSelection2
dec a dec a
jr .asm_17d260 jr .LoadToScriptVar
.asm_17d25d .UseMenuSelection2
ld a, [MenuSelection2] ld a, [MenuSelection2]
.asm_17d260 .LoadToScriptVar
ld [ScriptVar], a ld [ScriptVar], a
ret ret
.asm_17d264 .Exit
ld a, $4 ld a, $4
ld [ScriptVar], a ld [ScriptVar], a
ret ret
@@ -494,8 +496,8 @@ MenuDataHeader_17d26a: ; 17d26a
MenuData2_17d272: ; 17d272 MenuData2_17d272: ; 17d272
db $a0 ; flags db $a0 ; flags
db 4 db 4
db "ニュース", $1f, "よみこむ@" db "ニュース¯よみこむ@"
db "ニュース", $1f, "みる@" db "ニュース¯みる@"
db "せつめい@" db "せつめい@"
db "やめる@" db "やめる@"
; 17d28f ; 17d28f
@@ -633,27 +635,27 @@ Function17d370: ; 17d370
call DisableLCD call DisableLCD
ld hl, VTiles1 tile $6e ld hl, VTiles1 tile $6e
ld de, $c608 ld de, $c608
ld bc, $0010 ld bc, 1 tiles
call CopyBytes call CopyBytes
ld a, $1 ld a, $1
ld [rVBK], a ld [rVBK], a
ld hl, PokemonNewsGFX ld hl, PokemonNewsGFX
ld de, VTiles1 ld de, VTiles1
ld bc, $0480 ld bc, $48 tiles
call CopyBytes call CopyBytes
xor a xor a
ld hl, VTiles2 tile $7f ld hl, VTiles2 tile $7f
ld bc, $0010 ld bc, 1 tiles
call ByteFill call ByteFill
ld hl, $c608 ld hl, $c608
ld de, VTiles1 tile $6e ld de, VTiles1 tile $6e
ld bc, $0010 ld bc, 1 tiles
call CopyBytes call CopyBytes
xor a xor a
ld [rVBK], a ld [rVBK], a
ld hl, GFX_17eb7e ld hl, GFX_17eb7e
ld de, VTiles2 tile $60 ld de, VTiles2 tile $60
ld bc, $0010 ld bc, 1 tiles
call CopyBytes call CopyBytes
call EnableLCD call EnableLCD
call Function17d60b call Function17d60b
@@ -681,21 +683,21 @@ Function17d405:
call DisableLCD call DisableLCD
ld hl, VTiles1 tile $6e ld hl, VTiles1 tile $6e
ld de, $c608 ld de, $c608
ld bc, $0010 ld bc, 1 tiles
call CopyBytes call CopyBytes
ld a, $1 ld a, $1
ld [rVBK], a ld [rVBK], a
ld hl, PokemonNewsGFX ld hl, PokemonNewsGFX
ld de, VTiles1 ld de, VTiles1
ld bc, $0480 ld bc, $48 tiles
call CopyBytes call CopyBytes
xor a xor a
ld hl, VTiles2 tile $7f ld hl, VTiles2 tile $7f
ld bc, $0010 ld bc, 1 tiles
call ByteFill call ByteFill
ld hl, $c608 ld hl, $c608
ld de, VTiles1 tile $6e ld de, VTiles1 tile $6e
ld bc, $0010 ld bc, 1 tiles
call CopyBytes call CopyBytes
xor a xor a
ld [rVBK], a ld [rVBK], a

View File

@@ -143,20 +143,21 @@ sMobileEventIndex:: ds 1
sCrystalData:: sCrystalData::
ds wCrystalDataEnd - wCrystalData ds wCrystalDataEnd - wCrystalData
sMobileEventIndexBackup:: ds 1 sMobileEventIndexBackup:: ds 1
sSaveType:: ds 1
SECTION "SRAM Battle Tower", SRAM, BANK [1]
; data of the BattleTower must be in SRAM because you can save and leave between battles
sBattleTowerChallengeState:: ds 1
; 0: normal ; 0: normal
; 2: battle tower ; 2: battle tower
; data of the BattleTower must be in SRAM because you can save and leave between battles
sBattleTower:: ; be46 sBattleTower:: ; be46
sNrOfBeatenBattleTowerTrainers:: sNrOfBeatenBattleTowerTrainers:: ds 1
sbe46:: ds 1
sbe47:: ds 1 sbe47:: ds 1
; The 7 trainers of the BattleTower are saved here, so nobody appears more than once ; The 7 trainers of the BattleTower are saved here, so nobody appears more than once
sBTTrainers:: ; sbe48 sBTTrainers:: ; sbe48
ds 7 ds 7
sbe4f:: ds 1 sbe4f:: ds 1
sbe50:: ds 1 sBattleTowerReward:: ds 1
; Pkmn of previous trainer ; Pkmn of previous trainer
sBTPkmnOfTrainers:: ; 0xbe51 sBTPkmnOfTrainers:: ; 0xbe51
sBTPkmnPrevTrainer1:: sBTPkmnPrevTrainer1::

View File

@@ -2976,11 +2976,17 @@ BT_OTTrainer:: battle_tower_struct BT_OT
; d1e0 ; d1e0
ds $20 ds $20
; d200 ; d200
BT_TrainerTextIndex:: BT_TrainerTextIndex:: ds 2
ds $be w3_d202:: battle_tower_struct w3_d202
w3_d2be:: ds 1 w3_d2e2:: battle_tower_struct w3_d2e2
w3_d3c2:: battle_tower_struct w3_d3c2
w3_d4a2:: battle_tower_struct w3_d4a2
w3_d582:: battle_tower_struct w3_d582
w3_d662:: battle_tower_struct w3_d662
w3_d742:: battle_tower_struct w3_d742
; d822
ds -$22
SECTION "WRAM 3 part 2", WRAMX [$d800], BANK [3]
wBTChoiceOfLvlGroup:: wBTChoiceOfLvlGroup::
w3_d800:: ds $400 w3_d800:: ds $400
w3_dc00:: ds $168 w3_dc00:: ds $168