summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/wild/grass_water.asm498
-rw-r--r--data/wild/maps/CeruleanCave1F.asm2
-rw-r--r--data/wild/maps/CeruleanCave2F.asm2
-rw-r--r--data/wild/maps/CeruleanCaveB1F.asm2
-rw-r--r--data/wild/maps/DiglettsCave.asm2
-rw-r--r--data/wild/maps/MtMoon1F.asm2
-rw-r--r--data/wild/maps/MtMoonB1F.asm2
-rw-r--r--data/wild/maps/MtMoonB2F.asm2
-rw-r--r--data/wild/maps/PokemonMansion1F.asm2
-rw-r--r--data/wild/maps/PokemonMansion2F.asm2
-rw-r--r--data/wild/maps/PokemonMansion3F.asm2
-rw-r--r--data/wild/maps/PokemonMansionB1F.asm2
-rw-r--r--data/wild/maps/PokemonTower1F.asm2
-rw-r--r--data/wild/maps/PokemonTower2F.asm2
-rw-r--r--data/wild/maps/PokemonTower3F.asm2
-rw-r--r--data/wild/maps/PokemonTower4F.asm2
-rw-r--r--data/wild/maps/PokemonTower5F.asm2
-rw-r--r--data/wild/maps/PokemonTower6F.asm2
-rw-r--r--data/wild/maps/PokemonTower7F.asm2
-rw-r--r--data/wild/maps/PowerPlant.asm2
-rw-r--r--data/wild/maps/RockTunnel1F.asm2
-rw-r--r--data/wild/maps/RockTunnelB1F.asm2
-rw-r--r--data/wild/maps/Route1.asm2
-rw-r--r--data/wild/maps/Route10.asm2
-rw-r--r--data/wild/maps/Route11.asm2
-rw-r--r--data/wild/maps/Route12.asm2
-rw-r--r--data/wild/maps/Route13.asm2
-rw-r--r--data/wild/maps/Route14.asm2
-rw-r--r--data/wild/maps/Route15.asm2
-rw-r--r--data/wild/maps/Route16.asm2
-rw-r--r--data/wild/maps/Route17.asm2
-rw-r--r--data/wild/maps/Route18.asm2
-rw-r--r--data/wild/maps/Route19.asm2
-rw-r--r--data/wild/maps/Route2.asm2
-rw-r--r--data/wild/maps/Route20.asm2
-rw-r--r--data/wild/maps/Route21.asm2
-rw-r--r--data/wild/maps/Route22.asm2
-rw-r--r--data/wild/maps/Route23.asm2
-rw-r--r--data/wild/maps/Route24.asm2
-rw-r--r--data/wild/maps/Route25.asm2
-rw-r--r--data/wild/maps/Route3.asm2
-rw-r--r--data/wild/maps/Route4.asm2
-rw-r--r--data/wild/maps/Route5.asm2
-rw-r--r--data/wild/maps/Route6.asm2
-rw-r--r--data/wild/maps/Route7.asm2
-rw-r--r--data/wild/maps/Route8.asm2
-rw-r--r--data/wild/maps/Route9.asm2
-rw-r--r--data/wild/maps/SafariZoneCenter.asm2
-rw-r--r--data/wild/maps/SafariZoneEast.asm2
-rw-r--r--data/wild/maps/SafariZoneNorth.asm2
-rw-r--r--data/wild/maps/SafariZoneWest.asm2
-rw-r--r--data/wild/maps/SeafoamIslands1F.asm2
-rw-r--r--data/wild/maps/SeafoamIslandsB1F.asm2
-rw-r--r--data/wild/maps/SeafoamIslandsB2F.asm2
-rw-r--r--data/wild/maps/SeafoamIslandsB3F.asm2
-rw-r--r--data/wild/maps/SeafoamIslandsB4F.asm2
-rw-r--r--data/wild/maps/VictoryRoad1F.asm2
-rw-r--r--data/wild/maps/VictoryRoad2F.asm2
-rw-r--r--data/wild/maps/VictoryRoad3F.asm2
-rw-r--r--data/wild/maps/ViridianForest.asm2
-rw-r--r--data/wild/maps/nothing.asm2
-rw-r--r--engine/battle/init_battle.asm69
-rw-r--r--engine/items/town_map.asm2
-rw-r--r--engine/menus/party_menu.asm2
-rw-r--r--engine/overworld/dust_smoke.asm24
-rw-r--r--engine/predefs.asm10
-rw-r--r--home/overworld.asm42
-rw-r--r--home/predef.asm12
-rw-r--r--macros/wram.asm11
-rw-r--r--scripts/CeladonGym.asm84
-rw-r--r--scripts/CeruleanCity.asm80
-rw-r--r--scripts/CeruleanGym.asm94
-rw-r--r--scripts/CinnabarGym.asm279
-rw-r--r--scripts/CinnabarGym3.asm20
-rw-r--r--scripts/FuchsiaGym.asm99
-rw-r--r--scripts/PewterGym.asm111
-rw-r--r--scripts/SaffronGym.asm114
-rw-r--r--scripts/VermilionDock.asm4
-rw-r--r--scripts/VermilionGym.asm30
-rw-r--r--scripts/ViridianGym.asm121
-rw-r--r--text/CeladonGym.asm8
-rw-r--r--text/CeruleanGym.asm14
-rw-r--r--text/CinnabarGym.asm54
-rw-r--r--text/FuchsiaGym.asm10
-rw-r--r--text/PewterGym.asm18
-rw-r--r--text/SaffronGym.asm14
-rw-r--r--text/VermilionGym.asm8
-rw-r--r--text/ViridianGym.asm12
-rw-r--r--wram.asm1597
89 files changed, 1510 insertions, 2051 deletions
diff --git a/data/wild/grass_water.asm b/data/wild/grass_water.asm
index 4858ab5d..b9789845 100644
--- a/data/wild/grass_water.asm
+++ b/data/wild/grass_water.asm
@@ -1,254 +1,254 @@
WildDataPointers:
table_width 2, WildDataPointers
- dw NoMons ; PALLET_TOWN
- dw NoMons ; VIRIDIAN_CITY
- dw NoMons ; PEWTER_CITY
- dw NoMons ; CERULEAN_CITY
- dw NoMons ; LAVENDER_TOWN
- dw NoMons ; VERMILION_CITY
- dw NoMons ; CELADON_CITY
- dw NoMons ; FUCHSIA_CITY
- dw NoMons ; CINNABAR_ISLAND
- dw NoMons ; INDIGO_PLATEAU
- dw NoMons ; SAFFRON_CITY
- dw NoMons ; unused
- dw Route1Mons ; ROUTE_1
- dw Route2Mons ; ROUTE_2
- dw Route3Mons ; ROUTE_3
- dw Route4Mons ; ROUTE_4
- dw Route5Mons ; ROUTE_5
- dw Route6Mons ; ROUTE_6
- dw Route7Mons ; ROUTE_7
- dw Route8Mons ; ROUTE_8
- dw Route9Mons ; ROUTE_9
- dw Route10Mons ; ROUTE_10
- dw Route11Mons ; ROUTE_11
- dw Route12Mons ; ROUTE_12
- dw Route13Mons ; ROUTE_13
- dw Route14Mons ; ROUTE_14
- dw Route15Mons ; ROUTE_15
- dw Route16Mons ; ROUTE_16
- dw Route17Mons ; ROUTE_17
- dw Route18Mons ; ROUTE_18
- dw Route19Mons ; ROUTE_19
- dw Route20Mons ; ROUTE_20
- dw Route21Mons ; ROUTE_21
- dw Route22Mons ; ROUTE_22
- dw Route23Mons ; ROUTE_23
- dw Route24Mons ; ROUTE_24
- dw Route25Mons ; ROUTE_25
- dw NoMons ; REDS_HOUSE_1F
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw ForestMons ; ViridianForest
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw MoonMons1
- dw MoonMonsB1
- dw MoonMonsB2
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw TunnelMonsB1
- dw PowerPlantMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw PlateauMons1
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw TowerMons1
- dw TowerMons2
- dw TowerMons3
- dw TowerMons4
- dw TowerMons5
- dw TowerMons6
- dw TowerMons7
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw IslandMonsB1
- dw IslandMonsB2
- dw IslandMonsB3
- dw IslandMonsB4
- dw NoMons
- dw NoMons
- dw MansionMons1
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw IslandMons1
- dw NoMons
- dw PlateauMons2
- dw NoMons
- dw NoMons
- dw CaveMons
- dw PlateauMons3
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw MansionMons2
- dw MansionMons3
- dw MansionMonsB1
- dw ZoneMons1
- dw ZoneMons2
- dw ZoneMons3
- dw ZoneMonsCenter
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw DungeonMons2
- dw DungeonMonsB1
- dw DungeonMons1
- dw NoMons
- dw NoMons
- dw NoMons
- dw TunnelMonsB2
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
- dw NoMons
+ dw NothingWildMons ; PALLET_TOWN
+ dw NothingWildMons ; VIRIDIAN_CITY
+ dw NothingWildMons ; PEWTER_CITY
+ dw NothingWildMons ; CERULEAN_CITY
+ dw NothingWildMons ; LAVENDER_TOWN
+ dw NothingWildMons ; VERMILION_CITY
+ dw NothingWildMons ; CELADON_CITY
+ dw NothingWildMons ; FUCHSIA_CITY
+ dw NothingWildMons ; CINNABAR_ISLAND
+ dw NothingWildMons ; INDIGO_PLATEAU
+ dw NothingWildMons ; SAFFRON_CITY
+ dw NothingWildMons ; unused
+ dw Route1WildMons ; ROUTE_1
+ dw Route2WildMons ; ROUTE_2
+ dw Route3WildMons ; ROUTE_3
+ dw Route4WildMons ; ROUTE_4
+ dw Route5WildMons ; ROUTE_5
+ dw Route6WildMons ; ROUTE_6
+ dw Route7WildMons ; ROUTE_7
+ dw Route8WildMons ; ROUTE_8
+ dw Route9WildMons ; ROUTE_9
+ dw Route10WildMons ; ROUTE_10
+ dw Route11WildMons ; ROUTE_11
+ dw Route12WildMons ; ROUTE_12
+ dw Route13WildMons ; ROUTE_13
+ dw Route14WildMons ; ROUTE_14
+ dw Route15WildMons ; ROUTE_15
+ dw Route16WildMons ; ROUTE_16
+ dw Route17WildMons ; ROUTE_17
+ dw Route18WildMons ; ROUTE_18
+ dw Route19WildMons ; ROUTE_19
+ dw Route20WildMons ; ROUTE_20
+ dw Route21WildMons ; ROUTE_21
+ dw Route22WildMons ; ROUTE_22
+ dw Route23WildMons ; ROUTE_23
+ dw Route24WildMons ; ROUTE_24
+ dw Route25WildMons ; ROUTE_25
+ dw NothingWildMons ; REDS_HOUSE_1F
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw ViridianForestWildMons ; ViridianForest
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw MtMoon1FWildMons
+ dw MtMoonB1FWildMons
+ dw MtMoonB2FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw RockTunnel1FWildMons
+ dw PowerPlantWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw VictoryRoad1FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw PokemonTower1FWildMons
+ dw PokemonTower2FWildMons
+ dw PokemonTower3FWildMons
+ dw PokemonTower4FWildMons
+ dw PokemonTower5FWildMons
+ dw PokemonTower6FWildMons
+ dw PokemonTower7FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw SeafoamIslandsB1FWildMons
+ dw SeafoamIslandsB2FWildMons
+ dw SeafoamIslandsB3FWildMons
+ dw SeafoamIslandsB4FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw PokemonMansion1FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw SeafoamIslands1FWildMons
+ dw NothingWildMons
+ dw VictoryRoad2FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw DiglettsCaveWildMons
+ dw VictoryRoad3FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw PokemonMansion2FWildMons
+ dw PokemonMansion3FWildMons
+ dw PokemonMansionB1FWildMons
+ dw SafariZoneEastWildMons
+ dw SafariZoneNorthWildMons
+ dw SafariZoneWestWildMons
+ dw SafariZoneCenterWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw CeruleanCave2FWildMons
+ dw CeruleanCaveB1FWildMons
+ dw CeruleanCave1FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw RockTunnelB1FWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
+ dw NothingWildMons
assert_table_length NUM_MAPS
dw -1 ; end
diff --git a/data/wild/maps/CeruleanCave1F.asm b/data/wild/maps/CeruleanCave1F.asm
index f8a830de..ce1c35e5 100644
--- a/data/wild/maps/CeruleanCave1F.asm
+++ b/data/wild/maps/CeruleanCave1F.asm
@@ -1,4 +1,4 @@
-DungeonMons1:
+CeruleanCave1FWildMons:
def_grass_wildmons 10 ; encounter rate
db 50, GOLBAT
db 55, GOLBAT
diff --git a/data/wild/maps/CeruleanCave2F.asm b/data/wild/maps/CeruleanCave2F.asm
index 712d8cec..1bd7c206 100644
--- a/data/wild/maps/CeruleanCave2F.asm
+++ b/data/wild/maps/CeruleanCave2F.asm
@@ -1,4 +1,4 @@
-DungeonMons2:
+CeruleanCave2FWildMons:
def_grass_wildmons 15 ; encounter rate
db 52, GOLBAT
db 57, GOLBAT
diff --git a/data/wild/maps/CeruleanCaveB1F.asm b/data/wild/maps/CeruleanCaveB1F.asm
index 5787d240..a90882ad 100644
--- a/data/wild/maps/CeruleanCaveB1F.asm
+++ b/data/wild/maps/CeruleanCaveB1F.asm
@@ -1,4 +1,4 @@
-DungeonMonsB1:
+CeruleanCaveB1FWildMons:
def_grass_wildmons 25 ; encounter rate
db 54, GOLBAT
db 59, GOLBAT
diff --git a/data/wild/maps/DiglettsCave.asm b/data/wild/maps/DiglettsCave.asm
index e5ba5fa5..50ef0828 100644
--- a/data/wild/maps/DiglettsCave.asm
+++ b/data/wild/maps/DiglettsCave.asm
@@ -1,4 +1,4 @@
-CaveMons:
+DiglettsCaveWildMons:
def_grass_wildmons 20 ; encounter rate
db 18, DIGLETT
db 19, DIGLETT
diff --git a/data/wild/maps/MtMoon1F.asm b/data/wild/maps/MtMoon1F.asm
index 93edc040..717ce078 100644
--- a/data/wild/maps/MtMoon1F.asm
+++ b/data/wild/maps/MtMoon1F.asm
@@ -1,4 +1,4 @@
-MoonMons1:
+MtMoon1FWildMons:
def_grass_wildmons 10 ; encounter rate
db 8, ZUBAT
db 9, ZUBAT
diff --git a/data/wild/maps/MtMoonB1F.asm b/data/wild/maps/MtMoonB1F.asm
index d729dc6f..5683eac2 100644
--- a/data/wild/maps/MtMoonB1F.asm
+++ b/data/wild/maps/MtMoonB1F.asm
@@ -1,4 +1,4 @@
-MoonMonsB1:
+MtMoonB1FWildMons:
def_grass_wildmons 10 ; encounter rate
db 8, ZUBAT
db 9, ZUBAT
diff --git a/data/wild/maps/MtMoonB2F.asm b/data/wild/maps/MtMoonB2F.asm
index 63671cbe..a89422bb 100644
--- a/data/wild/maps/MtMoonB2F.asm
+++ b/data/wild/maps/MtMoonB2F.asm
@@ -1,4 +1,4 @@
-MoonMonsB2:
+MtMoonB2FWildMons:
def_grass_wildmons 10 ; encounter rate
db 10, ZUBAT
db 11, GEODUDE
diff --git a/data/wild/maps/PokemonMansion1F.asm b/data/wild/maps/PokemonMansion1F.asm
index 8aea3fac..de6b7cb0 100644
--- a/data/wild/maps/PokemonMansion1F.asm
+++ b/data/wild/maps/PokemonMansion1F.asm
@@ -1,4 +1,4 @@
-MansionMons1:
+PokemonMansion1FWildMons:
def_grass_wildmons 10 ; encounter rate
db 34, RATTATA
db 34, RATICATE
diff --git a/data/wild/maps/PokemonMansion2F.asm b/data/wild/maps/PokemonMansion2F.asm
index 818e705b..1cfb0b8b 100644
--- a/data/wild/maps/PokemonMansion2F.asm
+++ b/data/wild/maps/PokemonMansion2F.asm
@@ -1,4 +1,4 @@
-MansionMons2:
+PokemonMansion2FWildMons:
def_grass_wildmons 10 ; encounter rate
db 37, RATTATA
db 37, RATICATE
diff --git a/data/wild/maps/PokemonMansion3F.asm b/data/wild/maps/PokemonMansion3F.asm
index 36eb701b..05a8be23 100644
--- a/data/wild/maps/PokemonMansion3F.asm
+++ b/data/wild/maps/PokemonMansion3F.asm
@@ -1,4 +1,4 @@
-MansionMons3:
+PokemonMansion3FWildMons:
def_grass_wildmons 10 ; encounter rate
db 40, RATTATA
db 40, RATICATE
diff --git a/data/wild/maps/PokemonMansionB1F.asm b/data/wild/maps/PokemonMansionB1F.asm
index 1954695c..627f1b4d 100644
--- a/data/wild/maps/PokemonMansionB1F.asm
+++ b/data/wild/maps/PokemonMansionB1F.asm
@@ -1,4 +1,4 @@
-MansionMonsB1:
+PokemonMansionB1FWildMons:
def_grass_wildmons 10 ; encounter rate
db 35, GRIMER
db 38, GRIMER
diff --git a/data/wild/maps/PokemonTower1F.asm b/data/wild/maps/PokemonTower1F.asm
index 5e061298..023b996d 100644
--- a/data/wild/maps/PokemonTower1F.asm
+++ b/data/wild/maps/PokemonTower1F.asm
@@ -1,4 +1,4 @@
-TowerMons1:
+PokemonTower1FWildMons:
def_grass_wildmons 0 ; encounter rate
end_grass_wildmons
diff --git a/data/wild/maps/PokemonTower2F.asm b/data/wild/maps/PokemonTower2F.asm
index 39794a20..f958e167 100644
--- a/data/wild/maps/PokemonTower2F.asm
+++ b/data/wild/maps/PokemonTower2F.asm
@@ -1,4 +1,4 @@
-TowerMons2:
+PokemonTower2FWildMons:
def_grass_wildmons 0 ; encounter rate
end_grass_wildmons
diff --git a/data/wild/maps/PokemonTower3F.asm b/data/wild/maps/PokemonTower3F.asm
index 42ee5a6f..d98c9cd8 100644
--- a/data/wild/maps/PokemonTower3F.asm
+++ b/data/wild/maps/PokemonTower3F.asm
@@ -1,4 +1,4 @@
-TowerMons3:
+PokemonTower3FWildMons:
def_grass_wildmons 10 ; encounter rate
db 20, GASTLY
db 21, GASTLY
diff --git a/data/wild/maps/PokemonTower4F.asm b/data/wild/maps/PokemonTower4F.asm
index b81bc541..1e5ccca6 100644
--- a/data/wild/maps/PokemonTower4F.asm
+++ b/data/wild/maps/PokemonTower4F.asm
@@ -1,4 +1,4 @@
-TowerMons4:
+PokemonTower4FWildMons:
def_grass_wildmons 10 ; encounter rate
db 20, GASTLY
db 21, GASTLY
diff --git a/data/wild/maps/PokemonTower5F.asm b/data/wild/maps/PokemonTower5F.asm
index 66af9751..3426333e 100644
--- a/data/wild/maps/PokemonTower5F.asm
+++ b/data/wild/maps/PokemonTower5F.asm
@@ -1,4 +1,4 @@
-TowerMons5:
+PokemonTower5FWildMons:
def_grass_wildmons 15 ; encounter rate
db 22, GASTLY
db 23, GASTLY
diff --git a/data/wild/maps/PokemonTower6F.asm b/data/wild/maps/PokemonTower6F.asm
index 1ddafd84..6b7bd1e2 100644
--- a/data/wild/maps/PokemonTower6F.asm
+++ b/data/wild/maps/PokemonTower6F.asm
@@ -1,4 +1,4 @@
-TowerMons6:
+PokemonTower6FWildMons:
def_grass_wildmons 15 ; encounter rate
db 22, GASTLY
db 23, GASTLY
diff --git a/data/wild/maps/PokemonTower7F.asm b/data/wild/maps/PokemonTower7F.asm
index 5c859a00..91a9dfea 100644
--- a/data/wild/maps/PokemonTower7F.asm
+++ b/data/wild/maps/PokemonTower7F.asm
@@ -1,4 +1,4 @@
-TowerMons7:
+PokemonTower7FWildMons:
def_grass_wildmons 20 ; encounter rate
db 24, GASTLY
db 25, GASTLY
diff --git a/data/wild/maps/PowerPlant.asm b/data/wild/maps/PowerPlant.asm
index fde69fcd..db61a702 100644
--- a/data/wild/maps/PowerPlant.asm
+++ b/data/wild/maps/PowerPlant.asm
@@ -1,4 +1,4 @@
-PowerPlantMons:
+PowerPlantWildMons:
def_grass_wildmons 10 ; encounter rate
db 30, MAGNEMITE
db 35, MAGNEMITE
diff --git a/data/wild/maps/RockTunnel1F.asm b/data/wild/maps/RockTunnel1F.asm
index 98785e39..65e85e40 100644
--- a/data/wild/maps/RockTunnel1F.asm
+++ b/data/wild/maps/RockTunnel1F.asm
@@ -1,4 +1,4 @@
-TunnelMonsB1:
+RockTunnel1FWildMons:
def_grass_wildmons 15 ; encounter rate
db 15, ZUBAT
db 16, GEODUDE
diff --git a/data/wild/maps/RockTunnelB1F.asm b/data/wild/maps/RockTunnelB1F.asm
index 035574ef..7937b574 100644
--- a/data/wild/maps/RockTunnelB1F.asm
+++ b/data/wild/maps/RockTunnelB1F.asm
@@ -1,4 +1,4 @@
-TunnelMonsB2:
+RockTunnelB1FWildMons:
def_grass_wildmons 15 ; encounter rate
db 20, ZUBAT
db 17, GEODUDE
diff --git a/data/wild/maps/Route1.asm b/data/wild/maps/Route1.asm
index 7634f3b4..75069cb5 100644
--- a/data/wild/maps/Route1.asm
+++ b/data/wild/maps/Route1.asm
@@ -1,4 +1,4 @@
-Route1Mons:
+Route1WildMons:
def_grass_wildmons 25 ; encounter rate
db 3, PIDGEY
db 4, PIDGEY
diff --git a/data/wild/maps/Route10.asm b/data/wild/maps/Route10.asm
index bd9ba28f..b48a1ebb 100644
--- a/data/wild/maps/Route10.asm
+++ b/data/wild/maps/Route10.asm
@@ -1,4 +1,4 @@
-Route10Mons:
+Route10WildMons:
def_grass_wildmons 15 ; encounter rate
db 16, MAGNEMITE
db 18, RATTATA
diff --git a/data/wild/maps/Route11.asm b/data/wild/maps/Route11.asm
index e564296a..70b2f465 100644
--- a/data/wild/maps/Route11.asm
+++ b/data/wild/maps/Route11.asm
@@ -1,4 +1,4 @@
-Route11Mons:
+Route11WildMons:
def_grass_wildmons 15 ; encounter rate
db 16, PIDGEY
db 15, RATTATA
diff --git a/data/wild/maps/Route12.asm b/data/wild/maps/Route12.asm
index 40fd8e07..6852d91f 100644
--- a/data/wild/maps/Route12.asm
+++ b/data/wild/maps/Route12.asm
@@ -1,4 +1,4 @@
-Route12Mons:
+Route12WildMons:
def_grass_wildmons 15 ; encounter rate
db 25, ODDISH
db 25, BELLSPROUT
diff --git a/data/wild/maps/Route13.asm b/data/wild/maps/Route13.asm
index 33e097cd..6a46ab12 100644
--- a/data/wild/maps/Route13.asm
+++ b/data/wild/maps/Route13.asm
@@ -1,4 +1,4 @@
-Route13Mons:
+Route13WildMons:
def_grass_wildmons 15 ; encounter rate
db 25, ODDISH
db 25, BELLSPROUT
diff --git a/data/wild/maps/Route14.asm b/data/wild/maps/Route14.asm
index 98b1f4e3..b49572b1 100644
--- a/data/wild/maps/Route14.asm
+++ b/data/wild/maps/Route14.asm
@@ -1,4 +1,4 @@
-Route14Mons:
+Route14WildMons:
def_grass_wildmons 15 ; encounter rate
db 26, ODDISH
db 26, BELLSPROUT
diff --git a/data/wild/maps/Route15.asm b/data/wild/maps/Route15.asm
index 87392fa4..08d0851d 100644
--- a/data/wild/maps/Route15.asm
+++ b/data/wild/maps/Route15.asm
@@ -1,4 +1,4 @@
-Route15Mons:
+Route15WildMons:
def_grass_wildmons 15 ; encounter rate
db 26, ODDISH
db 26, BELLSPROUT
diff --git a/data/wild/maps/Route16.asm b/data/wild/maps/Route16.asm
index 4265809a..b9863b02 100644
--- a/data/wild/maps/Route16.asm
+++ b/data/wild/maps/Route16.asm
@@ -1,4 +1,4 @@
-Route16Mons:
+Route16WildMons:
def_grass_wildmons 25 ; encounter rate
db 22, SPEAROW
db 22, DODUO
diff --git a/data/wild/maps/Route17.asm b/data/wild/maps/Route17.asm
index 4c167abe..e6e14573 100644
--- a/data/wild/maps/Route17.asm
+++ b/data/wild/maps/Route17.asm
@@ -1,4 +1,4 @@
-Route17Mons:
+Route17WildMons:
def_grass_wildmons 25 ; encounter rate
db 26, DODUO
db 27, FEAROW
diff --git a/data/wild/maps/Route18.asm b/data/wild/maps/Route18.asm
index 04b4dbfa..b5929692 100644
--- a/data/wild/maps/Route18.asm
+++ b/data/wild/maps/Route18.asm
@@ -1,4 +1,4 @@
-Route18Mons:
+Route18WildMons:
def_grass_wildmons 25 ; encounter rate
db 22, SPEAROW
db 22, DODUO
diff --git a/data/wild/maps/Route19.asm b/data/wild/maps/Route19.asm
index c09ba290..81ada961 100644
--- a/data/wild/maps/Route19.asm
+++ b/data/wild/maps/Route19.asm
@@ -1,4 +1,4 @@
-Route19Mons:
+Route19WildMons:
def_grass_wildmons 0 ; encounter rate
end_grass_wildmons
diff --git a/data/wild/maps/Route2.asm b/data/wild/maps/Route2.asm
index eda91039..bb591fa7 100644
--- a/data/wild/maps/Route2.asm
+++ b/data/wild/maps/Route2.asm
@@ -1,4 +1,4 @@
-Route2Mons:
+Route2WildMons:
def_grass_wildmons 25 ; encounter rate
db 3, RATTATA
db 3, PIDGEY
diff --git a/data/wild/maps/Route20.asm b/data/wild/maps/Route20.asm
index b0f5b85a..e1d17955 100644
--- a/data/wild/maps/Route20.asm
+++ b/data/wild/maps/Route20.asm
@@ -1,4 +1,4 @@
-Route20Mons:
+Route20WildMons:
def_grass_wildmons 0 ; encounter rate
end_grass_wildmons
diff --git a/data/wild/maps/Route21.asm b/data/wild/maps/Route21.asm
index 54a647f9..32dc50ee 100644
--- a/data/wild/maps/Route21.asm
+++ b/data/wild/maps/Route21.asm
@@ -1,4 +1,4 @@
-Route21Mons:
+Route21WildMons:
def_grass_wildmons 25 ; encounter rate
db 15, PIDGEY
db 13, RATTATA
diff --git a/data/wild/maps/Route22.asm b/data/wild/maps/Route22.asm
index 9398fafc..b40e5bb4 100644
--- a/data/wild/maps/Route22.asm
+++ b/data/wild/maps/Route22.asm
@@ -1,4 +1,4 @@
-Route22Mons:
+Route22WildMons:
def_grass_wildmons 25 ; encounter rate
db 2, NIDORAN_M
db 2, NIDORAN_F
diff --git a/data/wild/maps/Route23.asm b/data/wild/maps/Route23.asm
index 99e3c548..beaea051 100644
--- a/data/wild/maps/Route23.asm
+++ b/data/wild/maps/Route23.asm
@@ -1,4 +1,4 @@
-Route23Mons:
+Route23WildMons:
def_grass_wildmons 10 ; encounter rate
db 41, NIDORINO
db 41, NIDORINA
diff --git a/data/wild/maps/Route24.asm b/data/wild/maps/Route24.asm
index 852137f4..2703ff20 100644
--- a/data/wild/maps/Route24.asm
+++ b/data/wild/maps/Route24.asm
@@ -1,4 +1,4 @@
-Route24Mons:
+Route24WildMons:
def_grass_wildmons 25 ; encounter rate
db 12, ODDISH
db 12, BELLSPROUT
diff --git a/data/wild/maps/Route25.asm b/data/wild/maps/Route25.asm
index 22b68eb0..c129a116 100644
--- a/data/wild/maps/Route25.asm
+++ b/data/wild/maps/Route25.asm
@@ -1,4 +1,4 @@
-Route25Mons:
+Route25WildMons:
def_grass_wildmons 15 ; encounter rate
db 12, ODDISH
db 12, BELLSPROUT
diff --git a/data/wild/maps/Route3.asm b/data/wild/maps/Route3.asm
index 49dde638..fc975478 100644
--- a/data/wild/maps/Route3.asm
+++ b/data/wild/maps/Route3.asm
@@ -1,4 +1,4 @@
-Route3Mons:
+Route3WildMons:
def_grass_wildmons 20 ; encounter rate
db 8, SPEAROW
db 9, SPEAROW
diff --git a/data/wild/maps/Route4.asm b/data/wild/maps/Route4.asm
index 7aa1f37b..6c94a750 100644
--- a/data/wild/maps/Route4.asm
+++ b/data/wild/maps/Route4.asm
@@ -1,4 +1,4 @@
-Route4Mons:
+Route4WildMons:
def_grass_wildmons 20 ; encounter rate
db 8, SPEAROW
db 9, SPEAROW
diff --git a/data/wild/maps/Route5.asm b/data/wild/maps/Route5.asm
index dc2ee194..a3c8c2c5 100644
--- a/data/wild/maps/Route5.asm
+++ b/data/wild/maps/Route5.asm
@@ -1,4 +1,4 @@
-Route5Mons:
+Route5WildMons:
def_grass_wildmons 15 ; encounter rate
db 15, PIDGEY
db 14, RATTATA
diff --git a/data/wild/maps/Route6.asm b/data/wild/maps/Route6.asm
index df91e521..44e83011 100644
--- a/data/wild/maps/Route6.asm
+++ b/data/wild/maps/Route6.asm
@@ -1,4 +1,4 @@
-Route6Mons:
+Route6WildMons:
def_grass_wildmons 15 ; encounter rate
db 15, PIDGEY
db 14, RATTATA
diff --git a/data/wild/maps/Route7.asm b/data/wild/maps/Route7.asm
index e0e78991..55474731 100644
--- a/data/wild/maps/Route7.asm
+++ b/data/wild/maps/Route7.asm
@@ -1,4 +1,4 @@
-Route7Mons:
+Route7WildMons:
def_grass_wildmons 15 ; encounter rate
db 20, PIDGEY
db 22, PIDGEY
diff --git a/data/wild/maps/Route8.asm b/data/wild/maps/Route8.asm
index a55d5e79..158b6342 100644
--- a/data/wild/maps/Route8.asm
+++ b/data/wild/maps/Route8.asm
@@ -1,4 +1,4 @@
-Route8Mons:
+Route8WildMons:
def_grass_wildmons 15 ; encounter rate
db 20, PIDGEY
db 22, PIDGEY
diff --git a/data/wild/maps/Route9.asm b/data/wild/maps/Route9.asm
index 273452c9..f40a9311 100644
--- a/data/wild/maps/Route9.asm
+++ b/data/wild/maps/Route9.asm
@@ -1,4 +1,4 @@
-Route9Mons:
+Route9WildMons:
def_grass_wildmons 15 ; encounter rate
db 16, NIDORAN_M
db 16, NIDORAN_F
diff --git a/data/wild/maps/SafariZoneCenter.asm b/data/wild/maps/SafariZoneCenter.asm
index 5573d8b8..cfc06064 100644
--- a/data/wild/maps/SafariZoneCenter.asm
+++ b/data/wild/maps/SafariZoneCenter.asm
@@ -1,4 +1,4 @@
-ZoneMonsCenter:
+SafariZoneCenterWildMons:
def_grass_wildmons 30 ; encounter rate
db 14, NIDORAN_M
db 36, NIDORAN_F
diff --git a/data/wild/maps/SafariZoneEast.asm b/data/wild/maps/SafariZoneEast.asm
index 1b634058..5eb6fa85 100644
--- a/data/wild/maps/SafariZoneEast.asm
+++ b/data/wild/maps/SafariZoneEast.asm
@@ -1,4 +1,4 @@
-ZoneMons1:
+SafariZoneEastWildMons:
def_grass_wildmons 30 ; encounter rate
db 21, NIDORAN_M
db 29, NIDORAN_F
diff --git a/data/wild/maps/SafariZoneNorth.asm b/data/wild/maps/SafariZoneNorth.asm
index 6ce432ef..e8672bbb 100644
--- a/data/wild/maps/SafariZoneNorth.asm
+++ b/data/wild/maps/SafariZoneNorth.asm
@@ -1,4 +1,4 @@
-ZoneMons2:
+SafariZoneNorthWildMons:
def_grass_wildmons 30 ; encounter rate
db 36, NIDORAN_M
db 14, NIDORAN_F
diff --git a/data/wild/maps/SafariZoneWest.asm b/data/wild/maps/SafariZoneWest.asm
index 42a4d3a3..27d4aa8f 100644
--- a/data/wild/maps/SafariZoneWest.asm
+++ b/data/wild/maps/SafariZoneWest.asm
@@ -1,4 +1,4 @@
-ZoneMons3:
+SafariZoneWestWildMons:
def_grass_wildmons 30 ; encounter rate
db 29, NIDORAN_M
db 21, NIDORAN_F
diff --git a/data/wild/maps/SeafoamIslands1F.asm b/data/wild/maps/SeafoamIslands1F.asm
index bc14de89..7bfd3fe7 100644
--- a/data/wild/maps/SeafoamIslands1F.asm
+++ b/data/wild/maps/SeafoamIslands1F.asm
@@ -1,4 +1,4 @@
-IslandMons1:
+SeafoamIslands1FWildMons:
def_grass_wildmons 15 ; encounter rate
db 18, ZUBAT
db 25, KRABBY
diff --git a/data/wild/maps/SeafoamIslandsB1F.asm b/data/wild/maps/SeafoamIslandsB1F.asm
index b213df3d..199c0019 100644
--- a/data/wild/maps/SeafoamIslandsB1F.asm
+++ b/data/wild/maps/SeafoamIslandsB1F.asm
@@ -1,4 +1,4 @@
-IslandMonsB1:
+SeafoamIslandsB1FWildMons:
def_grass_wildmons 10 ; encounter rate
db 27, ZUBAT
db 26, KRABBY
diff --git a/data/wild/maps/SeafoamIslandsB2F.asm b/data/wild/maps/SeafoamIslandsB2F.asm
index 4cb4805c..2dcde913 100644
--- a/data/wild/maps/SeafoamIslandsB2F.asm
+++ b/data/wild/maps/SeafoamIslandsB2F.asm
@@ -1,4 +1,4 @@
-IslandMonsB2:
+SeafoamIslandsB2FWildMons:
def_grass_wildmons 10 ; encounter rate
db 27, ZUBAT
db 27, KRABBY
diff --git a/data/wild/maps/SeafoamIslandsB3F.asm b/data/wild/maps/SeafoamIslandsB3F.asm
index e58c306f..f6bd5f9a 100644
--- a/data/wild/maps/SeafoamIslandsB3F.asm
+++ b/data/wild/maps/SeafoamIslandsB3F.asm
@@ -1,4 +1,4 @@
-IslandMonsB3:
+SeafoamIslandsB3FWildMons:
def_grass_wildmons 10 ; encounter rate
db 27, GOLBAT
db 36, ZUBAT
diff --git a/data/wild/maps/SeafoamIslandsB4F.asm b/data/wild/maps/SeafoamIslandsB4F.asm
index 84d4ba5d..7417cde9 100644
--- a/data/wild/maps/SeafoamIslandsB4F.asm
+++ b/data/wild/maps/SeafoamIslandsB4F.asm
@@ -1,4 +1,4 @@
-IslandMonsB4:
+SeafoamIslandsB4FWildMons:
def_grass_wildmons 10 ; encounter rate
db 36, GOLBAT
db 36, ZUBAT
diff --git a/data/wild/maps/VictoryRoad1F.asm b/data/wild/maps/VictoryRoad1F.asm
index 17ece17a..a02b2be5 100644
--- a/data/wild/maps/VictoryRoad1F.asm
+++ b/data/wild/maps/VictoryRoad1F.asm
@@ -1,4 +1,4 @@
-PlateauMons1:
+VictoryRoad1FWildMons:
def_grass_wildmons 15 ; encounter rate
db 26, GEODUDE
db 31, GEODUDE
diff --git a/data/wild/maps/VictoryRoad2F.asm b/data/wild/maps/VictoryRoad2F.asm
index 04ebaa6e..806b29ab 100644
--- a/data/wild/maps/VictoryRoad2F.asm
+++ b/data/wild/maps/VictoryRoad2F.asm
@@ -1,4 +1,4 @@
-PlateauMons2:
+VictoryRoad2FWildMons:
def_grass_wildmons 10 ; encounter rate
db 31, GEODUDE
db 36, GEODUDE
diff --git a/data/wild/maps/VictoryRoad3F.asm b/data/wild/maps/VictoryRoad3F.asm
index cf56245e..03d6bbf2 100644
--- a/data/wild/maps/VictoryRoad3F.asm
+++ b/data/wild/maps/VictoryRoad3F.asm
@@ -1,4 +1,4 @@
-PlateauMons3:
+VictoryRoad3FWildMons:
def_grass_wildmons 15 ; encounter rate
db 36, GEODUDE
db 44, GOLBAT
diff --git a/data/wild/maps/ViridianForest.asm b/data/wild/maps/ViridianForest.asm
index 93286607..f959b1b0 100644
--- a/data/wild/maps/ViridianForest.asm
+++ b/data/wild/maps/ViridianForest.asm
@@ -1,4 +1,4 @@
-ForestMons:
+ViridianForestWildMons:
def_grass_wildmons 25 ; encounter rate
db 3, CATERPIE
db 4, METAPOD
diff --git a/data/wild/maps/nothing.asm b/data/wild/maps/nothing.asm
index 1ccba991..47b94a28 100644
--- a/data/wild/maps/nothing.asm
+++ b/data/wild/maps/nothing.asm
@@ -1,4 +1,4 @@
-NoMons:
+NothingWildMons:
def_grass_wildmons 0 ; encounter rate
end_grass_wildmons
diff --git a/engine/battle/init_battle.asm b/engine/battle/init_battle.asm
index bd8b2e8f..680befda 100644
--- a/engine/battle/init_battle.asm
+++ b/engine/battle/init_battle.asm
@@ -188,95 +188,96 @@ LoadMonBackPic:
ld b, a
jp CopyVideoData
+; animates the mon "growing" out of the pokeball
AnimateSendingOutMon:
- ld a, [wPredefRegisters]
+ ld a, [wPredefHL]
ld h, a
- ld a, [wPredefRegisters + 1]
+ ld a, [wPredefHL + 1]
ld l, a
ldh a, [hStartTileID]
- ldh [hDownArrowBlinkCount1], a
+ ldh [hBaseTileID], a
ld b, $4c
ld a, [wIsInBattle]
and a
- jr z, .asm_f61ef
+ jr z, .notInBattle
add b
ld [hl], a
call Delay3
- ld bc, -41
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
add hl, bc
- ld a, $1
- ld [wNumMovesMinusOne], a
- ld bc, $303
+ ld a, 1
+ ld [wDownscaledMonSize], a
+ lb bc, 3, 3
predef CopyDownscaledMonTiles
- ld c, $4
+ ld c, 4
call DelayFrames
- ld bc, -41
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
add hl, bc
xor a
- ld [wNumMovesMinusOne], a
- ld bc, $505
+ ld [wDownscaledMonSize], a
+ lb bc, 5, 5
predef CopyDownscaledMonTiles
- ld c, $5
+ ld c, 5
call DelayFrames
- ld bc, -41
- jr .asm_f61f2
-.asm_f61ef
- ld bc, -123
-.asm_f61f2
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
+ jr .next
+.notInBattle
+ ld bc, -(SCREEN_WIDTH * 6 + 3)
+.next
add hl, bc
- ldh a, [hDownArrowBlinkCount1]
+ ldh a, [hBaseTileID]
add $31
jr CopyUncompressedPicToHL
CopyUncompressedPicToTilemap:
- ld a, [wPredefRegisters]
+ ld a, [wPredefHL]
ld h, a
- ld a, [wPredefRegisters + 1]
+ ld a, [wPredefHL + 1]
ld l, a
ldh a, [hStartTileID]
CopyUncompressedPicToHL::
- ld bc, $707
- ld de, $14
+ lb bc, 7, 7
+ ld de, SCREEN_WIDTH
push af
ld a, [wSpriteFlipped]
and a
- jr nz, .asm_f6220
+ jr nz, .flipped
pop af
-.asm_f6211
+.loop
push bc
push hl
-.asm_f6213
+.innerLoop
ld [hl], a
add hl, de
inc a
dec c
- jr nz, .asm_f6213
+ jr nz, .innerLoop
pop hl
inc hl
pop bc
dec b
- jr nz, .asm_f6211
+ jr nz, .loop
ret
-.asm_f6220
+.flipped
push bc
- ld b, $0
+ ld b, 0
dec c
add hl, bc
pop bc
pop af
-.asm_f6227
+.flippedLoop
push bc
push hl
-.asm_f6229
+.flippedInnerLoop
ld [hl], a
add hl, de
inc a
dec c
- jr nz, .asm_f6229
+ jr nz, .flippedInnerLoop
pop hl
dec hl
pop bc
dec b
- jr nz, .asm_f6227
+ jr nz, .flippedLoop
ret
diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm
index d385044a..3e71fc29 100644
--- a/engine/items/town_map.asm
+++ b/engine/items/town_map.asm
@@ -260,7 +260,7 @@ ToText:
db "To@"
BuildFlyLocationsList:
- ld hl, wFlyLocationsList - 1
+ ld hl, wFlyAnimUsingCoordList
ld [hl], $ff
inc hl
ld a, [wTownVisitedFlag]
diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm
index 3af777a2..c64ce70a 100644
--- a/engine/menus/party_menu.asm
+++ b/engine/menus/party_menu.asm
@@ -139,7 +139,7 @@ RedrawPartyMenu_::
ld l, a
ld de, wEvosMoves
ld a, BANK(EvosMovesPointerTable)
- ld bc, wEvosMoves.end - wEvosMoves
+ ld bc, wEvosMovesEnd - wEvosMoves
call FarCopyData
ld hl, wEvosMoves
ld de, .notAbleToEvolveText
diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm
index 773def96..ed016107 100644
--- a/engine/overworld/dust_smoke.asm
+++ b/engine/overworld/dust_smoke.asm
@@ -53,22 +53,16 @@ GetMoveBoulderDustFunctionPointer:
pop hl
ret
-MoveBoulderDustFunctionPointerTable:
-; facing down
- db $FF,$00
- dw AdjustOAMBlockYPos
-
-; facing up
- db $01,$00
- dw AdjustOAMBlockYPos
+boulder_dust_adjust: MACRO
+ db \1, \2 ; coords
+ dw \3 ; function
+ENDM
-; facing left
- db $01,$01
- dw AdjustOAMBlockXPos
-
-; facing right
- db $FF,$01
- dw AdjustOAMBlockXPos
+MoveBoulderDustFunctionPointerTable:
+ boulder_dust_adjust -1, 0, AdjustOAMBlockYPos ; down
+ boulder_dust_adjust 1, 0, AdjustOAMBlockYPos ; up
+ boulder_dust_adjust 1, 1, AdjustOAMBlockXPos ; left
+ boulder_dust_adjust -1, 1, AdjustOAMBlockXPos ; right
LoadSmokeTileFourTimes::
ld hl, vChars1 tile $7c
diff --git a/engine/predefs.asm b/engine/predefs.asm
index a9877739..faf0029e 100644
--- a/engine/predefs.asm
+++ b/engine/predefs.asm
@@ -1,20 +1,20 @@
GetPredefPointer::
-; Store the contents of the register
-; pairs (hl, de, bc) at wPredefRegisters.
+; Back up the contents of the registers (hl, de, bc).
; Then put the bank and address of predef
; wPredefID in [wPredefBank] and hl.
ld a, h
- ld [wPredefRegisters], a
+ ld [wPredefHL], a
ld a, l
- ld [wPredefRegisters + 1], a
+ ld [wPredefHL + 1], a
- ld hl, wPredefRegisters + 2
+ ld hl, wPredefDE
ld a, d
ld [hli], a
ld a, e
ld [hli], a
+ ASSERT wPredefDE + 2 == wPredefBC
ld a, b
ld [hli], a
ld [hl], c
diff --git a/home/overworld.asm b/home/overworld.asm
index 246a773b..50edcf74 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -522,7 +522,7 @@ CheckMapConnections::
ld a, [wXCoord]
cp $ff
jr nz, .checkEastMap
- ld a, [wMapConn3Ptr]
+ ld a, [wWestConnectedMap]
ld [wCurMap], a
ld a, [wWestConnectedMapXAlignment] ; new X coordinate upon entering west map
ld [wXCoord], a
@@ -559,7 +559,7 @@ CheckMapConnections::
ld a, [wCurrentMapWidth2] ; map width
cp b
jr nz, .checkNorthMap
- ld a, [wMapConn4Ptr]
+ ld a, [wEastConnectedMap]
ld [wCurMap], a
ld a, [wEastConnectedMapXAlignment] ; new X coordinate upon entering east map
ld [wXCoord], a
@@ -595,7 +595,7 @@ CheckMapConnections::
ld a, [wYCoord]
cp $ff
jr nz, .checkSouthMap
- ld a, [wMapConn1Ptr]
+ ld a, [wNorthConnectedMap]
ld [wCurMap], a
ld a, [wNorthConnectedMapYAlignment] ; new Y coordinate upon entering north map
ld [wYCoord], a
@@ -623,7 +623,7 @@ CheckMapConnections::
ld a, [wCurrentMapHeight2]
cp b
jr nz, .didNotEnterConnectedMap
- ld a, [wMapConn2Ptr]
+ ld a, [wSouthConnectedMap]
ld [wCurMap], a
ld a, [wSouthConnectedMapYAlignment] ; new Y coordinate upon entering south map
ld [wYCoord], a
@@ -919,7 +919,7 @@ LoadTileBlockMap::
dec b
jr nz, .rowLoop
.northConnection
- ld a, [wMapConn1Ptr]
+ ld a, [wNorthConnectedMap]
cp $ff
jr z, .southConnection
call SwitchToMapRomBank
@@ -931,13 +931,13 @@ LoadTileBlockMap::
ld e, a
ld a, [wNorthConnectionStripDest + 1]
ld d, a
- ld a, [wNorthConnectionStripWidth]
+ ld a, [wNorthConnectionStripLength]
ldh [hNorthSouthConnectionStripWidth], a
ld a, [wNorthConnectedMapWidth]
ldh [hNorthSouthConnectedMapWidth], a
call LoadNorthSouthConnectionsTileMap
.southConnection
- ld a, [wMapConn2Ptr]
+ ld a, [wSouthConnectedMap]
cp $ff
jr z, .westConnection
call SwitchToMapRomBank
@@ -949,13 +949,13 @@ LoadTileBlockMap::
ld e, a
ld a, [wSouthConnectionStripDest + 1]
ld d, a
- ld a, [wSouthConnectionStripWidth]
+ ld a, [wSouthConnectionStripLength]
ldh [hNorthSouthConnectionStripWidth], a
ld a, [wSouthConnectedMapWidth]
ldh [hNorthSouthConnectedMapWidth], a
call LoadNorthSouthConnectionsTileMap
.westConnection
- ld a, [wMapConn3Ptr]
+ ld a, [wWestConnectedMap]
cp $ff
jr z, .eastConnection
call SwitchToMapRomBank
@@ -967,13 +967,13 @@ LoadTileBlockMap::
ld e, a
ld a, [wWestConnectionStripDest + 1]
ld d, a
- ld a, [wWestConnectionStripHeight]
+ ld a, [wWestConnectionStripLength]
ld b, a
ld a, [wWestConnectedMapWidth]
ldh [hEastWestConnectedMapWidth], a
call LoadEastWestConnectionsTileMap
.eastConnection
- ld a, [wMapConn4Ptr]
+ ld a, [wEastConnectedMap]
cp $ff
jr z, .done
call SwitchToMapRomBank
@@ -985,7 +985,7 @@ LoadTileBlockMap::
ld e, a
ld a, [wEastConnectionStripDest + 1]
ld d, a
- ld a, [wEastConnectionStripHeight]
+ ld a, [wEastConnectionStripLength]
ld b, a
ld a, [wEastConnectedMapWidth]
ldh [hEastWestConnectedMapWidth], a
@@ -1827,32 +1827,32 @@ asm_0dbd:
jr nz, .copyFixedHeaderLoop
; initialize all the connected maps to disabled at first, before loading the actual values
ld a, $ff
- ld [wMapConn1Ptr], a
- ld [wMapConn2Ptr], a
- ld [wMapConn3Ptr], a
- ld [wMapConn4Ptr], a
+ ld [wNorthConnectedMap], a
+ ld [wSouthConnectedMap], a
+ ld [wWestConnectedMap], a
+ ld [wEastConnectedMap], a
; copy connection data (if any) to WRAM
ld a, [wMapConnections]
ld b, a
.checkNorth
bit 3, b
jr z, .checkSouth
- ld de, wMapConn1Ptr
+ ld de, wNorthConnectionHeader
call CopyMapConnectionHeader
.checkSouth
bit 2, b
jr z, .checkWest
- ld de, wMapConn2Ptr
+ ld de, wSouthConnectionHeader
call CopyMapConnectionHeader
.checkWest
bit 1, b
jr z, .checkEast
- ld de, wMapConn3Ptr
+ ld de, wWestConnectionHeader
call CopyMapConnectionHeader
.checkEast
bit 0, b
jr z, .getObjectDataPointer
- ld de, wMapConn4Ptr
+ ld de, wEastConnectionHeader
call CopyMapConnectionHeader
.getObjectDataPointer
ld a, [hli]
@@ -1875,7 +1875,7 @@ asm_0dbd:
ld c, a
ld de, wWarpEntries
.warpLoop ; one warp per loop iteration
- ld b, $04
+ ld b, 4
.warpInnerLoop
ld a, [hli]
ld [de], a
diff --git a/home/predef.asm b/home/predef.asm
index a0889e0e..4861d5d0 100644
--- a/home/predef.asm
+++ b/home/predef.asm
@@ -33,16 +33,16 @@ Predef::
GetPredefRegisters::
; Restore the contents of register pairs
; when GetPredefPointer was called.
- ld a, [wPredefRegisters + 0]
+ ld a, [wPredefHL]
ld h, a
- ld a, [wPredefRegisters + 1]
+ ld a, [wPredefHL + 1]
ld l, a
- ld a, [wPredefRegisters + 2]
+ ld a, [wPredefDE]
ld d, a
- ld a, [wPredefRegisters + 3]
+ ld a, [wPredefDE + 1]
ld e, a
- ld a, [wPredefRegisters + 4]
+ ld a, [wPredefBC]
ld b, a
- ld a, [wPredefRegisters + 5]
+ ld a, [wPredefBC + 1]
ld c, a
ret
diff --git a/macros/wram.asm b/macros/wram.asm
index 6f463db9..be89dad6 100644
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -103,6 +103,17 @@ sprite_oam_struct: MACRO
\1Attributes:: db
ENDM
+map_connection_struct: MACRO
+\1ConnectedMap:: db
+\1ConnectionStripSrc:: dw
+\1ConnectionStripDest:: dw
+\1ConnectionStripLength:: db
+\1ConnectedMapWidth:: db
+\1ConnectedMapYAlignment:: db
+\1ConnectedMapXAlignment:: db
+\1ConnectedMapViewPointer:: dw
+ENDM
+
animated_object: MACRO
\1Index:: db
\1FramesetID:: db
diff --git a/scripts/CeladonGym.asm b/scripts/CeladonGym.asm
index 30e4fa35..2ffa1995 100644
--- a/scripts/CeladonGym.asm
+++ b/scripts/CeladonGym.asm
@@ -22,7 +22,7 @@ CeladonGym_Script:
.LeaderName:
db "ERIKA@"
-CeladonGymText_48943:
+CeladonGymResetScripts:
xor a
ld [wJoyIgnore], a
ld [wCeladonGymCurScript], a
@@ -33,16 +33,16 @@ CeladonGym_ScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
- dw CeladonGymScript3
+ dw CeladonGymErikaPostBattle
-CeladonGymScript3:
+CeladonGymErikaPostBattle:
ld a, [wIsInBattle]
cp $ff
- jp z, CeladonGymText_48943
+ jp z, CeladonGymResetScripts
ld a, $f0
ld [wJoyIgnore], a
-CeladonGymText_48963:
+CeladonGymReceiveTM21:
ld a, $9
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
@@ -68,19 +68,19 @@ CeladonGymText_48963:
; deactivate gym trainers
SetEventRange EVENT_BEAT_CELADON_GYM_TRAINER_0, EVENT_BEAT_CELADON_GYM_TRAINER_6
- jp CeladonGymText_48943
+ jp CeladonGymResetScripts
CeladonGym_TextPointers:
- dw CeladonGymText1
- dw CeladonGymText2
- dw CeladonGymText3
- dw CeladonGymText4
- dw CeladonGymText5
- dw CeladonGymText6
- dw CeladonGymText7
- dw CeladonGymText8
- dw CeladonGymText9
- dw TM21Text
+ dw ErikaText
+ dw CeladonGymTrainerText1
+ dw CeladonGymTrainerText2
+ dw CeladonGymTrainerText3
+ dw CeladonGymTrainerText4
+ dw CeladonGymTrainerText5
+ dw CeladonGymTrainerText6
+ dw CeladonGymTrainerText7
+ dw ErikaRainbowBadgeInfoText
+ dw ReceivedTM21Text
dw TM21NoRoomText
CeladonGymTrainerHeaders:
@@ -101,27 +101,27 @@ CeladonGymTrainerHeader6:
trainer EVENT_BEAT_CELADON_GYM_TRAINER_6, 3, CeladonGymBattleText8, CeladonGymEndBattleText8, CeladonGymAfterBattleText8
db -1 ; end
-CeladonGymText1:
+ErikaText:
text_asm
CheckEvent EVENT_BEAT_ERIKA
- jr z, .beginBattle
+ jr z, .beforeBeat
CheckEventReuseA EVENT_GOT_TM21
- jr nz, .afterVictory
- call z, CeladonGymText_48963
+ jr nz, .afterBeat
+ call z, CeladonGymReceiveTM21
call DisableWaitingAfterTextDisplay
jr .done
-.afterVictory
- ld hl, CeladonGymText_48a68
+.afterBeat
+ ld hl, ErikaPostBattleAdviceText
call PrintText
jr .done
-.beginBattle
- ld hl, CeladonGymText_48a5e
+.beforeBeat
+ ld hl, ErikaPreBattleText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, CeladonGymText_48a63
- ld de, CeladonGymText_48a63
+ ld hl, ReceivedRainbowBadgeText
+ ld de, ReceivedRainbowBadgeText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -135,23 +135,23 @@ CeladonGymText1:
.done
jp TextScriptEnd
-CeladonGymText_48a5e:
- text_far _CeladonGymText_48a5e
+ErikaPreBattleText:
+ text_far _ErikaPreBattleText
text_end
-CeladonGymText_48a63:
- text_far _CeladonGymText_48a63
+ReceivedRainbowBadgeText:
+ text_far _ReceivedRainbowBadgeText
text_end
-CeladonGymText_48a68:
- text_far _CeladonGymText_48a68
+ErikaPostBattleAdviceText:
+ text_far _ErikaPostBattleAdviceText
text_end
-CeladonGymText9:
- text_far _CeladonGymText9
+ErikaRainbowBadgeInfoText:
+ text_far _ErikaRainbowBadgeInfoText
text_end
-TM21Text:
+ReceivedTM21Text:
text_far _ReceivedTM21Text
sound_get_item_1
text_far _TM21ExplanationText
@@ -161,7 +161,7 @@ TM21NoRoomText:
text_far _TM21NoRoomText
text_end
-CeladonGymText2:
+CeladonGymTrainerText1:
text_asm
ld hl, CeladonGymTrainerHeader0
call TalkToTrainer
@@ -179,7 +179,7 @@ CeladonGymAfterBattleText2:
text_far _CeladonGymAfterBattleText2
text_end
-CeladonGymText3:
+CeladonGymTrainerText2:
text_asm
ld hl, CeladonGymTrainerHeader1
call TalkToTrainer
@@ -197,7 +197,7 @@ CeladonGymAfterBattleText3:
text_far _CeladonGymAfterBattleText3
text_end
-CeladonGymText4:
+CeladonGymTrainerText3:
text_asm
ld hl, CeladonGymTrainerHeader2
call TalkToTrainer
@@ -215,7 +215,7 @@ CeladonGymAfterBattleText4:
text_far _CeladonGymAfterBattleText4
text_end
-CeladonGymText5:
+CeladonGymTrainerText4:
text_asm
ld hl, CeladonGymTrainerHeader3
call TalkToTrainer
@@ -233,7 +233,7 @@ CeladonGymAfterBattleText5:
text_far _CeladonGymAfterBattleText5
text_end
-CeladonGymText6:
+CeladonGymTrainerText5:
text_asm
ld hl, CeladonGymTrainerHeader4
call TalkToTrainer
@@ -251,7 +251,7 @@ CeladonGymAfterBattleText6:
text_far _CeladonGymAfterBattleText6
text_end
-CeladonGymText7:
+CeladonGymTrainerText6:
text_asm
ld hl, CeladonGymTrainerHeader5
call TalkToTrainer
@@ -269,7 +269,7 @@ CeladonGymAfterBattleText7:
text_far _CeladonGymAfterBattleText7
text_end
-CeladonGymText8:
+CeladonGymTrainerText7:
text_asm
ld hl, CeladonGymTrainerHeader6
call TalkToTrainer
diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm
index 7a8dc63c..a9f62baa 100644
--- a/scripts/CeruleanCity.asm
+++ b/scripts/CeruleanCity.asm
@@ -40,18 +40,18 @@ IF DEF(_DEBUG)
ret nz
ENDC
CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF
- jr nz, .asm_194f7
+ jr nz, .skipRocketThiefEncounter
ld hl, CeruleanCityCoords1
call ArePlayerCoordsInArray
- jr nc, .asm_194f7
+ jr nc, .skipRocketThiefEncounter
ld a, [wCoordIndex]
cp $1
ld a, PLAYER_DIR_UP
ld b, SPRITE_FACING_DOWN
- jr nz, .asm_194e6
+ jr nz, .playerBelowRocketThief
ld a, PLAYER_DIR_DOWN
ld b, SPRITE_FACING_UP
-.asm_194e6
+.playerBelowRocketThief
ld [wPlayerMovingDirection], a
ld a, b
ld [wSprite02StateData1FacingDirection], a
@@ -59,7 +59,7 @@ ENDC
ld a, $2
ldh [hSpriteIndexOrTextID], a
jp DisplayTextID
-.asm_194f7
+.skipRocketThiefEncounter
CheckEvent EVENT_BEAT_CERULEAN_RIVAL
ret nz
ld hl, CeruleanCityCoords2
@@ -67,9 +67,9 @@ ENDC
ret nc
ld a, [wWalkBikeSurfState]
and a
- jr z, .asm_19512
+ jr z, .walking
call StopAllMusic
-.asm_19512
+.walking
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
@@ -78,15 +78,15 @@ ENDC
ld a, $f0
ld [wJoyIgnore], a
ld a, [wXCoord]
- cp 20
- jr z, .asm_19535
+ cp 20 ; is the player standing on the right side of the bridge?
+ jr z, .playerOnRightSideOfBridge
ld a, $1
ldh [hSpriteIndex], a
ld a, SPRITESTATEDATA2_MAPX
ldh [hSpriteDataOffset], a
call GetPointerWithinSpriteStateData2
ld [hl], 25
-.asm_19535
+.playerOnRightSideOfBridge
ld a, HS_CERULEAN_RIVAL
ld [wMissableObjectIndex], a
predef ShowObject
@@ -164,13 +164,13 @@ CeruleanCityScript2:
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
ld a, [wXCoord]
- cp 20
- jr nz, .asm_195f0
+ cp 20 ; is the player standing on the right side of the bridge?
+ jr nz, .playerOnRightSideOfBridge
ld de, CeruleanCityMovement4
- jr .asm_195f3
-.asm_195f0
+ jr .skip
+.playerOnRightSideOfBridge
ld de, CeruleanCityMovement3
-.asm_195f3
+.skip
ld a, $1
ldh [hSpriteIndex], a
call MoveSprite
@@ -265,7 +265,7 @@ CeruleanCityText_19677:
CeruleanCityText2:
text_asm
CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF
- jr nz, .asm_4ca20
+ jr nz, .beatRocketThief
ld hl, CeruleanCityText_196d9
call PrintText
ld hl, wd72d
@@ -281,7 +281,7 @@ CeruleanCityText2:
ld a, $4
ld [wCeruleanCityCurScript], a
jp TextScriptEnd
-.asm_4ca20
+.beatRocketThief
ld hl, CeruleanCityText_196f3
call PrintText
lb bc, TM_DIG, 1
@@ -342,21 +342,22 @@ CeruleanCityText6:
CeruleanCityText7:
text_asm
ldh a, [hRandomAdd]
- cp 180
- jr c, .asm_e9fc9
+ cp 180 ; 76/256 chance of 1st dialogue
+ jr c, .notFirstText
ld hl, CeruleanCityText_19730
call PrintText
- jr .asm_d486e
-.asm_e9fc9
- cp 100
- jr c, .asm_df99b
+ jr .end
+.notFirstText
+ cp 100 ; 80/256 chance of 2nd dialogue
+ jr c, .notSecondText
ld hl, CeruleanCityText_19735
call PrintText
- jr .asm_d486e
-.asm_df99b
+ jr .end
+.notSecondText
+ ; 100/256 chance of 3rd dialogue
ld hl, CeruleanCityText_1973a
call PrintText
-.asm_d486e
+.end
jp TextScriptEnd
CeruleanCityText_19730:
@@ -374,27 +375,28 @@ CeruleanCityText_1973a:
CeruleanCityText8:
text_asm
ldh a, [hRandomAdd]
- cp 180
- jr c, .asm_e28da
+ cp 180 ; 76/256 chance of 1st dialogue
+ jr c, .notFirstText
ld hl, CeruleanCityText_1976f
call PrintText
- jr .asm_f2f38
-.asm_e28da
- cp 120
- jr c, .asm_15d08
+ jr .end
+.notFirstText
+ cp 120 ; 60/256 chance of 2nd dialogue
+ jr c, .notSecondText
ld hl, CeruleanCityText_19774
call PrintText
- jr .asm_f2f38
-.asm_15d08
- cp 60
- jr c, .asm_d7fea
+ jr .end
+.notSecondText
+ cp 60 ; 60/256 chance of 3rd dialogue
+ jr c, .notThirdText
ld hl, CeruleanCityText_19779
call PrintText
- jr .asm_f2f38
-.asm_d7fea
+ jr .end
+.notThirdText
+ ; 60/256 chance of 4th dialogue
ld hl, CeruleanCityText_1977e
call PrintText
-.asm_f2f38
+.end
jp TextScriptEnd
CeruleanCityText_1976f:
diff --git a/scripts/CeruleanGym.asm b/scripts/CeruleanGym.asm
index 7e4bd319..388e128a 100644
--- a/scripts/CeruleanGym.asm
+++ b/scripts/CeruleanGym.asm
@@ -22,7 +22,7 @@ CeruleanGym_Script:
.LeaderName:
db "MISTY@"
-CeruleanGymScript_5c6ed:
+CeruleanGymResetScripts:
xor a
ld [wJoyIgnore], a
ld [wCeruleanGymCurScript], a
@@ -33,16 +33,16 @@ CeruleanGym_ScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
- dw CeruleanGymScript3
+ dw CeruleanGymMistyPostBattle
-CeruleanGymScript3:
+CeruleanGymMistyPostBattle:
ld a, [wIsInBattle]
cp $ff
- jp z, CeruleanGymScript_5c6ed
+ jp z, CeruleanGymResetScripts
ld a, $f0
ld [wJoyIgnore], a
-CeruleanGymScript_5c70d:
+CeruleanGymReceiveTM11:
ld a, $5
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
@@ -68,16 +68,16 @@ CeruleanGymScript_5c70d:
; deactivate gym trainers
SetEvents EVENT_BEAT_CERULEAN_GYM_TRAINER_0, EVENT_BEAT_CERULEAN_GYM_TRAINER_1
- jp CeruleanGymScript_5c6ed
+ jp CeruleanGymResetScripts
CeruleanGym_TextPointers:
- dw CeruleanGymText1
- dw CeruleanGymText2
- dw CeruleanGymText3
- dw CeruleanGymText4
- dw CeruleanGymText5
- dw CeruleanGymText6
- dw CeruleanGymText7
+ dw MistyText
+ dw CeruleanGymTrainerText1
+ dw CeruleanGymTrainerText2
+ dw CeruleanGymGuideText
+ dw MistyCascadeBadgeInfoText
+ dw ReceivedTM11Text
+ dw TM11NoRoomText
CeruleanGymTrainerHeaders:
def_trainers 2
@@ -87,27 +87,27 @@ CeruleanGymTrainerHeader1:
trainer EVENT_BEAT_CERULEAN_GYM_TRAINER_1, 3, CeruleanGymBattleText2, CeruleanGymEndBattleText2, CeruleanGymAfterBattleText2
db -1 ; end
-CeruleanGymText1:
+MistyText:
text_asm
CheckEvent EVENT_BEAT_MISTY
- jr z, .beginBattle
+ jr z, .beforeBeat
CheckEventReuseA EVENT_GOT_TM11
- jr nz, .afterVictory
- call z, CeruleanGymScript_5c70d
+ jr nz, .afterBeat
+ call z, CeruleanGymReceiveTM11
call DisableWaitingAfterTextDisplay
jr .done
-.afterVictory
- ld hl, CeruleanGymText_5c7c3
+.afterBeat
+ ld hl, TM11ExplanationText
call PrintText
jr .done
-.beginBattle
- ld hl, CeruleanGymText_5c7be
+.beforeBeat
+ ld hl, MistyPreBattleText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, CeruleanGymText_5c7d8
- ld de, CeruleanGymText_5c7d8
+ ld hl, ReceivedCascadeBadgeText
+ ld de, ReceivedCascadeBadgeText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -122,32 +122,32 @@ CeruleanGymText1:
.done
jp TextScriptEnd
-CeruleanGymText_5c7be:
- text_far _CeruleanGymText_5c7be
+MistyPreBattleText:
+ text_far _MistyPreBattleText
text_end
-CeruleanGymText_5c7c3:
- text_far _CeruleanGymText_5c7c3
+TM11ExplanationText:
+ text_far _TM11ExplanationText
text_end
-CeruleanGymText5:
- text_far _CeruleanGymText_5c7c8
+MistyCascadeBadgeInfoText:
+ text_far _MistyCascadeBadgeInfoText
text_end
-CeruleanGymText6:
+ReceivedTM11Text:
text_far _ReceivedTM11Text
sound_get_item_1
text_end
-CeruleanGymText7:
- text_far _CeruleanGymText_5c7d3
+TM11NoRoomText:
+ text_far _TM11NoRoomText
text_end
-CeruleanGymText_5c7d8:
- text_far _CeruleanGymText_5c7d8
+ReceivedCascadeBadgeText:
+ text_far _ReceivedCascadeBadgeText
text_end
-CeruleanGymText2:
+CeruleanGymTrainerText1:
text_asm
ld hl, CeruleanGymTrainerHeader0
call TalkToTrainer
@@ -165,7 +165,7 @@ CeruleanGymAfterBattleText1:
text_far _CeruleanGymAfterBattleText1
text_end
-CeruleanGymText3:
+CeruleanGymTrainerText2:
text_asm
ld hl, CeruleanGymTrainerHeader1
call TalkToTrainer
@@ -183,23 +183,23 @@ CeruleanGymAfterBattleText2:
text_far _CeruleanGymAfterBattleText2
text_end
-CeruleanGymText4:
+CeruleanGymGuideText:
text_asm
CheckEvent EVENT_BEAT_MISTY
- jr nz, .asm_5c821
- ld hl, CeruleanGymText_5c82a
+ jr nz, .afterBeat
+ ld hl, CeruleanGymGuidePreBattleText
call PrintText
- jr .asm_5c827
-.asm_5c821
- ld hl, CeruleanGymText_5c82f
+ jr .done
+.afterBeat
+ ld hl, CeruleanGymGuidePostBattleText
call PrintText
-.asm_5c827
+.done
jp TextScriptEnd
-CeruleanGymText_5c82a:
- text_far _CeruleanGymText_5c82a
+CeruleanGymGuidePreBattleText:
+ text_far _CeruleanGymGuidePreBattleText
text_end
-CeruleanGymText_5c82f:
- text_far _CeruleanGymText_5c82f
+CeruleanGymGuidePostBattleText:
+ text_far _CeruleanGymGuidePostBattleText
text_end
diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm
index 7c015a64..63da9a86 100644
--- a/scripts/CinnabarGym.asm
+++ b/scripts/CinnabarGym.asm
@@ -1,11 +1,11 @@
CinnabarGym_Script:
- call CinnabarGymScript_75759
+ call CinnabarGymSetMapAndTiles
call EnableAutoTextBoxDrawing
ld hl, CinnabarGym_ScriptPointers
ld a, [wCinnabarGymCurScript]
jp CallFunctionInTable
-CinnabarGymScript_75759:
+CinnabarGymSetMapAndTiles:
ld hl, wCurrentMapScriptFlags
bit 6, [hl]
res 6, [hl]
@@ -29,7 +29,7 @@ CinnabarGymScript_75759:
.LeaderName:
db "BLAINE@"
-CinnabarGymScript_75792:
+CinnabarGymResetScripts:
xor a
ld [wJoyIgnore], a
ld [wCinnabarGymCurScript], a
@@ -37,7 +37,7 @@ CinnabarGymScript_75792:
ld [wOpponentAfterWrongAnswer], a
ret
-CinnabarGymScript_74f48:
+CinnabarGymSetTrainerHeader:
ldh a, [hSpriteIndexOrTextID]
ld [wTrainerHeaderFlagBit], a
ret
@@ -49,7 +49,7 @@ CinnabarGym_ScriptPointers:
dw CinnabarGymScript0
dw CinnabarGymScript1
dw CinnabarGymScript2
- dw CinnabarGymScript3
+ dw CinnabarGymBlainePostBattle
CinnabarGymScript0:
ld a, [wOpponentAfterWrongAnswer]
@@ -63,23 +63,23 @@ CinnabarGymScript0:
ld hl, PikachuMovementData_74f97
ld b, SPRITE_FACING_DOWN
call CinnabarGymScript_74fa3
- ld de, MovementData_757d7
- jr .asm_757cb
+ ld de, MovementNpcToLeftAndUp
+ jr .MoveSprite
.asm_757c3
ld a, PLAYER_DIR_RIGHT
ld [wPlayerMovingDirection], a
ld hl, PikachuMovementData_74f9e
ld b, SPRITE_FACING_RIGHT
call CinnabarGymScript_74fa3
- ld de, MovementData_757da
-.asm_757cb
+ ld de, MovementNpcToLeft
+.MoveSprite
call MoveSprite
ld a, $1
ld [wCinnabarGymCurScript], a
ld [wCurMapScript], a
ret
-MovementData_757d7:
+MovementNpcToLeftAndUp:
db NPC_MOVEMENT_LEFT
db NPC_MOVEMENT_UP
db -1 ; end
@@ -91,7 +91,7 @@ PikachuMovementData_74f97:
db $35
db $3f
-MovementData_757da:
+MovementNpcToLeft:
db NPC_MOVEMENT_LEFT
db -1 ; end
@@ -132,7 +132,7 @@ CinnabarGymScript2:
call CinnabarGymScript_753e9
ld a, [wIsInBattle]
cp $ff
- jp z, CinnabarGymScript_75792
+ jp z, CinnabarGymResetScripts
ld a, [wTrainerHeaderFlagBit]
sub $2
ld c, a
@@ -194,14 +194,15 @@ CinnabarGymScript_75041:
call UpdateCinnabarGymGateTileBlocks
ret
-CinnabarGymScript3:
+CinnabarGymBlainePostBattle:
call CinnabarGymScript_753e9
ld a, [wIsInBattle]
cp $ff
- jp z, CinnabarGymScript_75792
+ jp z, CinnabarGymResetScripts
ld a, $f0
ld [wJoyIgnore], a
-CinnabarGymScript3_75857:
+; fallthrough
+CinnabarGymReceiveTM38:
ld a, $a
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
@@ -230,19 +231,19 @@ CinnabarGymScript3_75857:
ld hl, wCurrentMapScriptFlags
set 5, [hl]
- jp CinnabarGymScript_75792
+ jp CinnabarGymResetScripts
CinnabarGym_TextPointers:
- dw CinnabarGymText1
- dw CinnabarGymText2
- dw CinnabarGymText3
- dw CinnabarGymText4
- dw CinnabarGymText5
- dw CinnabarGymText6
- dw CinnabarGymText7
- dw CinnabarGymText8
- dw CinnabarGymText9
- dw BlaineBadgeText
+ dw BlaineText
+ dw CinnabarGymTrainerText1
+ dw CinnabarGymTrainerText2
+ dw CinnabarGymTrainerText3
+ dw CinnabarGymTrainerText4
+ dw CinnabarGymTrainerText5
+ dw CinnabarGymTrainerText6
+ dw CinnabarGymTrainerText7
+ dw CinnabarGymGuideText
+ dw BlaineVolcanoBadgeInfoText
dw ReceivedTM38Text
dw TM38NoRoomText
@@ -266,45 +267,45 @@ CinnabarGymScript_750c3:
ld [wCurMapScript], a
jp TextScriptEnd
-CinnabarGymText1:
+BlaineText:
text_asm
CheckEvent EVENT_BEAT_BLAINE
- jr z, .beginBattle
+ jr z, .beforeBeat
CheckEventReuseA EVENT_GOT_TM38
- jr nz, .afterVictory
- call z, CinnabarGymScript3_75857
+ jr nz, .afterBeat
+ call z, CinnabarGymReceiveTM38
call DisableWaitingAfterTextDisplay
jp TextScriptEnd
-.afterVictory
- ld hl, BlaineFireBlastText
+.afterBeat
+ ld hl, BlainePostBattleAdviceText
call PrintText
jp TextScriptEnd
-.beginBattle
- ld hl, BlaineBattleText
+.beforeBeat
+ ld hl, BlainePreBattleText
call PrintText
- ld hl, BlaineEndBattleText
- ld de, BlaineEndBattleText
+ ld hl, ReceivedVolcanoBadgeText
+ ld de, ReceivedVolcanoBadgeText
call SaveEndBattleTextPointers
ld a, $7
ld [wGymLeaderNo], a
jp CinnabarGymScript_750c3
-BlaineBattleText:
- text_far _BlaineBattleText
+BlainePreBattleText:
+ text_far _BlainePreBattleText
text_end
-BlaineEndBattleText:
- text_far _BlaineEndBattleText
+ReceivedVolcanoBadgeText:
+ text_far _ReceivedVolcanoBadgeText
sound_get_key_item ; actually plays the second channel of SFX_BALL_POOF due to the wrong music bank being loaded
text_waitbutton
text_end
-BlaineFireBlastText:
- text_far _BlaineFireBlastText
+BlainePostBattleAdviceText:
+ text_far _BlainePostBattleAdviceText
text_end
-BlaineBadgeText:
- text_far _BlaineBadgeText
+BlaineVolcanoBadgeInfoText:
+ text_far _BlaineVolcanoBadgeInfoText
text_end
ReceivedTM38Text:
@@ -317,37 +318,37 @@ TM38NoRoomText:
text_far _TM38NoRoomText
text_end
-CinnabarGymText2:
+CinnabarGymTrainerText1:
text_asm
- call CinnabarGymScript_74f48
+ call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_0
jr nz, .asm_46bb4
- ld hl, CinnabarGymText_7595f
+ ld hl, CinnabarGymBattleText2
call PrintText
- ld hl, CinnabarGymText_75964
- ld de, CinnabarGymText_75964
+ ld hl, CinnabarGymEndBattleText2
+ ld de, CinnabarGymEndBattleText2
call SaveEndBattleTextPointers
jp CinnabarGymScript_750c3
.asm_46bb4
- ld hl, CinnabarGymText_75969
+ ld hl, CinnabarGymAfterBattleText2
call PrintText
jp TextScriptEnd
-CinnabarGymText_7595f:
- text_far _CinnabarGymText_7595f
+CinnabarGymBattleText2:
+ text_far _CinnabarGymBattleText2
text_end
-CinnabarGymText_75964:
- text_far _CinnabarGymText_75964
+CinnabarGymEndBattleText2:
+ text_far _CinnabarGymEndBattleText2
text_end
-CinnabarGymText_75969:
- text_far _CinnabarGymText_75969
+CinnabarGymAfterBattleText2:
+ text_far _CinnabarGymAfterBattleText2
text_end
-CinnabarGymText3:
+CinnabarGymTrainerText2:
text_asm
- call CinnabarGymScript_74f48
+ call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_1
jr nz, .asm_751a8
call CinnabarGymScript_753f3
@@ -358,35 +359,35 @@ CinnabarGymText3:
jp CinnabarGymScript_753de
.asm_75196
- ld hl, CinnabarGymText_75994
+ ld hl, CinnabarGymBattleText1
call PrintText
- ld hl, CinnabarGymText_75999
- ld de, CinnabarGymText_75999
+ ld hl, CinnabarGymEndBattleText1
+ ld de, CinnabarGymEndBattleText1
call SaveEndBattleTextPointers
jp CinnabarGymScript_750c3
.asm_751a8
- ld hl, CinnabarGymText_7599e
+ ld hl, CinnabarGymAfterBattleText1
call PrintText
jp TextScriptEnd
-CinnabarGymText_75994:
- text_far _CinnabarGymText_75994
+CinnabarGymBattleText1:
+ text_far _CinnabarGymBattleText1
text_end
-CinnabarGymText_75999:
- text_far _CinnabarGymText_75999
+CinnabarGymEndBattleText1:
+ text_far _CinnabarGymEndBattleText1
text_end
-CinnabarGymText_7599e:
- text_far _CinnabarGymText_7599e
+CinnabarGymAfterBattleText1:
+ text_far _CinnabarGymAfterBattleText1
text_end
-CinnabarGymText4:
+CinnabarGymTrainerText3:
text_asm
- call CinnabarGymScript_74f48
+ call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_2
- jr nz, .asm_751ee
+ jr nz, .afterBeat
call CinnabarGymScript_753f3
jr nz, .asm_751dc
CheckEvent EVENT_CINNABAR_GYM_GATE2_UNLOCKED
@@ -395,34 +396,34 @@ CinnabarGymText4:
jp CinnabarGymScript_753de
.asm_751dc
- ld hl, CinnabarGymText_759c9
+ ld hl, CinnabarGymBattleText3
call PrintText
- ld hl, CinnabarGymText_759ce
- ld de, CinnabarGymText_759ce
+ ld hl, CinnabarGymEndBattleText3
+ ld de, CinnabarGymEndBattleText3
call SaveEndBattleTextPointers
jp CinnabarGymScript_750c3
-.asm_751ee
- ld hl, CinnabarGymText_759d3
+.afterBeat
+ ld hl, CinnabarGymAfterBattleText3
call PrintText
jp TextScriptEnd
-CinnabarGymText_759c9:
- text_far _CinnabarGymText_759c9
+CinnabarGymBattleText3:
+ text_far _CinnabarGymBattleText3
text_end
-CinnabarGymText_759ce:
- text_far _CinnabarGymText_759ce
+CinnabarGymEndBattleText3:
+ text_far _CinnabarGymEndBattleText3
text_end
-CinnabarGymText_759d3:
- text_far _CinnabarGymText_759d3
+CinnabarGymAfterBattleText3:
+ text_far _CinnabarGymAfterBattleText3
text_end
-CinnabarGymText5:
+CinnabarGymTrainerText4:
text_asm
- call CinnabarGymScript_74f48
+ call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_3
- jr nz, .asm_75234
+ jr nz, .afterBeat
call CinnabarGymScript_753f3
jr nz, .asm_75222
CheckEvent EVENT_CINNABAR_GYM_GATE3_UNLOCKED
@@ -431,34 +432,34 @@ CinnabarGymText5:
jp CinnabarGymScript_753de
.asm_75222
- ld hl, CinnabarGymText_759fe
+ ld hl, CinnabarGymBattleText4
call PrintText
- ld hl, CinnabarGymText_75a03
- ld de, CinnabarGymText_75a03
+ ld hl, CinnabarGymEndBattleText4
+ ld de, CinnabarGymEndBattleText4
call SaveEndBattleTextPointers
jp CinnabarGymScript_750c3
-.asm_75234
- ld hl, CinnabarGymText_75a08
+.afterBeat
+ ld hl, CinnabarGymAfterBattleText4
call PrintText
jp TextScriptEnd
-CinnabarGymText_759fe:
- text_far _CinnabarGymText_759fe
+CinnabarGymBattleText4:
+ text_far _CinnabarGymBattleText4
text_end
-CinnabarGymText_75a03:
- text_far _CinnabarGymText_75a03
+CinnabarGymEndBattleText4:
+ text_far _CinnabarGymEndBattleText4
text_end
-CinnabarGymText_75a08:
- text_far _CinnabarGymText_75a08
+CinnabarGymAfterBattleText4:
+ text_far _CinnabarGymAfterBattleText4
text_end
-CinnabarGymText6:
+CinnabarGymTrainerText5:
text_asm
- call CinnabarGymScript_74f48
+ call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_4
- jr nz, .asm_776b4
+ jr nz, .afterBeat
call CinnabarGymScript_753f3
jr nz, .asm_75222
CheckEvent EVENT_CINNABAR_GYM_GATE4_UNLOCKED
@@ -467,34 +468,34 @@ CinnabarGymText6:
jp CinnabarGymScript_753de
.asm_75222
- ld hl, CinnabarGymText_75a33
+ ld hl, CinnabarGymBattleText5
call PrintText
- ld hl, CinnabarGymText_75a38
- ld de, CinnabarGymText_75a38
+ ld hl, CinnabarGymEndBattleText5
+ ld de, CinnabarGymEndBattleText5
call SaveEndBattleTextPointers
jp CinnabarGymScript_750c3
-.asm_776b4
- ld hl, CinnabarGymText_75a3d
+.afterBeat
+ ld hl, CinnabarGymAfterBattleText5
call PrintText
jp TextScriptEnd
-CinnabarGymText_75a33:
- text_far _CinnabarGymText_75a33
+CinnabarGymBattleText5:
+ text_far _CinnabarGymBattleText5
text_end
-CinnabarGymText_75a38:
- text_far _CinnabarGymText_75a38
+CinnabarGymEndBattleText5:
+ text_far _CinnabarGymEndBattleText5
text_end
-CinnabarGymText_75a3d:
- text_far _CinnabarGymText_75a3d
+CinnabarGymAfterBattleText5:
+ text_far _CinnabarGymAfterBattleText5
text_end
-CinnabarGymText7:
+CinnabarGymTrainerText6:
text_asm
- call CinnabarGymScript_74f48
+ call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_5
- jr nz, .asm_2f755
+ jr nz, .afterBeat
call CinnabarGymScript_753f3
jr nz, .asm_75222
CheckEvent EVENT_CINNABAR_GYM_GATE5_UNLOCKED
@@ -503,34 +504,34 @@ CinnabarGymText7:
jp CinnabarGymScript_753de
.asm_75222
- ld hl, CinnabarGymText_75a68
+ ld hl, CinnabarGymBattleText6
call PrintText
- ld hl, CinnabarGymText_75a6d
- ld de, CinnabarGymText_75a6d
+ ld hl, CinnabarGymEndBattleText6
+ ld de, CinnabarGymEndBattleText6
call SaveEndBattleTextPointers
jp CinnabarGymScript_750c3
-.asm_2f755
- ld hl, CinnabarGymText_75a72
+.afterBeat
+ ld hl, CinnabarGymAfterBattleText6
call PrintText
jp TextScriptEnd
-CinnabarGymText_75a68:
- text_far _CinnabarGymText_75a68
+CinnabarGymBattleText6:
+ text_far _CinnabarGymBattleText6
text_end
-CinnabarGymText_75a6d:
- text_far _CinnabarGymText_75a6d
+CinnabarGymEndBattleText6:
+ text_far _CinnabarGymEndBattleText6
text_end
-CinnabarGymText_75a72:
- text_far _CinnabarGymText_75a72
+CinnabarGymAfterBattleText6:
+ text_far _CinnabarGymAfterBattleText6
text_end
-CinnabarGymText8:
+CinnabarGymTrainerText7:
text_asm
- call CinnabarGymScript_74f48
+ call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_6
- jr nz, .asm_d87be
+ jr nz, .afterBeat
call CinnabarGymScript_753f3
jr nz, .asm_75222
CheckEvent EVENT_CINNABAR_GYM_GATE6_UNLOCKED
@@ -539,30 +540,30 @@ CinnabarGymText8:
jp CinnabarGymScript_753de
.asm_75222
- ld hl, CinnabarGymText_75a9d
+ ld hl, CinnabarGymBattleText7
call PrintText
- ld hl, CinnabarGymText_75aa2
- ld de, CinnabarGymText_75aa2
+ ld hl, CinnabarGymEndBattleText7
+ ld de, CinnabarGymEndBattleText7
call SaveEndBattleTextPointers
jp CinnabarGymScript_750c3
-.asm_d87be
- ld hl, CinnabarGymText_75aa7
+.afterBeat
+ ld hl, CinnabarGymAfterBattleText7
call PrintText
jp TextScriptEnd
-CinnabarGymText_75a9d:
- text_far _CinnabarGymText_75a9d
+CinnabarGymBattleText7:
+ text_far _CinnabarGymBattleText7
text_end
-CinnabarGymText_75aa2:
- text_far _CinnabarGymText_75aa2
+CinnabarGymEndBattleText7:
+ text_far _CinnabarGymEndBattleText7
text_end
-CinnabarGymText_75aa7:
- text_far _CinnabarGymText_75aa7
+CinnabarGymAfterBattleText7:
+ text_far _CinnabarGymAfterBattleText7
text_end
-CinnabarGymText9:
+CinnabarGymGuideText:
text_asm
callfar Func_f2133
jp TextScriptEnd
diff --git a/scripts/CinnabarGym3.asm b/scripts/CinnabarGym3.asm
index af3db510..dae792df 100644
--- a/scripts/CinnabarGym3.asm
+++ b/scripts/CinnabarGym3.asm
@@ -1,20 +1,20 @@
Func_f2133::
CheckEvent EVENT_BEAT_BLAINE
- jr nz, .asm_627d9
- ld hl, CinnabarGymText_75ac2
- jr .asm_0b11d
-.asm_627d9
- ld hl, CinnabarGymText_75ac7
-.asm_0b11d
+ jr nz, .afterBeat
+ ld hl, CinnabarGymGuidePreBattleText
+ jr .done
+.afterBeat
+ ld hl, CinnabarGymGuidePostBattleText
+.done
call PrintText
ret
-CinnabarGymText_75ac2:
- text_far _CinnabarGymText_75ac2
+CinnabarGymGuidePreBattleText:
+ text_far _CinnabarGymGuidePreBattleText
text_end
-CinnabarGymText_75ac7:
- text_far _CinnabarGymText_75ac7
+CinnabarGymGuidePostBattleText:
+ text_far _CinnabarGymGuidePostBattleText
text_end
Func_f2150::
diff --git a/scripts/FuchsiaGym.asm b/scripts/FuchsiaGym.asm
index 9216ab08..8dc93d22 100644
--- a/scripts/FuchsiaGym.asm
+++ b/scripts/FuchsiaGym.asm
@@ -24,7 +24,7 @@ FuchsiaGym_Script:
.LeaderName:
db "KOGA@"
-FuchsiaGymScript_75477:
+FuchsiaGymResetScripts:
xor a
ld [wJoyIgnore], a
ld [wFuchsiaGymCurScript], a
@@ -35,15 +35,16 @@ FuchsiaGym_ScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
- dw FuchsiaGymScript3
+ dw FuchsiaGymKogaPostBattle
-FuchsiaGymScript3:
+FuchsiaGymKogaPostBattle:
ld a, [wIsInBattle]
cp $ff
- jp z, FuchsiaGymScript_75477
+ jp z, FuchsiaGymResetScripts
ld a, $f0
ld [wJoyIgnore], a
-FuchsiaGymScript3_75497:
+; fallthrough
+FuchsiaGymReceiveTM06:
ld a, $9
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
@@ -69,20 +70,20 @@ FuchsiaGymScript3_75497:
; deactivate gym trainers
SetEventRange EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
- jp FuchsiaGymScript_75477
+ jp FuchsiaGymResetScripts
FuchsiaGym_TextPointers:
- dw FuchsiaGymText1
- dw FuchsiaGymText2
- dw FuchsiaGymText3
- dw FuchsiaGymText4
- dw FuchsiaGymText5
- dw FuchsiaGymText6
- dw FuchsiaGymText7
- dw FuchsiaGymText8
- dw FuchsiaGymText9
- dw FuchsiaGymText10
- dw FuchsiaGymText11
+ dw KogaText
+ dw FuchsiaGymTrainerText1
+ dw FuchsiaGymTrainerText2
+ dw FuchsiaGymTrainerText3
+ dw FuchsiaGymTrainerText4
+ dw FuchsiaGymTrainerText5
+ dw FuchsiaGymTrainerText6
+ dw FuchsiaGymGuideText
+ dw KogaSoulBadgeInfoText
+ dw ReceivedTM06Text
+ dw TM06NoRoomText
FuchsiaGymTrainerHeaders:
def_trainers 2
@@ -100,27 +101,27 @@ FuchsiaGymTrainerHeader5:
trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_5, 2, FuchsiaGymBattleText6, FuchsiaGymEndBattleText6, FuchsiaGymAfterBattleText6
db -1 ; end
-FuchsiaGymText1:
+KogaText:
text_asm
CheckEvent EVENT_BEAT_KOGA
- jr z, .beginBattle
+ jr z, .beforeBeat
CheckEventReuseA EVENT_GOT_TM06
- jr nz, .afterVictory
- call z, FuchsiaGymScript3_75497
+ jr nz, .afterBeat
+ call z, FuchsiaGymReceiveTM06
call DisableWaitingAfterTextDisplay
jr .done
-.afterVictory
- ld hl, KogaExplainToxicText
+.afterBeat
+ ld hl, KogaPostBattleAdviceText
call PrintText
jr .done
-.beginBattle
+.beforeBeat
ld hl, KogaBeforeBattleText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, KogaAfterBattleText
- ld de, KogaAfterBattleText
+ ld hl, ReceivedSoulBadgeText
+ ld de, ReceivedSoulBadgeText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -139,19 +140,19 @@ KogaBeforeBattleText:
text_far _KogaBeforeBattleText
text_end
-KogaAfterBattleText:
- text_far _KogaAfterBattleText
+ReceivedSoulBadgeText:
+ text_far _ReceivedSoulBadgeText
text_end
-KogaExplainToxicText:
- text_far _KogaExplainToxicText
+KogaPostBattleAdviceText:
+ text_far _KogaPostBattleAdviceText
text_end
-FuchsiaGymText9:
- text_far _FuchsiaGymText9
+KogaSoulBadgeInfoText:
+ text_far _KogaSoulBadgeInfoText
text_end
-FuchsiaGymText10:
+ReceivedTM06Text:
text_far _ReceivedTM06Text
sound_get_key_item
@@ -159,11 +160,11 @@ TM06ExplanationText:
text_far _TM06ExplanationText
text_end
-FuchsiaGymText11:
+TM06NoRoomText:
text_far _TM06NoRoomText
text_end
-FuchsiaGymText2:
+FuchsiaGymTrainerText1:
text_asm
ld hl, FuchsiaGymTrainerHeader0
call TalkToTrainer
@@ -181,7 +182,7 @@ FuchsiaGymAfterBattleText1:
text_far _FuchsiaGymAfterBattleText1
text_end
-FuchsiaGymText3:
+FuchsiaGymTrainerText2:
text_asm
ld hl, FuchsiaGymTrainerHeader1
call TalkToTrainer
@@ -199,7 +200,7 @@ FuchsiaGymAfterBattleText2:
text_far _FuchsiaGymAfterBattleText2
text_end
-FuchsiaGymText4:
+FuchsiaGymTrainerText3:
text_asm
ld hl, FuchsiaGymTrainerHeader2
call TalkToTrainer
@@ -217,7 +218,7 @@ FuchsiaGymAfterBattleText3:
text_far _FuchsiaGymAfterBattleText3
text_end
-FuchsiaGymText5:
+FuchsiaGymTrainerText4:
text_asm
ld hl, FuchsiaGymTrainerHeader3
call TalkToTrainer
@@ -235,7 +236,7 @@ FuchsiaGymAfterBattleText4:
text_far _FuchsiaGymAfterBattleText4
text_end
-FuchsiaGymText6:
+FuchsiaGymTrainerText5:
text_asm
ld hl, FuchsiaGymTrainerHeader4
call TalkToTrainer
@@ -253,7 +254,7 @@ FuchsiaGymAfterBattleText5:
text_far _FuchsiaGymAfterBattleText5
text_end
-FuchsiaGymText7:
+FuchsiaGymTrainerText6:
text_asm
ld hl, FuchsiaGymTrainerHeader5
call TalkToTrainer
@@ -271,20 +272,20 @@ FuchsiaGymAfterBattleText6:
text_far _FuchsiaGymAfterBattleText6
text_end
-FuchsiaGymText8:
+FuchsiaGymGuideText:
text_asm
CheckEvent EVENT_BEAT_KOGA
- ld hl, FuchsiaGymText_75653
- jr nz, .asm_50671
- ld hl, FuchsiaGymText_7564e
-.asm_50671
+ ld hl, FuchsiaGymGuidePostBattleText
+ jr nz, .afterBeat
+ ld hl, FuchsiaGymGuidePreBattleText
+.afterBeat
call PrintText
jp TextScriptEnd
-FuchsiaGymText_7564e:
- text_far _FuchsiaGymText_7564e
+FuchsiaGymGuidePreBattleText:
+ text_far _FuchsiaGymGuidePreBattleText
text_end
-FuchsiaGymText_75653:
- text_far _FuchsiaGymText_75653
+FuchsiaGymGuidePostBattleText:
+ text_far _FuchsiaGymGuidePostBattleText
text_end
diff --git a/scripts/PewterGym.asm b/scripts/PewterGym.asm
index 2d3c2bb9..016535c2 100644
--- a/scripts/PewterGym.asm
+++ b/scripts/PewterGym.asm
@@ -23,7 +23,7 @@ PewterGym_Script:
.LeaderName:
db "BROCK@"
-PewterGymScript_5c3bf:
+PewterGymResetScripts:
xor a
ld [wJoyIgnore], a
ld [wPewterGymCurScript], a
@@ -34,15 +34,16 @@ PewterGym_ScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
- dw PewterGymScript3
+ dw PewterGymBrockPostBattle
-PewterGymScript3:
+PewterGymBrockPostBattle:
ld a, [wIsInBattle]
cp $ff
- jp z, PewterGymScript_5c3bf
+ jp z, PewterGymResetScripts
ld a, $f0
ld [wJoyIgnore], a
-PewterGymScript_5c3df:
+; fallthrough
+PewterGymScriptReceiveTM34:
ld a, $4
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
@@ -77,15 +78,15 @@ PewterGymScript_5c3df:
; deactivate gym trainers
SetEvent EVENT_BEAT_PEWTER_GYM_TRAINER_0
- jp PewterGymScript_5c3bf
+ jp PewterGymResetScripts
PewterGym_TextPointers:
- dw PewterGymText1
- dw PewterGymText2
- dw PewterGymText3
- dw PewterGymText4
- dw PewterGymText5
- dw PewterGymText6
+ dw BrockText
+ dw PewterGymTrainerText1
+ dw PewterGymGuideText
+ dw BeforeReceivedTM34Text
+ dw ReceivedTM34Text
+ dw TM34NoRoomText
PewterGymTrainerHeaders:
def_trainers 2
@@ -93,27 +94,27 @@ PewterGymTrainerHeader0:
trainer EVENT_BEAT_PEWTER_GYM_TRAINER_0, 5, PewterGymBattleText1, PewterGymEndBattleText1, PewterGymAfterBattleText1
db -1 ; end
-PewterGymText1:
+BrockText:
text_asm
CheckEvent EVENT_BEAT_BROCK
- jr z, .beginBattle
+ jr z, .beforeBeat
CheckEventReuseA EVENT_GOT_TM34
- jr nz, .gymVictory
- call z, PewterGymScript_5c3df
+ jr nz, .afterBeat
+ call z, PewterGymScriptReceiveTM34
call DisableWaitingAfterTextDisplay
jr .done
-.gymVictory
- ld hl, PewterGymText_5c4a3
+.afterBeat
+ ld hl, BrockPostBattleAdviceText
call PrintText
jr .done
-.beginBattle
- ld hl, PewterGymText_5c49e
+.beforeBeat
+ ld hl, BrockPreBattleText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, PewterGymText_5c4bc
- ld de, PewterGymText_5c4bc
+ ld hl, ReceivedBoulderBadgeText
+ ld de, ReceivedBoulderBadgeText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -129,35 +130,35 @@ PewterGymText1:
.done
jp TextScriptEnd
-PewterGymText_5c49e:
- text_far _PewterGymText_5c49e
+BrockPreBattleText:
+ text_far _BrockPreBattleText
text_end
-PewterGymText_5c4a3:
- text_far _PewterGymText_5c4a3
+BrockPostBattleAdviceText:
+ text_far _BrockPostBattleAdviceText
text_end
-PewterGymText4:
- text_far _TM34PreReceiveText
+BeforeReceivedTM34Text:
+ text_far _BeforeReceivedTM34Text
text_end
-PewterGymText5:
+ReceivedTM34Text:
text_far _ReceivedTM34Text
sound_get_item_1
text_far _TM34ExplanationText
text_end
-PewterGymText6:
+TM34NoRoomText:
text_far _TM34NoRoomText
text_end
-PewterGymText_5c4bc:
- text_far _PewterGymText_5c4bc
+ReceivedBoulderBadgeText:
+ text_far _ReceivedBoulderBadgeText
sound_get_item_1
- text_far _PewterGymText_5c4c1
+ text_far _BrockBoulerBadgeInfoText ; Text to tell that the flash technique can be used
text_end
-PewterGymText2:
+PewterGymTrainerText1:
text_asm
ld hl, PewterGymTrainerHeader0
call TalkToTrainer
@@ -175,58 +176,58 @@ PewterGymAfterBattleText1:
text_far _PewterGymAfterBattleText1
text_end
-PewterGymText3:
+PewterGymGuideText:
text_asm
ld a, [wBeatGymFlags]
bit BIT_BOULDERBADGE, a
- jr nz, .asm_5c50c
- ld hl, PewterGymText_5c515
+ jr nz, .afterBeat
+ ld hl, PewterGymGuidePreAdviceText
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_5c4fe
+ jr nz, .PewterGymGuideBeginAdviceText
ld a, [wd472]
bit 7, a
jp nz, .asm_5c3fa
- ld hl, PewterGymText_5c51a
+ ld hl, PewterGymGuideBeginAdviceText
call PrintText
- jr .asm_5c504
-.asm_5c4fe
+ jr .PewterGymGuideAdviceText
+.PewterGymGuideBeginAdviceText
ld hl, PewterGymText_5c524
call PrintText
-.asm_5c504
- ld hl, PewterGymText_5c51f
+.PewterGymGuideAdviceText
+ ld hl, PewterGymGuideAdviceText
call PrintText
- jr .asm_5c512
-.asm_5c50c
- ld hl, PewterGymText_5c529
+ jr .done
+.afterBeat
+ ld hl, PewterGymGuidePostBattleText
call PrintText
-.asm_5c512
+.done
jp TextScriptEnd
.asm_5c3fa
ld hl, PewterGymText_5c41c
call PrintText
jp TextScriptEnd
-PewterGymText_5c515:
- text_far _PewterGymText_5c515
+PewterGymGuidePreAdviceText:
+ text_far _PewterGymGuidePreAdviceText
text_end
-PewterGymText_5c51a:
- text_far _PewterGymText_5c51a
+PewterGymGuideBeginAdviceText:
+ text_far _PewterGymGuideBeginAdviceText
text_end
-PewterGymText_5c51f:
- text_far _PewterGymText_5c51f
+PewterGymGuideAdviceText:
+ text_far _PewterGymGuideAdviceText
text_end
PewterGymText_5c524:
text_far _PewterGymText_5c524
text_end
-PewterGymText_5c529:
- text_far _PewterGymText_5c529
+PewterGymGuidePostBattleText:
+ text_far _PewterGymGuidePostBattleText
text_end
PewterGymText_5c41c:
diff --git a/scripts/SaffronGym.asm b/scripts/SaffronGym.asm
index a55c58ff..23b2dd85 100644
--- a/scripts/SaffronGym.asm
+++ b/scripts/SaffronGym.asm
@@ -22,7 +22,7 @@ SaffronGym_Script:
.LeaderName:
db "SABRINA@"
-SaffronGymText_5d048:
+SaffronGymResetScripts:
xor a
ld [wJoyIgnore], a
ld [wSaffronGymCurScript], a
@@ -33,16 +33,16 @@ SaffronGym_ScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
- dw SaffronGymScript3
+ dw SaffronGymSabrinaPostBattle
-SaffronGymScript3:
+SaffronGymSabrinaPostBattle:
ld a, [wIsInBattle]
cp $ff
- jp z, SaffronGymText_5d048
+ jp z, SaffronGymResetScripts
ld a, $f0
ld [wJoyIgnore], a
-SaffronGymText_5d068:
+SaffronGymReceiveTM46:
ld a, $a
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
@@ -68,21 +68,21 @@ SaffronGymText_5d068:
; deactivate gym trainers
SetEventRange EVENT_BEAT_SAFFRON_GYM_TRAINER_0, EVENT_BEAT_SAFFRON_GYM_TRAINER_6
- jp SaffronGymText_5d048
+ jp SaffronGymResetScripts
SaffronGym_TextPointers:
- dw SaffronGymText1
- dw SaffronGymText2
- dw SaffronGymText3
- dw SaffronGymText4
- dw SaffronGymText5
- dw SaffronGymText6
- dw SaffronGymText7
- dw SaffronGymText8
- dw SaffronGymText9
- dw SaffronGymText10
- dw SaffronGymText11
- dw SaffronGymText12
+ dw SabrinaText
+ dw SaffronGymTrainerText1
+ dw SaffronGymTrainerText2
+ dw SaffronGymTrainerText3
+ dw SaffronGymTrainerText4
+ dw SaffronGymTrainerText5
+ dw SaffronGymTrainerText6
+ dw SaffronGymTrainerText7
+ dw SaffronGymGuideText
+ dw KogaMarshBadgeInfoText
+ dw ReceivedTM46Text
+ dw TM46NoRoomText
SaffronGymTrainerHeaders:
def_trainers 2
@@ -102,27 +102,27 @@ SaffronGymTrainerHeader6:
trainer EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 3, SaffronGymBattleText7, SaffronGymEndBattleText7, SaffronGymAfterBattleText7
db -1 ; end
-SaffronGymText1:
+SabrinaText:
text_asm
CheckEvent EVENT_BEAT_SABRINA
- jr z, .beginBattle
+ jr z, .beforeBeat
CheckEventReuseA EVENT_GOT_TM46
- jr nz, .afterVictory
- call z, SaffronGymText_5d068
+ jr nz, .afterBeat
+ call z, SaffronGymReceiveTM46
call DisableWaitingAfterTextDisplay
jr .done
-.afterVictory
- ld hl, SaffronGymText_5d16e
+.afterBeat
+ ld hl, SabrinaPostBattleAdviceText
call PrintText
jr .done
-.beginBattle
- ld hl, SaffronGymText_5d162
+.beforeBeat
+ ld hl, SabrinaPreBattleText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, SaffronGymText_5d167
- ld de, SaffronGymText_5d167
+ ld hl, ReceivedMarshBadgeText
+ ld de, ReceivedMarshBadgeText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -135,95 +135,95 @@ SaffronGymText1:
.done
jp TextScriptEnd
-SaffronGymText_5d162:
- text_far _SaffronGymText_5d162
+SabrinaPreBattleText:
+ text_far _SabrinaPreBattleText
text_end
-SaffronGymText_5d167:
- text_far _SaffronGymText_5d167
+ReceivedMarshBadgeText:
+ text_far _ReceivedMarshBadgeText
sound_get_key_item ; actually plays the second channel of SFX_BALL_POOF due to the wrong music bank being loaded
text_promptbutton
text_end
-SaffronGymText_5d16e:
- text_far _SaffronGymText_5d16e
+SabrinaPostBattleAdviceText:
+ text_far _SabrinaPostBattleAdviceText
text_end
-SaffronGymText10:
- text_far _SaffronGymText_5d173
+KogaMarshBadgeInfoText:
+ text_far _KogaMarshBadgeInfoText
text_end
-SaffronGymText11:
- text_far ReceivedTM46Text
+ReceivedTM46Text:
+ text_far _ReceivedTM46Text
sound_get_item_1
text_far _TM46ExplanationText
text_end
-SaffronGymText12:
+TM46NoRoomText:
text_far _TM46NoRoomText
text_end
-SaffronGymText2:
+SaffronGymTrainerText1:
text_asm
ld hl, SaffronGymTrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-SaffronGymText3:
+SaffronGymTrainerText2:
text_asm
ld hl, SaffronGymTrainerHeader1
call TalkToTrainer
jp TextScriptEnd
-SaffronGymText4:
+SaffronGymTrainerText3:
text_asm
ld hl, SaffronGymTrainerHeader2
call TalkToTrainer
jp TextScriptEnd
-SaffronGymText5:
+SaffronGymTrainerText4:
text_asm
ld hl, SaffronGymTrainerHeader3
call TalkToTrainer
jp TextScriptEnd
-SaffronGymText6:
+SaffronGymTrainerText5:
text_asm
ld hl, SaffronGymTrainerHeader4
call TalkToTrainer
jp TextScriptEnd
-SaffronGymText7:
+SaffronGymTrainerText6:
text_asm
ld hl, SaffronGymTrainerHeader5
call TalkToTrainer
jp TextScriptEnd
-SaffronGymText8:
+SaffronGymTrainerText7:
text_asm
ld hl, SaffronGymTrainerHeader6
call TalkToTrainer
jp TextScriptEnd
-SaffronGymText9:
+SaffronGymGuideText:
text_asm
CheckEvent EVENT_BEAT_SABRINA
- jr nz, .asm_5d1dd
- ld hl, SaffronGymText_5d1e6
+ jr nz, .afterBeat
+ ld hl, SaffronGymGuidePreBattleText
call PrintText
- jr .asm_5d1e3
-.asm_5d1dd
- ld hl, SaffronGymText_5d1eb
+ jr .done
+.afterBeat
+ ld hl, SaffronGymGuidePostBattleText
call PrintText
-.asm_5d1e3
+.done
jp TextScriptEnd
-SaffronGymText_5d1e6:
- text_far _SaffronGymText_5d1e6
+SaffronGymGuidePreBattleText:
+ text_far _SaffronGymGuidePreBattleText
text_end
-SaffronGymText_5d1eb:
- text_far _SaffronGymText_5d1eb
+SaffronGymGuidePostBattleText:
+ text_far _SaffronGymGuidePostBattleText
text_end
SaffronGymBattleText1:
diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm
index 0263669f..af118d18 100644
--- a/scripts/VermilionDock.asm
+++ b/scripts/VermilionDock.asm
@@ -182,12 +182,12 @@ VermilionDock_1dc7c:
VermilionDock_EraseSSAnne:
; Fill the area the S.S. Anne occupies in BG map 0 with water tiles.
ld hl, wVermilionDockTileMapBuffer
- ld bc, (5 * BG_MAP_WIDTH) + SCREEN_WIDTH
+ ld bc, wVermilionDockTileMapBufferEnd - wVermilionDockTileMapBuffer
ld a, $14 ; water tile
call FillMemory
hlbgcoord 0, 10
ld de, wVermilionDockTileMapBuffer
- ld bc, (6 * BG_MAP_WIDTH) / 16
+ lb bc, BANK(wVermilionDockTileMapBuffer), 12
call CopyVideoData
; Replace the blocks of the lower half of the ship with water blocks. This
diff --git a/scripts/VermilionGym.asm b/scripts/VermilionGym.asm
index 3673f9b9..3bbb8743 100644
--- a/scripts/VermilionGym.asm
+++ b/scripts/VermilionGym.asm
@@ -94,8 +94,8 @@ VermilionGym_TextPointers:
dw VermilionGymTrainerText1
dw VermilionGymTrainerText2
dw VermilionGymTrainerText3
- dw VermilionGymFanText
- dw LTSurgeThunderbadgeInfoText
+ dw VermilionGymGuideText
+ dw LTSurgeThunderBadgeInfoText
dw ReceivedTM24Text
dw TM24NoRoomText
@@ -128,8 +128,8 @@ LTSurgeText:
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, ReceivedThunderbadgeText
- ld de, ReceivedThunderbadgeText
+ ld hl, ReceivedThunderBadgeText
+ ld de, ReceivedThunderBadgeText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -153,8 +153,8 @@ LTSurgePostBattleAdviceText:
text_far _LTSurgePostBattleAdviceText
text_end
-LTSurgeThunderbadgeInfoText:
- text_far _LTSurgeThunderbadgeInfoText
+LTSurgeThunderBadgeInfoText:
+ text_far _LTSurgeThunderBadgeInfoText
text_end
ReceivedTM24Text:
@@ -167,8 +167,8 @@ TM24NoRoomText:
text_far _TM24NoRoomText
text_end
-ReceivedThunderbadgeText:
- text_far _ReceivedThunderbadgeText
+ReceivedThunderBadgeText:
+ text_far _ReceivedThunderBadgeText
text_end
VermilionGymTrainerText1:
@@ -225,24 +225,24 @@ VermilionGymAfterBattleText3:
text_far _VermilionGymAfterBattleText3
text_end
-VermilionGymFanText:
+VermilionGymGuideText:
text_asm
ld a, [wBeatGymFlags]
bit BIT_THUNDERBADGE, a
jr nz, .afterBeat
- ld hl, VermilionGymFanPreBattleText
+ ld hl, VermilionGymGuidePreBattleText
call PrintText
jr .done
.afterBeat
- ld hl, VermilionGymFanPostBattleText
+ ld hl, VermilionGymGuidePostBattleText
call PrintText
.done
jp TextScriptEnd
-VermilionGymFanPreBattleText:
- text_far _VermilionGymFanPreBattleText
+VermilionGymGuidePreBattleText:
+ text_far _VermilionGymGuidePreBattleText
text_end
-VermilionGymFanPostBattleText:
- text_far _VermilionGymFanPostBattleText
+VermilionGymGuidePostBattleText:
+ text_far _VermilionGymGuidePostBattleText
text_end
diff --git a/scripts/ViridianGym.asm b/scripts/ViridianGym.asm
index b7b4a34d..0b90383c 100644
--- a/scripts/ViridianGym.asm
+++ b/scripts/ViridianGym.asm
@@ -16,7 +16,7 @@ ViridianGym_Script:
.LeaderName:
db "GIOVANNI@"
-ViridianGymScript_748d6:
+ViridianGymResetScripts:
xor a
ld [wJoyIgnore], a
ld [wViridianGymCurScript], a
@@ -27,7 +27,7 @@ ViridianGym_ScriptPointers:
dw ViridianGymScript0
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
- dw ViridianGymScript3
+ dw ViridianGymGiovanniPostBattle
dw ViridianGymScript4
ViridianGymScript0:
@@ -116,7 +116,7 @@ ViridianGymArrowMovement12:
ViridianGymScript4:
ld a, [wSimulatedJoypadStatesIndex]
and a
- jr nz, .asm_74980
+ jr nz, .ViridianGymLoadSpinnerArrow
xor a
ld [wJoyIgnore], a
ld hl, wd736
@@ -124,16 +124,17 @@ ViridianGymScript4:
ld a, $0
ld [wCurMapScript], a
ret
-.asm_74980
+.ViridianGymLoadSpinnerArrow
farjp LoadSpinnerArrowTiles
-ViridianGymScript3:
+ViridianGymGiovanniPostBattle:
ld a, [wIsInBattle]
cp $ff
- jp z, ViridianGymScript_748d6
+ jp z, ViridianGymResetScripts
ld a, $f0
ld [wJoyIgnore], a
-ViridianGymScript3_74995:
+; fallthrough
+ViridianGymReceiveTM27:
ld a, $c
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
@@ -163,23 +164,23 @@ ViridianGymScript3_74995:
ld [wMissableObjectIndex], a
predef ShowObject
SetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_BATTLE
- jp ViridianGymScript_748d6
+ jp ViridianGymResetScripts
ViridianGym_TextPointers:
- dw ViridianGymText1
- dw ViridianGymText2
- dw ViridianGymText3
- dw ViridianGymText4
- dw ViridianGymText5
- dw ViridianGymText6
- dw ViridianGymText7
- dw ViridianGymText8
- dw ViridianGymText9
- dw ViridianGymText10
+ dw GiovanniText
+ dw ViridianGymTrainerText1
+ dw ViridianGymTrainerText2
+ dw ViridianGymTrainerText3
+ dw ViridianGymTrainerText4
+ dw ViridianGymTrainerText5
+ dw ViridianGymTrainerText6
+ dw ViridianGymTrainerText7
+ dw ViridianGymTrainerText8
+ dw ViridianGymGuideText
dw PickUpItemText
- dw ViridianGymText12
- dw ViridianGymText13
- dw ViridianGymText14
+ dw GiovanniEarthBadgeInfoText
+ dw ReceivedTM27Text
+ dw TM27NoRoomText
ViridianGymTrainerHeaders:
def_trainers 2
@@ -201,19 +202,19 @@ ViridianGymTrainerHeader7:
trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 4, ViridianGymBattleText8, ViridianGymEndBattleText8, ViridianGymAfterBattleText8
db -1 ; end
-ViridianGymText1:
+GiovanniText:
text_asm
CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
- jr z, .beginBattle
+ jr z, .beforeBeat
CheckEventReuseA EVENT_GOT_TM27
- jr nz, .afterVictory
- call z, ViridianGymScript3_74995
+ jr nz, .afterBeat
+ call z, ViridianGymReceiveTM27
call DisableWaitingAfterTextDisplay
jr .done
-.afterVictory
+.afterBeat
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, ViridianGymText_74ad9
+ ld hl, GiovanniPostBattleAdviceText
call PrintText
call GBFadeOutToBlack
ld a, HS_VIRIDIAN_GYM_GIOVANNI
@@ -223,14 +224,14 @@ ViridianGymText1:
call Delay3
call GBFadeInFromBlack
jr .done
-.beginBattle
- ld hl, ViridianGymText_74ace
+.beforeBeat
+ ld hl, GiovanniPreBattleText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, ViridianGymText_74ad3
- ld de, ViridianGymText_74ad3
+ ld hl, ReceivedEarthBadgeText
+ ld de, ReceivedEarthBadgeText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -243,25 +244,25 @@ ViridianGymText1:
.done
jp TextScriptEnd
-ViridianGymText_74ace:
- text_far _ViridianGymText_74ace
+GiovanniPreBattleText:
+ text_far _GiovanniPreBattleText
text_end
-ViridianGymText_74ad3:
- text_far _ViridianGymText_74ad3
+ReceivedEarthBadgeText:
+ text_far _ReceivedEarthBadgeText
sound_level_up ; probably supposed to play SFX_GET_ITEM_1 but the wrong music bank is loaded
text_end
-ViridianGymText_74ad9:
- text_far _ViridianGymText_74ad9
+GiovanniPostBattleAdviceText:
+ text_far _GiovanniPostBattleAdviceText
text_waitbutton
text_end
-ViridianGymText12:
- text_far _ViridianGymText12
+GiovanniEarthBadgeInfoText:
+ text_far _GiovanniEarthBadgeInfoText
text_end
-ViridianGymText13:
+ReceivedTM27Text:
text_far _ReceivedTM27Text
sound_get_item_1
@@ -269,11 +270,11 @@ TM27ExplanationText:
text_far _TM27ExplanationText
text_end
-ViridianGymText14:
+TM27NoRoomText:
text_far _TM27NoRoomText
text_end
-ViridianGymText2:
+ViridianGymTrainerText1:
text_asm
ld hl, ViridianGymTrainerHeader0
call TalkToTrainer
@@ -291,7 +292,7 @@ ViridianGymAfterBattleText1:
text_far _ViridianGymAfterBattleText1
text_end
-ViridianGymText3:
+ViridianGymTrainerText2:
text_asm
ld hl, ViridianGymTrainerHeader1
call TalkToTrainer
@@ -309,7 +310,7 @@ ViridianGymAfterBattleText2:
text_far _ViridianGymAfterBattleText2
text_end
-ViridianGymText4:
+ViridianGymTrainerText3:
text_asm
ld hl, ViridianGymTrainerHeader2
call TalkToTrainer
@@ -327,7 +328,7 @@ ViridianGymAfterBattleText3:
text_far _ViridianGymAfterBattleText3
text_end
-ViridianGymText5:
+ViridianGymTrainerText4:
text_asm
ld hl, ViridianGymTrainerHeader3
call TalkToTrainer
@@ -345,7 +346,7 @@ ViridianGymAfterBattleText4:
text_far _ViridianGymAfterBattleText4
text_end
-ViridianGymText6:
+ViridianGymTrainerText5:
text_asm
ld hl, ViridianGymTrainerHeader4
call TalkToTrainer
@@ -363,7 +364,7 @@ ViridianGymAfterBattleText5:
text_far _ViridianGymAfterBattleText5
text_end
-ViridianGymText7:
+ViridianGymTrainerText6:
text_asm
ld hl, ViridianGymTrainerHeader5
call TalkToTrainer
@@ -381,7 +382,7 @@ ViridianGymAfterBattleText6:
text_far _ViridianGymAfterBattleText6
text_end
-ViridianGymText8:
+ViridianGymTrainerText7:
text_asm
ld hl, ViridianGymTrainerHeader6
call TalkToTrainer
@@ -399,7 +400,7 @@ ViridianGymAfterBattleText7:
text_far _ViridianGymAfterBattleText7
text_end
-ViridianGymText9:
+ViridianGymTrainerText8:
text_asm
ld hl, ViridianGymTrainerHeader7
call TalkToTrainer
@@ -417,23 +418,23 @@ ViridianGymAfterBattleText8:
text_far _ViridianGymAfterBattleText8
text_end
-ViridianGymText10:
+ViridianGymGuideText:
text_asm
CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
- jr nz, .asm_1abd1
- ld hl, ViridianGymText_74bd4
+ jr nz, .afterBeat
+ ld hl, ViridianGymGuidePreBattleText
call PrintText
- jr .asm_6064d
-.asm_1abd1
- ld hl, ViridianGymText_74bd9
+ jr .done
+.afterBeat
+ ld hl, ViridianGymGuidePostBattleText
call PrintText
-.asm_6064d
+.done
jp TextScriptEnd
-ViridianGymText_74bd4:
- text_far _ViridianGymText_74bd4
+ViridianGymGuidePreBattleText:
+ text_far _ViridianGymGuidePreBattleText
text_end
-ViridianGymText_74bd9:
- text_far _ViridianGymText_74bd9
+ViridianGymGuidePostBattleText:
+ text_far _ViridianGymGuidePostBattleText
text_end
diff --git a/text/CeladonGym.asm b/text/CeladonGym.asm
index 5d354bbb..2ea0dc44 100644
--- a/text/CeladonGym.asm
+++ b/text/CeladonGym.asm
@@ -1,4 +1,4 @@
-_CeladonGymText_48a5e::
+_ErikaPreBattleText::
text "Hello. Lovely"
line "weather isn't it?"
cont "It's so pleasant."
@@ -25,7 +25,7 @@ _CeladonGymText_48a5e::
line "shall not lose."
done
-_CeladonGymText_48a63::
+_ReceivedRainbowBadgeText::
text "Oh!"
line "I concede defeat."
@@ -36,7 +36,7 @@ _CeladonGymText_48a63::
line "the RAINBOWBADGE."
prompt
-_CeladonGymText_48a68::
+_ErikaPostBattleAdviceText::
text "You are cataloging"
line "#MON? I must"
cont "say I'm impressed."
@@ -47,7 +47,7 @@ _CeladonGymText_48a68::
cont "unattractive."
done
-_CeladonGymText9::
+_ErikaRainbowBadgeInfoText::
text "The RAINBOWBADGE"
line "will make #MON"
cont "up to L50 obey."
diff --git a/text/CeruleanGym.asm b/text/CeruleanGym.asm
index 4f8d5ab2..c201984f 100644
--- a/text/CeruleanGym.asm
+++ b/text/CeruleanGym.asm
@@ -1,4 +1,4 @@
-_CeruleanGymText_5c7be::
+_MistyPreBattleText::
text "Hi, you're a new"
line "face!"
@@ -19,7 +19,7 @@ _CeruleanGymText_5c7be::
line "sweetie?"
done
-_CeruleanGymText_5c7c3::
+_TM11ExplanationText::
text "TM11 teaches"
line "BUBBLEBEAM!"
@@ -27,7 +27,7 @@ _CeruleanGymText_5c7c3::
line "aquatic #MON!"
done
-_CeruleanGymText_5c7c8::
+_MistyCascadeBadgeInfoText::
text "The CASCADEBADGE"
line "makes all #MON"
cont "up to L30 obey!"
@@ -52,12 +52,12 @@ _ReceivedTM11Text::
line "TM11!@"
text_end
-_CeruleanGymText_5c7d3::
+_TM11NoRoomText::
text "You better make"
line "room for this!"
done
-_CeruleanGymText_5c7d8::
+_ReceivedCascadeBadgeText::
text "I can't"
line "believe I lost!"
@@ -107,7 +107,7 @@ _CeruleanGymAfterBattleText2::
line "someone like you!"
done
-_CeruleanGymText_5c82a::
+_CeruleanGymGuidePreBattleText::
text "Yo! Champ in"
line "making!"
@@ -125,7 +125,7 @@ _CeruleanGymText_5c82a::
line "electricity!"
done
-_CeruleanGymText_5c82f::
+_CeruleanGymGuidePostBattleText::
text "You beat MISTY!"
line "What'd I tell ya?"
diff --git a/text/CinnabarGym.asm b/text/CinnabarGym.asm
index a59dbeaa..03855d6d 100644
--- a/text/CinnabarGym.asm
+++ b/text/CinnabarGym.asm
@@ -1,4 +1,4 @@
-_BlaineBattleText::
+_BlainePreBattleText::
text "Hah!"
para "I am BLAINE! I"
@@ -13,7 +13,7 @@ _BlaineBattleText::
line "have BURN HEAL!"
done
-_BlaineEndBattleText::
+_ReceivedVolcanoBadgeText::
text "I have"
line "burnt out!"
@@ -21,7 +21,7 @@ _BlaineEndBattleText::
line "the VOLCANOBADGE!@"
text_end
-_BlaineFireBlastText::
+_BlainePostBattleAdviceText::
text "FIRE BLAST is the"
line "ultimate fire"
cont "technique!"
@@ -30,7 +30,7 @@ _BlaineFireBlastText::
line "water #MON!"
done
-_BlaineBadgeText::
+_BlaineVolcanoBadgeInfoText::
text "Hah!"
para "The VOLCANOBADGE"
@@ -68,18 +68,18 @@ _TM38NoRoomText::
line "gift!"
done
-_CinnabarGymText_7595f::
+_CinnabarGymBattleText2::
text "Do you know how"
line "hot #MON fire"
cont "breath can get?"
done
-_CinnabarGymText_75964::
+_CinnabarGymEndBattleText2::
text "Yow!"
line "Hot, hot, hot!"
prompt
-_CinnabarGymText_75969::
+_CinnabarGymAfterBattleText2::
text "Fire, or to be"
line "more precise,"
cont "combustion..."
@@ -88,66 +88,66 @@ _CinnabarGymText_75969::
line "blah..."
done
-_CinnabarGymText_75994::
+_CinnabarGymBattleText1::
text "I was a thief, but"
line "I became straight"
cont "as a trainer!"
done
-_CinnabarGymText_75999::
+_CinnabarGymEndBattleText1::
text "I"
line "surrender!"
prompt
-_CinnabarGymText_7599e::
+_CinnabarGymAfterBattleText1::
text "I can't help"
line "stealing other"
cont "people's #MON!"
done
-_CinnabarGymText_759c9::
+_CinnabarGymBattleText3::
text "You can't win!"
line "I have studied"
cont "#MON totally!"
done
-_CinnabarGymText_759ce::
+_CinnabarGymEndBattleText3::
text "Waah!"
line "My studies!"
prompt
-_CinnabarGymText_759d3::
+_CinnabarGymAfterBattleText3::
text "My theories are"
line "too complicated"
cont "for you!"
done
-_CinnabarGymText_759fe::
+_CinnabarGymBattleText4::
text "I just like using"
line "fire #MON!"
done
-_CinnabarGymText_75a03::
+_CinnabarGymEndBattleText4::
text "Too hot"
line "to handle!"
prompt
-_CinnabarGymText_75a08::
+_CinnabarGymAfterBattleText4::
text "I wish there was"
line "a thief #MON!"
cont "I'd use that!"
done
-_CinnabarGymText_75a33::
+_CinnabarGymBattleText5::
text "I know why BLAINE"
line "became a trainer!"
done
-_CinnabarGymText_75a38::
+_CinnabarGymEndBattleText5::
text "Ow!"
prompt
-_CinnabarGymText_75a3d::
+_CinnabarGymAfterBattleText5::
text "BLAINE was lost"
line "in the mountains"
cont "when a fiery bird"
@@ -158,40 +158,40 @@ _CinnabarGymText_75a3d::
cont "his way down!"
done
-_CinnabarGymText_75a68::
+_CinnabarGymBattleText6::
text "I've been to many"
line "GYMs, but this is"
cont "my favorite!"
done
-_CinnabarGymText_75a6d::
+_CinnabarGymEndBattleText6::
text "Yowza!"
line "Too hot!"
prompt
-_CinnabarGymText_75a72::
+_CinnabarGymAfterBattleText6::
text "Us fire #MON"
line "fans like PONYTA"
cont "and NINETALES!"
done
-_CinnabarGymText_75a9d::
+_CinnabarGymBattleText7::
text "Fire is weak"
line "against H2O!"
done
-_CinnabarGymText_75aa2::
+_CinnabarGymEndBattleText7::
text "Oh!"
line "Snuffed out!"
prompt
-_CinnabarGymText_75aa7::
+_CinnabarGymAfterBattleText7::
text "Water beats fire!"
line "But, fire melts"
cont "ice #MON!"
done
-_CinnabarGymText_75ac2::
+_CinnabarGymGuidePreBattleText::
text "Yo! Champ in"
line "making!"
@@ -206,7 +206,7 @@ _CinnabarGymText_75ac2::
line "some BURN HEALs!"
done
-_CinnabarGymText_75ac7::
+_CinnabarGymGuidePostBattleText::
text "<PLAYER>! You beat"
line "that fire brand!"
done
diff --git a/text/FuchsiaGym.asm b/text/FuchsiaGym.asm
index 587af1a1..683ae423 100644
--- a/text/FuchsiaGym.asm
+++ b/text/FuchsiaGym.asm
@@ -16,7 +16,7 @@ _KogaBeforeBattleText::
cont "techniques!"
done
-_KogaAfterBattleText::
+_ReceivedSoulBadgeText::
text "Humph!"
line "You have proven"
cont "your worth!"
@@ -25,7 +25,7 @@ _KogaAfterBattleText::
line "SOULBADGE!"
prompt
-_KogaExplainToxicText::
+_KogaPostBattleAdviceText::
text "When afflicted by"
line "TOXIC, #MON"
cont "suffer more and"
@@ -36,7 +36,7 @@ _KogaExplainToxicText::
line "terrorize foes!"
done
-_FuchsiaGymText9::
+_KogaSoulBadgeInfoText::
text "Now that you have"
line "the SOULBADGE,"
cont "the DEFENSE of"
@@ -197,7 +197,7 @@ _FuchsiaGymAfterBattleText6::
cont "choose?"
done
-_FuchsiaGymText_7564e::
+_FuchsiaGymGuidePreBattleText::
text "Yo! Champ in"
line "making!"
@@ -214,7 +214,7 @@ _FuchsiaGymText_7564e::
cont "to reach him!"
done
-_FuchsiaGymText_75653::
+_FuchsiaGymGuidePostBattleText::
text "It's amazing how"
line "ninja can terrify"
cont "even now!"
diff --git a/text/PewterGym.asm b/text/PewterGym.asm
index 03626f7d..892269c1 100644
--- a/text/PewterGym.asm
+++ b/text/PewterGym.asm
@@ -1,4 +1,4 @@
-_PewterGymText_5c49e::
+_BrockPreBattleText::
text "I'm BROCK!"
line "I'm PEWTER's GYM"
cont "LEADER!"
@@ -17,7 +17,7 @@ _PewterGymText_5c49e::
cont "me your best!"
done
-_PewterGymText_5c4a3::
+_BrockPostBattleAdviceText::
text "There are all"
line "kinds of trainers"
cont "in the world!"
@@ -38,7 +38,7 @@ _PewterGymText_5c4a3::
cont "your abilities!"
done
-_TM34PreReceiveText::
+_BeforeReceivedTM34Text::
text "Wait! Take this"
line "with you!"
done
@@ -77,7 +77,7 @@ _TM34NoRoomText::
line "room for this!"
done
-_PewterGymText_5c4bc::
+_ReceivedBoulderBadgeText::
text "I took"
line "you for granted."
@@ -89,7 +89,7 @@ _PewterGymText_5c4bc::
line "the BOULDERBADGE!@"
text_end
-_PewterGymText_5c4c1::
+_BrockBoulerBadgeInfoText::
text_start
para "That's an official"
@@ -128,7 +128,7 @@ _PewterGymAfterBattleText1::
cont "as BROCK!"
done
-_PewterGymText_5c515::
+_PewterGymGuidePreAdviceText::
text "Hiya! I can tell"
line "you have what it"
cont "takes to become a"
@@ -142,12 +142,12 @@ _PewterGymText_5c515::
line "to the top!"
done
-_PewterGymText_5c51a::
+_PewterGymGuideBeginAdviceText::
text "All right! Let's"
line "get happening!"
prompt
-_PewterGymText_5c51f::
+_PewterGymGuideAdviceText::
text "The 1st #MON"
line "out in a match is"
cont "at the top of the"
@@ -165,7 +165,7 @@ _PewterGymText_5c524::
cont "get happening!"
prompt
-_PewterGymText_5c529::
+_PewterGymGuidePostBattleText::
text "Just as I thought!"
line "You're #MON"
cont "champ material!"
diff --git a/text/SaffronGym.asm b/text/SaffronGym.asm
index a42a6932..eab08aea 100644
--- a/text/SaffronGym.asm
+++ b/text/SaffronGym.asm
@@ -1,4 +1,4 @@
-_SaffronGymText_5d162::
+_SabrinaPreBattleText::
text "I had a vision of"
line "your arrival!"
@@ -16,7 +16,7 @@ _SaffronGymText_5d162::
cont "you my powers!"
done
-_SaffronGymText_5d167::
+_ReceivedMarshBadgeText::
text "I'm"
line "shocked!"
cont "But, a loss is a"
@@ -30,14 +30,14 @@ _SaffronGymText_5d167::
line "MARSHBADGE!@"
text_end
-_SaffronGymText_5d16e::
+_SabrinaPostBattleAdviceText::
text "Everyone has"
line "psychic power!"
cont "People just don't"
cont "realize it!"
done
-_SaffronGymText_5d173::
+_KogaMarshBadgeInfoText::
text "The MARSHBADGE"
line "makes #MON up"
cont "to L70 obey you!"
@@ -55,7 +55,7 @@ _SaffronGymText_5d173::
line "this TM with you!"
done
-ReceivedTM46Text::
+_ReceivedTM46Text::
text "<PLAYER> received"
line "TM46!@"
text_end
@@ -74,7 +74,7 @@ _TM46NoRoomText::
line "of other items!"
done
-_SaffronGymText_5d1e6::
+_SaffronGymGuidePreBattleText::
text "Yo! Champ in"
line "making!"
@@ -91,7 +91,7 @@ _SaffronGymText_5d1e6::
cont "even aim a punch!"
done
-_SaffronGymText_5d1eb::
+_SaffronGymGuidePostBattleText::
text "Psychic power,"
line "huh?"
diff --git a/text/VermilionGym.asm b/text/VermilionGym.asm
index de548eca..2c6a3dff 100644
--- a/text/VermilionGym.asm
+++ b/text/VermilionGym.asm
@@ -32,7 +32,7 @@ _LTSurgePostBattleAdviceText::
cont "type #MON!"
done
-_LTSurgeThunderbadgeInfoText::
+_LTSurgeThunderBadgeInfoText::
text "The THUNDERBADGE"
line "cranks up your"
cont "#MON's SPEED!"
@@ -67,7 +67,7 @@ _TM24NoRoomText::
line "in your pack!"
done
-_ReceivedThunderbadgeText::
+_ReceivedThunderBadgeText::
text "Whoa!"
para "You're the real"
@@ -135,7 +135,7 @@ _VermilionGymAfterBattleText3::
cont "next to it!"
done
-_VermilionGymFanPreBattleText::
+_VermilionGymGuidePreBattleText::
text "Yo! Champ in"
line "making!"
@@ -161,7 +161,7 @@ _VermilionGymFanPreBattleText::
cont "get to him!"
done
-_VermilionGymFanPostBattleText::
+_VermilionGymGuidePostBattleText::
text "Whew! That match"
line "was electric!"
done
diff --git a/text/ViridianGym.asm b/text/ViridianGym.asm
index 66c889df..95fe63b3 100644
--- a/text/ViridianGym.asm
+++ b/text/ViridianGym.asm
@@ -1,4 +1,4 @@
-_ViridianGymText_74ace::
+_GiovanniPreBattleText::
text "Fwahahaha! This is"
line "my hideout!"
@@ -18,7 +18,7 @@ _ViridianGymText_74ace::
cont "greatest trainer!"
done
-_ViridianGymText_74ad3::
+_ReceivedEarthBadgeText::
text "Ha!"
line "That was a truly"
cont "intense fight!"
@@ -27,7 +27,7 @@ _ViridianGymText_74ad3::
cont "the EARTHBADGE!@"
text_end
-_ViridianGymText_74ad9::
+_GiovanniPostBattleAdviceText::
text "Having lost, I"
line "cannot face my"
cont "underlings!"
@@ -43,7 +43,7 @@ _ViridianGymText_74ad9::
cont "Farewell!@"
text_end
-_ViridianGymText12::
+_GiovanniEarthBadgeInfoText::
text "The EARTHBADGE"
line "makes #MON of"
cont "any level obey!"
@@ -215,7 +215,7 @@ _ViridianGymAfterBattleText8::
cont "our GYM LEADER!"
done
-_ViridianGymText_74bd4::
+_ViridianGymGuidePreBattleText::
text "Yo! Champ in"
line "making!"
@@ -233,7 +233,7 @@ _ViridianGymText_74bd4::
cont "#MON!"
done
-_ViridianGymText_74bd9::
+_ViridianGymGuidePostBattleText::
text "Blow me away!"
line "GIOVANNI was the"
cont "GYM LEADER here?"
diff --git a/wram.asm b/wram.asm
index 93d7d40e..ceb1e956 100644
--- a/wram.asm
+++ b/wram.asm
@@ -12,14 +12,13 @@ wUnusedC000:: db
wSoundID:: db
-wMuteAudioAndPauseMusic::
; bit 7: whether sound has been muted
; all bits: whether the effective is active
; Store 1 to activate effect (any value in the range [1, 127] works).
; All audio is muted and music is paused. Sfx continues playing until it
; ends normally.
; Store 0 to resume music.
- ds 1
+wMuteAudioAndPauseMusic:: db
wDisableChannelOutputWhenSfxEnds:: db
@@ -27,109 +26,54 @@ wStereoPanning:: db
wSavedVolume:: db
-wChannelCommandPointers::
- ds 16
-
-wChannelReturnAddresses::
- ds 16
-
-wChannelSoundIDs::
- ds 8
-
-wChannelFlags1::
- ds 8
-
-wChannelFlags2::
- ds 8
+wChannelCommandPointers:: ds NUM_CHANNELS * 2
+wChannelReturnAddresses:: ds NUM_CHANNELS * 2
-wChannelDutyCycles::
- ds 8
+wChannelSoundIDs:: ds NUM_CHANNELS
-wChannelDutyCyclePatterns::
- ds 8
-
-wChannelVibratoDelayCounters::
+wChannelFlags1:: ds NUM_CHANNELS
+wChannelFlags2:: ds NUM_CHANNELS
+wChannelDutyCycles:: ds NUM_CHANNELS
+wChannelDutyCyclePatterns:: ds NUM_CHANNELS
; reloaded at the beginning of a note. counts down until the vibrato begins.
- ds 8
-
-wChannelVibratoExtents::
- ds 8
-
-wChannelVibratoRates::
+wChannelVibratoDelayCounters:: ds NUM_CHANNELS
+wChannelVibratoExtents:: ds NUM_CHANNELS
; high nybble is rate (counter reload value) and low nybble is counter.
; time between applications of vibrato.
- ds 8
-
-wChannelFrequencyLowBytes::
- ds 8
-
-wChannelVibratoDelayCounterReloadValues::
+wChannelVibratoRates:: ds NUM_CHANNELS
+wChannelFrequencyLowBytes:: ds NUM_CHANNELS
; delay of the beginning of the vibrato from the start of the note
- ds 8
-
-wChannelPitchSlideLengthModifiers::
- ds 8
-
-wChannelPitchSlideFrequencySteps::
- ds 8
-
-wChannelPitchSlideFrequencyStepsFractionalPart::
- ds 8
-
-wChannelPitchSlideCurrentFrequencyFractionalPart::
- ds 8
-
-wChannelPitchSlideCurrentFrequencyHighBytes::
- ds 8
-
-wChannelPitchSlideCurrentFrequencyLowBytes::
- ds 8
-
-wChannelPitchSlideTargetFrequencyHighBytes::
- ds 8
-
-wChannelPitchSlideTargetFrequencyLowBytes::
- ds 8
-
-wChannelNoteDelayCounters::
+wChannelVibratoDelayCounterReloadValues:: ds NUM_CHANNELS
+wChannelPitchSlideLengthModifiers:: ds NUM_CHANNELS
+wChannelPitchSlideFrequencySteps:: ds NUM_CHANNELS
+wChannelPitchSlideFrequencyStepsFractionalPart:: ds NUM_CHANNELS
+wChannelPitchSlideCurrentFrequencyFractionalPart:: ds NUM_CHANNELS
+wChannelPitchSlideCurrentFrequencyHighBytes:: ds NUM_CHANNELS
+wChannelPitchSlideCurrentFrequencyLowBytes:: ds NUM_CHANNELS
+wChannelPitchSlideTargetFrequencyHighBytes:: ds NUM_CHANNELS
+wChannelPitchSlideTargetFrequencyLowBytes:: ds NUM_CHANNELS
; Note delays are stored as 16-bit fixed-point numbers where the integer part
; is 8 bits and the fractional part is 8 bits.
- ds 8
-
-wChannelLoopCounters::
- ds 8
-
-wChannelNoteSpeeds::
- ds 8
-
-wChannelNoteDelayCountersFractionalPart::
- ds 8
-
-wChannelOctaves::
- ds 8
-
-wChannelVolumes::
+wChannelNoteDelayCounters:: ds NUM_CHANNELS
+wChannelLoopCounters:: ds NUM_CHANNELS
+wChannelNoteSpeeds:: ds NUM_CHANNELS
+wChannelNoteDelayCountersFractionalPart:: ds NUM_CHANNELS
+wChannelOctaves:: ds NUM_CHANNELS
; also includes fade for hardware channels that support it
- ds 8
+wChannelVolumes:: ds NUM_CHANNELS
wMusicWaveInstrument:: db
-
wSfxWaveInstrument:: db
-
wMusicTempo:: dw
-
wSfxTempo:: dw
-
wSfxHeaderPointer:: dw
wNewSoundID:: db
wAudioROMBank:: db
-
wAudioSavedROMBank:: db
wFrequencyModifier:: db
-
wTempoModifier:: db
wc0f3:: ds 1
@@ -141,10 +85,9 @@ SECTION "Sprite State Data", WRAM0
wSpriteDataStart::
-wSpriteStateData1::
; data for all sprites on the current map
; holds info for 16 sprites with $10 bytes each
-; player sprite is always sprite 0
+wSpriteStateData1::
; struct fields:
; - 0: picture ID (fixed, loaded at map init)
; - 1: movement status (0: uninitialized, 1: ready, 2: delayed, 3: moving)
@@ -169,10 +112,9 @@ wSprite{02d:n}StateData1:: spritestatedata1 wSprite{02d:n}StateData1
ENDR
wSpritePikachuStateData1:: spritestatedata1 wSpritePikachuStateData1 ; pikachu is struct 15
-wSpriteStateData2::
; more data for all sprites on the current map
; holds info for 16 sprites with $10 bytes each
-; player sprite is always sprite 0
+wSpriteStateData2::
; struct fields:
; - 0: walk animation counter (counting from $10 backwards when moving)
; - 1:
@@ -207,32 +149,28 @@ wSpriteDataEnd::
SECTION "OAM Buffer", WRAM0
-wOAMBuffer::
; buffer for OAM data. Copied to OAM by DMA
+wOAMBuffer::
; wOAMBufferSprite00 - wOAMBufferSprite39
FOR n, NUM_SPRITE_OAM_STRUCTS
wOAMBufferSprite{02d:n}:: sprite_oam_struct wOAMBufferSprite{02d:n}
ENDR
wOAMBufferEnd::
-wTileMap::
; buffer for tiles that are visible on screen (20 columns by 18 rows)
- ds SCREEN_WIDTH * SCREEN_HEIGHT
+wTileMap:: ds SCREEN_WIDTH * SCREEN_HEIGHT
UNION
-wTileMapBackup::
; buffer for temporarily saving and restoring current screen's tiles
; (e.g. if menus are drawn on top)
- ds SCREEN_WIDTH * SCREEN_HEIGHT
+wTileMapBackup:: ds SCREEN_WIDTH * SCREEN_HEIGHT
NEXTU
-wSerialPartyMonsPatchList::
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
- ds 200
+wSerialPartyMonsPatchList:: ds 200
-wSerialEnemyMonsPatchList::
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
- ds 200
+wSerialEnemyMonsPatchList:: ds 200
NEXTU
wAnimatedObjectsData::
@@ -329,13 +267,11 @@ ENDU
ds 80
UNION
-wOverworldMap::
- ds 1300
+wOverworldMap:: ds 1300
wOverworldMapEnd::
NEXTU
-wTempPic::
- ds 7 * 7 tiles
+wTempPic:: ds 7 * 7 tiles
NEXTU
wPrinterData::
@@ -410,144 +346,113 @@ wcbec::
ds 16
ENDU
-wRedrawRowOrColumnSrcTiles::
; the tiles of the row or column to be redrawn by RedrawRowOrColumn
- ds SCREEN_WIDTH * 2
+wRedrawRowOrColumnSrcTiles:: ds SCREEN_WIDTH * 2
; coordinates of the position of the cursor for the top menu item (id 0)
wTopMenuItemY:: db
wTopMenuItemX:: db
-wCurrentMenuItem::
; the id of the currently selected menu item
; the top item has id 0, the one below that has id 1, etc.
; note that the "top item" means the top item currently visible on the screen
; add this value to [wListScrollOffset] to get the item's position within the list
- ds 1
+wCurrentMenuItem:: db
-wTileBehindCursor::
; the tile that was behind the menu cursor's current location
- ds 1
+wTileBehindCursor:: db
-wMaxMenuItem::
; id of the bottom menu item
- ds 1
+wMaxMenuItem:: db
-wMenuWatchedKeys::
; bit mask of keys that the menu will respond to
- ds 1
+wMenuWatchedKeys:: db
-wLastMenuItem::
; id of previously selected menu item
- ds 1
+wLastMenuItem:: db
-wPartyAndBillsPCSavedMenuItem::
; It is mainly used by the party menu to remember the cursor position while the
; menu isn't active.
; It is also used to remember the cursor position of mon lists (for the
; withdraw/deposit/release actions) in Bill's PC so that it doesn't get lost
; when you choose a mon from the list and a sub-menu is shown. It's reset when
; you return to the main Bill's PC menu.
- ds 1
+wPartyAndBillsPCSavedMenuItem:: db
-wBagSavedMenuItem::
; It is used by the bag list to remember the cursor position while the menu
; isn't active.
- ds 1
+wBagSavedMenuItem:: db
-wBattleAndStartSavedMenuItem::
; It is used by the start menu to remember the cursor position while the menu
; isn't active.
; The battle menu uses it so that the cursor position doesn't get lost when
; a sub-menu is shown. It's reset at the start of each battle.
- ds 1
+wBattleAndStartSavedMenuItem:: db
wPlayerMoveListIndex:: db
-wPlayerMonNumber::
; index in party of currently battling mon
- ds 1
+wPlayerMonNumber:: db
-wMenuCursorLocation::
; the address of the menu cursor's current location within wTileMap
- ds 2
+wMenuCursorLocation:: dw
ds 2
-wMenuJoypadPollCount::
; how many times should HandleMenuInput poll the joypad state before it returns?
- ds 1
+wMenuJoypadPollCount:: db
-wMenuItemToSwap::
; id of menu item selected for swapping (counts from 1) (0 means that no menu item has been selected for swapping)
- ds 1
+wMenuItemToSwap:: db
-wListScrollOffset::
; offset of the current top menu item from the beginning of the list
; keeps track of what section of the list is on screen
- ds 1
+wListScrollOffset:: db
-wMenuWatchMovingOutOfBounds::
; If non-zero, then when wrapping is disabled and the player tries to go past
; the top or bottom of the menu, return from HandleMenuInput. This is useful for
; menus that have too many items to display at once on the screen because it
; allows the caller to scroll the entire menu up or down when this happens.
- ds 1
+wMenuWatchMovingOutOfBounds:: db
wTradeCenterPointerTableIndex:: db
ds 1
-wTextDest::
; destination pointer for text output
; this variable is written to, but is never read from
- ds 2
+wTextDest:: dw
-wDoNotWaitForButtonPressAfterDisplayingText::
; if non-zero, skip waiting for a button press after displaying text in DisplayTextID
- ds 1
+wDoNotWaitForButtonPressAfterDisplayingText:: db
-wSerialSyncAndExchangeNybbleReceiveData::
-; the final received nybble is stored here by Serial_SyncAndExchangeNybble
-
-wSerialExchangeNybbleTempReceiveData::
-; temporary nybble used by Serial_ExchangeNybble
-
-wLinkMenuSelectionReceiveBuffer::
-; two byte buffer
+UNION
; the received menu selection is stored twice
- ds 1
+wLinkMenuSelectionReceiveBuffer:: dw
+ ds 3
+; the menu selection byte is stored twice before sending
+wLinkMenuSelectionSendBuffer:: dw
+ ds 3
+wEnteringCableClub::
+wLinkTimeoutCounter:: db
-wSerialExchangeNybbleReceiveData::
+NEXTU
+; temporary nybble used by Serial_ExchangeNybble
+wSerialExchangeNybbleTempReceiveData::
+; the final received nybble is stored here by Serial_SyncAndExchangeNybble
+wSerialSyncAndExchangeNybbleReceiveData:: db
; the final received nybble is stored here by Serial_ExchangeNybble
- ds 1
-
+wSerialExchangeNybbleReceiveData:: db
ds 3
-
-wSerialExchangeNybbleSendData::
; this nybble is sent when using Serial_SyncAndExchangeNybble or Serial_ExchangeNybble
+wSerialExchangeNybbleSendData:: db
+ ds 4
+wUnknownSerialCounter:: dw
+ENDU
-wLinkMenuSelectionSendBuffer::
-; two byte buffer
-; the menu selection byte is stored twice before sending
-
- ds 5
-
-wLinkTimeoutCounter::
-; 1 byte
-
-wUnknownSerialCounter::
-; 2 bytes
-
-wEnteringCableClub::
-; 1 byte
- ds 2
-
-wWhichTradeMonSelectionMenu::
; $00 = player mons
; $01 = enemy mons
-
-wMonDataLocation::
+wWhichTradeMonSelectionMenu::
; 0 = player's party
; 1 = enemy party
; 2 = current box
@@ -557,86 +462,77 @@ wMonDataLocation::
; AddPartyMon uses it slightly differently.
; If the lower nybble is 0, the mon is added to the player's party, else the enemy's.
; If the entire value is 0, then the player is allowed to name the mon.
- ds 1
+wMonDataLocation:: db
-wMenuWrappingEnabled::
; set to 1 if you can go from the bottom to the top or top to bottom of a menu
; set to 0 if you can't go past the top or bottom of the menu
- ds 1
+wMenuWrappingEnabled:: db
-wCheckFor180DegreeTurn::
; whether to check for 180-degree turn (0 = don't, 1 = do)
- ds 1
+wCheckFor180DegreeTurn:: db
ds 1
wMissableObjectIndex:: db
wPredefID:: db
-wPredefRegisters::
- ds 6
+wPredefHL:: dw
+wPredefDE:: dw
+wPredefBC:: dw
wTrainerHeaderFlagBit:: db
ds 1
-wNPCMovementScriptPointerTableNum::
; which NPC movement script pointer is being used
; 0 if an NPC movement script is not running
- ds 1
+wNPCMovementScriptPointerTableNum:: db
-wNPCMovementScriptBank::
; ROM bank of current NPC movement script
- ds 1
+wNPCMovementScriptBank:: db
ds 2
-wUnusedCC5B::
-
-wVermilionDockTileMapBuffer::
-; 180 bytes
+UNION
+wVermilionDockTileMapBuffer:: ; ds 5 * BG_MAP_WIDTH + SCREEN_WIDTH
-wOaksAideRewardItemName::
+wOaksAideRewardItemName:: ; ds ITEM_NAME_LENGTH
-wDexRatingNumMonsSeen::
+wElevatorWarpMaps:: ; ds 11 * 2
-wFilteredBagItems::
; List of bag items that has been filtered to a certain type of items,
; such as drinks or fossils.
+wFilteredBagItems:: ; ds 3 + 1
-wElevatorWarpMaps::
-
-wMonPartySpritesSavedOAM::
; Saved copy of OAM for the first frame of the animation to make it easy to
; flip back from the second frame.
-; $60 bytes
+wMonPartySpritesSavedOAM:: ; ds $60
-wTrainerCardBlkPacket::
-; $40 bytes
+wTrainerCardBlkPacket:: ; ds $40
-wSlotMachineSevenAndBarModeChance::
+wHallOfFame:: ; ds HOF_TEAM
+
+wNPCMovementDirections:: ; ds $ff
+
+wBoostExpByExpAll::
+; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
+wAnimationType::
; If a random number greater than this value is generated, then the player is
; allowed to have three 7 symbols or bar symbols line up.
; So, this value is actually the chance of NOT entering that mode.
; If the slot is lucky, it equals 250, giving a 5/256 (~2%) chance.
; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance.
-
-wHallOfFame::
-wBoostExpByExpAll::
-wAnimationType::
-; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
-
-UNION
-wNPCMovementDirections:: db
+wSlotMachineSevenAndBarModeChance::
+wUnusedCC5B::
+wDexRatingNumMonsSeen:: db
wDexRatingNumMonsOwned:: db
-wDexRatingText::
-wTrainerCardBadgeAttributes:: db
+wTrainerCardBadgeAttributes::
+wDexRatingText:: db
-wSlotMachineSavedROMBank::
; ROM back to return to when the player is done with the slot machine
- ds 1
+wSlotMachineSavedROMBank:: db
ds 26
@@ -655,20 +551,13 @@ wPikaPicUsedGFXEnd::
ENDU
UNION
-wNPCMovementDirections2::
- ds 10
+wNPCMovementDirections2:: ds 10
+; used in Pallet Town scripted movement
+wNumStepsToTake:: db
NEXTU
-wSwitchPartyMonTempBuffer::
; temporary buffer when swapping party mon data
- ds 49
-
-NEXTU
- ds 10
-
-wNumStepsToTake::
-; used in Pallet Town scripted movement
- ds 1
+wSwitchPartyMonTempBuffer:: ds 44 ; party_struct size
NEXTU
wPikaPicAnimObjectDataBufferSize:: db
@@ -687,71 +576,64 @@ wPikaPicAnimObjectDataBuffer::
wPikaPicAnimObjectDataBufferEnd::
ENDU
- ds 10
+ ds 15
wRLEByteCount:: db
-wAddedToParty::
-; 0 = not added
-; 1 = added
-
-wSimulatedJoypadStatesEnd::
; this is the end of the joypad states
; the list starts above this address and extends downwards in memory until here
; overloaded with below labels
+wSimulatedJoypadStatesEnd::
wParentMenuItem::
-
-wCanEvolveFlags::
+; 0 = not added
+; 1 = added
+wAddedToParty::
; 1 flag for each party member indicating whether it can evolve
; The purpose of these flags is to track which mons levelled up during the
; current battle at the end of the battle when evolution occurs.
; Other methods of evolution simply set it by calling TryEvolvingMon.
- ds 1
+wCanEvolveFlags:: db
wForceEvolution:: db
; if [wAILayer2Encouragement] != 1, the second AI layer is not applied
wAILayer2Encouragement:: db
+
ds 1
; current HP of player and enemy substitutes
wPlayerSubstituteHP:: db
wEnemySubstituteHP:: db
-wTestBattlePlayerSelectedMove::
; The player's selected move during a test battle.
; InitBattleVariables sets it to the move Pound.
- ds 1
+wTestBattlePlayerSelectedMove:: db
ds 1
-wMoveMenuType::
; 0=regular, 1=mimic, 2=above message box (relearn, heal pp..)
- ds 1
+wMoveMenuType:: db
wPlayerSelectedMove:: db
wEnemySelectedMove:: db
wLinkBattleRandomNumberListIndex:: db
-wAICount::
; number of times remaining that AI action can occur
- ds 1
+wAICount:: db
ds 2
wEnemyMoveListIndex:: db
-wLastSwitchInEnemyMonHP::
; The enemy mon's HP when it was switched in or when the current player mon
; was switched in, which was more recent.
; It's used to determine the message to print when switching out the player mon.
- ds 2
+wLastSwitchInEnemyMonHP:: dw
-wTotalPayDayMoney::
; total amount of money made using Pay Day during the current battle
- ds 3
+wTotalPayDayMoney:: ds 3
wSafariEscapeFactor:: db
wSafariBaitFactor:: db
@@ -760,58 +642,60 @@ wSafariBaitFactor:: db
wTransformedEnemyMonOriginalDVs:: dw
-wMonIsDisobedient:: ds 1
+wMonIsDisobedient:: db
-wPlayerDisabledMoveNumber:: ds 1
-wEnemyDisabledMoveNumber:: ds 1
+wPlayerDisabledMoveNumber:: db
+wEnemyDisabledMoveNumber:: db
-wInHandlePlayerMonFainted::
; When running in the scope of HandlePlayerMonFainted, it equals 1.
; When running in the scope of HandleEnemyMonFainted, it equals 0.
- ds 1
+wInHandlePlayerMonFainted:: db
-wPlayerUsedMove:: ds 1
-wEnemyUsedMove:: ds 1
+wPlayerUsedMove:: db
+wEnemyUsedMove:: db
-wEnemyMonMinimized:: ds 1
+wEnemyMonMinimized:: db
-wMoveDidntMiss:: ds 1
+wMoveDidntMiss:: db
-wPartyFoughtCurrentEnemyFlags::
; flags that indicate which party members have fought the current enemy mon
- flag_array 6
+wPartyFoughtCurrentEnemyFlags:: flag_array PARTY_LENGTH
-wLowHealthAlarmDisabled::
; Whether the low health alarm has been disabled due to the player winning the
; battle.
- ds 1
+wLowHealthAlarmDisabled:: db
wPlayerMonMinimized:: db
ds 13
+UNION
wLuckySlotHiddenObjectIndex::
-
-wEnemyNumHits::
; number of hits by enemy in attacks like Double Slap, etc.
+wEnemyNumHits:: db
-wEnemyBideAccumulatedDamage::
+NEXTU
; the amount of damage accumulated by the enemy while biding (2 bytes)
+wEnemyBideAccumulatedDamage:: dw
+ENDU
- ds 10
-
-wInGameTradeGiveMonSpecies::
+ ds 8
-wPlayerMonUnmodifiedLevel:: db
+wVermilionDockTileMapBufferEnd::
-wInGameTradeTextPointerTablePointer::
+UNION
+wInGameTradeGiveMonSpecies:: db
+wInGameTradeTextPointerTablePointer:: dw
+wInGameTradeTextPointerTableIndex:: db
+wInGameTradeGiveMonName:: ds NAME_LENGTH
+wInGameTradeReceiveMonName:: ds NAME_LENGTH
+wInGameTradeMonNick:: ds NAME_LENGTH
+wInGameTradeReceiveMonSpecies:: db
+NEXTU
+wPlayerMonUnmodifiedLevel:: db
wPlayerMonUnmodifiedMaxHP:: dw
-
-wInGameTradeTextPointerTableIndex::
-
-wPlayerMonUnmodifiedAttack:: db
-wInGameTradeGiveMonName:: db
+wPlayerMonUnmodifiedAttack:: dw
wPlayerMonUnmodifiedDefense:: dw
wPlayerMonUnmodifiedSpeed:: dw
wPlayerMonUnmodifiedSpecial:: dw
@@ -819,18 +703,13 @@ wPlayerMonUnmodifiedSpecial:: dw
; stat modifiers for the player's current pokemon
; value can range from 1 - 13 ($1 to $D)
; 7 is normal
-
wPlayerMonStatMods::
wPlayerMonAttackMod:: db
wPlayerMonDefenseMod:: db
wPlayerMonSpeedMod:: db
wPlayerMonSpecialMod:: db
-
-wInGameTradeReceiveMonName::
-
wPlayerMonAccuracyMod:: db
wPlayerMonEvasionMod:: db
-
ds 2
wPlayerMonStatModsEnd::
@@ -839,21 +718,13 @@ wPlayerMonStatModsEnd::
wEnemyMonUnmodifiedLevel:: db
wEnemyMonUnmodifiedMaxHP:: dw
wEnemyMonUnmodifiedAttack:: dw
-wEnemyMonUnmodifiedDefense:: db
-
-wInGameTradeMonNick:: db
-
+wEnemyMonUnmodifiedDefense:: dw
wEnemyMonUnmodifiedSpeed:: dw
-wEnemyMonUnmodifiedSpecial:: db
-
-wEngagedTrainerClass:: db
-wEngagedTrainerSet::
-; ds 1
+wEnemyMonUnmodifiedSpecial:: dw
; stat modifiers for the enemy's current pokemon
; value can range from 1 - 13 ($1 to $D)
; 7 is normal
-
wEnemyMonStatMods::
wEnemyMonAttackMod:: db
wEnemyMonDefenseMod:: db
@@ -861,391 +732,287 @@ wEnemyMonSpeedMod:: db
wEnemyMonSpecialMod:: db
wEnemyMonAccuracyMod:: db
wEnemyMonEvasionMod:: db
-
-wInGameTradeReceiveMonSpecies:: db
-
- ds 1
+ ds 2
wEnemyMonStatModsEnd::
+NEXTU
+ ds 30
+wEngagedTrainerClass:: db
+wEngagedTrainerSet:: db
+ENDU
+
ds 1
wNPCMovementDirections2Index::
-
wUnusedCD37::
-
-wFilteredBagItemsCount::
; number of items in wFilteredBagItems list
- ds 1
+wFilteredBagItemsCount:: db
-wSimulatedJoypadStatesIndex::
; the next simulated joypad state is at wSimulatedJoypadStatesEnd plus this value minus 1
; 0 if the joypad state is not being simulated
- ds 1
+wSimulatedJoypadStatesIndex:: db
-wWastedByteCD39::
; written to but nothing ever reads it
- ds 1
+wWastedByteCD39:: db
-wWastedByteCD3A::
; written to but nothing ever reads it
- ds 1
+wWastedByteCD3A:: db
-wOverrideSimulatedJoypadStatesMask::
; mask indicating which real button presses can override simulated ones
; XXX is it ever not 0?
- ds 1
+wOverrideSimulatedJoypadStatesMask:: db
ds 1
-wFallingObjectsMovementData::
-; up to 20 bytes (one byte for each falling object)
+; one byte for each falling object
+wFallingObjectsMovementData:: ; ds 20
-wSavedY::
+; array of the number of mons in each box
+wBoxMonCounts:: ; ds NUM_BOXES
-wTempSCX::
+; BCD number
+wPriceTemp:: ; ds 3
-wBattleTransitionCircleScreenQuadrantY::
+; the current mon's field moves
+wFieldMoves:: ; ds NUM_MOVES
+
+wBoxNumString:: ; ds 3
+
+wSavedY::
+wTempSCX::
; 0 = upper half (Y < 9)
; 1 = lower half (Y >= 9)
-
-wBattleTransitionCopyTilesOffset::
+wBattleTransitionCircleScreenQuadrantY::
; 2 bytes
; after 1 row/column has been copied, the offset to the next one to copy from
-
-wInwardSpiralUpdateScreenCounter::
+wBattleTransitionCopyTilesOffset::
; counts down from 7 so that every time 7 more tiles of the spiral have been
; placed, the tile map buffer is copied to VRAM so that progress is visible
-
+wInwardSpiralUpdateScreenCounter::
wHoFTeamIndex::
-
-wSSAnneSmokeDriftAmount::
; multiplied by 16 to get the number of times to go right by 2 pixels
-
-wBoxMonCounts::
-; 12 bytes
-; array of the number of mons in each box
-
+wSSAnneSmokeDriftAmount::
wDexMaxSeenMon::
-
wPPRestoreItem::
-
wWereAnyMonsAsleep::
-
wCanPlaySlots::
-
wNumShakes::
-
-wDayCareStartLevel::
; the level of the mon at the time it entered day care
-
+wDayCareStartLevel::
wWhichBadge::
-
-wPriceTemp::
-; 3-byte BCD number
-
wTitleScreenScene::
-
wPlayerCharacterOAMTile::
-
-wMoveDownSmallStarsOAMCount::
; the number of small stars OAM entries to move down
-
+wMoveDownSmallStarsOAMCount::
wChargeMoveNum::
-
wCoordIndex::
-
wOptionsTextSpeedCursorX::
-
wOptionsCursorLocation::
-
wTrainerInfoTextBoxWidthPlus1::
-
wSwappedMenuItem::
-
wHoFMonSpecies::
-
-wFieldMoves::
-; 4 bytes
-; the current mon's field moves
-
-wBadgeNumberTile::
; tile ID of the badge number being drawn
-
-wRodResponse::
+wBadgeNumberTile::
; 0 = no bite
; 1 = bite
; 2 = no fish on map
-
+wRodResponse::
wWhichTownMapLocation::
-
-wStoppingWhichSlotMachineWheel::
; which wheel the player is trying to stop
; 0 = none, 1 = wheel 1, 2 = wheel 2, 3 or greater = wheel 3
-
+wStoppingWhichSlotMachineWheel::
wTradedPlayerMonSpecies::
-
wTradingWhichPlayerMon::
-
wChangeBoxSavedMapTextPointer::
-
wFlyAnimUsingCoordList::
-
wPlayerSpinInPlaceAnimFrameDelay::
-
wPlayerSpinWhileMovingUpOrDownAnimDeltaY::
-
-wBoxNumString::
-
wHiddenObjectFunctionArgument::
-
-wWhichTrade::
; which entry from TradeMons to select
-
+wWhichTrade::
wTrainerSpriteOffset::
+wUnusedCD3D::
+ db
-wUnusedCD3D:: db
+; $ff sentinel values at each end
+wFlyLocationsList:: ; ds NUM_CITY_MAPS + 2
wTitleScreenTimer::
-
-wHUDPokeballGfxOffsetX::
; difference in X between the next ball and the current one
-
-wBattleTransitionCircleScreenQuadrantX::
+wHUDPokeballGfxOffsetX::
; 0 = left half (X < 10)
; 1 = right half (X >= 10)
-
+wBattleTransitionCircleScreenQuadrantX::
wSSAnneSmokeX::
-
wDayCareNumLevelsGrown::
-
wOptionsBattleAnimCursorX::
-
wTrainerInfoTextBoxWidth::
-
wHoFPartyMonIndex::
-
-wNumCreditsMonsDisplayed::
; the number of credits mons that have been displayed so far
-
-wBadgeNameTile::
+wNumCreditsMonsDisplayed::
; first tile ID of the name being drawn
-
-wFlyLocationsList::
-; NUM_CITY_MAPS bytes plus $ff sentinel values at each end
-
+wBadgeNameTile::
wSlotMachineWheel1Offset::
-
wTradedEnemyMonSpecies::
-
wTradingWhichEnemyMon::
-
wFlyAnimCounter::
-
wPlayerSpinInPlaceAnimFrameDelayDelta::
-
wPlayerSpinWhileMovingUpOrDownAnimMaxY::
-
wHiddenObjectFunctionRomBank::
-
wTrainerEngageDistance::
+wJigglypuffFacingDirections2::
+ db
-wJigglypuffFacingDirections2:: db
+wHUDGraphicsTiles:: ; ds 3
-wHUDGraphicsTiles::
-; 3 bytes
+; BCD number
+wDayCareTotalCost:: ; ds 2
+
+; a list of the first tile IDs of each badge or face (depending on whether the
+; badge is owned) to be drawn on the trainer screen
+wBadgeOrFaceTiles:: ; ds NUM_BADGES
-wDayCareTotalCost::
-; 2-byte BCD number
+wNameOfPlayerMonToBeTraded:: ; ds NAME_LENGTH
wJigglypuffFacingDirections::
-
wOptionsBattleStyleCursorX::
-
wTrainerInfoTextBoxNextRowOffset::
-
wHoFMonLevel::
-
-wBadgeOrFaceTiles::
-; 8 bytes
-; a list of the first tile IDs of each badge or face (depending on whether the
-; badge is owned) to be drawn on the trainer screen
-
wSlotMachineWheel2Offset::
-
-wNameOfPlayerMonToBeTraded::
-
wFlyAnimBirdSpriteImageIndex::
-
wPlayerSpinInPlaceAnimFrameDelayEndValue::
-
wPlayerSpinWhileMovingUpOrDownAnimFrameDelay::
-
wHiddenObjectIndex::
+wTrainerFacingDirection::
+ db
-wTrainerFacingDirection:: db
-
-wHoFMonOrPlayer::
; show mon or show player?
; 0 = mon
; 1 = player
-
+wHoFMonOrPlayer::
wSlotMachineWheel3Offset::
-
wPlayerSpinInPlaceAnimSoundID::
-
wHiddenObjectY::
-
wTrainerScreenY::
+wOptionsCancelCursorX::
+ db
-wOptionsCancelCursorX:: db
+; BCD number (always set to $100)
+wDayCarePerLevelCost:: ; ds 2
-wDayCarePerLevelCost::
-; 2-byte BCD number (always set to $100)
+wTradedPlayerMonOT:: ; ds NAME_LENGTH
wHoFTeamIndex2::
-
wHiddenItemOrCoinsIndex::
-
-wTradedPlayerMonOT::
-
wHiddenObjectX::
-
-wSlotMachineWinningSymbol::
; the OAM tile number of the upper left corner of the winning symbol minus 2
-
+wSlotMachineWinningSymbol::
wNumFieldMoves::
-
wSlotMachineWheel1BottomTile::
-
-wTrainerScreenX:: db
-; a lot of the uses for these values use more than the said address
+wTrainerScreenX::
+ db
wHoFTeamNo::
-
wSlotMachineWheel1MiddleTile::
+wFieldMovesLeftmostXCoord::
+ db
-wFieldMovesLeftmostXCoord:: db
-
-wLastFieldMoveID::
-; unused
-
-wSlotMachineWheel1TopTile:: db
+wLastFieldMoveID:: ; unused
+wSlotMachineWheel1TopTile::
+ db
wSlotMachineWheel2BottomTile:: db
wSlotMachineWheel2MiddleTile:: db
-wTempCoins1::
-; 2 bytes
; temporary variable used to add payout amount to the player's coins
+wTempCoins1:: ; ds 2
wSlotMachineWheel2TopTile:: db
-wBattleTransitionSpiralDirection::
; 0 = outward, 1 = inward
-
+wBattleTransitionSpiralDirection::
wSlotMachineWheel3BottomTile:: db
-wSlotMachineWheel3MiddleTile::
-
-wFacingDirectionList::
-; 4 bytes (also, the byte before the start of the list (wSlotMachineWheel3BottomTile)
-; is used a temp variable when the list is rotated)
; used when spinning the player's sprite
- ds 1
+; also, the byte before the start of the list is
+; used as a temp variable when the list is rotated
+wFacingDirectionList:: ; ds 4
-wSlotMachineWheel3TopTile::
+wSlotMachineWheel3MiddleTile:: db
-wTempObtainedBadgesBooleans::
-; 8 bytes
; temporary list created when displaying the badges on the trainer screen
; one byte for each badge; 0 = not obtained, 1 = obtained
- ds 1
+wTempObtainedBadgesBooleans:: ; ds NUM_BADGES
-wTempCoins2::
-; 2 bytes
-; temporary variable used to subtract the bet amount from the player's coins
+wSlotMachineWheel3TopTile:: db
-wPayoutCoins::
-; 2 bytes
- ds 2
+; temporary variable used to subtract the bet amount from the player's coins
+wTempCoins2::
+wPayoutCoins:: dw
-wTradedPlayerMonOTID::
+wTradedPlayerMonOTID:: ; dw
-wSlotMachineFlags::
; These flags are set randomly and control when the wheels stop.
; bit 6: allow the player to win in general
; bit 7: allow the player to win with 7 or bar (plus the effect of bit 6)
- ds 1
+wSlotMachineFlags:: db
-wSlotMachineWheel1SlipCounter::
; wheel 1 can "slip" while this is non-zero
-
-wCutTile::
+wSlotMachineWheel1SlipCounter::
; $3d = tree tile
; $52 = grass tile
- ds 1
+wCutTile:: db
-wSlotMachineWheel2SlipCounter::
-; wheel 2 can "slip" while this is non-zero
+wTradedEnemyMonOT:: ; ds NAME_LENGTH
-wTradedEnemyMonOT:: db
+; wheel 2 can "slip" while this is non-zero
+wSlotMachineWheel2SlipCounter:: db
wSavedPlayerScreenY::
-
-wSlotMachineRerollCounter::
; The remaining number of times wheel 3 will roll down a symbol until a match is
; found, when winning is enabled. It's initialized to 4 each bet.
-
-wEmotionBubbleSpriteIndex::
+wSlotMachineRerollCounter::
; the index of the sprite the emotion bubble is to be displayed above
- ds 1
+wEmotionBubbleSpriteIndex:: db
wWhichEmotionBubble::
-
-wSlotMachineBet::
; how many coins the player bet on the slot machine (1 to 3)
-
+wSlotMachineBet::
wSavedPlayerFacingDirection::
-
-wWhichAnimationOffsets::
; 0 = cut animation, 1 = boulder dust animation
- ds 9
+wWhichAnimationOffsets:: db
+
+ ds 8
wTradedEnemyMonOTID:: dw
-wStandingOnWarpPadOrHole::
; 0 = neither
; 1 = warp pad
; 2 = hole
-
+wStandingOnWarpPadOrHole::
wOAMBaseTile::
-
wGymTrashCanIndex:: db
wSymmetricSpriteOAMAttributes:: db
wMonPartySpriteSpecies:: db
-wLeftGBMonSpecies::
; in the trade animation, the mon that leaves the left gameboy
- ds 1
+wLeftGBMonSpecies:: db
-wRightGBMonSpecies::
; in the trade animation, the mon that leaves the right gameboy
- ds 1
+wRightGBMonSpecies:: db
-wFlags_0xcd60::
; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaneously)
; bit 1: boulder dust animation (from using Strength) pending
; bit 3: using generic PC
; bit 5: don't play sound when A or B is pressed in menu
; bit 6: tried pushing against boulder once (you need to push twice before it will move)
- ds 1
+wFlags_0xcd60:: db
ds 9
-wActionResultOrTookBattleTurn::
; This has overlapping related uses.
; When the player tries to use an item or use certain field moves, 0 is stored
; when the attempt fails and 1 is stored when the attempt succeeds.
@@ -1255,269 +1022,222 @@ wActionResultOrTookBattleTurn::
; something other than a move (e.g. using an item or switching pokemon).
; So, when an item is successfully used in battle, this value becomes non-zero
; and the player is not allowed to make a move and the two uses are compatible.
- ds 1
+wActionResultOrTookBattleTurn:: db
-wJoyIgnore::
; Set buttons are ignored.
- ds 1
+wJoyIgnore:: db
-wDownscaledMonSize::
; size of downscaled mon pic used in pokeball entering/exiting animation
; $00 = 5×5
; $01 = 3×3
-
-wNumMovesMinusOne::
+wDownscaledMonSize::
; FormatMovesString stores the number of moves minus one here
- ds 1
+wNumMovesMinusOne:: db
UNION
-
wcd6d:: ds NAME_BUFFER_LENGTH ; buffer for various data
NEXTU
+wEvosMoves:: ds MAX_EVOLUTIONS * EVOLUTION_SIZE + 1
+wEvosMovesEnd::
+NEXTU
ds 4
-
-wStatusScreenCurrentPP::
; temp variable used to print a move's current PP on the status screen
- ds 1
-
+wStatusScreenCurrentPP:: db
ds 6
-
-wNormalMaxPPList::
; list of normal max PP (without PP up) values
- ds 9
-
-NEXTU
-
-wEvosMoves:: ds MAX_EVOLUTIONS * EVOLUTION_SIZE + 1
-.end::
-
+wNormalMaxPPList:: ds NUM_MOVES
+ ds 5
ENDU
-wSerialOtherGameboyRandomNumberListBlock::
; buffer for transferring the random number list generated by the other gameboy
+wSerialOtherGameboyRandomNumberListBlock:: ; ds $11
-wTileMapBackup2::
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
- ds 20 * 18
+wTileMapBackup2:: ds 20 * 18
-wNamingScreenNameLength::
+; Temporary storage area
+wBuffer:: ; ds 30
+wNamingScreenNameLength::
wEvoOldSpecies::
-
-wBuffer::
-; Temporary storage area of 30 bytes.
-
-wTownMapCoords::
; lower nybble is x, upper nybble is y
-
-wLearningMovesFromDayCare::
+wTownMapCoords::
; whether WriteMonMoves is being used to make a mon learn moves from day care
; non-zero if so
-
+wLearningMovesFromDayCare::
wChangeMonPicEnemyTurnSpecies::
+wHPBarMaxHP::
+ db
-wHPBarMaxHP:: db
-
-wNamingScreenSubmitName::
; non-zero when the player has chosen to submit the name
-
+wNamingScreenSubmitName::
wChangeMonPicPlayerTurnSpecies::
+wEvoNewSpecies::
+ db
-wEvoNewSpecies:: db
+UNION
+wHPBarOldHP:: dw
+wHPBarNewHP:: dw
+wHPBarDelta:: db
+wHPBarTempHP:: dw
+ ds 11
+wHPBarHPDifference:: db
-wAlphabetCase::
+NEXTU
; 0 = upper case
; 1 = lower case
-
+wAlphabetCase::
wEvoMonTileOffset::
-
-wHPBarOldHP:: db
+ db
wEvoCancelled:: db
-wNamingScreenLetter::
-
-wHPBarNewHP:: dw
-wHPBarDelta:: db
-
-wHPBarTempHP:: dw
-
- ds 11
+wNamingScreenLetter:: db
+ENDU
-wHPBarHPDifference:: db
ds 7
-wAIItem::
; the item that the AI used
- ds 1
+wAIItem:: db
wUsedItemOnWhichPokemon:: db
-wAnimSoundID::
; sound ID during battle animations
- ds 1
+wAnimSoundID:: db
-wBankswitchHomeSavedROMBank::
; used as a storage value for the bank to return to after a BankswitchHome (bankswitch in homebank)
- ds 1
+wBankswitchHomeSavedROMBank:: db
-wBankswitchHomeTemp::
; used as a temp storage value for the bank to switch to
- ds 1
+wBankswitchHomeTemp:: db
-wBoughtOrSoldItemInMart::
; 0 = nothing bought or sold in pokemart
; 1 = bought or sold something in pokemart
; this value is not used for anything
- ds 1
+wBoughtOrSoldItemInMart:: db
-wBattleResult::
; $00 - win
; $01 - lose
; $02 - draw
- ds 1
+wBattleResult:: db
-wAutoTextBoxDrawingControl::
; bit 0: if set, DisplayTextID automatically draws a text box
- ds 1
+wAutoTextBoxDrawingControl:: db
-wcf0d:: ds 1 ; used with some overworld scripts (not exactly sure what it's used for)
+wcf0d:: db ; used with some overworld scripts (not exactly sure what it's used for)
-wTilePlayerStandingOn::
; used in CheckForTilePairCollisions2 to store the tile the player is on
- ds 1
+wTilePlayerStandingOn:: db
-wNPCNumScriptedSteps:: ds 1
+wNPCNumScriptedSteps:: db
-wNPCMovementScriptFunctionNum::
; which script function within the pointer table indicated by
; wNPCMovementScriptPointerTableNum
- ds 1
+wNPCMovementScriptFunctionNum:: db
-wTextPredefFlag::
; bit 0: set when printing a text predef so that DisplayTextID doesn't switch
; to the current map's bank
- ds 1
+wTextPredefFlag:: db
wPredefParentBank:: db
-wSpriteIndex:: ds 1
+wSpriteIndex:: db
-wCurSpriteMovement2::
; movement byte 2 of current sprite
- ds 1
+wCurSpriteMovement2:: db
ds 2
-wNPCMovementScriptSpriteOffset::
; sprite offset of sprite being controlled by NPC movement script
- ds 1
+wNPCMovementScriptSpriteOffset:: db
wScriptedNPCWalkCounter:: db
ds 1
-wOnSGB::
; if running on SGB, it's 1, else it's 0
- ds 1
+wOnSGB:: db
wDefaultPaletteCommand:: db
-wPlayerHPBarColor::
+wPlayerHPBarColor:: ; dw
-wWholeScreenPaletteMonSpecies::
; species of the mon whose palette is used for the whole screen
- ds 1
+wWholeScreenPaletteMonSpecies:: db
wEnemyHPBarColor:: db
; 0: green
; 1: yellow
; 2: red
-wPartyMenuHPBarColors::
- ds 6
+wPartyMenuHPBarColors:: ds PARTY_LENGTH
wStatusScreenHPBarColor:: db
ds 7
wCopyingSGBTileData::
-
wWhichPartyMenuHPBar::
+wPalPacket::
+ db
-wPalPacket:: db
+wPartyMenuBlkPacket:: ; ds $30
-wPartyMenuBlkPacket::
-; $30 bytes
ds 9
-wPartyHPBarAttributes::
- ds 6
+wPartyHPBarAttributes:: ds 6
ds 14
-wExpAmountGained::
-; 2-byte big-endian number
-; the total amount of exp a mon gained
-
-wcf4b::
; storage buffer for various strings
- ds 2
+wcf4b:: ; ds 20
+
+; the total amount of exp a mon gained
+wExpAmountGained:: dw
wGainBoostedExp:: db
ds 17
-wGymCityName::
- ds 17
+wGymCityName:: ds 17
-wGymLeaderName::
- ds NAME_LENGTH
+wGymLeaderName:: ds NAME_LENGTH
-wItemList::
- ds 16
+wItemList:: ds 16
wListPointer:: dw
-wUnusedCF8D::
-; 2 bytes
; used to store pointers, but never read
- ds 2
+wUnusedCF8D:: dw
wItemPrices:: dw
-wcf91:: ds 1 ; used with a lot of things (too much to list here)
+wcf91:: db ; used with a lot of things (too much to list here)
-wWhichPokemon::
; which pokemon you selected
- ds 1
+wWhichPokemon:: db
-wPrintItemPrices::
; if non-zero, then print item prices when displaying lists
- ds 1
+wPrintItemPrices:: db
-wHPBarType::
; type of HP bar
; $00 = enemy HUD in battle
; $01 = player HUD in battle / status screen
; $02 = party menu
-
-wListMenuID::
+wHPBarType::
; ID used by DisplayListMenuID
- ds 1
+wListMenuID:: db
-wRemoveMonFromBox::
; if non-zero, RemovePokemon will remove the mon from the current box,
; else it will remove the mon from the party
-
-wMoveMonType::
+wRemoveMonFromBox::
; 0 = move from box to party
; 1 = move from party to box
; 2 = move from daycare to party
; 3 = move from party to daycare
- ds 1
+wMoveMonType:: db
wItemQuantity:: db
@@ -1526,22 +1246,18 @@ wMaxItemQuantity:: db
; LoadMonData copies mon data here
wLoadedMon:: party_struct wLoadedMon
-wFontLoaded::
; bit 0: The space in VRAM that is used to store walk animation tile patterns
; for the player and NPCs is in use for font tile patterns.
; This means that NPC movement must be disabled.
; The other bits are unused.
- ds 1
+wFontLoaded:: db
-wWalkCounter::
; walk animation counter
- ds 1
+wWalkCounter:: db
-wTileInFrontOfPlayer::
; background tile number in front of the player (either 1 or 2 steps ahead)
- ds 1
+wTileInFrontOfPlayer:: db
-wAudioFadeOutControl::
; The desired fade counter reload value is stored here prior to calling
; PlaySound in order to cause the current music to fade out before the new
; music begins playing. Storing 0 causes no fade out to occur and the new music
@@ -1551,13 +1267,12 @@ wAudioFadeOutControl::
; in this variable. FadeOutAudio checks if it's non-zero every V-Blank and
; fades out the current audio if it is. Once it has finished fading out the
; audio, it zeroes this variable and starts playing the sound ID stored in it.
- ds 1
+wAudioFadeOutControl:: db
wAudioFadeOutCounterReloadValue:: db
wAudioFadeOutCounter:: db
-wLastMusicSoundID::
; This is used to determine whether the default music is already playing when
; attempting to play the default music (in order to avoid restarting the same
; music) and whether the music has already been stopped when attempting to
@@ -1567,14 +1282,13 @@ wLastMusicSoundID::
; contain $ff (if the music has been stopped) or 0 (because some routines zero
; it in order to prevent assumptions from being made about the current state of
; the music).
- ds 1
+wLastMusicSoundID:: db
-wUpdateSpritesEnabled::
; $00 = causes sprites to be hidden and the value to change to $ff
; $01 = enabled
; $ff = disabled
; other values aren't used
- ds 1
+wUpdateSpritesEnabled:: db
wEnemyMoveNum:: db
wEnemyMoveEffect:: db
@@ -1589,7 +1303,6 @@ wPlayerMoveType:: db
wPlayerMoveAccuracy:: db
wPlayerMoveMaxPP:: db
-
wEnemyMonSpecies2:: db
wBattleMonSpecies2:: db
@@ -1631,9 +1344,9 @@ SECTION "WRAM Bank 1", WRAMX
; continuing wEnemyMon from the previous section
ds 1 ; NUM_MOVES - 3
-wEnemyMonBaseStats:: ds 5
-wEnemyMonActualCatchRate:: ds 1
-wEnemyMonBaseExp:: ds 1
+wEnemyMonBaseStats:: ds NUM_STATS
+wEnemyMonActualCatchRate:: db
+wEnemyMonBaseExp:: db
wBattleMonNick:: ds NAME_LENGTH
wBattleMon:: battle_struct wBattleMon
@@ -1644,87 +1357,76 @@ wTrainerClass:: db
ds 1
wTrainerPicPointer:: dw
+
ds 1
-wTempMoveNameBuffer::
+wTempMoveNameBuffer:: ; ds 14
-wLearnMoveMonName::
; The name of the mon that is learning a move.
+wLearnMoveMonName:: ; ds NAME_LENGTH
+
ds 16
-wTrainerBaseMoney::
-; 2-byte BCD number
+; BCD number
; money received after battle = base money × level of highest-level enemy mon
- ds 2
+wTrainerBaseMoney:: dw
wMissableObjectCounter:: db
ds 1
-wTrainerName::
; 13 bytes for the letters of the opposing trainer
; the name is terminated with $50 with possible
; unused trailing letters
- ds 13
+wTrainerName:: ds 13
-wIsInBattle::
; lost battle, this is -1
; no battle, this is 0
; wild battle, this is 1
; trainer battle, this is 2
- ds 1
+wIsInBattle:: db
-wPartyGainExpFlags::
; flags that indicate which party members should be be given exp when GainExperience is called
- flag_array 6
+wPartyGainExpFlags:: flag_array PARTY_LENGTH
-wCurOpponent::
; in a wild battle, this is the species of pokemon
; in a trainer battle, this is the trainer class + OPP_ID_OFFSET
- ds 1
+wCurOpponent:: db
-wBattleType::
; in normal battle, this is 0
; in old man battle, this is 1
; in safari battle, this is 2
- ds 1
+wBattleType:: db
-wDamageMultipliers::
; bits 0-6: Effectiveness
; $0 = immune
; $5 = not very effective
; $a = neutral
; $14 = super-effective
; bit 7: STAB
- ds 1
+wDamageMultipliers:: db
-wLoneAttackNo::
; which entry in LoneAttacks to use
-wGymLeaderNo::
; it's actually the same thing as ^
- ds 1
-wTrainerNo::
+wLoneAttackNo::
+wGymLeaderNo:: db
; which instance of [youngster, lass, etc] is this?
- ds 1
+wTrainerNo:: db
-wCriticalHitOrOHKO::
; $00 = normal attack
; $01 = critical hit
; $02 = successful OHKO
; $ff = failed OHKO
- ds 1
+wCriticalHitOrOHKO:: db
wMoveMissed:: db
-wPlayerStatsToDouble::
; always 0
- ds 1
+wPlayerStatsToDouble:: db
-wPlayerStatsToHalve::
; always 0
- ds 1
+wPlayerStatsToHalve:: db
-wPlayerBattleStatus1::
; bit 0 - bide
; bit 1 - thrash / petal dance
; bit 2 - attacking multiple times (e.g. double kick)
@@ -1733,9 +1435,8 @@ wPlayerBattleStatus1::
; bit 5 - using multi-turn move (e.g. wrap)
; bit 6 - invulnerable to normal attack (using fly/dig)
; bit 7 - confusion
- ds 1
+wPlayerBattleStatus1:: db
-wPlayerBattleStatus2::
; bit 0 - X Accuracy effect
; bit 1 - protected by "mist"
; bit 2 - focus energy effect
@@ -1743,74 +1444,65 @@ wPlayerBattleStatus2::
; bit 5 - need to recharge
; bit 6 - rage
; bit 7 - leech seeded
- ds 1
+wPlayerBattleStatus2:: db
-wPlayerBattleStatus3::
; bit 0 - toxic
; bit 1 - light screen
; bit 2 - reflect
; bit 3 - transformed
- ds 1
+wPlayerBattleStatus3:: db
-wEnemyStatsToDouble::
; always 0
- ds 1
+wEnemyStatsToDouble:: db
-wEnemyStatsToHalve::
; always 0
- ds 1
+wEnemyStatsToHalve:: db
wEnemyBattleStatus1:: db
wEnemyBattleStatus2:: db
wEnemyBattleStatus3:: db
-wPlayerNumAttacksLeft::
; when the player is attacking multiple times, the number of attacks left
- ds 1
+wPlayerNumAttacksLeft:: db
wPlayerConfusedCounter:: db
wPlayerToxicCounter:: db
-wPlayerDisabledMove::
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
- ds 1
+wPlayerDisabledMove:: db
ds 1
-wEnemyNumAttacksLeft::
; when the enemy is attacking multiple times, the number of attacks left
- ds 1
+wEnemyNumAttacksLeft:: db
wEnemyConfusedCounter:: db
wEnemyToxicCounter:: db
-wEnemyDisabledMove::
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
- ds 1
+wEnemyDisabledMove:: db
ds 1
-wPlayerNumHits::
-; number of hits by player in attacks like Double Slap, etc.
+; the amount of damage accumulated by the player while biding
+wPlayerBideAccumulatedDamage:: ; dw
-wPlayerBideAccumulatedDamage::
-; the amount of damage accumulated by the player while biding (2 bytes)
+wUnknownSerialCounter2:: ; dw
-wUnknownSerialCounter2::
-; 2 bytes
+; number of hits by player in attacks like Double Slap, etc.
+wPlayerNumHits:: db
- ds 4
+ ds 3
-wEscapedFromBattle::
; non-zero when an item or move that allows escape from battle was used
- ds 1
+wEscapedFromBattle:: db
-wAmountMoneyWon::
-; 3-byte BCD number
+; BCD number
+wAmountMoneyWon:: ; ds 3
wObjectToHide:: db
@@ -1818,27 +1510,20 @@ wObjectToShow:: db
ds 1
-wDefaultMap::
; the map you will start at when the debug bit is set
-
+wDefaultMap::
wMenuItemOffset::
-
-wAnimationID::
; ID number of the current battle animation
- ds 1
+wAnimationID:: db
wNamingScreenType::
-
wPartyMenuTypeOrMessageID::
-
-wTempTilesetNumTiles::
; temporary storage for the number of tiles in a tileset
- ds 1
+wTempTilesetNumTiles:: db
-wSavedListScrollOffset::
; used by the pokemart code to save the existing value of wListScrollOffset
; so that it can be restored when the player is done with the pokemart NPC
- ds 1
+wSavedListScrollOffset:: db
ds 2
@@ -1848,68 +1533,52 @@ wBaseCoordY:: db
; low health alarm counter/enable
; high bit = enable, others = timer to cycle frequencies
-wLowHealthAlarm:: ds 1
+wLowHealthAlarm:: db
-wFBTileCounter::
; counts how many tiles of the current frame block have been drawn
- ds 1
+wFBTileCounter:: db
wMovingBGTilesCounter2:: db
-wSubAnimFrameDelay::
; duration of each frame of the current subanimation in terms of screen refreshes
- ds 1
-wSubAnimCounter::
+wSubAnimFrameDelay:: db
; counts the number of subentries left in the current subanimation
- ds 1
+wSubAnimCounter:: db
-wSaveFileStatus::
; 1 = no save file or save file is corrupted
; 2 = save file exists and no corruption has been detected
- ds 1
+wSaveFileStatus:: db
-wNumFBTiles::
; number of tiles in current battle animation frame block
- ds 1
+wNumFBTiles:: db
wFlashScreenLongCounter::
-
wSpiralBallsBaseY::
-
-wFallingObjectMovementByte::
; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
; bit 7: direction; 0 = right, 1 = left
-
+wFallingObjectMovementByte::
wNumShootingBalls::
-
-wTradedMonMovingRight::
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
-
+wTradedMonMovingRight::
wOptionsInitialized::
-
wNewSlotMachineBallTile::
-
-wCoordAdjustmentAmount::
; how much to add to the X/Y coord
-
-wUnusedD08A:: db
+wCoordAdjustmentAmount::
+wUnusedD08A::
+ db
wSpiralBallsBaseX::
-
wNumFallingObjects::
-
wSlideMonDelay::
-
-wAnimCounter::
; generic counter variable for various animations
-
-wSubAnimTransform::
+wAnimCounter::
; controls what transformations are applied to the subanimation
; 01: flip horizontally and vertically
; 02: flip horizontally and translate downwards 40 pixels
; 03: translate base coordinates of frame blocks, but don't change their internal coordinates or flip their tiles
; 04: reverse the subanimation
- ds 1
+wSubAnimTransform::
+ db
wEndBattleWinTextPointer:: dw
@@ -1921,155 +1590,121 @@ wEndBattleTextRomBank:: db
ds 1
-wSubAnimAddrPtr::
; the address _of the address_ of the current subanimation entry
- ds 2
+wSubAnimAddrPtr:: dw
+
+; the address of the current subentry of the current subanimation
+wSubAnimSubEntryAddr:: ; dw
-wSlotMachineAllowMatchesCounter::
; If non-zero, the allow matches flag is always set.
; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is
; the only way it can increase. Winning certain payout amounts will decrement it
; or zero it.
+wSlotMachineAllowMatchesCounter:: db
-wSubAnimSubEntryAddr::
-; the address of the current subentry of the current subanimation
- ds 2
-
- ds 2
+ ds 3
wOutwardSpiralTileMapPointer:: db
wPartyMenuAnimMonEnabled::
-
-wTownMapSpriteBlinkingEnabled::
; non-zero when enabled. causes nest locations to blink on and off.
; the town selection cursor will blink regardless of what this value is
-
+wTownMapSpriteBlinkingEnabled::
wUnusedD09B:: db
-wFBDestAddr::
; current destination address in OAM for frame blocks (big endian)
- ds 2
+wFBDestAddr:: dw
-wFBMode::
; controls how the frame blocks are put together to form frames
; specifically, after finishing drawing the frame block, the frame block's mode determines what happens
; 00: clean OAM buffer and delay
; 02: move onto the next frame block with no delay and no cleaning OAM buffer
; 03: delay, but don't clean OAM buffer
; 04: delay, without cleaning OAM buffer, and do not advance [wFBDestAddr], so that the next frame block will overwrite this one
- ds 1
+wFBMode:: db
-wLinkCableAnimBulgeToggle::
; 0 = small
; 1 = big
-
+wLinkCableAnimBulgeToggle::
wIntroNidorinoBaseTile::
-
wOutwardSpiralCurrentDirection::
-
wDropletTile::
-
wNewTileBlockID::
-
wWhichBattleAnimTileset::
-
-wSquishMonCurrentDirection::
; 0 = left
; 1 = right
-
-wSlideMonUpBottomRowLeftTile::
+wSquishMonCurrentDirection::
; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_
- ds 1
+wSlideMonUpBottomRowLeftTile::
+ db
-wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank
+wDisableVBlankWYUpdate:: db ; if non-zero, don't update WY during V-blank
wSpriteCurPosX:: db
wSpriteCurPosY:: db
wSpriteWidth:: db
wSpriteHeight:: db
-wSpriteInputCurByte::
; current input byte
- ds 1
-wSpriteInputBitCounter::
+wSpriteInputCurByte:: db
; bit offset of last read input bit
- ds 1
+wSpriteInputBitCounter:: db
-wSpriteOutputBitOffset:: ; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
+; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
; 3 -> XX000000 1st column
; 2 -> 00XX0000 2nd column
; 1 -> 0000XX00 3rd column
; 0 -> 000000XX 4th column
- ds 1
+wSpriteOutputBitOffset:: db
-wSpriteLoadFlags::
; bit 0 determines used buffer (0 -> sSpriteBuffer1, 1 -> sSpriteBuffer2)
; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation)
- ds 1
+wSpriteLoadFlags:: db
wSpriteUnpackMode:: db
wSpriteFlipped:: db
-wSpriteInputPtr::
; pointer to next input byte
- ds 2
-wSpriteOutputPtr::
+wSpriteInputPtr:: dw
; pointer to current output byte
- ds 2
-wSpriteOutputPtrCached::
+wSpriteOutputPtr:: dw
; used to revert pointer for different bit offsets
- ds 2
-wSpriteDecodeTable0Ptr::
+wSpriteOutputPtrCached:: dw
; pointer to differential decoding table (assuming initial value 0)
- ds 2
-wSpriteDecodeTable1Ptr::
+wSpriteDecodeTable0Ptr:: dw
; pointer to differential decoding table (assuming initial value 1)
- ds 2
+wSpriteDecodeTable1Ptr:: dw
-wd0b5:: ds 1 ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things
+wd0b5:: db ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things
wNameListType:: db
wPredefBank:: db
wMonHeader::
-
-wMonHIndex::
; In the ROM base stats data structure, this is the dex number, but it is
; overwritten with the internal index number after the header is copied to WRAM.
- ds 1
-
+wMonHIndex:: db
wMonHBaseStats::
wMonHBaseHP:: db
wMonHBaseAttack:: db
wMonHBaseDefense:: db
wMonHBaseSpeed:: db
wMonHBaseSpecial:: db
-
wMonHTypes::
wMonHType1:: db
wMonHType2:: db
-
wMonHCatchRate:: db
wMonHBaseEXP:: db
wMonHSpriteDim:: db
wMonHFrontSprite:: dw
wMonHBackSprite:: dw
-
-wMonHMoves::
- ds NUM_MOVES
-
+wMonHMoves:: ds NUM_MOVES
wMonHGrowthRate:: db
-
-wMonHLearnset::
-; bit field
- flag_array NUM_TMS + NUM_HMS
-
+wMonHLearnset:: flag_array NUM_TMS + NUM_HMS
ds 1
wMonHeaderEnd::
-wSavedTileAnimations::
; saved at the start of a battle and then written back at the end of the battle
- ds 1
+wSavedTileAnimations:: db
ds 2
@@ -2079,66 +1714,52 @@ wDamage:: dw
wRepelRemainingSteps:: db
-wMoves::
; list of moves for FormatMovesString
- ds NUM_MOVES
+wMoves:: ds NUM_MOVES
wMoveNum:: db
-wMovesString::
- ds 56
+wMovesString:: ds 56
wUnusedD119:: db
-wWalkBikeSurfStateCopy::
; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
- ds 1
+wWalkBikeSurfStateCopy:: db
-wInitListType::
; the type of list for InitList to init
- ds 1
+wInitListType:: db
-wCapturedMonSpecies::
; 0 if no mon was captured
- ds 1
+wCapturedMonSpecies:: db
-wFirstMonsNotOutYet::
; Non-zero when the first player mon and enemy mon haven't been sent out yet.
; It prevents the game from asking if the player wants to choose another mon
; when the enemy sends out their first mon and suppresses the "no will to fight"
; message when the game searches for the first non-fainted mon in the party,
; which will be the first mon sent out.
- ds 1
+wFirstMonsNotOutYet:: db
wPokeBallCaptureCalcTemp::
-
; lower nybble: number of shakes
; upper nybble: number of animations to play
wPokeBallAnimData::
-
wUsingPPUp::
-
wMaxPP::
-
; 0 for player, non-zero for enemy
wCalculateWhoseStats::
-
wTypeEffectiveness::
-
wMoveType::
-
wNumSetBits::
+; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
+wd11e::
+ db
-wd11e:: ds 1 ; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
-
-wForcePlayerToChooseMon::
; When this value is non-zero, the player isn't allowed to exit the party menu
; by pressing B and not choosing a mon.
- ds 1
+wForcePlayerToChooseMon:: db
-wNumRunAttempts::
; number of times the player has tried to run from battle
- ds 1
+wNumRunAttempts:: db
wEvolutionOccurred:: db
@@ -2150,30 +1771,25 @@ wIsKeyItem:: db
wTextBoxID:: db
-wCurrentMapScriptFlags:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value
+wCurrentMapScriptFlags:: db ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value
wCurEnemyLVL:: db
-wItemListPointer::
; pointer to list of items terminated by $FF
- ds 2
+wItemListPointer:: dw
-wListCount::
; number of entries in a list
- ds 1
+wListCount:: db
wLinkState:: db
wTwoOptionMenuID:: db
-wChosenMenuItem::
; the id of the menu item the player ultimately chose
-
-wOutOfBattleBlackout::
+wChosenMenuItem::
; non-zero when the whole party has fainted due to out-of-battle poison damage
- ds 1
+wOutOfBattleBlackout:: db
-wMenuExitMethod::
; the way the user exited a menu
; for list menus and the buy/sell/quit menu:
; $01 = the user pressed A to choose a menu item
@@ -2181,46 +1797,36 @@ wMenuExitMethod::
; for two-option menus:
; $01 = the user pressed A with the first menu item selected
; $02 = the user pressed B or pressed A with the second menu item selected
- ds 1
+wMenuExitMethod:: db
-wDungeonWarpDataEntrySize::
; the size is always 6, so they didn't need a variable in RAM for this
-
-wWhichPewterGuy::
+wDungeonWarpDataEntrySize::
; 0 = museum guy
; 1 = gym guy
-
-wWhichPrizeWindow::
+wWhichPewterGuy::
; there are 3 windows, from 0 to 2
-
-wGymGateTileBlock::
+wWhichPrizeWindow::
; a horizontal or vertical gate block
- ds 1
+wGymGateTileBlock:: db
wSavedSpriteScreenY:: db
-
wSavedSpriteScreenX:: db
-
wSavedSpriteMapY:: db
-
wSavedSpriteMapX:: db
ds 5
wWhichPrize:: db
-wIgnoreInputCounter::
; counts downward each frame
; when it hits 0, bit 5 (ignore input bit) of wd730 is reset
- ds 1
+wIgnoreInputCounter:: db
-wStepCounter::
; counts down once every step
- ds 1
+wStepCounter:: db
-wNumberOfNoRandomBattleStepsLeft::
; after a battle, you have at least 3 steps before a random battle can occur
- ds 1
+wNumberOfNoRandomBattleStepsLeft:: db
wPrize1:: db
wPrize2:: db
@@ -2228,30 +1834,25 @@ wPrize3:: db
ds 1
-wSerialRandomNumberListBlock::
; the first 7 bytes are the preamble
+wSerialRandomNumberListBlock::
wPrize1Price:: dw
-
wPrize2Price:: dw
-
wPrize3Price:: dw
ds 1
-wLinkBattleRandomNumberList::
; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
- ds 10
+wLinkBattleRandomNumberList:: ds 10
-wSerialPlayerDataBlock::
-; the first 6 bytes are the preamble
+wSerialPlayerDataBlock:: ; ds ...
-wPseudoItemID::
; When a real item is being used, this is 0.
; When a move is acting as an item, this is the ID of the item it's acting as.
; For example, out-of-battle Dig is executed using a fake Escape Rope item. In
; that case, this would be ESCAPE_ROPE.
- ds 1
+wPseudoItemID:: db
wUnusedD153:: db
@@ -2261,13 +1862,12 @@ wEvoStoneItemID:: db
wSavedNPCMovementDirections2Index:: db
-wPlayerName::
- ds NAME_LENGTH
+wPlayerName:: ds NAME_LENGTH
wPartyDataStart::
-wPartyCount:: ds 1
+wPartyCount:: db
wPartySpecies:: ds PARTY_LENGTH + 1
wPartyMons::
@@ -2294,28 +1894,20 @@ wPartyDataEnd::
wMainDataStart::
-wPokedexOwned::
- flag_array NUM_POKEMON
+wPokedexOwned:: flag_array NUM_POKEMON
wPokedexOwnedEnd::
-wPokedexSeen::
- flag_array NUM_POKEMON
+wPokedexSeen:: flag_array NUM_POKEMON
wPokedexSeenEnd::
-
wNumBagItems:: db
-wBagItems::
; item, quantity
- ds BAG_ITEM_CAPACITY * 2
- ds 1 ; end
+wBagItems:: ds BAG_ITEM_CAPACITY * 2 + 1
-wPlayerMoney::
- ds 3 ; BCD
+wPlayerMoney:: ds 3 ; BCD
-wRivalName::
- ds NAME_LENGTH
+wRivalName:: ds NAME_LENGTH
-wOptions::
; bit 7 = battle animation
; 0: On
; 1: Off
@@ -2326,47 +1918,38 @@ wOptions::
; 1: Fast
; 3: Medium
; 5: Slow
- ds 1
+wOptions:: db
-wObtainedBadges::
- flag_array 8
+wObtainedBadges:: flag_array NUM_BADGES
ds 1
-wLetterPrintingDelayFlags::
; bit 0: If 0, limit the delay to 1 frame. Note that this has no effect if
; the delay has been disabled entirely through bit 1 of this variable
; or bit 6 of wd730.
; bit 1: If 0, no delay.
- ds 1
+wLetterPrintingDelayFlags:: db
wPlayerID:: dw
wMapMusicSoundID:: db
-
wMapMusicROMBank:: db
-wMapPalOffset::
; offset subtracted from FadePal4 to get the background and object palettes for the current map
; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4
- ds 1
+wMapPalOffset:: db
wCurMap:: db
-wCurrentTileBlockMapViewPointer::
; pointer to the upper left corner of the current view in the tile block map
- ds 2
+wCurrentTileBlockMapViewPointer:: dw
-wYCoord::
; player's position on the current map
- ds 1
-
+wYCoord:: db
wXCoord:: db
-wYBlockCoord::
-; player's y position (by block)
- ds 1
-
+; player's position (by block)
+wYBlockCoord:: db
wXBlockCoord:: db
wLastMap:: db
@@ -2375,115 +1958,40 @@ wUnusedD366:: db
wCurMapTileset:: db
-wCurMapHeight::
; blocks
- ds 1
-
-wCurMapWidth::
-; blocks
- ds 1
+wCurMapHeight:: db
+wCurMapWidth:: db
wMapDataPtr:: dw
-
wMapTextPtr:: dw
-
wMapScriptPtr:: dw
-wMapConnections::
-; connection byte
- ds 1
-
-wMapConn1Ptr:: db
-
-wNorthConnectionStripSrc:: dw
-
-wNorthConnectionStripDest:: dw
-
-wNorthConnectionStripWidth:: db
-
-wNorthConnectedMapWidth:: db
-
-wNorthConnectedMapYAlignment:: db
-
-wNorthConnectedMapXAlignment:: db
-
-wNorthConnectedMapViewPointer:: dw
-
-wMapConn2Ptr:: db
-
-wSouthConnectionStripSrc:: dw
-
-wSouthConnectionStripDest:: dw
-
-wSouthConnectionStripWidth:: db
-
-wSouthConnectedMapWidth:: db
-
-wSouthConnectedMapYAlignment:: db
-
-wSouthConnectedMapXAlignment:: db
-
-wSouthConnectedMapViewPointer:: dw
-
-wMapConn3Ptr:: db
-
-wWestConnectionStripSrc:: dw
-
-wWestConnectionStripDest:: dw
-
-wWestConnectionStripHeight:: db
-
-wWestConnectedMapWidth:: db
+wMapConnections:: db
+wNorthConnectionHeader:: map_connection_struct wNorth
+wSouthConnectionHeader:: map_connection_struct wSouth
+wWestConnectionHeader:: map_connection_struct wWest
+wEastConnectionHeader:: map_connection_struct wEast
-wWestConnectedMapYAlignment:: db
-
-wWestConnectedMapXAlignment:: db
-
-wWestConnectedMapViewPointer:: dw
-
-wMapConn4Ptr:: db
-
-wEastConnectionStripSrc:: dw
-
-wEastConnectionStripDest:: dw
-
-wEastConnectionStripHeight:: db
-
-wEastConnectedMapWidth:: db
-
-wEastConnectedMapYAlignment:: db
-
-wEastConnectedMapXAlignment:: db
-
-wEastConnectedMapViewPointer:: dw
-
-wSpriteSet::
; sprite set for the current map (11 sprite picture ID's)
- ds 11
-
-wSpriteSetID::
+wSpriteSet:: ds 11
; sprite set ID for the current map
- ds 1
+wSpriteSetID:: db
wObjectDataPointerTemp:: dw
ds 2
-wMapBackgroundTile::
; the tile shown outside the boundaries of the map
- ds 1
+wMapBackgroundTile:: db
-wNumberOfWarps::
-; number of warps in current map
- ds 1
+; number of warps in current map (up to 32)
+wNumberOfWarps:: db
-wWarpEntries::
; current map warp entries
- ds 128
+wWarpEntries:: ds 32 * 4 ; Y, X, warp ID, map ID
-wDestinationWarpID::
; if $ff, the player's coordinates are not updated when entering the map
- ds 1
+wDestinationWarpID:: db
wPikachuOverworldStateFlags:: ds 1
wPikachuSpawnState:: ds 1
@@ -2574,122 +2082,96 @@ wd49c:: ds 1
ds 19
-wNumSigns::
; number of signs in the current map (up to 16)
- ds 1
+wNumSigns:: db
-wSignCoords::
-; 2 bytes each
-; Y, X
- ds 32
+wSignCoords:: ds 16 * 2 ; Y, X
+wSignTextIDs:: ds 16
-wSignTextIDs::
- ds 16
-
-wNumSprites::
-; number of sprites on the current map
- ds 1
+; number of sprites on the current map (up to 16)
+wNumSprites:: db
; these two variables track the X and Y offset in blocks from the last special warp used
; they don't seem to be used for anything
wYOffsetSinceLastSpecialWarp:: db
wXOffsetSinceLastSpecialWarp:: db
-wMapSpriteData::
-; two bytes per sprite (movement byte 2, text ID)
- ds 32
+wMapSpriteData:: ds 16 * 2 ; movement byte 2, text ID
+wMapSpriteExtraData:: ds 16 * 2 ; trainer class/item ID, trainer set ID
-wMapSpriteExtraData::
-; two bytes per sprite (trainer class/item ID, trainer set ID)
- ds 32
-
-wCurrentMapHeight2::
; map height in 2x2 meta-tiles
- ds 1
+wCurrentMapHeight2:: db
-wCurrentMapWidth2::
; map width in 2x2 meta-tiles
- ds 1
+wCurrentMapWidth2:: db
-wMapViewVRAMPointer::
; the address of the upper left corner of the visible portion of the BG tile map in VRAM
- ds 2
+wMapViewVRAMPointer:: dw
; In the comments for the player direction variables below, "moving" refers to
; both walking and changing facing direction without taking a step.
-wPlayerMovingDirection::
; if the player is moving, the current direction
; if the player is not moving, zero
; map scripts write to this in order to change the player's facing direction
- ds 1
+wPlayerMovingDirection:: db
-wPlayerLastStopDirection::
; the direction in which the player was moving before the player last stopped
- ds 1
+wPlayerLastStopDirection:: db
-wPlayerDirection::
; if the player is moving, the current direction
; if the player is not moving, the last the direction in which the player moved
- ds 1
+wPlayerDirection:: db
wTilesetBank:: db
-wTilesetBlocksPtr::
; maps blocks (4x4 tiles) to tiles
- ds 2
+wTilesetBlocksPtr:: dw
wTilesetGfxPtr:: dw
-wTilesetCollisionPtr::
; list of all walkable tiles
- ds 2
+wTilesetCollisionPtr:: dw
-wTilesetTalkingOverTiles::
- ds 3
+wTilesetTalkingOverTiles:: ds 3
wGrassTile:: db
ds 4
wNumBoxItems:: db
-wBoxItems::
; item, quantity
- ds PC_ITEM_CAPACITY * 2
- ds 1 ; end
+wBoxItems:: ds PC_ITEM_CAPACITY * 2 + 1
-wCurrentBoxNum::
; bits 0-6: box number
; bit 7: whether the player has changed boxes before
- ds 2
+wCurrentBoxNum:: dw
-wNumHoFTeams::
; number of HOF teams
- ds 1
+wNumHoFTeams:: db
wUnusedD5A3:: db
-wPlayerCoins::
- ds 2 ; BCD
+wPlayerCoins:: ds 2 ; BCD
-wMissableObjectFlags::
; bit array of missable objects. set = removed
- ds 32
+wMissableObjectFlags:: flag_array $100
wMissableObjectFlagsEnd::
ds 7
-wd5cd:: ds 1 ; temp copy of SPRITESTATEDATA1_IMAGEINDEX (used for sprite facing/anim)
+; temp copy of SPRITESTATEDATA1_IMAGEINDEX (used for sprite facing/anim)
+wd5cd:: db
-wMissableObjectList::
; each entry consists of 2 bytes
; * the sprite ID (depending on the current map)
; * the missable object index (global, used for wMissableObjectFlags)
; terminated with $FF
- ds 17 * 2
+wMissableObjectList:: ds 16 * 2 + 1
+
+ ds 1
wGameProgressFlags::
-; $c8 bytes
wOaksLabCurScript:: db
wPalletTownCurScript:: db
ds 1
@@ -2808,39 +2290,31 @@ wGameProgressFlagsEnd::
ds 56
-wObtainedHiddenItemsFlags::
- ds 14
+wObtainedHiddenItemsFlags:: flag_array 112
-wObtainedHiddenCoinsFlags:: dw
+wObtainedHiddenCoinsFlags:: flag_array 16
-wWalkBikeSurfState::
; $00 = walking
; $01 = biking
; $02 = surfing
- ds 1
+wWalkBikeSurfState:: db
ds 10
-wTownVisitedFlag::
- flag_array NUM_CITY_MAPS
+wTownVisitedFlag:: flag_array NUM_CITY_MAPS
-wSafariSteps::
; starts at 502
- ds 2
+wSafariSteps:: dw
-wFossilItem::
; item given to cinnabar lab
- ds 1
-
-wFossilMon::
+wFossilItem:: db
; mon that will result from the item
- ds 1
+wFossilMon:: db
ds 2
-wEnemyMonOrTrainerClass::
; trainer classes start at OPP_ID_OFFSET
- ds 1
+wEnemyMonOrTrainerClass:: db
wPlayerJumpingYScreenCoordsIndex:: db
@@ -2854,36 +2328,30 @@ ENDC
wPlayerStarter:: db
-wBoulderSpriteIndex::
; sprite index of the boulder the player is trying to push
- ds 1
+wBoulderSpriteIndex:: db
wLastBlackoutMap:: db
-wDestinationMap::
; destination map (for certain types of special warps, not ordinary walking)
- ds 1
+wDestinationMap:: db
wUnusedD71B:: db
-wTileInFrontOfBoulderAndBoulderCollisionResult::
; used to store the tile in front of the boulder when trying to push a boulder
; also used to store the result of the collision check ($ff for a collision and $00 for no collision)
- ds 1
+wTileInFrontOfBoulderAndBoulderCollisionResult:: db
-wDungeonWarpDestinationMap::
; destination map for dungeon warps
- ds 1
+wDungeonWarpDestinationMap:: db
-wWhichDungeonWarp::
; which dungeon warp within the source map was used
- ds 1
+wWhichDungeonWarp:: db
wUnusedD71F:: db
ds 8
-wd728::
; bit 0: using Strength outside of battle
; bit 1: set by IsSurfingAllowed when surfing's allowed, but the caller resets it after checking the result
; bit 3: received Old Rod
@@ -2891,23 +2359,20 @@ wd728::
; bit 5: received Super Rod
; bit 6: gave one of the Saffron guards a drink
; bit 7: set by ItemUseCardKey, which is leftover code from a previous implementation of the Card Key
- ds 1
+wd728:: db
ds 1
-wBeatGymFlags::
; redundant because it matches wObtainedBadges
; used to determine whether to show name on statue and in two NPC text scripts
- ds 1
+wBeatGymFlags:: db
ds 1
-wd72c::
; bit 0: if not set, the 3 minimum steps between random battles have passed
; bit 1: prevent audio fade out
- ds 1
+wd72c:: db
-wd72d::
; This variable is used for temporary flags and as the destination map when
; warping to the Trade Center or Colosseum.
; bit 0: sprite facing directions have been initialised in the Trade Center
@@ -2918,9 +2383,8 @@ wd72d::
; but they do not appear to affect anything. Bit 6 is reset after all battles
; and bit 7 is reset after trainer battles (but it's only set before trainer
; battles anyway).
- ds 1
+wd72d:: db
-wd72e::
; bit 0: the player has received Lapras in the Silph Co. building
; bit 1: set in various places, but doesn't appear to have an effect
; bit 2: the player has healed pokemon at a pokemon center at least once
@@ -2929,20 +2393,18 @@ wd72e::
; bit 5: set when a battle ends and when the player blacks out in the overworld due to poison
; bit 6: using the link feature
; bit 7: set if scripted NPC movement has been initialised
- ds 1
+wd72e:: db
ds 1
-wd730::
; bit 0: NPC sprite being moved by script
; bit 5: ignore joypad input
; bit 6: print text with no delay between each letter
; bit 7: set if joypad states are being simulated in the overworld or an NPC's movement is being scripted
- ds 1
+wd730:: db
ds 1
-wd732::
; bit 0: play time being counted
; bit 1: remnant of debug mode; only set by the debug build.
; if it is set:
@@ -2960,78 +2422,67 @@ wd732::
; bit 4: jumped into hole (Pokemon Mansion, Seafoam Islands, Victory Road) or went down waterfall (Seafoam Islands), so the target warp is a "dungeon warp"
; bit 5: currently being forced to ride bike (cycling road)
; bit 6: map destination is [wLastBlackoutMap] (usually the last used pokemon center, but could be the player's house)
- ds 1
+wd732:: db
-wFlags_D733::
; bit 0: running a test battle
; bit 1: prevent music from changing when entering new map
; bit 2: skip the joypad check in CheckWarpsNoCollision (used for the forced warp down the waterfall in the Seafoam Islands)
; bit 3: trainer wants to battle
; bit 4: use variable [wCurMapScript] instead of the provided index for next frame's map script (used to start battle when talking to trainers)
; bit 7: used fly out of battle
- ds 1
+wFlags_D733:: db
-wBeatLorelei::
; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby
; the game uses this to tell when Elite 4 events need to be reset
- ds 1
+wBeatLorelei:: db
ds 1
-wd736::
; bit 0: check if the player is standing on a door and make him walk down a step if so
; bit 1: the player is currently stepping down from a door
; bit 2: standing on a warp
; bit 6: jumping down a ledge / fishing animation
; bit 7: player sprite spinning due to spin tiles (Rocket hideout / Viridian Gym)
- ds 1
+wd736:: db
wCompletedInGameTradeFlags:: dw
ds 2
wWarpedFromWhichWarp:: db
-
wWarpedFromWhichMap:: db
ds 2
wCardKeyDoorY:: db
-
wCardKeyDoorX:: db
ds 2
wFirstLockTrashCanIndex:: db
-
wSecondLockTrashCanIndex:: db
ds 2
-wEventFlags::
- flag_array NUM_EVENTS
+wEventFlags:: flag_array NUM_EVENTS
UNION
wGrassRate:: db
-wGrassMons::
- ds 10 * 2
+wGrassMons:: ds 10 * 2
ds 8
wWaterRate:: db
-wWaterMons::
- ds 10 * 2
+wWaterMons:: ds 10 * 2
NEXTU
-wLinkEnemyTrainerName::
; linked game's trainer name
- ds NAME_LENGTH
+wLinkEnemyTrainerName:: ds NAME_LENGTH
ds 1
-wSerialEnemyDataBlock::
-; ds $1a8
+wSerialEnemyDataBlock:: ; ds $1a8
ds 9
@@ -3063,16 +2514,14 @@ wTrainerHeaderPtr:: dw
ds 6
-wOpponentAfterWrongAnswer::
; the trainer the player must face after getting a wrong answer in the Cinnabar
; gym quiz
-
+wOpponentAfterWrongAnswer::
wUnusedDA38:: db
-wCurMapScript::
; index of current map script, mostly used as index for function pointer array
; mostly copied from map-specific map script pointer and written back later
- ds 1
+wCurMapScript:: db
ds 7
@@ -3087,10 +2536,9 @@ wSafariZoneGameOver:: db
wNumSafariBalls:: db
-wDayCareInUse::
; 0 if no pokemon is in the daycare
; 1 if pokemon is in the daycare
- ds 1
+wDayCareInUse:: db
wDayCareMonName:: ds NAME_LENGTH
wDayCareMonOT:: ds NAME_LENGTH
@@ -3102,11 +2550,10 @@ wMainDataEnd::
wBoxDataStart::
-wBoxCount:: ds 1
+wBoxCount:: db
wBoxSpecies:: ds MONS_PER_BOX + 1
wBoxMons::
-
; wBoxMon1 - wBoxMon20
FOR n, 1, MONS_PER_BOX + 1
wBoxMon{d:n}:: box_struct wBoxMon{d:n}