summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/audio/music1_headers.asm156
-rw-r--r--src/audio/music2_headers.asm204
-rw-r--r--src/data/attack_animations.asm2
-rw-r--r--src/data/booster_packs.asm24
-rw-r--r--src/data/cards.asm4
-rw-r--r--src/data/decks.asm2
-rw-r--r--src/data/map_objects.asm222
-rw-r--r--src/data/map_scripts.asm376
-rw-r--r--src/data/npc_map_data.asm262
-rw-r--r--src/data/npcs.asm4
-rw-r--r--src/data/warps.asm2
-rw-r--r--src/engine/bank01.asm32
-rw-r--r--src/engine/bank02.asm241
-rw-r--r--[-rwxr-xr-x]src/engine/bank03.asm1224
-rw-r--r--src/engine/bank04.asm153
-rw-r--r--src/engine/bank06.asm94
-rw-r--r--src/engine/bank07.asm124
-rw-r--r--src/engine/bank20.asm36
-rw-r--r--src/engine/effect_functions.asm12
-rw-r--r--src/engine/home.asm32
-rw-r--r--[-rwxr-xr-x]src/macros/scripts.asm22
-rw-r--r--src/sram.asm26
-rw-r--r--src/text/text1.asm4
-rw-r--r--src/text/text2.asm16
-rw-r--r--src/text/text3.asm144
-rw-r--r--src/text/text4.asm24
-rw-r--r--src/text/text5.asm2
-rw-r--r--src/text/text6.asm28
-rw-r--r--src/text/text8.asm2
-rw-r--r--src/text/text_offsets.asm220
-rw-r--r--src/wram.asm35
-rw-r--r--tools/constants.py740
-rwxr-xr-xtools/script_extractor.py6
-rwxr-xr-xtools/script_extractor2.py393
34 files changed, 3478 insertions, 1390 deletions
diff --git a/src/audio/music1_headers.asm b/src/audio/music1_headers.asm
index 05f33bb..26cdff4 100644
--- a/src/audio/music1_headers.asm
+++ b/src/audio/music1_headers.asm
@@ -41,19 +41,19 @@ SongHeaderPointers1: ; f4f05 (3d:4f05)
dw Music_DuelTheme2
dw Music_DuelTheme3
dw Music_PauseMenu
- dw $0000
+ dw NULL
dw Music_DeckMachine
dw Music_CardPop
dw Music_Overworld
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
dw Music_Unused13
dw Music_Unused14
dw Music_MatchStart1
@@ -107,10 +107,10 @@ Music_PauseMenu: ; f4f68 (3d:4f68)
;Music_PCMainMenu
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
Music_DeckMachine: ; f4f7a (3d:4f7a)
db %1111
@@ -135,147 +135,147 @@ Music_Overworld: ; f4f8c (3d:4f8c)
;Music_PokemonDome
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_ChallengeHall
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Club1
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Club2
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Club3
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Ronald
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Imakuni
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_HallOfHonor
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Credits
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
Music_Unused13: ; f4fe6 (3d:4fe6)
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
Music_Unused14: ; f4fef (3d:4fef)
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
Music_MatchStart1: ; f4ff8 (3d:4ff8)
db %0001
dw Music_MatchStart1_Ch1
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
Music_MatchStart2: ; f5001 (3d:5001)
db %0011
dw Music_MatchStart2_Ch1
dw Music_MatchStart2_Ch2
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
Music_MatchStart3: ; f500a (3d:500a)
db %0011
dw Music_MatchStart3_Ch1
dw Music_MatchStart3_Ch2
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
Music_MatchVictory: ; f5013 (3d:5013)
db %0111
dw Music_MatchVictory_Ch1
dw Music_MatchVictory_Ch2
dw Music_MatchVictory_Ch3
- dw $0000
+ dw NULL
Music_MatchLoss: ; f501c (3d:501c)
db %0111
dw Music_MatchLoss_Ch1
dw Music_MatchLoss_Ch2
dw Music_MatchLoss_Ch3
- dw $0000
+ dw NULL
Music_MatchDraw: ; f5025 (3d:5025)
db %0111
dw Music_MatchDraw_Ch1
dw Music_MatchDraw_Ch2
dw Music_MatchDraw_Ch3
- dw $0000
+ dw NULL
Music_Unused1b: ; f502e (3d:502e)
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
Music_BoosterPack: ; f5037 (3d:5037)
db %0111
dw Music_BoosterPack_Ch1
dw Music_BoosterPack_Ch2
dw Music_BoosterPack_Ch3
- dw $0000
+ dw NULL
Music_Medal: ; f5040 (3d:5040)
db %0111
dw Music_Medal_Ch1
dw Music_Medal_Ch2
dw Music_Medal_Ch3
- dw $0000
+ dw NULL
Music_Unused1e: ; f5049 (3d:5049)
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
diff --git a/src/audio/music2_headers.asm b/src/audio/music2_headers.asm
index 206d8fd..3a088f7 100644
--- a/src/audio/music2_headers.asm
+++ b/src/audio/music2_headers.asm
@@ -36,15 +36,15 @@ SongBanks2: ; f8ee6 (3e:4ee6)
SongHeaderPointers2: ; f8f05 (3e:4f05)
dw Music_Stop
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
dw Music_PCMainMenu
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw Music_PokemonDome
dw Music_ChallengeHall
dw Music_Club1
@@ -54,56 +54,56 @@ SongHeaderPointers2: ; f8f05 (3e:4f05)
dw Music_Imakuni
dw Music_HallOfHonor
dw Music_Credits
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Stop
db %0000
;Music_TitleScreen
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_DuelTheme1
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_DuelTheme2
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_DuelTheme3
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_PauseMenu
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
Music_PCMainMenu: ; f8f71 (3e:4f71)
db %1111
@@ -114,24 +114,24 @@ Music_PCMainMenu: ; f8f71 (3e:4f71)
;Music_DeckMachine
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_CardPop
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Overworld
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
Music_PokemonDome: ; f8f95 (3e:4f95)
db %1111
@@ -159,7 +159,7 @@ Music_Club2: ; f8fb0 (3e:4fb0)
dw Music_Club2_Ch1
dw Music_Club2_Ch2
dw Music_Club2_Ch3
- dw $0000
+ dw NULL
Music_Club3: ; f8fb9 (3e:4fb9)
db %1111
@@ -187,7 +187,7 @@ Music_HallOfHonor: ; f8fd4 (3e:4fd4)
dw Music_HallOfHonor_Ch1
dw Music_HallOfHonor_Ch2
dw Music_HallOfHonor_Ch3
- dw $0000
+ dw NULL
Music_Credits: ; f8fdd (3e:4fdd)
db %1111
@@ -198,84 +198,84 @@ Music_Credits: ; f8fdd (3e:4fdd)
;Music_Unused13
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Unused14
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_MatchStart1
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_MatchStart2
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_MatchStart3
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_MatchVictory
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_MatchLoss
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_MatchDraw
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Unused1b
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_BoosterPack
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Medal
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
;Music_Unused1e
db %0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
diff --git a/src/data/attack_animations.asm b/src/data/attack_animations.asm
index b8a3e77..d0bc93b 100644
--- a/src/data/attack_animations.asm
+++ b/src/data/attack_animations.asm
@@ -21,7 +21,7 @@ anim_end2: MACRO
ENDM
PointerTable_AttackAnimation:
- dw $0000 ; ATK_ANIM_NONE
+ dw NULL ; ATK_ANIM_NONE
dw AttackAnimation_Hit ; ATK_ANIM_HIT
dw AttackAnimation_BigHit ; ATK_ANIM_BIG_HIT
dw AttackAnimation_Hit ; ATK_ANIM_3
diff --git a/src/data/booster_packs.asm b/src/data/booster_packs.asm
index 44a401f..51bb8c2 100644
--- a/src/data/booster_packs.asm
+++ b/src/data/booster_packs.asm
@@ -14,7 +14,7 @@ ENDM
; For the energy or energy generation function, there are three options:
; - Pointer to a function that generates energies (some generate one, some generate a full pack)
; - A single energy of a specific type
-; - $0000 if no card in the pack is an energy
+; - NULL if no card in the pack is an energy
; As for Card Type Chances, note that whenever one card of the 10 is drawn, the chances of
; the type of that card are reduced by the original average of all 8 types (capping the result at 1).
@@ -232,7 +232,7 @@ BoosterPack_EvolutionTrainer:: ; 1e580 (7:6580)
BoosterPack_MysteryNeutral:: ; 1e58c (7:658c)
booster_set MYSTERY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 17 ; Grass Type Chance
@@ -247,7 +247,7 @@ BoosterPack_MysteryNeutral:: ; 1e58c (7:658c)
BoosterPack_MysteryGrassColorless:: ; 1e598 (7:6598)
booster_set MYSTERY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 48 ; Grass Type Chance
@@ -262,7 +262,7 @@ BoosterPack_MysteryGrassColorless:: ; 1e598 (7:6598)
BoosterPack_MysteryWaterColorless:: ; 1e5a4 (7:65a4)
booster_set MYSTERY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 12 ; Grass Type Chance
@@ -277,7 +277,7 @@ BoosterPack_MysteryWaterColorless:: ; 1e5a4 (7:65a4)
BoosterPack_MysteryLightningColorless:: ; 1e5b0 (7:65b0)
booster_set MYSTERY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 12 ; Grass Type Chance
@@ -292,7 +292,7 @@ BoosterPack_MysteryLightningColorless:: ; 1e5b0 (7:65b0)
BoosterPack_MysteryFightingColorless:: ; 1e5bc (7:65bc)
booster_set MYSTERY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 12 ; Grass Type Chance
@@ -307,7 +307,7 @@ BoosterPack_MysteryFightingColorless:: ; 1e5bc (7:65bc)
BoosterPack_MysteryTrainerColorless:: ; 1e5c8 (7:65c8)
booster_set MYSTERY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 12 ; Grass Type Chance
@@ -322,7 +322,7 @@ BoosterPack_MysteryTrainerColorless:: ; 1e5c8 (7:65c8)
BoosterPack_LaboratoryMostlyNeutral:: ; 1e5d4 (7:65d4)
booster_set LABORATORY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 20 ; Grass Type Chance
@@ -337,7 +337,7 @@ BoosterPack_LaboratoryMostlyNeutral:: ; 1e5d4 (7:65d4)
BoosterPack_LaboratoryGrass:: ; 1e5e0 (7:65e0)
booster_set LABORATORY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 48 ; Grass Type Chance
@@ -352,7 +352,7 @@ BoosterPack_LaboratoryGrass:: ; 1e5e0 (7:65e0)
BoosterPack_LaboratoryWater:: ; 1e5ec (7:65ec)
booster_set LABORATORY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 16 ; Grass Type Chance
@@ -367,7 +367,7 @@ BoosterPack_LaboratoryWater:: ; 1e5ec (7:65ec)
BoosterPack_LaboratoryPsychic:: ; 1e5f8 (7:65f8)
booster_set LABORATORY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 16 ; Grass Type Chance
@@ -382,7 +382,7 @@ BoosterPack_LaboratoryPsychic:: ; 1e5f8 (7:65f8)
BoosterPack_LaboratoryTrainer:: ; 1e604 (7:6604)
booster_set LABORATORY ; booster pack set
- dw $0000 ; energy or energy generation function
+ dw NULL ; energy or energy generation function
; Card Type Chances
db 16 ; Grass Type Chance
diff --git a/src/data/cards.asm b/src/data/cards.asm
index a045188..9c1ae11 100644
--- a/src/data/cards.asm
+++ b/src/data/cards.asm
@@ -2,7 +2,7 @@
; convenience once the meaning of all fields is figured out.
CardPointers: ; 30c5c (c:4c5c)
- dw $0000
+ dw NULL
dw GrassEnergyCard
dw FireEnergyCard
dw WaterEnergyCard
@@ -231,7 +231,7 @@ CardPointers: ; 30c5c (c:4c5c)
dw PokemonFluteCard
dw GamblerCard
dw RecycleCard
- dw $0000
+ dw NULL
BulbasaurCard: ; 30e28 (c:4e28)
db TYPE_PKMN_GRASS ; type
diff --git a/src/data/decks.asm b/src/data/decks.asm
index 424874b..8b800f4 100644
--- a/src/data/decks.asm
+++ b/src/data/decks.asm
@@ -54,7 +54,7 @@ DeckPointers: ; 30000 (c:4000)
dw FlamethrowerDeck
dw ReshuffleDeck
dw ImakuniDeck
- dw $0000
+ dw NULL
UnnamedDeck: ; 30070 (c:4070)
db 20, PSYCHIC_ENERGY
diff --git a/src/data/map_objects.asm b/src/data/map_objects.asm
index 069b12d..046c20f 100644
--- a/src/data/map_objects.asm
+++ b/src/data/map_objects.asm
@@ -8,7 +8,7 @@ MasonLabObjects: ; 13b04 (3:7b04)
db NORTH, 18, 2
dw PrintInteractableObjectText
tx Text04a0
- tx Text049f
+ tx WhatIsADeckText
db NORTH, 20, 2
dw PrintInteractableObjectText
@@ -42,8 +42,8 @@ MasonLabObjects: ; 13b04 (3:7b04)
db NORTH, 2, 2
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db $ff
@@ -51,103 +51,103 @@ MasonLabObjects: ; 13b04 (3:7b04)
DeckMachineRoomObjects: ; 13b4d (3:7b4d)
db NORTH, 2, 2
dw Script_d932
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 4, 2
dw Script_d932
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 2
- dw $593f
- tx Text041b
- tx Text041a
+ dw Script_d93f
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 8, 2
- dw $593f
- tx Text041b
- tx Text041a
+ dw Script_d93f
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 10, 2
- dw $5995
- tx Text041b
- tx Text041a
+ dw Script_d995
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 12, 2
- dw $5995
- tx Text041b
- tx Text041a
+ dw Script_d995
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 14, 2
- dw $59c2
- tx Text041b
- tx Text041a
+ dw Script_d9c2
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 16, 2
- dw $59c2
- tx Text041b
- tx Text041a
+ dw Script_d9c2
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 18, 2
- dw $59ef
- tx Text041b
- tx Text041a
+ dw Script_d9ef
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 20, 2
- dw $59ef
- tx Text041b
- tx Text041a
+ dw Script_d9ef
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 14, 10
- dw $5a1c
- tx Text041b
- tx Text041a
+ dw Script_da1c
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 16, 10
- dw $5a1c
- tx Text041b
- tx Text041a
+ dw Script_da1c
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 18, 10
- dw $5a49
- tx Text041b
- tx Text041a
+ dw Script_da49
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 20, 10
- dw $5a49
- tx Text041b
- tx Text041a
+ dw Script_da49
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 14, 18
- dw $5a76
- tx Text041b
- tx Text041a
+ dw Script_da76
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 16, 18
- dw $5a76
- tx Text041b
- tx Text041a
+ dw Script_da76
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 18, 18
- dw $5aa3
- tx Text041b
- tx Text041a
+ dw Script_daa3
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 20, 18
- dw $5aa3
- tx Text041b
- tx Text041a
+ dw Script_daa3
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 2, 18
- dw $5ad0
- tx Text041b
- tx Text041a
+ dw Script_dad0
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 4, 18
- dw $5ad0
- tx Text041b
- tx Text041a
+ dw Script_dad0
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db $ff
@@ -234,17 +234,17 @@ FightingClubLobbyObjects: ; 13c6f (3:7c6f)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -268,17 +268,17 @@ RockClubLobbyObjects: ; 13ca6 (3:7ca6)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -302,17 +302,17 @@ WaterClubLobbyObjects: ; 13cdd (3:7cdd)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -336,17 +336,17 @@ LightningClubLobbyObjects: ; 13d14 (3:7d14)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -370,17 +370,17 @@ GrassClubLobbyObjects: ; 13d4b (3:7d4b)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -404,17 +404,17 @@ PsychicClubLobbyObjects: ; 13d82 (3:7d82)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -438,17 +438,17 @@ ScienceClubLobbyObjects: ; 13db9 (3:7db9)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -472,17 +472,17 @@ FireClubLobbyObjects: ; 13df0 (3:7df0)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -506,17 +506,17 @@ ChallengeHallLobbyObjects: ; 13e27 (3:7e27)
db NORTH, 2, 8
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 6, 6
dw Script_fc52
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db NORTH, 10, 6
dw Func_fc7a
- tx Text041b
+ tx PlaceholderMessageText
tx ClerkNPCName
db $ff
@@ -564,19 +564,19 @@ PokemonDomeEntranceObjects: ; 13e5e (3:7e5e)
tx Text0507
db NORTH, 22, 0
- dw $76af
+ dw Script_f6af
tx Text0558
tx Text0509
db NORTH, 24, 0
- dw $76af
+ dw Script_f6af
tx Text0558
tx Text0509
db NORTH, 28, 2
dw PC_c7ea
- tx Text041b
- tx Text041a
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db $ff
@@ -585,23 +585,23 @@ HallOfHonorObjects: ; 13ec2 (3:7ec2)
; Legendary Cards
db NORTH, 10, 10
dw Script_fbf1
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; Legendary Cards
db NORTH, 12, 10
dw Script_fbf1
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
db NORTH, 10, 2
- dw $7be1
- tx Text041b
- tx Text041a
+ dw Script_fbe1
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db NORTH, 12, 2
- dw $7be1
- tx Text041b
- tx Text041a
+ dw Script_fbe1
+ tx PlaceholderMessageText
+ tx PokemonTradingCards101Text
db $ff
diff --git a/src/data/map_scripts.asm b/src/data/map_scripts.asm
index 3084f8b..0ee337d 100644
--- a/src/data/map_scripts.asm
+++ b/src/data/map_scripts.asm
@@ -1,7 +1,7 @@
; each map has a maximum of 8 scripts
; scripts are referenced with ids [0,2,4,6,8,a,c,e]
; each script id is used for a specific event
-; if a script pointer is $0000, that map has no script for that event
+; if a script pointer is NULL, that map has no script for that event
; 0: NPC data
; 2: Called after every NPC is loaded (unused)
; 4: Interactable Objects
@@ -13,341 +13,341 @@
MapScripts: ; 1162a (4:562a)
; OVERWORLD_MAP
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadOverworld
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
; MASON_LABORATORY
dw MasonLabNPCS
- dw $0000
+ dw NULL
dw MasonLabObjects
dw MasonLabPressedA
dw MasonLabLoadMap
dw MasonLaboratoryAfterDuel
- dw $0000
+ dw NULL
dw MasonLabCloseTextBox
; DECK_MACHINE_ROOM
dw DeckMachineRoomNPCS
- dw $0000
+ dw NULL
dw DeckMachineRoomObjects
- dw $0000
- dw $0000
- dw $589f
- dw $0000
- dw $58ad
+ dw NULL
+ dw NULL
+ dw DeckMachineRoomAfterDuel
+ dw NULL
+ dw DeckMachineRoomCloseTextBox
; ISHIHARAS_HOUSE
dw IshiharasHouseNPCS
- dw $0000
+ dw NULL
dw IshiharasHouseObjects
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
; FIGHTING_CLUB_ENTRANCE
dw FightingClubEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadClubEntrance
dw ClubEntranceAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; FIGHTING_CLUB_LOBBY
dw FightingClubLobbyNPCS
- dw $0000
+ dw NULL
dw FightingClubLobbyObjects
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
dw FightingClubLobbyAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; FIGHTING_CLUB
dw FightingClubNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
dw FightingClubAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; ROCK_CLUB_ENTRANCE
dw RockClubEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadClubEntrance
dw ClubEntranceAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; ROCK_CLUB_LOBBY
dw RockClubLobbyNPCS
- dw $0000
+ dw NULL
dw RockClubLobbyObjects
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
dw RockClubLobbyAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; ROCK_CLUB
dw RockClubNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $5fd6
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw RockClubAfterDuel
+ dw NULL
+ dw NULL
; WATER_CLUB_ENTRANCE
dw WaterClubEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadClubEntrance
dw ClubEntranceAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; WATER_CLUB_LOBBY
dw WaterClubLobbyNPCS
- dw $0000
+ dw NULL
dw WaterClubLobbyObjects
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
dw WaterClubLobbyAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; WATER_CLUB
dw WaterClubNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
dw WaterClubAfterDuel
dw WaterClubMovePlayer
- dw $0000
+ dw NULL
; LIGHTNING_CLUB_ENTRANCE
dw LightningClubEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadClubEntrance
dw ClubEntranceAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; LIGHTNING_CLUB_LOBBY
dw LightningClubLobbyNPCS
- dw $0000
+ dw NULL
dw LightningClubLobbyObjects
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
dw LightningClubLobbyAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; LIGHTNING_CLUB
dw LightningClubNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $63e8
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw LightningClubAfterDuel
+ dw NULL
+ dw NULL
; GRASS_CLUB_ENTRANCE
dw GrassClubEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadClubEntrance
dw GrassClubEntranceAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; GRASS_CLUB_LOBBY
dw GrassClubLobbyNPCS
- dw $0000
+ dw NULL
dw GrassClubLobbyObjects
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
dw GrassClubLobbyAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; GRASS_CLUB
dw GrassClubNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $66e7
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw GrassClubAfterDuel
+ dw NULL
+ dw NULL
; PSYCHIC_CLUB_ENTRANCE
dw PsychicClubEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadClubEntrance
dw ClubEntranceAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; PSYCHIC_CLUB_LOBBY
dw PsychicClubLobbyNPCS
- dw $0000
+ dw NULL
dw PsychicClubLobbyObjects
- dw $0000
- dw $6971
+ dw NULL
+ dw PsychicClubLobbyLoadMap
dw PsychicClubLobbyAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; PSYCHIC_CLUB
dw PsychicClubNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $6a46
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw PsychicClubAfterDuel
+ dw NULL
+ dw NULL
; SCIENCE_CLUB_ENTRANCE
dw ScienceClubEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadClubEntrance
dw ClubEntranceAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; SCIENCE_CLUB_LOBBY
dw ScienceClubLobbyNPCS
- dw $0000
+ dw NULL
dw ScienceClubLobbyObjects
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
dw ScienceClubLobbyAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; SCIENCE_CLUB
dw ScienceClubNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $6bf1
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw ScienceClubAfterDuel
+ dw NULL
+ dw NULL
; FIRE_CLUB_ENTRANCE
dw FireClubEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw LoadClubEntrance
dw ClubEntranceAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; FIRE_CLUB_LOBBY
dw FireClubLobbyNPCS
- dw $0000
+ dw NULL
dw FireClubLobbyObjects
dw FireClubPressedA
- dw $0000
+ dw NULL
dw FireClubLobbyAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; FIRE_CLUB
dw FireClubNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
dw FireClubAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; CHALLENGE_HALL_ENTRANCE
dw ChallengeHallEntranceNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
+ dw NULL
; CHALLENGE_HALL_LOBBY
dw ChallengeHallLobbyNPCS
- dw $0000
+ dw NULL
dw ChallengeHallLobbyObjects
- dw $0000
+ dw NULL
dw ChallengeHallLobbyLoadMap
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
; CHALLENGE_HALL
dw ChallengeHallNPCS
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
dw ChallengeHallLoadMap
dw ChallengeHallAfterDuel
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
; POKEMON_DOME_ENTRANCE
dw PokemonDomeEntranceNPCS
- dw $0000
+ dw NULL
dw PokemonDomeEntranceObjects
- dw $0000
- dw $7607
- dw $0000
- dw $0000
- dw $762a
+ dw NULL
+ dw PokemonDomeEntranceLoadMap
+ dw NULL
+ dw NULL
+ dw PokemonDomeEntranceCloseTextBox
; POKEMON_DOME
dw PokemonDomeNPCS
- dw $0000
- dw $0000
- dw $0000
- dw $7706
- dw $76e0
- dw $76c6
- dw $7718
+ dw NULL
+ dw NULL
+ dw NULL
+ dw PokemonDomeLoadMap
+ dw PokemonDomeAfterDuel
+ dw PokemonDomeMovePlayer
+ dw PokemonDomeCloseTextBox
; HALL_OF_HONOR
dw HallOfHonorNPCS
- dw $0000
+ dw NULL
dw HallOfHonorObjects
- dw $0000
+ dw NULL
dw HallOfHonorLoadMap
- dw $0000
- dw $0000
- dw $0000
+ dw NULL
+ dw NULL
+ dw NULL
diff --git a/src/data/npc_map_data.asm b/src/data/npc_map_data.asm
index 7c01e72..adcbee2 100644
--- a/src/data/npc_map_data.asm
+++ b/src/data/npc_map_data.asm
@@ -4,30 +4,30 @@
; pre-load function. (Resets c flag if NPC should not be loaded)
MasonLabNPCS: ; 772f (4:1372f)
db NPC_DRMASON, $0e, $06, SOUTH
- dw $5710
+ dw Preload_DrMason
db NPC_SAM, $04, $0e, EAST
- dw $5604
+ dw Preload_Sam
db NPC_TECH1, $16, $08, WEST
- dw $0000
+ dw NULL
db NPC_TECH2, $16, $14, SOUTH
- dw $0000
+ dw NULL
db NPC_TECH3, $16, $16, WEST
- dw $0000
+ dw NULL
db NPC_TECH4, $0a, $16, EAST
- dw $0000
+ dw NULL
db NPC_TECH5, $06, $04, SOUTH
- dw $55eb
+ dw Preload_Tech5
db $00
DeckMachineRoomNPCS: ; 775a (4:1375a)
db NPC_TECH6, $06, $08, SOUTH
- dw $0000
+ dw NULL
db NPC_TECH7, $06, $16, WEST
- dw $0000
+ dw NULL
db NPC_TECH8, $0a, $12, WEST
- dw $0000
+ dw NULL
db NPC_AARON, $0c, $0c, WEST
- dw $0000
+ dw NULL
db $00
IshiharasHouseNPCS: ; 7773 (4:13773)
@@ -41,308 +41,308 @@ IshiharasHouseNPCS: ; 7773 (4:13773)
FightingClubEntranceNPCS: ; 7786 (4:13786)
db NPC_CLERK1, $06, $02, SOUTH
- dw $0000
+ dw NULL
db NPC_RONALD1, $08, $fe, SOUTH
- dw $685b
+ dw Preload_Ronald1InClubEntrance
db NPC_RONALD2, $fe, $08, NORTH
- dw $689a
+ dw Preload_Ronald2InClubEntrance
db NPC_RONALD3, $fe, $08, NORTH
- dw $6915
+ dw Preload_Ronald3InClubEntrance
db $00
FightingClubLobbyNPCS: ; 779f (4:1379f)
db NPC_MAN1, $0c, $0e, WEST
- dw $0000
+ dw NULL
db NPC_IMAKUNI, $12, $02, NORTH
- dw $5ceb
+ dw Preload_ImakuniInFightingClubLobby
db NPC_SPECS1, $12, $10, EAST
- dw $0000
+ dw NULL
db NPC_BUTCH, $14, $10, WEST
- dw $0000
+ dw NULL
db NPC_GRANNY1, $04, $10, WEST
- dw $5d98
+ dw Preload_Granny1
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
FightingClubNPCS: ; 77ca (4:137ca)
db NPC_CHRIS, $04, $08, SOUTH
- dw $5e43
+ dw Preload_ChrisInFightingClub
db NPC_MICHAEL, $0e, $0a, SOUTH
- dw $5e79
+ dw Preload_MichaelInFightingClub
db NPC_JESSICA, $12, $06, EAST
- dw $5ea5
+ dw Preload_JessicaInFightingClub
db NPC_MITCH, $0a, $04, SOUTH
- dw $0000
+ dw NULL
db $00
RockClubEntranceNPCS: ; 77e3 (4:137e3)
db NPC_CLERK2, $06, $02, SOUTH
- dw $0000
+ dw NULL
db NPC_RONALD1, $08, $fe, SOUTH
- dw $685b
+ dw Preload_Ronald1InClubEntrance
db NPC_RONALD2, $fe, $08, NORTH
- dw $689a
+ dw Preload_Ronald2InClubEntrance
db NPC_RONALD3, $fe, $08, NORTH
- dw $6915
+ dw Preload_Ronald3InClubEntrance
db $00
RockClubLobbyNPCS: ; 77fc (4:137fc)
db NPC_CHRIS, $12, $08, WEST
- dw $5ee9
+ dw Preload_ChrisInRockClubLobby
db NPC_MATTHEW, $06, $0e, EAST
- dw $0000
+ dw NULL
db NPC_WOMAN1, $14, $12, NORTH
- dw $0000
+ dw NULL
db NPC_CHAP1, $0e, $10, EAST
- dw $0000
+ dw NULL
db NPC_LASS3, $10, $04, SOUTH
- dw $5fcb
+ dw Preload_Lass3
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
RockClubNPCS: ; 7827 (4:13827)
db NPC_RYAN, $14, $0e, EAST
- dw $0000
+ dw NULL
db NPC_ANDREW, $06, $14, NORTH
- dw $0000
+ dw NULL
db NPC_GENE, $0c, $06, NORTH
- dw $0000
+ dw NULL
db $00
WaterClubEntranceNPCS: ; 783a (4:1383a)
db NPC_CLERK3, $06, $02, SOUTH
- dw $0000
+ dw NULL
db NPC_RONALD1, $08, $fe, SOUTH
- dw $685b
+ dw Preload_Ronald1InClubEntrance
db NPC_RONALD2, $fe, $08, NORTH
- dw $689a
+ dw Preload_Ronald2InClubEntrance
db NPC_RONALD3, $fe, $08, NORTH
- dw $6915
+ dw Preload_Ronald3InClubEntrance
db $00
WaterClubLobbyNPCS: ; 7853 (4:13853)
db NPC_GAL1, $06, $0e, SOUTH
- dw $0000
+ dw NULL
db NPC_LASS1, $10, $0a, SOUTH
- dw $0000
+ dw NULL
db NPC_IMAKUNI, $12, $02, NORTH
dw Preload_ImakuniInWaterClubLobby
db NPC_MAN2, $04, $12, EAST
- dw Preload_Man2InWaterClubLobby
+ dw Preload_Man2
db NPC_PAPPY2, $16, $10, NORTH
- dw $0000
+ dw NULL
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
WaterClubNPCS: ; 787e (4:1387e)
db NPC_SARA, $06, $12, EAST
- dw $0000
+ dw NULL
db NPC_AMANDA, $16, $14, WEST
- dw $0000
+ dw NULL
db NPC_JOSHUA, $16, $08, SOUTH
- dw $0000
+ dw NULL
db NPC_AMY, $16, $04, SOUTH
dw Preload_Amy
db $00
LightningClubEntranceNPCS: ; 7897 (4:13897)
db NPC_CLERK4, $06, $02, SOUTH
- dw $0000
+ dw NULL
db NPC_RONALD1, $08, $fe, SOUTH
- dw $685b
+ dw Preload_Ronald1InClubEntrance
db NPC_RONALD2, $fe, $08, NORTH
- dw $689a
+ dw Preload_Ronald2InClubEntrance
db NPC_RONALD3, $fe, $08, NORTH
- dw $6915
+ dw Preload_Ronald3InClubEntrance
db $00
LightningClubLobbyNPCS: ; 78b0 (4:138b0)
db NPC_CHAP2, $12, $10, WEST
- dw $0000
+ dw NULL
db NPC_IMAKUNI, $12, $02, NORTH
- dw $637b
+ dw Preload_ImakuniInLightningClubLobby
db NPC_LASS4, $08, $0c, SOUTH
- dw $0000
+ dw NULL
db NPC_HOOD1, $14, $08, SOUTH
- dw $0000
+ dw NULL
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
LightningClubNPCS: ; 78d5 (4:138d5)
db NPC_JENNIFER, $0e, $12, SOUTH
- dw $0000
+ dw NULL
db NPC_NICHOLAS, $06, $0a, SOUTH
- dw $0000
+ dw NULL
db NPC_BRANDON, $16, $0c, NORTH
- dw $0000
+ dw NULL
db NPC_ISAAC, $0c, $04, NORTH
- dw $6494
+ dw Preload_Isaac
db $00
GrassClubEntranceNPCS: ; 78ee (4:138ee)
db NPC_CLERK5, $06, $02, SOUTH
- dw $0000
+ dw NULL
db NPC_MICHAEL, $0e, $08, SOUTH
- dw $656a
+ dw Preload_MichaelInGrassClubEntrance
db NPC_RONALD1, $08, $fe, SOUTH
- dw $685b
+ dw Preload_Ronald1InClubEntrance
db NPC_RONALD2, $fe, $08, NORTH
- dw $689a
+ dw Preload_Ronald2InClubEntrance
db NPC_RONALD3, $fe, $08, NORTH
- dw $6915
+ dw Preload_Ronald3InClubEntrance
db $00
GrassClubLobbyNPCS: ; 790d (4:1390d)
db NPC_BRITTANY, $0c, $0e, WEST
- dw $0000
+ dw NULL
db NPC_LASS2, $12, $08, SOUTH
- dw $0000
+ dw NULL
db NPC_GRANNY2, $04, $10, EAST
- dw $0000
+ dw NULL
db NPC_GAL2, $14, $10, NORTH
- dw $66dc
+ dw Preload_Gal2
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
GrassClubNPCS: ; 7932 (4:13932)
db NPC_KRISTIN, $04, $0a, EAST
- dw $0000
+ dw NULL
db NPC_HEATHER, $0e, $10, SOUTH
- dw $0000
+ dw NULL
db NPC_NIKKI, $0c, $04, SOUTH
- dw $6796
+ dw Preload_NikkiInGrassClub
db $00
PsychicClubEntranceNPCS: ; 7945 (4:13945)
db NPC_CLERK6, $06, $02, SOUTH
- dw $0000
+ dw NULL
db NPC_RONALD1, $08, $fe, SOUTH
- dw $685b
+ dw Preload_Ronald1InClubEntrance
db NPC_RONALD2, $fe, $08, NORTH
- dw $689a
+ dw Preload_Ronald2InClubEntrance
db NPC_RONALD3, $fe, $08, NORTH
- dw $6915
+ dw Preload_Ronald3InClubEntrance
db NPC_LAD3, $0e, $04, SOUTH
- dw $0000
+ dw NULL
db $00
PsychicClubLobbyNPCS: ; 7964 (4:13964)
db NPC_ROBERT, $14, $08, NORTH
- dw $0000
+ dw NULL
db NPC_PAPPY1, $04, $10, EAST
- dw $0000
+ dw NULL
db NPC_RONALD1, $0c, $0a, EAST
- dw $69f7
+ dw Preload_Ronald1InPsychicClubLobby
db NPC_GAL3, $10, $0e, WEST
- dw $0000
+ dw NULL
db NPC_CHAP4, $18, $10, SOUTH
- dw $0000
+ dw NULL
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
PsychicClubNPCS: ; 798f (4:1398f)
db NPC_DANIEL, $08, $08, NORTH
- dw $0000
+ dw NULL
db NPC_STEPHANIE, $16, $0c, EAST
- dw $0000
+ dw NULL
db NPC_MURRAY2, $02, $02, WEST
- dw $6ad0
+ dw Preload_Murray2
db NPC_MURRAY1, $0c, $06, SOUTH
- dw $6ada
+ dw Preload_Murray1
db $00
ScienceClubEntranceNPCS: ; 79a8 (4:139a8)
db NPC_CLERK7, $06, $02, SOUTH
- dw $0000
+ dw NULL
db NPC_RONALD1, $08, $fe, SOUTH
- dw $685b
+ dw Preload_Ronald1InClubEntrance
db NPC_RONALD2, $fe, $08, NORTH
- dw $689a
+ dw Preload_Ronald2InClubEntrance
db NPC_RONALD3, $fe, $08, NORTH
- dw $6915
+ dw Preload_Ronald3InClubEntrance
db $00
ScienceClubLobbyNPCS: ; 79c1 (4:139c1)
db NPC_LAD1, $12, $12, NORTH
- dw $0000
+ dw NULL
db NPC_IMAKUNI, $12, $02, NORTH
- dw $6b65
+ dw Preload_ImakuniInScienceClubLobby
db NPC_MAN3, $04, $0e, WEST
- dw $0000
+ dw NULL
db NPC_SPECS2, $0c, $0e, WEST
- dw $0000
+ dw NULL
db NPC_SPECS3, $16, $08, SOUTH
- dw $0000
+ dw NULL
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
ScienceClubNPCS: ; 79ec (4:139ec)
db NPC_JOSEPH, $08, $0a, SOUTH
- dw $6cc4
+ dw Preload_Joseph
db NPC_DAVID, $14, $04, NORTH
- dw $0000
+ dw NULL
db NPC_ERIK, $06, $12, SOUTH
- dw $0000
+ dw NULL
db NPC_RICK, $04, $04, NORTH
- dw $0000
+ dw NULL
db $00
FireClubEntranceNPCS: ; 7a05 (4:13a05)
db NPC_CLERK8, $06, $02, SOUTH
- dw $0000
+ dw NULL
db NPC_RONALD1, $08, $fe, SOUTH
- dw $685b
+ dw Preload_Ronald1InClubEntrance
db NPC_RONALD2, $fe, $08, NORTH
- dw $689a
+ dw Preload_Ronald2InClubEntrance
db NPC_RONALD3, $fe, $08, NORTH
- dw $6915
+ dw Preload_Ronald3InClubEntrance
db $00
FireClubLobbyNPCS: ; 7a1e (4:13a1e)
db NPC_JESSICA, $0c, $0e, WEST
- dw $6d8d
+ dw Preload_JessicaInFireClubLobby
db NPC_LAD2, $12, $06, EAST
- dw $6e25
+ dw Preload_Lad2
db NPC_CHAP3, $06, $0a, NORTH
- dw $0000
+ dw NULL
db NPC_MANIA, $14, $12, NORTH
- dw $0000
+ dw NULL
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
FireClubNPCS: ; 7a43 (4:13a43)
db NPC_JOHN, $0c, $12, SOUTH
- dw $0000
+ dw NULL
db NPC_ADAM, $08, $0e, SOUTH
- dw $0000
+ dw NULL
db NPC_JONATHAN, $12, $0a, SOUTH
- dw $0000
+ dw NULL
db NPC_KEN, $0e, $04, SOUTH
- dw $0000
+ dw NULL
db $00
ChallengeHallEntranceNPCS: ; 7a5c (4:13a5c)
@@ -366,7 +366,7 @@ ChallengeHallLobbyNPCS: ; 7a63 (4:13a63)
db NPC_RONALD1, $08, $0c, SOUTH
dw Preload_ChallengeHallLobbyRonald1
db NPC_CLERK10, $06, $04, SOUTH
- dw $0000
+ dw NULL
db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH
dw Preload_GiftCenterClerk
db $00
@@ -386,33 +386,33 @@ ChallengeHallNPCS: ; 7a9a (4:13a9a)
PokemonDomeEntranceNPCS: ; 7ab9 (4:13ab9)
db NPC_RONALD1, $0e, $12, SOUTH
- dw $0000
+ dw NULL
db $00
PokemonDomeNPCS: ; 7ac0 (4:13ac0)
db NPC_COURTNEY, $12, $02, SOUTH
- dw $774b
+ dw Preload_Courtney
db NPC_STEVE, $16, $02, SOUTH
- dw $778c
+ dw Preload_Steve
db NPC_JACK, $08, $02, SOUTH
- dw $77a3
+ dw Preload_Jack
db NPC_ROD, $0c, $02, SOUTH
- dw $77ba
+ dw Preload_Rod
db NPC_RONALD1, $1e, $00, SOUTH
- dw $77d6
+ dw Preload_Ronald1InPokemonDome
db $00
HallOfHonorNPCS: ; 7adf (4:13adf)
db NPC_LEGENDARY_CARD_TOP_LEFT, $0a, $08, SOUTH
- dw $0000
+ dw NULL
db NPC_LEGENDARY_CARD_TOP_RIGHT, $0c, $08, SOUTH
- dw $0000
+ dw NULL
db NPC_LEGENDARY_CARD_LEFT_SPARK, $08, $0a, SOUTH
- dw $0000
+ dw NULL
db NPC_LEGENDARY_CARD_BOTTOM_LEFT, $0a, $0a, SOUTH
- dw $0000
+ dw NULL
db NPC_LEGENDARY_CARD_BOTTOM_RIGHT, $0c, $0a, SOUTH
- dw $0000
+ dw NULL
db NPC_LEGENDARY_CARD_RIGHT_SPARK, $0e, $0a, SOUTH
- dw $0000
+ dw NULL
db $00
diff --git a/src/data/npcs.asm b/src/data/npcs.asm
index d7280b6..34885d6 100644
--- a/src/data/npcs.asm
+++ b/src/data/npcs.asm
@@ -710,7 +710,7 @@ Murray1NPCHeader:
db $00
db $12
db $00
- dw Script_Murray1
+ dw Script_Murray
tx MurrayNPCName
db MURRAY_PIC
db STRANGE_PSYSHOCK_DECK_ID
@@ -723,7 +723,7 @@ Murray2NPCHeader:
db $03
db $15
db $10
- dw Script_Murray2
+ dw Script_Murray
tx MurrayNPCName
db MURRAY_PIC
db STRANGE_PSYSHOCK_DECK_ID
diff --git a/src/data/warps.asm b/src/data/warps.asm
index cb34721..cba8053 100644
--- a/src/data/warps.asm
+++ b/src/data/warps.asm
@@ -1,5 +1,5 @@
WarpDataPointers: ; 1c099 (7:4099)
- dw $0000
+ dw NULL
dw MasonLaboratoryWarpData
dw DeckMachineRoomWarpData
dw IshiharasHouseWarpData
diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm
index 081ae3a..9cdb098 100644
--- a/src/engine/bank01.asm
+++ b/src/engine/bank01.asm
@@ -510,7 +510,7 @@ OpenActivePokemonScreen: ; 4376 (1:4376)
; triggered by selecting the "Pkmn Power" item in the duel menu
DuelMenu_PkmnPower: ; 438e (1:438e)
- call $6431
+ call Func_6431
jp c, DuelMainInterface
call UseAttackOrPokemonPower
jp DuelMainInterface
@@ -1027,7 +1027,7 @@ EnergyDiscardCardListParameters: ; 46f3 (1:46f3)
db 4 ; number of items selectable without scrolling
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; triggered by selecting the "Attack" item in the duel menu
DuelMenu_Attack: ; 46fc (1:46fc)
@@ -1168,28 +1168,28 @@ AttackMenuParameters: ; 47e4 (1:47e4)
db 2 ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; display the card page with id at wMovePageNumber of wLoadedCard1
-DisplayMovePage: ; $47ec (1:47ec)
+DisplayMovePage: ; 47ec (1:47ec)
ld a, [wMovePageNumber]
ld hl, MovePageDisplayPointerTable
jp JumpToFunctionInTable
-MovePageDisplayPointerTable: ; $47f5 (1:47f5)
+MovePageDisplayPointerTable: ; 47f5 (1:47f5)
dw DisplayMovePage_Move1Page1 ; MOVEPAGE_MOVE1_1
dw DisplayMovePage_Move1Page2 ; MOVEPAGE_MOVE1_2
dw DisplayMovePage_Move2Page1 ; MOVEPAGE_MOVE2_1
dw DisplayMovePage_Move2Page2 ; MOVEPAGE_MOVE2_2
; display MOVEPAGE_MOVE1_1
-DisplayMovePage_Move1Page1: ; $47fd (1:47fd)
+DisplayMovePage_Move1Page1: ; 47fd (1:47fd)
call DisplayCardPage_PokemonMove1Page1
jr SwitchMovePage
; display MOVEPAGE_MOVE1_2 if it exists. otherwise return in order
; to switch back to MOVEPAGE_MOVE1_1 and display it instead.
-DisplayMovePage_Move1Page2: ; $4802 (1:4802)
+DisplayMovePage_Move1Page2: ; 4802 (1:4802)
ld hl, wLoadedCard1Move1Description + 2
ld a, [hli]
or [hl]
@@ -1198,13 +1198,13 @@ DisplayMovePage_Move1Page2: ; $4802 (1:4802)
jr SwitchMovePage
; display MOVEPAGE_MOVE2_1
-DisplayMovePage_Move2Page1: ; $480d (1:480d)
+DisplayMovePage_Move2Page1: ; 480d (1:480d)
call DisplayCardPage_PokemonMove2Page1
jr SwitchMovePage
; display MOVEPAGE_MOVE2_2 if it exists. otherwise return in order
; to switch back to MOVEPAGE_MOVE2_1 and display it instead.
-DisplayMovePage_Move2Page2: ; $4812 (1:4812)
+DisplayMovePage_Move2Page2: ; 4812 (1:4812)
ld hl, wLoadedCard1Move2Description + 2
ld a, [hli]
or [hl]
@@ -1214,7 +1214,7 @@ DisplayMovePage_Move2Page2: ; $4812 (1:4812)
; switch to MOVEPAGE_MOVE*_2 if in MOVEPAGE_MOVE*_1 and vice versa.
; sets the next move page to switch to if Right or Left are pressed.
-SwitchMovePage: ; $481b (1:481b)
+SwitchMovePage: ; 481b (1:481b)
ld hl, wMovePageNumber
ld a, $01
xor [hl]
@@ -2152,7 +2152,7 @@ NoBasicPokemonCardListParameters: ; 4e37 (1:4e37)
db 7 ; number of items selectable without scrolling
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; used only during the practice duel with Sam.
; displays the list with the player's cards in hand, and the player's name above the list.
@@ -2664,7 +2664,7 @@ DoPracticeDuelAction: ; 51e7 (1:51e7)
jp JumpToFunctionInTable
PracticeDuelActionTable: ; 51f8 (1:51f8)
- dw $0000
+ dw NULL
dw PracticeDuel_DrawSevenCards
dw PracticeDuel_PlayGoldeen
dw PracticeDuel_PutStaryuInBench
@@ -3484,7 +3484,7 @@ ItemSelectionMenuParameters: ; 5708 (1:5708)
db 2 ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
CardListParameters: ; 5710 (1:5710)
db 1, 3 ; cursor x, cursor y
@@ -5709,7 +5709,7 @@ Func_6423: ; 6423 (1:6423)
Func_6431: ; 6431 (1:6431)
xor a
ld [wSelectedDuelSubMenuItem], a
-
+
Func_6435:
call Func_64b0
ld hl, PlayAreaScreenMenuParameters_ActivePokemonIncluded
@@ -8262,7 +8262,7 @@ Func_73d8: ; 73d8 (1:73d8)
ld [hli], a
ld [hl], a
.asm_73ec
- ld hl, $7408
+ ld hl, Data_7408
call PlaceTextItems
call DrawDuelistPortraitsAndNames
ld a, [wOpponentDeckID]
@@ -8272,8 +8272,8 @@ Func_73d8: ; 73d8 (1:73d8)
lb bc, 15, 10
call WriteTwoByteNumberInTxSymbolFormat
ret
-; 0x7408
+Data_7408: ; 7408 (1:7408)
INCROM $7408, $7415
Func_7415: ; 7415 (1:7415)
diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm
index 1e6179b..c72af73 100644
--- a/src/engine/bank02.asm
+++ b/src/engine/bank02.asm
@@ -1379,8 +1379,8 @@ Func_8764: ; 8764 (2:4764)
call LoadCursorTile
; reset ce5c and ce56
xor a
- ld [$ce5c], a
- ld [$ce56], a
+ ld [wce5c], a
+ ld [wce56], a
; draw play area screen for the turn player
ldh a, [hWhoseTurn]
@@ -1389,13 +1389,13 @@ Func_8764: ; 8764 (2:4764)
call DrawYourOrOppPlayAreaScreen
.swap
- ld a, [$ce56]
+ ld a, [wce56]
or a
jr z, .draw_menu
; if ce56 != 0, swap turn
call SwapTurn
xor a
- ld [$ce56], a
+ ld [wce56], a
.draw_menu
xor a
@@ -1430,7 +1430,7 @@ Func_8764: ; 8764 (2:4764)
ld l, a
call DrawYourOrOppPlayAreaScreen
xor a
- ld [$ce56], a
+ ld [wce56], a
.text
call DrawWideTextBox
@@ -1482,7 +1482,7 @@ PlayAreaMenuParameters: ; 8811 (2:4811)
db 2 ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
Func_8819: ; 8819 (2:4819)
ld a, [wPrizeCardCursorPosition]
@@ -1506,7 +1506,7 @@ Func_8819: ; 8819 (2:4819)
ld a, c
add $40
- ld [$ce5c], a
+ ld [wce5c], a
ld a, c
add DUELVARS_PRIZE_CARDS
call GetTurnDuelistVariable
@@ -1524,7 +1524,7 @@ Func_8849: ; 8849 (2:4849)
call CreateDeckCardList
ret c
ld a, %01111111
- ld [$ce5c], a
+ ld [wce5c], a
ld a, [wDuelTempList]
; fallthrough
@@ -1535,11 +1535,11 @@ Func_8849: ; 8849 (2:4849)
; with upper bit set if turn was swapped
Func_8855: ; 8855 (2:4855)
ld b, a
- ld a, [$ce5c]
+ ld a, [wce5c]
or a
jr nz, .display
ld a, b
- ld [$ce5c], a
+ ld [wce5c], a
.display
ld a, b
call LoadCardDataToBuffer1_FromDeckIndex
@@ -1550,15 +1550,15 @@ Func_8855: ; 8855 (2:4855)
pop af
; if ce56 != 0, swap turn
- ld a, [$ce56]
+ ld a, [wce56]
or a
jr z, .dont_swap
call SwapTurn
- ld a, [$ce5c]
+ ld a, [wce5c]
or %10000000
ret
.dont_swap
- ld a, [$ce5c]
+ ld a, [wce5c]
ret
Func_8883: ; 8883 (2:4883)
@@ -1597,7 +1597,7 @@ Func_8883: ; 8883 (2:4883)
call SwapTurn
ld a, $01
- ld [$ce56], a
+ ld [wce56], a
jp Func_8764.loop_2
Func_8764_TransitionTable: ; 88c2 (2:48c2)
@@ -1866,13 +1866,13 @@ Func_8cd4: ; 8cd4 (2:4cd4)
Func_8cf9: ; 8cf9 (2:4cf9)
call EnableSRAM
xor a
- ld hl, $b703
+ ld hl, sb703
ld [hli], a
inc a
ld [hli], a
ld [hli], a
ld [hl], a
- ld [$b701], a
+ ld [sb701], a
call DisableSRAM
Func_8d0b: ; 8d0b (2:4d0b)
ld hl, Unknown_8d15
@@ -2106,7 +2106,7 @@ Func_8f05: ; 8f05 (2:4f05)
ret
Func_8f38: ; 8f38 (2:4f38)
- ld hl, $b701
+ ld hl, sb701
call EnableSRAM
ld a, [hli]
ld h, [hl]
@@ -2127,7 +2127,7 @@ Func_8f38: ; 8f38 (2:4f38)
inc hl
ld [hl], $20
inc hl
- ld de, $c592
+ ld de, wc592
ld a, [de]
inc de
ld [hli], a
@@ -2138,7 +2138,7 @@ Func_8f38: ; 8f38 (2:4f38)
ld [hli], a
xor a
ld [hl], a
- ld hl, $b701
+ ld hl, sb701
call EnableSRAM
ld e, [hl]
inc hl
@@ -2447,17 +2447,17 @@ Func_9152: ; 9152 (2:5152)
Func_9168: ; 9168 (2:5168)
ld [hffb5], a
call Func_8d56
- ld de, $0000
- ld bc, $1404
+ lb de, 0, 0
+ lb bc, 20, 4
call DrawRegularTextBox
- ld de, $0003
- ld bc, $1404
+ lb de, 0, 3
+ lb bc, 20, 4
call DrawRegularTextBox
- ld de, $0006
- ld bc, $1404
+ lb de, 0, 6
+ lb bc, 20, 4
call DrawRegularTextBox
- ld de, $0009
- ld bc, $1404
+ lb de, 0, 9
+ lb bc, 20, 4
call DrawRegularTextBox
ld hl, Unknown_9242
call PlaceTextItems
@@ -2709,13 +2709,19 @@ CalculateOnesAndTensDigits: ; 98a6 (2:58a6)
pop af
ret
- INCROM $98c7, $9e41
+ INCROM $98c7, $9a6d
+
+Func_9a6d: ; 9a6d (2:5a6d)
+ INCROM $9a6d, $9e41
Func_9e41: ; 9e41 (2:5e41)
INCROM $9e41, $a288
Func_a288: ; a288 (2:6288)
- INCROM $a288, $b177
+ INCROM $a288, $adfe
+
+Func_adfe: ; adfe (2:6dfe)
+ INCROM $adfe, $b177
Func_b177: ; b177 (2:7177)
INCROM $b177, $b19d
@@ -2728,20 +2734,20 @@ Func_b19d: ; b19d (2:719d)
ld [hl], e
inc hl
ld [hl], d
- call $7379
+ call Func_b379
ld a, $3c
ld [wd0a5], a
xor a
.asm_b1b3
- ld hl, $76fb
- call $5a6d
- call $7704
- call $7545
+ ld hl, Unknown_b6fb
+ call Func_9a6d
+ call Func_b704
+ call Func_b545
ldtx hl, PleaseSelectDeckText
call DrawWideTextBox_PrintText
ld de, $0224 ; PleaseSelectDeckText?
- call $7285
- call $729f
+ call Func_b285
+ call Func_b29f
jr c, .asm_b1b3
cp $ff
ret z
@@ -2751,15 +2757,16 @@ Func_b19d: ; b19d (2:719d)
ld [wd088], a
call ResetCheckMenuCursorPositionAndBlink
call DrawWideTextBox
- ld hl, $7274
+ ld hl, Unknown_b274
call PlaceTextItems
+.asm_b1e7
call DoFrame
call HandleCheckMenuInput
- jp nc, $71e7
+ jp nc, .asm_b1e7
cp $ff
jr nz, .asm_b1fa
ld a, [wd086]
- jp $71b3
+ jp .asm_b1b3
.asm_b1fa
ld a, [wCheckMenuCursorYPosition]
@@ -2768,66 +2775,108 @@ Func_b19d: ; b19d (2:719d)
add [hl]
or a
jr nz, .asm_b22c
- call $735b
+ call Func_b35b
jr nc, .asm_b216
- call $7592
+ call Func_b592
ld a, [wd086]
- jp c, $71b3
+ jp c, .asm_b1b3
jr .asm_b25e
.asm_b216
- ld hl, $0272
+ ldtx hl, OKIfFileDeletedText
call YesOrNoMenuWithText
ld a, [wd086]
jr c, .asm_b1b3
- call $7592
+ call Func_b592
ld a, [wd086]
- jp c, $71b3
+ jp c, .asm_b1b3
jr .asm_b25e
.asm_b22c
cp $1
jr nz, .asm_b24c
- call $735b
+ call Func_b35b
jr c, .asm_b240
- call $76ca
+ call Func_b6ca
ld a, [wd086]
- jp c, $71b3
+ jp c, .asm_b1b3
jr .asm_b25e
.asm_b240
ld hl, WaitForVBlank
call DrawWideTextBox_WaitForInput
ld a, [wd086]
- jp $71b3
+ jp .asm_b1b3
.asm_b24c
cp $2
jr nz, .asm_b273
- call $735b
+ call Func_b35b
jr c, .asm_b240
- call $77c6
+ call Func_b7c6
ld a, [wd086]
- jp nc, $71b3
+ jp nc, .asm_b1b3
.asm_b25e
ld a, [wd087]
ld [wcea1], a
- call $7379
- call $7704
- call $7545
+ call Func_b379
+ call Func_b704
+ call Func_b545
ld a, [wd086]
- jp $71b3
+ jp .asm_b1b3
.asm_b273
ret
-; 0xb274
- INCROM $b274, $ba04
+Unknown_b274: ; b274 (2:7274)
+ INCROM $b274, $b285
+
+Func_b285: ; b285 (2:7285)
+ INCROM $b285, $b29f
+
+Func_b29f: ; b29f (2:729f)
+ INCROM $b29f, $b35b
+
+Func_b35b: ; b35b (2:735b)
+ INCROM $b35b, $b379
+
+Func_b379: ; b379 (2:7379)
+ INCROM $b379, $b3fe
+
+Unknown_b3fe: ; b3fe (2:73fe)
+ INCROM $b3fe, $b545
+
+Func_b545: ; b545 (2:7545)
+ INCROM $b545, $b592
+
+Func_b592: ; b592 (2:7592)
+ INCROM $b592, $b625
+
+Func_b625: ; b625 (2:7625)
+ INCROM $b625, $b644
+
+Func_b644: ; b644 (2:7644)
+ INCROM $b644, $b653
+
+Func_b653: ; b653 (2:7653)
+ INCROM $b653, $b6ca
+
+Func_b6ca: ; b6ca (2:76ca)
+ INCROM $b6ca, $b6fb
+
+Unknown_b6fb: ; b6fb (2:76fb)
+ INCROM $b6fb, $b704
+
+Func_b704: ; b704 (2:7704)
+ INCROM $b704, $b7c6
+
+Func_b7c6: ; b7c6 (2:77c6)
+ INCROM $b7c6, $ba04
Func_ba04: ; ba04 (2:7a04)
ld a, [wd0a9]
- ld hl, $7b83
+ ld hl, Data_bb83
sla a
ld c, a
ld b, $0
@@ -2840,17 +2889,20 @@ Func_ba04: ; ba04 (2:7a04)
ld [de], a
xor a
ld [wcea1], a
- call $7b97
+ call Func_bb97
ld a, $5
ld [wd0a5], a
xor a
- ld hl, $7b6e
+ ; fallthrough
+
+Func_ba25: ; ba25 (2:7a25)
+ ld hl, Func_bb6e
call InitializeMenuParameters
ldtx hl, PleaseSelectDeckText
call DrawWideTextBox_PrintText
ld a, $5
ld [wNamingScreenKeyboardHeight], a
- ld hl, $73fe
+ ld hl, Unknown_b3fe
ld d, h
ld a, l
ld hl, wcece
@@ -2882,7 +2934,7 @@ Func_ba04: ; ba04 (2:7a04)
ld b, $0
ld hl, wd00d
add hl, bc
- call $7653
+ call Func_b653
ld a, [hli]
ld h, [hl]
ld l, a
@@ -2893,19 +2945,19 @@ Func_ba04: ; ba04 (2:7a04)
ld e, l
ld a, [hl]
pop hl
- call $7644
+ call Func_b644
or a
jr z, .asm_ba40
ld a, $1
call PlaySFXConfirmOrCancel
- call $7653
+ call Func_b653
call Func_8e1f
- call $7644
+ call Func_b644
ld a, [wd087]
ld [wcea1], a
- call $7b97
+ call Func_bb97
ld a, [wd086]
- jp $7a25
+ jp Func_ba25
.asm_baa3
call DrawCursor2
@@ -2915,21 +2967,22 @@ Func_ba04: ; ba04 (2:7a04)
ld [wd086], a
ldh a, [hCurMenuItem]
cp $ff
- jp z, $7b0d
+ jp z, .asm_bb0d
ld [wd088], a
call ResetCheckMenuCursorPositionAndBlink
xor a
ld [wce5e], a
call DrawWideTextBox
- ld hl, $7b76
+ ld hl, Data_bb76
call PlaceTextItems
+.asm_bacc
call DoFrame
- call $46ac
- jp nc, $7acc
+ call HandleCheckMenuInput_YourOrOppPlayArea
+ jp nc, .asm_bacc
cp $ff
jr nz, .asm_badf
ld a, [wd086]
- jp $7a25
+ jp Func_ba25
.asm_badf
ld a, [wCheckMenuCursorYPosition]
@@ -2938,20 +2991,21 @@ Func_ba04: ; ba04 (2:7a04)
add [hl]
or a
jr nz, .asm_bb09
- call $7653
- call $77c6
- call $7644
+ call Func_b653
+ call Func_b7c6
+ call Func_b644
ld a, [wd086]
- jp nc, $7a25
+ jp nc, Func_ba25
ld a, [wd087]
ld [wcea1], a
- call $7b97
+ call Func_bb97
ld a, [wd086]
- jp $7a25
+ jp Func_ba25
.asm_bb09
cp $1
jr nz, .asm_bb12
+.asm_bb0d
xor a
ld [wd0a4], a
ret
@@ -2979,7 +3033,7 @@ Func_ba04: ; ba04 (2:7a04)
ld a, [hl]
ld [bc], a
pop hl
- call $7653
+ call Func_b653
ld a, [hli]
ld h, [hl]
ld l, a
@@ -2990,20 +3044,29 @@ Func_ba04: ; ba04 (2:7a04)
ld e, l
ld a, [hl]
pop hl
- call $7644
+ call Func_b644
or a
- jp z, $7a40
+ jp z, .asm_ba40
ld a, $1
call PlaySFXConfirmOrCancel
- call $7653
+ call Func_b653
xor a
- call $6dfe
- call $7644
+ call Func_adfe
+ call Func_b644
ld a, [wd087]
ld [wcea1], a
- call $7b97
+ call Func_bb97
ld a, [wd086]
- jp $7a25
-; 0xbb6e
+ jp Func_ba25
+
+Func_bb6e: ; bb6e (2:7b6e)
+ INCROM $bb6e, $bb76
+
+Data_bb76: ; bb76 (2:7b76)
+ INCROM $bb76, $bb83
+
+Data_bb83: ; bb83 (2:7b83)
+ INCROM $bb83, $bb97
- INCROM $bb6e, $c000
+Func_bb97: ; bb97 (2:7b97)
+ INCROM $bb97, $c000
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm
index 2e3f0d9..3608d97 100755..100644
--- a/src/engine/bank03.asm
+++ b/src/engine/bank03.asm
@@ -468,7 +468,16 @@ Func_c36a: ; c36a (3:436a)
ret
; 0xc37a
- INCROM $c37a, $c41c
+ INCROM $c37a, $c38f
+
+Func_c38f: ; c38f (3:438f)
+ INCROM $c38f, $c3ca
+
+Func_c3ca: ; c3ca (3:43ca)
+ INCROM $c3ca, $c3ee
+
+Func_c3ee: ; c3ee (3:43ee)
+ INCROM $c3ee, $c41c
Func_c41c: ; c41c (3:441c)
ld a, [wd332]
@@ -1071,7 +1080,7 @@ PC_c7ea: ; c7ea (3:47ea)
call DoFrameIfLCDEnabled
ldtx hl, TurnedPCOnText
call PrintScrollableText_NoTextBoxLabel
- call $484e
+ call Func_c84e
.asm_c801
ld a, $1
call Func_c29b
@@ -1088,9 +1097,9 @@ PC_c7ea: ; c7ea (3:47ea)
jr z, .asm_c82f
call Func_c2a3
ld a, [wd0b9]
- ld hl, $4846
+ ld hl, PointerTable_c846
call JumpToFunctionInTable
- ld hl, $484e
+ ld hl, Func_c84e
call Func_c32b
jr .asm_c801
.asm_c82f
@@ -1103,9 +1112,27 @@ PC_c7ea: ; c7ea (3:47ea)
ld [wd112], a
call Func_39fc
ret
-; 0xc846
- INCROM $c846, $c891
+PointerTable_c846: ; c846 (3:4846)
+ dw Func_c859
+ dw Func_c86d
+ dw Func_c872
+ dw Func_c877
+
+Func_c84e: ; c84e (3:484e)
+ INCROM $c84e, $c859
+
+Func_c859: ; c859 (3:4859)
+ INCROM $c859, $c86d
+
+Func_c86d: ; c86d (3:486d)
+ INCROM $c86d, $c872
+
+Func_c872: ; c872 (3:4872)
+ INCROM $c872, $c877
+
+Func_c877: ; c877 (3:4877)
+ INCROM $c877, $c891
Func_c891: ; c891 (3:4891)
push hl
@@ -1161,7 +1188,7 @@ Func_c8ba: ; c8ba (3:48ba)
call Func_c241
call Func_c915
call DoFrameIfLCDEnabled
- call $2c62
+ call PrintScrollableText_WithTextBoxLabel
ret
Func_c8ed: ; c8ed (3:48ed)
@@ -1201,7 +1228,7 @@ Func_c915: ; c915 (3:4915)
ld de, $000c
ld bc, $1406
call AdjustCoordinatesForBGScroll
- call $43ca
+ call Func_c3ca
pop de
pop bc
ret
@@ -1804,9 +1831,10 @@ SetScriptPointer: ; cc8b (3:4c8b)
inc hl
ld [hl], b
ret
-; 0xcc92
- INCROM $cc92, $cc96
+GetScriptArgs5AfterPointer: ; cc92 (3:4c92)
+ ld a, $5
+ jr GetScriptArgsAfterPointer
GetScriptArgs1AfterPointer: ; cc96 (3:4c96)
ld a, $1
@@ -2397,7 +2425,11 @@ Func_cfd4: ; cfd4 (3:4fd4)
jp IncreaseScriptPointerBy1
Data_d006: ; d006 (3:5006)
- INCROM $d006, $d00b
+ db GRAVELER
+ db OMASTAR
+ db PARASECT
+ db RAPIDASH
+ db WEEZING
Func_d00b: ; d00b (3:500b)
sla c
@@ -2549,11 +2581,11 @@ Func_d103: ; d103 (3:5103)
ld [wTempNPC], a
call FindLoadedNPC
jr c, .asm_d119
- call $54d1
+ call ScriptCommand_JumpIfFlagNonzero2.passTryJump
jr .asm_d11c
.asm_d119
- call $54e6
+ call ScriptCommand_JumpIfFlagZero2.fail
.asm_d11c
pop af
@@ -2581,7 +2613,7 @@ Func_d135: ; d135 (3:5135)
rlca
ld c, a
ld b, $0
- ld hl, $5151
+ ld hl, MapNames - 2
add hl, bc
ld e, [hl]
inc hl
@@ -2592,7 +2624,19 @@ Func_d135: ; d135 (3:5135)
ld [hl], d
jp IncreaseScriptPointerBy2
- INCROM $d153, $d16b
+MapNames: ; d153 (3:5153)
+ tx MasonLaboratoryMapNameText
+ tx MrIshiharasHouseMapNameText
+ tx FightingClubMapNameText
+ tx RockClubMapNameText
+ tx WaterClubMapNameText
+ tx LightningClubMapNameText
+ tx GrassClubMapNameText
+ tx PsychicClubMapNameText
+ tx ScienceClubMapNameText
+ tx FireClubMapNameText
+ tx ChallengeHallMapNameText
+ tx PokemonDomeMapNameText
Func_d16b: ; d16b (3:516b)
ld hl, wCurrentNPCNameTx
@@ -2646,7 +2690,7 @@ Func_d1b3: ; d1b3 (3:51b3)
; fallthrough
.asm_d1c3
- ld hl, $51dc
+ ld hl, TradeCardNames
asm_d1c6:
ld e, a
add a
@@ -2662,7 +2706,51 @@ asm_d1c6:
ld [wTxRam2 + 1], a
jp IncreaseScriptPointerBy1
- INCROM $d1dc, $d209
+TradeCardNames: ; d1dc (3:51dc)
+ db MEWTWO2
+ tx MewtwoTradeCardName
+
+ db MEW1
+ tx MewTradeCardName
+
+ db ARCANINE1
+ tx ArcanineTradeCardName
+
+ db PIKACHU3
+ tx PikachuTradeCardName
+
+ db PIKACHU4
+ tx PikachuTradeCardName
+
+ db SURFING_PIKACHU1
+ tx SurfingPikachuTradeCardName
+
+ db SURFING_PIKACHU2
+ tx SurfingPikachuTradeCardName
+
+ db ELECTABUZZ1
+ tx ElectabuzzTradeCardName
+
+ db SLOWPOKE1
+ tx SlowpokeTradeCardName
+
+ db MEWTWO3
+ tx MewtwoTradeCardName
+
+ db MEWTWO2
+ tx MewtwoTradeCardName
+
+ db MEW1
+ tx MewTradeCardName
+
+ db JIGGLYPUFF1
+ tx JigglypuffTradeCardName
+
+ db SUPER_ENERGY_RETRIEVAL
+ tx SuperEnergyRetrievalTradeCardName
+
+ db FLYING_PIKACHU
+ tx FlyingPikachuTradeCardName
Func_d209: ; d209 (3:5209)
get_flag_value EVENT_FLAG_71
@@ -2696,13 +2784,16 @@ Func_d209: ; d209 (3:5209)
LegendaryCards: ; d234 (3:5234)
db ZAPDOS3
- tx Text03f0
+ tx ZapdosLegendaryCardName
+
db MOLTRES2
- tx Text03f1
+ tx MoltresLegendaryCardName
+
db ARTICUNO2
- tx Text03f2
+ tx ArticunoLegendaryCardName
+
db DRAGONITE1
- tx Text03f3
+ tx DragoniteLegendaryCardName
Flags_d240: ; d240 (3:5240)
db EVENT_FLAG_6D
@@ -2726,39 +2817,37 @@ ScriptCommand_ChooseDeckToDuelAgainstMultichoice: ; d24c (3:524c)
.multichoice_menu_args ; d25e
dw NULL ; NPC title for textbox under menu
- tx Text03f9 ; text for textbox under menu
+ tx SelectDeckToDuelText ; text for textbox under menu
dw MultichoiceTextbox_ConfigTable_ChooseDeckToDuelAgainst ; location of table configuration in bank 4
db $03 ; the value to return when b is pressed
dw wMultichoiceTextboxResult_ChooseDeckToDuelAgainst ; ram location to return result into
dw .text_entries ; location of table containing text entries
.text_entries ; d269
- tx Text03f6
- tx Text03f7
- tx Text03f8
+ tx LightningAndFireDeckChoiceText
+ tx WaterAndFightingDeckChoiceText
+ tx GrassAndPsychicDeckChoiceText
- INCROM $d26f, $d271
+ dw NULL
ScriptCommand_ChooseStarterDeckMultichoice: ; d271 (3:5271)
ld hl, .multichoice_menu_args
xor a
call ShowMultichoiceTextbox
jp IncreaseScriptPointerBy1
-; 0xd27b
.multichoice_menu_args ; d27b
dw NULL ; NPC title for textbox under menu
- tx Text03fd ; text for textbox under menu
+ tx SelectDeckToTakeText ; text for textbox under menu
dw MultichoiceTextbox_ConfigTable_ChooseDeckStarterDeck ; location of table configuration in bank 4
db $00 ; the value to return when b is pressed
- dw $d693 ; ram location to return result into
+ dw wd693 ; ram location to return result into
dw .text_entries ; location of table containing text entries
.text_entries
- tx Text03fa
- tx Text03fb
- tx Text03fc
-
+ tx CharmanderAndFriendsDeckChoiceText
+ tx SquirtleAndFriendsDeckChoiceText
+ tx BulbasaurAndFriendsDeckChoiceText
; displays a textbox with multiple choices and a cursor.
; takes as an argument in h1 a pointer to a table
@@ -2855,11 +2944,10 @@ ScriptCommand_ShowSamNormalMultichoice: ; d2f6 (3:52f6)
xor a
ld [wMultichoiceTextboxResult_Sam], a
jp IncreaseScriptPointerBy1
-; 0xd30c
.multichoice_menu_args ; d30c
tx SamNPCName ; NPC title for textbox under menu
- tx Text03fe ; text for textbox under menu
+ tx HowCanIHelpText ; text for textbox under menu
dw SamNormalMultichoice_ConfigurationTable ; location of table configuration in bank 4
db $03 ; the value to return when b is pressed
dw wMultichoiceTextboxResult_Sam ; ram location to return result into
@@ -3002,9 +3090,9 @@ Func_d408: ; d408 (3:5408)
ld [wd111], a
jp IncreaseScriptPointerBy2
-Func_d40f: ; d40f (3:540f)
+ScriptCommand_PlaySong: ; d40f (3:540f)
ld a, c
- call CallPlaySong
+ call ScriptPlaySong
jp IncreaseScriptPointerBy2
ScriptCommand_PlaySFX: ; d416 (3:5416)
@@ -3061,7 +3149,7 @@ ScriptCommand_JumpIfFlagZero1: ; d460 (3:5460)
ld a, c
call GetEventFlagValue
or a
- jr z, ScriptCommand_JumpIfFlagZero1.passTryJump
+ jr z, .passTryJump
.fail
call SetScriptControlByteFail
@@ -3144,7 +3232,7 @@ ScriptCommand_JumpIfFlagNonzero2: ; d4ca (3:54ca)
or a
jr z, ScriptCommand_JumpIfFlagZero2.fail
-.passTryJump:
+.passTryJump
call SetScriptControlBytePass
call GetScriptArgs2AfterPointer
jr z, .noJumpArgs
@@ -3210,8 +3298,8 @@ MasonLaboratoryAfterDuel: ; d53b (3:553b)
.after_duel_table
db NPC_SAM
db NPC_SAM
- dw $568a
- dw $569f
+ dw Script_BeatSam
+ dw Script_LostToSam
db $00
MasonLabLoadMap: ; d549 (3:5549)
@@ -3248,27 +3336,222 @@ ChallengeMachineObjectTable: ; d572 (3:5572)
Script_ChallengeMachine: ; d57d (3:557d)
start_script
run_command Func_ccdc
- tx Text05bd
+ tx ItsTheChallengeMachineText
run_command Func_d43d
quit_script_fully
Script_Tech1: ; d583 (3:5583)
- INCROM $d583, $d5ca
+ lb bc, 0, EnergyCardListEnd - EnergyCardList
+ ld hl, EnergyCardList
+.count_loop
+ ld a, [hli]
+ call GetCardCountInCollection
+ add b
+ ld b, a
+ dec c
+ jr nz, .count_loop
+ ld a, b
+ cp 10
+ jr c, .low_on_energies
+
+ start_script
+ jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL
+ print_variable_text Tech1MasterMedalExplanationText, Tech1AutoDeckMachineExplanationText
+ quit_script_fully
+
+.low_on_energies
+ ld c, EnergyCardListEnd - EnergyCardList
+ ld hl, EnergyCardList
+.next_energy_card
+ ld b, 10
+ ld a, [hli]
+.add_loop
+ push af
+ call AddCardToCollection
+ pop af
+ dec b
+ jr nz, .add_loop
+ dec c
+ jr nz, .next_energy_card
+
+ start_script
+ print_text_string Tech1FewEnergyCardsText
+ pause_song
+ play_song MUSIC_BOOSTER_PACK
+ print_text_string Tech1ReceivedEnergyCardsText
+ wait_for_song_to_finish
+ resume_song
+ print_text_quit_fully Tech1GoodbyeText
+
+EnergyCardList: ; d5c4 (3:55c4)
+ db GRASS_ENERGY
+ db FIRE_ENERGY
+ db WATER_ENERGY
+ db LIGHTNING_ENERGY
+ db FIGHTING_ENERGY
+ db PSYCHIC_ENERGY
+EnergyCardListEnd:
Script_Tech2: ; d5ca (3:55ca)
- INCROM $d5ca, $d5d5
+ start_script
+ jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL
+ print_variable_text Tech2LegendaryCardsExplanationText, Tech2LegendaryCardsCongratsText
+ quit_script_fully
Script_Tech3: ; d5d5 (3:55d5)
- INCROM $d5d5, $d5e0
+ start_script
+ jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL
+ print_variable_text Tech3BoosterPackExplanationText, Tech3LegendaryCardsCongratsText
+ quit_script_fully
Script_Tech4: ; d5e0 (3:55e0)
- INCROM $d5e0, $d5f9
+ start_script
+ jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL
+ print_variable_text Tech4ClubsExplanationText, Tech4DefeatedTheGrandMastersText
+ quit_script_fully
+
+Preload_Tech5: ; d5eb (3:55eb)
+ get_flag_value EVENT_RECEIVED_LEGENDARY_CARD
+ or a
+ jr z, .skip
+ ld hl, wLoadNPCXPos
+ inc [hl]
+ inc [hl]
+.skip
+ scf
+ ret
Script_Tech5: ; d5f9 (3:55f9)
- INCROM $d5f9, $d61d
+ start_script
+ jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL
+ print_variable_text Tech5DiaryAndEmailExplanationText, Tech5ChallengeMachineExplanationText
+ quit_script_fully
+
+Preload_Sam: ; d604 (3:5604)
+ get_flag_value EVENT_FLAG_3E
+ cp $01
+ jr nc, .skip
+ ld a, $0a
+ ld [wLoadNPCXPos], a
+ ld a, $08
+ ld [wLoadNPCYPos], a
+ ld a, SOUTH
+ ld [wLoadNPCDirection], a
+.skip
+ scf
+ ret
Script_Sam: ; d61d (3:561d)
- INCROM $d61d, $d727
+ start_script
+ show_sam_normal_multichoice
+ close_text_box
+ jump_if_flag_equal EVENT_FLAG_75, $00, .ows_d63b
+ jump_if_flag_equal EVENT_FLAG_75, $02, Script_d6b0
+ jump_if_flag_equal EVENT_FLAG_75, $03, .ows_d637
+ print_text_string Text05cb
+ ask_question_jump Text05cc, .ows_d647
+.ows_d637
+ print_text_string Text05cd
+ quit_script_fully
+
+.ows_d63b
+ print_text_string Text05ce
+ ask_question_jump Text05cf, .ows_d647
+ print_text_string Text05d0
+ quit_script_fully
+
+.ows_d647
+ close_text_box
+ jump_if_player_coords_match 4, 12, .ows_above_sam
+ jump_if_player_coords_match 2, 14, .ows_left_of_sam
+; ows_below_sam
+ set_player_direction WEST
+ move_player WEST, 1
+ set_player_direction NORTH
+ move_player NORTH, 1
+.ows_left_of_sam
+ set_player_direction NORTH
+ move_player NORTH, 1
+ set_player_direction EAST
+ move_player EAST, 1
+.ows_above_sam
+ set_player_direction EAST
+ move_player EAST, 1
+ move_player EAST, 1
+ move_player EAST, 1
+ set_player_direction SOUTH
+ move_player SOUTH, 1
+ set_player_direction WEST
+ move_active_npc NPCMovement_d889
+ jump_if_flag_equal EVENT_FLAG_75, $00, .ows_d685
+ start_battle PRIZES_2, SAMS_PRACTICE_DECK_ID, MUSIC_DUEL_THEME_1
+ quit_script_fully
+
+.ows_d685
+ start_battle PRIZES_2, SAMS_NORMAL_DECK_ID, MUSIC_DUEL_THEME_1
+ quit_script_fully
+
+Script_BeatSam: ; d68a (3:568a)
+ start_script
+ jump_if_flag_equal EVENT_FLAG_3E, $01, Script_d82d
+ jump_if_flag_equal EVENT_FLAG_75, $01, Script_d6ad
+ print_text_string Text05d1
+ give_booster_packs BOOSTER_ENERGY_RANDOM, NO_BOOSTER, NO_BOOSTER
+ print_text_quit_fully Text05d2
+
+Script_LostToSam: ; d69f (3:569f)
+ start_script
+ jump_if_flag_equal EVENT_FLAG_3E, $01, Script_d82d
+ jump_if_flag_equal EVENT_FLAG_75, $01, Script_d6ad
+ print_text_quit_fully Text05d3
+
+Script_d6ad:
+ print_text_quit_fully Text05d4
+
+Script_d6b0:
+ print_text_string Text05d5
+.ows_d6b3
+ close_text_box
+ show_sam_tutorial_multichoice
+ close_text_box
+ jump_if_flag_equal EVENT_FLAG_75, $07, Script_Sam.ows_d637
+ jump_if_flag_equal EVENT_FLAG_75, $01, .ows_d6df
+ jump_if_flag_equal EVENT_FLAG_75, $02, .ows_d6e5
+ jump_if_flag_equal EVENT_FLAG_75, $03, .ows_d6eb
+ jump_if_flag_equal EVENT_FLAG_75, $04, .ows_d6f1
+ jump_if_flag_equal EVENT_FLAG_75, $05, .ows_d6f7
+ jump_if_flag_equal EVENT_FLAG_75, $06, .ows_d6fd
+ print_text_string Text05d6
+ script_jump .ows_d6b3
+.ows_d6df
+ print_text_string Text05d7
+ script_jump .ows_d6b3
+.ows_d6e5
+ print_text_string Text05d8
+ script_jump .ows_d6b3
+.ows_d6eb
+ print_text_string Text05d9
+ script_jump .ows_d6b3
+.ows_d6f1
+ print_text_string Text05da
+ script_jump .ows_d6b3
+.ows_d6f7
+ print_text_string Text05db
+ script_jump .ows_d6b3
+.ows_d6fd
+ print_text_string Text05dc
+ script_jump .ows_d6b3
+
+Func_d703: ; d703 (3:5703)
+ get_flag_value EVENT_RECEIVED_LEGENDARY_CARD
+ or a
+ ret z
+ ld a, $0a
+ farcall Func_80ba4
+ ret
+
+Preload_DrMason: ; d710 (3:5710)
+ INCROM $d710, $d727
Script_DrMason: ; d727 (3:5727)
INCROM $d727, $d753
@@ -3381,9 +3664,12 @@ Script_d827: ; d827 (3:5827)
start_script
start_battle PRIZES_2, SAMS_PRACTICE_DECK_ID, MUSIC_DUEL_THEME_1
quit_script_fully
-; 0xd82d
- INCROM $d82d, $d834
+Script_d82d:
+ close_advanced_text_box
+ set_next_npc_and_script $01, AfterTutorialBattleScript
+ end_script_loop
+ ret
AfterTutorialBattleScript: ; d834 (3:5834)
start_script
@@ -3414,8 +3700,7 @@ AfterTutorialBattleScript: ; d834 (3:5834)
print_text_string Text05f4
close_text_box
pause_song
- run_command Func_d40f
- try_give_medal_pc_packs
+ play_song MUSIC_BOOSTER_PACK
run_command Func_ccdc
tx Text05f5
wait_for_song_to_finish
@@ -3440,6 +3725,7 @@ NPCMovement_d882: ; d882 (3:5882)
db WEST
db WEST
db SOUTH
+NPCMovement_d889: ; d889 (3:5889)
db EAST | NO_MOVE
db $ff
@@ -3468,9 +3754,21 @@ NPCMovement_d896: ; d896 (3:5896)
db EAST
db SOUTH | NO_MOVE
db $ff
-; 0xd89f
- INCROM $d89f, $d8bb
+DeckMachineRoomAfterDuel: ; d89f (3:589f)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+
+.after_duel_table
+ db NPC_AARON
+ db NPC_AARON
+ dw Script_BeatAaron
+ dw Script_LostToAaron
+ db $00
+
+DeckMachineRoomCloseTextBox: ; d8ad (3:58ad)
+ INCROM $d8ad, $d8bb
Script_Tech6: ; d8bb (3:58bb)
INCROM $d8bb, $d8c6
@@ -3482,7 +3780,13 @@ Script_Tech8: ; d8d1 (3:58d1)
INCROM $d8d1, $d8dd
Script_Aaron: ; d8dd (3:58dd)
- INCROM $d8dd, $d932
+ INCROM $d8dd, $d903
+
+Script_BeatAaron: ; d903 (3:5903)
+ INCROM $d903, $d92e
+
+Script_LostToAaron: ; d92e (3:592e)
+ INCROM $d92e, $d932
Script_d932: ; d932 (3:5932)
start_script
@@ -3494,9 +3798,33 @@ Script_d932: ; d932 (3:5932)
.ows_d93c
open_deck_machine $09
quit_script_fully
-; 0xd93f
- INCROM $d93f, $dadd
+Script_d93f: ; d93f (3:593f)
+ INCROM $d93f, $d995
+
+Script_d995: ; d995 (3:5995)
+ INCROM $d995, $d9c2
+
+Script_d9c2: ; d9c2 (3:59c2)
+ INCROM $d9c2, $d9ef
+
+Script_d9ef: ; d9ef (3:59ef)
+ INCROM $d9ef, $da1c
+
+Script_da1c: ; da1c (3:5a1c)
+ INCROM $da1c, $da49
+
+Script_da49: ; da49 (3:5a49)
+ INCROM $da49, $da76
+
+Script_da76: ; da76 (3:5a76)
+ INCROM $da76, $daa3
+
+Script_daa3: ; daa3 (3:5aa3)
+ INCROM $daa3, $dad0
+
+Script_dad0: ; dad0 (3:5ad0)
+ INCROM $dad0, $dadd
Preload_NikkiInIshiharasHouse: ; dadd (3:5add)
get_flag_value EVENT_FLAG_35
@@ -3672,7 +4000,10 @@ FightingClubLobbyAfterDuel: ; dc68 (3:5c68)
db $00
Script_Man1: ; dc76 (3:5c76)
- INCROM $dc76, $dd0d
+ INCROM $dc76, $dceb
+
+Preload_ImakuniInFightingClubLobby: ; dceb (3:5ceb)
+ INCROM $dceb, $dd0d
Script_Imakuni: ; dd0d (3:5d0d)
start_script
@@ -3692,7 +4023,7 @@ Script_Imakuni: ; dd0d (3:5d0d)
Script_BeatImakuni: ; dd2d (3:5d2d)
start_script
jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $07, .giveBoosters
- script_increment_flag_value EVENT_IMAKUNI_WIN_COUNT
+ increment_flag_value EVENT_IMAKUNI_WIN_COUNT
jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $03, .threeWins
jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $06, .sixWins
.giveBoosters
@@ -3752,41 +4083,40 @@ Script_Specs1: ; dd82 (3:5d82)
INCROM $dd82, $dd8d
Script_Butch: ; dd8d (3:5d8d)
- INCROM $dd8d, $dd9f
+ INCROM $dd8d, $dd98
+
+Preload_Granny1: ; dd98 (3:5d98)
+ INCROM $dd98, $dd9f
Script_Granny1: ; dd9f (3:5d9f)
INCROM $dd9f, $dda3
-
FightingClubAfterDuel: ; dda3 (3:5da3)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
-; 0xddaa
.after_duel_table
db NPC_CHRIS
db NPC_CHRIS
- dw $5e69
- dw $5e75
+ dw Script_BeatChrisInFightingClub
+ dw Script_LostToChrisInFightingClub
db NPC_MICHAEL
db NPC_MICHAEL
- dw $5e95
- dw $5ea1
+ dw Script_BeatMichaelInFightingClub
+ dw Script_LostToMichaelInFightingClub
db NPC_JESSICA
db NPC_JESSICA
- dw $5ec1
- dw $5ecd
+ dw Script_BeatJessicaInFightingClub
+ dw Script_LostToJessicaInFightingClub
db NPC_MITCH
db NPC_MITCH
dw Script_BeatMitch
- dw Script_LoseToMitch
-
+ dw Script_LostToMitch
db $00
-; ddc3
Script_Mitch: ; ddc3 (3:5dc3)
start_script
@@ -3800,27 +4130,21 @@ Script_Mitch: ; ddc3 (3:5dc3)
script_set_flag_value EVENT_FLAG_17, $01
script_set_flag_value EVENT_FLAG_20, $01
quit_script_fully
-; 0xdde2
.three_pupils_remaining
print_text_quit_fully Text0478
-; 0xdde5
.two_pupils_remaining
print_text_quit_fully Text0479
-; 0xdde8
.one_pupil_remaining
print_text_quit_fully Text047a
-; 0xddeb
.all_pupils_defeated
print_text_string Text047b
ask_question_jump Text047c, .do_battle
print_text_string Text047d
quit_script_fully
-; 0xddf7
.do_battle
print_text_string Text047e
start_battle PRIZES_6, FIRST_STRIKE_DECK_ID, MUSIC_DUEL_THEME_2
quit_script_fully
-; 0xddff
Script_BeatMitch: ; ddff (3:5dff)
start_script
@@ -3836,38 +4160,57 @@ Script_BeatMitch: ; ddff (3:5dff)
give_booster_packs BOOSTER_LABORATORY_NEUTRAL, BOOSTER_LABORATORY_NEUTRAL, NO_BOOSTER
print_text_string Text0481
quit_script_fully
-; 0xde19
-Script_LoseToMitch: ; de19 (3:5e19)
+Script_LostToMitch: ; de19 (3:5e19)
start_script
jump_if_flag_nonzero_2 EVENT_FLAG_0F, Script_Mitch_PrintTrainHarderText
print_text_quit_fully Text0482
-; 0xde21
-Script_Mitch_AlreadyHaveMedal: ; 0xde21
+Script_Mitch_AlreadyHaveMedal: ; de21 (3:5e21)
print_text_string Text0483
ask_question_jump Text047c, .do_battle
print_text_string Text0484
quit_script_fully
-; 0xde2d
.do_battle
print_text_string Text0485
start_battle PRIZES_6, FIRST_STRIKE_DECK_ID, MUSIC_DUEL_THEME_2
quit_script_fully
-; 0xde35
Script_Mitch_GiveBoosters:
print_text_string Text0486
give_booster_packs BOOSTER_LABORATORY_NEUTRAL, BOOSTER_LABORATORY_NEUTRAL, NO_BOOSTER
print_text_string Text0487
quit_script_fully
-; 0xde40
Script_Mitch_PrintTrainHarderText:
print_text_quit_fully Text0488
-; 0xde43
- INCROM $de43, $ded1
+Preload_ChrisInFightingClub: ; de43 (3:5e43)
+ INCROM $de43, $de69
+
+Script_BeatChrisInFightingClub: ; de69 (3:5e69)
+ INCROM $de69, $de75
+
+Script_LostToChrisInFightingClub: ; de75 (3:5e75)
+ INCROM $de75, $de79
+
+Preload_MichaelInFightingClub: ; de79 (3:5e79)
+ INCROM $de79, $de95
+
+Script_BeatMichaelInFightingClub: ; de95 (3:5e95)
+ INCROM $de95, $dea1
+
+Script_LostToMichaelInFightingClub: ; dea1 (3:5ea1)
+ INCROM $dea1, $dea5
+
+Preload_JessicaInFightingClub: ; dea5 (3:5ea5)
+ INCROM $dea5, $dec1
+
+Script_BeatJessicaInFightingClub: ; dec1 (3:5ec1)
+ INCROM $dec1, $decd
+
+Script_LostToJessicaInFightingClub: ; decd (3:5ecd)
+ INCROM $decd, $ded1
Script_Clerk2: ; ded1 (3:5ed1)
INCROM $ded1, $ded5
@@ -3876,56 +4219,108 @@ RockClubLobbyAfterDuel: ; ded5 (3:5ed5)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
-; 0xdedc
.after_duel_table
db NPC_CHRIS
db NPC_CHRIS
- dw $5f0c
- dw $5f20
+ dw Script_BeatChrisInRockClubLobby
+ dw Script_LostToChrisInRockClubLobby
db NPC_MATTHEW
db NPC_MATTHEW
- dw $5f63
- dw $5f78
+ dw Script_BeatMatthew
+ dw Script_LostToMatthew
db $00
-; 0xdee9
+Preload_ChrisInRockClubLobby: ; dee9 (3:5ee9)
INCROM $dee9, $def2
Script_Chris: ; def2 (3:5ef2)
- INCROM $def2, $df39
+ INCROM $def2, $df0c
+
+Script_BeatChrisInRockClubLobby: ; df0c (3:5f0c)
+ INCROM $df0c, $df20
+
+Script_LostToChrisInRockClubLobby: ; df20 (3:5f20)
+ INCROM $df20, $df39
Script_Matthew: ; df39 (3:5f39)
- INCROM $df39, $df83
+ INCROM $df39, $df63
+
+Script_BeatMatthew: ; df63 (3:5f63)
+ INCROM $df63, $df78
+
+Script_LostToMatthew: ; df78 (3:5f78)
+ INCROM $df78, $df83
Script_Woman1: ; df83 (3:5f83)
INCROM $df83, $dfc0
Script_Chap1: ; dfc0 (3:5fc0)
- INCROM $dfc0, $dfd2
+ INCROM $dfc0, $dfcb
+
+Preload_Lass3: ; dfcb (3:5fcb)
+ INCROM $dfcb, $dfd2
Script_Lass3: ; dfd2 (3:5fd2)
- INCROM $dfd2, $dff0
+ INCROM $dfd2, $dfd6
+
+RockClubAfterDuel: ; dfd6 (3:5fd6)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+
+.after_duel_table
+ db NPC_RYAN
+ db NPC_RYAN
+ dw Script_BeatRyan
+ dw Script_LostToRyan
+
+ db NPC_ANDREW
+ db NPC_ANDREW
+ dw Script_BeatAndrew
+ dw Script_LostToAndrew
+
+ db NPC_GENE
+ db NPC_GENE
+ dw Script_BeatGene
+ dw Script_LostToGene
+ db $00
Script_Ryan: ; dff0 (3:5ff0)
- INCROM $dff0, $e017
+ INCROM $dff0, $e007
+
+Script_BeatRyan: ; e007 (3:6007)
+ INCROM $e007, $e013
+
+Script_LostToRyan: ; e013 (3:6013)
+ INCROM $e013, $e017
Script_Andrew: ; e017 (3:6017)
- INCROM $e017, $e03e
+ INCROM $e017, $e02e
+
+Script_BeatAndrew: ; e02e (3:602e)
+ INCROM $e02e, $e03a
+
+Script_LostToAndrew: ; e03a (3:603a)
+ INCROM $e03a, $e03e
Script_Gene: ; e03e (3:603e)
- INCROM $e03e, $e09e
+ INCROM $e03e, $e059
+
+Script_BeatGene: ; e059 (3:6059)
+ INCROM $e059, $e073
+
+Script_LostToGene: ; e073 (3:6073)
+ INCROM $e073, $e09e
Script_Clerk3: ; e09e (3:609e)
INCROM $e09e, $e0a2
-
WaterClubLobbyAfterDuel: ; e0a2 (3:60a2)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
-; 0xe0a9
.after_duel_table
db NPC_IMAKUNI
@@ -3933,7 +4328,6 @@ WaterClubLobbyAfterDuel: ; e0a2 (3:60a2)
dw Script_BeatImakuni
dw Script_LostToImakuni
db $00
-; 0xe0b0
Preload_ImakuniInWaterClubLobby: ; e0b0 (3:60b0)
get_flag_value EVENT_IMAKUNI_STATE
@@ -3957,35 +4351,35 @@ Script_Gal1: ; e0cf (3:60cf)
start_script
jump_if_flag_equal EVENT_FLAG_12, $02, .ows_e10e
jump_if_flag_equal EVENT_FLAG_12, $00, NULL
- print_variable_text Text041d, Text041e
+ print_variable_text Gal1WantToTrade1Text, Gal1WantToTrade2Text
script_set_flag_value EVENT_FLAG_12, $01
- ask_question_jump Text041f, .ows_e0eb
- print_text_string Text0420
+ ask_question_jump Gal1WouldYouLikeToTradeText, .ows_e0eb
+ print_text_string Gal1DeclinedTradeText
quit_script_fully
.ows_e0eb
jump_if_card_owned LAPRAS, .ows_e0f3
- print_text_string Text0421
+ print_text_string Gal1DontOwnCardText
quit_script_fully
.ows_e0f3
jump_if_card_in_collection LAPRAS, .ows_e0fb
- print_text_string Text0422
+ print_text_string Gal1CardInDeckText
quit_script_fully
.ows_e0fb
script_set_flag_value EVENT_FLAG_12, $02
- print_text_string Text0423
+ print_text_string Gal1LetsTradeText
run_command Func_ccdc
- tx Text0424
+ tx Gal1TradeCompleteText
take_card LAPRAS
give_card ARCANINE1
show_card_received_screen ARCANINE1
- print_text_string Text0425
+ print_text_string Gal1ThanksText
quit_script_fully
.ows_e10e
- print_text_quit_fully Text0426
+ print_text_quit_fully Gal1AfterTradeText
Script_Lass1: ; e111 (3:6111)
start_script
@@ -4003,7 +4397,7 @@ Script_Lass1: ; e111 (3:6111)
.ows_e12d
print_text_quit_fully Text0429
-Preload_Man2InWaterClubLobby: ; e130 (3:6130)
+Preload_Man2: ; e130 (3:6130)
get_flag_value EVENT_JOSHUA_STATE
cp JOSHUA_BEATEN
ret
@@ -4028,7 +4422,7 @@ WaterClubMovePlayer: ; e13f (3:613f)
ld bc, Script_NotReadyToSeeAmy
jp SetNextNPCAndScript
-WaterClubAfterDuel: ;e157 (3:6157)
+WaterClubAfterDuel: ; e157 (3:6157)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
@@ -4192,7 +4586,7 @@ Script_Joshua: ; e21c (3:621c)
print_variable_text Text0440, Text0441
quit_script_fully
-.startDuel:
+.startDuel
print_text_string Text0442
try_give_pc_pack $04
start_battle PRIZES_4, SOUND_OF_THE_WAVES_DECK_ID, MUSIC_DUEL_THEME_1
@@ -4214,7 +4608,7 @@ Script_BeatJoshua: ; e26c (3:626c)
jump_if_flag_not_equal EVENT_JOSHUA_STATE, JOSHUA_BEATEN, .firstJoshuaWin
quit_script_fully
-.firstJoshuaWin:
+.firstJoshuaWin
script_set_flag_value EVENT_JOSHUA_STATE, JOSHUA_BEATEN
print_text_string Text0449
close_text_box
@@ -4359,7 +4753,6 @@ ScriptJump_TalkToAmyAgain: ; e356 (3:6356)
print_text_string Text0459
start_battle PRIZES_6, GO_GO_RAIN_DANCE_DECK_ID, MUSIC_DUEL_THEME_2
quit_script_fully
-; 0xe369
Script_Clerk4: ; e369 (3:6369)
INCROM $e369, $e36d
@@ -4368,7 +4761,6 @@ LightningClubLobbyAfterDuel: ; e36d (3:636d)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
-; 0xe374
.after_duel_table
db NPC_IMAKUNI
@@ -4376,9 +4768,9 @@ LightningClubLobbyAfterDuel: ; e36d (3:636d)
dw Script_BeatImakuni
dw Script_LostToImakuni
db $00
-; 0xe37B
- INCROM $e37B, $e39a
+Preload_ImakuniInLightningClubLobby: ; e37b (3:637b)
+ INCROM $e37b, $e39a
Script_Chap2: ; e39a (3:639a)
INCROM $e39a, $e3d9
@@ -4387,19 +4779,73 @@ Script_Lass4: ; e3d9 (3:63d9)
INCROM $e3d9, $e3dd
Script_Hood1: ; e3dd (3:63dd)
- INCROM $e3dd, $e408
+ INCROM $e3dd, $e3e8
+
+LightningClubAfterDuel: ; e3e8 (3:63e8)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+
+.after_duel_table
+ db NPC_JENNIFER
+ db NPC_JENNIFER
+ dw Script_BeatJennifer
+ dw Script_LostToJennifer
+
+ db NPC_NICHOLAS
+ db NPC_NICHOLAS
+ dw Script_BeatNicholas
+ dw Script_LostToNicholas
+
+ db NPC_BRANDON
+ db NPC_BRANDON
+ dw Script_BeatBrandon
+ dw Script_LostToBrandon
+
+ db NPC_ISAAC
+ db NPC_ISAAC
+ dw Script_BeatIsaac
+ dw Script_LostToIsaac
+ db $00
Script_Jennifer: ; e408 (3:6408)
- INCROM $e408, $e42f
+ INCROM $e408, $e41d
+
+Script_BeatJennifer: ; e41d (3:641d)
+ INCROM $e41d, $e42b
+
+Script_LostToJennifer: ; e42b (3:642b)
+ INCROM $e42b, $e42f
Script_Nicholas: ; e42f (3:642f)
- INCROM $e42f, $e456
+ INCROM $e42f, $e444
+
+Script_BeatNicholas: ; e444 (3:6444)
+ INCROM $e444, $e452
+
+Script_LostToNicholas: ; e452 (3:6452)
+ INCROM $e452, $e456
Script_Brandon: ; e456 (3:6456)
- INCROM $e456, $e4ad
+ INCROM $e456, $e480
+
+Script_BeatBrandon: ; e480 (3:6480)
+ INCROM $e480, $e490
+
+Script_LostToBrandon: ; e490 (3:6490)
+ INCROM $e490, $e494
+
+Preload_Isaac: ; e494 (3:6494)
+ INCROM $e494, $e4ad
Script_Isaac: ; e4ad (3:64ad)
- INCROM $e4ad, $e525
+ INCROM $e4ad, $e4e1
+
+Script_BeatIsaac: ; e4e1 (3:64e1)
+ INCROM $e4e1, $e4fb
+
+Script_LostToIsaac: ; e4fb (3:64fb)
+ INCROM $e4fb, $e525
GrassClubEntranceAfterDuel: ; e525 (3:6525)
ld hl, GrassClubEntranceAfterDuelTable
@@ -4439,8 +4885,8 @@ FindEndOfBattleScript: ; e52c (3:652c)
GrassClubEntranceAfterDuelTable: ; e553 (3:6553)
db NPC_MICHAEL
db NPC_MICHAEL
- dw $6597
- dw $65ab
+ dw Script_BeatMichaelInGrassClubEntrance
+ dw Script_LostToMichaelInGrassClubEntrance
db NPC_RONALD2
db NPC_RONALD2
@@ -4454,10 +4900,19 @@ GrassClubEntranceAfterDuelTable: ; e553 (3:6553)
db $00
Script_Clerk5: ; e566 (3:6566)
- INCROM $e566, $e573
+ INCROM $e566, $e56a
+
+Preload_MichaelInGrassClubEntrance: ; e56a (3:656a)
+ INCROM $e56a, $e573
Script_Michael: ; e573 (3:6573)
- INCROM $e573, $e5c4
+ INCROM $e573, $e597
+
+Script_BeatMichaelInGrassClubEntrance: ; e597 (3:6597)
+ INCROM $e597, $e5ab
+
+Script_LostToMichaelInGrassClubEntrance: ; e5ab (3:65ab)
+ INCROM $e5ab, $e5c4
GrassClubLobbyAfterDuel: ; e5c4 (3:65c4)
ld hl, .after_duel_table
@@ -4589,22 +5044,67 @@ Script_Lass2: ; e61f (3:661f)
give_card BLASTOISE
show_card_received_screen BLASTOISE
print_text_quit_fully Text06f3
-; 0xe6d8
Script_Granny2: ; e6d8 (3:66d8)
- INCROM $e6d8, $e6e3
+ INCROM $e6d8, $e6dc
+
+Preload_Gal2: ; e6dc (3:66dc)
+ INCROM $e6dc, $e6e3
Script_Gal2: ; e6e3 (3:66e3)
- INCROM $e6e3, $e701
+ INCROM $e6e3, $e6e7
+
+GrassClubAfterDuel: ; e6e7 (3:66e7)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+
+.after_duel_table
+ db NPC_KRISTIN
+ db NPC_KRISTIN
+ dw Script_BeatKristin
+ dw Script_LostToKristin
+
+ db NPC_HEATHER
+ db NPC_HEATHER
+ dw Script_BeatHeather
+ dw Script_LostToHeather
+
+ db NPC_NIKKI
+ db NPC_NIKKI
+ dw Script_BeatNikki
+ dw Script_LostToNikki
+ db $00
Script_Kristin: ; e701 (3:6701)
- INCROM $e701, $e745
+ INCROM $e701, $e71c
+
+Script_BeatKristin: ; e71c (3:671c)
+ INCROM $e71c, $e741
+
+Script_LostToKristin: ; e741 (3:6741)
+ INCROM $e741, $e745
Script_Heather: ; e745 (3:6745)
- INCROM $e745, $e79e
+ INCROM $e745, $e760
+
+Script_BeatHeather: ; e760 (3:6760)
+ INCROM $e760, $e78a
+
+Script_LostToHeather: ; e78a (3:678a)
+ INCROM $e78a, $e796
+
+Preload_NikkiInGrassClub: ; e796 (3:6796)
+ INCROM $e796, $e79e
Script_Nikki: ; e79e (3:679e)
- INCROM $e79e, $e7f6
+ INCROM $e79e, $e7d3
+
+Script_BeatNikki: ; e7d3 (3:67d3)
+ INCROM $e7d3, $e7f2
+
+Script_LostToNikki: ; e7f2 (3:67f2)
+ INCROM $e7f2, $e7f6
ClubEntranceAfterDuel: ; e7f6 (3:67f6)
ld hl, .after_duel_table
@@ -4640,7 +5140,7 @@ TryFirstRonaldEncounter: ; e813 (3:6813)
TryFirstRonaldFight: ; e822 (3:6822)
ld a, NPC_RONALD2
- ld [$d3ab], a
+ ld [wTempNPC], a
call FindLoadedNPC
ret c
get_flag_value EVENT_FLAG_4C
@@ -4651,7 +5151,7 @@ TryFirstRonaldFight: ; e822 (3:6822)
TrySecondRonaldFight: ; e837 (3:6837)
ld a, NPC_RONALD3
- ld [$d3ab], a
+ ld [wTempNPC], a
call FindLoadedNPC
ret c
get_flag_value EVENT_FLAG_4D
@@ -4659,13 +5159,15 @@ TrySecondRonaldFight: ; e837 (3:6837)
ret nz
ld bc, ScriptSecondRonaldFight
jp SetNextNPCAndScript
-; 0xe84c
Script_Clerk6: ; e84c (3:684c)
INCROM $e84c, $e850
Script_Lad3: ; e850 (3:6850)
- INCROM $e850, $e862
+ INCROM $e850, $e85b
+
+Preload_Ronald1InClubEntrance: ; e85b (3:685b)
+ INCROM $e85b, $e862
Script_FirstRonaldEncounter: ; e862 (3:6862)
start_script
@@ -4701,8 +5203,8 @@ NPCMovement_e894: ; e894 (3:6894)
db SOUTH
db SOUTH
db $ff
-; e89a
+Preload_Ronald2InClubEntrance: ; e89a (3:689a)
INCROM $e89a, $e8c0
Script_FirstRonaldFight: ; e8c0 (3:68c0)
@@ -4711,9 +5213,10 @@ Script_FirstRonaldFight: ; e8c0 (3:68c0)
do_frames $3c
move_active_npc NPCMovement_e90d
print_text_string Text064a
- jump_if_player_coords_match $08, $02, $68d6
+ jump_if_player_coords_match $08, $02, .ows_e8d6
set_player_direction WEST
move_player WEST, 1
+.ows_e8d6
set_player_direction SOUTH
move_player SOUTH, 1
move_player SOUTH, 1
@@ -4763,8 +5266,8 @@ NPCMovement_e90f: ; e90f (3:690f)
db SOUTH
db SOUTH
db $ff
-; e915
+Preload_Ronald3InClubEntrance: ; e915 (3:6915)
INCROM $e915, $e91e
ScriptSecondRonaldFight: ; e91e (3:691e)
@@ -4804,58 +5307,105 @@ ScriptJump_FinishedSecondRonaldFight: ; e959 (3:6959)
run_command Func_cdcb
run_command Func_d41d
quit_script_fully
-; 0xe963
-
PsychicClubLobbyAfterDuel: ; e963 (3:6963)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
-; 0xe96a
.after_duel_table
-
db NPC_ROBERT
db NPC_ROBERT
- dw $6995
- dw $69a1
+ dw Script_BeatRobert
+ dw Script_LostToRobert
db $00
+PsychicClubLobbyLoadMap: ; e971 (3:6971)
INCROM $e971, $e980
Script_Robert: ; e980 (3:6980)
- INCROM $e980, $e9a5
+ INCROM $e980, $e995
+
+Script_BeatRobert: ; e995 (3:6995)
+ INCROM $e995, $e9a1
+
+Script_LostToRobert: ; e9a1 (3:69a1)
+ INCROM $e9a1, $e9a5
Script_Pappy1: ; e9a5 (3:69a5)
- INCROM $e9a5, $ea30
+ INCROM $e9a5, $e9f7
+
+Preload_Ronald1InPsychicClubLobby: ; e9f7 (3:69f7)
+ INCROM $e9f7, $ea30
Script_Gal3: ; ea30 (3:6a30)
INCROM $ea30, $ea3b
Script_Chap4: ; ea3b (3:6a3b)
- INCROM $ea3b, $ea60
+ INCROM $ea3b, $ea46
+
+PsychicClubAfterDuel: ; ea46 (3:6a46)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+
+.after_duel_table
+ db NPC_DANIEL
+ db NPC_DANIEL
+ dw Script_BeatDaniel
+ dw Script_LostToDaniel
+
+ db NPC_STEPHANIE
+ db NPC_STEPHANIE
+ dw Script_BeatStephanie
+ dw Script_LostToStephanie
+
+ db NPC_MURRAY1
+ db NPC_MURRAY1
+ dw Script_BeatMurray
+ dw Script_LostToMurray
+ db $00
Script_Daniel: ; ea60 (3:6a60)
- INCROM $ea60, $eaa2
+ INCROM $ea60, $ea92
+
+Script_BeatDaniel: ; ea92 (3:6a92)
+ INCROM $ea92, $ea9e
+
+Script_LostToDaniel: ; ea9e (3:6a9e)
+ INCROM $ea9e, $eaa2
Script_Stephanie: ; eaa2 (3:6aa2)
- INCROM $eaa2, $eadf
+ INCROM $eaa2, $eac0
+
+Script_BeatStephanie: ; eac0 (3:6ac0)
+ INCROM $eac0, $eacc
+
+Script_LostToStephanie: ; eacc (3:6acc)
+ INCROM $eacc, $ead0
+
+Preload_Murray2: ; ead0 (3:6ad0)
+ INCROM $ead0, $eada
-Script_Murray2: ; eadf (3:6adf)
- INCROM $eadf, $eadf
+Preload_Murray1: ; eada (3:6ada)
+ INCROM $eada, $eadf
-Script_Murray1: ; eadf (3:6adf)
- INCROM $eadf, $eb53
+Script_Murray: ; eadf (3:6adf)
+ INCROM $eadf, $eb0f
+
+Script_BeatMurray: ; eb0f (3:6b0f)
+ INCROM $eb0f, $eb29
+
+Script_LostToMurray: ; eb29 (3:6b29)
+ INCROM $eb29, $eb53
Script_Clerk7: ; eb53 (3:6b53)
INCROM $eb53, $eb57
-
ScienceClubLobbyAfterDuel:; eb57 (3:6b57)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
-; 0xeb5e
.after_duel_table
db NPC_IMAKUNI
@@ -4863,8 +5413,8 @@ ScienceClubLobbyAfterDuel:; eb57 (3:6b57)
dw Script_BeatImakuni
dw Script_LostToImakuni
db $00
-; 0xeb65
+Preload_ImakuniInScienceClubLobby: ; eb65 (3:6b65)
INCROM $eb65, $eb84
Script_Lad1: ; eb84 (3:6b84)
@@ -4877,19 +5427,73 @@ Script_Specs2: ; ebc5 (3:6bc5)
INCROM $ebc5, $ebed
Script_Specs3: ; ebed (3:6bed)
- INCROM $ebed, $ec11
+ INCROM $ebed, $ebf1
+
+ScienceClubAfterDuel: ; ebf1 (3:6bf1)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+
+.after_duel_table
+ db NPC_JOSEPH
+ db NPC_JOSEPH
+ dw Script_BeatJoseph
+ dw Script_LostToJoseph
+
+ db NPC_DAVID
+ db NPC_DAVID
+ dw Script_BeatDavid
+ dw Script_LostToDavid
+
+ db NPC_ERIK
+ db NPC_ERIK
+ dw Script_BeatErik
+ dw Script_LostToErik
+
+ db NPC_RICK
+ db NPC_RICK
+ dw Script_BeatRick
+ dw Script_LostToRick
+ db $00
Script_David: ; ec11 (3:6c11)
- INCROM $ec11, $ec42
+ INCROM $ec11, $ec2f
+
+Script_BeatDavid: ; ec2f (3:6c2f)
+ INCROM $ec2f, $ec3e
+
+Script_LostToDavid: ; ec3e (3:6c3e)
+ INCROM $ec3e, $ec42
Script_Erik: ; ec42 (3:6c42)
- INCROM $ec42, $ec67
+ INCROM $ec42, $ec57
+
+Script_BeatErik: ; ec57 (3:6c57)
+ INCROM $ec57, $ec63
+
+Script_LostToErik: ; ec63 (3:6c63)
+ INCROM $ec63, $ec67
Script_Rick: ; ec67 (3:6c67)
- INCROM $ec67, $ecdb
+ INCROM $ec67, $ec80
+
+Script_BeatRick: ; ec80 (3:6c80)
+ INCROM $ec80, $ec9a
+
+Script_LostToRick: ; ec9a (3:6c9a)
+ INCROM $ec9a, $ecc4
+
+Preload_Joseph: ; ecc4 (3:6cc4)
+ INCROM $ecc4, $ecdb
Script_Joseph: ; ecdb (3:6cdb)
- INCROM $ecdb, $ed45
+ INCROM $ecdb, $ecf6
+
+Script_BeatJoseph: ; ecf6 (3:6cf6)
+ INCROM $ecf6, $ed1c
+
+Script_LostToJoseph: ; ed1c (3:6d1c)
+ INCROM $ed1c, $ed45
Script_Clerk8: ; ed45 (3:6d45)
INCROM $ed45, $ed49
@@ -4898,17 +5502,14 @@ FireClubLobbyAfterDuel: ; ed49 (3:6d49)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
-; 0xed50
.after_duel_table
db NPC_JESSICA
db NPC_JESSICA
- dw $6dba
- dw $6dce
+ dw Script_BeatJessicaInFireClubLobby
+ dw Script_LostToJessicaInFireClubLobby
db $00
-; 0xed57
-
FireClubPressedA: ; ed57 (3:6d57)
ld hl, SlowpokePaintingObjectTable
call FindExtraInteractableObjects
@@ -4953,15 +5554,24 @@ FindExtraInteractableObjects: ; ed64 (3:6d64)
call SetNextScript
scf
ret
-; 0xed8d
+Preload_JessicaInFireClubLobby: ; ed8d (3:6d8d)
INCROM $ed8d, $ed96
Script_Jessica: ; ed96 (3:6d96)
- INCROM $ed96, $ede8
+ INCROM $ed96, $edba
+
+Script_BeatJessicaInFireClubLobby: ; edba (3:6dba)
+ INCROM $edba, $edce
+
+Script_LostToJessicaInFireClubLobby: ; edce (3:6dce)
+ INCROM $edce, $ede8
Script_Chap3: ; ede8 (3:6de8)
- INCROM $ede8, $ee2c
+ INCROM $ede8, $ee25
+
+Preload_Lad2: ; ee25 (3:6e25)
+ INCROM $ee25, $ee2c
Script_Lad2: ; ee2c (3:6e2c)
INCROM $ee2c, $ee76
@@ -4974,17 +5584,15 @@ Script_ee76: ; ee76 (3:6e76)
.ows_ee7d
script_set_flag_value EVENT_FLAG_21, $02
run_command Func_ccdc
- tx Text06a2
+ tx FoundLv9SlowpokeText
give_card SLOWPOKE1
show_card_received_screen SLOWPOKE1
quit_script_fully
-; 0xee88
Script_Mania: ; ee88 (3:6e88)
INCROM $ee88, $ee93
-
-FireClubAfterDuel: ;ee93 (3:6e93)
+FireClubAfterDuel: ; ee93 (3:6e93)
ld hl, .after_duel_table
call FindEndOfBattleScript
ret
@@ -4992,35 +5600,51 @@ FireClubAfterDuel: ;ee93 (3:6e93)
.after_duel_table
db NPC_JOHN
db NPC_JOHN
- dw $6ec8
- dw $6ed4
+ dw Script_BeatJohn
+ dw Script_LostToJohn
db NPC_ADAM
db NPC_ADAM
- dw $6eed
- dw $6ef9
+ dw Script_BeatAdam
+ dw Script_LostToAdam
db NPC_JONATHAN
db NPC_JONATHAN
- dw $6f12
- dw $6f1e
+ dw Script_BeatJonathan
+ dw Script_LostToJonathan
db NPC_KEN
db NPC_KEN
dw Script_BeatKen
- dw Script_LoseToKen
-
+ dw Script_LostToKen
db $00
-; 0xeeb3
Script_John: ; eeb3 (3:6eb3)
- INCROM $eeb3, $eed8
+ INCROM $eeb3, $eec8
+
+Script_BeatJohn: ; eec8 (3:6ec8)
+ INCROM $eec8, $eed4
+
+Script_LostToJohn: ; eed4 (3:6ed4)
+ INCROM $eed4, $eed8
Script_Adam: ; eed8 (3:6ed8)
- INCROM $eed8, $eefd
+ INCROM $eed8, $eeed
+
+Script_BeatAdam: ; eeed (3:6eed)
+ INCROM $eeed, $eef9
+
+Script_LostToAdam: ; eef9 (3:6ef9)
+ INCROM $eef9, $eefd
Script_Jonathan: ; eefd (3:6efd)
- INCROM $eefd, $ef22
+ INCROM $eefd, $ef12
+
+Script_BeatJonathan: ; ef12 (3:6f12)
+ INCROM $ef12, $ef1e
+
+Script_LostToJonathan: ; ef1e (3:6f1e)
+ INCROM $ef1e, $ef22
Script_Ken: ; ef22 (3:6f22)
start_script
@@ -5044,7 +5668,6 @@ Script_Ken: ; ef22 (3:6f22)
print_text_string Text06c0
start_battle PRIZES_6, FIRE_CHARGE_DECK_ID, MUSIC_DUEL_THEME_2
quit_script_fully
-; 0xef5e
Script_BeatKen: ; ef5e (3:6f5e)
start_script
@@ -5061,16 +5684,12 @@ Script_BeatKen: ; ef5e (3:6f5e)
give_booster_packs BOOSTER_MYSTERY_NEUTRAL, BOOSTER_MYSTERY_NEUTRAL, NO_BOOSTER
print_text_string Text06c3
quit_script_fully
-; 0xef78
-
-
-Script_LoseToKen: ; ef78 (3:6f78)
+Script_LostToKen: ; ef78 (3:6f78)
start_script
jump_if_flag_zero_2 EVENT_FLAG_0A, NULL
print_variable_text Text06c4, Text06c5
quit_script_fully
-; 0xef83
Script_KenBattle_AlreadyHaveMedal: ; ef83 (3:6f83)
print_text_string Text06c6
@@ -5080,7 +5699,6 @@ Script_KenBattle_AlreadyHaveMedal: ; ef83 (3:6f83)
print_text_string Text06c7
start_battle PRIZES_6, FIRE_CHARGE_DECK_ID, MUSIC_DUEL_THEME_2
quit_script_fully
-; 0xef96
Preload_Clerk9: ; ef96 (3:6f96)
call TryGiveMedalPCPacks
@@ -5211,7 +5829,7 @@ ChallengeHallLobbyLoadMap: ; f088 (3:7088)
ld a, $02
ld [wTempNPC], a
call FindLoadedNPC
- ld bc, $7166
+ ld bc, Script_f166
jp SetNextNPCAndScript
Script_Pappy3: ; f09c (3:709c)
@@ -5316,10 +5934,19 @@ Func_f121: ; f121 (3:7121)
ret
Unknown_f146: ; f146 (3:7146)
- INCROM $f146, $f156
+ db $01, $00, EVENT_FLAG_50, $01
+ db $03, $03, EVENT_FLAG_51, $02
+ db $07, $03, EVENT_FLAG_52, $03
+ db $07, $00, EVENT_FLAG_53, $04
Unknown_f156: ; f156 (3:7156)
- INCROM $f156, $f239
+ db $01, $00, EVENT_FLAG_54, $05
+ db $03, $03, EVENT_FLAG_55, $06
+ db $07, $03, EVENT_FLAG_56, $07
+ db $07, $00, EVENT_FLAG_57, $08
+
+Script_f166: ; f166 (3:7166)
+ INCROM $f166, $f239
ChallengeHallAfterDuel: ; f239 (3:7239)
ld c, $00
@@ -5460,7 +6087,6 @@ Script_Clerk12: ; f295 (3:7295)
set_next_npc_and_script $4a, Script_f353
end_script_loop
ret
-; f349
NPCMovement_f349: ; f349 (3:7349)
db NORTH
@@ -5770,7 +6396,6 @@ ScriptJump_f4db: ; f4db (3:74db)
set_next_npc_and_script NPC_CLERK12, Script_f3e9
end_script_loop
ret
-; f559
; Loads the NPC to fight at the challenge hall
Preload_ChallengeHallOpponent: ; f559 (3:7559)
@@ -5796,50 +6421,87 @@ Preload_ChallengeHallOpponent: ; f559 (3:7559)
Func_f580: ; f580 (3:7580)
get_flag_value EVENT_FLAG_44
cp $3
- jr z, .asm_f596
+ jr z, .pick_challenger_include_ronald
get_flag_value EVENT_FLAG_45
cp $3
- ld d, $18
- jr nz, .asm_f598
- ld a, $2
- jr .asm_f5ac
+ ld d, ChallengeHallNPCsEnd - ChallengeHallNPCs - 1 ; discount Ronald
+ jr nz, .pick_challenger
+ ld a, NPC_RONALD1
+ jr .force_ronald
-.asm_f596
- ld d, $19
+.pick_challenger_include_ronald
+ ld d, ChallengeHallNPCsEnd - ChallengeHallNPCs
-.asm_f598
+.pick_challenger
ld a, d
call Random
ld c, a
- call $75cc
- jr c, .asm_f598
- call $75d4
+ call Func_f5cc
+ jr c, .pick_challenger
+ call Func_f5d4
ld b, $0
- ld hl, $75b3
+ ld hl, ChallengeHallNPCs
add hl, bc
ld a, [hl]
-.asm_f5ac
+.force_ronald
ld [wTempNPC], a
ld [wd696], a
ret
-; 0xf5b3
- INCROM $f5b3, $f5db
+ChallengeHallNPCs: ; f5b3 (3:75b3)
+ db NPC_CHRIS
+ db NPC_MICHAEL
+ db NPC_JESSICA
+ db NPC_MATTHEW
+ db NPC_RYAN
+ db NPC_ANDREW
+ db NPC_SARA
+ db NPC_AMANDA
+ db NPC_JOSHUA
+ db NPC_JENNIFER
+ db NPC_NICHOLAS
+ db NPC_BRANDON
+ db NPC_BRITTANY
+ db NPC_KRISTIN
+ db NPC_HEATHER
+ db NPC_ROBERT
+ db NPC_DANIEL
+ db NPC_STEPHANIE
+ db NPC_JOSEPH
+ db NPC_DAVID
+ db NPC_ERIK
+ db NPC_JOHN
+ db NPC_ADAM
+ db NPC_JONATHAN
+ db NPC_RONALD1
+ChallengeHallNPCsEnd:
+
+Func_f5cc: ; f5cc (3:75cc)
+ INCROM $f5cc, $f5d4
+
+Func_f5d4: ; f5d4 (3:75d4)
+ INCROM $f5d4, $f5db
Func_f5db: ; f5db (3:75db)
xor a
- ld [$d698], a
- ld [$d699], a
- ld [$d69a], a
- ld [$d69b], a
+ ld [wd698], a
+ ld [wd699], a
+ ld [wd69a], a
+ ld [wd69b], a
ret
; 0xf5e9
INCROM $f5e9, $f602
Func_f602: ; f602 (3:7602)
- INCROM $f602, $f631
+ INCROM $f602, $f607
+
+PokemonDomeEntranceLoadMap: ; f607 (3:7607)
+ INCROM $f607, $f62a
+
+PokemonDomeEntranceCloseTextBox: ; f62a (3:762a)
+ INCROM $f62a, $f631
Script_f631: ; f631 (3:7631)
start_script
@@ -5851,7 +6513,51 @@ Script_f631: ; f631 (3:7631)
ret
.ows_f63c
- INCROM $f63c, $f71f
+ INCROM $f63c, $f6af
+
+Script_f6af: ; f6af (3:76af)
+ INCROM $f6af, $f6c6
+
+PokemonDomeMovePlayer: ; f6c6 (3:76c6)
+ INCROM $f6c6, $f6e0
+
+PokemonDomeAfterDuel: ; f6e0 (3:76e0)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+
+.after_duel_table
+ db NPC_COURTNEY
+ db NPC_COURTNEY
+ dw Script_BeatCourtney
+ dw Script_LostToCourtney
+
+ db NPC_STEVE
+ db NPC_STEVE
+ dw Script_BeatSteve
+ dw Script_LostToSteve
+
+ db NPC_JACK
+ db NPC_JACK
+ dw Script_BeatJack
+ dw Script_LostToJack
+
+ db NPC_ROD
+ db NPC_ROD
+ dw Script_BeatRod
+ dw Script_LostToRod
+
+ db NPC_RONALD1
+ db NPC_RONALD1
+ dw Script_BeatRonald1InPokemonDome
+ dw Script_LostToRonald1InPokemonDome
+ db $00
+
+PokemonDomeLoadMap: ; f706 (3:7706)
+ INCROM $f706, $f718
+
+PokemonDomeCloseTextBox: ; f718 (3:7718)
+ INCROM $f718, $f71f
Script_Courtney: ; f71f (3:771f)
INCROM $f71f, $f72a
@@ -5863,14 +6569,59 @@ Script_Jack: ; f735 (3:7735)
INCROM $f735, $f740
Script_Rod: ; f740 (3:7740)
- INCROM $f740, $fbdb
+ INCROM $f740, $f74b
+
+Preload_Courtney: ; f74b (3:774b)
+ INCROM $f74b, $f78c
+
+Preload_Steve: ; f78c (3:778c)
+ INCROM $f78c, $f7a3
+
+Preload_Jack: ; f7a3 (3:77a3)
+ INCROM $f7a3, $f7ba
+
+Preload_Rod: ; f7ba (3:77ba)
+ INCROM $f7ba, $f7d6
+
+Preload_Ronald1InPokemonDome: ; f7d6 (3:77d6)
+ INCROM $f7d6, $f93f
+
+Script_LostToCourtney: ; f93f (3:793f)
+ INCROM $f93f, $f95a
+
+Script_BeatCourtney: ; f95a (3:795a)
+ INCROM $f95a, $f9b7
+
+Script_LostToSteve: ; f9b7 (3:79b7)
+ INCROM $f9b7, $f9c8
+
+Script_BeatSteve: ; f9c8 (3:79c8)
+ INCROM $f9c8, $fa23
+
+Script_LostToJack: ; fa23 (3:7a23)
+ INCROM $fa23, $fa34
+
+Script_BeatJack: ; fa34 (3:7a34)
+ INCROM $fa34, $fa98
+
+Script_LostToRod: ; fa98 (3:7a98)
+ INCROM $fa98, $faae
+
+Script_BeatRod: ; faae (3:7aae)
+ INCROM $faae, $fb48
+
+Script_LostToRonald1InPokemonDome: ; fb48 (3:7b48)
+ INCROM $fb48, $fb53
+
+Script_BeatRonald1InPokemonDome: ; fb53 (3:7b53)
+ INCROM $fb53, $fbdb
HallOfHonorLoadMap: ; fbdb (3:7bdb)
ld a, SFX_10
call PlaySFX
ret
-; 0xfbe1
+Script_fbe1: ; fbe1 (3:7be1)
INCROM $fbe1, $fbf1
Script_fbf1: ; fbf1 (3:7bf1)
@@ -5929,16 +6680,16 @@ Func_fc2b: ; fc2b (3:7c2b)
ld c, [hl]
inc hl
ld b, [hl]
- ld a, $b0
+ ld a, LOW(ClerkNPCName_)
ld [wCurrentNPCNameTx], a
- ld a, $3
+ ld a, HIGH(ClerkNPCName_)
ld [wCurrentNPCNameTx+1], a
jp SetNextScript
PointerTable_fc4c: ; fc4c (3:7c4c)
- dw Unknown_fc64
- dw Unknown_fc68
- dw Unknown_fc60
+ dw Script_fc64
+ dw Script_fc68
+ dw Script_fc60
Script_fc52: ; fc52 (3:7c52)
start_script
@@ -5950,14 +6701,17 @@ Script_fc52: ; fc52 (3:7c52)
run_command Func_cd76
quit_script_fully
-Unknown_fc60: ; fc60 (3:7c60)
- INCROM $fc60, $fc64
+Script_fc60: ; fc60 (3:7c60)
+ start_script
+ print_text_quit_fully Text06ca
-Unknown_fc64: ; fc64 (3:7c64)
- INCROM $fc64, $fc68
+Script_fc64: ; fc64 (3:7c64)
+ start_script
+ print_text_quit_fully Text06cb
-Unknown_fc68: ; fc68 (3:7c68)
- INCROM $fc68, $fc6c
+Script_fc68: ; fc68 (3:7c68)
+ start_script
+ print_text_quit_fully Text06cc
; Clerk looks away from you if you can't use infrared
; This is one of the preloads that does not change whether or not they appear
@@ -6036,7 +6790,7 @@ NPCMovement_fce1: ; fce1 (3:7ce1)
NPCMovement_fce3: ; fce3 (3:7ce3)
db NORTH | NO_MOVE
db $ff
-; fce5
+; 0xfce5
rept $31b
db $ff
diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm
index e4db318..db3ae26 100644
--- a/src/engine/bank04.asm
+++ b/src/engine/bank04.asm
@@ -28,13 +28,13 @@ Func_10031: ; 10031 (4:4031)
push af
ld a, $1
call BankswitchSRAM
- call $4cbb
+ call Func_10cbb
call DisableSRAM
- call $4b28
+ call Func_10b28
call FlushAllPalettes
call EnableLCD
call DoFrameIfLCDEnabled
- call $4cea
+ call Func_10cea
call FlushAllPalettes
pop af
call BankswitchSRAM
@@ -45,7 +45,13 @@ Func_10059: ; 10059 (4:4059)
INCROM $10059, $100a2
Func_100a2: ; 100a2 (4:40a2)
- INCROM $100a2, $1029e
+ INCROM $100a2, $1010c
+
+Func_1010c: ; 1010c (4:410c)
+ INCROM $1010c, $10197
+
+Func_10197: ; 10197 (4:4197)
+ INCROM $10197, $1029e
Medal_1029e: ; 1029e (4:429e)
sub $8
@@ -59,22 +65,22 @@ Medal_1029e: ; 1029e (4:429e)
call PlaySong
farcall Func_70000
call DisableLCD
- call $4000
+ call Func_10000
ld a, $fa
ld [wd114], a
- call $410c
+ call Func_1010c
pop bc
ld a, c
add a
ld c, a
ld b, $0
- ld hl, Unknown_1030b
+ ld hl, MasterMedalNames
add hl, bc
ld a, [hli]
ld [wTxRam2], a
ld a, [hl]
ld [wTxRam2 + 1], a
- call $4031
+ call Func_10031
ld a, MUSIC_MEDAL
call PlaySong
ld a, $ff
@@ -86,7 +92,7 @@ Medal_1029e: ; 1029e (4:429e)
ld [wd116], a
and $f
jr nz, .asm_102e2
- call $4197
+ call Func_10197
ld a, [wd116]
cp $e0
jr nz, .asm_102e2
@@ -98,8 +104,15 @@ Medal_1029e: ; 1029e (4:429e)
ld [wd291], a
ret
-Unknown_1030b: ; 1030b (4:430b)
- INCROM $1030b, $1031b
+MasterMedalNames: ; 1030b (4:430b)
+ tx GrassClubMapNameText
+ tx ScienceClubMapNameText
+ tx FireClubMapNameText
+ tx WaterClubMapNameText
+ tx LightningClubMapNameText
+ tx PsychicClubMapNameText
+ tx RockClubMapNameText
+ tx FightingClubMapNameText
BoosterPack_1031b: ; 1031b (4:431b)
ld c, a
@@ -107,25 +120,25 @@ BoosterPack_1031b: ; 1031b (4:431b)
push af
push bc
call DisableLCD
- call $4000
+ call Func_10000
xor a
ld [wTextBoxFrameType], a
pop bc
push bc
ld b, $0
- ld hl, $43a5
+ ld hl, Unknown_103a5
add hl, bc
ld a, [hl]
ld c, a
add a
add a
ld c, a
- ld hl, $43c2
+ ld hl, Unknown_103c2
add hl, bc
ld a, [hli]
push hl
ld bc, $0600
- call $70ca
+ call Func_130ca
pop hl
ld a, [hli]
ld [wTxRam3], a
@@ -135,7 +148,7 @@ BoosterPack_1031b: ; 1031b (4:431b)
ld [wTxRam2], a
ld a, [hl]
ld [wTxRam2 + 1], a
- call $4031
+ call Func_10031
call PauseSong
ld a, MUSIC_BOOSTER_PACK
call PlaySong
@@ -166,9 +179,12 @@ BoosterPack_1031b: ; 1031b (4:431b)
pop af
ld [wd291], a
ret
-; 0x103a5
- INCROM $103a5, $103d2
+Unknown_103a5: ; 103a5 (4:43a5)
+ INCROM $103a5, $103c2
+
+Unknown_103c2: ; 103c2 (4:43c2)
+ INCROM $103c2, $103d2
Func_103d2: ; 103d2 (4:43d2)
INCROM $103d2, $103d3
@@ -177,7 +193,7 @@ Duel_Init: ; 103d3 (4:43d3)
ld a, [wd291]
push af
call DisableLCD
- call $4000
+ call Func_10000
ld a, $4
ld [wTextBoxFrameType], a
lb de, 0, 12
@@ -188,7 +204,7 @@ Duel_Init: ; 103d3 (4:43d3)
add a
ld c, a
ld b, $0
- ld hl, $445b
+ ld hl, Unknown_1045b
add hl, bc
ld a, [hli]
ld [wTxRam2], a
@@ -199,8 +215,8 @@ Duel_Init: ; 103d3 (4:43d3)
ld [wTxRam2_b], a
ld a, [wOpponentName + 1]
ld [wTxRam2_b + 1], a
- ld hl, $4451
- call $51b3 ; LoadDuelistName
+ ld hl, Unknown_10451
+ call Func_111b3 ; LoadDuelistName
pop hl
ld a, [hli]
ld [wTxRam2], a
@@ -209,8 +225,8 @@ Duel_Init: ; 103d3 (4:43d3)
ld [wTxRam2 + 1], a
or c
jr z, .asm_10425
- ld hl, $4456
- call $51b3 ; LoadDeckName
+ ld hl, Unknown_10456
+ call Func_111b3 ; LoadDeckName
.asm_10425
ld bc, $0703
@@ -218,7 +234,7 @@ Duel_Init: ; 103d3 (4:43d3)
call Func_3e2a ; LoadDuelistPortrait
ld a, [wMatchStartTheme]
call PlaySong
- call $4031
+ call Func_10031
call DoFrameIfLCDEnabled
lb bc, $2f, $1d ; cursor tile, tile behind cursor
lb de, 18, 17 ; x, y
@@ -229,9 +245,15 @@ Duel_Init: ; 103d3 (4:43d3)
pop af
ld [wd291], a
ret
-; 0x10451
- INCROM $10451, $10548
+Unknown_10451: ; 10451 (4:4451)
+ INCROM $10451, $10456
+
+Unknown_10456: ; 10456 (4:4456)
+ INCROM $10456, $1045b
+
+Unknown_1045b: ; 1045b (4:445b)
+ INCROM $1045b, $10548
Func_10548: ; 10548 (4:4548)
INCROM $10548, $10756
@@ -284,7 +306,10 @@ Func_10ab4: ; 10ab4 (4:4ab4)
INCROM $10ab4, $10af9
Func_10af9: ; 10af9 (4:4af9)
- INCROM $10af9, $10c96
+ INCROM $10af9, $10b28
+
+Func_10b28: ; 10b28 (4:4b28)
+ INCROM $10b28, $10c96
Func_10c96: ; 10c96 (4:4c96)
ldh a, [hBankSRAM]
@@ -292,13 +317,13 @@ Func_10c96: ; 10c96 (4:4c96)
push bc
ld a, $1
call BankswitchSRAM
- call $4cbb
+ call Func_10cbb
call Func_10ab4
pop bc
ld a, c
or a
jr nz, .asm_10cb0
- call $4cea
+ call Func_10cea
call Func_10af9
.asm_10cb0
@@ -307,15 +332,18 @@ Func_10c96: ; 10c96 (4:4c96)
call BankswitchSRAM
call DisableSRAM
ret
-; 0x10cbb
- INCROM $10cbb, $10dba
+Func_10cbb: ; 10cbb (4:4cbb)
+ INCROM $10cbb, $10cea
+
+Func_10cea: ; 10cea (4:4cea)
+ INCROM $10cea, $10dba
Func_10dba: ; 10dba (4:4dba)
ld a, $1
farcall Func_c29b
ld a, [wd0ba]
- ld hl, $4e17
+ ld hl, Unknown_10e17
farcall Func_111e9
.asm_10dca
call DoFrameIfLCDEnabled
@@ -331,15 +359,18 @@ Func_10dba: ; 10dba (4:4dba)
.asm_10ddd
ld [wd10e], a
push af
- ld hl, $4df0
+ ld hl, Unknown_10df0
call JumpToFunctionInTable
farcall CloseTextBox
call DoFrameIfLCDEnabled
pop af
ret
-; 0x10df0
- INCROM $10df0, $10e28
+Unknown_10df0: ; 10df0 (4:4df0)
+ INCROM $10df0, $10e17
+
+Unknown_10e17: ; 10e17 (4:4e17)
+ INCROM $10e17, $10e28
Func_10e28: ; 10e28 (4:4e28)
INCROM $10e28, $10e55
@@ -788,12 +819,15 @@ Func_11184: ; 11184 (4:5184)
ld hl, wd341
dec [hl]
ret
-; 0x111b3
+Func_111b3: ; 111b3 (4:51b3)
INCROM $111b3, $111e9
Func_111e9: ; 111e9 (4:51e9)
- INCROM $111e9, $1124d
+ INCROM $111e9, $11238
+
+Func_11238: ; 11238 (4:5238)
+ INCROM $11238, $1124d
Func_1124d: ; 1124d (4:524d)
INCROM $1124d, $11320
@@ -830,7 +864,7 @@ Func_1157c: ; 1157c (4:557c)
ld [wd32e], a
.asm_1159f
- call $5238
+ call Func_11238
ret
Func_115a3: ; 115a3 (4:55a3)
@@ -1040,7 +1074,7 @@ OverworldScriptTable: ; 1217b (4:617b)
dw Func_d3e0
dw Func_d3fe
dw Func_d408
- dw Func_d40f
+ dw ScriptCommand_PlaySong
dw ScriptCommand_PlaySFX
dw ScriptCommand_PauseSong
dw ScriptCommand_ResumeSong
@@ -1078,11 +1112,11 @@ MultichoiceTextbox_ConfigTable_ChooseDeckToDuelAgainst: ;1224b
db $04, $00 ; x, y to start drawing box
db $10, $08 ; width, height of box
db $06, $02 ; x, y coordinate to start printing next text
- tx Text03f6 ; text id to print next
+ tx LightningAndFireDeckChoiceText ; text id to print next
db $06, $04 ; x, y coordinate to start printing next text
- tx Text03f7 ; text id to print next
+ tx WaterAndFightingDeckChoiceText ; text id to print next
db $06, $06 ; x, y coordinate to start printing next text
- tx Text03f8 ; text id to print next
+ tx GrassAndPsychicDeckChoiceText ; text id to print next
db $ff ; marker byte -- end text entries
db $05, $02 ; cursor starting x, y
db $02 ; number of tiles the cursor moves per toggle
@@ -1095,11 +1129,11 @@ MultichoiceTextbox_ConfigTable_ChooseDeckStarterDeck: ;12264
db $04, $00 ; x, y to start drawing box
db $10, $08 ; width, height of box
db $06, $02 ; x, y coordinate to start printing next text
- tx Text03fa ; text id to print next
+ tx CharmanderAndFriendsDeckChoiceText ; text id to print next
db $06, $04 ; x, y coordinate to start printing next text
- tx Text03fb ; text id to print next
+ tx SquirtleAndFriendsDeckChoiceText ; text id to print next
db $06, $06 ; x, y coordinate to start printing next text
- tx Text03fc ; text id to print next
+ tx BulbasaurAndFriendsDeckChoiceText ; text id to print next
db $ff ; marker byte -- end text entries
db $05, $02 ; cursor starting x, y
db $02 ; number of tiles the cursor moves per toggle
@@ -1115,7 +1149,7 @@ SamNormalMultichoice_ConfigurationTable: ;1227d
tx Text03ff ; text id to print next
db $ff ; marker byte -- end text entries
db $0b, $02 ; cursor starting x, y
- db $02 ; number of tiles the cursor moves per toggle
+ db $02 ; number of tiles the cursor moves per toggle
db $04 ; cursor max index
db $0f ; cursor image
@@ -1202,7 +1236,7 @@ MainMenu_ContinueFromDiary: ; 12741 (4:6741)
farcall Func_70000
call EnableSRAM
xor a
- ld [$ba44], a
+ ld [sba44], a
call DisableSRAM
ld a, GAME_EVENT_OVERWORLD
ld [wGameEvent], a
@@ -1234,7 +1268,10 @@ MainMenu_ContinueDuel: ; 1277e (4:677e)
ret
; 0x1279a
- INCROM $1279a, $12871
+ INCROM $1279a, $12863
+
+Func_12863: ; 12863 (4:6863)
+ INCROM $12863, $12871
Func_12871: ; 12871 (4:6871)
INCROM $12871, $1288c
@@ -1393,10 +1430,12 @@ FillNewSpriteAnimBufferEntry: ; 129d9 (4:69d9)
pop bc
pop hl
ret
-; 0x129fa
Func_129fa: ; 129fa (4:69fa)
ld a, [wWhichSprite]
+ ; fallthrough
+
+Func_129fd: ; 129fd (4:69fd)
push af
ld a, [wd5d7]
or a
@@ -1836,7 +1875,13 @@ Func_12c5e: ; 12c5e (4:6c5e)
INCROM $12c5e, $12c7f
Func_12c7f: ; 12c7f (4:6c7f)
- INCROM $12c7f, $131b3
+ INCROM $12c7f, $12fc6
+
+Func_12fc6: ; 12fc6 (4:6fc6)
+ INCROM $12fc6, $130ca
+
+Func_130ca: ; 130ca (4:70ca)
+ INCROM $130ca, $131b3
Func_131b3: ; 131b3 (4:71b3)
INCROM $131b3, $131d3
@@ -1859,12 +1904,12 @@ Func_1344d: ; 1344d (4:744d)
Func_13485: ; 13485 (4:7485)
call EnableSRAM
- ld a, [$ba68]
+ ld a, [sba68]
or a
ret z
- ld a, [$ba56]
+ ld a, [sba56]
ld [wTxRam3], a
- ld a, [$ba57]
+ ld a, [sba57]
ld [wTxRam3 + 1], a
call DisableSRAM
call PauseSong
diff --git a/src/engine/bank06.asm b/src/engine/bank06.asm
index 8eb6e9a..f314b48 100644
--- a/src/engine/bank06.asm
+++ b/src/engine/bank06.asm
@@ -923,26 +923,26 @@ glossary_entry: MACRO
ENDM
GlossaryData1:
- glossary_entry 7, Text02fa, Text030c
- glossary_entry 5, Text02fb, Text030d
- glossary_entry 7, Text02fc, Text030e
- glossary_entry 6, Text02fd, Text030f
- glossary_entry 6, Text02fe, Text0310
- glossary_entry 4, Text02ff, Text0311
- glossary_entry 5, Text0300, Text0312
- glossary_entry 7, Text0301, Text0313
- glossary_entry 5, Text0302, Text0314
+ glossary_entry 7, AboutTheDeckText, DeckDescriptionText
+ glossary_entry 5, AboutTheDiscardPileText, DiscardPileDescriptionText
+ glossary_entry 7, AboutTheHandText, HandDescriptionText
+ glossary_entry 6, AboutTheArenaText, ArenaDescriptionText
+ glossary_entry 6, AboutTheBenchText, BenchDescriptionText
+ glossary_entry 4, AboutTheActivePokemonText, ActivePokemonDescriptionText
+ glossary_entry 5, AboutBenchPokemonText, BenchPokemonDescriptionText
+ glossary_entry 7, AboutPrizesText, PrizesDescriptionText
+ glossary_entry 5, AboutDamageCountersText, DamageCountersDescriptionText
GlossaryData2:
- glossary_entry 5, Text0303, Text0315
- glossary_entry 5, Text0304, Text0316
- glossary_entry 5, Text0305, Text0317
- glossary_entry 5, Text0306, Text0318
- glossary_entry 6, Text0307, Text0319
- glossary_entry 5, Text0308, Text031a
- glossary_entry 6, Text0309, Text031b
- glossary_entry 6, Text030a, Text031c
- glossary_entry 6, Text030b, Text031d
+ glossary_entry 5, AboutEnergyCardsText, EnergyCardsDescriptionText
+ glossary_entry 5, AboutTrainerCardsText, TrainerCardsDescriptionText
+ glossary_entry 5, AboutBasicPokemonText, BasicPokemonDescriptionText
+ glossary_entry 5, AboutEvolutionCardsText, EvolutionCardsDescriptionText
+ glossary_entry 6, AboutAttackingText, AttackingDescriptionText
+ glossary_entry 5, AboutPokemonPowerText, PokemonPowerDescriptionText
+ glossary_entry 6, AboutWeaknessText, WeaknessDescriptionText
+ glossary_entry 6, AboutResistanceText, ResistanceDescriptionText
+ glossary_entry 6, AboutRetreatingText, RetreatingDescriptionText
Func_18661: ; 18661 (6:4661)
xor a
@@ -1077,7 +1077,7 @@ Func_18f9c: ; 18f9c (6:4f9c)
ld a, DUEL_ANIM_SCREEN_MAIN_SCENE
ld [wDuelAnimationScreen], a
ld a, $01
- ld [$d4b3], a
+ ld [wd4b3], a
xor a
ld [wd4b0], a
ld a, [de]
@@ -1147,10 +1147,10 @@ Func_19014: ; 19014 (6:5014)
ld a, $97
call Func_3b6a
ld a, [wce81]
- ld [$d4b3], a
+ ld [wd4b3], a
push de
ld hl, wce7f
- ld de, $d4b1
+ ld de, wd4b1
ld a, [hli]
ld [de], a
inc de
@@ -1192,7 +1192,7 @@ Func_19014: ; 19014 (6:5014)
Func_19079: ; 19079 (6:5079)
ld a, [de]
inc de
- ld [$d4b3], a
+ ld [wd4b3], a
ld a, [wce82]
ld [wd4b0], a
call Func_1909d
@@ -1210,7 +1210,7 @@ PointerTable_006_508f: ; 1908f (6:508f)
dw Func_19013
Func_1909d: ; 1909d (6:509d)
- ld a, [$d4b3]
+ ld a, [wd4b3]
cp $04
jr z, .asm_50ad
cp $01
@@ -1265,7 +1265,7 @@ Func_1909d: ; 1909d (6:509d)
; this part is not perfectly analyzed.
; needs some fix.
- ld a, [$d4b3]
+ ld a, [wd4b3]
cp $04
jr z, Func_190fb.asm_510f
Func_190fb: ; 190fb (6:50fb)
@@ -1341,25 +1341,25 @@ Func_19168: ; 19168 (6:5168)
jr z, .asm_5188
call LoadTxRam3
ld a, [wce81]
- ld hl, $003a
+ ldtx hl, AttackDamageText
and $06
ret z
- ld hl, $0038
+ ldtx hl, WeaknessMoreDamage2Text
cp $06
ret z
and $02
- ld hl, $0037
+ ldtx hl, WeaknessMoreDamageText
ret nz
- ld hl, $0036
+ ldtx hl, ResistanceLessDamageText
ret
.asm_5188
call CheckNoDamageOrEffect
ret c
- ld hl, $003b
+ ldtx hl, NoDamageText
ld a, [wce81]
and $04
ret z
- ld hl, $0039
+ ldtx hl, ResistanceNoDamageText
ret
; needs analyze.
@@ -1624,7 +1624,7 @@ Func_1a68d: ; 1a68d (6:668d)
call SetupText
bank1call InitAndDrawCardListScreenLayout
ldtx hl, ChooseTheCardYouWishToExamineText
- ldtx de, Text0196
+ ldtx de, BoosterPackText
bank1call SetCardListHeaderText
ld a, A_BUTTON | START
ld [wNoItemSelectionMenuKeys], a
@@ -1684,12 +1684,12 @@ Func_1a6cd: ; 1a6cd (6:66cd)
ld hl, $00a3
bank1call DrawWholeScreenTextBox
ld a, $0a
- ld [$0000], a
+ ld [MBC3SRamEnable], a
xor a
ldh [hBankSRAM], a
- ld [$4000], a
- ld [$a000], a
- ld [$0000], a
+ ld [MBC3SRamBank], a
+ ld [MBC3RTC], a
+ ld [MBC3SRamEnable], a
jp Reset
ret
@@ -1712,7 +1712,7 @@ Func_1a73a: ; 1a73a (6:673a)
or b
jr nz, .asm_6749
ld a, $0a
- ld [$0000], a
+ ld [MBC3SRamEnable], a
ld a, e
ld [s0a00b], a
pop bc
@@ -1728,20 +1728,20 @@ WhatIsYourNameData: ; 1a75e (6:675e)
; without any bank description.
; That is, the developers hard-coded it. -_-;;
Deck1Data: ; 1a763 (6:6763)
- textitem 2, 1, Text022b
- textitem 14, 1, Text0219
+ textitem 2, 1, Deck1Text
+ textitem 14, 1, DeckText
db $ff
Deck2Data: ; 1a76c (6:676c)
- textitem 2, 1, Text022c
- textitem 14, 1, Text0219
+ textitem 2, 1, Deck2Text
+ textitem 14, 1, DeckText
db $ff
Deck3Data: ; 1a775 (6:6775)
- textitem 2, 1, Text022d
- textitem 14, 1, Text0219
+ textitem 2, 1, Deck3Text
+ textitem 14, 1, DeckText
db $ff
Deck4Data: ; 1a77e (6:677e)
- textitem 2, 1, Text022e
- textitem 14, 1, Text0219
+ textitem 2, 1, Deck4Text
+ textitem 14, 1, DeckText
db $ff
; set each byte zero from hl for b bytes.
@@ -1938,7 +1938,7 @@ DrawNamingScreenBG: ; 1a892 (6:6892)
; print "End".
ld hl, .data
call PlaceTextItems
- ldtx hl, Text0221
+ ldtx hl, PlayerNameKeyboardText
lb de, 2, 4
call InitTextPrinting
call ProcessTextFromID
@@ -2815,7 +2815,7 @@ Func_1ae99: ; 1ae99 (6:6e99)
ld hl, DrawNamingScreenBG.data
call PlaceTextItems
; print the keyboard characters.
- ldtx hl, NamingScreenKeyboardText ; "A B C D..."
+ ldtx hl, DeckNameKeyboardText ; "A B C D..."
lb de, 2, 4
call InitTextPrinting
call ProcessTextFromID
@@ -3297,7 +3297,7 @@ Func_1bae4: ; 1bae4 (6:7ae4)
push af
ld hl, wd088
ld b, [hl]
- farcall $2, $7625
+ farcall Func_b625
jr c, .asm_7af5
pop af
ld [wd0a6], a
diff --git a/src/engine/bank07.asm b/src/engine/bank07.asm
index 614cb61..81356d3 100644
--- a/src/engine/bank07.asm
+++ b/src/engine/bank07.asm
@@ -112,7 +112,7 @@ Func_1c461: ; 1c461 (7:4461)
ld a, b
ld [hli], a
ld [hl], c
- call $46e3
+ call Func_1c6e3
pop bc
pop hl
ret
@@ -214,7 +214,7 @@ Func_1c50a: ; 1c50a (7:450a)
ld a, [hl]
or a
jr z, .asm_1c52c
- call $44fa
+ call Func_1c4fa
jr nc, .asm_1c521
xor a
ld [wd3b8], a
@@ -223,7 +223,7 @@ Func_1c50a: ; 1c50a (7:450a)
xor a
ld [hli], a
ld a, [hl]
- farcall $4, $69fd
+ farcall Func_129fd
ld hl, wd349
dec [hl]
@@ -337,7 +337,7 @@ Func_1c5e9: ; 1c5e9 (7:45e9)
ld l, LOADED_NPC_FIELD_07
call GetItemInLoadedNPCIndex
ld a, [hl]
- ld bc, $fffd
+ ld bc, -3
add hl, bc
ld [hl], a
call Func_1c58e
@@ -346,6 +346,7 @@ Func_1c5e9: ; 1c5e9 (7:45e9)
ret
; 0x1c5ff
+Func_1c5ff: ; 1c5ff (7:45ff)
INCROM $1c5ff, $1c610
Func_1c610: ; 1c610 (7:4610)
@@ -382,7 +383,7 @@ Func_1c719: ; 1c719 (7:4719)
ld b, a
ld c, [hl]
ld a, $40
- call $3937
+ call UpdatePermissionOfMapPosition
pop bc
pop hl
ret
@@ -473,12 +474,12 @@ Func_1c78d: ; 1c78d (7:478d)
inc hl
ld [hl], b
dec hl
- call $39ea
+ call Func_39ea
cp $f0
jr nc, .asm_1c7bb
push af
and $7f
- call $45ff
+ call Func_1c5ff
pop af
bit 7, a
jr z, .asm_1c7dc
@@ -489,7 +490,7 @@ Func_1c78d: ; 1c78d (7:478d)
cp $ff
jr z, .asm_1c7d2
inc bc
- call $39ea
+ call Func_39ea
push hl
ld l, a
ld h, $0
@@ -551,8 +552,8 @@ Func_1c83d: ; 1c83d (7:483d)
pop bc
pop hl
ret
-; 0x1c858
+Func_1c858: ; 1c858 (7:4858)
INCROM $1c858, $1c8bc
Func_1c8bc: ; 1c8bc (7:48bc)
@@ -841,7 +842,7 @@ Func_1ca31: ; 1ca31 (7:4a31)
add %00001000
and %01111111
cp b
- jp z, .asm_007_4a6b
+ jp z, .asm_1ca6b
ld [hl], a
ld b, $00
@@ -864,7 +865,7 @@ Func_1ca31: ; 1ca31 (7:4a31)
ld a, [wd4be]
ld [hl], a
-.asm_007_4a6b
+.asm_1ca6b
pop bc
pop hl
ret
@@ -998,7 +999,7 @@ Func_1cb18: ; 1cb18 (7:4b18)
ld [wd4c0], a
ld a, [wd42a]
cp $ff
- call nz, $4cd4
+ call nz, Func_1ccd4
ld hl, wAnimationQueue
ld c, $07
.asm_1cb3b
@@ -1007,7 +1008,7 @@ Func_1cb18: ; 1cb18 (7:4b18)
cp $ff
jr z, .asm_1cb4b
ld [wWhichSprite], a
- farcall $4, $69fa
+ farcall Func_129fa
ld a, $ff
ld [hl], a
.asm_1cb4b
@@ -1159,7 +1160,7 @@ Func_1cc03: ; 1cc03 (7:4c03)
ret
; 0x1cc2f
-.Func_1cc2f
+.Func_1cc2f
ld a, $4e
.loop
inc a
@@ -1274,6 +1275,7 @@ Func_1ccbc: ; 1ccbc (7:4cbc)
ret
; 0x1ccd4
+Func_1ccd4: ; 1ccd4 (7:4cd4)
INCROM $1ccd4, $1cce4
Func_1cce4: ; 1cce4 (7:4ce4)
@@ -2240,8 +2242,8 @@ Func_1d078: ; 1d078 (7:5078)
ld a, MUSIC_STOP
call PlaySong
call Func_3ca0
- call $5335
- call $53ce
+ call Func_1d335
+ call Func_1d3ce
xor a
ld [wd635], a
ld a, $3c
@@ -2249,7 +2251,7 @@ Func_1d078: ; 1d078 (7:5078)
.asm_1d095
call DoFrameIfLCDEnabled
call UpdateRNGSources
- call $5614
+ call Func_1d614
ld hl, wd635
inc [hl]
call AssertSongFinished
@@ -2273,46 +2275,46 @@ Func_1d078: ; 1d078 (7:5078)
farcall Func_10ab4
.asm_1d0c7
- call $50fa
- call $511c
+ call Func_1d0fa
+ call Func_1d11c
ld a, [wd628]
cp $2
jr nz, .asm_1d0db
- call $5289
+ call Func_1d289
jr c, Func_1d078
jr .asm_1d0e7
.asm_1d0db
ld a, [wd628]
cp $1
jr nz, .asm_1d0e7
- call $52b8
+ call Func_1d2b8
jr c, Func_1d078
.asm_1d0e7
ld a, [wd628]
cp $0
jr nz, .asm_1d0f3
- call $52dd
+ call Func_1d2dd
jr c, Func_1d078
.asm_1d0f3
call ResetDoFrameFunction
call Func_3ca0
ret
-; 0x1d0fa
+Func_1d0fa: ; 1d0fa (7:50fa)
INCROM $1d0fa, $1d11c
Func_1d11c: ; 1d11c (7:511c)
ld a, MUSIC_PC_MAIN_MENU
call PlaySong
call DisableLCD
- farcall $4, $4000
+ farcall Func_10000
lb de, $30, $8f
call SetupText
call Func_3ca0
xor a
ld [wLineSeparation], a
- call $51e1
- call $517f
+ call Func_1d1e1
+ call Func_1d17f
ld a, $ff
ld [wd626], a
ld a, [wd627]
@@ -2325,13 +2327,13 @@ Func_1d11c: ; 1d11c (7:511c)
.asm_1d14f
ld hl, wd636
farcall Func_111e9
- farcall $4, $4031
+ farcall Func_10031
.asm_1d15a
call DoFrameIfLCDEnabled
call UpdateRNGSources
call HandleMenuInput
push af
- call $51e9
+ call Func_1d1e9
pop af
jr nc, .asm_1d15a
ldh a, [hCurMenuItem]
@@ -2347,12 +2349,30 @@ Func_1d11c: ; 1d11c (7:511c)
ld a, e
ld [wd628], a
ret
-; 0x1d17f
- INCROM $1d17f, $1d306
+Func_1d17f: ; 1d17f (7:517f)
+ INCROM $1d17f, $1d1e1
+
+Func_1d1e1: ; 1d1e1 (7:51e1)
+ INCROM $1d1e1, $1d1e9
+
+Func_1d1e9: ; 1d1e9 (7:51e9)
+ INCROM $1d1e9, $1d289
+
+Func_1d289: ; 1d289 (7:5289)
+ INCROM $1d289, $1d2b8
+
+Func_1d2b8: ; 1d2b8 (7:52b8)
+ INCROM $1d2b8, $1d2dd
+
+Func_1d2dd: ; 1d2dd (7:52dd)
+ INCROM $1d2dd, $1d306
Func_1d306: ; 1d306 (7:5306)
- INCROM $1d306, $1d386
+ INCROM $1d306, $1d335
+
+Func_1d335: ; 1d335 (7:5335)
+ INCROM $1d335, $1d386
Titlescreen_1d386: ; 1d386 (7:5386)
call AssertSongFinished
@@ -2372,7 +2392,10 @@ Titlescreen_1d386: ; 1d386 (7:5386)
ret
Func_1d3a9: ; 1d3a9 (7:53a9)
- INCROM $1d3a9, $1d42e
+ INCROM $1d3a9, $1d3ce
+
+Func_1d3ce: ; 1d3ce (7:53ce)
+ INCROM $1d3ce, $1d42e
Func_1d42e: ; 1d42e (7:542e)
INCROM $1d42e, $1d519
@@ -2388,35 +2411,38 @@ Titlescreen_1d519: ; 1d519 (7:5519)
INCROM $1d523, $1d59c
Func_1d59c: ; 1d59c (7:559c)
- INCROM $1d59c, $1d6ad
+ INCROM $1d59c, $1d614
+
+Func_1d614: ; 1d614 (7:5614)
+ INCROM $1d614, $1d6ad
Credits_1d6ad: ; 1d6ad (7:56ad)
ld a, MUSIC_STOP
call PlaySong
- call $5705
- call $4858
+ call Func_1d705
+ call Func_1c858
xor a
ld [wd324], a
ld a, MUSIC_CREDITS
call PlaySong
- farcall $4, $4031
- call $57fc
+ farcall Func_10031
+ call Func_1d7fc
.asm_1d6c8
call DoFrameIfLCDEnabled
- call $5765
- call $580b
+ call Func_1d765
+ call Func_1d80b
ld a, [wd633]
cp $ff
jr nz, .asm_1d6c8
call WaitForSongToFinish
ld a, $8
- farcall $4, $6863
+ farcall Func_12863
ld a, MUSIC_STOP
call PlaySong
farcall Func_10ab4
call Func_3ca4
call Set_WD_off
- call $5758
+ call Func_1d758
call EnableLCD
call DoFrameIfLCDEnabled
call DisableLCD
@@ -2424,6 +2450,18 @@ Credits_1d6ad: ; 1d6ad (7:56ad)
set 1, [hl]
call ResetDoFrameFunction
ret
-; 0x1d705
- INCROM $1d705, $1e1c4
+Func_1d705: ; 1d705 (7:5705)
+ INCROM $1d705, $1d758
+
+Func_1d758: ; 1d758 (7:5758)
+ INCROM $1d758, $1d765
+
+Func_1d765: ; 1d765 (7:5765)
+ INCROM $1d765, $1d7fc
+
+Func_1d7fc: ; 1d7fc (7:57fc)
+ INCROM $1d7fc, $1d80b
+
+Func_1d80b: ; 1d80b (7:580b)
+ INCROM $1d80b, $1e1c4
diff --git a/src/engine/bank20.asm b/src/engine/bank20.asm
index c2a8cdf..31e6d91 100644
--- a/src/engine/bank20.asm
+++ b/src/engine/bank20.asm
@@ -5,9 +5,9 @@ Func_80028: ; 80028 (20:4028)
call Func_801f1
ld bc, $0000
call Func_80077
- farcall $3, $49c7
- call $41a1
- farcall $3, $43ee
+ farcall Func_c9c7
+ call Func_801a1
+ farcall Func_c3ee
ret
; 0x8003d
@@ -16,12 +16,12 @@ Func_80028: ; 80028 (20:4028)
Func_80077: ; 80077 (20:4077)
ld a, $1
ld [wd292], a
- jr .asm_80082
+ jr Func_80082
xor a
ld [wd292], a
-.asm_80082
+Func_80082: ; 80082 (20:4082)
push hl
push bc
push de
@@ -78,7 +78,7 @@ Func_800bd: ; 800bd (20:40bd)
Func_800e0: ; 800e0 (20:40e0)
push hl
- ld hl, $d28e
+ ld hl, wd28e
ld a, [wd12f]
ld [hl], a
ld a, [wd23c]
@@ -99,7 +99,7 @@ Func_800e0: ; 800e0 (20:40e0)
push bc
push de
ld b, $00
- ld a, [$d28e]
+ ld a, [wd28e]
ld c, a
ld de, wd23e
call Func_3be4
@@ -138,17 +138,17 @@ Func_800e0: ; 800e0 (20:40e0)
ret
Func_80148: ; 80148 (20:4148)
- ld a, [$d291]
+ ld a, [wd291]
or a
ret z
- ld a, [$d23c]
+ ld a, [wd23c]
or a
jr z, .asm_80162
push hl
push bc
.asm_80155
push bc
- ld a, [$d291]
+ ld a, [wd291]
add [hl]
ld [hli], a
pop bc
@@ -160,7 +160,7 @@ Func_80148: ; 80148 (20:4148)
.asm_80162
push hl
push bc
- ld a, [$d291]
+ ld a, [wd291]
.asm_80167
ld [hli], a
dec b
@@ -411,7 +411,7 @@ Func_803b9: ; 803b9 (20:43b9)
call GetMapDataPointer
call LoadGraphicsPointerFromHL
ld a, [hl]
- ld [$d239], a
+ ld [wd239], a
ret
; 0x803c9
@@ -570,9 +570,9 @@ Func_80b89: ; 80b89 (20:4b89)
push af
ld c, a
ld a, $01
- ld [$d292], a
+ ld [wd292], a
ld b, $00
- ld hl, $d323
+ ld hl, wd323
add hl, bc
ld a, [hl]
or a
@@ -618,7 +618,7 @@ Func_80baa: ; 80baa (20:4baa)
add a
ld c, a
ld b, $0
- ld hl, $4c21
+ ld hl, Unknown_80c21
add hl, bc
ld a, [hli]
ld h, [hl]
@@ -636,7 +636,7 @@ Func_80baa: ; 80baa (20:4baa)
ld a, [hl]
ld [wd131], a
push bc
- farcall $20, $4082
+ farcall Func_80082
pop bc
srl b
ld a, c
@@ -648,7 +648,7 @@ Func_80baa: ; 80baa (20:4baa)
ld b, $0
ld hl, wBoosterViableCardList
add hl, bc
- farcall $3, $438f
+ farcall Func_c38f
pop af
ld [wd23b], a
pop af
@@ -665,8 +665,8 @@ Func_80baa: ; 80baa (20:4baa)
pop bc
pop hl
ret
-; 0x80c21
+Unknown_80c21: ; 80c21 (20:4c21)
INCROM $80c21, $80e5a
SpriteNullAnimationPointer: ; 80e5a (20:4e5a)
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm
index 63a3642..45e71a2 100644
--- a/src/engine/effect_functions.asm
+++ b/src/engine/effect_functions.asm
@@ -495,7 +495,7 @@ ApplyAndAnimateHPRecovery: ; 2c221 (b:4221)
ld e, a
ld a, 0
adc d
- ld d, a
+ ld d, a
; de = damage dealt + current HP
; bc = max HP of card
call CompareDEtoBC
@@ -877,7 +877,7 @@ HandleDefendingPokemonAttackSelection: ; 2c391 (b:4391)
db 2 ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; 0x2c3fc
; loads in hl the pointer to attack's name.
@@ -1244,7 +1244,7 @@ HandleColorChangeScreen: ; 2c588 (b:4588)
db MAX_PLAY_AREA_POKEMON ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; 0x2c5be
.DrawScreen: ; 2c5be (b:45be)
@@ -1444,7 +1444,7 @@ PlayAreaSelectionMenuParameters: ; 2c6e0 (b:46e0)
db MAX_PLAY_AREA_POKEMON ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; 0x2c6e8
BenchSelectionMenuParameters: ; 2c6e8 (b:46e8)
@@ -1453,7 +1453,7 @@ BenchSelectionMenuParameters: ; 2c6e8 (b:46e8)
db MAX_PLAY_AREA_POKEMON ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; 0x2c6f0
SpitPoison_AIEffect: ; 2c6f0 (b:46f0)
@@ -9097,7 +9097,7 @@ MorphEffect: ; 2eff6 (b:6ff6)
.successful
ld a, DUELVARS_ARENA_CARD_STAGE
call GetTurnDuelistVariable
- or a
+ or a
jr z, .skip_discard_stage_below
; if this is a stage 1 Pokemon (in case it's used
diff --git a/src/engine/home.asm b/src/engine/home.asm
index c860dd3..8e5233b 100644
--- a/src/engine/home.asm
+++ b/src/engine/home.asm
@@ -7983,7 +7983,7 @@ NarrowTextBoxMenuParameters: ; 2a96 (0:2a96)
db 1 ; number of items
db SYM_CURSOR_D ; cursor tile number
db SYM_BOX_BOTTOM ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; draw a 20x6 text box aligned to the bottom of the screen
DrawWideTextBox: ; 2a9e (0:2a9e)
@@ -8020,7 +8020,7 @@ WideTextBoxMenuParameters: ; 2ac8 (0:2ac8)
db 1 ; number of items
db SYM_CURSOR_D ; cursor tile number
db SYM_BOX_BOTTOM ; tile behind cursor
- dw $0000 ; function pointer if non-0
+ dw NULL ; function pointer if non-0
; display a two-item horizontal menu with custom text provided in hl and handle input
TwoItemHorizontalMenu: ; 2ad0 (0:2ad0)
@@ -8793,7 +8793,7 @@ LoadTxRam3: ; 2ec4 (0:2ec4)
; load data of card with text id of name at de to wLoadedCard1
LoadCardDataToBuffer1_FromName: ; 2ecd (0:2ecd)
- ld hl, CardPointers + 2 ; skip first $0000 pointer
+ ld hl, CardPointers + 2 ; skip first NULL pointer
ld a, BANK(CardPointers)
call BankpushROM2
.find_card_loop
@@ -9051,7 +9051,7 @@ CheckMatchingCommand: ; 2ffe (0:2ffe)
ld a, l
or h
jr nz, .not_null_pointer
- ; return carry if pointer is $0000
+ ; return carry if pointer is NULL
scf
ret
@@ -10639,7 +10639,7 @@ GameEvent_Duel: ; 38c0 (0:38c0)
ld [wd112], a
call EnableSRAM
xor a
- ld [$ba44], a
+ ld [sba44], a
call DisableSRAM
call Func_3a3b
bank1call StartDuel
@@ -10652,7 +10652,7 @@ GameEvent_ChallengeMachine: ; 38db (0:38db)
call Func_39fc
call EnableSRAM
xor a
- ld [$ba44], a
+ ld [sba44], a
call DisableSRAM
.asm_38ed
farcall Func_131d3
@@ -10667,7 +10667,7 @@ GameEvent_ContinueDuel: ; 38fb (0:38fb)
ld [wd112], a
bank1call TryContinueDuel
call EnableSRAM
- ld a, [$ba44]
+ ld a, [sba44]
call DisableSRAM
cp $ff
jr z, GameEvent_ChallengeMachine.asm_38ed
@@ -11060,9 +11060,9 @@ RunOverworldScript: ; 3aed (0:3aed)
Func_3b11: ; 3b11 (0:3b11)
ldh a, [hBankROM]
push af
- ld a, $04
+ ld a, BANK(_GameLoop)
call BankswitchROM
- call $66d1
+ call _GameLoop
pop af
call BankswitchROM
ret
@@ -11126,7 +11126,7 @@ Func_3b6a: ; 3b6a (0:3b6a)
push hl
push bc
push de
- ld a, BANK(Func_1ca31)
+ ld a, BANK(Func_1ca31) ; BANK(Func_1c8ef)
call BankswitchROM
ld a, [wTempAnimation]
cp $61
@@ -11191,7 +11191,7 @@ SetDoFrameFunction: ; 3bd2 (0:3bd2)
ResetDoFrameFunction: ; 3bdb (0:3bdb)
push hl
- ld hl, $0000
+ ld hl, NULL
call SetDoFrameFunction
pop hl
ret
@@ -11331,7 +11331,7 @@ DivideBCbyDE: ; 3c5a (0:3c5a)
jr nz, .asm_3c63
ret
-CallPlaySong: ; 3c83 (0:3c83)
+ScriptPlaySong: ; 3c83 (0:3c83)
call PlaySong
ret
@@ -11629,9 +11629,9 @@ Func_3e17: ; 3e17 (0:3e17)
ld [wd131], a
ldh a, [hBankROM]
push af
- ld a, $4
+ ld a, BANK(Func_12fc6)
call BankswitchROM
- call $6fc6
+ call Func_12fc6
pop af
call BankswitchROM
ret
@@ -11646,9 +11646,9 @@ Func_3e31: ; 3e31 (0:3e31)
ldh a, [hBankROM]
push af
call Func_3cb4
- ld a, $20
+ ld a, BANK(Func_804d8)
call BankswitchROM
- call $44d8
+ call Func_804d8
pop af
call BankswitchROM
ret
diff --git a/src/macros/scripts.asm b/src/macros/scripts.asm
index 6836b4d..5884ffc 100755..100644
--- a/src/macros/scripts.asm
+++ b/src/macros/scripts.asm
@@ -77,7 +77,7 @@ ENDM
const Func_d3e0_index ; $45
const Func_d3fe_index ; $46
const Func_d408_index ; $47
- const Func_d40f_index ; $48
+ const ScriptCommand_PlaySong_index ; $48
const ScriptCommand_PlaySFX_index ; $49
const ScriptCommand_PauseSong_index ; $4a
const ScriptCommand_ResumeSong_index ; $4b
@@ -346,6 +346,12 @@ script_nop: MACRO
run_command ScriptCommand_nop
ENDM
+; Plays a song
+play_song: MACRO
+ run_command ScriptCommand_PlaySong
+ db \1 ; Song ID (ex MUSIC_BOOSTER_PACK)
+ENDM
+
; Plays a sound effect
play_sfx: MACRO
run_command ScriptCommand_PlaySFX
@@ -471,22 +477,22 @@ zero_out_flag_value: MACRO
db \1 ; flag (ex EVENT_FLAG_11)
ENDM
-; Jumps to a script position if a flag is zero
-jump_if_flag_zero_2: MACRO
- run_command ScriptCommand_JumpIfFlagZero2
+; Jumps to a script position if a flag is nonzero
+jump_if_flag_nonzero_2: MACRO
+ run_command ScriptCommand_JumpIfFlagNonzero2
db \1 ; flag (ex EVENT_FLAG_11)
dw \2 ; Script Label
ENDM
-; Jumps to a script position if a flag is nonzero
-jump_if_flag_nonzero_2: MACRO
- run_command ScriptCommand_JumpIfFlagNonzero2
+; Jumps to a script position if a flag is zero
+jump_if_flag_zero_2: MACRO
+ run_command ScriptCommand_JumpIfFlagZero2
db \1 ; flag (ex EVENT_FLAG_11)
dw \2 ; Script Label
ENDM
; Increments given flags value (truncates the new value)
-script_increment_flag_value: MACRO
+increment_flag_value: MACRO
run_command ScriptCommand_IncrementFlagValue
db \1 ; flag (ex EVENT_FLAG_11)
ENDM
diff --git a/src/sram.asm b/src/sram.asm
index 6abe5d7..09c4e67 100644
--- a/src/sram.asm
+++ b/src/sram.asm
@@ -70,6 +70,32 @@ s0a3f8:: ; a3f8
sCurrentlySelectedDeck:: ; b700
ds $1
+sb701:: ; b701
+ ds $1
+
+ ds $1
+
+sb703:: ; b703
+ ds $1
+
+ ds $340
+
+sba44:: ; ba44
+ ds $1
+
+ ds $11
+
+sba56:: ; ba56
+ ds $1
+
+sba57:: ; ba57
+ ds $1
+
+ ds $10
+
+sba68:: ; ba68
+ ds $1
+
SECTION "SRAM1", SRAM
SECTION "SRAM2", SRAM
diff --git a/src/text/text1.asm b/src/text/text1.asm
index 93c389f..931a98d 100644
--- a/src/text/text1.asm
+++ b/src/text/text1.asm
@@ -222,12 +222,12 @@ ResistanceLessDamageText: ; 365e1 (d:65e1)
line "<RAMNUM> damage due to Resistance!"
done
-Text0037: ; 36609 (d:6609)
+WeaknessMoreDamageText: ; 36609 (d:6609)
text "<RAMTEXT> received"
line "<RAMNUM> damage due to Weakness!"
done
-Text0038: ; 3662f (d:662f)
+WeaknessMoreDamage2Text: ; 3662f (d:662f)
text "<RAMTEXT> received"
line "<RAMNUM> damage due to Weakness!"
done
diff --git a/src/text/text2.asm b/src/text/text2.asm
index fc603ee..d85eda7 100644
--- a/src/text/text2.asm
+++ b/src/text/text2.asm
@@ -844,7 +844,7 @@ Text0195: ; 39f03 (e:5f03)
line "Please wait..."
done
-Text0196: ; 39f21 (e:5f21)
+BoosterPackText: ; 39f21 (e:5f21)
text "Booster Pack"
done
@@ -1507,7 +1507,7 @@ OpponentsDiscardPileText: ; 3b7cf (e:77cf)
text "Opponent's Discard Pile"
done
-Text0219: ; 3b7e8 (e:77e8)
+DeckText: ; 3b7e8 (e:77e8)
text "Deck"
done
@@ -1563,7 +1563,7 @@ Text0220: ; 3b886 (e:7886)
textfw0 "-(2)"
done
-Text0221: ; 3b8f2 (e:78f2)
+PlayerNameKeyboardText: ; 3b8f2 (e:78f2)
textfw3 "A", " ", "B", " ", "C", " ", "D", " ", "E", " ", "F", " ", "G", " ", "H", " ", "I"
line ""
textfw3 "J", " ", "K", " ", "L", " ", "M", " ", "N", " ", "O", " ", "P", " ", "Q", " ", "R"
@@ -1580,7 +1580,7 @@ Text0221: ; 3b8f2 (e:78f2)
textfw0 " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "
done
-NamingScreenKeyboardText: ; 3b97b (e:797b)
+DeckNameKeyboardText: ; 3b97b (e:797b)
textfw3 "A", " ", "B", " ", "C", " ", "D", " ", "E", " ", "F", " ", "G", " ", "H", " ", "I"
line ""
textfw3 "J", " ", "K", " ", "L", " ", "M", " ", "N", " ", "O", " ", "P", " ", "Q", " ", "R"
@@ -1632,19 +1632,19 @@ ChosenAsDuelingDeckText: ; 3ba55 (e:7a55)
line "chosen as the dueling deck!"
done
-Text022b: ; 3ba78 (e:7a78)
+Deck1Text: ; 3ba78 (e:7a78)
textfw0 "1", "·"
done
-Text022c: ; 3ba7b (e:7a7b)
+Deck2Text: ; 3ba7b (e:7a7b)
textfw0 "2", "·"
done
-Text022d: ; 3ba7e (e:7a7e)
+Deck3Text: ; 3ba7e (e:7a7e)
textfw0 "3", "·"
done
-Text022e: ; 3ba81 (e:7a81)
+Deck4Text: ; 3ba81 (e:7a81)
textfw0 "4", "·"
done
diff --git a/src/text/text3.asm b/src/text/text3.asm
index 4d3fccf..e7dadf6 100644
--- a/src/text/text3.asm
+++ b/src/text/text3.asm
@@ -21,7 +21,7 @@ Text0271: ; 3c082 (f:4082)
text "Dismantled the Deck."
done
-Text0272: ; 3c098 (f:4098)
+OKIfFileDeletedText: ; 3c098 (f:4098)
text "OK if this file is deleted?"
done
@@ -644,79 +644,79 @@ ChooseWordAndPressAButtonText: ; 3d48f (f:548f)
line "A button."
done
-Text02fa: ; 3d4b6 (f:54b6)
+AboutTheDeckText: ; 3d4b6 (f:54b6)
text "About the Deck"
done
-Text02fb: ; 3d4c6 (f:54c6)
+AboutTheDiscardPileText: ; 3d4c6 (f:54c6)
text "About the Discard Pile"
done
-Text02fc: ; 3d4de (f:54de)
+AboutTheHandText: ; 3d4de (f:54de)
text "About the Hand"
done
-Text02fd: ; 3d4ee (f:54ee)
+AboutTheArenaText: ; 3d4ee (f:54ee)
text "About the Arena"
done
-Text02fe: ; 3d4ff (f:54ff)
+AboutTheBenchText: ; 3d4ff (f:54ff)
text "About the Bench"
done
-Text02ff: ; 3d510 (f:5510)
+AboutTheActivePokemonText: ; 3d510 (f:5510)
text "About the Active Pokémon"
done
-Text0300: ; 3d52a (f:552a)
+AboutBenchPokemonText: ; 3d52a (f:552a)
text "About Bench Pokémon"
done
-Text0301: ; 3d53f (f:553f)
+AboutPrizesText: ; 3d53f (f:553f)
text "About Prizes"
done
-Text0302: ; 3d54d (f:554d)
+AboutDamageCountersText: ; 3d54d (f:554d)
text "About Damage Counters"
done
-Text0303: ; 3d564 (f:5564)
+AboutEnergyCardsText: ; 3d564 (f:5564)
text "About Energy Cards"
done
-Text0304: ; 3d578 (f:5578)
+AboutTrainerCardsText: ; 3d578 (f:5578)
text "About Trainer Cards"
done
-Text0305: ; 3d58d (f:558d)
+AboutBasicPokemonText: ; 3d58d (f:558d)
text "About Basic Pokémon"
done
-Text0306: ; 3d5a2 (f:55a2)
+AboutEvolutionCardsText: ; 3d5a2 (f:55a2)
text "About Evolution Cards"
done
-Text0307: ; 3d5b9 (f:55b9)
+AboutAttackingText: ; 3d5b9 (f:55b9)
text "About Attacking"
done
-Text0308: ; 3d5ca (f:55ca)
+AboutPokemonPowerText: ; 3d5ca (f:55ca)
text "About Pokémon Power"
done
-Text0309: ; 3d5df (f:55df)
+AboutWeaknessText: ; 3d5df (f:55df)
text "About Weakness"
done
-Text030a: ; 3d5ef (f:55ef)
+AboutResistanceText: ; 3d5ef (f:55ef)
text "About Resistance"
done
-Text030b: ; 3d601 (f:5601)
+AboutRetreatingText: ; 3d601 (f:5601)
text "About Retreating"
done
-Text030c: ; 3d613 (f:5613)
+DeckDescriptionText: ; 3d613 (f:5613)
text "The Deck is the pile of cards"
line "you will be drawing from."
line "At the beginning of your turn, you"
@@ -725,7 +725,7 @@ Text030c: ; 3d613 (f:5613)
line "from the Deck, you lose the game."
done
-Text030d: ; 3d6d0 (f:56d0)
+DiscardPileDescriptionText: ; 3d6d0 (f:56d0)
text "The pile in which you place used"
line "cards is called the Discard Pile."
line "You can look at both yours and your"
@@ -733,7 +733,7 @@ Text030d: ; 3d6d0 (f:56d0)
line "with the Check command."
done
-Text030e: ; 3d769 (f:5769)
+HandDescriptionText: ; 3d769 (f:5769)
text "The cards held by each player"
line "are called a Hand."
line "There is no restriction to the"
@@ -742,7 +742,7 @@ Text030e: ; 3d769 (f:5769)
line "cards in your Hand."
done
-Text030f: ; 3d807 (f:5807)
+ArenaDescriptionText: ; 3d807 (f:5807)
text "The place where the Pokémon"
line "that is actively fighting"
line "is placed is called the Arena."
@@ -750,7 +750,7 @@ Text030f: ; 3d807 (f:5807)
line "Active Pokémon in the Arena."
done
-Text0310: ; 3d899 (f:5899)
+BenchDescriptionText: ; 3d899 (f:5899)
text "The Bench is where your Pokémon"
line "that are in play but aren't actively"
line "fighting sit."
@@ -761,14 +761,14 @@ Text0310: ; 3d899 (f:5899)
line "the Bench."
done
-Text0311: ; 3d96e (f:596e)
+ActivePokemonDescriptionText: ; 3d96e (f:596e)
text "The Active Pokémon is the "
line "Pokémon that is in the Arena."
line "Only Active Pokémon can "
line "attack."
done
-Text0312: ; 3d9c9 (f:59c9)
+BenchPokemonDescriptionText: ; 3d9c9 (f:59c9)
text "The Pokémon that are in play"
line "but aren't actively fighting"
line "are called Bench Pokémon."
@@ -780,7 +780,7 @@ Text0312: ; 3d9c9 (f:59c9)
line "Pokémon, you lose the game."
done
-Text0313: ; 3dad1 (f:5ad1)
+PrizesDescriptionText: ; 3dad1 (f:5ad1)
text "Prizes are the cards placed to"
line "count the number of the opponent's"
line "Pokémon you Knocked Out."
@@ -791,7 +791,7 @@ Text0313: ; 3dad1 (f:5ad1)
line "you win the game."
done
-Text0314: ; 3dbc5 (f:5bc5)
+DamageCountersDescriptionText: ; 3dbc5 (f:5bc5)
text "A Damage Counter represents the"
line "amount of damage a certain Pokémon"
line "has taken."
@@ -803,7 +803,7 @@ Text0314: ; 3dbc5 (f:5bc5)
line "HP is 0."
done
-Text0315: ; 3dcb2 (f:5cb2)
+EnergyCardsDescriptionText: ; 3dcb2 (f:5cb2)
text "Energy Cards are cards that power"
line "your Pokémon, making them able"
line "to Attack."
@@ -816,7 +816,7 @@ Text0315: ; 3dcb2 (f:5cb2)
line "from your Hand per turn."
done
-Text0316: ; 3ddbe (f:5dbe)
+TrainerCardsDescriptionText: ; 3ddbe (f:5dbe)
text "Trainer Cards are support cards."
line "There are many Trainer Cards"
line "with different effects."
@@ -828,7 +828,7 @@ Text0316: ; 3ddbe (f:5dbe)
line "as you like."
done
-Text0317: ; 3deb0 (f:5eb0)
+BasicPokemonDescriptionText: ; 3deb0 (f:5eb0)
text "Basic Pokémon are cards that "
line "can be played directly from your "
line "hand into the play area. Basic "
@@ -838,7 +838,7 @@ Text0317: ; 3deb0 (f:5eb0)
line "examples of Basic Pokémon."
done
-Text0318: ; 3df82 (f:5f82)
+EvolutionCardsDescriptionText: ; 3df82 (f:5f82)
text "Evolution Cards are cards you"
line "play on top of a Basic Pokémon card"
line "(or sometimes on top of another"
@@ -853,7 +853,7 @@ Text0318: ; 3df82 (f:5f82)
line "place the Stage 2 Evolution Card."
done
-Text0319: ; 3e10a (f:610a)
+AttackingDescriptionText: ; 3e10a (f:610a)
text "By choosing Attack, your Pokémon"
line "will fight your opponent's Pokémon."
line "Your Pokémon require Energy"
@@ -864,7 +864,7 @@ Text0319: ; 3e10a (f:610a)
line "Pokémon that can Attack."
done
-Text031a: ; 3e1f7 (f:61f7)
+PokemonPowerDescriptionText: ; 3e1f7 (f:61f7)
text "Unlike Attacks, Pokémon Power"
line "can be used by Active or Benched"
line "Pokémon. Some Pokémon Power are"
@@ -874,14 +874,14 @@ Text031a: ; 3e1f7 (f:61f7)
line "command, PKMN Power."
done
-Text031b: ; 3e2c5 (f:62c5)
+WeaknessDescriptionText: ; 3e2c5 (f:62c5)
text "Some Pokémon have a Weakness."
line "If a Pokémon has a Weakness, it"
line "takes double damage when attacked by"
line "Pokémon of a certain type."
done
-Text031c: ; 3e344 (f:6344)
+ResistanceDescriptionText: ; 3e344 (f:6344)
text "Some Pokémon have Resistance."
line "If a Pokémon has Resistance, it"
line "takes 30 less damage whenever"
@@ -889,7 +889,7 @@ Text031c: ; 3e344 (f:6344)
line "a certain type."
done
-Text031d: ; 3e3c8 (f:63c8)
+RetreatingDescriptionText: ; 3e3c8 (f:63c8)
text "By choosing Retreat, you can"
line "switch the Active Pokémon with"
line "a Pokémon on your Bench."
@@ -994,51 +994,51 @@ Text032f: ; 3e768 (f:6768)
text " ??'s House "
done
-Text0330: ; 3e77e (f:677e)
+MasonLaboratoryMapNameText: ; 3e77e (f:677e)
text "Mason Laboratory"
done
-Text0331: ; 3e790 (f:6790)
+MrIshiharasHouseMapNameText: ; 3e790 (f:6790)
text "Mr Ishihara's House"
done
-Text0332: ; 3e7a5 (f:67a5)
+FightingClubMapNameText: ; 3e7a5 (f:67a5)
text "Fighting"
done
-Text0333: ; 3e7af (f:67af)
+RockClubMapNameText: ; 3e7af (f:67af)
text "Rock"
done
-Text0334: ; 3e7b5 (f:67b5)
+WaterClubMapNameText: ; 3e7b5 (f:67b5)
text "Water"
done
-Text0335: ; 3e7bc (f:67bc)
+LightningClubMapNameText: ; 3e7bc (f:67bc)
text "Lightning"
done
-Text0336: ; 3e7c7 (f:67c7)
+GrassClubMapNameText: ; 3e7c7 (f:67c7)
text "Grass"
done
-Text0337: ; 3e7ce (f:67ce)
+PsychicClubMapNameText: ; 3e7ce (f:67ce)
text "Psychic"
done
-Text0338: ; 3e7d7 (f:67d7)
+ScienceClubMapNameText: ; 3e7d7 (f:67d7)
text "Science"
done
-Text0339: ; 3e7e0 (f:67e0)
+FireClubMapNameText: ; 3e7e0 (f:67e0)
text "Fire"
done
-Text033a: ; 3e7e6 (f:67e6)
+ChallengeHallMapNameText: ; 3e7e6 (f:67e6)
text "Challenge Hall"
done
-Text033b: ; 3e7f6 (f:67f6)
+PokemonDomeMapNameText: ; 3e7f6 (f:67f6)
text "Pokémon Dome"
done
@@ -1860,96 +1860,96 @@ AaronNPCName: ; 3f823 (f:7823)
text "Aaron"
done
-Text03e8: ; 3f82a (f:782a)
+MewtwoTradeCardName: ; 3f82a (f:782a)
text "<Lv>60 MEWTWO "
done
-Text03e9: ; 3f838 (f:7838)
+MewTradeCardName: ; 3f838 (f:7838)
text "<Lv>8 MEW "
done
-Text03ea: ; 3f842 (f:7842)
+ArcanineTradeCardName: ; 3f842 (f:7842)
text "<Lv>34 ARCANINE"
done
-Text03eb: ; 3f851 (f:7851)
+PikachuTradeCardName: ; 3f851 (f:7851)
text "<Lv>16 PIKACHU"
done
-Text03ec: ; 3f85f (f:785f)
+SurfingPikachuTradeCardName: ; 3f85f (f:785f)
text "<Lv>13 SURFING PIKACHU"
done
-Text03ed: ; 3f875 (f:7875)
+ElectabuzzTradeCardName: ; 3f875 (f:7875)
text "<Lv>20 ELECTABUZZ"
done
-Text03ee: ; 3f886 (f:7886)
+SlowpokeTradeCardName: ; 3f886 (f:7886)
text "<Lv>9 SLOWPOKE"
done
-Text03ef: ; 3f894 (f:7894)
+JigglypuffTradeCardName: ; 3f894 (f:7894)
text "<Lv>12 JIGGLYPUFF"
done
-Text03f0: ; 3f8a5 (f:78a5)
+ZapdosLegendaryCardName: ; 3f8a5 (f:78a5)
text "<Lv>68 ZAPDOS"
done
-Text03f1: ; 3f8b2 (f:78b2)
+MoltresLegendaryCardName: ; 3f8b2 (f:78b2)
text "<Lv>37 MOLTRES"
done
-Text03f2: ; 3f8c0 (f:78c0)
+ArticunoLegendaryCardName: ; 3f8c0 (f:78c0)
text "<Lv>37 ARTICUNO"
done
-Text03f3: ; 3f8cf (f:78cf)
+DragoniteLegendaryCardName: ; 3f8cf (f:78cf)
text "<Lv>41 DRAGONITE"
done
-Text03f4: ; 3f8df (f:78df)
+SuperEnergyRetrievalTradeCardName: ; 3f8df (f:78df)
text "Super Energy Retrieval"
done
-Text03f5: ; 3f8f7 (f:78f7)
+FlyingPikachuTradeCardName: ; 3f8f7 (f:78f7)
text "<Lv>12 FLYING PIKACHU"
done
-Text03f6: ; 3f90c (f:790c)
+LightningAndFireDeckChoiceText: ; 3f90c (f:790c)
text "Lightning & Fire Deck"
done
-Text03f7: ; 3f923 (f:7923)
+WaterAndFightingDeckChoiceText: ; 3f923 (f:7923)
text "Water & Fighting Deck"
done
-Text03f8: ; 3f93a (f:793a)
+GrassAndPsychicDeckChoiceText: ; 3f93a (f:793a)
text "Grass & Psychic Deck"
done
-Text03f9: ; 3f950 (f:7950)
+SelectDeckToDuelText: ; 3f950 (f:7950)
text "Please select the Deck"
line "you wish to Duel against."
done
-Text03fa: ; 3f982 (f:7982)
+CharmanderAndFriendsDeckChoiceText: ; 3f982 (f:7982)
text "CHARMANDER & Friends Deck"
done
-Text03fb: ; 3f99d (f:799d)
+SquirtleAndFriendsDeckChoiceText: ; 3f99d (f:799d)
text "SQUIRTLE & Friends Deck"
done
-Text03fc: ; 3f9b6 (f:79b6)
+BulbasaurAndFriendsDeckChoiceText: ; 3f9b6 (f:79b6)
text "BULBASAUR & Friends Deck"
done
-Text03fd: ; 3f9d0 (f:79d0)
+SelectDeckToTakeText: ; 3f9d0 (f:79d0)
text "Please select the Deck you want."
done
-Text03fe: ; 3f9f2 (f:79f2)
+HowCanIHelpText: ; 3f9f2 (f:79f2)
text "Hi, <RAMNAME>."
line "How can I help you?"
done
diff --git a/src/text/text4.asm b/src/text/text4.asm
index 74bec46..b597fb6 100644
--- a/src/text/text4.asm
+++ b/src/text/text4.asm
@@ -320,11 +320,11 @@ Text0419: ; 41965 (10:5965)
line "attached Booster Pack."
done
-Text041a: ; 4199b (10:599b)
+PokemonTradingCards101Text: ; 4199b (10:599b)
text "”Pokémon Trading Cards 101”"
done
-Text041b: ; 419b8 (10:59b8)
+PlaceholderMessageText: ; 419b8 (10:59b8)
text "This message is not in yet!"
done
@@ -338,7 +338,7 @@ Text041c: ; 419d5 (10:59d5)
line "just to collect them."
done
-Text041d: ; 41a74 (10:5a74)
+Gal1WantToTrade1Text: ; 41a74 (10:5a74)
text "We don't use Fire Pokémon cards"
line "here at the Water Club."
line "I have this rare Arcanine, but"
@@ -347,17 +347,17 @@ Text041d: ; 41a74 (10:5a74)
line "mind trading it for my Arcanine?"
done
-Text041e: ; 41b1d (10:5b1d)
+Gal1WantToTrade2Text: ; 41b1d (10:5b1d)
text "Hi! We meet again!"
line "Have you decided to trade your"
line "Lapras for my rare Arcanine?"
done
-Text041f: ; 41b6d (10:5b6d)
+Gal1WouldYouLikeToTradeText: ; 41b6d (10:5b6d)
text "Would you like to trade?"
done
-Text0420: ; 41b87 (10:5b87)
+Gal1DeclinedTradeText: ; 41b87 (10:5b87)
text "Aw, you're not going to"
line "trade with me?"
line "Well, that's too bad..."
@@ -365,13 +365,13 @@ Text0420: ; 41b87 (10:5b87)
line "come look for me."
done
-Text0421: ; 41bf6 (10:5bf6)
+Gal1DontOwnCardText: ; 41bf6 (10:5bf6)
text "Hey! What are you trying to pull?"
line "You don't have a Lapras!?!"
line "Come see me when you get a Lapras."
done
-Text0422: ; 41c57 (10:5c57)
+Gal1CardInDeckText: ; 41c57 (10:5c57)
text "OK! Let's trade your Lapras"
line "for my Arcanine..."
line "Oh! I see your Lapras"
@@ -382,23 +382,23 @@ Text0422: ; 41c57 (10:5c57)
line ""
done
-Text0423: ; 41cf7 (10:5cf7)
+Gal1LetsTradeText: ; 41cf7 (10:5cf7)
text "OK then, let's trade your"
line "Lapras for my Arcanine."
done
-Text0424: ; 41d2a (10:5d2a)
+Gal1TradeCompleteText: ; 41d2a (10:5d2a)
text "<RAMNAME> traded a Lapras"
line "for an Arcanine!"
done
-Text0425: ; 41d4e (10:5d4e)
+Gal1ThanksText: ; 41d4e (10:5d4e)
text "Thanks, <RAMNAME>!"
line "I'll take good care"
line "of this Lapras."
done
-Text0426: ; 41d7e (10:5d7e)
+Gal1AfterTradeText: ; 41d7e (10:5d7e)
text "Hey! You're the one who"
line "gave me your Lapras!"
line "I'm taking good care of"
diff --git a/src/text/text5.asm b/src/text/text5.asm
index ba26ccb..809cb63 100644
--- a/src/text/text5.asm
+++ b/src/text/text5.asm
@@ -95,7 +95,7 @@ Text049e: ; 4437a (11:437a)
line "Well, I hope I see you around!"
done
-Text049f: ; 443d6 (11:43d6)
+WhatIsADeckText: ; 443d6 (11:43d6)
text "What is a deck?"
done
diff --git a/src/text/text6.asm b/src/text/text6.asm
index 901e9fe..eb045ea 100644
--- a/src/text/text6.asm
+++ b/src/text/text6.asm
@@ -932,12 +932,12 @@ Text05bc: ; 4ab23 (12:6b23)
line " A new journey has just begun...”"
done
-Text05bd: ; 4ad20 (12:6d20)
+ItsTheChallengeMachineText: ; 4ad20 (12:6d20)
text "It's the Challenge Machine,"
line "created by Dr. Mason!"
done
-Text05be: ; 4ad53 (12:6d53)
+Tech1MasterMedalExplanationText: ; 4ad53 (12:6d53)
text "The 8 Club Masters each own a"
line "Master Medal."
line "The secret of each Club's deck is"
@@ -949,7 +949,7 @@ Text05be: ; 4ad53 (12:6d53)
line "different Decks!"
done
-Text05bf: ; 4ae4d (12:6e4d)
+Tech1AutoDeckMachineExplanationText: ; 4ae4d (12:6e4d)
text "You finally inherited the"
line "Legendary Pokémon Cards!"
line "Did you see the Legendary Auto"
@@ -960,7 +960,7 @@ Text05bf: ; 4ae4d (12:6e4d)
line "to a very powerful deck!"
done
-Text05c0: ; 4af26 (12:6f26)
+Tech1FewEnergyCardsText: ; 4af26 (12:6f26)
text "Excuse me, but you don't seem "
line "to have many Energy cards."
line "Building a deck must be difficult "
@@ -968,17 +968,17 @@ Text05c0: ; 4af26 (12:6f26)
line "Here, take these!"
done
-Text05c1: ; 4afb0 (12:6fb0)
+Tech1ReceivedEnergyCardsText: ; 4afb0 (12:6fb0)
text "<RAMNAME> received some "
line "Energy cards!"
done
-Text05c2: ; 4afd0 (12:6fd0)
+Tech1GoodbyeText: ; 4afd0 (12:6fd0)
text "Goodbye!"
line "Take care!"
done
-Text05c3: ; 4afe5 (12:6fe5)
+Tech2LegendaryCardsExplanationText: ; 4afe5 (12:6fe5)
text "Are you also hoping to inherit"
line "the Legendary Pokémon Cards?"
line "If you want the Legendary Cards,"
@@ -991,14 +991,14 @@ Text05c3: ; 4afe5 (12:6fe5)
line "more about the Legendary Cards."
done
-Text05c4: ; 4b129 (12:7129)
+Tech2LegendaryCardsCongratsText: ; 4b129 (12:7129)
text "You finally inherited the"
line "Legendary Pokémon Cards!"
line "Amazing!"
line "Congratulations, <RAMNAME>!!!"
done
-Text05c5: ; 4b17c (12:717c)
+Tech3BoosterPackExplanationText: ; 4b17c (12:717c)
text "When you defeat a Club Member,"
line "you'll receive a Booster Pack."
line "Each Booster Pack has 10 cards."
@@ -1009,7 +1009,7 @@ Text05c5: ; 4b17c (12:717c)
line "so choose your opponents well."
done
-Text05c6: ; 4b274 (12:7274)
+Tech3LegendaryCardsCongratsText: ; 4b274 (12:7274)
text "Congratulations on inheriting "
line "the Legendary Pokémon Cards,"
line ""
@@ -1019,7 +1019,7 @@ Text05c6: ; 4b274 (12:7274)
line "you'll have a good time!"
done
-Text05c7: ; 4b323 (12:7323)
+Tech4ClubsExplanationText: ; 4b323 (12:7323)
text "I'm sure you already know, but there"
line "are 8 Clubs: the Fighting, Water,"
line "Lightning, Grass, Psychic, Fire,"
@@ -1028,14 +1028,14 @@ Text05c7: ; 4b323 (12:7323)
line "are specific to that Club."
done
-Text05c8: ; 4b3e2 (12:73e2)
+Tech4DefeatedTheGrandMastersText: ; 4b3e2 (12:73e2)
text "Amazing! You beat the 8 Club "
line "Masters!"
line "And you even defeated the"
line "4 Grand Masters! Amazing!"
done
-Text05c9: ; 4b43e (12:743e)
+Tech5DiaryAndEmailExplanationText: ; 4b43e (12:743e)
text "To save your game, press START"
line "and choose Diary from the Menu."
line "You can do all sorts of stuff with"
@@ -1044,7 +1044,7 @@ Text05c9: ; 4b43e (12:743e)
line "Dr. Mason on that PC, too!"
done
-Text05ca: ; 4b4ea (12:74ea)
+Tech5ChallengeMachineExplanationText: ; 4b4ea (12:74ea)
text "This is the Challenge Machine"
line "created by Dr. Mason!"
line "The Challenge Machine is a "
diff --git a/src/text/text8.asm b/src/text/text8.asm
index c76de49..6bd0fe6 100644
--- a/src/text/text8.asm
+++ b/src/text/text8.asm
@@ -205,7 +205,7 @@ Text06a1: ; 509f2 (14:49f2)
line "Bye!"
done
-Text06a2: ; 50a9e (14:4a9e)
+FoundLv9SlowpokeText: ; 50a9e (14:4a9e)
text "<RAMNAME>"
line "checked the wall!"
line ""
diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm
index b793894..50838e6 100644
--- a/src/text/text_offsets.asm
+++ b/src/text/text_offsets.asm
@@ -56,8 +56,8 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text0034 ; 0x0034
textpointer PokemonsAttackText ; 0x0035
textpointer ResistanceLessDamageText ; 0x0036
- textpointer Text0037 ; 0x0037
- textpointer Text0038 ; 0x0038
+ textpointer WeaknessMoreDamageText ; 0x0037
+ textpointer WeaknessMoreDamage2Text ; 0x0038
textpointer ResistanceNoDamageText ; 0x0039
textpointer AttackDamageText ; 0x003a
textpointer NoDamageText ; 0x003b
@@ -407,7 +407,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer ReceivedPromotionalSurfingPikachuText ; 0x0193
textpointer Text0194 ; 0x0194
textpointer Text0195 ; 0x0195
- textpointer Text0196 ; 0x0196
+ textpointer BoosterPackText ; 0x0196
textpointer Text0197 ; 0x0197
textpointer Text0198 ; 0x0198
textpointer Text0199 ; 0x0199
@@ -538,7 +538,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer InchesText ; 0x0216
textpointer YourDiscardPileText ; 0x0217
textpointer OpponentsDiscardPileText ; 0x0218
- textpointer Text0219 ; 0x0219
+ textpointer DeckText ; 0x0219
textpointer Text021a ; 0x021a
textpointer Text021b ; 0x021b
textpointer Text021c ; 0x021c
@@ -546,8 +546,8 @@ TextOffsets:: ; 34000 (d:4000)
textpointer WhatIsYourNameText ; 0x021e
textpointer Text021f ; 0x021f
textpointer Text0220 ; 0x0220
- textpointer Text0221 ; 0x0221
- textpointer NamingScreenKeyboardText ; 0x0222
+ textpointer PlayerNameKeyboardText ; 0x0221
+ textpointer DeckNameKeyboardText ; 0x0222
textpointer NewDeckText ; 0x0223
textpointer PleaseSelectDeckText ; 0x0224
textpointer Text0225 ; 0x0225
@@ -556,10 +556,10 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text0228 ; 0x0228
textpointer Text0229 ; 0x0229
textpointer ChosenAsDuelingDeckText ; 0x022a
- textpointer Text022b ; 0x022b
- textpointer Text022c ; 0x022c
- textpointer Text022d ; 0x022d
- textpointer Text022e ; 0x022e
+ textpointer Deck1Text ; 0x022b
+ textpointer Deck2Text ; 0x022c
+ textpointer Deck3Text ; 0x022d
+ textpointer Deck4Text ; 0x022e
textpointer ThereIsNoDeckHereText ; 0x022f
textpointer Text0230 ; 0x0230
textpointer Text0231 ; 0x0231
@@ -627,7 +627,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text026f ; 0x026f
textpointer Text0270 ; 0x0270
textpointer Text0271 ; 0x0271
- textpointer Text0272 ; 0x0272
+ textpointer OKIfFileDeletedText ; 0x0272
textpointer Text0273 ; 0x0273
textpointer Text0274 ; 0x0274
textpointer Text0275 ; 0x0275
@@ -763,42 +763,42 @@ TextOffsets:: ; 34000 (d:4000)
textpointer GlossaryMenuPage1Text ; 0x02f7
textpointer GlossaryMenuPage2Text ; 0x02f8
textpointer ChooseWordAndPressAButtonText ; 0x02f9
- textpointer Text02fa ; 0x02fa
- textpointer Text02fb ; 0x02fb
- textpointer Text02fc ; 0x02fc
- textpointer Text02fd ; 0x02fd
- textpointer Text02fe ; 0x02fe
- textpointer Text02ff ; 0x02ff
- textpointer Text0300 ; 0x0300
- textpointer Text0301 ; 0x0301
- textpointer Text0302 ; 0x0302
- textpointer Text0303 ; 0x0303
- textpointer Text0304 ; 0x0304
- textpointer Text0305 ; 0x0305
- textpointer Text0306 ; 0x0306
- textpointer Text0307 ; 0x0307
- textpointer Text0308 ; 0x0308
- textpointer Text0309 ; 0x0309
- textpointer Text030a ; 0x030a
- textpointer Text030b ; 0x030b
- textpointer Text030c ; 0x030c
- textpointer Text030d ; 0x030d
- textpointer Text030e ; 0x030e
- textpointer Text030f ; 0x030f
- textpointer Text0310 ; 0x0310
- textpointer Text0311 ; 0x0311
- textpointer Text0312 ; 0x0312
- textpointer Text0313 ; 0x0313
- textpointer Text0314 ; 0x0314
- textpointer Text0315 ; 0x0315
- textpointer Text0316 ; 0x0316
- textpointer Text0317 ; 0x0317
- textpointer Text0318 ; 0x0318
- textpointer Text0319 ; 0x0319
- textpointer Text031a ; 0x031a
- textpointer Text031b ; 0x031b
- textpointer Text031c ; 0x031c
- textpointer Text031d ; 0x031d
+ textpointer AboutTheDeckText ; 0x02fa
+ textpointer AboutTheDiscardPileText ; 0x02fb
+ textpointer AboutTheHandText ; 0x02fc
+ textpointer AboutTheArenaText ; 0x02fd
+ textpointer AboutTheBenchText ; 0x02fe
+ textpointer AboutTheActivePokemonText ; 0x02ff
+ textpointer AboutBenchPokemonText ; 0x0300
+ textpointer AboutPrizesText ; 0x0301
+ textpointer AboutDamageCountersText ; 0x0302
+ textpointer AboutEnergyCardsText ; 0x0303
+ textpointer AboutTrainerCardsText ; 0x0304
+ textpointer AboutBasicPokemonText ; 0x0305
+ textpointer AboutEvolutionCardsText ; 0x0306
+ textpointer AboutAttackingText ; 0x0307
+ textpointer AboutPokemonPowerText ; 0x0308
+ textpointer AboutWeaknessText ; 0x0309
+ textpointer AboutResistanceText ; 0x030a
+ textpointer AboutRetreatingText ; 0x030b
+ textpointer DeckDescriptionText ; 0x030c
+ textpointer DiscardPileDescriptionText ; 0x030d
+ textpointer HandDescriptionText ; 0x030e
+ textpointer ArenaDescriptionText ; 0x030f
+ textpointer BenchDescriptionText ; 0x0310
+ textpointer ActivePokemonDescriptionText ; 0x0311
+ textpointer BenchPokemonDescriptionText ; 0x0312
+ textpointer PrizesDescriptionText ; 0x0313
+ textpointer DamageCountersDescriptionText ; 0x0314
+ textpointer EnergyCardsDescriptionText ; 0x0315
+ textpointer TrainerCardsDescriptionText ; 0x0316
+ textpointer BasicPokemonDescriptionText ; 0x0317
+ textpointer EvolutionCardsDescriptionText ; 0x0318
+ textpointer AttackingDescriptionText ; 0x0319
+ textpointer PokemonPowerDescriptionText ; 0x031a
+ textpointer WeaknessDescriptionText ; 0x031b
+ textpointer ResistanceDescriptionText ; 0x031c
+ textpointer RetreatingDescriptionText ; 0x031d
textpointer Text031e ; 0x031e
textpointer Text031f ; 0x031f
textpointer Text0320 ; 0x0320
@@ -817,18 +817,18 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text032d ; 0x032d
textpointer Text032e ; 0x032e
textpointer Text032f ; 0x032f
- textpointer Text0330 ; 0x0330
- textpointer Text0331 ; 0x0331
- textpointer Text0332 ; 0x0332
- textpointer Text0333 ; 0x0333
- textpointer Text0334 ; 0x0334
- textpointer Text0335 ; 0x0335
- textpointer Text0336 ; 0x0336
- textpointer Text0337 ; 0x0337
- textpointer Text0338 ; 0x0338
- textpointer Text0339 ; 0x0339
- textpointer Text033a ; 0x033a
- textpointer Text033b ; 0x033b
+ textpointer MasonLaboratoryMapNameText ; 0x0330
+ textpointer MrIshiharasHouseMapNameText ; 0x0331
+ textpointer FightingClubMapNameText ; 0x0332
+ textpointer RockClubMapNameText ; 0x0333
+ textpointer WaterClubMapNameText ; 0x0334
+ textpointer LightningClubMapNameText ; 0x0335
+ textpointer GrassClubMapNameText ; 0x0336
+ textpointer PsychicClubMapNameText ; 0x0337
+ textpointer ScienceClubMapNameText ; 0x0338
+ textpointer FireClubMapNameText ; 0x0339
+ textpointer ChallengeHallMapNameText ; 0x033a
+ textpointer PokemonDomeMapNameText ; 0x033b
textpointer Text033c ; 0x033c
textpointer Text033d ; 0x033d
textpointer Text033e ; 0x033e
@@ -1001,29 +1001,29 @@ TextOffsets:: ; 34000 (d:4000)
textpointer GrannyNPCName ; 0x03e5
textpointer GuideNPCName ; 0x03e6
textpointer AaronNPCName ; 0x03e7
- textpointer Text03e8 ; 0x03e8
- textpointer Text03e9 ; 0x03e9
- textpointer Text03ea ; 0x03ea
- textpointer Text03eb ; 0x03eb
- textpointer Text03ec ; 0x03ec
- textpointer Text03ed ; 0x03ed
- textpointer Text03ee ; 0x03ee
- textpointer Text03ef ; 0x03ef
- textpointer Text03f0 ; 0x03f0
- textpointer Text03f1 ; 0x03f1
- textpointer Text03f2 ; 0x03f2
- textpointer Text03f3 ; 0x03f3
- textpointer Text03f4 ; 0x03f4
- textpointer Text03f5 ; 0x03f5
- textpointer Text03f6 ; 0x03f6
- textpointer Text03f7 ; 0x03f7
- textpointer Text03f8 ; 0x03f8
- textpointer Text03f9 ; 0x03f9
- textpointer Text03fa ; 0x03fa
- textpointer Text03fb ; 0x03fb
- textpointer Text03fc ; 0x03fc
- textpointer Text03fd ; 0x03fd
- textpointer Text03fe ; 0x03fe
+ textpointer MewtwoTradeCardName ; 0x03e8
+ textpointer MewTradeCardName ; 0x03e9
+ textpointer ArcanineTradeCardName ; 0x03ea
+ textpointer PikachuTradeCardName ; 0x03eb
+ textpointer SurfingPikachuTradeCardName ; 0x03ec
+ textpointer ElectabuzzTradeCardName ; 0x03ed
+ textpointer SlowpokeTradeCardName ; 0x03ee
+ textpointer JigglypuffTradeCardName ; 0x03ef
+ textpointer ZapdosLegendaryCardName ; 0x03f0
+ textpointer MoltresLegendaryCardName ; 0x03f1
+ textpointer ArticunoLegendaryCardName ; 0x03f2
+ textpointer DragoniteLegendaryCardName ; 0x03f3
+ textpointer SuperEnergyRetrievalTradeCardName ; 0x03f4
+ textpointer FlyingPikachuTradeCardName ; 0x03f5
+ textpointer LightningAndFireDeckChoiceText ; 0x03f6
+ textpointer WaterAndFightingDeckChoiceText ; 0x03f7
+ textpointer GrassAndPsychicDeckChoiceText ; 0x03f8
+ textpointer SelectDeckToDuelText ; 0x03f9
+ textpointer CharmanderAndFriendsDeckChoiceText ; 0x03fa
+ textpointer SquirtleAndFriendsDeckChoiceText ; 0x03fb
+ textpointer BulbasaurAndFriendsDeckChoiceText ; 0x03fc
+ textpointer SelectDeckToTakeText ; 0x03fd
+ textpointer HowCanIHelpText ; 0x03fe
textpointer Text03ff ; 0x03ff
textpointer Text0400 ; 0x0400
textpointer Text0401 ; 0x0401
@@ -1051,19 +1051,19 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text0417 ; 0x0417
textpointer Text0418 ; 0x0418
textpointer Text0419 ; 0x0419
- textpointer Text041a ; 0x041a
- textpointer Text041b ; 0x041b
+ textpointer PokemonTradingCards101Text ; 0x041a
+ textpointer PlaceholderMessageText ; 0x041b
textpointer Text041c ; 0x041c
- textpointer Text041d ; 0x041d
- textpointer Text041e ; 0x041e
- textpointer Text041f ; 0x041f
- textpointer Text0420 ; 0x0420
- textpointer Text0421 ; 0x0421
- textpointer Text0422 ; 0x0422
- textpointer Text0423 ; 0x0423
- textpointer Text0424 ; 0x0424
- textpointer Text0425 ; 0x0425
- textpointer Text0426 ; 0x0426
+ textpointer Gal1WantToTrade1Text ; 0x041d
+ textpointer Gal1WantToTrade2Text ; 0x041e
+ textpointer Gal1WouldYouLikeToTradeText ; 0x041f
+ textpointer Gal1DeclinedTradeText ; 0x0420
+ textpointer Gal1DontOwnCardText ; 0x0421
+ textpointer Gal1CardInDeckText ; 0x0422
+ textpointer Gal1LetsTradeText ; 0x0423
+ textpointer Gal1TradeCompleteText ; 0x0424
+ textpointer Gal1ThanksText ; 0x0425
+ textpointer Gal1AfterTradeText ; 0x0426
textpointer Text0427 ; 0x0427
textpointer Text0428 ; 0x0428
textpointer Text0429 ; 0x0429
@@ -1184,7 +1184,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text049c ; 0x049c
textpointer Text049d ; 0x049d
textpointer Text049e ; 0x049e
- textpointer Text049f ; 0x049f
+ textpointer WhatIsADeckText ; 0x049f
textpointer Text04a0 ; 0x04a0
textpointer Text04a1 ; 0x04a1
textpointer Text04a2 ; 0x04a2
@@ -1470,20 +1470,20 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text05ba ; 0x05ba
textpointer Text05bb ; 0x05bb
textpointer Text05bc ; 0x05bc
- textpointer Text05bd ; 0x05bd
- textpointer Text05be ; 0x05be
- textpointer Text05bf ; 0x05bf
- textpointer Text05c0 ; 0x05c0
- textpointer Text05c1 ; 0x05c1
- textpointer Text05c2 ; 0x05c2
- textpointer Text05c3 ; 0x05c3
- textpointer Text05c4 ; 0x05c4
- textpointer Text05c5 ; 0x05c5
- textpointer Text05c6 ; 0x05c6
- textpointer Text05c7 ; 0x05c7
- textpointer Text05c8 ; 0x05c8
- textpointer Text05c9 ; 0x05c9
- textpointer Text05ca ; 0x05ca
+ textpointer ItsTheChallengeMachineText ; 0x05bd
+ textpointer Tech1MasterMedalExplanationText ; 0x05be
+ textpointer Tech1AutoDeckMachineExplanationText ; 0x05bf
+ textpointer Tech1FewEnergyCardsText ; 0x05c0
+ textpointer Tech1ReceivedEnergyCardsText ; 0x05c1
+ textpointer Tech1GoodbyeText ; 0x05c2
+ textpointer Tech2LegendaryCardsExplanationText ; 0x05c3
+ textpointer Tech2LegendaryCardsCongratsText ; 0x05c4
+ textpointer Tech3BoosterPackExplanationText ; 0x05c5
+ textpointer Tech3LegendaryCardsCongratsText ; 0x05c6
+ textpointer Tech4ClubsExplanationText ; 0x05c7
+ textpointer Tech4DefeatedTheGrandMastersText ; 0x05c8
+ textpointer Tech5DiaryAndEmailExplanationText ; 0x05c9
+ textpointer Tech5ChallengeMachineExplanationText ; 0x05ca
textpointer Text05cb ; 0x05cb
textpointer Text05cc ; 0x05cc
textpointer Text05cd ; 0x05cd
@@ -1699,7 +1699,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text069f ; 0x069f
textpointer Text06a0 ; 0x06a0
textpointer Text06a1 ; 0x06a1
- textpointer Text06a2 ; 0x06a2
+ textpointer FoundLv9SlowpokeText ; 0x06a2
textpointer Text06a3 ; 0x06a3
textpointer Text06a4 ; 0x06a4
textpointer Text06a5 ; 0x06a5
diff --git a/src/wram.asm b/src/wram.asm
index 30ea0e3..238c36f 100644
--- a/src/wram.asm
+++ b/src/wram.asm
@@ -404,7 +404,10 @@ wDuelTempList:: ; c510
; this is kept updated with some default text that is used
; when the text printing functions are called with text id $0000
wDefaultText:: ; c590
- ds $70
+ ds $2
+
+wc592:: ; c592
+ ds $6e
SECTION "WRAM0 Text Engine", WRAM0
@@ -1622,6 +1625,7 @@ wce53:: ; ce53
wDuelInitialPrizesUpperBitsSet:: ; ce55
ds $1
+wce56:: ; ce56
ds $1
; it's used for restore the position of cursor
@@ -1638,7 +1642,10 @@ wInPlayAreaTemporaryPosition:: ; ce58
wce59:: ; ce59
ds $1
- ds $3
+ ds $2
+
+wce5c:: ; ce5c
+ ds $1
; stores whether there are Pokemon in play area
; player arena Pokemon sets bit 0
@@ -1930,7 +1937,7 @@ wd0a5:: ; d0a5
wd0a6:: ; d0a6
ds $1
-dw0a7:: ; d0a7
+wd0a7:: ; d0a7
ds $2
wd0a9:: ; d0a9
@@ -2115,6 +2122,7 @@ wd237:: ; d237
wd238:: ; d238
ds $1
+wd239:: ; d239
ds $1
wd23a:: ; d23a
@@ -2132,7 +2140,10 @@ wd23d:: ; d23d
wd23e:: ; d23e
ds $1
- ds $50
+ ds $4f
+
+wd28e:: ; d28e
+ ds $1
wd28f:: ; d28f
ds $1
@@ -2666,7 +2677,7 @@ wd693:: ; d693
wMultichoiceTextboxResult_Sam:: ; d694
ds $1
-
+
UNION
wMultichoiceTextboxResult_ChooseDeckToDuelAgainst:: ; d695
@@ -2687,7 +2698,19 @@ wd696:: ; d696
wd697:: ; d697
ds $1
- ds $6e8
+wd698:: ; d698
+ ds $1
+
+wd699:: ; d699
+ ds $1
+
+wd69a:: ; d69a
+ ds $1
+
+wd69b:: ; d69b
+ ds $1
+
+ ds $6e4
SECTION "WRAM1 Audio", WRAMX
diff --git a/tools/constants.py b/tools/constants.py
new file mode 100644
index 0000000..ee3069e
--- /dev/null
+++ b/tools/constants.py
@@ -0,0 +1,740 @@
+boosters = {
+ 0x00: "BOOSTER_COLOSSEUM_NEUTRAL",
+ 0x01: "BOOSTER_COLOSSEUM_GRASS",
+ 0x02: "BOOSTER_COLOSSEUM_FIRE",
+ 0x03: "BOOSTER_COLOSSEUM_WATER",
+ 0x04: "BOOSTER_COLOSSEUM_LIGHTNING",
+ 0x05: "BOOSTER_COLOSSEUM_FIGHTING",
+ 0x06: "BOOSTER_COLOSSEUM_TRAINER",
+ 0x07: "BOOSTER_EVOLUTION_NEUTRAL",
+ 0x08: "BOOSTER_EVOLUTION_GRASS",
+ 0x09: "BOOSTER_EVOLUTION_FIRE",
+ 0x0a: "BOOSTER_EVOLUTION_WATER",
+ 0x0b: "BOOSTER_EVOLUTION_FIGHTING",
+ 0x0c: "BOOSTER_EVOLUTION_PSYCHIC",
+ 0x0d: "BOOSTER_EVOLUTION_TRAINER",
+ 0x0e: "BOOSTER_MYSTERY_NEUTRAL",
+ 0x0f: "BOOSTER_MYSTERY_GRASS_COLORLESS",
+ 0x10: "BOOSTER_MYSTERY_WATER_COLORLESS",
+ 0x11: "BOOSTER_MYSTERY_LIGHTNING_COLORLESS",
+ 0x12: "BOOSTER_MYSTERY_FIGHTING_COLORLESS",
+ 0x13: "BOOSTER_MYSTERY_TRAINER_COLORLESS",
+ 0x14: "BOOSTER_LABORATORY_NEUTRAL",
+ 0x15: "BOOSTER_LABORATORY_GRASS",
+ 0x16: "BOOSTER_LABORATORY_WATER",
+ 0x17: "BOOSTER_LABORATORY_PSYCHIC",
+ 0x18: "BOOSTER_LABORATORY_TRAINER",
+ 0x19: "BOOSTER_ENERGY_LIGHTNING_FIRE",
+ 0x1a: "BOOSTER_ENERGY_WATER_FIGHTING",
+ 0x1b: "BOOSTER_ENERGY_GRASS_PSYCHIC",
+ 0x1c: "BOOSTER_ENERGY_RANDOM",
+ 0xff: "NO_BOOSTER",
+}
+
+cards = {
+ 0x00: "VARIABLE_CARD",
+ 0x01: "GRASS_ENERGY",
+ 0x02: "FIRE_ENERGY",
+ 0x03: "WATER_ENERGY",
+ 0x04: "LIGHTNING_ENERGY",
+ 0x05: "FIGHTING_ENERGY",
+ 0x06: "PSYCHIC_ENERGY",
+ 0x07: "DOUBLE_COLORLESS_ENERGY",
+ 0x08: "BULBASAUR",
+ 0x09: "IVYSAUR",
+ 0x0a: "VENUSAUR1",
+ 0x0b: "VENUSAUR2",
+ 0x0c: "CATERPIE",
+ 0x0d: "METAPOD",
+ 0x0e: "BUTTERFREE",
+ 0x0f: "WEEDLE",
+ 0x10: "KAKUNA",
+ 0x11: "BEEDRILL",
+ 0x12: "EKANS",
+ 0x13: "ARBOK",
+ 0x14: "NIDORANF",
+ 0x15: "NIDORINA",
+ 0x16: "NIDOQUEEN",
+ 0x17: "NIDORANM",
+ 0x18: "NIDORINO",
+ 0x19: "NIDOKING",
+ 0x1a: "ZUBAT",
+ 0x1b: "GOLBAT",
+ 0x1c: "ODDISH",
+ 0x1d: "GLOOM",
+ 0x1e: "VILEPLUME",
+ 0x1f: "PARAS",
+ 0x20: "PARASECT",
+ 0x21: "VENONAT",
+ 0x22: "VENOMOTH",
+ 0x23: "BELLSPROUT",
+ 0x24: "WEEPINBELL",
+ 0x25: "VICTREEBEL",
+ 0x26: "GRIMER",
+ 0x27: "MUK",
+ 0x28: "EXEGGCUTE",
+ 0x29: "EXEGGUTOR",
+ 0x2a: "KOFFING",
+ 0x2b: "WEEZING",
+ 0x2c: "TANGELA1",
+ 0x2d: "TANGELA2",
+ 0x2e: "SCYTHER",
+ 0x2f: "PINSIR",
+ 0x30: "CHARMANDER",
+ 0x31: "CHARMELEON",
+ 0x32: "CHARIZARD",
+ 0x33: "VULPIX",
+ 0x34: "NINETAILS1",
+ 0x35: "NINETAILS2",
+ 0x36: "GROWLITHE",
+ 0x37: "ARCANINE1",
+ 0x38: "ARCANINE2",
+ 0x39: "PONYTA",
+ 0x3a: "RAPIDASH",
+ 0x3b: "MAGMAR1",
+ 0x3c: "MAGMAR2",
+ 0x3d: "FLAREON1",
+ 0x3e: "FLAREON2",
+ 0x3f: "MOLTRES1",
+ 0x40: "MOLTRES2",
+ 0x41: "SQUIRTLE",
+ 0x42: "WARTORTLE",
+ 0x43: "BLASTOISE",
+ 0x44: "PSYDUCK",
+ 0x45: "GOLDUCK",
+ 0x46: "POLIWAG",
+ 0x47: "POLIWHIRL",
+ 0x48: "POLIWRATH",
+ 0x49: "TENTACOOL",
+ 0x4a: "TENTACRUEL",
+ 0x4b: "SEEL",
+ 0x4c: "DEWGONG",
+ 0x4d: "SHELLDER",
+ 0x4e: "CLOYSTER",
+ 0x4f: "KRABBY",
+ 0x50: "KINGLER",
+ 0x51: "HORSEA",
+ 0x52: "SEADRA",
+ 0x53: "GOLDEEN",
+ 0x54: "SEAKING",
+ 0x55: "STARYU",
+ 0x56: "STARMIE",
+ 0x57: "MAGIKARP",
+ 0x58: "GYARADOS",
+ 0x59: "LAPRAS",
+ 0x5a: "VAPOREON1",
+ 0x5b: "VAPOREON2",
+ 0x5c: "OMANYTE",
+ 0x5d: "OMASTAR",
+ 0x5e: "ARTICUNO1",
+ 0x5f: "ARTICUNO2",
+ 0x60: "PIKACHU1",
+ 0x61: "PIKACHU2",
+ 0x62: "PIKACHU3",
+ 0x63: "PIKACHU4",
+ 0x64: "FLYING_PIKACHU",
+ 0x65: "SURFING_PIKACHU1",
+ 0x66: "SURFING_PIKACHU2",
+ 0x67: "RAICHU1",
+ 0x68: "RAICHU2",
+ 0x69: "MAGNEMITE1",
+ 0x6a: "MAGNEMITE2",
+ 0x6b: "MAGNETON1",
+ 0x6c: "MAGNETON2",
+ 0x6d: "VOLTORB",
+ 0x6e: "ELECTRODE1",
+ 0x6f: "ELECTRODE2",
+ 0x70: "ELECTABUZZ1",
+ 0x71: "ELECTABUZZ2",
+ 0x72: "JOLTEON1",
+ 0x73: "JOLTEON2",
+ 0x74: "ZAPDOS1",
+ 0x75: "ZAPDOS2",
+ 0x76: "ZAPDOS3",
+ 0x77: "SANDSHREW",
+ 0x78: "SANDSLASH",
+ 0x79: "DIGLETT",
+ 0x7a: "DUGTRIO",
+ 0x7b: "MANKEY",
+ 0x7c: "PRIMEAPE",
+ 0x7d: "MACHOP",
+ 0x7e: "MACHOKE",
+ 0x7f: "MACHAMP",
+ 0x80: "GEODUDE",
+ 0x81: "GRAVELER",
+ 0x82: "GOLEM",
+ 0x83: "ONIX",
+ 0x84: "CUBONE",
+ 0x85: "MAROWAK1",
+ 0x86: "MAROWAK2",
+ 0x87: "HITMONLEE",
+ 0x88: "HITMONCHAN",
+ 0x89: "RHYHORN",
+ 0x8a: "RHYDON",
+ 0x8b: "KABUTO",
+ 0x8c: "KABUTOPS",
+ 0x8d: "AERODACTYL",
+ 0x8e: "ABRA",
+ 0x8f: "KADABRA",
+ 0x90: "ALAKAZAM",
+ 0x91: "SLOWPOKE1",
+ 0x92: "SLOWPOKE2",
+ 0x93: "SLOWBRO",
+ 0x94: "GASTLY1",
+ 0x95: "GASTLY2",
+ 0x96: "HAUNTER1",
+ 0x97: "HAUNTER2",
+ 0x98: "GENGAR",
+ 0x99: "DROWZEE",
+ 0x9a: "HYPNO",
+ 0x9b: "MR_MIME",
+ 0x9c: "JYNX",
+ 0x9d: "MEWTWO1",
+ 0x9e: "MEWTWO2",
+ 0x9f: "MEWTWO3",
+ 0xa0: "MEW1",
+ 0xa1: "MEW2",
+ 0xa2: "MEW3",
+ 0xa3: "PIDGEY",
+ 0xa4: "PIDGEOTTO",
+ 0xa5: "PIDGEOT1",
+ 0xa6: "PIDGEOT2",
+ 0xa7: "RATTATA",
+ 0xa8: "RATICATE",
+ 0xa9: "SPEAROW",
+ 0xaa: "FEAROW",
+ 0xab: "CLEFAIRY",
+ 0xac: "CLEFABLE",
+ 0xad: "JIGGLYPUFF1",
+ 0xae: "JIGGLYPUFF2",
+ 0xaf: "JIGGLYPUFF3",
+ 0xb0: "WIGGLYTUFF",
+ 0xb1: "MEOWTH1",
+ 0xb2: "MEOWTH2",
+ 0xb3: "PERSIAN",
+ 0xb4: "FARFETCHD",
+ 0xb5: "DODUO",
+ 0xb6: "DODRIO",
+ 0xb7: "LICKITUNG",
+ 0xb8: "CHANSEY",
+ 0xb9: "KANGASKHAN",
+ 0xba: "TAUROS",
+ 0xbb: "DITTO",
+ 0xbc: "EEVEE",
+ 0xbd: "PORYGON",
+ 0xbe: "SNORLAX",
+ 0xbf: "DRATINI",
+ 0xc0: "DRAGONAIR",
+ 0xc1: "DRAGONITE1",
+ 0xc2: "DRAGONITE2",
+ 0xc3: "PROFESSOR_OAK",
+ 0xc4: "IMPOSTER_PROFESSOR_OAK",
+ 0xc5: "BILL",
+ 0xc6: "MR_FUJI",
+ 0xc7: "LASS",
+ 0xc8: "IMAKUNI_CARD",
+ 0xc9: "POKEMON_TRADER",
+ 0xca: "POKEMON_BREEDER",
+ 0xcb: "CLEFAIRY_DOLL",
+ 0xcc: "MYSTERIOUS_FOSSIL",
+ 0xcd: "ENERGY_RETRIEVAL",
+ 0xce: "SUPER_ENERGY_RETRIEVAL",
+ 0xcf: "ENERGY_SEARCH",
+ 0xd0: "ENERGY_REMOVAL",
+ 0xd1: "SUPER_ENERGY_REMOVAL",
+ 0xd2: "SWITCH",
+ 0xd3: "POKEMON_CENTER",
+ 0xd4: "POKE_BALL",
+ 0xd5: "SCOOP_UP",
+ 0xd6: "COMPUTER_SEARCH",
+ 0xd7: "POKEDEX",
+ 0xd8: "PLUSPOWER",
+ 0xd9: "DEFENDER",
+ 0xda: "ITEM_FINDER",
+ 0xdb: "GUST_OF_WIND",
+ 0xdc: "DEVOLUTION_SPRAY",
+ 0xdd: "POTION",
+ 0xde: "SUPER_POTION",
+ 0xdf: "FULL_HEAL",
+ 0xe0: "REVIVE",
+ 0xe1: "MAINTENANCE",
+ 0xe2: "POKEMON_FLUTE",
+ 0xe3: "GAMBLER",
+ 0xe4: "RECYCLE",
+ 0xff: "$ff",
+}
+
+decks = {
+ 0x00: "SAMS_PRACTICE_DECK_ID",
+ 0x01: "PRACTICE_PLAYER_DECK_ID",
+ 0x02: "SAMS_NORMAL_DECK_ID",
+ 0x03: "CHARMANDER_AND_FRIENDS_DECK_ID",
+ 0x04: "CHARMANDER_EXTRA_DECK_ID",
+ 0x05: "SQUIRTLE_AND_FRIENDS_DECK_ID",
+ 0x06: "SQUIRTLE_EXTRA_DECK_ID",
+ 0x07: "BULBASAUR_AND_FRIENDS_DECK_ID",
+ 0x08: "BULBASAUR_EXTRA_DECK_ID",
+ 0x09: "LIGHTNING_AND_FIRE_DECK_ID",
+ 0x0a: "WATER_AND_FIGHTING_DECK_ID",
+ 0x0b: "GRASS_AND_PSYCHIC_DECK_ID",
+ 0x0c: "LEGENDARY_MOLTRES_DECK_ID",
+ 0x0d: "LEGENDARY_ZAPDOS_DECK_ID",
+ 0x0e: "LEGENDARY_ARTICUNO_DECK_ID",
+ 0x0f: "LEGENDARY_DRAGONITE_DECK_ID",
+ 0x10: "FIRST_STRIKE_DECK_ID",
+ 0x11: "ROCK_CRUSHER_DECK_ID",
+ 0x12: "GO_GO_RAIN_DANCE_DECK_ID",
+ 0x13: "ZAPPING_SELFDESTRUCT_DECK_ID",
+ 0x14: "FLOWER_POWER_DECK_ID",
+ 0x15: "STRANGE_PSYSHOCK_DECK_ID",
+ 0x16: "WONDERS_OF_SCIENCE_DECK_ID",
+ 0x17: "FIRE_CHARGE_DECK_ID",
+ 0x18: "IM_RONALD_DECK_ID",
+ 0x19: "POWERFUL_RONALD_DECK_ID",
+ 0x1a: "INVINCIBLE_RONALD_DECK_ID",
+ 0x1b: "LEGENDARY_RONALD_DECK_ID",
+ 0x1c: "MUSCLES_FOR_BRAINS_DECK_ID",
+ 0x1d: "HEATED_BATTLE_DECK_ID",
+ 0x1e: "LOVE_TO_BATTLE_DECK_ID",
+ 0x1f: "EXCAVATION_DECK_ID",
+ 0x20: "BLISTERING_POKEMON_DECK_ID",
+ 0x21: "HARD_POKEMON_DECK_ID",
+ 0x22: "WATERFRONT_POKEMON_DECK_ID",
+ 0x23: "LONELY_FRIENDS_DECK_ID",
+ 0x24: "SOUND_OF_THE_WAVES_DECK_ID",
+ 0x25: "PIKACHU_DECK_ID",
+ 0x26: "BOOM_BOOM_SELFDESTRUCT_DECK_ID",
+ 0x27: "POWER_GENERATOR_DECK_ID",
+ 0x28: "ETCETERA_DECK_ID",
+ 0x29: "FLOWER_GARDEN_DECK_ID",
+ 0x2a: "KALEIDOSCOPE_DECK_ID",
+ 0x2b: "GHOST_DECK_ID",
+ 0x2c: "NAP_TIME_DECK_ID",
+ 0x2d: "STRANGE_POWER_DECK_ID",
+ 0x2e: "FLYIN_POKEMON_DECK_ID",
+ 0x2f: "LOVELY_NIDORAN_DECK_ID",
+ 0x30: "POISON_DECK_ID",
+ 0x31: "ANGER_DECK_ID",
+ 0x32: "FLAMETHROWER_DECK_ID",
+ 0x33: "RESHUFFLE_DECK_ID",
+ 0x34: "IMAKUNI_DECK_ID",
+ 0xff: "$ff",
+}
+
+directions = [
+ "NORTH",
+ "EAST",
+ "SOUTH",
+ "WEST",
+]
+
+events = [
+ "EVENT_FLAG_00",
+ "EVENT_FLAG_01",
+ "EVENT_TEMP_TALKED_TO_IMAKUNI",
+ "EVENT_TEMP_BATTLED_IMAKUNI",
+ "EVENT_FLAG_04",
+ "EVENT_FLAG_05",
+ "EVENT_FLAG_06",
+ "EVENT_FLAG_07",
+ "EVENT_FLAG_08",
+ "EVENT_FLAG_09",
+ "EVENT_FLAG_0A",
+ "EVENT_BEAT_AMY",
+ "EVENT_FLAG_0C",
+ "EVENT_FLAG_0D",
+ "EVENT_FLAG_0E",
+ "EVENT_FLAG_0F",
+ "EVENT_FLAG_10",
+ "EVENT_FLAG_11",
+ "EVENT_FLAG_12",
+ "EVENT_IMAKUNI_STATE",
+ "EVENT_FLAG_14",
+ "EVENT_BEAT_SARA",
+ "EVENT_BEAT_AMANDA",
+ "EVENT_FLAG_17",
+ "EVENT_FLAG_18",
+ "EVENT_FLAG_19",
+ "EVENT_FLAG_1A",
+ "EVENT_FLAG_1B",
+ "EVENT_FLAG_1C",
+ "EVENT_FLAG_1D",
+ "EVENT_FLAG_1E",
+ "EVENT_FLAG_1F",
+ "EVENT_FLAG_20",
+ "EVENT_FLAG_21",
+ "EVENT_RECEIVED_LEGENDARY_CARD",
+ "EVENT_FLAG_23",
+ "EVENT_FLAG_24",
+ "EVENT_FLAG_25",
+ "EVENT_FLAG_26",
+ "EVENT_FLAG_27",
+ "EVENT_FLAG_28",
+ "EVENT_FLAG_29",
+ "EVENT_FLAG_2A",
+ "EVENT_FLAG_2B",
+ "EVENT_FLAG_2C",
+ "EVENT_FLAG_2D",
+ "EVENT_MEDAL_COUNT",
+ "EVENT_FLAG_2F",
+ "EVENT_FLAG_30",
+ "EVENT_FLAG_31",
+ "EVENT_FLAG_32",
+ "EVENT_JOSHUA_STATE",
+ "EVENT_IMAKUNI_ROOM",
+ "EVENT_FLAG_35",
+ "EVENT_IMAKUNI_WIN_COUNT",
+ "EVENT_FLAG_37",
+ "EVENT_FLAG_38",
+ "EVENT_FLAG_39",
+ "EVENT_FLAG_3A",
+ "EVENT_FLAG_3B",
+ "FLAG_BEAT_BRITTANY",
+ "EVENT_FLAG_3D",
+ "EVENT_FLAG_3E",
+ "EVENT_FLAG_3F",
+ "EVENT_FLAG_40",
+ "EVENT_FLAG_41",
+ "EVENT_FLAG_42",
+ "EVENT_FLAG_43",
+ "EVENT_FLAG_44",
+ "EVENT_FLAG_45",
+ "EVENT_FLAG_46",
+ "EVENT_FLAG_47",
+ "EVENT_FLAG_48",
+ "EVENT_FLAG_49",
+ "EVENT_FLAG_4A",
+ "EVENT_FLAG_4B",
+ "EVENT_FLAG_4C",
+ "EVENT_FLAG_4D",
+ "EVENT_FLAG_4E",
+ "EVENT_FLAG_4F",
+ "EVENT_FLAG_50",
+ "EVENT_FLAG_51",
+ "EVENT_FLAG_52",
+ "EVENT_FLAG_53",
+ "EVENT_FLAG_54",
+ "EVENT_FLAG_55",
+ "EVENT_FLAG_56",
+ "EVENT_FLAG_57",
+ "EVENT_FLAG_58",
+ "EVENT_FLAG_59",
+ "EVENT_FLAG_5A",
+ "EVENT_FLAG_5B",
+ "EVENT_FLAG_5C",
+ "EVENT_FLAG_5D",
+ "EVENT_FLAG_5E",
+ "EVENT_FLAG_5F",
+ "EVENT_FLAG_60",
+ "EVENT_FLAG_61",
+ "EVENT_FLAG_62",
+ "EVENT_FLAG_63",
+ "EVENT_FLAG_64",
+ "EVENT_FLAG_65",
+ "EVENT_FLAG_66",
+ "EVENT_FLAG_67",
+ "EVENT_FLAG_68",
+ "EVENT_FLAG_69",
+ "EVENT_FLAG_6A",
+ "EVENT_FLAG_6B",
+ "EVENT_FLAG_6C",
+ "EVENT_FLAG_6D",
+ "EVENT_FLAG_6E",
+ "EVENT_FLAG_6F",
+ "EVENT_FLAG_70",
+ "EVENT_FLAG_71",
+ "EVENT_FLAG_72",
+ "EVENT_FLAG_73",
+ "EVENT_FLAG_74",
+ "EVENT_FLAG_75",
+ "EVENT_FLAG_76",
+]
+
+maps = [
+ "OVERWORLD_MAP",
+ "MASON_LABORATORY",
+ "DECK_MACHINE_ROOM",
+ "ISHIHARAS_HOUSE",
+ "FIGHTING_CLUB_ENTRANCE",
+ "FIGHTING_CLUB_LOBBY",
+ "FIGHTING_CLUB",
+ "ROCK_CLUB_ENTRANCE",
+ "ROCK_CLUB_LOBBY",
+ "ROCK_CLUB",
+ "WATER_CLUB_ENTRANCE",
+ "WATER_CLUB_LOBBY",
+ "WATER_CLUB",
+ "LIGHTNING_CLUB_ENTRANCE",
+ "LIGHTNING_CLUB_LOBBY",
+ "LIGHTNING_CLUB",
+ "GRASS_CLUB_ENTRANCE",
+ "GRASS_CLUB_LOBBY",
+ "GRASS_CLUB",
+ "PSYCHIC_CLUB_ENTRANCE",
+ "PSYCHIC_CLUB_LOBBY",
+ "PSYCHIC_CLUB",
+ "SCIENCE_CLUB_ENTRANCE",
+ "SCIENCE_CLUB_LOBBY",
+ "SCIENCE_CLUB",
+ "FIRE_CLUB_ENTRANCE",
+ "FIRE_CLUB_LOBBY",
+ "FIRE_CLUB",
+ "CHALLENGE_HALL_ENTRANCE",
+ "CHALLENGE_HALL_LOBBY",
+ "CHALLENGE_HALL",
+ "POKEMON_DOME_ENTRANCE",
+ "POKEMON_DOME",
+ "HALL_OF_HONOR",
+]
+
+npcs = [
+ "",
+ "NPC_DRMASON",
+ "NPC_RONALD1",
+ "NPC_ISHIHARA",
+ "NPC_IMAKUNI",
+ "NPC_05",
+ "NPC_06",
+ "NPC_SAM",
+ "NPC_TECH1",
+ "NPC_TECH2",
+ "NPC_TECH3",
+ "NPC_TECH4",
+ "NPC_TECH5",
+ "NPC_TECH6",
+ "NPC_CLERK1",
+ "NPC_CLERK2",
+ "NPC_CLERK3",
+ "NPC_CLERK4",
+ "NPC_CLERK5",
+ "NPC_CLERK6",
+ "NPC_CLERK7",
+ "NPC_CLERK8",
+ "NPC_CLERK9",
+ "NPC_CHRIS",
+ "NPC_MICHAEL",
+ "NPC_JESSICA",
+ "NPC_MITCH",
+ "NPC_MATTHEW",
+ "NPC_RYAN",
+ "NPC_ANDREW",
+ "NPC_GENE",
+ "NPC_SARA",
+ "NPC_AMANDA",
+ "NPC_JOSHUA",
+ "NPC_AMY",
+ "NPC_JENNIFER",
+ "NPC_NICHOLAS",
+ "NPC_BRANDON",
+ "NPC_ISAAC",
+ "NPC_BRITTANY",
+ "NPC_KRISTIN",
+ "NPC_HEATHER",
+ "NPC_NIKKI",
+ "NPC_ROBERT",
+ "NPC_DANIEL",
+ "NPC_STEPHANIE",
+ "NPC_MURRAY1",
+ "NPC_JOSEPH",
+ "NPC_DAVID",
+ "NPC_ERIK",
+ "NPC_RICK",
+ "NPC_JOHN",
+ "NPC_ADAM",
+ "NPC_JONATHAN",
+ "NPC_KEN",
+ "NPC_COURTNEY",
+ "NPC_STEVE",
+ "NPC_JACK",
+ "NPC_ROD",
+ "NPC_CLERK10",
+ "NPC_GIFT_CENTER_CLERK",
+ "NPC_MAN1",
+ "NPC_WOMAN1",
+ "NPC_CHAP1",
+ "NPC_GAL1",
+ "NPC_LASS1",
+ "NPC_CHAP2",
+ "NPC_LASS2",
+ "NPC_PAPPY1",
+ "NPC_LAD1",
+ "NPC_LAD2",
+ "NPC_CHAP3",
+ "NPC_CLERK12",
+ "NPC_CLERK13",
+ "NPC_HOST",
+ "NPC_SPECS1",
+ "NPC_BUTCH",
+ "NPC_GRANNY1",
+ "NPC_LASS3",
+ "NPC_MAN2",
+ "NPC_PAPPY2",
+ "NPC_LASS4",
+ "NPC_HOOD1",
+ "NPC_GRANNY2",
+ "NPC_GAL2",
+ "NPC_LAD3",
+ "NPC_GAL3",
+ "NPC_CHAP4",
+ "NPC_MAN3",
+ "NPC_SPECS2",
+ "NPC_SPECS3",
+ "NPC_WOMAN2",
+ "NPC_MANIA",
+ "NPC_PAPPY3",
+ "NPC_GAL4",
+ "NPC_CHAMP",
+ "NPC_HOOD2",
+ "NPC_LASS5",
+ "NPC_CHAP5",
+ "NPC_AARON",
+ "NPC_GUIDE",
+ "NPC_TECH7",
+ "NPC_TECH8",
+ "NPC_TORCH",
+ "NPC_LEGENDARY_CARD_TOP_LEFT",
+ "NPC_LEGENDARY_CARD_TOP_RIGHT",
+ "NPC_LEGENDARY_CARD_LEFT_SPARK",
+ "NPC_LEGENDARY_CARD_BOTTOM_LEFT",
+ "NPC_LEGENDARY_CARD_BOTTOM_RIGHT",
+ "NPC_LEGENDARY_CARD_RIGHT_SPARK",
+ "NPC_6E",
+ "NPC_6F",
+ "NPC_MURRAY2",
+ "NPC_RONALD2",
+ "NPC_RONALD3",
+ "NPC_73",
+]
+
+sfxs = [
+ "SFX_STOP",
+ "SFX_01",
+ "SFX_02",
+ "SFX_03",
+ "SFX_04",
+ "SFX_05",
+ "SFX_06",
+ "SFX_07",
+ "SFX_08",
+ "SFX_09",
+ "SFX_0A",
+ "SFX_0B",
+ "SFX_0C",
+ "SFX_0D",
+ "SFX_0E",
+ "SFX_0F",
+ "SFX_10",
+ "SFX_11",
+ "SFX_12",
+ "SFX_13",
+ "SFX_14",
+ "SFX_15",
+ "SFX_16",
+ "SFX_17",
+ "SFX_18",
+ "SFX_19",
+ "SFX_1A",
+ "SFX_1B",
+ "SFX_1C",
+ "SFX_1D",
+ "SFX_1E",
+ "SFX_1F",
+ "SFX_20",
+ "SFX_21",
+ "SFX_22",
+ "SFX_23",
+ "SFX_24",
+ "SFX_25",
+ "SFX_26",
+ "SFX_27",
+ "SFX_28",
+ "SFX_29",
+ "SFX_2A",
+ "SFX_2B",
+ "SFX_2C",
+ "SFX_2D",
+ "SFX_2E",
+ "SFX_2F",
+ "SFX_30",
+ "SFX_31",
+ "SFX_32",
+ "SFX_33",
+ "SFX_34",
+ "SFX_35",
+ "SFX_36",
+ "SFX_37",
+ "SFX_38",
+ "SFX_39",
+ "SFX_3A",
+ "SFX_3B",
+ "SFX_3C",
+ "SFX_3D",
+ "SFX_3E",
+ "SFX_3F",
+ "SFX_40",
+ "SFX_41",
+ "SFX_42",
+ "SFX_43",
+ "SFX_44",
+ "SFX_45",
+ "SFX_46",
+ "SFX_47",
+ "SFX_48",
+ "SFX_49",
+ "SFX_4A",
+ "SFX_4B",
+ "SFX_4C",
+ "SFX_4D",
+ "SFX_4E",
+ "SFX_4F",
+ "SFX_50",
+ "SFX_51",
+ "SFX_52",
+ "SFX_53",
+ "SFX_54",
+ "SFX_55",
+ "SFX_56",
+ "SFX_57",
+ "SFX_58",
+ "SFX_59",
+ "SFX_5A",
+ "SFX_5B",
+ "SFX_5C",
+ "SFX_5D",
+ "SFX_5E",
+ "SFX_5F",
+]
+
+songs = [
+ "MUSIC_STOP",
+ "MUSIC_TITLESCREEN",
+ "MUSIC_DUEL_THEME_1",
+ "MUSIC_DUEL_THEME_2",
+ "MUSIC_DUEL_THEME_3",
+ "MUSIC_PAUSE_MENU",
+ "MUSIC_PC_MAIN_MENU",
+ "MUSIC_DECK_MACHINE",
+ "MUSIC_CARD_POP",
+ "MUSIC_OVERWORLD",
+ "MUSIC_POKEMON_DOME",
+ "MUSIC_CHALLENGE_HALL",
+ "MUSIC_CLUB_1",
+ "MUSIC_CLUB_2",
+ "MUSIC_CLUB_3",
+ "MUSIC_RONALD",
+ "MUSIC_IMAKUNI",
+ "MUSIC_HALL_OF_HONOR",
+ "MUSIC_CREDITS",
+ "MUSIC_UNUSED_13",
+ "MUSIC_UNUSED_14",
+ "MUSIC_MATCH_START_1",
+ "MUSIC_MATCH_START_2",
+ "MUSIC_MATCH_START_3",
+ "MUSIC_MATCH_VICTORY",
+ "MUSIC_MATCH_LOSS",
+ "MUSIC_MATCH_DRAW",
+ "MUSIC_UNUSED_1B",
+ "MUSIC_BOOSTER_PACK",
+ "MUSIC_MEDAL",
+ "MUSIC_UNUSED_1E",
+]
diff --git a/tools/script_extractor.py b/tools/script_extractor.py
index 8869c66..ed8eaf9 100755
--- a/tools/script_extractor.py
+++ b/tools/script_extractor.py
@@ -86,9 +86,9 @@ def decodeLine(scriptList, game_data, loc, ignore_broken, locList):
wordLoc = (game_data[loc] + (game_data[loc+1]<<8))
if wordLoc == 0000:
if macroMode:
- ret += "NO_JUMP, "
+ ret += "NULL, "
else:
- ret += "\tdw NO_JUMP\n"
+ ret += "\tdw NULL\n"
else:
if macroMode:
ret += ".ows_" + format(wordLoc+0x8000,"04x") + ", "
@@ -285,7 +285,7 @@ def createList(): # this is a func just so all this can go at the bottom
("Func_d3e0", "", DO_NOT_QUIT,""),
("Func_d3fe", "q", DO_NOT_QUIT,""),
("Func_d408", "b", DO_NOT_QUIT,""),
- ("Func_d40f", "q", DO_NOT_QUIT,""),
+ ("ScriptCommand_PlaySong", "b", DO_NOT_QUIT,"play_song"),
("ScriptCommand_PlaySFX", "b", DO_NOT_QUIT,"play_sfx"),
("ScriptCommand_PauseSong", "", DO_NOT_QUIT,"pause_song"),
("ScriptCommand_ResumeSong", "", DO_NOT_QUIT,"resume_song"),
diff --git a/tools/script_extractor2.py b/tools/script_extractor2.py
new file mode 100755
index 0000000..0e835e4
--- /dev/null
+++ b/tools/script_extractor2.py
@@ -0,0 +1,393 @@
+#!/usr/bin/env python
+
+import argparse
+
+from constants import boosters
+from constants import cards
+from constants import decks
+from constants import directions
+from constants import events
+from constants import maps
+from constants import npcs
+from constants import sfxs
+from constants import songs
+
+args = None
+rom = None
+
+# script command names and parameter lists
+script_commands = {
+ 0xe7: { "name": "start_script", "params": [] },
+
+ 0x00: { "name": "end_script_loop", "params": [] },
+ 0x01: { "name": "close_advanced_text_box", "params": [] },
+ 0x02: { "name": "print_text_string", "params": [ "text" ] },
+ 0x03: { "name": "Func_ccdc", "params": [ "text" ] }, # print text and ???
+ 0x04: { "name": "ask_question_jump", "params": [ "text", "label" ] },
+ 0x05: { "name": "start_battle", "params": [ "prizes", "deck", "song" ] },
+ 0x06: { "name": "print_variable_text", "params": [ "text", "text" ] },
+ 0x07: { "name": "Func_cda8", "params": [ "text", "text" ] }, # print variable text and ???
+ 0x08: { "name": "print_text_quit_fully", "params": [ "text" ] },
+ 0x09: { "name": "Func_cdcb", "params": [] },
+ 0x0a: { "name": "move_active_npc_by_direction", "params": [ "movement_table" ] },
+ 0x0b: { "name": "close_text_box", "params": [] },
+ 0x0c: { "name": "give_booster_packs", "params": [ "booster", "booster", "booster" ] },
+ 0x0d: { "name": "jump_if_card_owned", "params": [ "card", "label" ] },
+ 0x0e: { "name": "jump_if_card_in_collection", "params": [ "card", "label" ] },
+ 0x0f: { "name": "give_card", "params": [ "card" ] },
+ 0x10: { "name": "take_card", "params": [ "card" ] },
+ 0x11: { "name": "Func_cf53", "params": [ "label" ] }, # jump if any energy cards in collection
+ 0x12: { "name": "Func_cf7b", "params": [] }, # remove all energy cards from collection
+ 0x13: { "name": "jump_if_enough_cards_owned", "params": [ "word_decimal", "label" ] },
+ 0x14: { "name": "fight_club_pupil_jump", "params": [ "label", "label", "label", "label", "label" ] },
+ 0x15: { "name": "Func_cfc6", "params": [ "byte" ] },
+ 0x16: { "name": "Func_cfd4", "params": [] },
+ 0x17: { "name": "Func_d00b", "params": [] }, # get card name for EVENT_FLAG_2B
+ 0x18: { "name": "Func_d025", "params": [ "label" ] }, # jump if card in EVENT_FLAG_2B is in collection or decks
+ 0x19: { "name": "Func_d032", "params": [ "label" ] }, # jump if card in EVENT_FLAG_2B is in collection
+ 0x1a: { "name": "Func_d03f", "params": [] }, # remove card in EVENT_FLAG_2B from collection
+ 0x1b: { "name": "script_jump", "params": [ "label" ] },
+ 0x1c: { "name": "try_give_medal_pc_packs", "params": [] },
+ 0x1d: { "name": "set_player_direction", "params": [ "direction" ] },
+ 0x1e: { "name": "move_player", "params": [ "direction", "byte_decimal" ] },
+ 0x1f: { "name": "show_card_received_screen", "params": [ "card" ] },
+ 0x20: { "name": "set_dialog_npc", "params": [ "npc" ] },
+ 0x21: { "name": "set_next_npc_and_script", "params": [ "npc", "label" ] },
+ 0x22: { "name": "Func_d095", "params": [ "byte", "byte", "byte" ] }, # LOADED_NPC_FIELD_05 and LOADED_NPC_FIELD_06
+ 0x23: { "name": "Func_d0be", "params": [ "byte", "byte" ] }, # coords
+ 0x24: { "name": "do_frames", "params": [ "byte_decimal" ] },
+ 0x25: { "name": "Func_d0d9", "params": [ "byte", "byte", "label" ] }, # coords, jump if npc coords match
+ 0x26: { "name": "jump_if_player_coords_match", "params": [ "byte_decimal", "byte_decimal", "label" ] },
+ 0x27: { "name": "move_active_npc", "params": [ "movement" ] },
+ 0x28: { "name": "give_one_of_each_trainer_booster", "params": [] },
+ 0x29: { "name": "Func_d103", "params": [ "npc", "label" ] }, # jump if npc loaded
+ 0x2a: { "name": "Func_d125", "params": [ "event" ] }, # give medal
+ 0x2b: { "name": "Func_d135", "params": [ "byte" ] }, # load current map name into tx ram slot
+ 0x2c: { "name": "Func_d16b", "params": [ "byte" ] }, # load current npc name into tx ram slot
+ 0x2d: { "name": "Func_cd4f", "params": [ "prizes", "deck", "song" ] },
+ 0x2e: { "name": "Func_cd94", "params": [ "text", "text", "text" ] },
+ 0x2f: { "name": "move_wram_npc", "params": [ "movement" ] },
+ 0x30: { "name": "Func_cdd8", "params": [] },
+ 0x31: { "name": "Func_cdf5", "params": [ "byte", "byte" ] }, # coords
+ 0x32: { "name": "Func_d195", "params": [] }, # pick challenge hall opponent
+ 0x33: { "name": "Func_d1ad", "params": [] }, # open menu
+ 0x34: { "name": "Func_d1b3", "params": [] }, # pick trade card
+ 0x35: { "name": "quit_script_fully", "params": [] },
+ 0x36: { "name": "Func_d244", "params": [ "byte" ] },
+ 0x37: { "name": "choose_deck_to_duel_against_multichoice", "params": [] },
+ 0x38: { "name": "open_deck_machine", "params": [ "byte" ] },
+ 0x39: { "name": "choose_starter_deck_multichoice", "params": [] },
+ 0x3a: { "name": "enter_map", "params": [ "byte", "map", "byte_decimal", "byte_decimal", "direction" ] },
+ 0x3b: { "name": "move_arbitrary_npc", "params": [ "npc", "movement" ] },
+ 0x3c: { "name": "Func_d209", "params": [] }, # pick legendary card
+ 0x3d: { "name": "Func_d38f", "params": [ "byte" ] },
+ 0x3e: { "name": "Func_d396", "params": [ "byte" ] },
+ 0x3f: { "name": "Func_cd76", "params": [] },
+ 0x40: { "name": "Func_d39d", "params": [ "byte" ] },
+ 0x41: { "name": "Func_d3b9", "params": [] },
+ 0x42: { "name": "try_give_pc_pack", "params": [ "byte" ] },
+ 0x43: { "name": "script_nop", "params": [] },
+ 0x44: { "name": "Func_d3d4", "params": [] },
+ 0x45: { "name": "Func_d3e0", "params": [] },
+ 0x46: { "name": "Func_d3fe", "params": [ "song" ] },
+ 0x47: { "name": "Func_d408", "params": [ "song" ] }, # set default song
+ 0x48: { "name": "play_song", "params": [ "song" ] },
+ 0x49: { "name": "play_sfx", "params": [ "sfx" ] },
+ 0x4a: { "name": "pause_song", "params": [] },
+ 0x4b: { "name": "resume_song", "params": [] },
+ 0x4c: { "name": "Func_d41d", "params": [] }, # play default song
+ 0x4d: { "name": "wait_for_song_to_finish", "params": [] },
+ 0x4e: { "name": "Func_d435", "params": [ "byte" ] },
+ 0x4f: { "name": "ask_question_jump_default_yes", "params": [ "text", "label" ] },
+ 0x50: { "name": "show_sam_normal_multichoice", "params": [] },
+ 0x51: { "name": "show_sam_tutorial_multichoice", "params": [] },
+ 0x52: { "name": "Func_d43d", "params": [] },
+ 0x53: { "name": "end_script_loop_2", "params": [] },
+ 0x54: { "name": "end_script_loop_3", "params": [] },
+ 0x55: { "name": "end_script_loop_4", "params": [] },
+ 0x56: { "name": "end_script_loop_5", "params": [] },
+ 0x57: { "name": "end_script_loop_6", "params": [] },
+ 0x58: { "name": "script_set_flag_value", "params": [ "event", "byte" ] },
+ 0x59: { "name": "jump_if_flag_zero_1", "params": [ "event", "label" ] },
+ 0x5a: { "name": "jump_if_flag_nonzero_1", "params": [ "event", "label" ] },
+ 0x5b: { "name": "jump_if_flag_equal", "params": [ "event", "byte", "label" ] },
+ 0x5c: { "name": "jump_if_flag_not_equal", "params": [ "event", "byte", "label" ] },
+ 0x5d: { "name": "jump_if_flag_not_less_than", "params": [ "event", "byte", "label" ] },
+ 0x5e: { "name": "jump_if_flag_less_than", "params": [ "event", "byte", "label" ] },
+ 0x5f: { "name": "max_out_flag_value", "params": [ "event" ] },
+ 0x60: { "name": "zero_out_flag_value", "params": [ "event" ] },
+ 0x61: { "name": "jump_if_flag_nonzero_2", "params": [ "event", "label"] },
+ 0x62: { "name": "jump_if_flag_zero_2", "params": [ "event", "label" ] },
+ 0x63: { "name": "increment_flag_value", "params": [ "event" ] },
+ 0x64: { "name": "end_script_loop_7", "params": [] },
+ 0x65: { "name": "end_script_loop_8", "params": [] },
+ 0x66: { "name": "end_script_loop_9", "params": [] },
+ 0x67: { "name": "end_script_loop_10", "params": [] },
+}
+
+quit_commands = [
+ 0x00,
+ 0x08,
+ 0x1b,
+ 0x35,
+ 0x53,
+ 0x54,
+ 0x55,
+ 0x56,
+ 0x57,
+ 0x64,
+ 0x65,
+ 0x66,
+ 0x67,
+]
+
+# length in bytes of each type of parameter
+param_lengths = {
+ "byte": 1,
+ "byte_decimal": 1,
+ "booster": 1,
+ "card": 1,
+ "deck": 1,
+ "direction": 1,
+ "event": 1,
+ "map": 1,
+ "npc": 1,
+ "prizes": 1,
+ "sfx": 1,
+ "song": 1,
+ "word_decimal": 2,
+ "movement": 2,
+ "movement_table": 2,
+ "text": 2,
+ "label": 2,
+}
+
+def get_bank(address):
+ return int(address / 0x4000)
+
+def get_relative_address(address):
+ if address < 0x4000:
+ return address
+ return (address % 0x4000) + 0x4000
+
+# get absolute pointer stored at an address in the rom
+# if bank is None, assumes the pointer refers to the same bank as the bank it is located in
+def get_pointer(address, bank=None):
+ raw_pointer = rom[address + 1] * 0x100 + rom[address]
+ if raw_pointer < 0x4000:
+ bank = 0
+ if bank is None:
+ bank = get_bank(address)
+ return (raw_pointer % 0x4000) + bank * 0x4000
+
+def make_address_comment(address):
+ return " ; {:x} ({:x}:{:x})\n".format(address, get_bank(address), get_relative_address(address))
+
+def make_blob(start, output, end=None):
+ return { "start": start, "output": output, "end": end if end else start }
+
+def dump_movement(address):
+ blobs = []
+ blobs.append(make_blob(address, "NPCMovement_{:x}:".format(address) + make_address_comment(address)))
+ while 1:
+ movement = rom[address]
+ if movement == 0xff:
+ blobs.append(make_blob(address, "\tdb ${:02x}\n\n".format(movement), address + 1))
+ break
+ if movement == 0xfe:
+ jump = rom[address + 1]
+ if jump > 127:
+ jump -= 256
+ blobs.append(make_blob(address, "\tdb ${:02x}, {}\n\n".format(movement, jump), address + 2))
+ break
+ blobs.append(make_blob(address, "\tdb {}".format(directions[movement & 0b01111111]) + (" | NO_MOVE\n" if movement & 0b10000000 else "\n"), address + 1))
+ address += 1
+ return blobs
+
+def dump_movement_table(address):
+ blobs = []
+ blobs.append(make_blob(address, "NPCMovementTable_{:x}:".format(address) + make_address_comment(address)))
+ for i in range(4):
+ pointer = get_pointer(address)
+ blobs.append(make_blob(address, "\tdw NPCMovement_{:x}\n".format(pointer) + ("\n" if i == 3 else ""), address + 2))
+ blobs += dump_movement(pointer)
+ address += 2
+ return blobs
+
+# parse a script starting at the given address
+# returns a list of all commands
+def dump_script(start_address, address=None, visited=set()):
+ blobs = []
+ branches = set()
+ if address is None:
+ blobs.append(make_blob(start_address, "Script_{:x}:".format(start_address) + make_address_comment(start_address)))
+ address = start_address
+ else:
+ blobs.append(make_blob(address, ".ows_{:x}\n".format(address)))
+ if address in visited:
+ return blobs
+ visited.add(address)
+ while 1:
+ command_address = address
+ command_id = rom[command_address]
+ command = script_commands[command_id]
+ address += 1
+ macro_mode = not command["name"].startswith("Func_")
+ if macro_mode:
+ output = "\t{}".format(command["name"])
+ else:
+ output = "\trun_command {}".format(command["name"])
+ # print all params for current command
+ for i in range(len(command["params"])):
+ param = rom[address]
+ param_type = command["params"][i]
+ param_length = param_lengths[param_type]
+ if param_type == "byte":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " ${:02x}".format(param)
+ elif param_type == "byte_decimal":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(param)
+ elif param_type == "booster":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(boosters[param])
+ elif param_type == "card":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(cards[param])
+ elif param_type == "deck":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(decks[param])
+ elif param_type == "direction":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(directions[param])
+ elif param_type == "event":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(events[param])
+ elif param_type == "map":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(maps[param])
+ elif param_type == "npc":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(npcs[param])
+ elif param_type == "prizes":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " PRIZES_{}".format(param)
+ elif param_type == "sfx":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(sfxs[param])
+ elif param_type == "song":
+ if not macro_mode:
+ output += "\n\tdb"
+ output += " {}".format(songs[param])
+ elif param_type == "word_decimal":
+ if not macro_mode:
+ output += "\n\tdw"
+ output += " {}".format(param + rom[address + 1] * 0x100)
+ elif param_type == "movement":
+ param = get_pointer(address)
+ label = "NPCMovement_{:x}".format(param)
+ if not macro_mode:
+ output += "\n\tdw"
+ output += " {}".format(label)
+ blobs += dump_movement(param)
+ elif param_type == "movement_table":
+ param = get_pointer(address)
+ label = "NPCMovementTable_{:x}".format(param)
+ if not macro_mode:
+ output += "\n\tdw"
+ output += " {}".format(label)
+ blobs += dump_movement_table(param)
+ elif param_type == "text":
+ text_id = param + rom[address + 1] * 0x100
+ if not macro_mode:
+ if text_id == 0x0000:
+ output += "\n\tdw"
+ else:
+ output += "\n\ttx"
+ if text_id == 0x0000:
+ output += " NULL"
+ else:
+ output += " Text{:04x}".format(text_id)
+ elif param_type == "label":
+ param = get_pointer(address)
+ if param == 0x0000:
+ label = "NULL"
+ elif param == start_address:
+ label = "Script_{:x}".format(param)
+ else:
+ label = ".ows_{:x}".format(param)
+ if param > start_address or args.allow_backward_jumps:
+ branches.add(param)
+ if not macro_mode:
+ output += "\n\tdw"
+ output += " {}".format(label)
+ address += param_length
+ if macro_mode and i < len(command["params"]) - 1:
+ output += ","
+ output += "\n"
+ blobs.append(make_blob(command_address, output, address))
+ if command_id in quit_commands:
+ if rom[address] == 0xc9:
+ blobs.append(make_blob(address, "\tret\n", address + 1))
+ address += 1
+ blobs.append(make_blob(address, "; 0x{:x}\n\n".format(address)))
+ break
+ for branch in branches:
+ blobs += dump_script(start_address, branch, visited)
+ return blobs
+
+def fill_gap(start, end):
+ output = ""
+ for address in range(start, end):
+ output += "\tdb ${:x}\n".format(rom[address])
+ output += "\n"
+ return output
+
+def sort_and_filter(blobs):
+ blobs.sort(key=lambda b: (b["start"], b["end"], not b["output"].startswith(";")))
+ filtered = []
+ for blob, next in zip(blobs, blobs[1:]+[None]):
+ if next and blob["start"] == next["start"] and blob["output"] == next["output"]:
+ continue
+ if next and blob["end"] < next["start"] and get_bank(blob["end"]) == get_bank(next["start"]):
+ if args.fill_gaps:
+ blob["output"] += fill_gap(blob["end"], next["start"])
+ else:
+ blob["output"] += "; gap from 0x{:x} to 0x{:x}\n\n".format(blob["end"], next["start"])
+ filtered.append(blob)
+ if len(filtered) > 0:
+ filtered[-1]["output"] = filtered[-1]["output"].rstrip("\n")
+ return filtered
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser(description="Pokemon TCG Script Extractor")
+ ap.add_argument("-b", "--allow-backward-jumps", action="store_true", help="extract scripts that are found before the starting address")
+ ap.add_argument("-g", "--fill-gaps", action="store_true", help="use 'db's to fill the gaps between visited locations")
+ ap.add_argument("-i", "--ignore-errors", action="store_true", help="silently proceed to the next address if an error occurs")
+ ap.add_argument("-r", "--rom", default="baserom.gbc", help="rom file to extract script from")
+ ap.add_argument("addresses", nargs="+", help="addresses to extract from")
+ args = ap.parse_args()
+ rom = bytearray(open(args.rom, "rb").read())
+ blobs = []
+ for address in args.addresses:
+ try:
+ blobs += dump_script(int(address, 16))
+ except:
+ if not args.ignore_errors:
+ raise
+ blobs = sort_and_filter(blobs)
+ output = ""
+ for blob in blobs:
+ output += blob["output"]
+ print(output)