diff options
author | i0brendan0 <19826742+i0brendan0@users.noreply.github.com> | 2019-06-06 08:27:34 -0500 |
---|---|---|
committer | i0brendan0 <19826742+i0brendan0@users.noreply.github.com> | 2019-06-06 08:27:34 -0500 |
commit | 4d6ac225bcfe1e1a4462be3e0ec4528aa528b05f (patch) | |
tree | 88bce53cc11db7b9f3f5c5c788aabb85349cfbae | |
parent | c3a5189178b5f512788b5cfa01b31a3b7ec02b1a (diff) |
Updated Expand the Town Map Tile Set (markdown)
-rw-r--r-- | Expand-the-Town-Map-Tile-Set.md | 245 |
1 files changed, 185 insertions, 60 deletions
diff --git a/Expand-the-Town-Map-Tile-Set.md b/Expand-the-Town-Map-Tile-Set.md index f30d195..116b3de 100644 --- a/Expand-the-Town-Map-Tile-Set.md +++ b/Expand-the-Town-Map-Tile-Set.md @@ -2,90 +2,215 @@ Hey guys! This is a tutorial on how to use 34 more tiles on the Town Map! It's actually pretty simple. I recommend reading the [town map editing tutorial](https://github.com/pret/pokecrystal/wiki/Edit-the-Town-Map) first to get to know how the town map works. Please note that GSCTME doesn't support this improvement, so if you're planning on using that for editing the town map, sorry, you'll have to manually edit the [gfx/pokegear/johto.bin](https://github.com/pret/pokecrystal/blob/master/gfx/pokegear/johto.bin) file in a hex editor. -First, edit [engine/pokegear/pokegear.asm](https://github.com/pret/pokecrystal/blob/master/engine/pokegear/pokegear.asm): -```diff -... +First, follow steps 1 - 5 of [Expand-tilesets-from-192-to-255-tiles](https://github.com/pret/pokecrystal/wiki/Expand-tilesets-from-192-to-255-tiles) to move usable text from the bottom left part of VRAM. -Pokegear_LoadGFX: - call ClearVBank1 - ld hl, TownMapGFX - ld de, vTiles2 - ld a, BANK(TownMapGFX) - call FarDecompress -- ld hl, PokegearGFX +Second, edit [engine/pokegear/pokegear.asm](https://github.com/pret/pokecrystal/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 a, BANK(PokegearGFX) -- call FarDecompress - ld hl, PokegearSpritesGFX2 - ld de, vTiles0 - ld a, BANK(PokegearSpritesGFX) - call Decompress - ld a, [wMapGroup] - ld b, a - ld a, [wMapNumber] - ld c, a - call GetWorldMapLocation - cp FAST_SHIP - jr z, .ssaqua -... - -TownMapPals: -; Assign palettes based on tile ids ++ 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 - decoord 0, 0, wAttrMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT -.loop -; Current tile - ld a, [hli] - push hl + 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 is space graphics ++; The palette map covers tiles $00 to $76, $77 and above aren't available - cp $60 -+ cp $7f ++ cp $77 jr nc, .pal0 -... - ``` -then edit [main.asm](https://github.com/pret/pokecrystal/blob/master/main.asm): ```diff -... - --PokegearGFX: --INCBIN "gfx/pokegear/pokegear.2bpp.lz" -- -INCLUDE "engine/pokemon/european_mail.asm" -... - + LoadTownMapGFX: + ld hl, TownMapGFX + ld de, vTiles2 +- lb bc, BANK(TownMapGFX), $30 ++ lb bc, BANK(TownMapGFX), $50 + call DecompressRequest2bpp + ret ``` -This is because we want to load the Town Map graphics and the PokeGear graphics in one file at the same time to make things simpler. (Thanks to i0Brendan0 for that idea.) - -Edit [gfx/pokegear/town_map.png](https://github.com/pret/pokecrystal/blob/master/gfx/pokegear/town_map.png) to include the [pokegear.png](https://github.com/pret/pokecrystal/blob/master/gfx/pokegear/pokegear.png) graphics below it, as well as two more rows (16 pixels) of your own custom graphics below that. Keep in mind that the tile in the bottom-right corner of this must be fully white, as it is the graphic for the spacing between words. Then delete [gfx/pokegear/pokegear.png](https://github.com/pret/pokecrystal/blob/master/gfx/pokegear/pokegear.png). Also delete the associated .2bpp, .2bpp.lz and .2bpp.lz.(some number) files if they exist. - -After you've done this, edit the [gfx/pokegear/town_map_palette_map.asm](https://github.com/pret/pokecrystal/blob/master/gfx/pokegear/town_map_palette_map.asm) file: +Edit gfx/pokegear/town_map_palette_map.asm ```diff -... - -; gfx/pokegear/town_map.png + ; 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 --; gfx/pokegear/pokegear.png ++ 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 -+ 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 ``` -Those four added lines may vary based on how you want to use the tiles. + +Edit the Makefile to get rid of the empty tiles in the pokegear.png file. +```diff +-gfx/pokegear/pokegear.2bpp: rgbgfx += -x2 ++gfx/pokegear/pokegear.2bpp: rgbgfx += -x8 +``` + +Open up 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 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 08 16 01 5B 0A 16 01 69 08 16 01 6F 0A 16 01 69 08 16 01 56 01 7F 01 6A 01 6B 01 6C 01 6D 01 6E 01 7F 02 55 01 16 01 69 08 26 01 07 0A 27 01 69 14 69 14 69 01 7F 12 69 01 69 01 7F 12 69 01 69 01 7F 12 69 01 69 14 FF` + +Open up 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 with + +Replace gfx/pokegear/pokegear.png with + Then, edit [gfx/pokegear/johto.bin](https://github.com/pret/pokecrystal/blob/master/gfx/pokegear/johto.bin) and [gfx/pokegear/kanto.bin](https://github.com/pret/pokecrystal/blob/master/gfx/pokegear/kanto.bin) to use your new tiles where you want them. Done! |