summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Expand-tilesets-from-192-to-255-tiles.md (renamed from Expand-tilesets-from-192-tiles-to-249.md)217
-rw-r--r--Tutorials.md3
-rw-r--r--screenshots/249-tiles-polished-map.pngbin8452 -> 0 bytes
-rw-r--r--screenshots/249-tiles-vram.pngbin15102 -> 0 bytes
-rw-r--r--screenshots/255-tiles-overworld.png (renamed from screenshots/249-tiles-overworld.png)bin6440 -> 6440 bytes
-rw-r--r--screenshots/255-tiles-polished-map.pngbin0 -> 8177 bytes
-rw-r--r--screenshots/255-tiles-vram.pngbin0 -> 15075 bytes
-rw-r--r--screenshots/255-tiles_gfx-font-font.png (renamed from screenshots/249-tiles_gfx-font-font.png)bin788 -> 788 bytes
-rw-r--r--screenshots/255-tiles_gfx-font-font_inversed.png (renamed from screenshots/249-tiles_gfx-font-font_inversed.png)bin773 -> 773 bytes
-rw-r--r--screenshots/255-tiles_gfx-font-overworld.png (renamed from screenshots/249-tiles_gfx-font-overworld.png)bin788 -> 788 bytes
-rw-r--r--screenshots/255-tiles_gfx-tilesets-johto_modern.png (renamed from screenshots/249-tiles_gfx-tilesets-johto_modern.png)bin2342 -> 2342 bytes
11 files changed, 182 insertions, 38 deletions
diff --git a/Expand-tilesets-from-192-tiles-to-249.md b/Expand-tilesets-from-192-to-255-tiles.md
index a338313..9ba8192 100644
--- a/Expand-tilesets-from-192-tiles-to-249.md
+++ b/Expand-tilesets-from-192-to-255-tiles.md
@@ -4,7 +4,7 @@ By default, tilesets in Gen 2 are limited to 192 tiles.
VRAM is divided into six areas, each 128 tiles large. The bottom-left and bottom-right areas are mostly for map tiles: $00 to $5F on the left, $80 to $DF on the right. The middle-left area ($80 to $FF), and the bottom two rows of the bottom-left area ($60 to $7F), are for text character tiles. The bottom two rows of the bottom-right area ($E0 to $FF) are unused. Furthermore, many of the text tiles are unused as well, including the ümläuted letters, most of the **b**old letters, etc.
-It's fairly simple to use $E0 to $FF for 32 more map tiles. We can also use $60 to $78 by moving the handful of necessary text tiles into the main font area. It's technically possible to use $79 to $7E as well, leaving only $7F for the space character, but the procedure is more complicated.
+It's fairly simple to use $E0 to $FF for 32 more map tiles. We can also use $60 to $7E by moving the necessary text tiles into the main font area, leaving only $7F for the space character and allowing 255 map tiles.
## Contents
@@ -34,7 +34,7 @@ Edit [home/map.asm](../blob/master/home/map.asm).
ld hl, wDecompressScratch
ld de, vTiles2
- ld bc, $60 tiles
-+ ld bc, $79 tiles
++ ld bc, $7f tiles
call CopyBytes
ld a, [rVBK]
@@ -60,14 +60,14 @@ Edit [home/map.asm](../blob/master/home/map.asm).
ld [rVBK], a
```
-Now instead of loading tileset graphics into tiles $00–$5F and $80–$DF, they'll be loaded into $00–$78 and $80–$FF. That's nearly four more rows, or 57 more tiles, usable for maps. (Note that only the first $79 tiles are loaded instead of the full $80; seven tiles, $7A–$7F, are not loaded because the textbox frames and space character go there.)
+Now instead of loading tileset graphics into tiles $00–$5F and $80–$DF, they'll be loaded into $00–$7E and $80–$FF. That's nearly four more rows, or 63 more tiles, usable for maps. (Note that only the first $7F tiles are loaded instead of the full $80; tile $7F, is not loaded because the space character goes there.)
## 2. Update the tilesets' graphics
Edit all the [gfx/tilesets/\*.png](../tree/master/gfx/tilesets/) files with more than six rows of tiles. In each case, we need to add two rows of blank tiles for the $60–$7F range (that is, the seventh and eighth rows). Here's one example, [gfx/tilesets/johto_modern.png](../blob/master/gfx/tilesets/johto_modern.png):
-![gfx/tilesets/johto_modern.png](screenshots/249-tiles_gfx-tilesets-johto_modern.png)
+![gfx/tilesets/johto_modern.png](screenshots/255-tiles_gfx-tilesets-johto_modern.png)
## 3. Update the tilesets' palette maps
@@ -94,10 +94,10 @@ Here's one example, [gfx/tilesets/johto_modern_palette_map.asm](../blob/master/g
- db $ff
-endr
-
-+ tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY
-+ tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY
-+ tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY
-+ tilepal 0, GRAY, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT
++ tilepal 0, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF
++ tilepal 0, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF
++ tilepal 0, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF
++ tilepal 0, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, TEXT
tilepal 1, GRAY, BROWN, BROWN, RED, GREEN, GREEN, GRAY, ROOF
tilepal 1, RED, RED, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF
tilepal 1, ROOF, ROOF, ROOF, GREEN, WATER, GREEN, BROWN, ROOF
@@ -112,7 +112,7 @@ Here's one example, [gfx/tilesets/johto_modern_palette_map.asm](../blob/master/g
tilepal 1, YELLOW, ROOF, ROOF, ROOF, ROOF, ROOF, RED, ROOF
```
-The `GRAY` values are for tiles $60–$78, which can be used for maps, and the `TEXT` values are for $79–$7F, which are still text tiles (the textbox frames and space character).
+The `ROOF` values are for tiles $60–$7E, which can be used for maps, and the `TEXT` value is for $7F, the space character.
## 4. Change which tiles hide sprites behind them
@@ -155,25 +155,26 @@ Edit [engine/overworld/map_objects.asm](../blob/master/engine/overworld/map_obje
## 5. Edit the font graphics
-Eleven text tiles in the $60–$7F range are actually used:
+Of the 32 tiles in the $60–$7F range, only 18 are actually used:
- The black square in [gfx/font/black.png](../blob/master/gfx/font/black.png)
- The up arrow in [gfx/font/up_arrow.png](../blob/master/gfx/font/up_arrow.png)
- The telephone in [gfx/font/phone_icon.png](../blob/master/gfx/font/phone_icon.png)
- The bold **V**, bold **S**, and small colon in the top row of [gfx/font/font_extra.png](../blob/master/gfx/font/font_extra.png)
- The “PO”, “Ké”, curly quotes, and ellipsis in the bottom row of [gfx/font/font_extra.png](../blob/master/gfx/font/font_extra.png)
+- The six textbox frame characters and space character in the bottom row of [gfx/font/font_extra.png](../blob/master/gfx/font/font_extra.png) (actually loaded from [gfx/frames/\*.png](../tree/master/gfx/frames/)
Meanwhile, the six ümläuted letters in [gfx/font/font.png](../blob/master/gfx/font/font.png) are unused, and the decimal point character is identical to the period. So replace them like this:
-![gfx/font/font.png](screenshots/249-tiles_gfx-font-font.png)
+![gfx/font/font.png](screenshots/255-tiles_gfx-font-font.png)
Do the same for [gfx/font/font_inversed.png](../blob/master/gfx/font/font_inversed.png):
-![gfx/font/font_inversed.png](screenshots/249-tiles_gfx-font-font_inversed.png)
+![gfx/font/font_inversed.png](screenshots/255-tiles_gfx-font-font_inversed.png)
And [gfx/font/overworld.png](../blob/master/gfx/font/overworld.png):
-![gfx/font/overworld.png](screenshots/249-tiles_gfx-font-overworld.png)
+![gfx/font/overworld.png](screenshots/255-tiles_gfx-font-overworld.png)
## 6. Delete the unused font graphics
@@ -208,6 +209,34 @@ Edit [gfx/font.asm](../blob/master/gfx/font.asm):
Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm):
```diff
+ _LoadStandardFont:: ; fb449
+- ld de, Font
+- ld hl, vTiles1
+- lb bc, BANK(Font), 128 ; "A" to "9"
+- ld a, [rLCDC]
+- bit rLCDC_ENABLE, a
+- jp z, Copy1bpp
+-
+ ld de, Font
+ ld hl, vTiles1
+ lb bc, BANK(Font), 32 ; "A" to "]"
+ call Get1bpp_2
+ ld de, Font + 32 * LEN_1BPP_TILE
+ ld hl, vTiles1 tile $20
+- lb bc, BANK(Font), 32 ; "a" to $bf
++ lb bc, BANK(Font), 26 ; "a" to "z" (skip "┌" to "┘")
+ call Get1bpp_2
+ ld de, Font + 64 * LEN_1BPP_TILE
+ ld hl, vTiles1 tile $40
+ lb bc, BANK(Font), 32 ; $c0 to "←"
+ call Get1bpp_2
+ ld de, Font + 96 * LEN_1BPP_TILE
+ ld hl, vTiles1 tile $60
+ lb bc, BANK(Font), 32 ; "'" to "9"
+ call Get1bpp_2
+ ret
+ ; fb48a
+
_LoadFontsExtra1:: ; fb48a
- ld de, FontsExtra_SolidBlackGFX
- ld hl, vTiles2 tile "■" ; $60
@@ -221,17 +250,38 @@ Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm):
- ld hl, vTiles2 tile "<BOLD_D>"
- lb bc, BANK(FontExtra), 22 ; "<BOLD_D>" to "ぉ"
- call Get2bpp_2
- jr LoadFrame
-; fb4b0
+ jr LoadFrame
+ ; fb4b0
-_LoadFontsExtra2:: ; fb4b0
+ _LoadFontsExtra2:: ; fb4b0
- ld de, FontsExtra2_UpArrowGFX
- ld hl, vTiles2 tile "▲" ; $61
- ld b, BANK(FontsExtra2_UpArrowGFX)
- ld c, 1
- call Get2bpp_2
- ret
-; fb4be
+ ret
+ ; fb4be
+
+ ...
+
+ LoadFrame: ; fb4cc
+ ld a, [wTextBoxFrame]
+ maskbits NUM_FRAMES
+ ld bc, 6 * LEN_1BPP_TILE
+ ld hl, Frames
+ call AddNTimes
+ ld d, h
+ ld e, l
+- ld hl, vTiles2 tile "┌" ; $79
++ ld hl, vTiles0 tile "┌" ; $ba
+ lb bc, BANK(Frames), 6 ; "┌" to "┘"
+ call Get1bpp_2
+ ld hl, vTiles2 tile " " ; $7f
+ ld de, TextBoxSpaceGFX
+ lb bc, BANK(TextBoxSpaceGFX), 1
+ call Get1bpp_2
+ ret
+ ; fb4f2
```
And edit [mobile/mobile_41.asm](../blob/master/mobile/mobile_41.asm):
@@ -258,6 +308,27 @@ And edit [mobile/mobile_41.asm](../blob/master/mobile/mobile_41.asm):
farcall LoadFrame
ret
; 10649b
+
+ Function10649b: ; 10649b
+ ld a, [wTextBoxFrame]
+ maskbits NUM_FRAMES
+ ld bc, 6 * LEN_1BPP_TILE
+ ld hl, Frames
+ call AddNTimes
+ ld d, h
+ ld e, l
+- ld hl, vTiles2 tile "┌" ; $79
++ ld hl, vTiles0 tile "┌" ; $ba
+ ld c, 6 ; "┌" to "┘"
+ ld b, BANK(Frames)
+ call Function1064c3
+ ld hl, vTiles2 tile " " ; $7f
+ ld de, TextBoxSpaceGFX
+ ld c, 1
+ ld b, BANK(TextBoxSpaceGFX)
+ call Function1064c3
+ ret
+ ; 1064c3
```
@@ -294,20 +365,20 @@ Edit [charmap.asm](../blob/master/charmap.asm):
- charmap "ぇ", $77 ; hiragana small e, unused
- charmap "ぉ", $78 ; hiragana small o, unused
-
-+; Textbox frame characters (from gfx/frames/*.png)
-+
- charmap "┌", $79
- charmap "─", $7a
- charmap "┐", $7b
- charmap "│", $7c
- charmap "└", $7d
- charmap "┘", $7e
- charmap " ", $7f
+- charmap "┌", $79
+- charmap "─", $7a
+- charmap "┐", $7b
+- charmap "│", $7c
+- charmap "└", $7d
+- charmap "┘", $7e
+- charmap " ", $7f
...
; Actual characters (from other graphics files)
++ charmap " ", $7f ; gfx/frames/space.png
++
- ; needed for _LoadFontsExtra1 (see engine/load_font.asm)
- charmap "■", $60 ; gfx/font/black.2bpp
- charmap "▲", $61 ; gfx/font/up_arrow.png
@@ -330,7 +401,13 @@ Edit [charmap.asm](../blob/master/charmap.asm):
- charmap "ä", $c3
- charmap "ö", $c4
- charmap "ü", $c5
--
++ charmap "┌", $ba
++ charmap "─", $bb
++ charmap "┐", $bc
++ charmap "│", $bd
++ charmap "└", $be
++ charmap "┘", $bf
+
charmap "'d", $d0
charmap "'l", $d1
charmap "'m", $d2
@@ -381,6 +458,24 @@ 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):
+
+```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
+```
+
Edit [engine/events/map_name_sign.asm](../blob/master/engine/events/map_name_sign.asm):
```diff
@@ -432,7 +527,7 @@ Edit [engine/events/magikarp.asm](../blob/master/engine/events/magikarp.asm):
; fbbbb
```
-And edit [engine/events/halloffame.asm](../blob/master/engine/events/halloffame.asm):
+Edit [engine/events/halloffame.asm](../blob/master/engine/events/halloffame.asm):
```diff
-HALLOFFAME_COLON EQU $63
@@ -455,18 +550,68 @@ And edit [engine/events/halloffame.asm](../blob/master/engine/events/halloffame.
...
```
+And edit [engine/link/link_2.asm](../blob/master/engine/link/link_2.asm):
+
+```
+ LinkTextbox2: ; 4d35b
+ ...
+
+ .PlaceBorder: ; 4d37e
+ push hl
+ ld a, $76
+ ld [hli], a
+ inc a
+ call .PlaceRow
+ inc a
+ ld [hl], a
+ pop hl
+ ld de, SCREEN_WIDTH
+ add hl, de
+ .loop
+ push hl
+- ld a, "┌"
++ ld a, $77
+ ld [hli], a
+ ld a, " "
+ call .PlaceRow
+- ld [hl], "─"
++ ld [hl], $78
+ pop hl
+ ld de, SCREEN_WIDTH
+ add hl, de
+ dec b
+ jr nz, .loop
+
+- ld a, "┐"
++ ld a, $79
+ ld [hli], a
+- ld a, "│"
++ ld a, $7a
+ call .PlaceRow
+- ld [hl], "└"
++ ld [hl], $7b
+ ret
+ ; 4d3ab
+
+ .PlaceRow: ; 4d3ab
+ ld d, c
+ .row_loop
+ ld [hli], a
+ dec d
+ jr nz, .row_loop
+ ret
+```
+
Now the game will work just like before:
-![Screenshot](screenshots/249-tiles-overworld.png)
+![Screenshot](screenshots/255-tiles-overworld.png)
-...except the VRAM now looks something like this, with 57 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/249-tiles-vram.png)
+![Screenshot](screenshots/255-tiles-vram.png)
Furthermore, Polished Map with the 256 Tiles option checked will correctly load, edit, and save the enlarged tilesets:
-![Screenshot](screenshots/249-tiles-polished-map.png)
-
-Note how the seven `TEXT`-colored tiles are reserved for the textbox frames and space character. So don't place any map tiles there.
+![Screenshot](screenshots/255-tiles-polished-map.png)
-It's technically possible to move the textbox frame tiles into the main font graphic, allowing 255 map tiles. (It is so far not possible to do the same with the space character, because it's used as a more general-purpose "filler/background" tile in many different places.) However, there are some complications with doing so.
+Remember, tile $7F is reserved for the space character, so don't use it for a map tile.
diff --git a/Tutorials.md b/Tutorials.md
index 7b19d4b..5837dde 100644
--- a/Tutorials.md
+++ b/Tutorials.md
@@ -27,7 +27,7 @@ Tutorials may use diff syntax to show edits:
**Upgrades to existing features:**
-- [Expand tilesets from 192 tiles to 249](Expand-tilesets-from-192-tiles-to-249)
+- [Expand tilesets from 192 to 255 tiles](Expand-tilesets-from-192-to-255-tiles)
- [Allow map tiles to appear above sprites (so NPCs can walk behind tiles) with `PRIORITY` colors](Allow-map-tiles-to-appear-above-sprites-\(so-NPCs-can-walk-behind-tiles\)-with-PRIORITY-colors)
- [Remove the 25% failure chance for AI status moves](Remove-the-25%25-failure-chance-for-AI-status-moves)
- [Colored trainer card badges](Colored-trainer-card-badges)
@@ -65,7 +65,6 @@ Tutorials may use diff syntax to show edits:
- Custom DVs for individual trainer teams (allows trainers to have shiny Pokémon)
- Remove all Pokémon sprite animations
- Increase Pokémon sprite animation size, from 128 to 256 tiles
-- Increased tileset size, from 192 to 255 tiles
- Implement dynamic overhead+underfoot bridges
- Pan the camera for cutscenes by making the player invisible
- Gain experience from catching Pokémon
diff --git a/screenshots/249-tiles-polished-map.png b/screenshots/249-tiles-polished-map.png
deleted file mode 100644
index a545d8e..0000000
--- a/screenshots/249-tiles-polished-map.png
+++ /dev/null
Binary files differ
diff --git a/screenshots/249-tiles-vram.png b/screenshots/249-tiles-vram.png
deleted file mode 100644
index 4258c89..0000000
--- a/screenshots/249-tiles-vram.png
+++ /dev/null
Binary files differ
diff --git a/screenshots/249-tiles-overworld.png b/screenshots/255-tiles-overworld.png
index 3af731f..3af731f 100644
--- a/screenshots/249-tiles-overworld.png
+++ b/screenshots/255-tiles-overworld.png
Binary files differ
diff --git a/screenshots/255-tiles-polished-map.png b/screenshots/255-tiles-polished-map.png
new file mode 100644
index 0000000..5c44efa
--- /dev/null
+++ b/screenshots/255-tiles-polished-map.png
Binary files differ
diff --git a/screenshots/255-tiles-vram.png b/screenshots/255-tiles-vram.png
new file mode 100644
index 0000000..bf8134e
--- /dev/null
+++ b/screenshots/255-tiles-vram.png
Binary files differ
diff --git a/screenshots/249-tiles_gfx-font-font.png b/screenshots/255-tiles_gfx-font-font.png
index 7cb4b6e..7cb4b6e 100644
--- a/screenshots/249-tiles_gfx-font-font.png
+++ b/screenshots/255-tiles_gfx-font-font.png
Binary files differ
diff --git a/screenshots/249-tiles_gfx-font-font_inversed.png b/screenshots/255-tiles_gfx-font-font_inversed.png
index 1b10dbd..1b10dbd 100644
--- a/screenshots/249-tiles_gfx-font-font_inversed.png
+++ b/screenshots/255-tiles_gfx-font-font_inversed.png
Binary files differ
diff --git a/screenshots/249-tiles_gfx-font-overworld.png b/screenshots/255-tiles_gfx-font-overworld.png
index 6b8ab1e..6b8ab1e 100644
--- a/screenshots/249-tiles_gfx-font-overworld.png
+++ b/screenshots/255-tiles_gfx-font-overworld.png
Binary files differ
diff --git a/screenshots/249-tiles_gfx-tilesets-johto_modern.png b/screenshots/255-tiles_gfx-tilesets-johto_modern.png
index 7d176db..7d176db 100644
--- a/screenshots/249-tiles_gfx-tilesets-johto_modern.png
+++ b/screenshots/255-tiles_gfx-tilesets-johto_modern.png
Binary files differ