summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authori0brendan0 <i0brendan0@github.com>2019-06-10 00:10:39 -0500
committeri0brendan0 <i0brendan0@github.com>2019-06-10 00:10:39 -0500
commitcfd2eaa4231d8c6ca9c9cf18a9d6ddf9fe8b8af6 (patch)
treeccdafeb8614e3177edef07107d5384a575708f19
parent1c9d30add8ff09f2c1d5e26198904452b1c6c913 (diff)
Add alternate Town Map tileset expansion
-rw-r--r--Expand-the-Town-Map-tileset-Alternate.md234
-rw-r--r--Expand-the-Town-Map-tileset.md1
-rw-r--r--screenshots/expanded-town-map-tileset.png.pngbin0 -> 798 bytes
3 files changed, 235 insertions, 0 deletions
diff --git a/Expand-the-Town-Map-tileset-Alternate.md b/Expand-the-Town-Map-tileset-Alternate.md
new file mode 100644
index 0000000..67f93aa
--- /dev/null
+++ b/Expand-the-Town-Map-tileset-Alternate.md
@@ -0,0 +1,234 @@
+This is an alternative tutorial on how to expand the Town Map's Tileset. It has more changes but allows you to keep the PokeGear and Town Map images separate and keeps the PokeGear tiles from being loaded when they don't need to be. This tutorial supports only adding another 32 tiles. If you need any more, follow the main tutorial.
+
+*WARNING* DO NOT USE BOTH TUTORIALS
+
+## Move text out of the way
+
+Follow steps 1 - 5 of [Expand-tilesets-from-192-to-255-tiles](Expand-tilesets-from-192-to-255-tiles) to move usable text from the bottom left part of VRAM. Skip if you've already done it.
+
+## Replace tile IDs
+
+Edit [engine/pokegear/pokegear.asm](../blob/master/engine/pokegear/pokegear.asm):
+```diff
+ Pokegear_LoadGFX:
+ call ClearVBank1
+ ld hl, TownMapGFX
+ ld de, vTiles2
+ ld a, BANK(TownMapGFX)
+ call FarDecompress
+ ld hl, PokegearGFX
+- ld de, vTiles2 tile $30
++ ld de, vTiles2 tile $50
+ ld a, BANK(PokegearGFX)
+ call FarDecompress
+```
+```diff
+ InitPokegearTilemap:
+ xor a
+ ldh [hBGMapMode], a
+ hlcoord 0, 0
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+- ld a, $4f
++ ld a, $6f
+```
+```diff
+ .PlacePhoneBars:
+ hlcoord 17, 1
+- ld a, $3c
++ ld a, $5c
+ ld [hli], a
+ inc a
+ ld [hl], a
+ hlcoord 17, 2
+ inc a
+ ld [hli], a
+ call GetMapPhoneService
+ and a
+ ret nz
+ hlcoord 18, 2
+- ld [hl], $3f
++ ld [hl], $5f
+ ret
+```
+```diff
+ Pokegear_FinishTilemap:
+ hlcoord 0, 0
+ ld bc, $8
+- ld a, $4f
++ ld a, $6f
+ call ByteFill
+ hlcoord 0, 1
+ ld bc, $8
+- ld a, $4f
++ ld a, $6f
+ call ByteFill
+ ld de, wPokegearFlags
+ ld a, [de]
+ ...
+ call nz, .PlaceRadioIcon
+ hlcoord 0, 0
+- ld a, $46
++ ld a, $66
+ call .PlacePokegearCardIcon
+ ret
+
+ .PlaceMapIcon:
+ hlcoord 2, 0
+- ld a, $40
++ ld a, $60
+ jr .PlacePokegearCardIcon
+
+ .PlacePhoneIcon:
+ hlcoord 4, 0
+- ld a, $44
++ ld a, $64
+ jr .PlacePokegearCardIcon
+
+ .PlaceRadioIcon:
+ hlcoord 6, 0
+- ld a, $42
++ ld a, $62
+```
+```diff
+ PokegearMap_UpdateLandmarkName:
+ push af
+ hlcoord 8, 0
+ lb bc, 2, 12
+ call ClearBox
+ pop af
+ ld e, a
+ push de
+ farcall GetLandmarkName
+ pop de
+ farcall TownMap_ConvertLineBreakCharacters
+ hlcoord 8, 0
+- ld [hl], $34
++ ld [hl], $54
+ ret
+```
+```diff
+ _FlyMap:
+ ...
+ ld de, FlyMapLabelBorderGFX
+- ld hl, vTiles2 tile $30
++ ld hl, vTiles2 tile $50
+ lb bc, BANK(FlyMapLabelBorderGFX), 6
+ call Request1bpp
+```
+```diff
+ TownMapBubble:
+ ; Draw the bubble containing the location text in the town map HUD
+
+ ; Top-left corner
+ hlcoord 1, 0
+- ld a, $30
++ ld a, $50
+ ld [hli], a
+ ...
+ ; Top-right corner
+- ld a, $31
++ ld a, $51
+ ld [hl], a
+ hlcoord 1, 1
+ ...
+ ; Bottom-left corner
+ hlcoord 1, 2
+- ld a, $32
++ ld a, $52
+ ld [hli], a
+ ...
+ ; Bottom-right corner
+- ld a, $33
++ ld a, $53
+ ld [hl], a
+ ...
+ ; Up/down arrows
+ hlcoord 18, 1
+- ld [hl], $34
++ ld [hl], $54
+ ret
+```
+```diff
+ TownMapPals:
+ ; Assign palettes based on tile ids
+ hlcoord 0, 0
+ decoord 0, 0, wAttrMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ .loop
+ ; Current tile
+ ld a, [hli]
+ push hl
+-; The palette map covers tiles $00 to $5f; $60 and above use palette 0
++; The palette map covers tiles $00 to $7e, $7f and above aren't available
+- cp $60
++ cp $7f
+ jr nc, .pal0
+```
+```diff
+ LoadTownMapGFX:
+ ld hl, TownMapGFX
+ ld de, vTiles2
+- lb bc, BANK(TownMapGFX), $30
++ lb bc, BANK(TownMapGFX), $50
+ call DecompressRequest2bpp
+ ret
+```
+
+## Add two rows of palettes
+
+Edit [gfx/pokegear/town_map_palette_map.asm](../blob/master/gfx/pokegear/town_map_palette_map.asm)
+```diff
+ ; gfx/pokegear/town_map.png
+ townmappals EARTH, EARTH, EARTH, MOUNTAIN, MOUNTAIN, MOUNTAIN, BORDER, BORDER
+ townmappals EARTH, EARTH, CITY, EARTH, POI, POI_MTN, POI, POI_MTN
+ townmappals EARTH, EARTH, EARTH, MOUNTAIN, MOUNTAIN, MOUNTAIN, BORDER, BORDER
+ townmappals EARTH, EARTH, BORDER, EARTH, EARTH, BORDER, BORDER, BORDER
+ townmappals EARTH, EARTH, EARTH, MOUNTAIN, MOUNTAIN, MOUNTAIN, BORDER, BORDER
+ townmappals BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER
++ townmappals BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER
++ townmappals BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER
++ townmappals BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER
++ townmappals BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER
+ ; gfx/pokegear/pokegear.png
+ townmappals BORDER, BORDER, BORDER, BORDER, POI, POI, POI, BORDER
+ townmappals BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER
+ townmappals CITY, CITY, CITY, CITY, CITY, CITY, CITY, CITY
+ townmappals CITY, CITY, CITY, CITY, CITY, CITY, CITY, BORDER
+ townmappals CITY, CITY, CITY, CITY, CITY, CITY, CITY, CITY
+ townmappals BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER
+```
+
+## Fix the PokeGear tilemaps
+
+Open up [gfx/pokegear/clock.tilemap.rle](../blob/master/gfx/pokegear/clock.tilemap.rle) in a hex editor of your choosing and replace it with
+`6F 08 6F 04 50 01 7F 06 51 01 6F 08 6F 04 7F 08 6F 0C 52 01 7F 06 53 01 6F 14 6F 02 06 01 07 0E 17 01 6F 02 6F 02 16 01 7F 0E 16 01 6F 02 6F 02 16 01 7F 0E 16 01 6F 02 6F 02 16 01 7F 0E 16 01 6F 02 6F 02 16 01 7F 0E 16 01 6F 02 6F 02 16 01 7F 0E 16 01 6F 02 6F 02 26 01 07 0E 27 01 6F 02 6F 14 FF`
+
+Open up [gfx/pokegear/radio.tilemap.rle](../blob/master/gfx/pokegear/radio.tilemap.rle) in a hex editor and replace it with
+`6F 08 06 01 07 0A 17 01 6F 08 16 01 6F 02 57 01 6F 01 58 01 59 01 6F 01 5A 01 6F 02 16 01 68 01 6A 07 16 01 5B 0A 16 01 6C 01 6E 07 16 01 6F 0A 16 01 6C 01 6E 07 16 01 56 01 7F 01 78 01 79 01 7A 01 7B 01 7C 01 7D 01 7F 01 55 01 16 01 6C 01 6E 07 26 01 07 0A 27 01 6C 01 6E 12 6D 01 6C 01 6E 12 6D 01 6C 01 7F 12 6D 01 6C 01 7F 12 6D 01 6C 01 7F 12 6D 01 6C 01 6E 12 6D 01 FF`
+
+Open up [gfx/pokegear/phone.tilemap.rle](../blob/master/gfx/pokegear/phone.tilemap.rle) in a hex editor and replace it with
+`6F 08 06 01 07 0A 17 01 6F 08 16 01 6F 0A 16 01 06 01 07 07 27 01 6F 0A 16 01 16 01 7F 12 16 01 16 01 7F 12 16 01 16 01 7F 12 16 01 16 01 7F 12 16 01 16 01 7F 12 16 01 16 01 7F 12 16 01 16 01 7F 12 16 01 16 01 7F 12 16 01 16 01 7F 12 16 01 FF`
+
+Replace [gfx/pokegear/town_map.png](../blob/master/gfx/pokegear/town_map.png) with the file below, or a new image with new tiles. Keep it 128x40 with border tiles in the same place as the ones below.
+
+![gfx/pokegear/town_map.png](screenshots/expanded-town-map-tileset.png)
+
+## Fix Pokedex
+
+Edit [engine/pokedex/pokedex.asm](../blob/master/engine/pokedex/pokedex.asm)
+```diff
+ DexEntryScreen_MenuActionJumptable:
+ ...
+ .Area:
+ ...
+ predef Pokedex_GetArea
+ call Pokedex_BlackOutBG
++ call Pokedex_LoadGFX
++ call Pokedex_LoadAnyFootprint
+
+```
+That will fix the tiles not being right when exiting the map.
+
+## Create your own map
+
+Then, edit [gfx/pokegear/johto.bin](,,/blob/master/gfx/pokegear/johto.bin) and [gfx/pokegear/kanto.bin](../blob/master/gfx/pokegear/kanto.bin) following the [Edit-the-Town-Map](Edit-the-Town-Map) tutorial.
diff --git a/Expand-the-Town-Map-tileset.md b/Expand-the-Town-Map-tileset.md
index cfe4135..78474df 100644
--- a/Expand-the-Town-Map-tileset.md
+++ b/Expand-the-Town-Map-tileset.md
@@ -2,6 +2,7 @@
(Note that the GSC Town Map Editor doesn't support this improvement, so you'll have to manually edit the [gfx/pokegear/johto.bin](../blob/master/gfx/pokegear/johto.bin) and [gfx/pokegear/kanto.bin](../blob/master/gfx/pokegear/kanto.bin) files in a hex editor.)
+[This alternate tutorial](Expand-the-Town-Map-tileset-Alternate) shows another way to do the same thing. It's more in depth but allows the Town Map tiles to be consecutive.
## Contents
diff --git a/screenshots/expanded-town-map-tileset.png.png b/screenshots/expanded-town-map-tileset.png.png
new file mode 100644
index 0000000..17de81d
--- /dev/null
+++ b/screenshots/expanded-town-map-tileset.png.png
Binary files differ