More battle tower shenanigans

This commit is contained in:
PikalaxALT 2015-12-08 16:06:13 -05:00
parent 0549e3413f
commit 5b7fc7b0fa
10 changed files with 359 additions and 224 deletions

View File

@ -753,7 +753,7 @@ LoadNote: ; e83d1
ld hl, Channel1Field0x22 - Channel1 ld hl, Channel1Field0x22 - Channel1
add hl, bc add hl, bc
sub [hl] sub [hl]
jr nc, .asm_e8420 jr nc, .greater_than
; ???? ; ????
ld hl, Channel1Flags3 - Channel1 ld hl, Channel1Flags3 - Channel1
add hl, bc add hl, bc
@ -779,9 +779,9 @@ LoadNote: ; e83d1
ld a, [hl] ld a, [hl]
sub d sub d
ld d, a ld d, a
jr .asm_e843e jr .resume
.asm_e8420 .greater_than
; ???? ; ????
ld hl, Channel1Flags3 - Channel1 ld hl, Channel1Flags3 - Channel1
add hl, bc add hl, bc
@ -806,7 +806,7 @@ LoadNote: ; e83d1
add hl, bc add hl, bc
sub [hl] sub [hl]
ld d, a ld d, a
.asm_e843e .resume
push bc push bc
ld hl, wc297 ld hl, wc297
ld b, 0; loop count ld b, 0; loop count
@ -1419,19 +1419,19 @@ MusicCommands: ; e8720
dw Music_ToggleSFX ; dw Music_ToggleSFX ;
dw MusicE0 ; dw MusicE0 ;
dw Music_Vibrato ; vibrato dw Music_Vibrato ; vibrato
dw MusicE2 ; dw MusicE2 ; unused
dw Music_ToggleNoise ; music noise sampling dw Music_ToggleNoise ; music noise sampling
dw Music_Panning ; force panning dw Music_Panning ; force panning
dw Music_Volume ; volume dw Music_Volume ; volume
dw Music_Tone ; tune dw Music_Tone ; tune
dw MusicE7 ; dw MusicE7 ; unused
dw MusicE8 ; dw MusicE8 ; unused
dw Music_GlobalTempo ; global tempo dw Music_TempoRelative ; global tempo
dw Music_RestartChannel ; restart current channel from header dw Music_RestartChannel ; restart current channel from header
dw Music_NewSong ; new song dw Music_NewSong ; new song
dw Music_SFXPriorityOn ; sfx priority on dw Music_SFXPriorityOn ; sfx priority on
dw Music_SFXPriorityOff ; sfx priority off dw Music_SFXPriorityOff ; sfx priority off
dw MusicEE ; dw MusicEE ; unused
dw Music_StereoPanning ; stereo panning dw Music_StereoPanning ; stereo panning
dw Music_SFXToggleNoise ; sfx noise sampling dw Music_SFXToggleNoise ; sfx noise sampling
dw MusicF1 ; nothing dw MusicF1 ; nothing
@ -1442,7 +1442,7 @@ MusicCommands: ; e8720
dw MusicF6 ; nothing dw MusicF6 ; nothing
dw MusicF7 ; nothing dw MusicF7 ; nothing
dw MusicF8 ; nothing dw MusicF8 ; nothing
dw MusicF9 ; dw MusicF9 ; unused
dw Music_SetCondition ; dw Music_SetCondition ;
dw Music_JumpIf ; dw Music_JumpIf ;
dw Music_JumpChannel ; jump dw Music_JumpChannel ; jump
@ -1847,7 +1847,7 @@ Music_Tone: ; e88e4
; e88f7 ; e88f7
MusicE7: ; e88f7 MusicE7: ; e88f7
; shrug ; unused
; params: 1 ; params: 1
ld hl, Channel1Flags2 - Channel1 ld hl, Channel1Flags2 - Channel1
add hl, bc add hl, bc
@ -1884,7 +1884,7 @@ MusicDE: ; e8906
; e891e ; e891e
MusicE8: ; e891e MusicE8: ; e891e
; shrug ; unused
; params: 1 ; params: 1
ld hl, Channel1Flags2 - Channel1 ld hl, Channel1Flags2 - Channel1
add hl, bc add hl, bc
@ -2106,7 +2106,7 @@ Music_Volume: ; e89d2
; e89e1 ; e89e1
Music_GlobalTempo: ; e89e1 Music_TempoRelative: ; e89e1
; set global tempo to current channel tempo +- param ; set global tempo to current channel tempo +- param
; params: 1 signed ; params: 1 signed
call GetMusicByte call GetMusicByte
@ -2304,7 +2304,7 @@ SetNoteDuration: ; e8a8d
ld a, [hl] ld a, [hl]
; multiply NoteLength by delay units ; multiply NoteLength by delay units
ld l, 0; just multiply ld l, 0; just multiply
call MultiplySimple call .Multiply
ld a, l ; % $100 ld a, l ; % $100
; store Tempo in de ; store Tempo in de
ld hl, Channel1Tempo - Channel1 ld hl, Channel1Tempo - Channel1
@ -2317,7 +2317,7 @@ SetNoteDuration: ; e8a8d
add hl, bc add hl, bc
ld l, [hl] ld l, [hl]
; multiply Tempo by last result (NoteLength * delay % $100) ; multiply Tempo by last result (NoteLength * delay % $100)
call MultiplySimple call .Multiply
; copy result to de ; copy result to de
ld e, l ld e, l
ld d, h ld d, h
@ -2333,7 +2333,7 @@ SetNoteDuration: ; e8a8d
; e8ab8 ; e8ab8
MultiplySimple: ; e8ab8 .Multiply: ; e8ab8
; multiplies a and de ; multiplies a and de
; adds the result to l ; adds the result to l
; stores the result in hl ; stores the result in hl
@ -2363,31 +2363,31 @@ SetGlobalTempo: ; e8ac7
cp CHAN5 cp CHAN5
jr nc, .sfxchannels jr nc, .sfxchannels
ld bc, Channel1 ld bc, Channel1
call SetTempo call Tempo
ld bc, Channel2 ld bc, Channel2
call SetTempo call Tempo
ld bc, Channel3 ld bc, Channel3
call SetTempo call Tempo
ld bc, Channel4 ld bc, Channel4
call SetTempo call Tempo
jr .end jr .end
.sfxchannels .sfxchannels
ld bc, Channel5 ld bc, Channel5
call SetTempo call Tempo
ld bc, Channel6 ld bc, Channel6
call SetTempo call Tempo
ld bc, Channel7 ld bc, Channel7
call SetTempo call Tempo
ld bc, Channel8 ld bc, Channel8
call SetTempo call Tempo
.end .end
pop bc ; restore current channel pop bc ; restore current channel
ret ret
; e8b03 ; e8b03
SetTempo: ; e8b03 Tempo: ; e8b03
; input: ; input:
; de: note length ; de: note length
; update Tempo ; update Tempo

View File

@ -2,7 +2,7 @@
const BATTLETOWERACTION_00 const BATTLETOWERACTION_00
const BATTLETOWERACTION_01 const BATTLETOWERACTION_01
const BATTLETOWERACTION_02 const BATTLETOWERACTION_02
const BATTLETOWERACTION_03 const BATTLETOWERACTION_SAVE_AND_QUIT
const BATTLETOWERACTION_CHALLENGECANCELED const BATTLETOWERACTION_CHALLENGECANCELED
const BATTLETOWERACTION_05 const BATTLETOWERACTION_05
const BATTLETOWERACTION_06 ; reset stuff in SRAM bank 5 const BATTLETOWERACTION_06 ; reset stuff in SRAM bank 5
@ -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_0E ; egg ticket const BATTLETOWERACTION_EGGTICKET ; egg ticket
const BATTLETOWERACTION_0F ; check w3_d090 const BATTLETOWERACTION_0F ; check w3_d090
const BATTLETOWERACTION_10 ; jumptable based on 5:a800 const BATTLETOWERACTION_10 ; jumptable based on 5:a800
const BATTLETOWERACTION_11 ; store 0 in 5:aa8d const BATTLETOWERACTION_11 ; store 0 in 5:aa8d
@ -26,11 +26,11 @@
const BATTLETOWERACTION_18 ; level check const BATTLETOWERACTION_18 ; level check
const BATTLETOWERACTION_19 ; ubers check const BATTLETOWERACTION_19 ; ubers check
const BATTLETOWERACTION_RESETDATA ; clear data const BATTLETOWERACTION_RESETDATA ; clear data
const BATTLETOWERACTION_1B ; give reward const BATTLETOWERACTION_GIVEREWARD ; give reward
const BATTLETOWERACTION_1C ; set won challenge const BATTLETOWERACTION_1C ; set won challenge
const BATTLETOWERACTION_1D ; set received reward const BATTLETOWERACTION_1D ; set received reward
const BATTLETOWERACTION_1E ; save options const BATTLETOWERACTION_CHOOSEREWARD ; save options
const BATTLETOWERACTION_CHOOSEREWARD const BATTLETOWERACTION_SAVEOPTIONS
BATTLETOWER_NO_CHALLENGE EQU 0 BATTLETOWER_NO_CHALLENGE EQU 0
BATTLETOWER_SAVED_AND_LEFT EQU 1 BATTLETOWER_SAVED_AND_LEFT EQU 1

View File

@ -175,7 +175,7 @@ SpecialsPointers:: ; c029
add_special SpecialBeastsCheck add_special SpecialBeastsCheck
add_special SpecialMonCheck add_special SpecialMonCheck
add_special Special_SetPlayerPalette add_special Special_SetPlayerPalette
add_special Function170bd2 add_special ret_170bd2
add_special Mobile_SelectThreeMons add_special Mobile_SelectThreeMons
add_special Function1037eb add_special Function1037eb
add_special Function10383c add_special Function10383c

View File

@ -135,9 +135,9 @@ unknownmusic0xe8: macro
db \1 ; unknown db \1 ; unknown
endm endm
enum globaltempo_cmd enum tempo_relative_cmd
globaltempo: macro tempo_relative: macro
db globaltempo_cmd db tempo_relative_cmd
bigdw \1 ; value bigdw \1 ; value
endm endm

View File

@ -97,7 +97,7 @@ Script_ChoseChallenge: ; 0x9e40f
writetext Text_RightThisWayToYourBattleRoom writetext Text_RightThisWayToYourBattleRoom
waitbutton waitbutton
closetext closetext
writebyte BATTLETOWERACTION_1E writebyte BATTLETOWERACTION_CHOOSEREWARD
special BattleTowerAction special BattleTowerAction
jump Script_WalkToBattleTowerElevator jump Script_WalkToBattleTowerElevator
@ -124,7 +124,7 @@ Script_WalkToBattleTowerElevator:
Script_GivePlayerHisPrize: ; 0x9e47a Script_GivePlayerHisPrize: ; 0x9e47a
writebyte BATTLETOWERACTION_1C writebyte BATTLETOWERACTION_1C
special BattleTowerAction special BattleTowerAction
writebyte BATTLETOWERACTION_1B writebyte BATTLETOWERACTION_GIVEREWARD
special BattleTowerAction special BattleTowerAction
if_equal POTION, Script_YourPackIsStuffedFull if_equal POTION, Script_YourPackIsStuffedFull
itemtotext $0, $1 itemtotext $0, $1

View File

@ -24,7 +24,7 @@ Script_BattleRoom: ; 0x9f421
applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerWalksIn applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerWalksIn
; beat all 7 opponents in a row ; beat all 7 opponents in a row
Script_BattleRoomLoop: ; 0x9f425 Script_BattleRoomLoop: ; 0x9f425
writebyte $2 writebyte BATTLETOWERBATTLEROOM_YOUNGSTER
special Function_LoadOpponentTrainerAndPokemonsWithOTSprite special Function_LoadOpponentTrainerAndPokemonsWithOTSprite
appear BATTLETOWERBATTLEROOM_YOUNGSTER appear BATTLETOWERBATTLEROOM_YOUNGSTER
warpsound warpsound
@ -71,9 +71,9 @@ Script_DontBattleNextOpponent: ; 0x9f483
iffalse Script_DontSaveAndEndTheSession iffalse Script_DontSaveAndEndTheSession
writebyte BATTLETOWERACTION_SAVELEVELGROUP ; save level group writebyte BATTLETOWERACTION_SAVELEVELGROUP ; save level group
special BattleTowerAction special BattleTowerAction
writebyte BATTLETOWERACTION_CHOOSEREWARD ; choose reward writebyte BATTLETOWERACTION_SAVEOPTIONS ; choose reward
special BattleTowerAction special BattleTowerAction
writebyte BATTLETOWERACTION_03 ; quicksave writebyte BATTLETOWERACTION_SAVE_AND_QUIT ; quicksave
special BattleTowerAction special BattleTowerAction
playsound SFX_SAVE playsound SFX_SAVE
waitsfx waitsfx

View File

@ -1,11 +1,11 @@
Function1700b0: ; 1700b0 Function1700b0: ; 1700b0
call Bank5c_ClearJumptableRAM call InitBattleTowerChallengeRAM
callba Function118121 callba Function118121
ret ret
; 1700ba ; 1700ba
Function1700ba: ; 1700ba Function1700ba: ; 1700ba
call Bank5c_ClearJumptableRAM call InitBattleTowerChallengeRAM
callba Function11811a callba Function11811a
ret ret
; 1700c4 ; 1700c4
@ -53,7 +53,7 @@ Function1700c4: ; 1700c4
; 170114 ; 170114
Function170114: ; 170114 Function170114: ; 170114
call Bank5c_ClearJumptableRAM call InitBattleTowerChallengeRAM
call Function170121 call Function170121
callba Function11805f callba Function11805f
ret ret
@ -64,7 +64,7 @@ Function170121: ; 170121
call GetSRAMBank call GetSRAMBank
ld hl, $a948 ld hl, $a948
ld de, wMisc ld de, wMisc
ld bc, $00f6 ld bc, $00f6 ; 246
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
call Function170c8b call Function170c8b
@ -183,7 +183,7 @@ Function170139: ; 170139
BattleTowerBattle: ; 170215 BattleTowerBattle: ; 170215
xor a xor a
ld [wcf63], a ld [wBattleTowerBattleEnded], a
call _BattleTowerBattle call _BattleTowerBattle
ret ret
; 17021d ; 17021d
@ -192,10 +192,10 @@ EmptySpecial_17021d: ; 17021d
ret ret
; 17021e ; 17021e
Bank5c_ClearJumptableRAM: ; 17021e InitBattleTowerChallengeRAM: ; 17021e
xor a xor a
ld [wcf63], a ld [wBattleTowerBattleEnded], a
ld [wcf64], a ld [wNrOfBeatenBattleTowerTrainers], a
ld [wcf65], a ld [wcf65], a
ld [wcf66], a ld [wcf66], a
ret ret
@ -205,14 +205,14 @@ _BattleTowerBattle: ; 17022c
.loop .loop
call .do_jumptable call .do_jumptable
call DelayFrame call DelayFrame
ld a, [wcf63] ld a, [wBattleTowerBattleEnded]
cp $1 cp $1
jr nz, .loop jr nz, .loop
ret ret
; 17023a ; 17023a
.do_jumptable: ; 17023a .do_jumptable: ; 17023a
ld a, [wcf63] ld a, [wBattleTowerBattleEnded]
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, .jumptable ld hl, .jumptable
@ -259,10 +259,10 @@ RunBattleTowerTrainer: ; 17024d
ld a, BANK(sNrOfBeatenBattleTowerTrainers) ld a, BANK(sNrOfBeatenBattleTowerTrainers)
call GetSRAMBank call GetSRAMBank
ld a, [sNrOfBeatenBattleTowerTrainers] ld a, [sNrOfBeatenBattleTowerTrainers]
ld [wNrOfBeatenBattleTowerTrainers], a ; wcf64 ld [wNrOfBeatenBattleTowerTrainers], a
call CloseSRAM call CloseSRAM
ld hl, StringBuffer3 ld hl, StringBuffer3
ld a, [wNrOfBeatenBattleTowerTrainers] ; wcf64 ld a, [wNrOfBeatenBattleTowerTrainers]
add "1" add "1"
ld [hli], a ld [hli], a
ld a, "@" ld a, "@"
@ -274,7 +274,7 @@ RunBattleTowerTrainer: ; 17024d
pop af pop af
ld [Options], a ld [Options], a
ld a, $1 ld a, $1
ld [wcf63], a ld [wBattleTowerBattleEnded], a
ret ret
@ -661,7 +661,7 @@ Function1704e1: ; 1704e1
; unreferenced special ; unreferenced special
call SpeechTextBox call SpeechTextBox
call FadeToMenu call FadeToMenu
call Bank5c_ClearJumptableRAM call InitBattleTowerChallengeRAM
call .JumptableLoop call .JumptableLoop
call CloseSubmenu call CloseSubmenu
ret ret
@ -758,20 +758,20 @@ endr
ret ret
.pressed_up .pressed_up
ld a, [wcf64] ld a, [wNrOfBeatenBattleTowerTrainers]
and a and a
ret z ret z
sub 15 sub 15
ld [wcf64], a ld [wNrOfBeatenBattleTowerTrainers], a
call .PlaceTextItems call .PlaceTextItems
ret ret
.pressed_down .pressed_down
ld a, [wcf64] ld a, [wNrOfBeatenBattleTowerTrainers]
cp 60 cp 60
ret z ret z
add 15 add 15
ld [wcf64], a ld [wNrOfBeatenBattleTowerTrainers], a
call .PlaceTextItems call .PlaceTextItems
ret ret
@ -834,7 +834,7 @@ endr
ld a, $50 ld a, $50
ld [wcd4e], a ld [wcd4e], a
ld hl, wMisc ld hl, wMisc
ld a, [wcf64] ld a, [wNrOfBeatenBattleTowerTrainers]
ld c, a ld c, a
xor a xor a
ld b, a ld b, a
@ -916,7 +916,7 @@ endr
; 17065d ; 17065d
.PlaceUpDownArrows: ; 17065d .PlaceUpDownArrows: ; 17065d
ld a, [wcf64] ld a, [wNrOfBeatenBattleTowerTrainers]
and a and a
jr z, .nope jr z, .nope
hlcoord 18, 5 hlcoord 18, 5
@ -924,7 +924,7 @@ endr
ld [hl], a ld [hl], a
.nope .nope
ld a, [wcf64] ld a, [wNrOfBeatenBattleTowerTrainers]
cp 60 cp 60
ret z ret z
hlcoord 18, 16 hlcoord 18, 16
@ -984,11 +984,11 @@ endr
dw Function170ae8 ; 0x18 dw Function170ae8 ; 0x18
dw Function170b16 ; 0x19 dw Function170b16 ; 0x19
dw ResetBattleTowerTrainersSRAM ; 0x1a dw ResetBattleTowerTrainersSRAM ; 0x1a
dw Function1706ee ; 0x1b dw BattleTower_GiveReward ; 0x1b
dw Function17071b ; 0x1c dw Function17071b ; 0x1c
dw Function170729 ; 0x1d dw Function170729 ; 0x1d
dw BattleTower_RandomlyChooseReward ; 0x1e dw BattleTower_RandomlyChooseReward ; 0x1e
dw Function170737 ; 0x1f dw BattleTower_SaveOptions ; 0x1f
; Reset the save memory for BattleTower-Trainers (Counter and all 7 TrainerBytes) ; Reset the save memory for BattleTower-Trainers (Counter and all 7 TrainerBytes)
@ -1008,7 +1008,7 @@ ResetBattleTowerTrainersSRAM: ; 1706d6 (5c:46d6) BattleTowerAction $1a
ret ret
Function1706ee: ; 1706ee (5c:46ee) BattleTowerAction $1b BattleTower_GiveReward: ; 1706ee (5c:46ee) BattleTowerAction $1b
ld a, BANK(sBattleTowerReward) ld a, BANK(sBattleTowerReward)
call GetSRAMBank call GetSRAMBank
@ -1053,11 +1053,11 @@ Function170729: ; 170729 (5c:4729) BattleTowerAction $1d
call CloseSRAM call CloseSRAM
ret ret
Function170737: ; 170737 (5c:4737) BattleTowerAction $1e BattleTower_SaveOptions: ; 170737 (5c:4737) BattleTowerAction $1f
callba SaveOptions callba SaveOptions
ret ret
BattleTower_RandomlyChooseReward: ; 17073e (5c:473e) BattleTowerAction $1f BattleTower_RandomlyChooseReward: ; 17073e (5c:473e) BattleTowerAction $1e
; Generate a random stat boosting item. ; Generate a random stat boosting item.
.loop .loop
call Random call Random
@ -1646,3 +1646,134 @@ Function170b16: ; 170b16 (5c:4b16) BattleTowerAction $19
call CloseSRAM call CloseSRAM
ld [ScriptVar], a ld [ScriptVar], a
ret ret
Function_LoadOpponentTrainerAndPokemonsWithOTSprite: ; 0x170b44
callba Function_LoadOpponentTrainerAndPokemons
ld a, [rSVBK]
push af
ld a, $3
ld [rSVBK], a
ld hl, BT_OTTrainerClass
ld a, [hl]
dec a
ld c, a
ld b, $0
pop af
ld [rSVBK], a
ld hl, .Sprites
add hl, bc
ld a, [hl]
ld [wBTTempOTSprite], a
; Load sprite of the opponent trainer
; because s/he is chosen randomly and appears out of nowhere
ld a, [ScriptVar]
dec a
sla a
ld e, a
sla a
sla a
sla a
ld c, a
ld b, 0
ld d, 0
ld hl, MapObjects
add hl, bc
inc hl
ld a, [wBTTempOTSprite]
ld [hl], a
ld hl, UsedSprites
add hl, de
ld [hli], a
ld [hUsedSpriteIndex], a
ld a, [hl]
ld [hUsedSpriteTile], a
callba GetUsedSprite
ret
; 170b90
.Sprites:
db SPRITE_FALKNER
db SPRITE_WHITNEY
db SPRITE_BUGSY
db SPRITE_MORTY
db SPRITE_PRYCE
db SPRITE_JASMINE
db SPRITE_CHUCK
db SPRITE_CLAIR
db SPRITE_SILVER
db SPRITE_OAK
db SPRITE_WILL
db SPRITE_CHRIS
db SPRITE_BRUNO
db SPRITE_KAREN
db SPRITE_KOGA
db SPRITE_LANCE
db SPRITE_BROCK
db SPRITE_MISTY
db SPRITE_SURGE
db SPRITE_SCIENTIST
db SPRITE_ERIKA
db SPRITE_YOUNGSTER
db SPRITE_YOUNGSTER
db SPRITE_YOUNGSTER
db SPRITE_LASS
db SPRITE_JANINE
db SPRITE_COOLTRAINER_M
db SPRITE_COOLTRAINER_F
db SPRITE_BUENA
db SPRITE_SUPER_NERD
db SPRITE_ROCKET
db SPRITE_GENTLEMAN
db SPRITE_BUENA
db SPRITE_TEACHER
db SPRITE_SABRINA
db SPRITE_BUG_CATCHER
db SPRITE_FISHER
db SPRITE_SUPER_NERD
db SPRITE_COOLTRAINER_F
db SPRITE_SAILOR
db SPRITE_SUPER_NERD
db SPRITE_BLUE
db SPRITE_ROCKER
db SPRITE_POKEFAN_M
db SPRITE_BIKER
db SPRITE_BLAINE
db SPRITE_PHARMACIST
db SPRITE_FISHER
db SPRITE_SUPER_NERD
db SPRITE_BLACK_BELT
db SPRITE_ROCKET
db SPRITE_YOUNGSTER
db SPRITE_LASS
db SPRITE_YOUNGSTER
db SPRITE_ROCKET_GIRL
db SPRITE_SAGE
db SPRITE_GRANNY
db SPRITE_ROCKER
db SPRITE_POKEFAN_M
db SPRITE_KIMONO_GIRL
db SPRITE_TWIN
db SPRITE_POKEFAN_F
db SPRITE_RED
db SPRITE_BLUE
db SPRITE_OFFICER
db SPRITE_ROCKET_GIRL
ret_170bd2: ; 170bd2
ret
; 170bd3
SpecialCheckForBattleTowerRules: ; 170bd3
callba CheckForBattleTowerRules
jr c, .asm_170bde
xor a
jr .asm_170be0
.asm_170bde
ld a, $1
.asm_170be0
ld [ScriptVar], a
ret
; 170be4

View File

@ -1071,7 +1071,7 @@ Function11878d: ; 11878d (46:478d)
set 0, [hl] set 0, [hl]
ld a, $6 ld a, $6
ld [rSVBK], a ld [rSVBK], a
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
ld a, [hl] ld a, [hl]
sla a sla a
@ -1466,7 +1466,7 @@ Function118a65: ; 118a65
ld de, wcc60 ld de, wcc60
ld bc, $80 ld bc, $80
call CopyBytes call CopyBytes
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
jp Function118b10 jp Function118b10
; 118a7a ; 118a7a
@ -1476,7 +1476,7 @@ Function118a7a: ; 118a7a
ld de, wcc60 ld de, wcc60
ld bc, $80 ld bc, $80
call CopyBytes call CopyBytes
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
jp Function118b10 jp Function118b10
; 118a8f ; 118a8f
@ -1486,7 +1486,7 @@ Function118a8f: ; 118a8f
ld de, wcc60 ld de, wcc60
ld bc, $80 ld bc, $80
call CopyBytes call CopyBytes
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
jp Function118b10 jp Function118b10
; 118aa4 ; 118aa4
@ -1498,7 +1498,7 @@ Function118aa4: ; 118aa4
call CopyBytes call CopyBytes
ld a, $5 ld a, $5
ld [rSVBK], a ld [rSVBK], a
ld de, LYOverrides ld de, w3_d100
ld bc, $e00 ld bc, $e00
jr Function118b10 jr Function118b10
; 118abc ; 118abc
@ -1508,7 +1508,7 @@ Function118abc: ; 118abc (46:4abc)
ld de, wcc60 ld de, wcc60
ld bc, $80 ld bc, $80
call CopyBytes call CopyBytes
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
jr Function118b10 jr Function118b10
; 118ad0 (46:4ad0) ; 118ad0 (46:4ad0)
@ -1518,7 +1518,7 @@ Function118ad0:
ld de, wcc60 ld de, wcc60
ld bc, $80 ld bc, $80
call CopyBytes call CopyBytes
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
jr Function118b10 jr Function118b10
@ -1663,7 +1663,8 @@ IndexDownloadURL: ; 0x118ce5
Function118d35: ; 118d35 Function118d35: ; 118d35
ld hl, LYOverridesBackup ; unreferenced
ld hl, $d200
ld a, [wcd38] ld a, [wcd38]
and a and a
jr nz, .asm_118d6e jr nz, .asm_118d6e
@ -1739,7 +1740,7 @@ asm_118d9f
ld [wcd3b], a ld [wcd3b], a
.asm_118db7 .asm_118db7
ld hl, $d800 ld hl, w3_d800
ld a, $8 ld a, $8
ld [hli], a ld [hli], a
ld a, $c6 ld a, $c6
@ -1760,7 +1761,7 @@ asm_118d9f
call Function119ec2 call Function119ec2
ld a, $40 ld a, $40
ld [wcd89], a ld [wcd89], a
ld hl, $d800 ld hl, w3_d800
ld de, $de00 ld de, $de00
ld bc, $0200 ld bc, $0200
ld a, $2c ld a, $2c
@ -1894,7 +1895,7 @@ Function118e92: ; 118e92
ld de, wcc60 ld de, wcc60
call Function1191ad call Function1191ad
ret c ret c
ld de, $d800 ld de, w3_d800
ld bc, $0800 ld bc, $0800
jp Function118b10 jp Function118b10
; 118eb0 ; 118eb0
@ -2105,7 +2106,7 @@ Function119009:
ld a, $40 ld a, $40
ld [wcd89], a ld [wcd89], a
ld hl, wc314 + 48 + 2 ld hl, wc314 + 48 + 2
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
ld a, $2c ld a, $2c
jp Function119e2b jp Function119e2b
@ -2119,9 +2120,9 @@ Function119054: ; 119054
ld e, a ld e, a
ld a, [wcd50] ld a, [wcd50]
ld d, a ld d, a
ld a, [UnknBGPals] ld a, [w3_d000]
ld c, a ld c, a
ld a, [wd001] ld a, [w3_d000 + 1]
ld b, a ld b, a
call Function119192 call Function119192
ret c ret c
@ -2131,9 +2132,9 @@ Function119054: ; 119054
ld a, $6 ld a, $6
ld [rSVBK], a ld [rSVBK], a
ld hl, wd002 ld hl, wd002
ld a, [UnknBGPals] ld a, [w3_d000]
ld c, a ld c, a
ld a, [wd001] ld a, [w3_d000 + 1]
ld b, a ld b, a
call Function119192 call Function119192
ret c ret c
@ -2178,7 +2179,7 @@ Function1190d0: ; 1190d0
ld de, wcc60 ld de, wcc60
call Function1191ad call Function1191ad
ret c ret c
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
jp Function118b10 jp Function118b10
; 1190ec ; 1190ec
@ -2198,9 +2199,9 @@ Function1190ec: ; 1190ec
call CloseSRAM call CloseSRAM
ld a, $6 ld a, $6
call GetSRAMBank call GetSRAMBank
ld a, [UnknBGPals] ld a, [w3_d000]
ld c, a ld c, a
ld a, [wd001] ld a, [w3_d000 + 1]
ld b, a ld b, a
ld hl, wd002 ld hl, wd002
ld de, $a000 ld de, $a000
@ -2211,9 +2212,9 @@ Function1190ec: ; 1190ec
jr z, .asm_11913e jr z, .asm_11913e
ld a, $6 ld a, $6
ld [rSVBK], a ld [rSVBK], a
ld a, [UnknBGPals] ld a, [w3_d000]
ld c, a ld c, a
ld a, [wd001] ld a, [w3_d000 + 1]
ld b, a ld b, a
ld hl, wd002 ld hl, wd002
call Function119192 call Function119192
@ -2330,7 +2331,7 @@ Function1191ad: ; 1191ad
; 1191d3 ; 1191d3
Function1191d3: ; 1191d3 Function1191d3: ; 1191d3
ld hl, wd102 ld hl, w3_d100 + 2
ld a, l ld a, l
ld [wcd53], a ld [wcd53], a
ld a, h ld a, h
@ -2678,7 +2679,7 @@ Function1193fb:
ld a, $8 ld a, $8
ld [wcd3c], a ld [wcd3c], a
call Function119ed8 call Function119ed8
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
jp Function118b10 jp Function118b10
; 119413 ; 119413
@ -2686,9 +2687,9 @@ Function1193fb:
Function119413: ; 119413 Function119413: ; 119413
ld a, $6 ld a, $6
call GetSRAMBank call GetSRAMBank
ld a, [UnknBGPals] ld a, [w3_d000]
ld c, a ld c, a
ld a, [wd001] ld a, [w3_d000 + 1]
ld b, a ld b, a
rept 2 rept 2
dec bc dec bc
@ -2707,7 +2708,7 @@ endr
ld [rSVBK], a ld [rSVBK], a
ld a, [wd000] ld a, [wd000]
ld c, a ld c, a
ld a, [wd001] ld a, [w3_d000 + 1]
ld b, a ld b, a
ld hl, wd002 ld hl, wd002
call Function119192 call Function119192
@ -3043,7 +3044,7 @@ Function119648: ; 119648 (46:5648)
ld [wcd3c], a ld [wcd3c], a
call Function119ed8 call Function119ed8
call Function118b24 call Function118b24
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
ld a, $2a ld a, $2a
jp Function119e2b jp Function119e2b
@ -3338,7 +3339,7 @@ Function1197dc:
xor a xor a
ld [de], a ld [de], a
call Function118b24 call Function118b24
ld de, UnknBGPals ld de, w3_d000
ld bc, $1000 ld bc, $1000
ld a, $2a ld a, $2a
jp Function119e2b jp Function119e2b
@ -3459,7 +3460,7 @@ Function1198f7:
ret nz ret nz
ld hl, $c608 + 2 ld hl, $c608 + 2
call Function119940 call Function119940
ld hl, $d800 ld hl, w3_d800
ld a, $c608 % $100 ld a, $c608 % $100
ld [hli], a ld [hli], a
ld a, $c608 / $100 ld a, $c608 / $100
@ -3480,7 +3481,7 @@ Function1198f7:
call Function119ec2 call Function119ec2
ld a, $40 ld a, $40
ld [wcd89], a ld [wcd89], a
ld hl, $d800 ld hl, w3_d800
ld de, $de00 ld de, $de00
ld bc, $0200 ld bc, $0200
ld a, $2c ld a, $2c
@ -3536,15 +3537,15 @@ Function119973: ; 119973
ld [wcf64], a ld [wcf64], a
xor a xor a
ld [wcf65], a ld [wcf65], a
ld [StringBuffer2 + 10], a ld [w3_d090], a
ld de, UnknBGPals ld de, w3_d000
ld a, $20 ld a, $20
jp Function119e2b jp Function119e2b
; 119987 ; 119987
Function119987: ; 119987 Function119987: ; 119987
ld hl, wd001 ld hl, w3_d000 + 1
ld a, [UnknBGPals] ld a, [w3_d000]
or [hl] or [hl]
jr z, .asm_1199a0 jr z, .asm_1199a0
ld a, [wcf64] ld a, [wcf64]
@ -3556,7 +3557,7 @@ Function119987: ; 119987
jp Function119e2b jp Function119e2b
.asm_1199a0 .asm_1199a0
ld a, [StringBuffer2 + 10] ld a, [w3_d090]
and a and a
jr z, .asm_1199ae jr z, .asm_1199ae
ld a, $16 ld a, $16
@ -3590,7 +3591,7 @@ Function1199ca: ; 1199ca
ld l, a ld l, a
ld a, [wcf65] ld a, [wcf65]
ld h, a ld h, a
ld de, LYOverrides ld de, w3_d100
ld bc, $0700 ld bc, $0700
ld a, $28 ld a, $28
jp Function119e2b jp Function119e2b
@ -3694,27 +3695,27 @@ Function1199e2: ; 1199e2
jp Function119b45 jp Function119b45
.asm_119aaf .asm_119aaf
ld a, [StringBuffer2 + 10] ld a, [w3_d090]
and a and a
jr nz, .asm_119aa7 jr nz, .asm_119aa7
ld a, [wd000 + $895] ld a, [w3_d895]
sub $30 sub $30
ld [StringBuffer2 + 10], a ld [w3_d090], a
ld a, [wcf64] ld a, [wcf64]
ld [StringBuffer2 + 11], a ld [w3_d090 + 1], a
ld a, [wcf65] ld a, [wcf65]
ld [StringBuffer2 + 12], a ld [w3_d090 + 2], a
Function119ac9: Function119ac9:
ld a, [UnknBGPals] ld a, [w3_d000]
ld l, a ld l, a
ld a, [wd001] ld a, [w3_d000 + 1]
ld h, a ld h, a
dec hl dec hl
ld a, l ld a, l
ld [UnknBGPals], a ld [w3_d000], a
ld a, h ld a, h
ld [wd001], a ld [w3_d000 + 1], a
ld a, [wcf64] ld a, [wcf64]
ld l, a ld l, a
ld a, [wcf65] ld a, [wcf65]
@ -3738,7 +3739,7 @@ Function119b0d: ; 119b0d
ld a, $8 ld a, $8
ld [wcd3c], a ld [wcd3c], a
call Function119ed8 call Function119ed8
ld a, [StringBuffer2 + 10] ld a, [w3_d090]
cp $1 cp $1
jr z, .asm_119b23 jr z, .asm_119b23
ld a, $19 ld a, $19
@ -3748,19 +3749,19 @@ Function119b0d: ; 119b0d
.asm_119b23 .asm_119b23
ld a, $10 ld a, $10
ld [wcd89], a ld [wcd89], a
ld a, [StringBuffer2 + 11] ld a, [w3_d090 + 1]
ld l, a ld l, a
ld a, [StringBuffer2 + 12] ld a, [w3_d090 + 2]
ld h, a ld h, a
ld de, LYOverrides ld de, w3_d100
ld bc, $0700 ld bc, $0700
ld a, $24 ld a, $24
jp Function119e2b jp Function119e2b
Function119b3b: Function119b3b:
ld a, [StringBuffer2 + 11] ld a, [w3_d090 + 1]
ld l, a ld l, a
ld a, [StringBuffer2 + 12] ld a, [w3_d090 + 2]
ld h, a ld h, a
jr asm_119b4d jr asm_119b4d
@ -3776,7 +3777,7 @@ asm_119b4d
; 119b52 ; 119b52
Function119b52: ; 119b52 Function119b52: ; 119b52
ld a, [StringBuffer2 + 10] ld a, [w3_d090]
cp $1 cp $1
jr nz, .asm_119b66 jr nz, .asm_119b66
ld a, $5 ld a, $5
@ -3791,19 +3792,19 @@ Function119b52: ; 119b52
; 119b6b ; 119b6b
Function119b6b: ; 119b6b Function119b6b: ; 119b6b
ld a, [StringBuffer2 + 10] ld a, [w3_d090]
cp $1 cp $1
jr z, .asm_119b75 jr z, .asm_119b75
jp Function119e2e jp Function119e2e
.asm_119b75 .asm_119b75
ld a, [LYOverrides] ld a, [w3_d100]
ld b, a ld b, a
ld a, [wd101] ld a, [w3_d100 + 1]
or b or b
jr z, .asm_119be3 jr z, .asm_119be3
ld hl, $d800 ld hl, w3_d800
ld de, wd102 ld de, w3_d100 + 2
.asm_119b85 .asm_119b85
ld a, [de] ld a, [de]
inc de inc de
@ -3887,7 +3888,7 @@ endr
ld [$a800], a ld [$a800], a
call CloseSRAM call CloseSRAM
xor a xor a
ld [StringBuffer2 + 10], a ld [w3_d090], a
ret ret
.asm_119bfa .asm_119bfa
@ -3896,10 +3897,10 @@ endr
cp $d cp $d
jr nz, .asm_119b93 jr nz, .asm_119b93
ld a, l ld a, l
cp (wd000 + $800 + $69) % $100 cp (w3_d869) % $100
jr nz, .asm_119be3 jr nz, .asm_119be3
ld a, h ld a, h
cp (wd000 + $800 + $69) / $100 cp (w3_d869) / $100
jr nz, .asm_119be3 jr nz, .asm_119be3
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank
@ -3907,14 +3908,14 @@ endr
ld [$b090], a ld [$b090], a
ld a, [wcf65] ld a, [wcf65]
ld [$b091], a ld [$b091], a
ld hl, $d800 ld hl, w3_d800
ld de, $b023 ld de, $b023
ld bc, $0069 ld bc, $0069
call CopyBytes call CopyBytes
ld a, $3 ld a, $3
ld [$a800], a ld [$a800], a
call CloseSRAM call CloseSRAM
ld hl, $d800 ld hl, w3_d800
ld de, $c608 ld de, $c608
ld bc, $0069 ld bc, $0069
call CopyBytes call CopyBytes
@ -3953,7 +3954,7 @@ Function119c3e: ; 119c3e
ld [$a800], a ld [$a800], a
call CloseSRAM call CloseSRAM
xor a xor a
ld [StringBuffer2 + 10], a ld [w3_d090], a
scf scf
ret ret
@ -4212,7 +4213,7 @@ Unknown_119e40:
Function119e4f: ; 119e4f Function119e4f: ; 119e4f
push bc push bc
ld hl, LYOverrides ld hl, w3_d100
ld a, [hli] ld a, [hli]
ld c, a ld c, a
ld a, [hli] ld a, [hli]
@ -4531,7 +4532,7 @@ Function11a00e: ; 11a00e
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
ld hl, $c608 ld hl, $c608
ld de, $d800 ld de, w3_d800
ld bc, $00f6 ld bc, $00f6
call CopyBytes call CopyBytes
ld a, $1 ld a, $1
@ -4541,7 +4542,7 @@ Function11a00e: ; 11a00e
call Function11a9ce call Function11a9ce
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
ld hl, $d800 ld hl, w3_d800
ld de, $c608 ld de, $c608
ld bc, $00f6 ld bc, $00f6
call CopyBytes call CopyBytes
@ -6978,16 +6979,69 @@ Function11b31b: ; 11b31b
; 11b350 ; 11b350
Unknown_11b350: Unknown_11b350:
db $1a, $5e, $1a, $66, $1a, $6e, $1a, $76, $1a, $7e, $1a, $86, $1a, $8e dbpixel 3, 11, 2, 6
db $22, $5e, $22, $66, $22, $6e, $22, $76, $22, $7e, $22, $86, $22, $8e dbpixel 3, 12, 2, 6
db $ff dbpixel 3, 13, 2, 6
dbpixel 3, 14, 2, 6
dbpixel 3, 15, 2, 6
dbpixel 3, 16, 2, 6
dbpixel 3, 17, 2, 6
dbpixel 4, 11, 2, 6
dbpixel 4, 12, 2, 6
dbpixel 4, 13, 2, 6
dbpixel 4, 14, 2, 6
dbpixel 4, 15, 2, 6
dbpixel 4, 16, 2, 6
dbpixel 4, 17, 2, 6
db -1
Unknown_11b36d: Unknown_11b36d:
db $30, $31, $31, $31, $31, $31, $32, $40, $41, $41, $41, $41, $41, $42 db $30
db $31
db $31
db $31
db $31
db $31
db $32
db $40
db $41
db $41
db $41
db $41
db $41
db $42
Unknown_11b37b: Unknown_11b37b:
db $30, $31, $31, $39, $39, $39, $39, $40, $41, $41, $39, $39, $39, $39 db $30
db $31
db $31
db $39
db $39
db $39
db $39
db $40
db $41
db $41
db $39
db $39
db $39
db $39
Unknown_11b389: Unknown_11b389:
db $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39 db $39
db $39
db $39
db $39
db $39
db $39
db $39
db $39
db $39
db $39
db $39
db $39
db $39
db $39
Function11b397: ; 11b397 Function11b397: ; 11b397
ld de, Sprites ld de, Sprites
@ -6999,12 +7053,14 @@ Function11b397: ; 11b397
and $7 and $7
swap a swap a
add [hl] add [hl]
inc hl inc hl ; 1
ld [de], a ld [de], a
inc de inc de
ld a, [hli]
ld a, [hli] ; 2
ld [de], a ld [de], a
inc de inc de
ld a, [bc] ld a, [bc]
inc bc inc bc
ld [de], a ld [de], a
@ -7355,7 +7411,7 @@ Function11b570: ; 11b570
Function11b585: ; 11b585 Function11b585: ; 11b585
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
ld hl, $d800 ld hl, w3_d800
ld de, $c608 ld de, $c608
ld bc, $008f ld bc, $008f
call CopyBytes call CopyBytes
@ -7482,7 +7538,7 @@ Function11b66d: ; 11b66d
push af push af
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
ld a, [StringBuffer2 + 10] ld a, [w3_d090]
ld b, a ld b, a
pop af pop af
ld [rSVBK], a ld [rSVBK], a
@ -7506,7 +7562,7 @@ Function11b66d: ; 11b66d
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
ld a, $2 ld a, $2
ld [StringBuffer2 + 10], a ld [w3_d090], a
pop af pop af
ld [rSVBK], a ld [rSVBK], a

View File

@ -34,6 +34,7 @@ Function170000: ; 170000
ld bc, $008f ld bc, $008f
call CopyBytes call CopyBytes
ret ret
; 17005a ; 17005a
Function17005a: ; 17005a Function17005a: ; 17005a
@ -71,85 +72,11 @@ Function17005a: ; 17005a
ld [wc74e], a ld [wc74e], a
call CloseSRAM call CloseSRAM
ret ret
; 1700b0 ; 1700b0
INCLUDE "misc/battle_tower_5c.asm" INCLUDE "misc/battle_tower_5c.asm"
Function_LoadOpponentTrainerAndPokemonsWithOTSprite: ; 0x170b44
callba Function_LoadOpponentTrainerAndPokemons
ld a, [rSVBK]
push af
ld a, $3
ld [rSVBK], a
ld hl, wd10a
ld a, [hl]
dec a
ld c, a
ld b, $0
pop af
ld [rSVBK], a
ld hl, Unknown_170b90
add hl, bc
ld a, [hl]
ld [wcd49], a
; Load sprite of the opponent trainer
; because s/he is chosen randomly and appears out of nowhere
ld a, [ScriptVar]
dec a
sla a
ld e, a
sla a
sla a
sla a
ld c, a
ld b, $0
ld d, $0
ld hl, MapObjects
add hl, bc
inc hl
ld a, [wcd49]
ld [hl], a
ld hl, UsedSprites
add hl, de
ld [hli], a
ld [hUsedSpriteIndex], a
ld a, [hl]
ld [hUsedSpriteTile], a
callba GetUsedSprite
ret
; 170b90
Unknown_170b90:
db $12, $13, $14, $15, $18, $17
db $16, $19, $04, $05, $11, $01
db $1c, $1b, $21, $1e, $1a, $1d
db $1f, $3c, $20, $27, $27, $27
db $28, $0a, $23, $24, $2a, $2b
db $35, $40, $2a, $29, $22, $25
db $3a, $2b, $24, $49, $2b, $07
db $2c, $2d, $4a, $0d, $4b, $3a
db $2b, $41, $35, $27, $28, $27
db $36, $3e, $30, $2c, $2d, $3d
db $26, $2e, $06, $07, $43, $36
Function170bd2: ; 170bd2
ret
; 170bd3
SpecialCheckForBattleTowerRules: ; 170bd3
callba CheckForBattleTowerRules
jr c, .asm_170bde
xor a
jr .asm_170be0
.asm_170bde
ld a, $1
.asm_170be0
ld [ScriptVar], a
ret
; 170be4
Function170be4: ; 170be4 Function170be4: ; 170be4
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank
@ -159,6 +86,7 @@ Function170be4: ; 170be4
call ByteFill call ByteFill
call CloseSRAM call CloseSRAM
ret ret
; 170bf7 ; 170bf7
Clears5_a89a: ; 170bf7 Clears5_a89a: ; 170bf7
@ -170,6 +98,7 @@ Clears5_a89a: ; 170bf7
ld [hl], a ld [hl], a
call CloseSRAM call CloseSRAM
ret ret
; 170c06 ; 170c06
Function170c06: ; 170c06 Function170c06: ; 170c06
@ -275,6 +204,7 @@ endr
ld [hl], a ld [hl], a
call CloseSRAM call CloseSRAM
ret ret
; 170c8b ; 170c8b
Function170c8b: ; 170c8b Function170c8b: ; 170c8b
@ -287,6 +217,7 @@ Function170c8b: ; 170c8b
dec b dec b
jr nz, .asm_170c90 jr nz, .asm_170c90
ret ret
; 170c98 ; 170c98
CheckBTMonMovesForErrors: ; 170c98 CheckBTMonMovesForErrors: ; 170c98
@ -330,6 +261,7 @@ CheckBTMonMovesForErrors: ; 170c98
dec c dec c
jr nz, .loop jr nz, .loop
ret ret
; 170cc6 ; 170cc6
Function170cc6: ; 170cc6 Function170cc6: ; 170cc6
@ -338,7 +270,7 @@ Function170cc6: ; 170cc6
ld a, $6 ld a, $6
ld [rSVBK], a ld [rSVBK], a
ld hl, LZ_170d16 ld hl, LZ_170d16
ld de, wd000 ld de, wBackupTilemap
call Decompress call Decompress
ld a, $1 ld a, $1
ld [rVBK], a ld [rVBK], a
@ -358,6 +290,7 @@ Function170cc6: ; 170cc6
pop af pop af
ld [rSVBK], a ld [rSVBK], a
ret ret
; 170d02 ; 170d02
Function170d02: ; 170d02 Function170d02: ; 170d02
@ -370,6 +303,7 @@ Function170d02: ; 170d02
xor a xor a
ld [rVBK], a ld [rVBK], a
ret ret
; 170d16 ; 170d16
LZ_170d16: LZ_170d16:
@ -417,15 +351,16 @@ Function1719ed: ; 1719ed (5c:59ed)
ret ret
Function171a11: ; 171a11 (5c:5a11) Function171a11: ; 171a11 (5c:5a11)
.loop
call JoyTextDelay call JoyTextDelay
ld a, [wcd49] ld a, [wcd49]
bit 7, a bit 7, a
jr nz, .asm_171a2c jr nz, .done
call Function171a36 call Function171a36
callba PlaySpriteAnimations callba PlaySpriteAnimations
callba ReloadMapPart callba ReloadMapPart
jr Function171a11 jr .loop
.asm_171a2c .done
callba ClearSpriteAnims callba ClearSpriteAnims
call ClearSprites call ClearSprites
ret ret
@ -465,6 +400,7 @@ Function171a5d: ; 171a5d (5c:5a5d)
bit 0, a bit 0, a
ret nz ret nz
jp Function171c66 jp Function171c66
.asm_171a6a .asm_171a6a
ld a, $0 ld a, $0
call Function3e32 call Function3e32
@ -492,6 +428,7 @@ Function171a95: ; 171a95 (5c:5a95)
ld de, String_171aa7 ld de, String_171aa7
call PlaceString call PlaceString
jp Function171c66 jp Function171c66
; 171aa7 (5c:5aa7) ; 171aa7 (5c:5aa7)
String_171aa7: ; 171aa7 String_171aa7: ; 171aa7
@ -626,6 +563,7 @@ Function171b9f: ; 171b9f (5c:5b9f)
ld a, $80 ld a, $80
ld [wcd49], a ld [wcd49], a
ret ret
asm_171ba5: ; 171ba5 (5c:5ba5) asm_171ba5: ; 171ba5 (5c:5ba5)
ld a, [wcd4a] ld a, [wcd4a]
and a and a
@ -633,6 +571,7 @@ asm_171ba5: ; 171ba5 (5c:5ba5)
dec a dec a
ld [wcd4a], a ld [wcd4a], a
ret ret
asm_171baf: ; 171baf (5c:5baf) asm_171baf: ; 171baf (5c:5baf)
ld a, [wcd4b] ld a, [wcd4b]
ld c, a ld c, a
@ -729,6 +668,7 @@ Function171c66: ; 171c66 (5c:5c66)
ld hl, wcd49 ld hl, wcd49
inc [hl] inc [hl]
ret ret
; 171c6b (5c:5c6b) ; 171c6b (5c:5c6b)
MenuDataHeader_171c6b: ; 171c6b MenuDataHeader_171c6b: ; 171c6b
@ -807,6 +747,7 @@ endr
hlcoord 3, 16 hlcoord 3, 16
ld de, String_172e3f ld de, String_172e3f
jp PlaceString jp PlaceString
.asm_171d16 .asm_171d16
ld hl, Tilemap_1725f9 ld hl, Tilemap_1725f9
decoord 0, 7 decoord 0, 7
@ -841,6 +782,7 @@ Function171d2b: ; 171d2b (5c:5d2b)
ld de, String_172e58 ld de, String_172e58
call PlaceString call PlaceString
ret ret
; 171d71 (5c:5d71) ; 171d71 (5c:5d71)
Palette_171d71: Palette_171d71:
@ -931,6 +873,7 @@ Function172e78: ; 172e78 (5c:6e78)
ld bc, $168 ld bc, $168
call CopyBytes call CopyBytes
ret ret
; 172eb9 (5c:6eb9) ; 172eb9 (5c:6eb9)
Function172eb9: Function172eb9:
@ -950,6 +893,7 @@ Function172eb9:
pop af pop af
ld [rSVBK], a ld [rSVBK], a
ret ret
; 172edf (5c:6edf) ; 172edf (5c:6edf)
Palette_172edf: Palette_172edf:

View File

@ -213,7 +213,7 @@ wCurTrackDuty:: ds 1
wCurTrackIntensity:: ds 1 wCurTrackIntensity:: ds 1
wCurTrackFrequency:: dw wCurTrackFrequency:: dw
wc296:: ds 1 ; used only in an unused function wc296:: ds 1 ; used only in an unused function
wc297:: ds 1 wc297:: ds 1 ; used in MusicE0 and LoadNote
CurMusicByte:: ; c298 CurMusicByte:: ; c298
ds 1 ds 1
@ -306,7 +306,7 @@ wc2be:: ds 1
CurSFX:: ; c2bf CurSFX:: ; c2bf
; id of sfx currently playing ; id of sfx currently playing
ds 1 ds 1
wc2c0::
wMapMusic:: ; c2c0 wMapMusic:: ; c2c0
ds 1 ds 1
@ -1257,6 +1257,7 @@ wcd47:: ds 1
BGMapPalBuffer:: ; cd48 BGMapPalBuffer:: ; cd48
ds 1 ; 40 ds 1 ; 40
wBTTempOTSprite::
wcd49:: ds 1 wcd49:: ds 1
wcd4a:: ds 1 wcd4a:: ds 1
wcd4b:: ds 1 wcd4b:: ds 1
@ -1365,6 +1366,7 @@ CurMove::
wNamedObjectTypeBuffer:: ds 1 wNamedObjectTypeBuffer:: ds 1
ds 1 ds 1
wJumptableIndex:: wJumptableIndex::
wBattleTowerBattleEnded::
wcf63:: ds 1 wcf63:: ds 1
wNrOfBeatenBattleTowerTrainers:: wNrOfBeatenBattleTowerTrainers::
wMomBankDigitCursorPosition:: wMomBankDigitCursorPosition::
@ -3039,7 +3041,9 @@ w3_d742:: battle_tower_struct w3_d742
ds -$22 ds -$22
wBTChoiceOfLvlGroup:: wBTChoiceOfLvlGroup::
w3_d800:: ds $400 w3_d800:: ds $69
w3_d869:: ds $2c
w3_d895:: ds $36b
w3_dc00:: ds $168 w3_dc00:: ds $168
w3_dd68:: ds $294 w3_dd68:: ds $294
w3_dffc:: ds 4 w3_dffc:: ds 4