Labelled some battle tower-related functions

The UbersCheck and LevelCheck are used only for the battle tower,
despite them living in the mobile files.
Also labelled some of the known BattleTowerActions.
This commit is contained in:
mid-kid
2017-11-19 11:52:42 +01:00
parent 1bf12455e4
commit 671341a0fb
4 changed files with 32 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
const_def const_def
const BATTLETOWERACTION_00 const BATTLETOWERACTION_CHECK_EXPLANATION_READ
const BATTLETOWERACTION_01 const BATTLETOWERACTION_SET_EXPLANATION_READ
const BATTLETOWERACTION_02 const BATTLETOWERACTION_GET_CHALLENGE_STATE
const BATTLETOWERACTION_SAVE_AND_QUIT const BATTLETOWERACTION_SAVE_AND_QUIT
const BATTLETOWERACTION_CHALLENGECANCELED const BATTLETOWERACTION_CHALLENGECANCELED
const BATTLETOWERACTION_05 const BATTLETOWERACTION_05
@@ -13,7 +13,7 @@
const BATTLETOWERACTION_CHECKMOBILEEVENT const BATTLETOWERACTION_CHECKMOBILEEVENT
const BATTLETOWERACTION_0C ; more time stuff in SRAM bank 5 const BATTLETOWERACTION_0C ; more time stuff in SRAM bank 5
const BATTLETOWERACTION_0D ; more time stuff in SRAM bank 5 const BATTLETOWERACTION_0D ; more time stuff in SRAM bank 5
const BATTLETOWERACTION_EGGTICKET ; egg ticket const BATTLETOWERACTION_EGGTICKET
const BATTLETOWERACTION_0F ; check w3_d090 const BATTLETOWERACTION_0F ; check w3_d090
const BATTLETOWERACTION_10 ; dw based on 5:a800 const BATTLETOWERACTION_10 ; dw based on 5:a800
const BATTLETOWERACTION_11 ; store 0 in 5:aa8d const BATTLETOWERACTION_11 ; store 0 in 5:aa8d
@@ -23,8 +23,8 @@
const BATTLETOWERACTION_15 ; set 0, [s1_be4f] const BATTLETOWERACTION_15 ; set 0, [s1_be4f]
const BATTLETOWERACTION_16 ; update time in SRAM bank 5 const BATTLETOWERACTION_16 ; update time in SRAM bank 5
const BATTLETOWERACTION_17 ; check time in SRAM bank 5 const BATTLETOWERACTION_17 ; check time in SRAM bank 5
const BATTLETOWERACTION_18 ; level check const BATTLETOWERACTION_LEVEL_CHECK
const BATTLETOWERACTION_19 ; ubers check const BATTLETOWERACTION_UBERS_CHECK
const BATTLETOWERACTION_RESETDATA ; clear data const BATTLETOWERACTION_RESETDATA ; clear data
const BATTLETOWERACTION_GIVEREWARD ; give reward const BATTLETOWERACTION_GIVEREWARD ; give reward
const BATTLETOWERACTION_1C ; set won challenge const BATTLETOWERACTION_1C ; set won challenge

View File

@@ -20,7 +20,7 @@ BattleTower1F_MapScriptHeader:
writebyte BATTLETOWERACTION_CHECKSAVEFILEISYOURS writebyte BATTLETOWERACTION_CHECKSAVEFILEISYOURS
special BattleTowerAction special BattleTowerAction
iffalse .SkipEverything iffalse .SkipEverything
writebyte BATTLETOWERACTION_02 ; copybytetovar sBattleTowerChallengeState writebyte BATTLETOWERACTION_GET_CHALLENGE_STATE ; copybytetovar sBattleTowerChallengeState
special BattleTowerAction special BattleTowerAction
if_equal $0, .SkipEverything if_equal $0, .SkipEverything
if_equal $2, .priorityjump1 if_equal $2, .priorityjump1
@@ -56,13 +56,13 @@ UnknownScript_0x9e3e0:
end end
ReceptionistScript_0x9e3e2: ReceptionistScript_0x9e3e2:
writebyte BATTLETOWERACTION_02 ; copybytetovar sBattleTowerChallengeState writebyte BATTLETOWERACTION_GET_CHALLENGE_STATE ; copybytetovar sBattleTowerChallengeState
special BattleTowerAction special BattleTowerAction
if_equal $3, Script_BeatenAllTrainers2 ; maps/BattleTowerBattleRoom.asm if_equal $3, Script_BeatenAllTrainers2 ; maps/BattleTowerBattleRoom.asm
opentext opentext
writetext Text_BattleTowerWelcomesYou writetext Text_BattleTowerWelcomesYou
buttonsound buttonsound
writebyte BATTLETOWERACTION_00 ; if new save file: bit 1, [s1_be4f] writebyte BATTLETOWERACTION_CHECK_EXPLANATION_READ ; if new save file: bit 1, [s1_be4f]
special BattleTowerAction special BattleTowerAction
if_not_equal $0, Script_Menu_ChallengeExplanationCancel if_not_equal $0, Script_Menu_ChallengeExplanationCancel
jump Script_BattleTowerIntroductionYesNo jump Script_BattleTowerIntroductionYesNo
@@ -87,7 +87,7 @@ Script_ChoseChallenge: ; 0x9e40f
special Special_TryQuickSave special Special_TryQuickSave
iffalse Script_Menu_ChallengeExplanationCancel iffalse Script_Menu_ChallengeExplanationCancel
dotrigger $1 dotrigger $1
writebyte BATTLETOWERACTION_01 ; set 1, [s1_be4f] writebyte BATTLETOWERACTION_SET_EXPLANATION_READ ; set 1, [s1_be4f]
special BattleTowerAction special BattleTowerAction
special Function1700b0 special Function1700b0
if_equal $a, Script_Menu_ChallengeExplanationCancel if_equal $a, Script_Menu_ChallengeExplanationCancel
@@ -148,7 +148,7 @@ Script_BattleTowerIntroductionYesNo: ; 0x9e49e
Script_BattleTowerExplanation: ; 0x9e4a5 Script_BattleTowerExplanation: ; 0x9e4a5
writetext Text_BattleTowerIntroduction_2 writetext Text_BattleTowerIntroduction_2
Script_BattleTowerSkipExplanation: Script_BattleTowerSkipExplanation:
writebyte BATTLETOWERACTION_01 writebyte BATTLETOWERACTION_SET_EXPLANATION_READ
special BattleTowerAction special BattleTowerAction
jump Script_Menu_ChallengeExplanationCancel jump Script_Menu_ChallengeExplanationCancel
@@ -174,7 +174,7 @@ UnreferencedScript_0x9e4be:
iffalse Script_Menu_ChallengeExplanationCancel iffalse Script_Menu_ChallengeExplanationCancel
special Special_TryQuickSave special Special_TryQuickSave
iffalse Script_Menu_ChallengeExplanationCancel iffalse Script_Menu_ChallengeExplanationCancel
writebyte BATTLETOWERACTION_01 writebyte BATTLETOWERACTION_SET_EXPLANATION_READ
special BattleTowerAction special BattleTowerAction
special Function1700ba special Function1700ba
if_equal $a, Script_Menu_ChallengeExplanationCancel if_equal $a, Script_Menu_ChallengeExplanationCancel
@@ -188,10 +188,10 @@ UnreferencedScript_0x9e4be:
end end
UnreferencedScript_0x9e4ea: UnreferencedScript_0x9e4ea:
writebyte BATTLETOWERACTION_18 writebyte BATTLETOWERACTION_LEVEL_CHECK
special BattleTowerAction special BattleTowerAction
if_not_equal $0, Script_APkmnLevelExceeds if_not_equal $0, Script_APkmnLevelExceeds
writebyte BATTLETOWERACTION_19 writebyte BATTLETOWERACTION_UBERS_CHECK
special BattleTowerAction special BattleTowerAction
if_not_equal $0, Script_MayNotEnterABattleRoomUnderL70 if_not_equal $0, Script_MayNotEnterABattleRoomUnderL70
special SpecialCheckForBattleTowerRules special SpecialCheckForBattleTowerRules

View File

@@ -952,9 +952,9 @@ BattleTowerAction: ; 170687
.dw ; 170696 (5c:4696) .dw ; 170696 (5c:4696)
dw Function17075f ; 0x00 dw BattleTowerAction_CheckExplanationRead ; 0x00
dw Function170788 ; 0x01 dw BattleTowerAction_SetExplanationRead ; 0x01
dw Function170778 ; 0x02 dw BattleTowerAction_GetChallengeState ; 0x02
dw BattleTowerAction_SetByteToQuickSaveChallenge ; 0x03 dw BattleTowerAction_SetByteToQuickSaveChallenge ; 0x03
dw BattleTowerAction_SetByteToCancelChallenge ; 0x04 dw BattleTowerAction_SetByteToCancelChallenge ; 0x04
dw Function1707ac ; 0x05 dw Function1707ac ; 0x05
@@ -966,7 +966,7 @@ BattleTowerAction: ; 170687
dw CheckMobileEventIndex ; 0x0b dw CheckMobileEventIndex ; 0x0b
dw Function1708c8 ; 0x0c dw Function1708c8 ; 0x0c
dw Function1708f0 ; 0x0d dw Function1708f0 ; 0x0d
dw Function17093c ; 0x0e dw BattleTowerAction_EggTicket ; 0x0e
dw Function1709aa ; 0x0f dw Function1709aa ; 0x0f
dw Function1709bb ; 0x10 dw Function1709bb ; 0x10
dw Function170a9c ; 0x11 dw Function170a9c ; 0x11
@@ -976,8 +976,8 @@ BattleTowerAction: ; 170687
dw Function170ad7 ; 0x15 dw Function170ad7 ; 0x15
dw Function170807 ; 0x16 dw Function170807 ; 0x16
dw Function17081d ; 0x17 dw Function17081d ; 0x17
dw Function170ae8 ; 0x18 dw BattleTowerAction_LevelCheck ; 0x18
dw Function170b16 ; 0x19 dw BattleTowerAction_UbersCheck ; 0x19
dw ResetBattleTowerTrainersSRAM ; 0x1a dw ResetBattleTowerTrainersSRAM ; 0x1a
dw BattleTower_GiveReward ; 0x1b dw BattleTower_GiveReward ; 0x1b
dw Function17071b ; 0x1c dw Function17071b ; 0x1c
@@ -1073,7 +1073,7 @@ BattleTower_RandomlyChooseReward: ; 17073e (5c:473e) BattleTowerAction $1e
call CloseSRAM call CloseSRAM
ret ret
Function17075f: ; 17075f (5c:475f) BattleTowerAction $00 BattleTowerAction_CheckExplanationRead: ; 17075f (5c:475f) BattleTowerAction $00
call BattleTower_CheckSaveFileExistsAndIsYours call BattleTower_CheckSaveFileExistsAndIsYours
ld a, [ScriptVar] ld a, [ScriptVar]
and a and a
@@ -1087,7 +1087,7 @@ Function17075f: ; 17075f (5c:475f) BattleTowerAction $00
call CloseSRAM call CloseSRAM
ret ret
Function170778: ; 170778 (5c:4778) BattleTowerAction $02 BattleTowerAction_GetChallengeState: ; 170778 (5c:4778) BattleTowerAction $02
ld hl, sBattleTowerChallengeState ld hl, sBattleTowerChallengeState
ld a, BANK(sBattleTowerChallengeState) ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank call GetSRAMBank
@@ -1096,7 +1096,7 @@ Function170778: ; 170778 (5c:4778) BattleTowerAction $02
call CloseSRAM call CloseSRAM
ret ret
Function170788: ; 170788 (5c:4788) BattleTowerAction $01 BattleTowerAction_SetExplanationRead: ; 170788 (5c:4788) BattleTowerAction $01
ld a, BANK(s1_be4f) ld a, BANK(s1_be4f)
call GetSRAMBank call GetSRAMBank
ld a, [s1_be4f] ld a, [s1_be4f]
@@ -1344,7 +1344,7 @@ Function170923: ; 170923
; 17093c ; 17093c
Function17093c: ; 17093c (5c:493c) BattleTowerAction $0e BattleTowerAction_EggTicket: ; 17093c (5c:493c) BattleTowerAction $0e
xor a xor a
ld [ScriptVar], a ld [ScriptVar], a
ld a, EGG_TICKET ld a, EGG_TICKET
@@ -1600,7 +1600,7 @@ Function170ad7: ; 170ad7 (5c:4ad7) BattleTowerAction $15
call CloseSRAM call CloseSRAM
ret ret
Function170ae8: ; 170ae8 (5c:4ae8) BattleTowerAction $18 BattleTowerAction_LevelCheck: ; 170ae8 (5c:4ae8) BattleTowerAction $18
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank
ld a, [$b2fb] ld a, [$b2fb]
@@ -1611,7 +1611,7 @@ Function170ae8: ; 170ae8 (5c:4ae8) BattleTowerAction $18
ld [wcd4f], a ld [wcd4f], a
xor a xor a
ld [ScriptVar], a ld [ScriptVar], a
callba Function119d93 ; level check callba BattleTower_LevelCheck ; level check
ret nc ret nc
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank
@@ -1620,7 +1620,7 @@ Function170ae8: ; 170ae8 (5c:4ae8) BattleTowerAction $18
ld [ScriptVar], a ld [ScriptVar], a
ret ret
Function170b16: ; 170b16 (5c:4b16) BattleTowerAction $19 BattleTowerAction_UbersCheck: ; 170b16 (5c:4b16) BattleTowerAction $19
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank
ld a, [$b2fb] ld a, [$b2fb]
@@ -1631,7 +1631,7 @@ Function170b16: ; 170b16 (5c:4b16) BattleTowerAction $19
ld [wcd4f], a ld [wcd4f], a
xor a xor a
ld [ScriptVar], a ld [ScriptVar], a
callba Function119dd1 ; ubers check callba BattleTower_UbersCheck
ret nc ret nc
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank

View File

@@ -1320,9 +1320,9 @@ Function118982:
ld a, [wcd38] ld a, [wcd38]
and a and a
jr nz, .asm_118a30 jr nz, .asm_118a30
call Function119d93 call BattleTower_LevelCheck
ret c ret c
call Function119dd1 call BattleTower_UbersCheck
ret c ret c
.asm_118a30 .asm_118a30
@@ -3991,7 +3991,7 @@ String_119d8c:
db "CANCEL@" db "CANCEL@"
; 119d93 ; 119d93
Function119d93: ; 119d93 (46:5d93) BattleTower_LevelCheck: ; 119d93 (46:5d93)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, $1
@@ -4035,7 +4035,7 @@ Function119d93: ; 119d93 (46:5d93)
scf scf
ret ret
Function119dd1: ; 119dd1 (46:5dd1) BattleTower_UbersCheck: ; 119dd1 (46:5dd1)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, [wcd4f] ld a, [wcd4f]