From 80aba7fc13c89d8799776ed479aa13ca69c718fe Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 5 Jan 2016 08:46:37 -0500 Subject: [PATCH] maptrigger macro --- constants/landmark_constants.asm | 192 +++++++++--------- constants/music_constants.asm | 208 ++++++++++---------- engine/events.asm | 2 +- engine/options_menu.asm | 4 +- engine/pokegear.asm | 48 ++--- engine/save.asm | 8 +- engine/scripting.asm | 2 +- engine/time.asm | 2 +- engine/town_map.asm | 14 +- home/menu.asm | 17 +- macros/map.asm | 4 + maps/AzaleaTown.asm | 6 +- maps/BattleTower1F.asm | 4 +- maps/BattleTowerElevator.asm | 4 +- maps/BattleTowerHallway.asm | 4 +- maps/BurnedTower1F.asm | 6 +- maps/CherrygroveCity.asm | 4 +- maps/CianwoodCity.asm | 4 +- maps/Colosseum.asm | 6 +- maps/DragonShrine.asm | 4 +- maps/DragonsDenB1F.asm | 4 +- maps/EcruteakHouse.asm | 4 +- maps/ElmsLab.asm | 12 +- maps/FastShip1F.asm | 6 +- maps/GoldenrodMagnetTrainStation.asm | 2 +- maps/HallOfFame.asm | 4 +- maps/LakeofRage.asm | 4 +- maps/MahoganyTown.asm | 4 +- maps/MobileBattleRoom.asm | 4 +- maps/MobileTradeRoomMobile.asm | 4 +- maps/MountMoon.asm | 4 +- maps/NewBarkTown.asm | 4 +- maps/OlivineCity.asm | 4 +- maps/PokeCenter2F.asm | 12 +- maps/RadioTower5F.asm | 6 +- maps/Route29.asm | 4 +- maps/Route32.asm | 6 +- maps/Route36NationalParkgate.asm | 6 +- maps/SaffronTrainStation.asm | 2 +- maps/TeamRocketBaseB1F.asm | 2 +- maps/TeamRocketBaseB3F.asm | 8 +- maps/TimeCapsule.asm | 4 +- maps/TradeCenter.asm | 4 +- maps/UndergroundPathSwitchRoomEntrances.asm | 4 +- maps/VermilionPort.asm | 4 +- maps/ViridianGym.asm | 21 +- wram.asm | 2 + 47 files changed, 345 insertions(+), 343 deletions(-) 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/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/events.asm b/engine/events.asm index 51e7288bc..120154f24 100644 --- a/engine/events.asm +++ b/engine/events.asm @@ -502,7 +502,7 @@ CheckTimeEvents: ; 9693a .do_daily callba CheckDailyResetTimer - callba CheckPokerusTrick + callba CheckPokerusTick callba CheckPhoneCall ret c 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/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 d271d5192..6198bf417 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -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 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/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/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/maps/AzaleaTown.asm b/maps/AzaleaTown.asm index 5921b1f0e..019c1f3fa 100644 --- a/maps/AzaleaTown.asm +++ b/maps/AzaleaTown.asm @@ -17,9 +17,9 @@ AzaleaTown_MapScriptHeader: db 3 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 - dw .Trigger2, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 + maptrigger .Trigger2 .MapCallbacks: db 1 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/BurnedTower1F.asm b/maps/BurnedTower1F.asm index 3adb8f2de..56df56768 100644 --- a/maps/BurnedTower1F.asm +++ b/maps/BurnedTower1F.asm @@ -10,9 +10,9 @@ BurnedTower1F_MapScriptHeader: db 3 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 - dw .Trigger2, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 + maptrigger .Trigger2 .MapCallbacks: db 1 diff --git a/maps/CherrygroveCity.asm b/maps/CherrygroveCity.asm index e3dc14c0a..20ae78fc1 100644 --- a/maps/CherrygroveCity.asm +++ b/maps/CherrygroveCity.asm @@ -10,8 +10,8 @@ CherrygroveCity_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/CianwoodCity.asm b/maps/CianwoodCity.asm index c05109db4..aa5ff3a02 100644 --- a/maps/CianwoodCity.asm +++ b/maps/CianwoodCity.asm @@ -17,8 +17,8 @@ CianwoodCity_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/Colosseum.asm b/maps/Colosseum.asm index b4383ac75..ef2e6c2b7 100644 --- a/maps/Colosseum.asm +++ b/maps/Colosseum.asm @@ -7,9 +7,9 @@ Colosseum_MapScriptHeader: db 3 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 - dw .Trigger2, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 + maptrigger .Trigger2 .MapCallbacks: db 2 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..fbde11df1 100644 --- a/maps/DragonsDenB1F.asm +++ b/maps/DragonsDenB1F.asm @@ -14,8 +14,8 @@ DragonsDenB1F_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/EcruteakHouse.asm b/maps/EcruteakHouse.asm index e8de95bc7..39649cd41 100644 --- a/maps/EcruteakHouse.asm +++ b/maps/EcruteakHouse.asm @@ -9,8 +9,8 @@ EcruteakHouse_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/ElmsLab.asm b/maps/ElmsLab.asm index f24586f31..02869d85b 100644 --- a/maps/ElmsLab.asm +++ b/maps/ElmsLab.asm @@ -11,12 +11,12 @@ 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 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/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/LakeofRage.asm b/maps/LakeofRage.asm index 20f7c0997..fa54e6afe 100644 --- a/maps/LakeofRage.asm +++ b/maps/LakeofRage.asm @@ -17,8 +17,8 @@ LakeofRage_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 2 diff --git a/maps/MahoganyTown.asm b/maps/MahoganyTown.asm index 4eeafd92c..7420f4bfc 100644 --- a/maps/MahoganyTown.asm +++ b/maps/MahoganyTown.asm @@ -9,8 +9,8 @@ MahoganyTown_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 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/NewBarkTown.asm b/maps/NewBarkTown.asm index cf25d1a18..11f582af5 100644 --- a/maps/NewBarkTown.asm +++ b/maps/NewBarkTown.asm @@ -8,8 +8,8 @@ NewBarkTown_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/OlivineCity.asm b/maps/OlivineCity.asm index 09c4a26c7..c93a32374 100644 --- a/maps/OlivineCity.asm +++ b/maps/OlivineCity.asm @@ -9,8 +9,8 @@ OlivineCity_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 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/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/Route29.asm b/maps/Route29.asm index cdd5fc426..b0cefef44 100644 --- a/maps/Route29.asm +++ b/maps/Route29.asm @@ -13,8 +13,8 @@ Route29_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/Route32.asm b/maps/Route32.asm index 63f29e81c..3081e9e26 100644 --- a/maps/Route32.asm +++ b/maps/Route32.asm @@ -19,9 +19,9 @@ Route32_MapScriptHeader: db 3 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 - dw .Trigger2, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 + maptrigger .Trigger2 .MapCallbacks: db 1 diff --git a/maps/Route36NationalParkgate.asm b/maps/Route36NationalParkgate.asm index 0a93c0d98..6d4ecd450 100644 --- a/maps/Route36NationalParkgate.asm +++ b/maps/Route36NationalParkgate.asm @@ -17,9 +17,9 @@ Route36NationalParkgate_MapScriptHeader: db 3 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 - dw .Trigger2, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 + maptrigger .Trigger2 .MapCallbacks: db 2 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/TeamRocketBaseB1F.asm b/maps/TeamRocketBaseB1F.asm index de9012ab0..ce4e59931 100644 --- a/maps/TeamRocketBaseB1F.asm +++ b/maps/TeamRocketBaseB1F.asm @@ -11,7 +11,7 @@ TeamRocketBaseB1F_MapScriptHeader: db 1 ; triggers - dw .Trigger0, 0 + maptrigger .Trigger0 .MapCallbacks: db 1 diff --git a/maps/TeamRocketBaseB3F.asm b/maps/TeamRocketBaseB3F.asm index a55e2c125..591a2b411 100644 --- a/maps/TeamRocketBaseB3F.asm +++ b/maps/TeamRocketBaseB3F.asm @@ -19,10 +19,10 @@ 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 diff --git a/maps/TimeCapsule.asm b/maps/TimeCapsule.asm index e543c352f..6a5f4d0ae 100644 --- a/maps/TimeCapsule.asm +++ b/maps/TimeCapsule.asm @@ -7,8 +7,8 @@ TimeCapsule_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/TradeCenter.asm b/maps/TradeCenter.asm index 3abad85e7..0da64c429 100644 --- a/maps/TradeCenter.asm +++ b/maps/TradeCenter.asm @@ -7,8 +7,8 @@ TradeCenter_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/UndergroundPathSwitchRoomEntrances.asm b/maps/UndergroundPathSwitchRoomEntrances.asm index 20a2a338d..3cfd5363e 100644 --- a/maps/UndergroundPathSwitchRoomEntrances.asm +++ b/maps/UndergroundPathSwitchRoomEntrances.asm @@ -48,8 +48,8 @@ UndergroundPathSwitchRoomEntrances_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 diff --git a/maps/VermilionPort.asm b/maps/VermilionPort.asm index 2e31531ce..e22774810 100644 --- a/maps/VermilionPort.asm +++ b/maps/VermilionPort.asm @@ -8,8 +8,8 @@ VermilionPort_MapScriptHeader: db 2 ; triggers - dw .Trigger0, 0 - dw .Trigger1, 0 + maptrigger .Trigger0 + maptrigger .Trigger1 .MapCallbacks: db 1 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 " 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/wram.asm b/wram.asm index 04ba20657..5876dd79c 100644 --- a/wram.asm +++ b/wram.asm @@ -907,9 +907,11 @@ wc6d6:: EnemySpdLevel:: ; c6d6 ds 1 wc6d7:: +wTownMapCursorLandmark:: EnemySAtkLevel:: ; c6d7 ds 1 wc6d8:: +wTownMapPlayerIconLandmark:: EnemySDefLevel:: ; c6d8 ds 1 wc6d9::