summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-06-23 21:37:28 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-06-23 21:37:28 -0400
commitc36ddd27b723fcdb92c621cf91de5c4bf9ca836f (patch)
tree04c4a11b955c8079cd0f542a18a3fcdd703e296f
parent4b5ed6f6165234349d277f32029127aefc16f1b7 (diff)
Another section
-rw-r--r--Expand-tilesets-from-192-to-255-tiles.md82
1 files changed, 45 insertions, 37 deletions
diff --git a/Expand-tilesets-from-192-to-255-tiles.md b/Expand-tilesets-from-192-to-255-tiles.md
index 57aafc5..286964c 100644
--- a/Expand-tilesets-from-192-to-255-tiles.md
+++ b/Expand-tilesets-from-192-to-255-tiles.md
@@ -17,6 +17,7 @@ It's fairly simple to use $E0 to $FF for 32 more map tiles. We can also use $60
6. [Delete the unused font graphics](#6-delete-the-unused-font-graphics)
7. [Update the character set](#7-update-the-character-set)
8. [Change some hard-coded tile placements](#8-change-some-hard-coded-tile-placements)
+9. [Correct other implicit assumptions about tiles](#9-correct-other-implicit-assumptions-about-tiles)
## 1. Load tile graphics into $60–$7F and $E0–$FF
@@ -460,22 +461,26 @@ Edit [charmap.asm](../blob/master/charmap.asm):
## 8. Change some hard-coded tile placements
-Edit [engine/pokemon/correct_nick_errors.asm](../blob/master/engine/pokemon/correct_nick_errors.asm):
+Some parts of the code use "<code>vTiles2 tile <i>N</i></code>" to hard-code the data for a tile from $00 to $7F. When such a tile is moved to the range $80–$FF, the offset is invalid, so it has to become "<code>vTiles0 tile <i>N</i></code>". (If it's unclear to you why, take a look at the VRAM screenshot again, noting that `Tiles0` is the top-left sixth, `vTiles1` is the middle-left, and `vTiles2` is the bottom-left, with all three being sequential in memory.)
+
+Edit [engine/menus/naming_screen.asm](../blob/master/engine/menus/naming_screen.asm):
```diff
- .textcommands ; 66cf
- ; table defining which characters are actually text commands
- ; format:
- ; ≥ <
- db TX_START, TX_BOX + 1
- db "<PLAY_G>", "<JP_18>" + 1
- db "<NI>", "<NO>" + 1
- db "<ROUTE>", "<GREEN>" + 1
- db "<ENEMY>", "<ENEMY>" + 1
- db "<MOM>", "<TM>" + 1
-- db "<ROCKET>", "┘" + 1
-+ db "<ROCKET>", " "
- db -1 ; end
+-NAMINGSCREEN_BORDER EQUS "\"■\"" ; $60
++NAMINGSCREEN_BORDER EQUS "\"■\"" ; $d7
+ NAMINGSCREEN_MIDDLELINE EQUS "\"→\"" ; $eb
+-NAMINGSCREEN_UNDERLINE EQUS "\"<DOT>\"" ; $f2
++NAMINGSCREEN_UNDERLINE EQUS "\"☎\"" ; $d9
+
+ LoadNamingScreenGFX: ; 11c51
+ ...
+
+- ld de, vTiles2 tile NAMINGSCREEN_BORDER
++ ld de, vTiles0 tile NAMINGSCREEN_BORDER
+ ld hl, NamingScreenGFX_Border
+ ld bc, 1 tiles
+ ld a, BANK(NamingScreenGFX_Border)
+ call FarCopyBytes
```
Edit [engine/events/map_name_sign.asm](../blob/master/engine/events/map_name_sign.asm):
@@ -496,26 +501,6 @@ Edit [engine/events/map_name_sign.asm](../blob/master/engine/events/map_name_sig
; b80d3
```
-Edit [engine/menus/naming_screen.asm](../blob/master/engine/menus/naming_screen.asm):
-
-```diff
--NAMINGSCREEN_BORDER EQUS "\"■\"" ; $60
-+NAMINGSCREEN_BORDER EQUS "\"■\"" ; $d7
- NAMINGSCREEN_MIDDLELINE EQUS "\"→\"" ; $eb
--NAMINGSCREEN_UNDERLINE EQUS "\"<DOT>\"" ; $f2
-+NAMINGSCREEN_UNDERLINE EQUS "\"☎\"" ; $d9
-
- LoadNamingScreenGFX: ; 11c51
- ...
-
-- ld de, vTiles2 tile NAMINGSCREEN_BORDER
-+ ld de, vTiles0 tile NAMINGSCREEN_BORDER
- ld hl, NamingScreenGFX_Border
- ld bc, 1 tiles
- ld a, BANK(NamingScreenGFX_Border)
- call FarCopyBytes
-```
-
Edit [engine/events/magikarp.asm](../blob/master/engine/events/magikarp.asm):
```diff
@@ -552,7 +537,28 @@ Edit [engine/events/halloffame.asm](../blob/master/engine/events/halloffame.asm)
...
```
-And edit [engine/link/link_2.asm](../blob/master/engine/link/link_2.asm):
+
+## 9. Correct other implicit assumptions about tiles
+
+Edit [engine/pokemon/correct_nick_errors.asm](../blob/master/engine/pokemon/correct_nick_errors.asm):
+
+```diff
+ .textcommands ; 66cf
+ ; table defining which characters are actually text commands
+ ; format:
+ ; ≥ <
+ db TX_START, TX_BOX + 1
+ db "<PLAY_G>", "<JP_18>" + 1
+ db "<NI>", "<NO>" + 1
+ db "<ROUTE>", "<GREEN>" + 1
+ db "<ENEMY>", "<ENEMY>" + 1
+ db "<MOM>", "<TM>" + 1
+- db "<ROCKET>", "┘" + 1
++ db "<ROCKET>", " "
+ db -1 ; end
+```
+
+And edit [engine/link/link_2.asm](../blob/master/engine/link/link_2.asm) (this was already done for pokecrystal as of July 2018):
```diff
LinkTextbox2: ; 4d35b
@@ -608,12 +614,14 @@ Now the game will work just like before:
![Screenshot](screenshots/255-tiles-overworld.png)
-...except the VRAM now looks something like this, with 63 more tiles available to use for maps:
+…except the VRAM now looks something like this, with 63 more tiles available to use for maps:
![Screenshot](screenshots/255-tiles-vram.png)
-Furthermore, Polished Map with the 256 Tiles option checked will correctly load, edit, and save the enlarged tilesets:
+Furthermore, [Polished Map](https://github.com/Rangi42/polished-map) (with the **256 Tiles** option checked) will correctly load, edit, and save the enlarged tilesets:
![Screenshot](screenshots/255-tiles-polished-map.png)
Remember, tile $7F is reserved for the space character, so don't use it for a map tile.
+
+This entire change is compatible with [adding `PRIORITY` colors so NPCs can walk behind tiles](Allow-map-tiles-to-appear-above-sprites-\(so-NPCs-can-walk-behind-tiles\)-with-PRIORITY-colors); in [step 3](#3-update-the-tilesets-palette-maps-to-not-skip-607f), you'll just be removing a `rept 32` instead of a `rept 16`.