summaryrefslogtreecommitdiff
path: root/Edit-the-Town-Map.md
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-07-18 00:02:47 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-07-18 00:02:47 -0400
commit817eebe12ddb905fae814a8c88ba609e480094d1 (patch)
treea834752b7b62f67ebb07352256131ecf512364c8 /Edit-the-Town-Map.md
parent9a95b1e9e88f2f38280a5b364f59c6938ff7f4d5 (diff)
New landmark macro
Diffstat (limited to 'Edit-the-Town-Map.md')
-rw-r--r--Edit-the-Town-Map.md28
1 files changed, 25 insertions, 3 deletions
diff --git a/Edit-the-Town-Map.md b/Edit-the-Town-Map.md
index 0b72163..de601e1 100644
--- a/Edit-the-Town-Map.md
+++ b/Edit-the-Town-Map.md
@@ -52,17 +52,39 @@ Clearly, those bytes represent these Town Maps:
## 4. The landmarks
-Landmarks are defined in [data/maps/landmarks.asm](../blob/master/data/maps/landmarks.asm). Each one has an X coordinate, Y coordinate, and name. The coordinates are in pixels from the top-left corner, but with 8 added to X and 16 added to Y. For example:
+Landmarks are defined in [data/maps/landmarks.asm](../blob/master/data/maps/landmarks.asm). Each one has an X coordinate, Y coordinate, and name. The coordinates are in pixels from the top-left corner of the 160x140-pixel screen. For example:
```
- landmark 148, 116, NewBarkTownName
+ landmark 140, 100, NewBarkTownName
...
NewBarkTownName: db "NEW BARK¯TOWN@"
```
-148 − 8 = 140 and 116 − 16 = 100; and if you look at pixel coordinates (140, 100) in the Johto map above, you'll see it's in the middle of the New Bark Town icon.
+If you look at pixel coordinates (140, 100) in the Johto map above, you'll see it's in the middle of the New Bark Town icon.
+
+Be careful, though! Currently pokecrystal defines the `landmark` macro like this:
+
+```
+landmark: MACRO
+; x, y, name
+ db \1 + 8, \2 + 16
+ dw \3
+ENDM
+```
+
+But versions older than July 18, 2018 define it like this:
+
+```
+landmark: MACRO
+; x, y, name
+ db \1, \2
+ dw \3
+ENDM
+```
+
+This means that older versions of pokecrystal have their landmark X coordinates increased by 8 and their Y coordinates by 16. For example, New Bark Town used to be at (148, 116).
If you're wondering why those offsets exist, it's because of how the GameBoy hardware works. From the [Pan Docs](http://bgb.bircd.org/pandocs.htm#vramspriteattributetableoam):