ref: 80aba7fc13c89d8799776ed479aa13ca69c718fe
parent: 27be0bfe05d161d60f977d19bee5b2812f0b5e16
author: PikalaxALT <PikalaxALT@gmail.com>
date: Tue Jan 5 03:46:37 EST 2016
maptrigger macro
--- 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
--- 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
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -502,7 +502,7 @@
.do_daily
callba CheckDailyResetTimer
- callba CheckPokerusTrick
+ callba CheckPokerusTick
callba CheckPhoneCall
ret c
--- a/engine/options_menu.asm
+++ b/engine/options_menu.asm
@@ -5,8 +5,8 @@
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
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -213,14 +213,14 @@
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 @@
Function90e3f: ; 90e3f
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK
@@ -341,7 +341,7 @@
ld [hl], $6
hlcoord 19, 2
ld [hl], $17
- ld a, [wc6d7]
+ ld a, [wTownMapCursorLandmark]
call Function910b4
ret
; 90e72
@@ -547,7 +547,7 @@
; 0x90fb4
Function90fb4: ; 90fb4 (24:4fb4)
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK
@@ -567,9 +567,9 @@
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 @@
ret
Function90fe9: ; 90fe9 (24:4fe9)
- call Function910e8
+ call TownMap_GetKantoLandmarkLimits
jr Function90ff2
Function90fee: ; 90fee (24:4fee)
@@ -637,7 +637,7 @@
jr nz, .down
ret
.up
- ld hl, wc6d7
+ ld hl, wTownMapCursorLandmark
ld a, [hl]
cp d
jr c, .asm_91047
@@ -649,7 +649,7 @@
jr .done
.down
- ld hl, wc6d7
+ ld hl, wTownMapCursorLandmark
ld a, [hl]
cp e
jr nz, .asm_91054
@@ -660,13 +660,13 @@
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 @@
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 @@
jp LoadStation_BuenasPassword
.RuinsOfAlphRadio
- ld a, [wc6d8]
+ ld a, [wTownMapPlayerIconLandmark]
cp RUINS_OF_ALPH
jr nz, .NoSignal
jp LoadStation_UnownRadio
@@ -1594,7 +1594,7 @@
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 @@
.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
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -723,13 +723,13 @@
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
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -1203,7 +1203,7 @@
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
--- a/engine/time.asm
+++ b/engine/time.asm
@@ -195,7 +195,7 @@
ret
; 114e7
-CheckPokerusTrick:: ; 114e7
+CheckPokerusTick:: ; 114e7
ld hl, wStartDay
call CalcDaysSince
call GetDaysSince
--- a/engine/town_map.asm
+++ b/engine/town_map.asm
@@ -45,23 +45,23 @@
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 @@
ld [Options], a
call ClearBGPalettes
ret
-; 919b0
-Function919b0: ; 919b0
.loop
call JoyTextDelay
ld hl, hJoyPressed
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -113,9 +113,8 @@
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 @@
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 @@
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 @@
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 @@
xor a
ld hl, wWindowStackBottom
-rept 2
ld [hld], a
-endr
+ ld [hld], a
ld a, l
ld [wWindowStackPointer], a
ld a, h
--- a/macros/map.asm
+++ b/macros/map.asm
@@ -183,3 +183,7 @@
db \1, \2
dw \3
endm
+
+maptrigger: MACRO
+ dw \1, 0
+endm
--- a/maps/AzaleaTown.asm
+++ b/maps/AzaleaTown.asm
@@ -17,9 +17,9 @@
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 1
--- a/maps/BattleTower1F.asm
+++ b/maps/BattleTower1F.asm
@@ -10,8 +10,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
--- a/maps/BattleTowerElevator.asm
+++ b/maps/BattleTowerElevator.asm
@@ -6,8 +6,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
--- a/maps/BattleTowerHallway.asm
+++ b/maps/BattleTowerHallway.asm
@@ -6,8 +6,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
--- a/maps/BurnedTower1F.asm
+++ b/maps/BurnedTower1F.asm
@@ -10,9 +10,9 @@
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 1
--- a/maps/CherrygroveCity.asm
+++ b/maps/CherrygroveCity.asm
@@ -10,8 +10,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/CianwoodCity.asm
+++ b/maps/CianwoodCity.asm
@@ -17,8 +17,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/Colosseum.asm
+++ b/maps/Colosseum.asm
@@ -7,9 +7,9 @@
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 2
--- a/maps/DragonShrine.asm
+++ b/maps/DragonShrine.asm
@@ -9,8 +9,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
--- a/maps/DragonsDenB1F.asm
+++ b/maps/DragonsDenB1F.asm
@@ -14,8 +14,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/EcruteakHouse.asm
+++ b/maps/EcruteakHouse.asm
@@ -9,8 +9,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/ElmsLab.asm
+++ b/maps/ElmsLab.asm
@@ -11,12 +11,12 @@
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
--- a/maps/FastShip1F.asm
+++ b/maps/FastShip1F.asm
@@ -9,9 +9,9 @@
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 0
--- a/maps/GoldenrodMagnetTrainStation.asm
+++ b/maps/GoldenrodMagnetTrainStation.asm
@@ -7,7 +7,7 @@
db 1
; triggers
- dw .Trigger0, 0
+ maptrigger .Trigger0
.MapCallbacks:
db 0
--- a/maps/HallOfFame.asm
+++ b/maps/HallOfFame.asm
@@ -6,8 +6,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
--- a/maps/LakeofRage.asm
+++ b/maps/LakeofRage.asm
@@ -17,8 +17,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 2
--- a/maps/MahoganyTown.asm
+++ b/maps/MahoganyTown.asm
@@ -9,8 +9,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/MobileBattleRoom.asm
+++ b/maps/MobileBattleRoom.asm
@@ -4,8 +4,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
--- a/maps/MobileTradeRoomMobile.asm
+++ b/maps/MobileTradeRoomMobile.asm
@@ -4,8 +4,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
--- a/maps/MountMoon.asm
+++ b/maps/MountMoon.asm
@@ -6,8 +6,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 0
--- a/maps/NewBarkTown.asm
+++ b/maps/NewBarkTown.asm
@@ -8,8 +8,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/OlivineCity.asm
+++ b/maps/OlivineCity.asm
@@ -9,8 +9,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/PokeCenter2F.asm
+++ b/maps/PokeCenter2F.asm
@@ -9,12 +9,12 @@
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
--- a/maps/RadioTower5F.asm
+++ b/maps/RadioTower5F.asm
@@ -10,9 +10,9 @@
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 0
--- a/maps/Route29.asm
+++ b/maps/Route29.asm
@@ -13,8 +13,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/Route32.asm
+++ b/maps/Route32.asm
@@ -19,9 +19,9 @@
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 1
--- a/maps/Route36NationalParkgate.asm
+++ b/maps/Route36NationalParkgate.asm
@@ -17,9 +17,9 @@
db 3
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
- dw .Trigger2, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
+ maptrigger .Trigger2
.MapCallbacks:
db 2
--- a/maps/SaffronTrainStation.asm
+++ b/maps/SaffronTrainStation.asm
@@ -9,7 +9,7 @@
db 1
; triggers
- dw .Trigger0, 0
+ maptrigger .Trigger0
.MapCallbacks:
db 0
--- a/maps/TeamRocketBaseB1F.asm
+++ b/maps/TeamRocketBaseB1F.asm
@@ -11,7 +11,7 @@
db 1
; triggers
- dw .Trigger0, 0
+ maptrigger .Trigger0
.MapCallbacks:
db 1
--- a/maps/TeamRocketBaseB3F.asm
+++ b/maps/TeamRocketBaseB3F.asm
@@ -19,10 +19,10 @@
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
--- a/maps/TimeCapsule.asm
+++ b/maps/TimeCapsule.asm
@@ -7,8 +7,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/TradeCenter.asm
+++ b/maps/TradeCenter.asm
@@ -7,8 +7,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/UndergroundPathSwitchRoomEntrances.asm
+++ b/maps/UndergroundPathSwitchRoomEntrances.asm
@@ -48,8 +48,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/VermilionPort.asm
+++ b/maps/VermilionPort.asm
@@ -8,8 +8,8 @@
db 2
; triggers
- dw .Trigger0, 0
- dw .Trigger1, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
.MapCallbacks:
db 1
--- a/maps/ViridianGym.asm
+++ b/maps/ViridianGym.asm
@@ -14,26 +14,26 @@
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 @@
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 @@
line "CHAMP?"
done
-UnknownText_0x9abae:
+LeaderBlueWinText:
text "BLUE: What?"
para "How the heck did I"
@@ -108,12 +109,12 @@
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 @@
line "it!"
done
-UnknownText_0x9acab:
+LeaderBlueEpilogueText:
text "BLUE: Listen, you."
para "You'd better not"
--- a/wram.asm
+++ b/wram.asm
@@ -907,9 +907,11 @@
EnemySpdLevel:: ; c6d6
ds 1
wc6d7::
+wTownMapCursorLandmark::
EnemySAtkLevel:: ; c6d7
ds 1
wc6d8::
+wTownMapPlayerIconLandmark::
EnemySDefLevel:: ; c6d8
ds 1
wc6d9::