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

View File

@ -27,7 +27,7 @@ BattleTower1F_MapScriptHeader:
end
.priorityjump1:
priorityjump UnknownScript_0x9e555
priorityjump BattleTower_LeftWithoutSaving
writebyte BATTLE_TOWER_ACTION_04
special BattleTowerAction
writebyte BATTLE_TOWER_ACTION_06
@ -119,7 +119,7 @@ Script_GivePlayerHisPrize: ; 0x9e47a
special BattleTowerAction
writebyte BATTLE_TOWER_ACTION_1B
special BattleTowerAction
if_equal $12, Script_YourPackIsStuffedFull
if_equal POTION, Script_YourPackIsStuffedFull
itemtotext $0, $1
giveitem ITEM_FROM_MEM, 5
writetext Text_PlayerGotFive
@ -236,9 +236,9 @@ UnknownScript_0x9e550:
loadmovesprites
end
UnknownScript_0x9e555:
BattleTower_LeftWithoutSaving:
loadfont
writetext UnknownText_0x9ee18
writetext Text_BattleTower_LeftWithoutSaving
closetext
jump UnknownScript_0x9e4b0
@ -610,7 +610,7 @@ Text_BattleTowerRules: ; 0x9ed72
line "placed on them."
done
UnknownText_0x9ee18:
Text_BattleTower_LeftWithoutSaving:
text "Excuse me!"
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]
jr nz, .asm_11813e
xor a
ld [UnknBGPals], a
ld [w3_d000], a
pop af
ld [rSVBK], a
call Function118452
@ -197,33 +197,37 @@ Function118180: ; 118180
ld de, $a89c
ld bc, $0016
call CopyBytes
ld a, [rSVBK]
push af
ld a, $3
ld [rSVBK], a
ld de, $d202
ld de, w3_d202
ld c, $96
callba Function17d0b3
jr c, .asm_1181d0
ld de, $d202
ld bc, $0196
callba Function17d1e1
jr c, .asm_1181d0
ld hl, $d202
callba CheckStringForErrors_IgnoreTerminator
jr c, .return_d3
ld de, w3_d202
lb bc, 1, $96
callba CheckStringContainsLessThanBNextCharacters
jr c, .return_d3
ld hl, w3_d202
ld de, $a8b2
ld bc, $0096
call CopyBytes
.asm_1181c9
.reset_banks
pop af
ld [rSVBK], a
call CloseSRAM
ret
.asm_1181d0
.return_d3
ld a, $d3
ld [wc300], a
ld [ScriptVar], a
jr .asm_1181c9
jr .reset_banks
; 1181da
Function1181da: ; 1181da
@ -7549,8 +7553,8 @@ Function11b6b4: ; 11b6b4
.asm_11b70f
ld de, $c63d
ld bc, $0105
callba Function17d1e1
lb bc, 1, 5
callba CheckStringContainsLessThanBNextCharacters
jr nc, .asm_11b723
callba Function17d187
@ -7563,8 +7567,8 @@ Function11b6b4: ; 11b6b4
.asm_11b736
ld de, $c642
ld bc, $0105
callba Function17d1e1
lb bc, 1, 5
callba CheckStringContainsLessThanBNextCharacters
jr nc, .asm_11b74a
callba Function17d199
@ -7577,8 +7581,8 @@ Function11b6b4: ; 11b6b4
.asm_11b75d
ld de, $c647
ld bc, $0221
callba Function17d1e1
lb bc, 2, $21
callba CheckStringContainsLessThanBNextCharacters
jr c, .asm_11b770
ld a, b
cp $2
@ -7596,8 +7600,8 @@ Function11b6b4: ; 11b6b4
.asm_11b789
ld de, $c668
ld bc, $0105
callba Function17d1e1
lb bc, 1, 5
callba CheckStringContainsLessThanBNextCharacters
jr nc, .asm_11b79d
callba Function17d1c9

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -143,20 +143,21 @@ sMobileEventIndex:: ds 1
sCrystalData::
ds wCrystalDataEnd - wCrystalData
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
; 2: battle tower
; data of the BattleTower must be in SRAM because you can save and leave between battles
sBattleTower:: ; be46
sNrOfBeatenBattleTowerTrainers::
sbe46:: ds 1
sNrOfBeatenBattleTowerTrainers:: ds 1
sbe47:: ds 1
; The 7 trainers of the BattleTower are saved here, so nobody appears more than once
sBTTrainers:: ; sbe48
ds 7
sbe4f:: ds 1
sbe50:: ds 1
sBattleTowerReward:: ds 1
; Pkmn of previous trainer
sBTPkmnOfTrainers:: ; 0xbe51
sBTPkmnPrevTrainer1::

View File

@ -2976,11 +2976,17 @@ BT_OTTrainer:: battle_tower_struct BT_OT
; d1e0
ds $20
; d200
BT_TrainerTextIndex::
ds $be
w3_d2be:: ds 1
BT_TrainerTextIndex:: ds 2
w3_d202:: battle_tower_struct w3_d202
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::
w3_d800:: ds $400
w3_dc00:: ds $168