summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--battle/core.asm4
-rw-r--r--constants/landmark_constants.asm192
-rw-r--r--constants/map_setup_constants.asm7
-rw-r--r--constants/music_constants.asm208
-rw-r--r--engine/color.asm106
-rw-r--r--engine/events.asm8
-rwxr-xr-xengine/link.asm28
-rw-r--r--engine/map_objects.asm19
-rw-r--r--engine/map_setup.asm2
-rwxr-xr-xengine/money.asm42
-rwxr-xr-xengine/move_mon.asm4
-rwxr-xr-xengine/options_menu.asm4
-rwxr-xr-xengine/overworld.asm2
-rw-r--r--engine/party_menu.asm8
-rw-r--r--engine/pokedex.asm6
-rwxr-xr-xengine/pokegear.asm48
-rw-r--r--engine/save.asm8
-rw-r--r--engine/scripting.asm17
-rwxr-xr-xengine/slot_machine.asm4
-rw-r--r--engine/spawn_points.asm2
-rwxr-xr-xengine/startmenu.asm2
-rwxr-xr-xengine/time.asm2
-rwxr-xr-xengine/town_map.asm14
-rwxr-xr-xengine/warp_connection.asm6
-rwxr-xr-xengine/wildmons.asm8
-rw-r--r--home/map.asm131
-rw-r--r--home/menu.asm17
-rw-r--r--macros/event.asm2
-rw-r--r--macros/map.asm4
-rwxr-xr-xmacros/wram.asm212
-rw-r--r--main.asm30
-rw-r--r--maps/AzaleaTown.asm8
-rw-r--r--maps/BattleTower1F.asm4
-rw-r--r--maps/BattleTowerElevator.asm4
-rw-r--r--maps/BattleTowerHallway.asm4
-rw-r--r--maps/BattleTowerOutside.asm4
-rw-r--r--maps/BlackthornCity.asm4
-rw-r--r--maps/BlackthornGym1F.asm2
-rw-r--r--maps/BlackthornGym2F.asm4
-rw-r--r--maps/BrunosRoom.asm20
-rw-r--r--maps/BurnedTower1F.asm8
-rw-r--r--maps/BurnedTowerB1F.asm2
-rw-r--r--maps/CeladonCity.asm2
-rw-r--r--maps/CeladonDeptStore6F.asm2
-rw-r--r--maps/CeruleanCity.asm2
-rw-r--r--maps/CherrygroveCity.asm6
-rw-r--r--maps/CianwoodCity.asm6
-rw-r--r--maps/CinnabarIsland.asm2
-rw-r--r--maps/Colosseum.asm10
-rw-r--r--maps/CopycatsHouse2F.asm2
-rw-r--r--maps/DayCare.asm2
-rw-r--r--maps/DragonShrine.asm4
-rw-r--r--maps/DragonsDenB1F.asm6
-rw-r--r--maps/EcruteakCity.asm2
-rw-r--r--maps/EcruteakHouse.asm6
-rw-r--r--maps/ElmsLab.asm14
-rw-r--r--maps/FastShip1F.asm6
-rw-r--r--maps/FuchsiaCity.asm2
-rw-r--r--maps/GoldenrodCity.asm4
-rw-r--r--maps/GoldenrodDeptStore5F.asm2
-rw-r--r--maps/GoldenrodDeptStoreB1F.asm4
-rw-r--r--maps/GoldenrodDeptStoreRoof.asm4
-rw-r--r--maps/GoldenrodGameCorner.asm2
-rw-r--r--maps/GoldenrodMagnetTrainStation.asm2
-rw-r--r--maps/HallOfFame.asm4
-rw-r--r--maps/IcePathB1F.asm4
-rw-r--r--maps/IlexForest.asm2
-rw-r--r--maps/IndigoPlateauPokeCenter1F.asm2
-rw-r--r--maps/KarensRoom.asm2
-rw-r--r--maps/KogasRoom.asm2
-rw-r--r--maps/KrissHouse2F.asm4
-rw-r--r--maps/KurtsHouse.asm2
-rw-r--r--maps/LakeofRage.asm8
-rw-r--r--maps/LancesRoom.asm2
-rw-r--r--maps/LavenderTown.asm2
-rw-r--r--maps/MahoganyMart1F.asm2
-rw-r--r--maps/MahoganyTown.asm6
-rw-r--r--maps/MobileBattleRoom.asm4
-rw-r--r--maps/MobileTradeRoomMobile.asm4
-rw-r--r--maps/MountMoon.asm4
-rw-r--r--maps/MountMoonSquare.asm4
-rw-r--r--maps/MrPokemonsHouse.asm132
-rw-r--r--maps/NewBarkTown.asm6
-rw-r--r--maps/OlivineCity.asm6
-rw-r--r--maps/PalletTown.asm2
-rw-r--r--maps/PewterCity.asm2
-rw-r--r--maps/PokeCenter2F.asm12
-rw-r--r--maps/RadioTower3F.asm2
-rw-r--r--maps/RadioTower5F.asm6
-rw-r--r--maps/Route16.asm2
-rw-r--r--maps/Route17.asm2
-rw-r--r--maps/Route19.asm2
-rw-r--r--maps/Route20.asm2
-rw-r--r--maps/Route23.asm2
-rw-r--r--maps/Route29.asm6
-rw-r--r--maps/Route31.asm2
-rw-r--r--maps/Route32.asm8
-rw-r--r--maps/Route34.asm2
-rw-r--r--maps/Route34IlexForestGate.asm2
-rw-r--r--maps/Route35NationalParkgate.asm4
-rw-r--r--maps/Route36.asm2
-rw-r--r--maps/Route36NationalParkgate.asm10
-rw-r--r--maps/Route37.asm2
-rw-r--r--maps/Route40.asm2
-rw-r--r--maps/Route40BattleTowerGate.asm2
-rw-r--r--maps/Route43.asm2
-rw-r--r--maps/Route43Gate.asm2
-rw-r--r--maps/RuinsofAlphAerodactylChamber.asm2
-rw-r--r--maps/RuinsofAlphHoOhChamber.asm2
-rw-r--r--maps/RuinsofAlphKabutoChamber.asm2
-rw-r--r--maps/RuinsofAlphOmanyteChamber.asm2
-rw-r--r--maps/RuinsofAlphOutside.asm2
-rw-r--r--maps/RuinsofAlphResearchCenter.asm2
-rw-r--r--maps/SaffronCity.asm2
-rw-r--r--maps/SaffronTrainStation.asm2
-rw-r--r--maps/SilverCaveOutside.asm2
-rw-r--r--maps/TeamRocketBaseB1F.asm4
-rw-r--r--maps/TeamRocketBaseB2F.asm2
-rw-r--r--maps/TeamRocketBaseB3F.asm10
-rw-r--r--maps/TimeCapsule.asm6
-rw-r--r--maps/TinTower1F.asm4
-rw-r--r--maps/TinTowerRoof.asm2
-rw-r--r--maps/TradeCenter.asm6
-rw-r--r--maps/UndergroundPathSwitchRoomEntrances.asm6
-rw-r--r--maps/UndergroundWarehouse.asm2
-rw-r--r--maps/UnionCaveB2F.asm2
-rw-r--r--maps/VermilionCity.asm2
-rw-r--r--maps/VermilionPort.asm6
-rw-r--r--maps/VioletCity.asm2
-rw-r--r--maps/ViridianCity.asm2
-rw-r--r--maps/ViridianGym.asm21
-rw-r--r--maps/WarehouseEntrance.asm6
-rw-r--r--maps/WhirlIslandLugiaChamber.asm2
-rw-r--r--maps/WillsRoom.asm2
-rw-r--r--maps/WiseTriosRoom.asm2
-rw-r--r--misc/gbc_only.asm4
-rw-r--r--misc/mobile_40.asm32
-rwxr-xr-xmisc/mobile_46.asm2
-rw-r--r--misc/mobile_5f.asm2
-rwxr-xr-xtrainers/read_party.asm2
-rw-r--r--wram.asm274
141 files changed, 1013 insertions, 995 deletions
diff --git a/battle/core.asm b/battle/core.asm
index d8c38d2c1..9a464023b 100644
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -9167,11 +9167,11 @@ GetRoamMonSpecies: ; 3fa31
Function3fa42: ; 3fa42
- ld hl, wd276
+ ld hl, OTPlayerID
ld de, StringBuffer1
ld bc, 2
call CopyBytes
- ld hl, wd26b
+ ld hl, OTPlayerName
ld bc, 10
call CopyBytes
ld hl, s1_b254
diff --git a/constants/landmark_constants.asm b/constants/landmark_constants.asm
index 592e966ad..5aa14f972 100644
--- a/constants/landmark_constants.asm
+++ b/constants/landmark_constants.asm
@@ -1,102 +1,102 @@
const_def
- const SPECIAL_MAP
- const NEW_BARK_TOWN
- const ROUTE_29
- const CHERRYGROVE_CITY
- const ROUTE_30
- const ROUTE_31
- const VIOLET_CITY
- const SPROUT_TOWER
- const ROUTE_32
- const RUINS_OF_ALPH
- const UNION_CAVE
- const ROUTE_33
- const AZALEA_TOWN
- const SLOWPOKE_WELL
- const ILEX_FOREST
- const ROUTE_34
- const GOLDENROD_CITY
- const RADIO_TOWER
- const ROUTE_35
- const NATIONAL_PARK
- const ROUTE_36
- const ROUTE_37
- const ECRUTEAK_CITY
- const TIN_TOWER
- const BURNED_TOWER
- const ROUTE_38
- const ROUTE_39
- const OLIVINE_CITY
- const LIGHTHOUSE
- const BATTLE_TOWER
- const ROUTE_40
- const WHIRL_ISLANDS
- const ROUTE_41
- const CIANWOOD_CITY
- const ROUTE_42
- const MT_MORTAR
- const MAHOGANY_TOWN
- const ROUTE_43
- const LAKE_OF_RAGE
- const ROUTE_44
- const ICE_PATH
- const BLACKTHORN_CITY
- const DRAGONS_DEN
- const ROUTE_45
- const DARK_CAVE
- const ROUTE_46
- const SILVER_CAVE
+ const SPECIAL_MAP ; 00
+ const NEW_BARK_TOWN ; 01
+ const ROUTE_29 ; 02
+ const CHERRYGROVE_CITY ; 03
+ const ROUTE_30 ; 04
+ const ROUTE_31 ; 05
+ const VIOLET_CITY ; 06
+ const SPROUT_TOWER ; 07
+ const ROUTE_32 ; 08
+ const RUINS_OF_ALPH ; 09
+ const UNION_CAVE ; 0a
+ const ROUTE_33 ; 0b
+ const AZALEA_TOWN ; 0c
+ const SLOWPOKE_WELL ; 0d
+ const ILEX_FOREST ; 0e
+ const ROUTE_34 ; 0f
+ const GOLDENROD_CITY ; 10
+ const RADIO_TOWER ; 11
+ const ROUTE_35 ; 12
+ const NATIONAL_PARK ; 13
+ const ROUTE_36 ; 14
+ const ROUTE_37 ; 15
+ const ECRUTEAK_CITY ; 16
+ const TIN_TOWER ; 17
+ const BURNED_TOWER ; 18
+ const ROUTE_38 ; 19
+ const ROUTE_39 ; 1a
+ const OLIVINE_CITY ; 1b
+ const LIGHTHOUSE ; 1c
+ const BATTLE_TOWER ; 1d
+ const ROUTE_40 ; 1e
+ const WHIRL_ISLANDS ; 1f
+ const ROUTE_41 ; 20
+ const CIANWOOD_CITY ; 21
+ const ROUTE_42 ; 22
+ const MT_MORTAR ; 23
+ const MAHOGANY_TOWN ; 24
+ const ROUTE_43 ; 25
+ const LAKE_OF_RAGE ; 26
+ const ROUTE_44 ; 27
+ const ICE_PATH ; 28
+ const BLACKTHORN_CITY ; 29
+ const DRAGONS_DEN ; 2a
+ const ROUTE_45 ; 2b
+ const DARK_CAVE ; 2c
+ const ROUTE_46 ; 2d
+ const SILVER_CAVE ; 2e
KANTO_LANDMARK EQU const_value
- const PALLET_TOWN
- const ROUTE_1
- const VIRIDIAN_CITY
- const ROUTE_2
- const PEWTER_CITY
- const ROUTE_3
- const MT_MOON
- const ROUTE_4
- const CERULEAN_CITY
- const ROUTE_24
- const ROUTE_25
- const ROUTE_5
- const UNDERGROUND
- const ROUTE_6
- const VERMILION_CITY
- const DIGLETTS_CAVE
- const ROUTE_7
- const ROUTE_8
- const ROUTE_9
- const ROCK_TUNNEL
- const ROUTE_10
- const POWER_PLANT
- const LAVENDER_TOWN
- const LAV_RADIO_TOWER
- const CELADON_CITY
- const SAFFRON_CITY
- const ROUTE_11
- const ROUTE_12
- const ROUTE_13
- const ROUTE_14
- const ROUTE_15
- const ROUTE_16
- const ROUTE_17
- const ROUTE_18
- const FUCHSIA_CITY
- const ROUTE_19
- const ROUTE_20
- const SEAFOAM_ISLANDS
- const CINNABAR_ISLAND
- const ROUTE_21
- const ROUTE_22
- const VICTORY_ROAD
- const ROUTE_23
- const INDIGO_PLATEAU
- const ROUTE_26
- const ROUTE_27
- const TOHJO_FALLS
- const ROUTE_28
- const FAST_SHIP
+ const PALLET_TOWN ; 2f
+ const ROUTE_1 ; 30
+ const VIRIDIAN_CITY ; 31
+ const ROUTE_2 ; 32
+ const PEWTER_CITY ; 33
+ const ROUTE_3 ; 34
+ const MT_MOON ; 35
+ const ROUTE_4 ; 36
+ const CERULEAN_CITY ; 37
+ const ROUTE_24 ; 38
+ const ROUTE_25 ; 39
+ const ROUTE_5 ; 3a
+ const UNDERGROUND ; 3b
+ const ROUTE_6 ; 3c
+ const VERMILION_CITY ; 3d
+ const DIGLETTS_CAVE ; 3e
+ const ROUTE_7 ; 3f
+ const ROUTE_8 ; 40
+ const ROUTE_9 ; 41
+ const ROCK_TUNNEL ; 42
+ const ROUTE_10 ; 43
+ const POWER_PLANT ; 44
+ const LAVENDER_TOWN ; 45
+ const LAV_RADIO_TOWER ; 46
+ const CELADON_CITY ; 47
+ const SAFFRON_CITY ; 48
+ const ROUTE_11 ; 49
+ const ROUTE_12 ; 4a
+ const ROUTE_13 ; 4b
+ const ROUTE_14 ; 4c
+ const ROUTE_15 ; 4d
+ const ROUTE_16 ; 4e
+ const ROUTE_17 ; 4f
+ const ROUTE_18 ; 50
+ const FUCHSIA_CITY ; 51
+ const ROUTE_19 ; 52
+ const ROUTE_20 ; 53
+ const SEAFOAM_ISLANDS ; 54
+ const CINNABAR_ISLAND ; 55
+ const ROUTE_21 ; 56
+ const ROUTE_22 ; 57
+ const VICTORY_ROAD ; 58
+ const ROUTE_23 ; 59
+ const INDIGO_PLATEAU ; 5a
+ const ROUTE_26 ; 5b
+ const ROUTE_27 ; 5c
+ const TOHJO_FALLS ; 5d
+ const ROUTE_28 ; 5e
+ const FAST_SHIP ; 5f
diff --git a/constants/map_setup_constants.asm b/constants/map_setup_constants.asm
index f739830f0..0ee137ead 100644
--- a/constants/map_setup_constants.asm
+++ b/constants/map_setup_constants.asm
@@ -12,6 +12,13 @@ const_value SET $f1
const MAPSETUP_BADWARP
const MAPSETUP_FLY
+const_value SET 1
+ const MAPCALLBACK_TILES
+ const MAPCALLBACK_OBJECTS
+ const MAPCALLBACK_CMDQUEUE
+ const MAPCALLBACK_SPRITES
+ const MAPCALLBACK_NEWMAP
+
; Command descriptions from Condensation water's scripting compendium. const_def
const_def
diff --git a/constants/music_constants.asm b/constants/music_constants.asm
index ebf10ec5a..5c54c3dc0 100644
--- a/constants/music_constants.asm
+++ b/constants/music_constants.asm
@@ -1,107 +1,107 @@
const_def
- const MUSIC_NONE
- const MUSIC_TITLE
- const MUSIC_ROUTE_1
- const MUSIC_ROUTE_3
- const MUSIC_ROUTE_12
- const MUSIC_MAGNET_TRAIN
- const MUSIC_KANTO_GYM_LEADER_BATTLE
- const MUSIC_KANTO_TRAINER_BATTLE
- const MUSIC_KANTO_WILD_BATTLE
- const MUSIC_POKEMON_CENTER
- const MUSIC_HIKER_ENCOUNTER
- const MUSIC_LASS_ENCOUNTER
- const MUSIC_OFFICER_ENCOUNTER
- const MUSIC_HEAL
- const MUSIC_LAVENDER_TOWN
- const MUSIC_ROUTE_2
- const MUSIC_MT_MOON
- const MUSIC_SHOW_ME_AROUND
- const MUSIC_GAME_CORNER
- const MUSIC_BICYCLE
- const MUSIC_HALL_OF_FAME
- const MUSIC_VIRIDIAN_CITY
- const MUSIC_CELADON_CITY
- const MUSIC_TRAINER_VICTORY
- const MUSIC_WILD_VICTORY
- const MUSIC_GYM_VICTORY
- const MUSIC_MT_MOON_SQUARE
- const MUSIC_GYM
- const MUSIC_PALLET_TOWN
- const MUSIC_POKEMON_TALK
- const MUSIC_PROF_OAK
- const MUSIC_RIVAL_ENCOUNTER
- const MUSIC_RIVAL_AFTER
- const MUSIC_SURF
- const MUSIC_EVOLUTION
- const MUSIC_NATIONAL_PARK
- const MUSIC_CREDITS
- const MUSIC_AZALEA_TOWN
- const MUSIC_CHERRYGROVE_CITY
- const MUSIC_KIMONO_ENCOUNTER
- const MUSIC_UNION_CAVE
- const MUSIC_JOHTO_WILD_BATTLE
- const MUSIC_JOHTO_TRAINER_BATTLE
- const MUSIC_ROUTE_30
- const MUSIC_ECRUTEAK_CITY
- const MUSIC_VIOLET_CITY
- const MUSIC_JOHTO_GYM_LEADER_BATTLE
- const MUSIC_CHAMPION_BATTLE
- const MUSIC_RIVAL_BATTLE
- const MUSIC_ROCKET_BATTLE
- const MUSIC_PROF_ELM
- const MUSIC_DARK_CAVE
- const MUSIC_ROUTE_29
- const MUSIC_ROUTE_36
- const MUSIC_SS_AQUA
- const MUSIC_YOUNGSTER_ENCOUNTER
- const MUSIC_BEAUTY_ENCOUNTER
- const MUSIC_ROCKET_ENCOUNTER
- const MUSIC_POKEMANIAC_ENCOUNTER
- const MUSIC_SAGE_ENCOUNTER
- const MUSIC_NEW_BARK_TOWN
- const MUSIC_GOLDENROD_CITY
- const MUSIC_VERMILION_CITY
- const MUSIC_POKEMON_CHANNEL
- const MUSIC_POKE_FLUTE_CHANNEL
- const MUSIC_TIN_TOWER
- const MUSIC_SPROUT_TOWER
- const MUSIC_BURNED_TOWER
- const MUSIC_LIGHTHOUSE
- const MUSIC_LAKE_OF_RAGE
- const MUSIC_INDIGO_PLATEAU
- const MUSIC_ROUTE_37
- const MUSIC_ROCKET_HIDEOUT
- const MUSIC_DRAGONS_DEN
- const MUSIC_JOHTO_WILD_BATTLE_NIGHT
- const MUSIC_RUINS_OF_ALPH_RADIO
- const MUSIC_CAPTURE
- const MUSIC_ROUTE_26
- const MUSIC_MOM
- const MUSIC_VICTORY_ROAD
- const MUSIC_POKEMON_LULLABY
- const MUSIC_POKEMON_MARCH
- const MUSIC_GS_OPENING
- const MUSIC_GS_OPENING_2
- const MUSIC_MAIN_MENU
- const MUSIC_RUINS_OF_ALPH_INTERIOR
- const MUSIC_ROCKET_OVERTURE
- const MUSIC_DANCING_HALL
- const MUSIC_BUG_CATCHING_CONTEST_RANKING
- const MUSIC_BUG_CATCHING_CONTEST
- const MUSIC_LAKE_OF_RAGE_ROCKET_RADIO
- const MUSIC_PRINTER
- const MUSIC_POST_CREDITS
- const MUSIC_CLAIR
- const MUSIC_MOBILE_ADAPTER_MENU
- const MUSIC_MOBILE_ADAPTER
- const MUSIC_BUENAS_PASSWORD
- const MUSIC_MYSTICALMAN_ENCOUNTER
- const MUSIC_CRYSTAL_OPENING
- const MUSIC_BATTLE_TOWER_THEME
- const MUSIC_SUICUNE_BATTLE
- const MUSIC_BATTLE_TOWER_LOBBY
- const MUSIC_MOBILE_CENTER
+ const MUSIC_NONE ; 00
+ const MUSIC_TITLE ; 01
+ const MUSIC_ROUTE_1 ; 02
+ const MUSIC_ROUTE_3 ; 03
+ const MUSIC_ROUTE_12 ; 04
+ const MUSIC_MAGNET_TRAIN ; 05
+ const MUSIC_KANTO_GYM_LEADER_BATTLE ; 06
+ const MUSIC_KANTO_TRAINER_BATTLE ; 07
+ const MUSIC_KANTO_WILD_BATTLE ; 08
+ const MUSIC_POKEMON_CENTER ; 09
+ const MUSIC_HIKER_ENCOUNTER ; 0a
+ const MUSIC_LASS_ENCOUNTER ; 0b
+ const MUSIC_OFFICER_ENCOUNTER ; 0c
+ const MUSIC_HEAL ; 0d
+ const MUSIC_LAVENDER_TOWN ; 0e
+ const MUSIC_ROUTE_2 ; 0f
+ const MUSIC_MT_MOON ; 10
+ const MUSIC_SHOW_ME_AROUND ; 11
+ const MUSIC_GAME_CORNER ; 12
+ const MUSIC_BICYCLE ; 13
+ const MUSIC_HALL_OF_FAME ; 14
+ const MUSIC_VIRIDIAN_CITY ; 15
+ const MUSIC_CELADON_CITY ; 16
+ const MUSIC_TRAINER_VICTORY ; 17
+ const MUSIC_WILD_VICTORY ; 18
+ const MUSIC_GYM_VICTORY ; 19
+ const MUSIC_MT_MOON_SQUARE ; 1a
+ const MUSIC_GYM ; 1b
+ const MUSIC_PALLET_TOWN ; 1c
+ const MUSIC_POKEMON_TALK ; 1d
+ const MUSIC_PROF_OAK ; 1e
+ const MUSIC_RIVAL_ENCOUNTER ; 1f
+ const MUSIC_RIVAL_AFTER ; 20
+ const MUSIC_SURF ; 21
+ const MUSIC_EVOLUTION ; 22
+ const MUSIC_NATIONAL_PARK ; 23
+ const MUSIC_CREDITS ; 24
+ const MUSIC_AZALEA_TOWN ; 25
+ const MUSIC_CHERRYGROVE_CITY ; 26
+ const MUSIC_KIMONO_ENCOUNTER ; 27
+ const MUSIC_UNION_CAVE ; 28
+ const MUSIC_JOHTO_WILD_BATTLE ; 29
+ const MUSIC_JOHTO_TRAINER_BATTLE ; 2a
+ const MUSIC_ROUTE_30 ; 2b
+ const MUSIC_ECRUTEAK_CITY ; 2c
+ const MUSIC_VIOLET_CITY ; 2d
+ const MUSIC_JOHTO_GYM_LEADER_BATTLE ; 2e
+ const MUSIC_CHAMPION_BATTLE ; 2f
+ const MUSIC_RIVAL_BATTLE ; 30
+ const MUSIC_ROCKET_BATTLE ; 31
+ const MUSIC_PROF_ELM ; 32
+ const MUSIC_DARK_CAVE ; 33
+ const MUSIC_ROUTE_29 ; 34
+ const MUSIC_ROUTE_36 ; 35
+ const MUSIC_SS_AQUA ; 36
+ const MUSIC_YOUNGSTER_ENCOUNTER ; 37
+ const MUSIC_BEAUTY_ENCOUNTER ; 38
+ const MUSIC_ROCKET_ENCOUNTER ; 39
+ const MUSIC_POKEMANIAC_ENCOUNTER ; 3a
+ const MUSIC_SAGE_ENCOUNTER ; 3b
+ const MUSIC_NEW_BARK_TOWN ; 3c
+ const MUSIC_GOLDENROD_CITY ; 3d
+ const MUSIC_VERMILION_CITY ; 3e
+ const MUSIC_POKEMON_CHANNEL ; 3f
+ const MUSIC_POKE_FLUTE_CHANNEL ; 40
+ const MUSIC_TIN_TOWER ; 41
+ const MUSIC_SPROUT_TOWER ; 42
+ const MUSIC_BURNED_TOWER ; 43
+ const MUSIC_LIGHTHOUSE ; 44
+ const MUSIC_LAKE_OF_RAGE ; 45
+ const MUSIC_INDIGO_PLATEAU ; 46
+ const MUSIC_ROUTE_37 ; 47
+ const MUSIC_ROCKET_HIDEOUT ; 48
+ const MUSIC_DRAGONS_DEN ; 49
+ const MUSIC_JOHTO_WILD_BATTLE_NIGHT ; 4a
+ const MUSIC_RUINS_OF_ALPH_RADIO ; 4b
+ const MUSIC_CAPTURE ; 4c
+ const MUSIC_ROUTE_26 ; 4d
+ const MUSIC_MOM ; 4e
+ const MUSIC_VICTORY_ROAD ; 4f
+ const MUSIC_POKEMON_LULLABY ; 50
+ const MUSIC_POKEMON_MARCH ; 51
+ const MUSIC_GS_OPENING ; 52
+ const MUSIC_GS_OPENING_2 ; 53
+ const MUSIC_MAIN_MENU ; 54
+ const MUSIC_RUINS_OF_ALPH_INTERIOR ; 55
+ const MUSIC_ROCKET_OVERTURE ; 56
+ const MUSIC_DANCING_HALL ; 57
+ const MUSIC_BUG_CATCHING_CONTEST_RANKING ; 58
+ const MUSIC_BUG_CATCHING_CONTEST ; 59
+ const MUSIC_LAKE_OF_RAGE_ROCKET_RADIO ; 5a
+ const MUSIC_PRINTER ; 5b
+ const MUSIC_POST_CREDITS ; 5c
+ const MUSIC_CLAIR ; 5d
+ const MUSIC_MOBILE_ADAPTER_MENU ; 5e
+ const MUSIC_MOBILE_ADAPTER ; 5f
+ const MUSIC_BUENAS_PASSWORD ; 60
+ const MUSIC_MYSTICALMAN_ENCOUNTER ; 61
+ const MUSIC_CRYSTAL_OPENING ; 62
+ const MUSIC_BATTLE_TOWER_THEME ; 63
+ const MUSIC_SUICUNE_BATTLE ; 64
+ const MUSIC_BATTLE_TOWER_LOBBY ; 65
+ const MUSIC_MOBILE_CENTER ; 66
-MUSIC_MAHOGANY_MART EQU 100 ; leftover from gold
+MUSIC_MAHOGANY_MART EQU $64 ; leftover from gold
diff --git a/engine/color.asm b/engine/color.asm
index 9ff761ffa..57f616955 100644
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -109,7 +109,7 @@ Function8aa4: ; 8aa4
; 8ad1
-Function8ad1: ; 8ad1
+InitPartyMenuPalettes: ; 8ad1
ld hl, PalPacket_9c56 + 1
call CopyFourPalettes
call InitPartyMenuOBPals
@@ -145,16 +145,17 @@ SGB_ApplyPartyMenuHPPals: ; 8ade SGB layout $fc
; 8b07
Function8b07: ; 8b07
+; Unreferenced
call CheckCGB
ret z
- ld hl, Palette8b2f
+ ld hl, .BGPal
ld de, UnknBGPals
ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
- ld hl, Palette8b37
- ld de, MartPointer
+ ld hl, .OBPal
+ ld de, UnknOBPals
ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
@@ -163,17 +164,14 @@ Function8b07: ; 8b07
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 8b2f
-Palette8b2f: ; 8b2f
+.BGPal
RGB 31, 31, 31
RGB 18, 23, 31
RGB 15, 20, 31
RGB 00, 00, 00
-; 8b37
-
-Palette8b37: ; 8b37
+.OBPal
RGB 31, 31, 31
RGB 31, 31, 12
RGB 08, 16, 28
@@ -182,6 +180,7 @@ Palette8b37: ; 8b37
; 8b3f
Function8b3f: ; 8b3f
+; Unreferenced
call CheckCGB
ret nz
ld a, [hSGB]
@@ -193,14 +192,14 @@ Function8b3f: ; 8b3f
Function8b4d: ; 8b4d
call CheckCGB
- jr nz, .asm_8b5c
+ jr nz, .cgb
ld a, [hSGB]
and a
ret z
ld hl, PalPacket_9c26
jp Function9809
-.asm_8b5c
+.cgb
ld de, UnknOBPals
ld a, $3b
call GetPredefPal
@@ -209,14 +208,14 @@ Function8b4d: ; 8b4d
Function8b67: ; 8b67
call CheckCGB
- jr nz, .asm_8b76
+ jr nz, .cgb
ld a, [hSGB]
and a
ret z
ld hl, PalPacket_9c36
jp Function9809
-.asm_8b76
+.cgb
ld de, UnknOBPals
ld a, $3c
call GetPredefPal
@@ -934,13 +933,13 @@ Function9809: ; 9809
push af
set 7, a
ld [wcfbe], a
- call Function981a
+ call PushSGBPals
pop af
ld [wcfbe], a
ret
; 981a
-Function981a: ; 981a
+PushSGBPals: ; 981a
ld a, [hl]
and $7
ret z
@@ -1004,7 +1003,7 @@ Function9853: ; 9853
call SGBDelayCycles
call Function993f
ld hl, PalPacket_9d66
- call Function981a
+ call PushSGBPals
.asm_988a
pop af
@@ -1020,50 +1019,49 @@ Function9890:: ; 9890
ld a, $1
ld [rVBK], a
ld hl, VTiles0
- ld bc, $2000
+ ld bc, $200 tiles
xor a
call ByteFill
ld a, $0
ld [rVBK], a
ld a, $80
ld [rBGPI], a
- ld c, $20
-.asm_98ac
- ld a, $ff
+ ld c, 4 * 8
+.bgpals_loop
+ ld a, $7fff % $100
ld [rBGPD], a
- ld a, $7f
+ ld a, $7fff / $100
ld [rBGPD], a
dec c
- jr nz, .asm_98ac
+ jr nz, .bgpals_loop
ld a, $80
ld [rOBPI], a
- ld c, $20
-.asm_98bd
- ld a, $ff
+ ld c, 4 * 8
+.obpals_loop
+ ld a, $7fff % $100
ld [rOBPD], a
- ld a, $7f
+ ld a, $7fff / $100
ld [rOBPD], a
dec c
- jr nz, .asm_98bd
+ jr nz, .obpals_loop
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, UnknBGPals
- call Function98df
+ call .LoadWhitePals
ld hl, BGPals
- call Function98df
+ call .LoadWhitePals
pop af
ld [rSVBK], a
ret
-; 98df
-Function98df: ; 98df
- ld c, $40
+.LoadWhitePals
+ ld c, 4 * 16
.loop
- ld a, $ff
+ ld a, $7fff % $100
ld [hli], a
- ld a, $7f
+ ld a, $7fff / $100
ld [hli], a
dec c
jr nz, .loop
@@ -1071,24 +1069,24 @@ Function98df: ; 98df
; 98eb
Function98eb: ; 98eb
- ld hl, Unknown_98ff
- ld c, $9
-.asm_98f0
+ ld hl, .PalPacketPointerTable
+ ld c, 9
+.loop
push bc
ld a, [hli]
push hl
ld h, [hl]
ld l, a
- call Function981a
+ call PushSGBPals
pop hl
inc hl
pop bc
dec c
- jr nz, .asm_98f0
+ jr nz, .loop
ret
; 98ff
-Unknown_98ff: ; 98ff
+.PalPacketPointerTable: ; 98ff
dw PalPacket_9d56
dw PalPacket_9d76
dw PalPacket_9d86
@@ -1105,18 +1103,18 @@ Function9911: ; 9911
xor a
ld [rJOYP], a
ld hl, PalPacket_9d56
- call Function981a
+ call PushSGBPals
call Function992c
call SGBDelayCycles
call Function993f
ld hl, PalPacket_9d66
- call Function981a
+ call PushSGBPals
ei
ret
; 992c
Function992c: ; 992c
- call Function9938
+ call .LoadSGBBorderPointers
push de
call Function9a24
pop hl
@@ -1124,7 +1122,7 @@ Function992c: ; 992c
ret
; 9938
-Function9938: ; 9938
+.LoadSGBBorderPointers: ; 9938
ld hl, SGBBorder
ld de, SGBBorderMap
ret
@@ -1140,7 +1138,7 @@ Function993f: ; 993f
Function994a: ; 994a
ld hl, PalPacket_9d26
- call Function981a
+ call PushSGBPals
call SGBDelayCycles
ld a, [rJOYP]
and $3
@@ -1186,7 +1184,7 @@ endr
Function99ab: ; 99ab
ld hl, PalPacket_9d16
- call Function981a
+ call PushSGBPals
jp SGBDelayCycles
; 99b4
@@ -1202,7 +1200,7 @@ Function99b4: ; 99b4
ld a, $e3
ld [rLCDC], a
ld hl, PalPacket_9d06
- call Function981a
+ call PushSGBPals
xor a
ld [rBGP], a
ret
@@ -1215,7 +1213,7 @@ Function99d8: ; 99d8
ld de, VTiles1
ld bc, 20 tiles
call CopyData
- ld b, $12
+ ld b, 18
.asm_99ea
push bc
ld bc, $c
@@ -1237,7 +1235,7 @@ Function99d8: ; 99d8
ld a, $e3
ld [rLCDC], a
ld hl, PalPacket_9d46
- call Function981a
+ call PushSGBPals
xor a
ld [rBGP], a
ret
@@ -1245,15 +1243,15 @@ Function99d8: ; 99d8
Function9a24: ; 9a24
call DisableLCD
- ld a, $e4
+ ld a, %11100100
ld [rBGP], a
ld de, VTiles1
ld b, $80
.asm_9a30
push bc
- ld bc, 2 palettes
+ ld bc, 1 tiles
call CopyData
- ld bc, 2 palettes
+ ld bc, 1 tiles
call ClearBytes
pop bc
dec b
@@ -1262,7 +1260,7 @@ Function9a24: ; 9a24
ld a, $e3
ld [rLCDC], a
ld hl, PalPacket_9d36
- call Function981a
+ call PushSGBPals
xor a
ld [rBGP], a
ret
@@ -1295,7 +1293,7 @@ ClearBytes: ; 0x9a5b
DrawDefaultTiles: ; 0x9a64
; Draw 240 tiles (2/3 of the screen) from tiles in VRAM
hlbgcoord 0, 0 ; BG Map 0
- ld de, 32 - 20
+ ld de, BG_MAP_WIDTH - SCREEN_WIDTH
ld a, $80 ; starting tile
ld c, 12 + 1
.line
diff --git a/engine/events.asm b/engine/events.asm
index 0d708cdde..9b4062aea 100644
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -227,7 +227,7 @@ HandleMapTimeAndJoypad: ; 967c1
; 967d1
Function967d1: ; 967d1
- callba Function576a ; engine/map_objects.asm
+ callba HandleNPCStep ; engine/map_objects.asm
callba _HandlePlayerStep
call _CheckObjectEnteringVisibleRange
ret
@@ -350,7 +350,7 @@ CheckTileEvent: ; 96874
call CheckCoordEventScriptFlag
jr z, .coord_events_disabled
- call CheckCurrentNextMapXYTriggers
+ call CheckCurrentMapXYTriggers
jr c, .coord_event
.coord_events_disabled
@@ -391,7 +391,7 @@ CheckTileEvent: ; 96874
ret
.coord_event
- ld hl, EngineBuffer5
+ ld hl, wCurCoordEventScriptAddr
ld a, [hli]
ld h, [hl]
ld l, a
@@ -502,7 +502,7 @@ CheckTimeEvents: ; 9693a
.do_daily
callba CheckDailyResetTimer
- callba CheckPokerusTrick
+ callba CheckPokerusTick
callba CheckPhoneCall
ret c
diff --git a/engine/link.asm b/engine/link.asm
index c7fd9dae3..a4d23762b 100755
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -184,7 +184,7 @@ Gen2ToGen2LinkComms: ; 28177
call Function29dba
ld a, [ScriptVar]
and a
- jp z, Function283b2
+ jp z, LinkTimeout
ld a, [hLinkPlayerNumber]
cp $2
jr nz, .Player1
@@ -397,11 +397,11 @@ Gen2ToGen2LinkComms: ; 28177
ld de, OTPartyCount
ld bc, 8
call CopyBytes
- ld de, wd276
+ ld de, OTPlayerID
ld bc, 2
call CopyBytes
- ld de, OTPartyMon1Species
- ld bc, $1a4
+ ld de, OTPartyMons
+ ld bc, OTPartyDataEnd - OTPartyMons
call CopyBytes
ld a, OTPartyMonOT % $100
ld [wd102], a
@@ -419,7 +419,7 @@ Gen2ToGen2LinkComms: ; 28177
ld a, CAL
ld [OtherTrainerClass], a
call ClearScreen
- callba Function4d354
+ callba Link_WaitBGMap
ld hl, Options
ld a, [hl]
push af
@@ -468,9 +468,9 @@ Gen2ToGen2LinkComms: ; 28177
jp InitTradeMenuDisplay
; 283b2
-Function283b2: ; 283b2
+LinkTimeout: ; 283b2
ld de, .TooMuchTimeHasElapsed
- ld b, $a
+ ld b, 10
.loop
call DelayFrame
call LinkDataReceived
@@ -1379,7 +1379,7 @@ Function28926: ; 28926
hlcoord 2, 16
ld de, .String_Stats_Trade
call PlaceString
- callba Function4d354
+ callba Link_WaitBGMap
.joy_loop
ld a, " "
@@ -1485,7 +1485,7 @@ Function28926: ; 28926
ld b, 4
ld c, 18
call Predef_LinkTextbox
- callba Function4d354
+ callba Link_WaitBGMap
ld hl, .Text_CantTradeLastMon
bccoord 1, 14
call PlaceWholeStringInBoxAtOnce
@@ -1507,7 +1507,7 @@ Function28926: ; 28926
ld b, 4
ld c, 18
call Predef_LinkTextbox
- callba Function4d354
+ callba Link_WaitBGMap
ld hl, .Text_Abnormal
bccoord 1, 14
call PlaceWholeStringInBoxAtOnce
@@ -1663,7 +1663,7 @@ LinkTrade: ; 28b87
ld b, $4
ld c, $12
call Predef_LinkTextbox
- callba Function4d354
+ callba Link_WaitBGMap
ld a, [wd002]
ld hl, PartySpecies
ld c, a
@@ -1713,7 +1713,7 @@ LinkTrade: ; 28b87
ld a, 1
ld [wMenuCursorY], a
ld [wMenuCursorX], a
- callba Function4d354
+ callba Link_WaitBGMap
call ScrollingMenuJoypad
push af
call Call_ExitMenu
@@ -1935,7 +1935,7 @@ LinkTrade: ; 28b87
call ClearScreen
call LoadTradeScreenBorder
call Function28eff
- callba Function4d354
+ callba Link_WaitBGMap
ld b, $1
pop af
ld c, a
@@ -1982,7 +1982,7 @@ LinkTrade: ; 28b87
hlcoord 1, 14
ld de, String28ebd
call PlaceString
- callba Function4d354
+ callba Link_WaitBGMap
ld c, 50
call DelayFrames
ld a, [wLinkMode]
diff --git a/engine/map_objects.asm b/engine/map_objects.asm
index ce83ba9f2..a0ae8bcf2 100644
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -2470,9 +2470,9 @@ Function56cd: ; 56cd
ret
; 576a
-Function576a:: ; 576a
+HandleNPCStep:: ; 576a
call .ResetStepVector
- call Function5781
+ call .DoStepsForAllObjects
ret
.ResetStepVector
@@ -2483,9 +2483,8 @@ Function576a:: ; 576a
ld a, -1
ld [wPlayerStepDirection], a
ret
-; 5781
-Function5781: ; 5781
+.DoStepsForAllObjects
ld bc, ObjectStructs
xor a
.loop
@@ -2505,21 +2504,21 @@ Function5781: ; 5781
ret
; 579d
-Function579d: ; 579d
- ld a, $3e
+RefreshPlayerSprite: ; 579d
+ ld a, movement_step_sleep_1
ld [wPlayerNextMovement], a
ld [wPlayerMovement], a
xor a
ld [wd04e], a
ld [PlayerObjectStepFrame], a
- call Function57bc
+ call .TryResetPlayerAction
callba CheckWarpFacingDown
call c, SpawnInFacingDown
- call SpawnInCustomFacing
+ call .SpawnInCustomFacing
ret
; 57bc
-Function57bc: ; 57bc
+.TryResetPlayerAction: ; 57bc
ld hl, wPlayerSpriteSetupFlags
bit 7, [hl]
jr nz, .ok
@@ -2531,7 +2530,7 @@ Function57bc: ; 57bc
ret
; 57ca
-SpawnInCustomFacing: ; 57ca
+.SpawnInCustomFacing: ; 57ca
ld hl, wPlayerSpriteSetupFlags
bit 5, [hl]
ret z
diff --git a/engine/map_setup.asm b/engine/map_setup.asm
index c2900665f..50ab18335 100644
--- a/engine/map_setup.asm
+++ b/engine/map_setup.asm
@@ -306,7 +306,7 @@ SuspendMapAnims: ; 154d3
; 154d7
LoadObjectsRunCallback_02: ; 154d7
- ld a, 2
+ ld a, MAPCALLBACK_OBJECTS
call RunMapCallback
callba LoadObjectMasks
callba InitializeVisibleSprites
diff --git a/engine/money.asm b/engine/money.asm
index 5935a23e7..d5d9b5c5c 100755
--- a/engine/money.asm
+++ b/engine/money.asm
@@ -1,11 +1,11 @@
GiveMoney:: ; 15fd7
- ld a, $3
+ ld a, 3
call AddMoney
ld bc, MaxMoney
- ld a, $3
+ ld a, 3
call CompareMoney
- jr z, .asm_15ff5
- jr c, .asm_15ff5
+ jr z, .not_maxed_out
+ jr c, .not_maxed_out
ld hl, MaxMoney
ld a, [hli]
ld [de], a
@@ -18,7 +18,7 @@ GiveMoney:: ; 15fd7
scf
ret
-.asm_15ff5
+.not_maxed_out
and a
ret
; 15ff7
@@ -31,7 +31,8 @@ MaxMoney: ; 15ff7
TakeMoney:: ; 15ffa
ld a, 3
call SubtractMoney
- jr nc, .asm_16009
+ jr nc, .okay
+ ; leave with 0 money
xor a
ld [de], a
inc de
@@ -41,20 +42,23 @@ TakeMoney:: ; 15ffa
scf
ret
-.asm_16009
+.okay
and a
ret
; 1600b
CompareMoney:: ; 1600b
- ld a, $3
+ ld a, 3
CompareFunds: ; 1600d
+; a: number of bytes
+; bc: start addr of amount (big-endian)
+; de: start addr of account (big-endian)
push hl
push de
push bc
ld h, b
ld l, c
- ld c, $0
+ ld c, 0
ld b, a
.loop1
dec a
@@ -82,10 +86,9 @@ CompareFunds: ; 1600d
jr .skip_carry
.set_carry
- ld a, $1
+ ld a, TRUE
and a
scf
-
.skip_carry
pop bc
pop de
@@ -96,6 +99,9 @@ CompareFunds: ; 1600d
SubtractMoney: ; 16035
ld a, 3
SubtractFunds: ; 16037
+; a: number of bytes
+; bc: start addr of amount (big-endian)
+; de: start addr of account (big-endian)
push hl
push de
push bc
@@ -127,11 +133,15 @@ SubtractFunds: ; 16037
; 16053
AddMoney: ; 16053
- ld a, $3
+ ld a, 3
AddFunds: ; 16055
+; a: number of bytes
+; bc: start addr of amount (big-endian)
+; de: start addr of account (big-endian)
push hl
push de
push bc
+
ld h, b
ld l, c
ld b, a
@@ -152,6 +162,7 @@ AddFunds: ; 16055
dec hl
dec b
jr nz, .loop2
+
pop bc
pop de
pop hl
@@ -189,7 +200,8 @@ TakeCoins:: ; 1608f
ld a, 2
ld de, Coins
call SubtractFunds
- jr nc, .asm_1609f
+ jr nc, .okay
+ ; leave with 0 coins
xor a
ld [de], a
inc de
@@ -197,13 +209,13 @@ TakeCoins:: ; 1608f
scf
ret
-.asm_1609f
+.okay
and a
ret
; 160a1
CheckCoins:: ; 160a1
- ld a, $2
+ ld a, 2
ld de, Coins
jp CompareFunds
; 160a9
diff --git a/engine/move_mon.asm b/engine/move_mon.asm
index e9a50ad4d..8bda52daa 100755
--- a/engine/move_mon.asm
+++ b/engine/move_mon.asm
@@ -1428,7 +1428,7 @@ CalcPkmnStatC: ; e17b
sla c
ld a, d
and a
- jr z, .SkipSqrt
+ jr z, .no_stat_exp
add hl, bc
push de
ld a, [hld]
@@ -1437,7 +1437,7 @@ CalcPkmnStatC: ; e17b
callba GetSquareRoot
pop de
-.SkipSqrt
+.no_stat_exp
srl c
pop hl
push bc
diff --git a/engine/options_menu.asm b/engine/options_menu.asm
index 2e8b0424b..f6d8392d9 100755
--- a/engine/options_menu.asm
+++ b/engine/options_menu.asm
@@ -5,8 +5,8 @@ _OptionsMenu: ; e41d0
ld [hl], $1
call ClearBGPalettes
hlcoord 0, 0
- ld b, $10
- ld c, $12
+ ld b, 16
+ ld c, 18
call TextBox
hlcoord 2, 2
ld de, StringOptions
diff --git a/engine/overworld.asm b/engine/overworld.asm
index 748ab4649..e1d50d0b8 100755
--- a/engine/overworld.asm
+++ b/engine/overworld.asm
@@ -166,7 +166,7 @@ endr
RunCallback_04: ; 14209
- ld a, $4
+ ld a, MAPCALLBACK_SPRITES
call RunMapCallback
call GetUsedSprites
call .LoadMiscTiles
diff --git a/engine/party_menu.asm b/engine/party_menu.asm
index 35f6e3d47..b9048da10 100644
--- a/engine/party_menu.asm
+++ b/engine/party_menu.asm
@@ -3,7 +3,7 @@ SelectMonFromParty: ; 50000
xor a
ld [PartyMenuActionText], a
call ClearBGPalettes
- call Function5003f
+ call InitPartyMenuLayout
call WaitBGMap
call SetPalettes
call DelayFrame
@@ -18,7 +18,7 @@ SelectTradeOrDaycareMon: ; 5001d
ld [PartyMenuActionText], a
call DisableSpriteUpdates
call ClearBGPalettes
- call Function5003f
+ call InitPartyMenuLayout
call WaitBGMap
ld b, SCGB_0A
call GetSGBLayout
@@ -29,7 +29,7 @@ SelectTradeOrDaycareMon: ; 5001d
ret
; 5003f
-Function5003f: ; 5003f
+InitPartyMenuLayout: ; 5003f
call LoadPartyMenuGFX
call InitPartyMenuWithCancel
call InitPartyMenuGFX
@@ -40,7 +40,7 @@ Function5003f: ; 5003f
LoadPartyMenuGFX: ; 5004f
call LoadFontsBattleExtra
- callab Function8ad1 ; engine/color.asm
+ callab InitPartyMenuPalettes ; engine/color.asm
callab ClearSpriteAnims2
ret
; 5005f
diff --git a/engine/pokedex.asm b/engine/pokedex.asm
index 14b1ebbce..d1e2d7edf 100644
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -577,15 +577,15 @@ Jumptable_40405: ; 40405 (10:4405)
; 4040d
Function4040d: ; 4040d (10:440d)
- ld b, $0
+ ld b, DEXMODE_NEW
jr Function40417
Function40411: ; 40411 (10:4411)
- ld b, $1
+ ld b, DEXMODE_OLD
jr Function40417
Function40415: ; 40415 (10:4415)
- ld b, $2
+ ld b, DEXMODE_ABC
Function40417: ; 40417 (10:4417)
ld a, [wCurrentDexMode]
cp b
diff --git a/engine/pokegear.asm b/engine/pokegear.asm
index 821a51f8a..4ef65da8c 100755
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -213,14 +213,14 @@ Function90d70: ; 90d70 (24:4d70)
call GetWorldMapLocation
.LoadLandmark
- ld [wc6d8], a
- ld [wc6d7], a
+ ld [wTownMapPlayerIconLandmark], a
+ ld [wTownMapCursorLandmark], a
ret
.FastShip
- ld [wc6d8], a
+ ld [wTownMapPlayerIconLandmark], a
ld a, NEW_BARK_TOWN
- ld [wc6d7], a
+ ld [wTownMapCursorLandmark], a
ret
Function90d9e: ; 90d9e (24:4d9e)
@@ -321,7 +321,7 @@ Function90e1a: ; 90e1a
Function90e3f: ; 90e3f
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK
@@ -341,7 +341,7 @@ Function90e3f: ; 90e3f
ld [hl], $6
hlcoord 19, 2
ld [hl], $17
- ld a, [wc6d7]
+ ld a, [wTownMapCursorLandmark]
call Function910b4
ret
; 90e72
@@ -547,7 +547,7 @@ UnknownText_0x90faf: ; 0x90faf
; 0x90fb4
Function90fb4: ; 90fb4 (24:4fb4)
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK
@@ -567,9 +567,9 @@ Function90fb4: ; 90fb4 (24:4fb4)
Function90fcd: ; 90fcd (24:4fcd)
call Function90da8
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
call Function9106a
- ld a, [wc6d7]
+ ld a, [wTownMapCursorLandmark]
call Function91098
ld a, c
ld [wc6d5], a
@@ -580,7 +580,7 @@ Function90fcd: ; 90fcd (24:4fcd)
ret
Function90fe9: ; 90fe9 (24:4fe9)
- call Function910e8
+ call TownMap_GetKantoLandmarkLimits
jr Function90ff2
Function90fee: ; 90fee (24:4fee)
@@ -637,7 +637,7 @@ Function9102f: ; 9102f (24:502f)
jr nz, .down
ret
.up
- ld hl, wc6d7
+ ld hl, wTownMapCursorLandmark
ld a, [hl]
cp d
jr c, .asm_91047
@@ -649,7 +649,7 @@ Function9102f: ; 9102f (24:502f)
jr .done
.down
- ld hl, wc6d7
+ ld hl, wTownMapCursorLandmark
ld a, [hl]
cp e
jr nz, .asm_91054
@@ -660,13 +660,13 @@ Function9102f: ; 9102f (24:502f)
dec [hl]
.done
- ld a, [wc6d7]
+ ld a, [wTownMapCursorLandmark]
call Function910b4
ld a, [wc6d5]
ld c, a
ld a, [wc6d6]
ld b, a
- ld a, [wc6d7]
+ ld a, [wTownMapCursorLandmark]
call Function910d4
ret
@@ -747,17 +747,17 @@ Function910d4: ; 910d4
ret
; 910e8
-Function910e8: ; 910e8
+TownMap_GetKantoLandmarkLimits: ; 910e8
ld a, [StatusFlags]
bit 6, a
- jr z, .asm_910f4
- ld d, $5e
- ld e, $2f
+ jr z, .not_hof
+ ld d, ROUTE_28
+ ld e, PALLET_TOWN
ret
-.asm_910f4
- ld d, $5e
- ld e, $58
+.not_hof
+ ld d, ROUTE_28
+ ld e, VICTORY_ROAD
ret
; 910f9
@@ -1558,7 +1558,7 @@ RadioChannels:
jp LoadStation_BuenasPassword
.RuinsOfAlphRadio
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
cp RUINS_OF_ALPH
jr nz, .NoSignal
jp LoadStation_UnownRadio
@@ -1594,7 +1594,7 @@ RadioChannels:
bit 4, a
jr z, .NoSignal
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
cp MAHOGANY_TOWN
jr z, .ok
cp ROUTE_43
@@ -1611,7 +1611,7 @@ RadioChannels:
.InJohto
; if in Johto or on the S.S. Aqua, set carry
; otherwise clear carry
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK
diff --git a/engine/save.asm b/engine/save.asm
index 7750b0f41..f2f3a79bd 100644
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -723,13 +723,13 @@ TryLoadSaveData: ; 14f1c
DefaultOptions: ; 14f7c
db $03 ; mid text speed
- db $00
+ db $00 ; wSaveFileExists
db $00 ; frame 0
- db $01
+ db $01 ; TextBoxFlags
db $40 ; gb printer: normal brightness
db $01 ; menu account on
- db $00
- db $00
+ db $00 ; ??
+ db $00 ; ??
; 14f84
CheckPrimarySaveFile: ; 14f84
diff --git a/engine/scripting.asm b/engine/scripting.asm
index 1111b0872..0a68243d3 100644
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -141,7 +141,7 @@ ScriptCommandTable: ; 96cb1
dw Script_stringtotext ; 44
dw Script_itemnotify ; 45
dw Script_pocketisfull ; 46
- dw Script_textbox ; 47
+ dw Script_textbox ; 47
dw Script_refreshscreen ; 48
dw Script_closetext ; 49
dw Script_loadbytec2cf ; 4a
@@ -160,15 +160,15 @@ ENDC
dw Script_buttonsound ; 55
dw Script_pokepic ; 56
dw Script_closepokepic ; 57
- dw Script__2dmenu ; 58
- dw Script_verticalmenu ; 59
+ dw Script__2dmenu ; 58
+ dw Script_verticalmenu ; 59
dw Script_loadpikachudata ; 5a
dw Script_randomwildmon ; 5b
dw Script_loadmemtrainer ; 5c
dw Script_loadwildmon ; 5d
dw Script_loadtrainer ; 5e
dw Script_startbattle ; 5f
- dw Script_reloadmapafterbattle ; 60
+ dw Script_reloadmapafterbattle ; 60
dw Script_catchtutorial ; 61
dw Script_trainertext ; 62
dw Script_trainerflagaction ; 63
@@ -203,7 +203,7 @@ ENDC
dw Script_encountermusic ; 80
dw Script_musicfadeout ; 81
dw Script_playmapmusic ; 82
- dw Script_dontrestartmapmusic ; 83
+ dw Script_dontrestartmapmusic ; 83
dw Script_cry ; 84
dw Script_playsound ; 85
dw Script_waitsfx ; 86
@@ -1203,7 +1203,7 @@ ApplyPersonFacing: ; 9728b
jr c, .not_visible ; STILL_SPRITE
ld hl, OBJECT_FLAGS1
add hl, bc
- bit 2, [hl]
+ bit FIXED_FACING, [hl]
jr nz, .not_visible
pop de
ld a, e
@@ -3049,10 +3049,7 @@ Script_loadbytec2cf: ; 97b27
ret
; 97b2e
-
-CloseTextScript: ; 97b2e
- closetext
-; 97b2f
+ ld c, c ; XXX
Script_closetext: ; 97b2f
; script command 0x49
diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm
index abdf6cd53..2520a9a24 100755
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -9,7 +9,7 @@ REEL_SIZE EQU 15
_SlotMachine:
ld hl, Options
- set 4, [hl]
+ set NO_TEXT_SCROLL, [hl]
call .InitGFX
call DelayFrame
.loop
@@ -22,7 +22,7 @@ _SlotMachine:
call ClearBGPalettes
callba MobileFn_105fd0
ld hl, Options
- res 4, [hl]
+ res NO_TEXT_SCROLL, [hl]
ld hl, rLCDC ; $ff40
res 2, [hl]
ret
diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm
index e577dc528..e8f1177f2 100644
--- a/engine/spawn_points.asm
+++ b/engine/spawn_points.asm
@@ -1,8 +1,6 @@
SpawnPoints: ; 0x152ab
- const_def
-
spawn: MACRO
; map, y, x
map \1
diff --git a/engine/startmenu.asm b/engine/startmenu.asm
index 58b7ca5ec..6ba60af36 100755
--- a/engine/startmenu.asm
+++ b/engine/startmenu.asm
@@ -146,7 +146,7 @@ StartMenu:: ; 125cd
call .DrawBugContestStatus
call UpdateSprites
call ret_d90
- call Function2b5c
+ call FinishExitMenu
ret
; 126d3
diff --git a/engine/time.asm b/engine/time.asm
index f4eee4b17..542141198 100755
--- a/engine/time.asm
+++ b/engine/time.asm
@@ -195,7 +195,7 @@ InitializeStartDay: ; 114dd
ret
; 114e7
-CheckPokerusTrick:: ; 114e7
+CheckPokerusTick:: ; 114e7
ld hl, wStartDay
call CalcDaysSince
call GetDaysSince
diff --git a/engine/town_map.asm b/engine/town_map.asm
index 2633b8385..100aaae17 100755
--- a/engine/town_map.asm
+++ b/engine/town_map.asm
@@ -45,23 +45,23 @@ _TownMap: ; 9191c
call SetPalettes
ld a, [hCGB]
and a
- jr z, .sgb
- ld a, $e4
+ jr z, .dmg
+ ld a, %11100100
call DmgToCgbObjPal0
call DelayFrame
-.sgb
+.dmg
ld a, [wd002]
cp KANTO_LANDMARK
jr nc, .kanto
ld d, KANTO_LANDMARK - 1
ld e, 1
- call Function919b0
+ call .loop
jr .resume
.kanto
- call Function910e8
- call Function919b0
+ call TownMap_GetKantoLandmarkLimits
+ call .loop
.resume
pop af
@@ -72,9 +72,7 @@ _TownMap: ; 9191c
ld [Options], a
call ClearBGPalettes
ret
-; 919b0
-Function919b0: ; 919b0
.loop
call JoyTextDelay
ld hl, hJoyPressed
diff --git a/engine/warp_connection.asm b/engine/warp_connection.asm
index 26ea2c2c9..7df4fc35b 100755
--- a/engine/warp_connection.asm
+++ b/engine/warp_connection.asm
@@ -5,11 +5,11 @@ RunCallback_05_03: ; 1045b0
call ResetFlashIfOutOfCave
call GetCurrentMapTrigger
call ResetBikeFlags
- ld a, $5
+ ld a, MAPCALLBACK_NEWMAP
call RunMapCallback
RunCallback_03: ; 1045c4
callba ClearCmdQueue
- ld a, $3
+ ld a, MAPCALLBACK_CMDQUEUE
call RunMapCallback
call GetMapHeaderTimeOfDayNybble
ld [wMapTimeOfDay], a
@@ -319,7 +319,7 @@ RefreshMapSprites: ; 1047f0
call ClearSprites
callba ReturnFromMapSetupScript
call GetMovementPermissions
- callba Function579d
+ callba RefreshPlayerSprite
callba CheckReplaceKrisSprite
ld hl, wPlayerSpriteSetupFlags
bit 6, [hl]
diff --git a/engine/wildmons.asm b/engine/wildmons.asm
index ff29c99b5..f6643d6c3 100755
--- a/engine/wildmons.asm
+++ b/engine/wildmons.asm
@@ -494,6 +494,7 @@ CopyCurrMapDE: ; 2a27f
; 2a288
LookUpWildmonsForMapDE: ; 2a288
+.loop
push hl
ld a, [hl]
inc a
@@ -509,7 +510,7 @@ LookUpWildmonsForMapDE: ; 2a288
.next
pop hl
add hl, bc
- jr LookUpWildmonsForMapDE
+ jr .loop
.nope
pop hl
@@ -896,7 +897,7 @@ endr
ld a, c
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
- ld hl, UnknownText_0x2a51a
+ ld hl, .SawRareMonText
call PrintText
xor a
ld [ScriptVar], a
@@ -906,9 +907,8 @@ endr
ld a, $1
ld [ScriptVar], a
ret
-; 2a51a
-UnknownText_0x2a51a: ; 0x2a51a
+.SawRareMonText
; I just saw some rare @ in @ . I'll call you if I see another rare #MON, OK?
text_jump UnknownText_0x1bd34b
db "@"
diff --git a/home/map.asm b/home/map.asm
index 370c6ac12..7b70c02b5 100644
--- a/home/map.asm
+++ b/home/map.asm
@@ -2,7 +2,7 @@
Clearwc7e8:: ; 210f
ld hl, wc7e8
- ld bc, $0018
+ ld bc, 24
ld a, $0
call ByteFill
ret
@@ -308,9 +308,8 @@ GetDestinationWarpNumber:: ; 2252
ret
.IncreaseHLTwice
-rept 2
inc hl
-endr
+ inc hl
scf
ret
; 22a7
@@ -424,9 +423,8 @@ ReadMapEventHeader:: ; 2336
ld a, [hli]
ld h, [hl]
ld l, a
-rept 2
inc hl
-endr
+ inc hl
call ReadWarps
call ReadCoordEvents
call ReadSignposts
@@ -563,11 +561,11 @@ ReadWarps:: ; 23da
ReadCoordEvents:: ; 23f1
ld a, [hli]
ld c, a
- ld [wCurrentNextMapXYTriggerCount], a
+ ld [wCurrentMapXYTriggerCount], a
ld a, l
- ld [wCurrentNextMapXYTriggerHeaderPointer], a
+ ld [wCurrentMapXYTriggerHeaderPointer], a
ld a, h
- ld [wCurrentNextMapXYTriggerHeaderPointer + 1], a
+ ld [wCurrentMapXYTriggerHeaderPointer + 1], a
ld a, c
and a
@@ -737,7 +735,7 @@ LoadBlockData:: ; 24cd
call ByteFill
call ChangeMap
call FillMapConnections
- ld a, $1
+ ld a, MAPCALLBACK_TILES
call RunMapCallback
ret
; 24e4
@@ -1198,7 +1196,7 @@ MaskObject:: ; 2712
ld d, $0
ld hl, wObjectMasks
add hl, de
- ld [hl], -1 ; ,masked
+ ld [hl], -1 ; , masked
ret
; 271e
@@ -1340,9 +1338,8 @@ UpdateBGMapRow:: ; 27d3
ld a, d
ld [hli], a
ld a, e
-rept 2
inc a
-endr
+ inc a
and $1f
ld b, a
ld a, e
@@ -1568,8 +1565,8 @@ SaveScreen_LoadNeighbor:: ; 28f7
GetMovementPermissions:: ; 2914
xor a
ld [TilePermissions], a
- call GetLeftRightCollision
- call GetUpDownCollision
+ call .LeftRight
+ call .UpDown
; get coords of current tile
ld a, [PlayerNextMapX]
ld d, a
@@ -1577,12 +1574,12 @@ GetMovementPermissions:: ; 2914
ld e, a
call GetCoordTile
ld [PlayerNextTile], a
- call Function29ff
+ call .CheckHiNybble
ret nz
ld a, [PlayerNextTile]
and 7
- ld hl, .data_2945
+ ld hl, .MovementPermissionsData
add l
ld l, a
ld a, 0
@@ -1595,11 +1592,11 @@ GetMovementPermissions:: ; 2914
ret
; 2945
-.data_2945 ; 2945
+.MovementPermissionsData ; 2945
db 1, 2, 4, 8, 9, 10, 5, 6
; 294d
-GetUpDownCollision:: ; 294d
+.UpDown
ld a, [PlayerNextMapX]
ld d, a
ld a, [PlayerNextMapY]
@@ -1609,17 +1606,17 @@ GetUpDownCollision:: ; 294d
inc e
call GetCoordTile
ld [TileDown], a
- call Function298b
+ call .Down
pop de
dec e
call GetCoordTile
ld [TileUp], a
- call Function29a8
+ call .Up
ret
; 296c
-GetLeftRightCollision:: ; 296c
+.LeftRight
ld a, [PlayerNextMapX]
ld d, a
ld a, [PlayerNextMapY]
@@ -1629,93 +1626,93 @@ GetLeftRightCollision:: ; 296c
dec d
call GetCoordTile
ld [TileLeft], a
- call Function29e2
+ call .Left
pop de
inc d
call GetCoordTile
ld [TileRight], a
- call Function29c5
+ call .Right
ret
; 298b
-Function298b:: ; 298b
- call Function29ff
+.Down
+ call .CheckHiNybble
ret nz
ld a, [TileDown]
and 7
cp $2
- jr z, .ok
+ jr z, .ok_down
cp $6
- jr z, .ok
+ jr z, .ok_down
cp $7
ret nz
-.ok
+.ok_down
ld a, [TilePermissions]
or FACE_DOWN
ld [TilePermissions], a
ret
; 29a8
-Function29a8:: ; 29a8
- call Function29ff
+.Up
+ call .CheckHiNybble
ret nz
ld a, [TileUp]
and 7
cp $3
- jr z, .ok
+ jr z, .ok_up
cp $4
- jr z, .ok
+ jr z, .ok_up
cp $5
ret nz
-.ok
+.ok_up
ld a, [TilePermissions]
or FACE_UP
ld [TilePermissions], a
ret
; 29c5
-Function29c5:: ; 29c5
- call Function29ff
+.Right
+ call .CheckHiNybble
ret nz
ld a, [TileRight]
and 7
cp $1
- jr z, .ok
+ jr z, .ok_right
cp $5
- jr z, .ok
+ jr z, .ok_right
cp $7
ret nz
-.ok
+.ok_right
ld a, [TilePermissions]
or FACE_RIGHT
ld [TilePermissions], a
ret
; 29e2
-Function29e2:: ; 29e2
- call Function29ff
+.Left
+ call .CheckHiNybble
ret nz
ld a, [TileLeft]
and 7
cp $0
- jr z, .ok
+ jr z, .ok_left
cp $4
- jr z, .ok
+ jr z, .ok_left
cp $6
ret nz
-.ok
+.ok_left
ld a, [TilePermissions]
or FACE_LEFT
ld [TilePermissions], a
ret
; 29ff
-Function29ff:: ; 29ff
+.CheckHiNybble
and $f0
cp $b0
ret z
@@ -1733,9 +1730,8 @@ GetFacingTileCoord:: ; 2a07
srl a
ld l, a
ld h, 0
-rept 2
- add hl,hl
-endr
+ add hl, hl
+ add hl, hl
ld de, .Directions
add hl, de
@@ -1777,9 +1773,8 @@ GetCoordTile:: ; 2a3c
jr z, .nope
ld l, a
ld h, $0
-rept 2
- add hl,hl
-endr
+ add hl, hl
+ add hl, hl
ld a, [TilesetCollisionAddress]
ld c, a
ld a, [TilesetCollisionAddress + 1]
@@ -1792,9 +1787,8 @@ endr
.nocarry
rr e
jr nc, .nocarry2
-rept 2
inc hl
-endr
+ inc hl
.nocarry2
ld a, [TilesetCollisionBank]
@@ -1895,16 +1889,16 @@ CheckIfFacingTileCoordIsSign:: ; 2aaa
.copysign
pop hl
- ld de, EngineBuffer1
+ ld de, wCurSignpostYCoord
ld bc, 5 ; signpost event length
call CopyBytes
scf
ret
; 2ad4
-CheckCurrentNextMapXYTriggers:: ; 2ad4
+CheckCurrentMapXYTriggers:: ; 2ad4
; If there are no xy triggers, we don't need to be here.
- ld a, [wCurrentNextMapXYTriggerCount]
+ ld a, [wCurrentMapXYTriggerCount]
and a
ret z
; Copy the trigger count into c.
@@ -1912,16 +1906,15 @@ CheckCurrentNextMapXYTriggers:: ; 2ad4
ld a, [hROMBank]
push af
call SwitchToMapScriptHeaderBank
- call CheckStandingOnXYTrigger
+ call .TriggerCheck
pop hl
ld a, h
rst Bankswitch
ret
-; 2ae7
-CheckStandingOnXYTrigger:: ; 2ae7
+.TriggerCheck
; Checks to see if you are standing on an xy-trigger. If yes, copies the trigger to EngineBuffer1 and sets carry.
- ld hl, wCurrentNextMapXYTriggerHeaderPointer
+ ld hl, wCurrentMapXYTriggerHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -1969,7 +1962,7 @@ CheckStandingOnXYTrigger:: ; 2ae7
.copytrigger
pop hl
- ld de, EngineBuffer1
+ ld de, wCurCoordEventTriggerID
ld bc, 8 ; xy-trigger size
call CopyBytes
scf
@@ -1992,7 +1985,7 @@ CloseSubmenu:: ; 2b3c
call UpdateSprites
call Call_ExitMenu
call ret_d90
- jr Function2b5c
+ jr FinishExitMenu
; 2b4d
ExitAllMenus:: ; 2b4d
@@ -2001,7 +1994,7 @@ ExitAllMenus:: ; 2b4d
call ReloadTilesetAndPalettes
call UpdateSprites
call ret_d90
-Function2b5c:: ; 2b5c
+FinishExitMenu:: ; 2b5c
ld b, SCGB_MAPPALS
call GetSGBLayout
callba LoadOW_BGPal7
@@ -2066,8 +2059,6 @@ GetMapHeaderPointer:: ; 2be5
ld b, a
ld a, [MapNumber]
ld c, a
-; 2bed
-
GetAnyMapHeaderPointer:: ; 0x2bed
; Prior to calling this function, you must have switched banks so that
; MapGroupPointers is visible.
@@ -2085,9 +2076,8 @@ GetAnyMapHeaderPointer:: ; 0x2bed
ld c, b
ld b, 0
ld hl, MapGroupPointers
-rept 2
add hl, bc
-endr
+ add hl, bc
ld a, [hli]
ld h, [hl]
@@ -2116,8 +2106,6 @@ GetMapHeaderMember:: ; 0x2c04
ld b, a
ld a, [MapNumber]
ld c, a
- ; fallthrough
-
GetAnyMapHeaderMember:: ; 0x2c0c
; bankswitch
ld a, [hROMBank]
@@ -2142,8 +2130,6 @@ SwitchToMapBank:: ; 2c1c
ld b, a
ld a, [MapNumber]
ld c, a
-; 2c24
-
SwitchToAnyMapBank:: ; 2c24
call GetAnyMapBank
rst Bankswitch
@@ -2155,8 +2141,6 @@ GetMapBank:: ; 2c29
ld b, a
ld a, [MapNumber]
ld c, a
-; 2c31
-
GetAnyMapBank:: ; 2c31
push hl
push de
@@ -2253,8 +2237,7 @@ GetMapPermission:: ; 2c8a
ret
; 2c98
-Function2c98:: ; 2c98
- ret
+ ret ; XXX
; 2c99
GetAnyMapPermission:: ; 2c99
diff --git a/home/menu.asm b/home/menu.asm
index 6854d6c92..3e04af8cf 100644
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -113,9 +113,8 @@ CopyNameFromMenu::
ld a, [hli]
ld h, [hl]
ld l, a
-rept 2
inc hl
-endr
+ inc hl
pop af
call GetNthString
ld d, h
@@ -444,9 +443,8 @@ PlaceNthMenuStrings:: ; 1f8d
push de
ld a, [MenuSelection]
call GetMenuDataPointerTableEntry
-rept 2
inc hl
-endr
+ inc hl
ld a, [hli]
ld d, [hl]
ld e, a
@@ -458,9 +456,8 @@ endr
Function1f9e:: ; 1f9e
; unreferenced
call GetMenuDataPointerTableEntry
-rept 2
inc hl
-endr
+ inc hl
ld a, [hli]
ld d, [hl]
ld e, a
@@ -483,9 +480,10 @@ GetMenuDataPointerTableEntry:: ; 1fb1
ld a, [hli]
ld h, [hl]
ld l, a
-rept 4
add hl, de
-endr
+ add hl, de
+ add hl, de
+ add hl, de
ret
; 1fbf
@@ -506,9 +504,8 @@ ClearWindowData:: ; 1fbf
xor a
ld hl, wWindowStackBottom
-rept 2
ld [hld], a
-endr
+ ld [hld], a
ld a, l
ld [wWindowStackPointer], a
ld a, h
diff --git a/macros/event.asm b/macros/event.asm
index 23fa9c034..c575b7caf 100644
--- a/macros/event.asm
+++ b/macros/event.asm
@@ -94,7 +94,6 @@ callasm: macro
dba \1
endm
-
enum special_command
special: macro
db special_command
@@ -106,7 +105,6 @@ add_special: MACRO
dba \1
ENDM
-
enum ptcallasm_command
ptcallasm: macro
db ptcallasm_command
diff --git a/macros/map.asm b/macros/map.asm
index 519e2eb76..2e8765770 100644
--- a/macros/map.asm
+++ b/macros/map.asm
@@ -183,3 +183,7 @@ stonetable: MACRO
db \1, \2
dw \3
endm
+
+maptrigger: MACRO
+ dw \1, 0
+endm
diff --git a/macros/wram.asm b/macros/wram.asm
new file mode 100755
index 000000000..8e5e55cba
--- /dev/null
+++ b/macros/wram.asm
@@ -0,0 +1,212 @@
+
+flag_array: MACRO
+ ds ((\1) + 7) / 8
+ENDM
+
+box_struct: MACRO
+\1Species:: db
+\1Item:: db
+\1Moves:: ds NUM_MOVES
+\1ID:: dw
+\1Exp:: ds 3
+\1StatExp::
+\1HPExp:: dw
+\1AtkExp:: dw
+\1DefExp:: dw
+\1SpdExp:: dw
+\1SpcExp:: dw
+\1DVs:: ds 2
+\1PP:: ds NUM_MOVES
+\1Happiness:: db
+\1PokerusStatus:: db
+\1CaughtData::
+\1CaughtTime::
+\1CaughtLevel:: db
+\1CaughtGender::
+\1CaughtLocation:: db
+\1Level:: db
+\1End::
+ENDM
+
+party_struct: MACRO
+ box_struct \1
+\1Status:: db
+\1Unused:: db
+\1HP:: dw
+\1MaxHP:: dw
+\1Stats:: ; big endian
+\1Attack:: dw
+\1Defense:: dw
+\1Speed:: dw
+\1SpclAtk:: dw
+\1SpclDef:: dw
+\1StatsEnd::
+ENDM
+
+red_box_struct: MACRO
+\1Species:: db
+\1HP:: dw
+\1BoxLevel:: db
+\1Status:: db
+\1Type::
+\1Type1:: db
+\1Type2:: db
+\1CatchRate:: db
+\1Moves:: ds NUM_MOVES
+\1OTID:: dw
+\1Exp:: ds 3
+\1HPExp:: dw
+\1AttackExp:: dw
+\1DefenseExp:: dw
+\1SpeedExp:: dw
+\1SpecialExp:: dw
+\1DVs:: ds 2
+\1PP:: ds NUM_MOVES
+ENDM
+
+red_party_struct: MACRO
+ red_box_struct \1
+\1Level:: db
+\1Stats::
+\1MaxHP:: dw
+\1Attack:: dw
+\1Defense:: dw
+\1Speed:: dw
+\1Special:: dw
+ENDM
+
+
+battle_struct: MACRO
+\1Species:: db
+\1Item:: db
+\1Moves:: ds NUM_MOVES
+\1MovesEnd::
+\1DVs:: ds 2
+\1PP:: ds NUM_MOVES
+\1Happiness:: db
+\1Level:: db
+\1Status:: ds 2
+\1HP:: dw
+\1MaxHP:: dw
+\1Stats:: ; big endian
+\1Attack:: dw
+\1Defense:: dw
+\1Speed:: dw
+\1SpclAtk:: dw
+\1SpclDef:: dw
+\1StatsEnd::
+\1Type::
+\1Type1:: db
+\1Type2:: db
+\1StructEnd::
+ENDM
+
+box: MACRO
+\1::
+\1Count:: ds 1
+\1Species:: ds MONS_PER_BOX + 1
+\1Mons::
+\1Mon1:: box_struct \1Mon1
+\1Mon2:: ds BOXMON_STRUCT_LENGTH * (MONS_PER_BOX +- 1)
+\1MonOT:: ds NAME_LENGTH * MONS_PER_BOX
+\1MonNicknames:: ds PKMN_NAME_LENGTH * MONS_PER_BOX
+\1MonNicknamesEnd::
+\1End:: ds 2 ; padding
+ENDM
+
+
+channel_struct: MACRO
+; Addreses are Channel1 (c101).
+\1MusicID:: dw
+\1MusicBank:: db
+\1Flags:: db ; 0:on/off 1:subroutine 3:sfx 4:noise 5:rest
+\1Flags2:: db ; 0:vibrato on/off 2:duty 4:cry pitch
+\1Flags3:: db ; 0:vibrato up/down
+\1MusicAddress:: dw
+\1LastMusicAddress:: dw
+ dw
+\1NoteFlags:: db ; 5:rest
+\1Condition:: db ; conditional jumps
+\1DutyCycle:: db ; bits 6-7 (0:12.5% 1:25% 2:50% 3:75%)
+\1Intensity:: db ; hi:pressure lo:velocity
+\1Frequency:: ; 11 bits
+\1FrequencyLo:: db
+\1FrequencyHi:: db
+\1Pitch:: db ; 0:rest 1-c:note
+\1Octave:: db ; 7-0 (0 is highest)
+\1StartingOctave:: db ; raises existing octaves (to repeat phrases)
+\1NoteDuration:: db ; frames remaining for the current note
+\1Field0x16:: ds 1 ; c117
+ ds 1 ; c118
+\1LoopCount:: db
+\1Tempo:: dw
+\1Tracks:: db ; hi:left lo:right
+\1Field0x1c:: ds 1 ; c11d
+\1VibratoDelayCount:: db ; initialized by \1VibratoDelay
+\1VibratoDelay:: db ; number of frames a note plays until vibrato starts
+\1VibratoExtent:: db
+\1VibratoRate:: db ; hi:frames for each alt lo:frames to the next alt
+\1Field0x21:: ds 1 ; c122
+\1Field0x22:: ds 1 ; c123
+\1Field0x23:: ds 1 ; c124
+\1Field0x24:: ds 1 ; c125
+\1Field0x25:: ds 1 ; c126
+ ds 1 ; c127
+\1CryPitch:: dw
+\1Field0x29:: ds 1
+\1Field0x2a:: ds 2
+\1Field0x2c:: ds 1
+\1NoteLength:: db ; frames per 16th note
+\1Field0x2e:: ds 1 ; c12f
+\1Field0x2f:: ds 1 ; c130
+\1Field0x30:: ds 1 ; c131
+ ds 1 ; c132
+ENDM
+
+battle_tower_struct: MACRO
+\1Name:: ds NAME_LENGTH +- 1
+\1TrainerClass:: ds 1
+\1Pkmn1:: party_struct \1Pkmn1
+\1Pkmn1Name:: ds PKMN_NAME_LENGTH
+\1Pkmn1NameEnd::
+\1Pkmn2:: party_struct \1Pkmn2
+\1Pkmn2Name:: ds PKMN_NAME_LENGTH
+\1Pkmn2NameEnd::
+\1Pkmn3:: party_struct \1Pkmn3
+\1Pkmn3Name:: ds PKMN_NAME_LENGTH
+\1Pkmn3NameEnd::
+\1TrainerData:: ds BATTLETOWER_TRAINERDATALENGTH
+\1TrainerEnd::
+endm
+
+mailmsg: MACRO
+\1Message:: ds MAIL_MSG_LENGTH
+\1MessageEnd:: ds 1
+\1Author:: ds PLAYER_NAME_LENGTH
+\1AuthorNationality:: ds 2
+\1AuthorID:: ds 2
+\1Species:: ds 1
+\1Type:: ds 1
+\1End::
+endm
+
+hof_mon: MACRO
+\1Species:: ds 1
+\1ID:: ds 2
+\1DVs:: ds 2
+\1Level:: ds 1
+\1Nickname:: ds PKMN_NAME_LENGTH +- 1
+\1End::
+endm
+
+hall_of_fame: MACRO
+\1::
+\1WinCount:: ds 1
+\1Mon1:: hof_mon \1Mon1
+\1Mon2:: hof_mon \1Mon2
+\1Mon3:: hof_mon \1Mon3
+\1Mon4:: hof_mon \1Mon4
+\1Mon5:: hof_mon \1Mon5
+\1Mon6:: hof_mon \1Mon6
+\1End:: ds 1
+ENDM
diff --git a/main.asm b/main.asm
index 5c91bffff..00cf73453 100644
--- a/main.asm
+++ b/main.asm
@@ -367,7 +367,7 @@ endr
StepHappiness:: ; 725a
; Raise the party's happiness by 1 point every other step cycle.
- ld hl, wdc77
+ ld hl, wHappinessStepCount
ld a, [hl]
inc a
and 1
@@ -6377,13 +6377,20 @@ GivePokerusAndConvertBerries: ; 2ed44
ld a, [PartyCount]
ld b, a
ld de, PARTYMON_STRUCT_LENGTH
+; Check to see if any of your Pokemon already has Pokerus.
+; If so, sample its spread through your party.
+; This means that you cannot get Pokerus de novo while
+; a party member has an active infection.
.loopMons
ld a, [hl]
and $f
- jr nz, .monHasActivePokerus
+ jr nz, .TrySpreadPokerus
add hl, de
dec b
jr nz, .loopMons
+
+; If we haven't been to Goldenrod City at least once,
+; prevent the contraction of Pokerus.
ld hl, StatusFlags2
bit 6, [hl]
ret z
@@ -6406,7 +6413,7 @@ GivePokerusAndConvertBerries: ; 2ed44
ld a, [hl]
and $f0
ret nz ; if it already has pokerus, do nothing
-.randomPokerusLoop
+.randomPokerusLoop ; Simultaneously sample the strain and duration
call Random
and a
jr z, .randomPokerusLoop
@@ -6417,7 +6424,7 @@ GivePokerusAndConvertBerries: ; 2ed44
and $7
inc a
.load_pkrs
- ld b, a
+ ld b, a ; this should come before the label
swap b
and $3
inc a
@@ -6425,19 +6432,22 @@ GivePokerusAndConvertBerries: ; 2ed44
ld [hl], a
ret
-.monHasActivePokerus
+.TrySpreadPokerus
call Random
cp 1 + 33 percent
ret nc ; 1/3 chance
+
ld a, [PartyCount]
cp 1
ret z ; only one mon, nothing to do
+
ld c, [hl]
ld a, b
- cp $2
+ cp 2
jr c, .checkPreviousMonsLoop ; no more mons after this one, go backwards
+
call Random
- cp $80
+ cp 1 + 50 percent
jr c, .checkPreviousMonsLoop ; 1/2 chance, go backwards
.checkFollowingMonsLoop
add hl, de
@@ -6449,7 +6459,7 @@ GivePokerusAndConvertBerries: ; 2ed44
ret z ; if mon has cured pokerus, stop searching
dec b ; go on to next mon
ld a, b
- cp $1
+ cp 1
jr nz, .checkFollowingMonsLoop ; no more mons left
ret
@@ -7777,13 +7787,13 @@ LinkMonStatsScreen: ; 4d319
call ClearBGPalettes
call MaxVolume
callba LoadTradeScreenBorder
- callba Function4d354
+ callba Link_WaitBGMap
callba InitTradeSpeciesList
callba Function28eff
call WaitBGMap2
ret
-Function4d354: ; 4d354
+Link_WaitBGMap: ; 4d354
call WaitBGMap
call WaitBGMap2
ret
diff --git a/maps/AzaleaTown.asm b/maps/AzaleaTown.asm
index 5921b1f0e..7f4c16bea 100644
--- a/maps/AzaleaTown.asm
+++ b/maps/AzaleaTown.asm
@@ -17,15 +17,15 @@ AzaleaTown_MapScriptHeader:
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 1
; callbacks
- dbw 5, .Flypoint
+ dbw MAPCALLBACK_NEWMAP, .Flypoint
.Trigger0
end
diff --git a/maps/BattleTower1F.asm b/maps/BattleTower1F.asm
index ba0bd1c33..ca10518fb 100644
--- a/maps/BattleTower1F.asm
+++ b/maps/BattleTower1F.asm
@@ -10,8 +10,8 @@ BattleTower1F_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
diff --git a/maps/BattleTowerElevator.asm b/maps/BattleTowerElevator.asm
index 9a25e55a4..dbbce6f3d 100644
--- a/maps/BattleTowerElevator.asm
+++ b/maps/BattleTowerElevator.asm
@@ -6,8 +6,8 @@ BattleTowerElevator_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
diff --git a/maps/BattleTowerHallway.asm b/maps/BattleTowerHallway.asm
index f541da05d..6c4a45920 100644
--- a/maps/BattleTowerHallway.asm
+++ b/maps/BattleTowerHallway.asm
@@ -6,8 +6,8 @@ BattleTowerHallway_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
diff --git a/maps/BattleTowerOutside.asm b/maps/BattleTowerOutside.asm
index eab3a5bba..6c04dffe4 100644
--- a/maps/BattleTowerOutside.asm
+++ b/maps/BattleTowerOutside.asm
@@ -12,8 +12,8 @@ BattleTowerOutside_MapScriptHeader:
db 2
; callbacks
- dbw 1, .Callback1
- dbw 2, .Callback2
+ dbw MAPCALLBACK_TILES, .Callback1
+ dbw MAPCALLBACK_OBJECTS, .Callback2
.Callback1
return
diff --git a/maps/BlackthornCity.asm b/maps/BlackthornCity.asm
index e4595c181..ea322d168 100644
--- a/maps/BlackthornCity.asm
+++ b/maps/BlackthornCity.asm
@@ -17,8 +17,8 @@ BlackthornCity_MapScriptHeader:
db 2
; callbacks
- dbw 5, .FlyPoint
- dbw 2, .Santos
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
+ dbw MAPCALLBACK_OBJECTS, .Santos
.FlyPoint
setflag ENGINE_FLYPOINT_BLACKTHORN
diff --git a/maps/BlackthornGym1F.asm b/maps/BlackthornGym1F.asm
index f51805859..7f5b88c4a 100644
--- a/maps/BlackthornGym1F.asm
+++ b/maps/BlackthornGym1F.asm
@@ -13,7 +13,7 @@ BlackthornGym1F_MapScriptHeader:
db 1
; callbacks
- dbw 1, .Boulders
+ dbw MAPCALLBACK_TILES, .Boulders
.Boulders
checkevent EVENT_BOULDER_IN_BLACKTHORN_GYM_1
diff --git a/maps/BlackthornGym2F.asm b/maps/BlackthornGym2F.asm
index 7d3176c31..d77464877 100644
--- a/maps/BlackthornGym2F.asm
+++ b/maps/BlackthornGym2F.asm
@@ -16,14 +16,14 @@ BlackthornGym2F_MapScriptHeader:
db 1
; callbacks
- dbw 3, .Boulders
+ dbw MAPCALLBACK_CMDQUEUE, .Boulders
.Boulders
writecmdqueue .BoulderCmdQueue
return
.BoulderCmdQueue
- dbw 2, .BoulderTable ; check if any stones are sitting on a warp
+ dbw MAPCALLBACK_OBJECTS, .BoulderTable ; check if any stones are sitting on a warp
db 0, 0 ; filler
.BoulderTable
diff --git a/maps/BrunosRoom.asm b/maps/BrunosRoom.asm
index 6fe8772ff..4833a18d5 100644
--- a/maps/BrunosRoom.asm
+++ b/maps/BrunosRoom.asm
@@ -6,32 +6,32 @@ BrunosRoom_MapScriptHeader:
db 2
; triggers
- dw UnknownScript_0x180993, 0
- dw UnknownScript_0x180997, 0
+ dw .Trigger0, 0
+ dw .Trigger1, 0
.MapCallbacks:
db 1
; callbacks
- dbw 1, UnknownScript_0x180998
+ dbw MAPCALLBACK_TILES, .BrunosRoomDoors
-UnknownScript_0x180993:
+.Trigger0
priorityjump UnknownScript_0x1809ad
end
-UnknownScript_0x180997:
+.Trigger1
end
-UnknownScript_0x180998:
+.BrunosRoomDoors:
checkevent EVENT_BRUNOS_ROOM_ENTRANCE_CLOSED
- iffalse UnknownScript_0x1809a2
+ iffalse .KeepDoorClosed
changeblock $4, $e, $2a
-UnknownScript_0x1809a2:
+.KeepDoorClosed
checkevent EVENT_BRUNOS_ROOM_EXIT_OPEN
- iffalse UnknownScript_0x1809ac
+ iffalse .OpenDoor
changeblock $4, $2, $16
-UnknownScript_0x1809ac:
+.OpenDoor
return
UnknownScript_0x1809ad:
diff --git a/maps/BurnedTower1F.asm b/maps/BurnedTower1F.asm
index 3adb8f2de..e892bb68c 100644
--- a/maps/BurnedTower1F.asm
+++ b/maps/BurnedTower1F.asm
@@ -10,16 +10,16 @@ BurnedTower1F_MapScriptHeader:
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 1
; callbacks
- dbw 1, .HoleAndLadder
+ dbw MAPCALLBACK_TILES, .HoleAndLadder
.Trigger0:
priorityjump .EusineTrigger
diff --git a/maps/BurnedTowerB1F.asm b/maps/BurnedTowerB1F.asm
index 623f38dcb..3ab89533c 100644
--- a/maps/BurnedTowerB1F.asm
+++ b/maps/BurnedTowerB1F.asm
@@ -22,7 +22,7 @@ BurnedTowerB1F_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x186160
+ dbw MAPCALLBACK_TILES, UnknownScript_0x186160
UnknownScript_0x18615e:
end
diff --git a/maps/CeladonCity.asm b/maps/CeladonCity.asm
index 0dde68efd..fc521d650 100644
--- a/maps/CeladonCity.asm
+++ b/maps/CeladonCity.asm
@@ -17,7 +17,7 @@ CeladonCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_CELADON
diff --git a/maps/CeladonDeptStore6F.asm b/maps/CeladonDeptStore6F.asm
index 3abeda346..a673a2e11 100644
--- a/maps/CeladonDeptStore6F.asm
+++ b/maps/CeladonDeptStore6F.asm
@@ -11,7 +11,7 @@ CeladonDeptStore6F_MapScriptHeader:
; callbacks
- dbw 1, .Callback
+ dbw MAPCALLBACK_TILES, .Callback
.Callback:
changeblock $c, $0, $3
diff --git a/maps/CeruleanCity.asm b/maps/CeruleanCity.asm
index b841f3f78..6d2720cbc 100644
--- a/maps/CeruleanCity.asm
+++ b/maps/CeruleanCity.asm
@@ -14,7 +14,7 @@ CeruleanCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_CERULEAN
diff --git a/maps/CherrygroveCity.asm b/maps/CherrygroveCity.asm
index e3dc14c0a..c123b74bf 100644
--- a/maps/CherrygroveCity.asm
+++ b/maps/CherrygroveCity.asm
@@ -10,14 +10,14 @@ CherrygroveCity_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.Trigger0
end
diff --git a/maps/CianwoodCity.asm b/maps/CianwoodCity.asm
index c05109db4..657e30bc7 100644
--- a/maps/CianwoodCity.asm
+++ b/maps/CianwoodCity.asm
@@ -17,14 +17,14 @@ CianwoodCity_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 5, .FlyPointAndSuicune
+ dbw MAPCALLBACK_NEWMAP, .FlyPointAndSuicune
.Trigger0
end
diff --git a/maps/CinnabarIsland.asm b/maps/CinnabarIsland.asm
index 6823bc8a7..cc73856d2 100644
--- a/maps/CinnabarIsland.asm
+++ b/maps/CinnabarIsland.asm
@@ -9,7 +9,7 @@ CinnabarIsland_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_CINNABAR
diff --git a/maps/Colosseum.asm b/maps/Colosseum.asm
index b4383ac75..25794f5c0 100644
--- a/maps/Colosseum.asm
+++ b/maps/Colosseum.asm
@@ -7,18 +7,18 @@ Colosseum_MapScriptHeader:
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 2
; callbacks
- dbw 2, ColosseumScript_SetWhichChris
+ dbw MAPCALLBACK_OBJECTS, ColosseumScript_SetWhichChris
- dbw 5, ColosseumScript_InitializeCB
+ dbw MAPCALLBACK_NEWMAP, ColosseumScript_InitializeCB
.Trigger0:
priorityjump ColosseumScript_Initialize
diff --git a/maps/CopycatsHouse2F.asm b/maps/CopycatsHouse2F.asm
index b25ba93be..aabfc0eb3 100644
--- a/maps/CopycatsHouse2F.asm
+++ b/maps/CopycatsHouse2F.asm
@@ -15,7 +15,7 @@ CopycatsHouse2F_MapScriptHeader:
; callbacks
- dbw 2, CopycatsHouse2FCallback
+ dbw MAPCALLBACK_OBJECTS, CopycatsHouse2FCallback
CopycatsHouse2FCallback:
checkflag ENGINE_PLAYER_IS_FEMALE
diff --git a/maps/DayCare.asm b/maps/DayCare.asm
index d6fbd8853..1eb84e034 100644
--- a/maps/DayCare.asm
+++ b/maps/DayCare.asm
@@ -11,7 +11,7 @@ DayCare_MapScriptHeader:
; callbacks
- dbw 2, .EggCheckCallback
+ dbw MAPCALLBACK_OBJECTS, .EggCheckCallback
.EggCheckCallback:
checkflag ENGINE_DAYCARE_MAN_HAS_EGG
diff --git a/maps/DragonShrine.asm b/maps/DragonShrine.asm
index 942920874..a2fa23b7b 100644
--- a/maps/DragonShrine.asm
+++ b/maps/DragonShrine.asm
@@ -9,8 +9,8 @@ DragonShrine_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
diff --git a/maps/DragonsDenB1F.asm b/maps/DragonsDenB1F.asm
index 5497bc90c..c6b94ca74 100644
--- a/maps/DragonsDenB1F.asm
+++ b/maps/DragonsDenB1F.asm
@@ -14,15 +14,15 @@ DragonsDenB1F_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 5, .CheckSilver
+ dbw MAPCALLBACK_NEWMAP, .CheckSilver
.Trigger0:
end
diff --git a/maps/EcruteakCity.asm b/maps/EcruteakCity.asm
index 0b5fd1192..b0b3c8ab8 100644
--- a/maps/EcruteakCity.asm
+++ b/maps/EcruteakCity.asm
@@ -15,7 +15,7 @@ EcruteakCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_ECRUTEAK
diff --git a/maps/EcruteakHouse.asm b/maps/EcruteakHouse.asm
index e8de95bc7..a11746e9a 100644
--- a/maps/EcruteakHouse.asm
+++ b/maps/EcruteakHouse.asm
@@ -9,15 +9,15 @@ EcruteakHouse_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 2, .InitializeSages
+ dbw MAPCALLBACK_OBJECTS, .InitializeSages
.Trigger0:
end
diff --git a/maps/ElmsLab.asm b/maps/ElmsLab.asm
index f24586f31..4dbffe754 100644
--- a/maps/ElmsLab.asm
+++ b/maps/ElmsLab.asm
@@ -11,19 +11,19 @@ ElmsLab_MapScriptHeader:
db 6
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
- dw .Trigger3, 0
- dw .Trigger4, 0
- dw .Trigger5, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
+ maptrigger .Trigger3
+ maptrigger .Trigger4
+ maptrigger .Trigger5
.MapCallbacks:
db 1
; callbacks
- dbw 2, .Callback_MoveElm
+ dbw MAPCALLBACK_OBJECTS, .Callback_MoveElm
.Trigger0:
priorityjump ElmsLab_AutowalkUpToElm
diff --git a/maps/FastShip1F.asm b/maps/FastShip1F.asm
index 40335d6df..dddc192cd 100644
--- a/maps/FastShip1F.asm
+++ b/maps/FastShip1F.asm
@@ -9,9 +9,9 @@ FastShip1F_MapScriptHeader:
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 0
diff --git a/maps/FuchsiaCity.asm b/maps/FuchsiaCity.asm
index 50f7664fd..898fd20a0 100644
--- a/maps/FuchsiaCity.asm
+++ b/maps/FuchsiaCity.asm
@@ -12,7 +12,7 @@ FuchsiaCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_FUCHSIA
diff --git a/maps/GoldenrodCity.asm b/maps/GoldenrodCity.asm
index e50f6e223..598e7405f 100644
--- a/maps/GoldenrodCity.asm
+++ b/maps/GoldenrodCity.asm
@@ -23,8 +23,8 @@ GoldenrodCity_MapScriptHeader:
db 2
; callbacks
- dbw 5, .FlyPointAndFloria
- dbw 2, .MoveTutor
+ dbw MAPCALLBACK_NEWMAP, .FlyPointAndFloria
+ dbw MAPCALLBACK_OBJECTS, .MoveTutor
.FlyPointAndFloria
setflag ENGINE_FLYPOINT_GOLDENROD
diff --git a/maps/GoldenrodDeptStore5F.asm b/maps/GoldenrodDeptStore5F.asm
index 72d299472..32a6691fe 100644
--- a/maps/GoldenrodDeptStore5F.asm
+++ b/maps/GoldenrodDeptStore5F.asm
@@ -15,7 +15,7 @@ GoldenrodDeptStore5F_MapScriptHeader:
; callbacks
- dbw 2, .CheckIfSunday
+ dbw MAPCALLBACK_OBJECTS, .CheckIfSunday
.CheckIfSunday:
checkcode VAR_WEEKDAY
diff --git a/maps/GoldenrodDeptStoreB1F.asm b/maps/GoldenrodDeptStoreB1F.asm
index 3fd4b6e97..e8489bbb5 100644
--- a/maps/GoldenrodDeptStoreB1F.asm
+++ b/maps/GoldenrodDeptStoreB1F.asm
@@ -17,9 +17,9 @@ GoldenrodDeptStoreB1F_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x7d781
+ dbw MAPCALLBACK_TILES, UnknownScript_0x7d781
- dbw 5, UnknownScript_0x7d7ac
+ dbw MAPCALLBACK_NEWMAP, UnknownScript_0x7d7ac
UnknownScript_0x7d781:
checkevent EVENT_RECEIVED_CARD_KEY
diff --git a/maps/GoldenrodDeptStoreRoof.asm b/maps/GoldenrodDeptStoreRoof.asm
index 6a95af206..34829c3fa 100644
--- a/maps/GoldenrodDeptStoreRoof.asm
+++ b/maps/GoldenrodDeptStoreRoof.asm
@@ -17,9 +17,9 @@ GoldenrodDeptStoreRoof_MapScriptHeader:
; callbacks
- dbw 1, .CheckSaleChangeBlock
+ dbw MAPCALLBACK_TILES, .CheckSaleChangeBlock
- dbw 2, .CheckSaleChangeClerk
+ dbw MAPCALLBACK_OBJECTS, .CheckSaleChangeClerk
.CheckSaleChangeBlock:
checkflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
diff --git a/maps/GoldenrodGameCorner.asm b/maps/GoldenrodGameCorner.asm
index d1fa4bc43..ec85ea6eb 100644
--- a/maps/GoldenrodGameCorner.asm
+++ b/maps/GoldenrodGameCorner.asm
@@ -21,7 +21,7 @@ GoldenrodGameCorner_MapScriptHeader:
; callbacks
- dbw 2, .Callback
+ dbw MAPCALLBACK_OBJECTS, .Callback
.Callback
checkevent EVENT_BEAT_ELITE_FOUR
diff --git a/maps/GoldenrodMagnetTrainStation.asm b/maps/GoldenrodMagnetTrainStation.asm
index a8276d1cf..44b6d6247 100644
--- a/maps/GoldenrodMagnetTrainStation.asm
+++ b/maps/GoldenrodMagnetTrainStation.asm
@@ -7,7 +7,7 @@ GoldenrodMagnetTrainStation_MapScriptHeader:
db 1
; triggers
- dw .Trigger0, 0
+ maptrigger .Trigger0
.MapCallbacks:
db 0
diff --git a/maps/HallOfFame.asm b/maps/HallOfFame.asm
index c8ee751a1..d0f59a861 100644
--- a/maps/HallOfFame.asm
+++ b/maps/HallOfFame.asm
@@ -6,8 +6,8 @@ HallOfFame_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
diff --git a/maps/IcePathB1F.asm b/maps/IcePathB1F.asm
index 510e4e458..9e9390f67 100644
--- a/maps/IcePathB1F.asm
+++ b/maps/IcePathB1F.asm
@@ -14,14 +14,14 @@ IcePathB1F_MapScriptHeader:
; callbacks
- dbw 3, .SetUpStoneTable
+ dbw MAPCALLBACK_CMDQUEUE, .SetUpStoneTable
.SetUpStoneTable:
writecmdqueue .CommandQueue
return
.CommandQueue:
- dbw 2, .StoneTable ; check if any stones are sitting on a warp
+ dbw MAPCALLBACK_OBJECTS, .StoneTable ; check if any stones are sitting on a warp
db 0, 0 ; filler
.StoneTable:
diff --git a/maps/IlexForest.asm b/maps/IlexForest.asm
index 5e6ad9f2e..c3dba4ac7 100644
--- a/maps/IlexForest.asm
+++ b/maps/IlexForest.asm
@@ -20,7 +20,7 @@ IlexForest_MapScriptHeader:
; callbacks
- dbw 2, .FarfetchdCallback
+ dbw MAPCALLBACK_OBJECTS, .FarfetchdCallback
.FarfetchdCallback:
checkevent EVENT_GOT_HM01_CUT
diff --git a/maps/IndigoPlateauPokeCenter1F.asm b/maps/IndigoPlateauPokeCenter1F.asm
index 620008472..49678a955 100644
--- a/maps/IndigoPlateauPokeCenter1F.asm
+++ b/maps/IndigoPlateauPokeCenter1F.asm
@@ -18,7 +18,7 @@ IndigoPlateauPokeCenter1F_MapScriptHeader:
; callbacks
- dbw 5, UnknownScript_0x18000a
+ dbw MAPCALLBACK_NEWMAP, UnknownScript_0x18000a
UnknownScript_0x180009:
end
diff --git a/maps/KarensRoom.asm b/maps/KarensRoom.asm
index 035346da9..c1e8a93cf 100644
--- a/maps/KarensRoom.asm
+++ b/maps/KarensRoom.asm
@@ -14,7 +14,7 @@ KarensRoom_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x180bc1
+ dbw MAPCALLBACK_TILES, UnknownScript_0x180bc1
UnknownScript_0x180bbc:
priorityjump UnknownScript_0x180bd6
diff --git a/maps/KogasRoom.asm b/maps/KogasRoom.asm
index 47ab0ba7c..2ed66f1bd 100644
--- a/maps/KogasRoom.asm
+++ b/maps/KogasRoom.asm
@@ -14,7 +14,7 @@ KogasRoom_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x18072d
+ dbw MAPCALLBACK_TILES, UnknownScript_0x18072d
UnknownScript_0x180728:
priorityjump UnknownScript_0x180742
diff --git a/maps/KrissHouse2F.asm b/maps/KrissHouse2F.asm
index c6dc28738..a66ed5948 100644
--- a/maps/KrissHouse2F.asm
+++ b/maps/KrissHouse2F.asm
@@ -13,9 +13,9 @@ KrissHouse2F_MapScriptHeader:
; callbacks
- dbw 5, .InitializeRoom
+ dbw MAPCALLBACK_NEWMAP, .InitializeRoom
- dbw 1, .SetSpawn
+ dbw MAPCALLBACK_TILES, .SetSpawn
.Null:
end
diff --git a/maps/KurtsHouse.asm b/maps/KurtsHouse.asm
index e0f4555c9..f3dd687bd 100644
--- a/maps/KurtsHouse.asm
+++ b/maps/KurtsHouse.asm
@@ -14,7 +14,7 @@ KurtsHouse_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x18e154
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x18e154
UnknownScript_0x18e154:
checkevent EVENT_CLEARED_SLOWPOKE_WELL
diff --git a/maps/LakeofRage.asm b/maps/LakeofRage.asm
index 20f7c0997..1b44fc7eb 100644
--- a/maps/LakeofRage.asm
+++ b/maps/LakeofRage.asm
@@ -17,16 +17,16 @@ LakeofRage_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 2
; callbacks
- dbw 5, .FlyPoint
- dbw 2, .Wesley
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
+ dbw MAPCALLBACK_OBJECTS, .Wesley
.Trigger0
end
diff --git a/maps/LancesRoom.asm b/maps/LancesRoom.asm
index db050db6d..6188ac56d 100644
--- a/maps/LancesRoom.asm
+++ b/maps/LancesRoom.asm
@@ -16,7 +16,7 @@ LancesRoom_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x180e3e
+ dbw MAPCALLBACK_TILES, UnknownScript_0x180e3e
UnknownScript_0x180e39:
priorityjump UnknownScript_0x180e53
diff --git a/maps/LavenderTown.asm b/maps/LavenderTown.asm
index d10cce8d0..fe5e393bd 100644
--- a/maps/LavenderTown.asm
+++ b/maps/LavenderTown.asm
@@ -12,7 +12,7 @@ LavenderTown_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_LAVENDER
diff --git a/maps/MahoganyMart1F.asm b/maps/MahoganyMart1F.asm
index 3bb527c2c..77d5cdc85 100644
--- a/maps/MahoganyMart1F.asm
+++ b/maps/MahoganyMart1F.asm
@@ -18,7 +18,7 @@ MahoganyMart1F_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x6c35b
+ dbw MAPCALLBACK_TILES, UnknownScript_0x6c35b
UnknownScript_0x6c356:
end
diff --git a/maps/MahoganyTown.asm b/maps/MahoganyTown.asm
index 4eeafd92c..5b282e0b3 100644
--- a/maps/MahoganyTown.asm
+++ b/maps/MahoganyTown.asm
@@ -9,14 +9,14 @@ MahoganyTown_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.Trigger0
end
diff --git a/maps/MobileBattleRoom.asm b/maps/MobileBattleRoom.asm
index 05e4c4b1d..678531b26 100644
--- a/maps/MobileBattleRoom.asm
+++ b/maps/MobileBattleRoom.asm
@@ -4,8 +4,8 @@ MobileBattleRoom_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
diff --git a/maps/MobileTradeRoomMobile.asm b/maps/MobileTradeRoomMobile.asm
index e0eb4df2f..6a51ddbde 100644
--- a/maps/MobileTradeRoomMobile.asm
+++ b/maps/MobileTradeRoomMobile.asm
@@ -4,8 +4,8 @@ MobileTradeRoomMobile_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
diff --git a/maps/MountMoon.asm b/maps/MountMoon.asm
index 5c1fdb985..b2ce702bb 100644
--- a/maps/MountMoon.asm
+++ b/maps/MountMoon.asm
@@ -6,8 +6,8 @@ MountMoon_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
diff --git a/maps/MountMoonSquare.asm b/maps/MountMoonSquare.asm
index c897757cb..96a3c7c1c 100644
--- a/maps/MountMoonSquare.asm
+++ b/maps/MountMoonSquare.asm
@@ -15,9 +15,9 @@ MountMoonSquare_MapScriptHeader:
; callbacks
- dbw 5, UnknownScript_0x77093
+ dbw MAPCALLBACK_NEWMAP, UnknownScript_0x77093
- dbw 2, UnknownScript_0x77097
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x77097
UnknownScript_0x77092:
end
diff --git a/maps/MrPokemonsHouse.asm b/maps/MrPokemonsHouse.asm
index 227a334d9..5f1af90e7 100644
--- a/maps/MrPokemonsHouse.asm
+++ b/maps/MrPokemonsHouse.asm
@@ -3,105 +3,105 @@ const_value set 2
const MRPOKEMONSHOUSE_OAK
MrPokemonsHouse_MapScriptHeader:
-.MapTriggers:
+.MapTriggers
db 2
; triggers
- dw UnknownScript_0x196e51, 0
- dw UnknownScript_0x196e55, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
-.MapCallbacks:
+.MapCallbacks
db 0
-UnknownScript_0x196e51:
- priorityjump UnknownScript_0x196e56
+.Trigger0
+ priorityjump .MrPokemonEvent
end
-UnknownScript_0x196e55:
+.Trigger1
end
-UnknownScript_0x196e56:
+.MrPokemonEvent
showemote EMOTE_SHOCK, MRPOKEMONSHOUSE_GENTLEMAN, 15
spriteface MRPOKEMONSHOUSE_GENTLEMAN, DOWN
opentext
- writetext UnknownText_0x196f66
+ writetext MrPokemonIntroText1
waitbutton
closetext
- applymovement PLAYER, MovementData_0x196f5a
+ applymovement PLAYER, MrPokemonsHouse_PlayerWalksToMrPokemon
opentext
- writetext UnknownText_0x196fa8
+ writetext MrPokemonIntroText2
buttonsound
waitsfx
giveitem MYSTERY_EGG
- writetext UnknownText_0x196fd2
+ writetext MrPokemonsHouse_GotEggText
playsound SFX_KEY_ITEM
waitsfx
itemnotify
setevent EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON
blackoutmod CHERRYGROVE_CITY
- writetext UnknownText_0x196feb
+ writetext MrPokemonIntroText3
buttonsound
spriteface MRPOKEMONSHOUSE_GENTLEMAN, RIGHT
- writetext UnknownText_0x197092
+ writetext MrPokemonIntroText4
buttonsound
spriteface MRPOKEMONSHOUSE_GENTLEMAN, DOWN
spriteface MRPOKEMONSHOUSE_OAK, LEFT
- writetext UnknownText_0x1970b7
+ writetext MrPokemonIntroText5
waitbutton
closetext
- jump UnknownScript_0x196ec9
+ jump MrPokemonsHouse_OakScript
-GentlemanScript_0x196e97:
+MrPokemonsHouse_MrPokemonScript:
faceplayer
opentext
checkitem RED_SCALE
- iftrue UnknownScript_0x196eb0
+ iftrue .RedScale
checkevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
- iftrue UnknownScript_0x196eaa
- writetext UnknownText_0x197134
+ iftrue .AlwaysNewDiscoveries
+ writetext MrPokemonText_ImDependingOnYou
waitbutton
closetext
end
-UnknownScript_0x196eaa:
- writetext UnknownText_0x19714a
+.AlwaysNewDiscoveries
+ writetext MrPokemonText_AlwaysNewDiscoveries
waitbutton
closetext
end
-UnknownScript_0x196eb0:
- writetext UnknownText_0x197476
+.RedScale
+ writetext MrPokemonText_GimmeTheScale
yesorno
- iffalse UnknownScript_0x196ec3
+ iffalse .refused
verbosegiveitem EXP_SHARE
- iffalse UnknownScript_0x196ec7
+ iffalse .full
takeitem RED_SCALE
- jump UnknownScript_0x196eaa
+ jump .AlwaysNewDiscoveries
-UnknownScript_0x196ec3:
- writetext UnknownText_0x19750d
+.refused
+ writetext MrPokemonText_Disappointed
waitbutton
-UnknownScript_0x196ec7:
+.full
closetext
end
-UnknownScript_0x196ec9:
+MrPokemonsHouse_OakScript:
playmusic MUSIC_PROF_OAK
- applymovement MRPOKEMONSHOUSE_OAK, MovementData_0x196f5d
+ applymovement MRPOKEMONSHOUSE_OAK, MrPokemonsHouse_OakWalksToPlayer
spriteface PLAYER, RIGHT
opentext
- writetext UnknownText_0x197185
+ writetext MrPokemonsHouse_OakText1
buttonsound
waitsfx
- writetext UnknownText_0x1973cc
+ writetext MrPokemonsHouse_GetDexText
playsound SFX_ITEM
waitsfx
setflag ENGINE_POKEDEX
- writetext UnknownText_0x1973de
+ writetext MrPokemonsHouse_OakText2
waitbutton
closetext
spriteface PLAYER, DOWN
- applymovement MRPOKEMONSHOUSE_OAK, MovementData_0x196f61
+ applymovement MRPOKEMONSHOUSE_OAK, MrPokemonsHouse_OakExits
playsound SFX_EXIT_BUILDING
disappear MRPOKEMONSHOUSE_OAK
waitsfx
@@ -109,7 +109,7 @@ UnknownScript_0x196ec9:
pause 15
spriteface PLAYER, UP
opentext
- writetext UnknownText_0x1970ed
+ writetext MrPokemonsHouse_MrPokemonHealText
waitbutton
closetext
special Special_FadeBlackQuickly
@@ -121,7 +121,7 @@ UnknownScript_0x196ec9:
special Special_FadeInQuickly
special RestartMapMusic
opentext
- writetext UnknownText_0x197134
+ writetext MrPokemonText_ImDependingOnYou
waitbutton
closetext
setevent EVENT_RIVAL_NEW_BARK_TOWN
@@ -133,48 +133,48 @@ UnknownScript_0x196ec9:
specialphonecall SPECIALCALL_ROBBED
clearevent EVENT_COP_IN_ELMS_LAB
checkevent EVENT_GOT_TOTODILE_FROM_ELM
- iftrue UnknownScript_0x196f49
+ iftrue .RivalTakesChikorita
checkevent EVENT_GOT_CHIKORITA_FROM_ELM
- iftrue UnknownScript_0x196f4d
+ iftrue .RivalTakesCyndaquil
setevent EVENT_TOTODILE_POKEBALL_IN_ELMS_LAB
end
-UnknownScript_0x196f49:
+.RivalTakesChikorita
setevent EVENT_CHIKORITA_POKEBALL_IN_ELMS_LAB
end
-UnknownScript_0x196f4d:
+.RivalTakesCyndaquil
setevent EVENT_CYNDAQUIL_POKEBALL_IN_ELMS_LAB
end
MapMrPokemonsHouseSignpost1Script:
- jumptext UnknownText_0x197543
+ jumptext MrPokemonsHouse_ForeignMagazinesText
MapMrPokemonsHouseSignpost3Script:
- jumptext UnknownText_0x197584
+ jumptext MrPokemonsHouse_BrokenComputerText
MapMrPokemonsHouseSignpost4Script:
- jumptext UnknownText_0x1975ac
+ jumptext MrPokemonsHouse_StrangeCoinsText
-MovementData_0x196f5a:
+MrPokemonsHouse_PlayerWalksToMrPokemon:
step_right
step_up
step_end
-MovementData_0x196f5d:
+MrPokemonsHouse_OakWalksToPlayer:
step_down
step_left
step_left
step_end
-MovementData_0x196f61:
+MrPokemonsHouse_OakExits:
step_down
step_left
turn_head_down
db $3f ; movement
step_end
-UnknownText_0x196f66:
+MrPokemonIntroText1:
text "Hello, hello! You"
line "must be <PLAY_G>."
@@ -182,18 +182,18 @@ UnknownText_0x196f66:
line "you would visit."
done
-UnknownText_0x196fa8:
+MrPokemonIntroText2:
text "This is what I"
line "want PROF.ELM to"
cont "examine."
done
-UnknownText_0x196fd2:
+MrPokemonsHouse_GotEggText:
text "<PLAYER> received"
line "MYSTERY EGG."
done
-UnknownText_0x196feb:
+MrPokemonIntroText3:
text "I know a couple"
line "who run a #MON"
cont "DAY-CARE service."
@@ -210,18 +210,18 @@ UnknownText_0x196feb:
cont "the authority."
done
-UnknownText_0x197092:
+MrPokemonIntroText4:
text "Even PROF.OAK here"
line "recognizes that."
done
-UnknownText_0x1970b7:
+MrPokemonIntroText5:
text "If my assumption"
line "is correct, PROF."
cont "ELM will know it."
done
-UnknownText_0x1970ed:
+MrPokemonsHouse_MrPokemonHealText:
text "You are returning"
line "to PROF.ELM?"
@@ -230,12 +230,12 @@ UnknownText_0x1970ed:
cont "rest."
done
-UnknownText_0x197134:
+MrPokemonText_ImDependingOnYou:
text "I'm depending on"
line "you!"
done
-UnknownText_0x19714a:
+MrPokemonText_AlwaysNewDiscoveries:
text "Life is delight-"
line "ful! Always, new"
@@ -243,7 +243,7 @@ UnknownText_0x19714a:
line "made!"
done
-UnknownText_0x197185:
+MrPokemonsHouse_OakText1:
text "OAK: Aha! So"
line "you're <PLAY_G>!"
@@ -307,12 +307,12 @@ UnknownText_0x197185:
line "encyclopedia!"
done
-UnknownText_0x1973cc:
+MrPokemonsHouse_GetDexText:
text "<PLAYER> received"
line "#DEX!"
done
-UnknownText_0x1973de:
+MrPokemonsHouse_OakText2:
text "Go meet many kinds"
line "of #MON and"
@@ -330,7 +330,7 @@ UnknownText_0x1973de:
line "counting on you!"
done
-UnknownText_0x197476:
+MrPokemonText_GimmeTheScale:
text "Hm? That SCALE!"
line "What's that?"
cont "A red GYARADOS?"
@@ -346,13 +346,13 @@ UnknownText_0x197476:
cont "from PROF.OAK."
done
-UnknownText_0x19750d:
+MrPokemonText_Disappointed:
text "That's disappoint-"
line "ing. That happens"
cont "to be very rare."
done
-UnknownText_0x197543:
+MrPokemonsHouse_ForeignMagazinesText:
text "It's packed with"
line "foreign magazines."
@@ -360,13 +360,13 @@ UnknownText_0x197543:
line "their titles…"
done
-UnknownText_0x197584:
+MrPokemonsHouse_BrokenComputerText:
text "It's a big com-"
line "puter. Hmm. It's"
cont "broken."
done
-UnknownText_0x1975ac:
+MrPokemonsHouse_StrangeCoinsText:
text "A whole pile of"
line "strange coins!"
@@ -396,5 +396,5 @@ MrPokemonsHouse_MapEventHeader:
.PersonEvents:
db 2
- person_event SPRITE_GENTLEMAN, 5, 3, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, GentlemanScript_0x196e97, -1
+ person_event SPRITE_GENTLEMAN, 5, 3, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, MrPokemonsHouse_MrPokemonScript, -1
person_event SPRITE_OAK, 5, 6, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_MR_POKEMONS_HOUSE_OAK
diff --git a/maps/NewBarkTown.asm b/maps/NewBarkTown.asm
index cf25d1a18..e2d7155f7 100644
--- a/maps/NewBarkTown.asm
+++ b/maps/NewBarkTown.asm
@@ -8,14 +8,14 @@ NewBarkTown_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.Trigger0
end
diff --git a/maps/OlivineCity.asm b/maps/OlivineCity.asm
index 09c4a26c7..03ca03fbe 100644
--- a/maps/OlivineCity.asm
+++ b/maps/OlivineCity.asm
@@ -9,14 +9,14 @@ OlivineCity_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.Trigger0
end
diff --git a/maps/PalletTown.asm b/maps/PalletTown.asm
index 3b63dada5..900a4bf20 100644
--- a/maps/PalletTown.asm
+++ b/maps/PalletTown.asm
@@ -10,7 +10,7 @@ PalletTown_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_PALLET
diff --git a/maps/PewterCity.asm b/maps/PewterCity.asm
index 5baaf418d..9d60b3a2e 100644
--- a/maps/PewterCity.asm
+++ b/maps/PewterCity.asm
@@ -13,7 +13,7 @@ PewterCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_PEWTER
diff --git a/maps/PokeCenter2F.asm b/maps/PokeCenter2F.asm
index c285fc8c2..7989143c3 100644
--- a/maps/PokeCenter2F.asm
+++ b/maps/PokeCenter2F.asm
@@ -9,12 +9,12 @@ PokeCenter2F_MapScriptHeader:
db 6
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
- dw .Trigger3, 0
- dw .Trigger4, 0
- dw .Trigger5, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
+ maptrigger .Trigger3
+ maptrigger .Trigger4
+ maptrigger .Trigger5
.MapCallbacks:
db 0
diff --git a/maps/RadioTower3F.asm b/maps/RadioTower3F.asm
index d848ddd09..13c953d8d 100644
--- a/maps/RadioTower3F.asm
+++ b/maps/RadioTower3F.asm
@@ -16,7 +16,7 @@ RadioTower3F_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x5e543
+ dbw MAPCALLBACK_TILES, UnknownScript_0x5e543
UnknownScript_0x5e543:
checkevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
diff --git a/maps/RadioTower5F.asm b/maps/RadioTower5F.asm
index eee02b34c..16447b2a6 100644
--- a/maps/RadioTower5F.asm
+++ b/maps/RadioTower5F.asm
@@ -10,9 +10,9 @@ RadioTower5F_MapScriptHeader:
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 0
diff --git a/maps/Route16.asm b/maps/Route16.asm
index d5c1454d0..46b49f3be 100644
--- a/maps/Route16.asm
+++ b/maps/Route16.asm
@@ -8,7 +8,7 @@ Route16_MapScriptHeader:
; callbacks
- dbw 5, UnknownScript_0x1ad318
+ dbw MAPCALLBACK_NEWMAP, UnknownScript_0x1ad318
UnknownScript_0x1ad318:
checkcode VAR_YCOORD
diff --git a/maps/Route17.asm b/maps/Route17.asm
index 1520d3eeb..7969259cc 100644
--- a/maps/Route17.asm
+++ b/maps/Route17.asm
@@ -13,7 +13,7 @@ Route17_MapScriptHeader:
; callbacks
- dbw 5, UnknownScript_0x1ad0ab
+ dbw MAPCALLBACK_NEWMAP, UnknownScript_0x1ad0ab
UnknownScript_0x1ad0ab:
setflag ENGINE_ALWAYS_ON_BIKE
diff --git a/maps/Route19.asm b/maps/Route19.asm
index bf1fc5dcb..7bbec34e3 100644
--- a/maps/Route19.asm
+++ b/maps/Route19.asm
@@ -15,7 +15,7 @@ Route19_MapScriptHeader:
; callbacks
- dbw 1, .ClearRocks
+ dbw MAPCALLBACK_TILES, .ClearRocks
.ClearRocks
checkevent EVENT_CINNABAR_ROCKS_CLEARED
diff --git a/maps/Route20.asm b/maps/Route20.asm
index 69cfea8eb..309713b57 100644
--- a/maps/Route20.asm
+++ b/maps/Route20.asm
@@ -12,7 +12,7 @@ Route20_MapScriptHeader:
; callbacks
- dbw 5, .ClearRocks
+ dbw MAPCALLBACK_NEWMAP, .ClearRocks
.ClearRocks
setevent EVENT_CINNABAR_ROCKS_CLEARED
diff --git a/maps/Route23.asm b/maps/Route23.asm
index 8f4fc6a56..07362658d 100644
--- a/maps/Route23.asm
+++ b/maps/Route23.asm
@@ -7,7 +7,7 @@ Route23_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_INDIGO_PLATEAU
diff --git a/maps/Route29.asm b/maps/Route29.asm
index cdd5fc426..0d4a5c2ab 100644
--- a/maps/Route29.asm
+++ b/maps/Route29.asm
@@ -13,15 +13,15 @@ Route29_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 2, .Tuscany
+ dbw MAPCALLBACK_OBJECTS, .Tuscany
.Trigger0:
end
diff --git a/maps/Route31.asm b/maps/Route31.asm
index 3309e292a..a9f9591de 100644
--- a/maps/Route31.asm
+++ b/maps/Route31.asm
@@ -16,7 +16,7 @@ Route31_MapScriptHeader:
; callbacks
- dbw 5, .CheckMomCall
+ dbw MAPCALLBACK_NEWMAP, .CheckMomCall
.CheckMomCall:
checkevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
diff --git a/maps/Route32.asm b/maps/Route32.asm
index 63f29e81c..48011ae9d 100644
--- a/maps/Route32.asm
+++ b/maps/Route32.asm
@@ -19,16 +19,16 @@ Route32_MapScriptHeader:
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 1
; callbacks
- dbw 2, .Frieda
+ dbw MAPCALLBACK_OBJECTS, .Frieda
.Trigger0:
end
diff --git a/maps/Route34.asm b/maps/Route34.asm
index d17dea61c..39304cc56 100644
--- a/maps/Route34.asm
+++ b/maps/Route34.asm
@@ -22,7 +22,7 @@ Route34_MapScriptHeader:
; callbacks
- dbw 2, .EggCheckCallback
+ dbw MAPCALLBACK_OBJECTS, .EggCheckCallback
.EggCheckCallback:
checkflag ENGINE_DAYCARE_MAN_HAS_EGG
diff --git a/maps/Route34IlexForestGate.asm b/maps/Route34IlexForestGate.asm
index ad3e5c5e0..4f66cb6ed 100644
--- a/maps/Route34IlexForestGate.asm
+++ b/maps/Route34IlexForestGate.asm
@@ -13,7 +13,7 @@ Route34IlexForestGate_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x62d2d
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x62d2d
UnknownScript_0x62d2d:
checkevent EVENT_FOREST_IS_RESTLESS
diff --git a/maps/Route35NationalParkgate.asm b/maps/Route35NationalParkgate.asm
index d0a770bbe..f20bf7be0 100644
--- a/maps/Route35NationalParkgate.asm
+++ b/maps/Route35NationalParkgate.asm
@@ -17,9 +17,9 @@ Route35NationalParkgate_MapScriptHeader:
; callbacks
- dbw 5, Route35NationalParkgate_CheckIfStillInContest
+ dbw MAPCALLBACK_NEWMAP, Route35NationalParkgate_CheckIfStillInContest
- dbw 2, Route35NationalParkgate_CheckIfContestDay
+ dbw MAPCALLBACK_OBJECTS, Route35NationalParkgate_CheckIfContestDay
Route35NationalParkgate_Trigger1:
end
diff --git a/maps/Route36.asm b/maps/Route36.asm
index 87e44c101..7e3af11d7 100644
--- a/maps/Route36.asm
+++ b/maps/Route36.asm
@@ -22,7 +22,7 @@ Route36_MapScriptHeader:
; callbacks
- dbw 2, ArthurCallback
+ dbw MAPCALLBACK_OBJECTS, ArthurCallback
UnknownScript_0x19400d:
end
diff --git a/maps/Route36NationalParkgate.asm b/maps/Route36NationalParkgate.asm
index 0a93c0d98..3c4527813 100644
--- a/maps/Route36NationalParkgate.asm
+++ b/maps/Route36NationalParkgate.asm
@@ -17,18 +17,18 @@ Route36NationalParkgate_MapScriptHeader:
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 2
; callbacks
- dbw 5, .CheckIfContestRunning
+ dbw MAPCALLBACK_NEWMAP, .CheckIfContestRunning
- dbw 2, .CheckIfContestAvailable
+ dbw MAPCALLBACK_OBJECTS, .CheckIfContestAvailable
.Trigger0:
end
diff --git a/maps/Route37.asm b/maps/Route37.asm
index 54081e849..58e730ac0 100644
--- a/maps/Route37.asm
+++ b/maps/Route37.asm
@@ -16,7 +16,7 @@ Route37_MapScriptHeader:
; callbacks
- dbw 2, SunnyCallback
+ dbw MAPCALLBACK_OBJECTS, SunnyCallback
SunnyCallback:
checkcode VAR_WEEKDAY
diff --git a/maps/Route40.asm b/maps/Route40.asm
index 65e040604..7ed17cdaf 100644
--- a/maps/Route40.asm
+++ b/maps/Route40.asm
@@ -21,7 +21,7 @@ Route40_MapScriptHeader:
; callbacks
- dbw 2, MonicaCallback
+ dbw MAPCALLBACK_OBJECTS, MonicaCallback
MonicaCallback:
clearevent EVENT_BATTLE_TOWER_OUTSIDE_SAILOR
diff --git a/maps/Route40BattleTowerGate.asm b/maps/Route40BattleTowerGate.asm
index ad98bb81e..4e6cfa8cb 100644
--- a/maps/Route40BattleTowerGate.asm
+++ b/maps/Route40BattleTowerGate.asm
@@ -11,7 +11,7 @@ Route40BattleTowerGate_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x9f665
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x9f665
UnknownScript_0x9f665:
clearevent EVENT_BATTLE_TOWER_OUTSIDE_SAILOR
diff --git a/maps/Route43.asm b/maps/Route43.asm
index ddc2bfa1c..5396f4545 100644
--- a/maps/Route43.asm
+++ b/maps/Route43.asm
@@ -17,7 +17,7 @@ Route43_MapScriptHeader:
; callbacks
- dbw 5, UnknownScript_0x19d051
+ dbw MAPCALLBACK_NEWMAP, UnknownScript_0x19d051
UnknownScript_0x19d051:
checkevent EVENT_CLEARED_ROCKET_HIDEOUT
diff --git a/maps/Route43Gate.asm b/maps/Route43Gate.asm
index 602f016ac..42801472b 100644
--- a/maps/Route43Gate.asm
+++ b/maps/Route43Gate.asm
@@ -16,7 +16,7 @@ Route43Gate_MapScriptHeader:
; callbacks
- dbw 5, UnknownScript_0x19abca
+ dbw MAPCALLBACK_NEWMAP, UnknownScript_0x19abca
UnknownScript_0x19abc5:
priorityjump UnknownScript_0x19abda
diff --git a/maps/RuinsofAlphAerodactylChamber.asm b/maps/RuinsofAlphAerodactylChamber.asm
index 31a5a373f..3550ee2a2 100644
--- a/maps/RuinsofAlphAerodactylChamber.asm
+++ b/maps/RuinsofAlphAerodactylChamber.asm
@@ -12,7 +12,7 @@ RuinsofAlphAerodactylChamber_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x58db9
+ dbw MAPCALLBACK_TILES, UnknownScript_0x58db9
UnknownScript_0x58dad:
checkevent EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
diff --git a/maps/RuinsofAlphHoOhChamber.asm b/maps/RuinsofAlphHoOhChamber.asm
index e27439fdc..1c3fff442 100644
--- a/maps/RuinsofAlphHoOhChamber.asm
+++ b/maps/RuinsofAlphHoOhChamber.asm
@@ -12,7 +12,7 @@ RuinsofAlphHoOhChamber_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x5857c
+ dbw MAPCALLBACK_TILES, UnknownScript_0x5857c
UnknownScript_0x5856d:
special SpecialHoOhChamber
diff --git a/maps/RuinsofAlphKabutoChamber.asm b/maps/RuinsofAlphKabutoChamber.asm
index c27f000c3..c46daa6f3 100644
--- a/maps/RuinsofAlphKabutoChamber.asm
+++ b/maps/RuinsofAlphKabutoChamber.asm
@@ -15,7 +15,7 @@ RuinsofAlphKabutoChamber_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x58737
+ dbw MAPCALLBACK_TILES, UnknownScript_0x58737
UnknownScript_0x5872b:
checkevent EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
diff --git a/maps/RuinsofAlphOmanyteChamber.asm b/maps/RuinsofAlphOmanyteChamber.asm
index 701eca02d..89e7deae2 100644
--- a/maps/RuinsofAlphOmanyteChamber.asm
+++ b/maps/RuinsofAlphOmanyteChamber.asm
@@ -12,7 +12,7 @@ RuinsofAlphOmanyteChamber_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x58bf8
+ dbw MAPCALLBACK_TILES, UnknownScript_0x58bf8
UnknownScript_0x58be9:
special SpecialOmanyteChamber
diff --git a/maps/RuinsofAlphOutside.asm b/maps/RuinsofAlphOutside.asm
index 6464b409e..e9d479850 100644
--- a/maps/RuinsofAlphOutside.asm
+++ b/maps/RuinsofAlphOutside.asm
@@ -18,7 +18,7 @@ RuinsofAlphOutside_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x5800f
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x5800f
UnknownScript_0x5800d:
end
diff --git a/maps/RuinsofAlphResearchCenter.asm b/maps/RuinsofAlphResearchCenter.asm
index 44e67ff83..988198340 100644
--- a/maps/RuinsofAlphResearchCenter.asm
+++ b/maps/RuinsofAlphResearchCenter.asm
@@ -16,7 +16,7 @@ RuinsofAlphResearchCenter_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x59185
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x59185
UnknownScript_0x59180:
end
diff --git a/maps/SaffronCity.asm b/maps/SaffronCity.asm
index c3bf50008..114e79ad7 100644
--- a/maps/SaffronCity.asm
+++ b/maps/SaffronCity.asm
@@ -16,7 +16,7 @@ SaffronCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_SAFFRON
diff --git a/maps/SaffronTrainStation.asm b/maps/SaffronTrainStation.asm
index cce353350..14e3722a8 100644
--- a/maps/SaffronTrainStation.asm
+++ b/maps/SaffronTrainStation.asm
@@ -9,7 +9,7 @@ SaffronTrainStation_MapScriptHeader:
db 1
; triggers
- dw .Trigger0, 0
+ maptrigger .Trigger0
.MapCallbacks:
db 0
diff --git a/maps/SilverCaveOutside.asm b/maps/SilverCaveOutside.asm
index 9e050cf72..1354eeeb7 100644
--- a/maps/SilverCaveOutside.asm
+++ b/maps/SilverCaveOutside.asm
@@ -7,7 +7,7 @@ SilverCaveOutside_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_SILVER_CAVE
diff --git a/maps/TeamRocketBaseB1F.asm b/maps/TeamRocketBaseB1F.asm
index de9012ab0..d535c925b 100644
--- a/maps/TeamRocketBaseB1F.asm
+++ b/maps/TeamRocketBaseB1F.asm
@@ -11,14 +11,14 @@ TeamRocketBaseB1F_MapScriptHeader:
db 1
; triggers
- dw .Trigger0, 0
+ maptrigger .Trigger0
.MapCallbacks:
db 1
; callbacks
- dbw 2, .Callback1
+ dbw MAPCALLBACK_OBJECTS, .Callback1
.Trigger0:
end
diff --git a/maps/TeamRocketBaseB2F.asm b/maps/TeamRocketBaseB2F.asm
index 3a675f92e..4df43d739 100644
--- a/maps/TeamRocketBaseB2F.asm
+++ b/maps/TeamRocketBaseB2F.asm
@@ -29,7 +29,7 @@ TeamRocketBaseB2F_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x6cf89
+ dbw MAPCALLBACK_TILES, UnknownScript_0x6cf89
UnknownScript_0x6cf85:
end
diff --git a/maps/TeamRocketBaseB3F.asm b/maps/TeamRocketBaseB3F.asm
index a55e2c125..e49a2b39a 100644
--- a/maps/TeamRocketBaseB3F.asm
+++ b/maps/TeamRocketBaseB3F.asm
@@ -19,17 +19,17 @@ TeamRocketBaseB3F_MapScriptHeader:
db 4
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
- dw .Trigger3, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
+ maptrigger .Trigger3
.MapCallbacks:
db 1
; callbacks
- dbw 1, .CheckGiovanniDoor
+ dbw MAPCALLBACK_TILES, .CheckGiovanniDoor
.Trigger0:
priorityjump LanceScript_0x6dffc
diff --git a/maps/TimeCapsule.asm b/maps/TimeCapsule.asm
index e543c352f..014e0d26b 100644
--- a/maps/TimeCapsule.asm
+++ b/maps/TimeCapsule.asm
@@ -7,15 +7,15 @@ TimeCapsule_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 2, TimeCapsule_SetWhichChris
+ dbw MAPCALLBACK_OBJECTS, TimeCapsule_SetWhichChris
.Trigger0:
priorityjump TimeCapsule_Initialize
diff --git a/maps/TinTower1F.asm b/maps/TinTower1F.asm
index b0164dc88..4d23f2ce1 100644
--- a/maps/TinTower1F.asm
+++ b/maps/TinTower1F.asm
@@ -23,9 +23,9 @@ TinTower1F_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x18502f
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x18502f
- dbw 1, UnknownScript_0x185084
+ dbw MAPCALLBACK_TILES, UnknownScript_0x185084
UnknownScript_0x18502a:
priorityjump UnknownScript_0x18508f
diff --git a/maps/TinTowerRoof.asm b/maps/TinTowerRoof.asm
index 61698aeae..bdfc8bb33 100644
--- a/maps/TinTowerRoof.asm
+++ b/maps/TinTowerRoof.asm
@@ -10,7 +10,7 @@ TinTowerRoof_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x77230
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x77230
UnknownScript_0x77230:
checkevent EVENT_FOUGHT_HO_OH
diff --git a/maps/TradeCenter.asm b/maps/TradeCenter.asm
index 3abad85e7..36f476de4 100644
--- a/maps/TradeCenter.asm
+++ b/maps/TradeCenter.asm
@@ -7,15 +7,15 @@ TradeCenter_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 2, TradeCenter_SetWhichChris
+ dbw MAPCALLBACK_OBJECTS, TradeCenter_SetWhichChris
.Trigger0:
priorityjump TradeCenter_Initialize
diff --git a/maps/UndergroundPathSwitchRoomEntrances.asm b/maps/UndergroundPathSwitchRoomEntrances.asm
index 20a2a338d..078242827 100644
--- a/maps/UndergroundPathSwitchRoomEntrances.asm
+++ b/maps/UndergroundPathSwitchRoomEntrances.asm
@@ -48,15 +48,15 @@ UndergroundPathSwitchRoomEntrances_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 1, .UpdateDoorPositions
+ dbw MAPCALLBACK_TILES, .UpdateDoorPositions
.Trigger0:
end
diff --git a/maps/UndergroundWarehouse.asm b/maps/UndergroundWarehouse.asm
index 84db4ed32..32454451c 100644
--- a/maps/UndergroundWarehouse.asm
+++ b/maps/UndergroundWarehouse.asm
@@ -16,7 +16,7 @@ UndergroundWarehouse_MapScriptHeader:
; callbacks
- dbw 5, .ResetSwitches
+ dbw MAPCALLBACK_NEWMAP, .ResetSwitches
.ResetSwitches:
clearevent EVENT_SWITCH_1
diff --git a/maps/UnionCaveB2F.asm b/maps/UnionCaveB2F.asm
index 0425c1d67..354771bb9 100644
--- a/maps/UnionCaveB2F.asm
+++ b/maps/UnionCaveB2F.asm
@@ -15,7 +15,7 @@ UnionCaveB2F_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x5a30d
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x5a30d
UnknownScript_0x5a30d:
checkflag ENGINE_UNION_CAVE_LAPRAS
diff --git a/maps/VermilionCity.asm b/maps/VermilionCity.asm
index 90b18c6b7..fb5e4e2e5 100644
--- a/maps/VermilionCity.asm
+++ b/maps/VermilionCity.asm
@@ -14,7 +14,7 @@ VermilionCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_VERMILION
diff --git a/maps/VermilionPort.asm b/maps/VermilionPort.asm
index 2e31531ce..d45df660b 100644
--- a/maps/VermilionPort.asm
+++ b/maps/VermilionPort.asm
@@ -8,14 +8,14 @@ VermilionPort_MapScriptHeader:
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.Trigger0
end
diff --git a/maps/VioletCity.asm b/maps/VioletCity.asm
index c142602ba..f707345f8 100644
--- a/maps/VioletCity.asm
+++ b/maps/VioletCity.asm
@@ -16,7 +16,7 @@ VioletCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_VIOLET
diff --git a/maps/ViridianCity.asm b/maps/ViridianCity.asm
index 7d725a3aa..875c53e89 100644
--- a/maps/ViridianCity.asm
+++ b/maps/ViridianCity.asm
@@ -12,7 +12,7 @@ ViridianCity_MapScriptHeader:
db 1
; callbacks
- dbw 5, .FlyPoint
+ dbw MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint
setflag ENGINE_FLYPOINT_VIRIDIAN
diff --git a/maps/ViridianGym.asm b/maps/ViridianGym.asm
index b277f34b0..c97d0a180 100644
--- a/maps/ViridianGym.asm
+++ b/maps/ViridianGym.asm
@@ -14,26 +14,26 @@ BlueScript_0x9aa26:
opentext
checkflag ENGINE_EARTHBADGE
iftrue .FightDone
- writetext UnknownText_0x9aa7b
+ writetext LeaderBlueBeforeText
waitbutton
closetext
- winlosstext UnknownText_0x9abae, 0
+ winlosstext LeaderBlueWinText, 0
loadtrainer BLUE, 1
startbattle
reloadmapafterbattle
setevent EVENT_BEAT_BLUE
opentext
- writetext UnknownText_0x9ac0f
+ writetext Text_ReceivedEarthBadge
playsound SFX_GET_BADGE
waitsfx
setflag ENGINE_EARTHBADGE
- writetext UnknownText_0x9ac27
+ writetext LeaderBlueAfterText
waitbutton
closetext
end
.FightDone
- writetext UnknownText_0x9acab
+ writetext LeaderBlueEpilogueText
waitbutton
closetext
end
@@ -58,11 +58,12 @@ ViridianGymStatue:
checkflag ENGINE_EARTHBADGE
iftrue .Beaten
jumpstd gymstatue1
+
.Beaten
trainertotext BLUE, 1, $1
jumpstd gymstatue2
-UnknownText_0x9aa7b:
+LeaderBlueBeforeText:
text "BLUE: Yo! Finally"
line "got here, huh?"
@@ -95,7 +96,7 @@ UnknownText_0x9aa7b:
line "CHAMP?"
done
-UnknownText_0x9abae:
+LeaderBlueWinText:
text "BLUE: What?"
para "How the heck did I"
@@ -108,12 +109,12 @@ UnknownText_0x9abae:
cont "it's EARTHBADGE."
done
-UnknownText_0x9ac0f:
+Text_ReceivedEarthBadge:
text "<PLAYER> received"
line "EARTHBADGE."
done
-UnknownText_0x9ac27:
+LeaderBlueAfterText:
text "BLUE: …"
para "All right, I was"
@@ -129,7 +130,7 @@ UnknownText_0x9ac27:
line "it!"
done
-UnknownText_0x9acab:
+LeaderBlueEpilogueText:
text "BLUE: Listen, you."
para "You'd better not"
diff --git a/maps/WarehouseEntrance.asm b/maps/WarehouseEntrance.asm
index 78523ae8e..05e662ace 100644
--- a/maps/WarehouseEntrance.asm
+++ b/maps/WarehouseEntrance.asm
@@ -18,11 +18,11 @@ WarehouseEntrance_MapScriptHeader:
; callbacks
- dbw 5, .ResetSwitches
+ dbw MAPCALLBACK_NEWMAP, .ResetSwitches
- dbw 1, .CheckBasementKey
+ dbw MAPCALLBACK_TILES, .CheckBasementKey
- dbw 2, .CheckDayOfWeek
+ dbw MAPCALLBACK_OBJECTS, .CheckDayOfWeek
.ResetSwitches:
clearevent EVENT_SWITCH_1
diff --git a/maps/WhirlIslandLugiaChamber.asm b/maps/WhirlIslandLugiaChamber.asm
index be55b8345..eb42831fd 100644
--- a/maps/WhirlIslandLugiaChamber.asm
+++ b/maps/WhirlIslandLugiaChamber.asm
@@ -10,7 +10,7 @@ WhirlIslandLugiaChamber_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x18c504
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x18c504
UnknownScript_0x18c504:
checkevent EVENT_FOUGHT_LUGIA
diff --git a/maps/WillsRoom.asm b/maps/WillsRoom.asm
index 1ff5d3c40..a63f6b478 100644
--- a/maps/WillsRoom.asm
+++ b/maps/WillsRoom.asm
@@ -14,7 +14,7 @@ WillsRoom_MapScriptHeader:
; callbacks
- dbw 1, UnknownScript_0x1804cb
+ dbw MAPCALLBACK_TILES, UnknownScript_0x1804cb
UnknownScript_0x1804c6:
priorityjump UnknownScript_0x1804e0
diff --git a/maps/WiseTriosRoom.asm b/maps/WiseTriosRoom.asm
index b906acc31..8bdb0f700 100644
--- a/maps/WiseTriosRoom.asm
+++ b/maps/WiseTriosRoom.asm
@@ -19,7 +19,7 @@ WiseTriosRoom_MapScriptHeader:
; callbacks
- dbw 2, UnknownScript_0x98574
+ dbw MAPCALLBACK_OBJECTS, UnknownScript_0x98574
UnknownScript_0x98572:
end
diff --git a/misc/gbc_only.asm b/misc/gbc_only.asm
index 81d3eadb4..2349bb687 100644
--- a/misc/gbc_only.asm
+++ b/misc/gbc_only.asm
@@ -10,7 +10,7 @@ GBCOnlyScreen: ; 4ea82
call ClearTileMap
ld hl, GBCOnlyGFX
- ld de, wd000
+ ld de, $d000
ld a, [rSVBK]
push af
ld a, 0
@@ -19,7 +19,7 @@ GBCOnlyScreen: ; 4ea82
pop af
ld [rSVBK], a
- ld de, wd000
+ ld de, $d000
ld hl, VTiles2
lb bc, BANK(GBCOnlyGFX), $54
call Get2bpp
diff --git a/misc/mobile_40.asm b/misc/mobile_40.asm
index 10ce4225c..70b069881 100644
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -1570,7 +1570,7 @@ Function1009ae: ; 1009ae
inc de
dec c
jr nz, .loop_col
- ld bc, 12
+ ld bc, BG_MAP_WIDTH - SCREEN_WIDTH
add hl, bc
pop bc
dec b
@@ -1609,7 +1609,7 @@ Function1009f3: ; 1009f3
ld a, [hJoyDown]
and SELECT + A_BUTTON
cp SELECT + A_BUTTON
- jr nz, .asm_100a07
+ jr nz, .select_a
ld hl, wcd2a
set 4, [hl]
ld a, $f8
@@ -1617,7 +1617,7 @@ Function1009f3: ; 1009f3
scf
ret
-.asm_100a07
+.select_a
xor a
ret
; 100a09
@@ -1630,13 +1630,13 @@ _LinkBattleSendReceiveAction: ; 100a09
cp LINK_MOBILE
jr nz, .not_mobile
- call Function100a87
+ call .MobileBattle_SendReceiveAction
call Function100da5
callba FinishBattleAnim
jr .done
.not_mobile
- call Function100a53
+ call .LinkBattle_SendReceiveAction
.done
ret
@@ -1669,7 +1669,7 @@ _LinkBattleSendReceiveAction: ; 100a09
ret
; 100a53
-Function100a53: ; 100a53
+.LinkBattle_SendReceiveAction: ; 100a53
ld a, [wd431]
ld [wPlayerLinkAction], a
ld a, $ff
@@ -1700,7 +1700,7 @@ Function100a53: ; 100a53
ret
; 100a87
-Function100a87: ; 100a87
+.MobileBattle_SendReceiveAction: ; 100a87
call Function100acf
call Function100641
ld a, 0
@@ -2100,7 +2100,7 @@ MobileBattleMonMenu: ; 100d22
; 100d67
Function100d67: ; 100d67
- ld hl, MenuDataHeader_100d88
+ ld hl, .MenuDataHeader
call CopyMenuDataHeader
xor a
ld [hBGMapMode], a
@@ -2115,19 +2115,19 @@ Function100d67: ; 100d67
ret
; 100d88
-MenuDataHeader_100d88: ; 100d88
+.MenuDataHeader: ; 100d88
db 0 ; flags
db 11, 11 ; start coords
db 17, 19 ; end coords
- dw MenuData2_100d90
+ dw .MenuData2
db 1 ; default option
-MenuData2_100d90: ; 100d90
+.MenuData2: ; 100d90
db $c0 ; flags
db 3
- db "いれかえる@"
- db "つよさをみる@"
- db "キャンセル@"
+ db "いれかえる@" ; TRADE
+ db "つよさをみる@" ; STATS
+ db "キャンセル@" ; CANCEL
; 100da5
Function100da5: ; 100da5
@@ -3061,7 +3061,7 @@ Function1013aa: ; 1013aa
call ReloadTilesetAndPalettes
callba Function106464
call UpdateSprites
- call Function2b5c
+ call FinishExitMenu
ret
; 1013c0
@@ -3069,7 +3069,7 @@ Function1013c0: ; 1013c0
callba BlankScreen
callba MobileFunc_106462
callba Function106464
- call Function2b5c
+ call FinishExitMenu
ret
; 1013d6
diff --git a/misc/mobile_46.asm b/misc/mobile_46.asm
index fb1519908..e49138df6 100755
--- a/misc/mobile_46.asm
+++ b/misc/mobile_46.asm
@@ -5573,7 +5573,7 @@ Function11a9ce: ; 11a9ce
callba MobileFunc_106462
callba Function106464
call ret_d90
- callba Function2b5c
+ callba FinishExitMenu
call UpdateSprites
ret
; 11a9f0
diff --git a/misc/mobile_5f.asm b/misc/mobile_5f.asm
index a83c7a925..044038e38 100644
--- a/misc/mobile_5f.asm
+++ b/misc/mobile_5f.asm
@@ -4708,7 +4708,7 @@ Function17f555: ; 17f555
Function17f5c3: ; 17f5c3
call Function17f5e4
- callba Function2b5c
+ callba FinishExitMenu
ld a, $1
ld [wc303], a
ret
diff --git a/trainers/read_party.asm b/trainers/read_party.asm
index 71cbdc5e5..af4e63cb9 100755
--- a/trainers/read_party.asm
+++ b/trainers/read_party.asm
@@ -333,7 +333,7 @@ endr
Battle_GetTrainerName:: ; 39939
ld a, [InBattleTowerBattle]
bit 0, a
- ld hl, wd26b
+ ld hl, OTPlayerName
jp nz, CopyTrainerName
ld a, [OtherTrainerID]
diff --git a/wram.asm b/wram.asm
index 056816e92..129dc3e33 100644
--- a/wram.asm
+++ b/wram.asm
@@ -1,217 +1,5 @@
INCLUDE "includes.asm"
-
-flag_array: MACRO
- ds ((\1) + 7) / 8
-ENDM
-
-box_struct: MACRO
-\1Species:: db
-\1Item:: db
-\1Moves:: ds NUM_MOVES
-\1ID:: dw
-\1Exp:: ds 3
-\1StatExp::
-\1HPExp:: dw
-\1AtkExp:: dw
-\1DefExp:: dw
-\1SpdExp:: dw
-\1SpcExp:: dw
-\1DVs:: ds 2
-\1PP:: ds NUM_MOVES
-\1Happiness:: db
-\1PokerusStatus:: db
-\1CaughtData::
-\1CaughtTime::
-\1CaughtLevel:: db
-\1CaughtGender::
-\1CaughtLocation:: db
-\1Level:: db
-\1End::
-ENDM
-
-party_struct: MACRO
- box_struct \1
-\1Status:: db
-\1Unused:: db
-\1HP:: dw
-\1MaxHP:: dw
-\1Stats:: ; big endian
-\1Attack:: dw
-\1Defense:: dw
-\1Speed:: dw
-\1SpclAtk:: dw
-\1SpclDef:: dw
-\1StatsEnd::
-ENDM
-
-red_box_struct: MACRO
-\1Species:: db
-\1HP:: dw
-\1BoxLevel:: db
-\1Status:: db
-\1Type::
-\1Type1:: db
-\1Type2:: db
-\1CatchRate:: db
-\1Moves:: ds NUM_MOVES
-\1OTID:: dw
-\1Exp:: ds 3
-\1HPExp:: dw
-\1AttackExp:: dw
-\1DefenseExp:: dw
-\1SpeedExp:: dw
-\1SpecialExp:: dw
-\1DVs:: ds 2
-\1PP:: ds NUM_MOVES
-ENDM
-
-red_party_struct: MACRO
- red_box_struct \1
-\1Level:: db
-\1Stats::
-\1MaxHP:: dw
-\1Attack:: dw
-\1Defense:: dw
-\1Speed:: dw
-\1Special:: dw
-ENDM
-
-
-battle_struct: MACRO
-\1Species:: db
-\1Item:: db
-\1Moves:: ds NUM_MOVES
-\1MovesEnd::
-\1DVs:: ds 2
-\1PP:: ds NUM_MOVES
-\1Happiness:: db
-\1Level:: db
-\1Status:: ds 2
-\1HP:: dw
-\1MaxHP:: dw
-\1Stats:: ; big endian
-\1Attack:: dw
-\1Defense:: dw
-\1Speed:: dw
-\1SpclAtk:: dw
-\1SpclDef:: dw
-\1StatsEnd::
-\1Type::
-\1Type1:: db
-\1Type2:: db
-\1StructEnd::
-ENDM
-
-box: MACRO
-\1::
-\1Count:: ds 1
-\1Species:: ds MONS_PER_BOX + 1
-\1Mons::
-\1Mon1:: box_struct \1Mon1
-\1Mon2:: ds BOXMON_STRUCT_LENGTH * (MONS_PER_BOX +- 1)
-\1MonOT:: ds NAME_LENGTH * MONS_PER_BOX
-\1MonNicknames:: ds PKMN_NAME_LENGTH * MONS_PER_BOX
-\1MonNicknamesEnd::
-\1End:: ds 2 ; padding
-ENDM
-
-
-channel_struct: MACRO
-; Addreses are Channel1 (c101).
-\1MusicID:: dw
-\1MusicBank:: db
-\1Flags:: db ; 0:on/off 1:subroutine 3:sfx 4:noise 5:rest
-\1Flags2:: db ; 0:vibrato on/off 2:duty 4:cry pitch
-\1Flags3:: db ; 0:vibrato up/down
-\1MusicAddress:: dw
-\1LastMusicAddress:: dw
- dw
-\1NoteFlags:: db ; 5:rest
-\1Condition:: db ; conditional jumps
-\1DutyCycle:: db ; bits 6-7 (0:12.5% 1:25% 2:50% 3:75%)
-\1Intensity:: db ; hi:pressure lo:velocity
-\1Frequency:: ; 11 bits
-\1FrequencyLo:: db
-\1FrequencyHi:: db
-\1Pitch:: db ; 0:rest 1-c:note
-\1Octave:: db ; 7-0 (0 is highest)
-\1StartingOctave:: db ; raises existing octaves (to repeat phrases)
-\1NoteDuration:: db ; frames remaining for the current note
-\1Field0x16:: ds 1 ; c117
- ds 1 ; c118
-\1LoopCount:: db
-\1Tempo:: dw
-\1Tracks:: db ; hi:left lo:right
-\1Field0x1c:: ds 1 ; c11d
-\1VibratoDelayCount:: db ; initialized by \1VibratoDelay
-\1VibratoDelay:: db ; number of frames a note plays until vibrato starts
-\1VibratoExtent:: db
-\1VibratoRate:: db ; hi:frames for each alt lo:frames to the next alt
-\1Field0x21:: ds 1 ; c122
-\1Field0x22:: ds 1 ; c123
-\1Field0x23:: ds 1 ; c124
-\1Field0x24:: ds 1 ; c125
-\1Field0x25:: ds 1 ; c126
- ds 1 ; c127
-\1CryPitch:: dw
-\1Field0x29:: ds 1
-\1Field0x2a:: ds 2
-\1Field0x2c:: ds 1
-\1NoteLength:: db ; frames per 16th note
-\1Field0x2e:: ds 1 ; c12f
-\1Field0x2f:: ds 1 ; c130
-\1Field0x30:: ds 1 ; c131
- ds 1 ; c132
-ENDM
-
-battle_tower_struct: MACRO
-\1Name:: ds NAME_LENGTH +- 1
-\1TrainerClass:: ds 1
-\1Pkmn1:: party_struct \1Pkmn1
-\1Pkmn1Name:: ds PKMN_NAME_LENGTH
-\1Pkmn1NameEnd::
-\1Pkmn2:: party_struct \1Pkmn2
-\1Pkmn2Name:: ds PKMN_NAME_LENGTH
-\1Pkmn2NameEnd::
-\1Pkmn3:: party_struct \1Pkmn3
-\1Pkmn3Name:: ds PKMN_NAME_LENGTH
-\1Pkmn3NameEnd::
-\1TrainerData:: ds BATTLETOWER_TRAINERDATALENGTH
-\1TrainerEnd::
-endm
-
-mailmsg: MACRO
-\1Message:: ds MAIL_MSG_LENGTH
-\1MessageEnd:: ds 1
-\1Author:: ds PLAYER_NAME_LENGTH
-\1AuthorNationality:: ds 2
-\1AuthorID:: ds 2
-\1Species:: ds 1
-\1Type:: ds 1
-\1End::
-endm
-
-hof_mon: MACRO
-\1Species:: ds 1
-\1ID:: ds 2
-\1DVs:: ds 2
-\1Level:: ds 1
-\1Nickname:: ds PKMN_NAME_LENGTH +- 1
-\1End::
-endm
-
-hall_of_fame: MACRO
-\1::
-\1WinCount:: ds 1
-\1Mon1:: hof_mon \1Mon1
-\1Mon2:: hof_mon \1Mon2
-\1Mon3:: hof_mon \1Mon3
-\1Mon4:: hof_mon \1Mon4
-\1Mon5:: hof_mon \1Mon5
-\1Mon6:: hof_mon \1Mon6
-\1End:: ds 1
-ENDM
-
+INCLUDE "macros/wram.asm"
INCLUDE "vram.asm"
SECTION "Stack", WRAM0
@@ -907,9 +695,11 @@ wc6d6::
EnemySpdLevel:: ; c6d6
ds 1
wc6d7::
+wTownMapCursorLandmark::
EnemySAtkLevel:: ; c6d7
ds 1
wc6d8::
+wTownMapPlayerIconLandmark::
EnemySDefLevel:: ; c6d8
ds 1
wc6d9::
@@ -1764,7 +1554,7 @@ wMinutesSince:: ds 1
wHoursSince:: ds 1
wDaysSince:: ds 1
-wRAM0End:: ; cfc0
+wRAM0End:: ; cfd8
SECTION "WRAM 1", WRAMX, BANK [1]
@@ -1903,6 +1693,8 @@ MenuItemsList::
CurFruitTree::
CurInput::
wElevatorPointerBank::
+wCurCoordEventTriggerID::
+wCurSignpostYCoord::
EngineBuffer1:: ; d03e
ds 1
@@ -1911,24 +1703,30 @@ wJumpStdScriptBuffer::
CurFruit:: ; d03f
MartPointerBank::
wElevatorPointerLo::
+wCurCoordEventMapY::
+wCurSignpostXCoord::
EngineBuffer2::
ds 1
wd040::
wElevatorPointerHi::
MartPointer:: ; d040
+wCurCoordEventMapX::
+wCurSignpostType::
EngineBuffer3::
ds 1
wd041::
wElevatorOriginFloor::
-EngineBuffer4::
wTempTrainerHeader::
wTempTrainerEventFlagLo::
+wCurSignpostScriptAddr::
+EngineBuffer4::
ds 1
wTempTrainerEventFlagHi::
MovementAnimation:: ; d042
+wCurCoordEventScriptAddr::
EngineBuffer5::
ds 1
@@ -2072,7 +1870,7 @@ wd10b:: ds 1
wItemQuantityChangeBuffer:: ds 1
wItemQuantityBuffer:: ds 1
-TempMon::
+TempMon:: ; d10e
party_struct TempMon
wSpriteFlags:: ds 1
@@ -2398,11 +2196,11 @@ CurDamage:: ; d256
ds 2
ds 2
-wMornEncounterRate:: ds 1
-wDayEncounterRate:: ds 1
-wNiteEncounterRate:: ds 1
-wWaterEncounterRate:: ds 1
-wListMoves_MoveIndicesBuffer:: ds 4
+wMornEncounterRate:: ds 1 ; d25a
+wDayEncounterRate:: ds 1 ; d25b
+wNiteEncounterRate:: ds 1 ; d25c
+wWaterEncounterRate:: ds 1 ; d25d
+wListMoves_MoveIndicesBuffer:: ds NUM_MOVES
wPutativeTMHMMove:: ds 1
wd263:: ds 1
wd264:: ds 1
@@ -2428,7 +2226,6 @@ wPokedexShowPointerBank::
wd26d:: ds 1
ds 3
wd271:: ds 5
-wd276:: ds 10
ds wd26b - @
@@ -2466,7 +2263,7 @@ OTPartyMonsEnd::
OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8
OTPartyMonNicknames:: ds PKMN_NAME_LENGTH * PARTY_LENGTH ; d3ea
-
+OTPartyDataEnd::
ds 4
wd430::
@@ -2523,6 +2320,9 @@ wd454:: ds 1
wBattleScriptFlags:: ds 2
wPlayerSpriteSetupFlags:: ds 1
+; bit 7: if set, cancel PlayerAction
+; bit 5: if set, set facing according to bits 0-1
+; bits 0-1: direction facing
wMapReentryScriptQueueFlag:: ds 1 ; MemScriptFlag
wMapReentryScriptBank:: ds 1 ; MemScriptBank
wMapReentryScriptAddress:: ds 2 ; MemScriptAddr
@@ -2946,6 +2746,7 @@ wCelebiEvent:: ds 1
ds 1
BikeFlags:: ; dbf5
+; bit 0: using strength
; bit 1: always on bike
; bit 2: downhill
ds 1
@@ -2958,8 +2759,8 @@ wCurrentCaller:: ds 2
wCurrMapWarpCount:: ds 1
wCurrMapWarpHeaderPointer:: ds 1
wdbfd:: ds 1
-wCurrentNextMapXYTriggerCount:: ds 1
-wCurrentNextMapXYTriggerHeaderPointer:: ds 1
+wCurrentMapXYTriggerCount:: ds 1
+wCurrentMapXYTriggerHeaderPointer:: ds 1
wdc00:: ds 1
wCurrentMapSignpostCount:: ds 1
wCurrentMapSignpostHeaderPointer::
@@ -3054,12 +2855,12 @@ PoisonStepCount:: ; dc74
ds 1
ds 2
-wdc77:: ds 2
-wdc79::
+wHappinessStepCount:: ds 1
+ ds 1
wParkBallsRemaining::
-wSafariBallsRemaining:: ds 1
-wSafariTimeRemaining:: ds 2
-wPhoneList:: ds CONTACT_LIST_SIZE
+wSafariBallsRemaining:: ds 1 ; dc79
+wSafariTimeRemaining:: ds 2 ; dc7a
+wPhoneList:: ds CONTACT_LIST_SIZE ; dc7c
ds 23
wLuckyNumberShowFlag:: ds 2 ; dc9d
wLuckyIDNumber:: ds 2 ; dc9f
@@ -3287,7 +3088,8 @@ w3_d742:: battle_tower_struct w3_d742
ds -$22
wBTChoiceOfLvlGroup::
-w3_d800:: ds $69
+w3_d800:: ; ds BG_MAP_WIDTH * SCREEN_HEIGHT ($240)
+ ds $69
w3_d869:: ds $17
w3_d880:: ds 1
w3_d881:: ds 1
@@ -3300,10 +3102,12 @@ w3_d895:: ds 11
w3_d8a0:: ds 1
w3_d8a1:: ds 1
w3_d8a2:: ds 1
-w3_d8a3:: ds 1
- ds $35c
-w3_dc00:: ds $168
-w3_dd68:: ds $284
+w3_d8a3:: ds $19d
+w3_da40:: ds $1c0
+
+w3_dc00:: ds SCREEN_WIDTH * SCREEN_HEIGHT
+w3_dd68:: ds SCREEN_WIDTH * SCREEN_HEIGHT
+ ds $11c
w3_dfec:: ds $10
w3_dffc:: ds 4