diff options
-rw-r--r-- | Expand-tilesets-from-192-to-255-tiles.md | 88 |
1 files changed, 47 insertions, 41 deletions
diff --git a/Expand-tilesets-from-192-to-255-tiles.md b/Expand-tilesets-from-192-to-255-tiles.md index b4e55ad..b76df85 100644 --- a/Expand-tilesets-from-192-to-255-tiles.md +++ b/Expand-tilesets-from-192-to-255-tiles.md @@ -228,26 +228,6 @@ Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm): - ld c, 1 - call Get2bpp_2 ret - - ... - - LoadFrame: - 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 ``` And edit [mobile/mobile_41.asm](../blob/master/mobile/mobile_41.asm): @@ -273,26 +253,6 @@ And edit [mobile/mobile_41.asm](../blob/master/mobile/mobile_41.asm): call Get2bpp farcall LoadFrame ret - - Function10649b: - 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 ``` @@ -489,7 +449,53 @@ Now tiles $60–$7E and $E0–$FE can safely have NPCs on top of them, but tiles ## 9. Change some hard-coded tile placements -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>". (We already did this in [step 3](#4-load-the-updated-font-graphics) for `LoadFrame` and `Function10649b`.) +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>". + +Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm) again: + +```diff + LoadFrame: + 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 +``` + +Edit [mobile/mobile_41.asm](../blob/master/mobile/mobile_41.asm) again: + +```diff + Function10649b: + 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 +``` Edit [engine/menus/naming_screen.asm](../blob/master/engine/menus/naming_screen.asm): |