summaryrefslogtreecommitdiff
path: root/Hard-coded-logic.md
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2018-04-04 13:05:04 -0400
committerRangi <35663410+Rangi42@users.noreply.github.com>2018-04-04 13:05:04 -0400
commitb413e463686cc2f2c3b308a0cb99bd1acd638ceb (patch)
treeadec7a77a0a69a76b0818168d0c0b993f91908bb /Hard-coded-logic.md
parent680ac4cd494fae3e4bf10c186db48641ba1482c0 (diff)
Updated Hard coded logic (markdown)
Diffstat (limited to 'Hard-coded-logic.md')
-rw-r--r--Hard-coded-logic.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/Hard-coded-logic.md b/Hard-coded-logic.md
index 4e0b271..070b971 100644
--- a/Hard-coded-logic.md
+++ b/Hard-coded-logic.md
@@ -6,6 +6,7 @@ Much of the game logic can be changed via the files in [data/](../blob/master/da
- [Tilesets that have per-mapgroup roofs](#tilesets-that-have-per-mapgroup-roofs)
- [Maps that don't display a location sign](#maps-that-dont-display-a-location-sign)
- [Outdoor maps within indoor maps don't confuse Dig or Escape Rope](#outdoor-maps-within-indoor-maps-dont-confuse-dig-or-escape-rope)
+- [Landmark limits when scrolling in the Town Map](#landmark-limits-when-scrolling-in-the-town-map)
- [Trainer classes with different battle music](#trainer-classes-with-different-battle-music)
- [`RIVAL1`'s first Pokémon has no held item](#rival1s-first-pokémon-has-no-held-item)
- [`RIVAL1` and `RIVAL2` don't print their trainer class in battle](#rival1-and-rival2-dont-print-their-trainer-class-in-battle)
@@ -82,6 +83,36 @@ There's no "outdoor-within-indoor" map environment, so the few maps in this situ
```
+## Landmark limits when scrolling in the Town Map
+
+This is caused by `PokegearMap_KantoMap` and `PokegearMap_JohtoMap` in [engine/pokegear.asm](../blob/master/engine/pokegear.asm):
+
+```asm
+PokegearMap_KantoMap: ; 90fe9 (24:4fe9)
+ call TownMap_GetKantoLandmarkLimits
+ jr PokegearMap_ContinueMap
+
+PokegearMap_JohtoMap: ; 90fee (24:4fee)
+ ld d, SILVER_CAVE
+ ld e, NEW_BARK_TOWN
+PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
+ ...
+
+TownMap_GetKantoLandmarkLimits: ; 910e8
+ ld a, [wStatusFlags]
+ bit STATUSFLAGS_HALL_OF_FAME_F, a
+ jr z, .not_hof
+ ld d, ROUTE_28
+ ld e, PALLET_TOWN
+ ret
+
+.not_hof
+ ld d, ROUTE_28
+ ld e, VICTORY_ROAD
+ ret
+```
+
+
## `RIVAL1`'s first Pokémon has no held item
This is caused by `InitEnemyTrainer` in [engine/battle/core.asm](../blob/master/engine/battle/core.asm):