Deobfuscate gyms consistently

This commit is contained in:
deak311andris 2019-10-07 07:23:57 +02:00
parent 8d2afb7c13
commit 2e45c2946a
9 changed files with 77 additions and 77 deletions

View file

@ -54,12 +54,12 @@ CeladonGymText_48963:
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
SetEvent EVENT_GOT_TM21 SetEvent EVENT_GOT_TM21
jr .asm_4898c jr .gymVictory
.BagFull .BagFull
ld a, $b ld a, $b
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
.asm_4898c .gymVictory
ld hl, wObtainedBadges ld hl, wObtainedBadges
set 3, [hl] set 3, [hl]
ld hl, wBeatGymFlags ld hl, wBeatGymFlags
@ -151,17 +151,17 @@ CeladonGymTrainerHeader6:
CeladonGymText1: CeladonGymText1:
TX_ASM TX_ASM
CheckEvent EVENT_BEAT_ERIKA CheckEvent EVENT_BEAT_ERIKA
jr z, .asm_48a2d jr z, .beginBattle
CheckEventReuseA EVENT_GOT_TM21 CheckEventReuseA EVENT_GOT_TM21
jr nz, .asm_48a25 jr nz, .afterVictory
call z, CeladonGymText_48963 call z, CeladonGymText_48963
call DisableWaitingAfterTextDisplay call DisableWaitingAfterTextDisplay
jr .asm_48a5b jr .done
.asm_48a25 .afterVictory
ld hl, CeladonGymText_48a68 ld hl, CeladonGymText_48a68
call PrintText call PrintText
jr .asm_48a5b jr .done
.asm_48a2d .beginBattle
ld hl, CeladonGymText_48a5e ld hl, CeladonGymText_48a5e
call PrintText call PrintText
ld hl, wd72d ld hl, wd72d
@ -179,7 +179,7 @@ CeladonGymText1:
ld a, $3 ld a, $3
ld [wCeladonGymCurScript], a ld [wCeladonGymCurScript], a
ld [wCurMapScript], a ld [wCurMapScript], a
.asm_48a5b .done
jp TextScriptEnd jp TextScriptEnd
CeladonGymText_48a5e: CeladonGymText_48a5e:

View file

@ -54,12 +54,12 @@ CeruleanGymScript_5c70d:
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
SetEvent EVENT_GOT_TM11 SetEvent EVENT_GOT_TM11
jr .asm_5c736 jr .gymVictory
.BagFull .BagFull
ld a, $7 ld a, $7
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
.asm_5c736 .gymVictory
ld hl, wObtainedBadges ld hl, wObtainedBadges
set 1, [hl] set 1, [hl]
ld hl, wBeatGymFlags ld hl, wBeatGymFlags
@ -102,17 +102,17 @@ CeruleanGymTrainerHeader1:
CeruleanGymText1: CeruleanGymText1:
TX_ASM TX_ASM
CheckEvent EVENT_BEAT_MISTY CheckEvent EVENT_BEAT_MISTY
jr z, .asm_5c78d jr z, .beginBattle
CheckEventReuseA EVENT_GOT_TM11 CheckEventReuseA EVENT_GOT_TM11
jr nz, .asm_5c785 jr nz, .afterVictory
call z, CeruleanGymScript_5c70d call z, CeruleanGymScript_5c70d
call DisableWaitingAfterTextDisplay call DisableWaitingAfterTextDisplay
jr .asm_5c7bb jr .done
.asm_5c785 .afterVictory
ld hl, CeruleanGymText_5c7c3 ld hl, CeruleanGymText_5c7c3
call PrintText call PrintText
jr .asm_5c7bb jr .done
.asm_5c78d .beginBattle
ld hl, CeruleanGymText_5c7be ld hl, CeruleanGymText_5c7be
call PrintText call PrintText
ld hl, wd72d ld hl, wd72d
@ -131,7 +131,7 @@ CeruleanGymText1:
ld [hJoyHeld], a ld [hJoyHeld], a
ld a, $3 ld a, $3
ld [wCeruleanGymCurScript], a ld [wCeruleanGymCurScript], a
.asm_5c7bb .done
jp TextScriptEnd jp TextScriptEnd
CeruleanGymText_5c7be: CeruleanGymText_5c7be:

View file

@ -151,12 +151,12 @@ CinnabarGymScript3_75857:
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
SetEvent EVENT_GOT_TM38 SetEvent EVENT_GOT_TM38
jr .asm_75880 jr .gymVictory
.BagFull .BagFull
ld a, $c ld a, $c
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
.asm_75880 .gymVictory
ld hl, wObtainedBadges ld hl, wObtainedBadges
set 6, [hl] set 6, [hl]
ld hl, wBeatGymFlags ld hl, wBeatGymFlags
@ -207,17 +207,17 @@ CinnabarGymScript_758b7:
CinnabarGymText1: CinnabarGymText1:
TX_ASM TX_ASM
CheckEvent EVENT_BEAT_BLAINE CheckEvent EVENT_BEAT_BLAINE
jr z, .asm_d9332 jr z, .beginBattle
CheckEventReuseA EVENT_GOT_TM38 CheckEventReuseA EVENT_GOT_TM38
jr nz, .asm_3012f jr nz, .afterVictory
call z, CinnabarGymScript3_75857 call z, CinnabarGymScript3_75857
call DisableWaitingAfterTextDisplay call DisableWaitingAfterTextDisplay
jp TextScriptEnd jp TextScriptEnd
.asm_3012f .afterVictory
ld hl, BlaineFireBlastText ld hl, BlaineFireBlastText
call PrintText call PrintText
jp TextScriptEnd jp TextScriptEnd
.asm_d9332 .beginBattle
ld hl, BlaineBattleText ld hl, BlaineBattleText
call PrintText call PrintText
ld hl, BlaineEndBattleText ld hl, BlaineEndBattleText

View file

@ -54,12 +54,12 @@ FuchsiaGymScript3_75497:
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
SetEvent EVENT_GOT_TM06 SetEvent EVENT_GOT_TM06
jr .asm_754c0 jr .gymVictory
.BagFull .BagFull
ld a, $b ld a, $b
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
.asm_754c0 .gymVictory
ld hl, wObtainedBadges ld hl, wObtainedBadges
set 4, [hl] set 4, [hl]
ld hl, wBeatGymFlags ld hl, wBeatGymFlags
@ -142,17 +142,17 @@ FuchsiaGymTrainerHeader5:
FuchsiaGymText1: FuchsiaGymText1:
TX_ASM TX_ASM
CheckEvent EVENT_BEAT_KOGA CheckEvent EVENT_BEAT_KOGA
jr z, .asm_181b6 jr z, .beginBattle
CheckEventReuseA EVENT_GOT_TM06 CheckEventReuseA EVENT_GOT_TM06
jr nz, .asm_adc3b jr nz, .afterVictory
call z, FuchsiaGymScript3_75497 call z, FuchsiaGymScript3_75497
call DisableWaitingAfterTextDisplay call DisableWaitingAfterTextDisplay
jr .asm_e84c6 jr .done
.asm_adc3b .afterVictory
ld hl, KogaExplainToxicText ld hl, KogaExplainToxicText
call PrintText call PrintText
jr .asm_e84c6 jr .done
.asm_181b6 .beginBattle
ld hl, KogaBeforeBattleText ld hl, KogaBeforeBattleText
call PrintText call PrintText
ld hl, wd72d ld hl, wd72d
@ -171,7 +171,7 @@ FuchsiaGymText1:
ld [hJoyHeld], a ld [hJoyHeld], a
ld a, $3 ld a, $3
ld [wFuchsiaGymCurScript], a ld [wFuchsiaGymCurScript], a
.asm_e84c6 .done
jp TextScriptEnd jp TextScriptEnd
KogaBeforeBattleText: KogaBeforeBattleText:

View file

@ -764,17 +764,17 @@ OaksLab_TextPointers2:
OaksLabText1: OaksLabText1:
TX_ASM TX_ASM
CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB_2 CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB_2
jr nz, .asm_1d0de jr nz, .beforeChooseMon
ld hl, OaksLabGaryText1 ld hl, OaksLabGaryText1
call PrintText call PrintText
jr .done jr .done
.asm_1d0de .beforeChooseMon
bit 2, a bit 2, a
jr nz, .asm_1d0ea jr nz, .afterChooseMon
ld hl, OaksLabText40 ld hl, OaksLabText40
call PrintText call PrintText
jr .done jr .done
.asm_1d0ea .afterChooseMon
ld hl, OaksLabText41 ld hl, OaksLabText41
call PrintText call PrintText
.done .done

View file

@ -54,12 +54,12 @@ PewterGymScript_5c3df:
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
SetEvent EVENT_GOT_TM34 SetEvent EVENT_GOT_TM34
jr .asm_5c408 jr .gymVictory
.BagFull .BagFull
ld a, $6 ld a, $6
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
.asm_5c408 .gymVictory
ld hl, wObtainedBadges ld hl, wObtainedBadges
set 0, [hl] set 0, [hl]
ld hl, wBeatGymFlags ld hl, wBeatGymFlags
@ -101,17 +101,17 @@ PewterGymTrainerHeader0:
PewterGymText1: PewterGymText1:
TX_ASM TX_ASM
CheckEvent EVENT_BEAT_BROCK CheckEvent EVENT_BEAT_BROCK
jr z, .asm_5c46a jr z, .beginBattle
CheckEventReuseA EVENT_GOT_TM34 CheckEventReuseA EVENT_GOT_TM34
jr nz, .asm_5c462 jr nz, .gymVictory
call z, PewterGymScript_5c3df call z, PewterGymScript_5c3df
call DisableWaitingAfterTextDisplay call DisableWaitingAfterTextDisplay
jr .asm_5c49b jr .done
.asm_5c462 .gymVictory
ld hl, PewterGymText_5c4a3 ld hl, PewterGymText_5c4a3
call PrintText call PrintText
jr .asm_5c49b jr .done
.asm_5c46a .beginBattle
ld hl, PewterGymText_5c49e ld hl, PewterGymText_5c49e
call PrintText call PrintText
ld hl, wd72d ld hl, wd72d
@ -131,7 +131,7 @@ PewterGymText1:
ld a, $3 ld a, $3
ld [wPewterGymCurScript], a ld [wPewterGymCurScript], a
ld [wCurMapScript], a ld [wCurMapScript], a
.asm_5c49b .done
jp TextScriptEnd jp TextScriptEnd
PewterGymText_5c49e: PewterGymText_5c49e:

View file

@ -54,12 +54,12 @@ SaffronGymText_5d068:
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
SetEvent EVENT_GOT_TM46 SetEvent EVENT_GOT_TM46
jr .asm_5d091 jr .gymVictory
.BagFull .BagFull
ld a, $c ld a, $c
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
.asm_5d091 .gymVictory
ld hl, wObtainedBadges ld hl, wObtainedBadges
set 5, [hl] set 5, [hl]
ld hl, wBeatGymFlags ld hl, wBeatGymFlags
@ -152,17 +152,17 @@ SaffronGymTrainerHeader6:
SaffronGymText1: SaffronGymText1:
TX_ASM TX_ASM
CheckEvent EVENT_BEAT_SABRINA CheckEvent EVENT_BEAT_SABRINA
jr z, .asm_5d134 jr z, .beginBattle
CheckEventReuseA EVENT_GOT_TM46 CheckEventReuseA EVENT_GOT_TM46
jr nz, .asm_5d12c jr nz, .afterVictory
call z, SaffronGymText_5d068 call z, SaffronGymText_5d068
call DisableWaitingAfterTextDisplay call DisableWaitingAfterTextDisplay
jr .asm_5d15f jr .done
.asm_5d12c .afterVictory
ld hl, SaffronGymText_5d16e ld hl, SaffronGymText_5d16e
call PrintText call PrintText
jr .asm_5d15f jr .done
.asm_5d134 .beginBattle
ld hl, SaffronGymText_5d162 ld hl, SaffronGymText_5d162
call PrintText call PrintText
ld hl, wd72d ld hl, wd72d
@ -179,7 +179,7 @@ SaffronGymText1:
ld [wGymLeaderNo], a ld [wGymLeaderNo], a
ld a, $3 ld a, $3
ld [wSaffronGymCurScript], a ld [wSaffronGymCurScript], a
.asm_5d15f .done
jp TextScriptEnd jp TextScriptEnd
SaffronGymText_5d162: SaffronGymText_5d162:

View file

@ -29,14 +29,14 @@ Gym3LeaderName:
VermilionGymScript_5ca6d: VermilionGymScript_5ca6d:
CheckEvent EVENT_2ND_LOCK_OPENED CheckEvent EVENT_2ND_LOCK_OPENED
jr nz, .asm_5ca78 jr nz, .doorsOpen
ld a, $24 ld a, $24
jr .asm_5ca7f jr .replaceTile
.asm_5ca78 .doorsOpen
ld a, SFX_GO_INSIDE ld a, SFX_GO_INSIDE
call PlaySound call PlaySound
ld a, $5 ld a, $5
.asm_5ca7f .replaceTile
ld [wNewTileBlockID], a ld [wNewTileBlockID], a
lb bc, 2, 2 lb bc, 2, 2
predef_jump ReplaceTileBlock predef_jump ReplaceTileBlock
@ -73,12 +73,12 @@ VermilionGymScript_5caaa:
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
SetEvent EVENT_GOT_TM24 SetEvent EVENT_GOT_TM24
jr .asm_5cad3 jr .gymVictory
.BagFull .BagFull
ld a, $8 ld a, $8
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
.asm_5cad3 .gymVictory
ld hl, wObtainedBadges ld hl, wObtainedBadges
set 2, [hl] set 2, [hl]
ld hl, wBeatGymFlags ld hl, wBeatGymFlags
@ -131,17 +131,17 @@ VermilionGymTrainerHeader2:
VermilionGymText1: VermilionGymText1:
TX_ASM TX_ASM
CheckEvent EVENT_BEAT_LT_SURGE CheckEvent EVENT_BEAT_LT_SURGE
jr z, .asm_5cb39 jr z, .beforeBeat
CheckEventReuseA EVENT_GOT_TM24 CheckEventReuseA EVENT_GOT_TM24
jr nz, .asm_5cb31 jr nz, .afterBeat
call z, VermilionGymScript_5caaa call z, VermilionGymScript_5caaa
call DisableWaitingAfterTextDisplay call DisableWaitingAfterTextDisplay
jr .asm_5cb6a jr .done
.asm_5cb31 .afterBeat
ld hl, VermilionGymText_5cb72 ld hl, VermilionGymText_5cb72
call PrintText call PrintText
jr .asm_5cb6a jr .done
.asm_5cb39 .beforeBeat
ld hl, VermilionGymText_5cb6d ld hl, VermilionGymText_5cb6d
call PrintText call PrintText
ld hl, wd72d ld hl, wd72d
@ -161,7 +161,7 @@ VermilionGymText1:
ld a, $3 ld a, $3
ld [wVermilionGymCurScript], a ld [wVermilionGymCurScript], a
ld [wCurMapScript], a ld [wCurMapScript], a
.asm_5cb6a .done
jp TextScriptEnd jp TextScriptEnd
VermilionGymText_5cb6d: VermilionGymText_5cb6d:

View file

@ -148,12 +148,12 @@ ViridianGymScript3_74995:
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
SetEvent EVENT_GOT_TM27 SetEvent EVENT_GOT_TM27
jr .asm_749be jr .gymVictory
.BagFull .BagFull
ld a, $e ld a, $e
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID
.asm_749be .gymVictory
ld hl, wObtainedBadges ld hl, wObtainedBadges
set 7, [hl] set 7, [hl]
ld hl, wBeatGymFlags ld hl, wBeatGymFlags
@ -261,13 +261,13 @@ ViridianGymTrainerHeader7:
ViridianGymText1: ViridianGymText1:
TX_ASM TX_ASM
CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
jr z, .asm_6de66 jr z, .beginBattle
CheckEventReuseA EVENT_GOT_TM27 CheckEventReuseA EVENT_GOT_TM27
jr nz, .asm_9fc95 jr nz, .afterVictory
call z, ViridianGymScript3_74995 call z, ViridianGymScript3_74995
call DisableWaitingAfterTextDisplay call DisableWaitingAfterTextDisplay
jr .asm_6dff7 jr .done
.asm_9fc95 .afterVictory
ld a, $1 ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, ViridianGymText_74ad9 ld hl, ViridianGymText_74ad9
@ -279,8 +279,8 @@ ViridianGymText1:
call UpdateSprites call UpdateSprites
call Delay3 call Delay3
call GBFadeInFromBlack call GBFadeInFromBlack
jr .asm_6dff7 jr .done
.asm_6de66 .beginBattle
ld hl, ViridianGymText_74ace ld hl, ViridianGymText_74ace
call PrintText call PrintText
ld hl, wd72d ld hl, wd72d
@ -297,7 +297,7 @@ ViridianGymText1:
ld [wGymLeaderNo], a ld [wGymLeaderNo], a
ld a, $3 ld a, $3
ld [wViridianGymCurScript], a ld [wViridianGymCurScript], a
.asm_6dff7 .done
jp TextScriptEnd jp TextScriptEnd
ViridianGymText_74ace: ViridianGymText_74ace: