diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2019-05-18 14:11:16 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2019-05-18 14:11:16 -0400 |
commit | 681c6f3ed62b4c32d714a5a169680e76357462fe (patch) | |
tree | d76729e8487c04c3455314388ab3576f94df6e25 | |
parent | 00a5aed6c3675f57a985e67bcb8472dcf2568179 (diff) |
Complete, clean up, and screenshot
-rw-r--r-- | Edit-the-Town-Map.md | 156 | ||||
-rw-r--r-- | screenshots/town-map-no-borders.png | bin | 0 -> 3487 bytes |
2 files changed, 104 insertions, 52 deletions
diff --git a/Edit-the-Town-Map.md b/Edit-the-Town-Map.md index b694575..9954ce3 100644 --- a/Edit-the-Town-Map.md +++ b/Edit-the-Town-Map.md @@ -8,7 +8,7 @@ The Town Map is a bit tricky to edit: it's one of the only things in pokecrystal 3. [The Johto and Kanto tilemaps](#3-the-johto-and-kanto-tilemaps) 4. [The landmarks](#4-the-landmarks) 5. [GSC Town Map Editor](#5-gsc-town-map-editor) -6. [Remove the Border Tiles](#6-remove-the-border-tiles) +6. [Remove the gray border for more map area](#6-remove-the-gray-border-for-more-map-area) ## 1. The tileset @@ -92,13 +92,13 @@ This means that older versions of pokecrystal have their landmark X coordinates If you're wondering why those offsets exist, it's because of how the GameBoy hardware works. From the [Pan Docs](http://bgb.bircd.org/pandocs.htm#vramspriteattributetableoam): -> **Byte0 - Y Position** -> Specifies the sprites vertical position on the screen (minus 16). +> **Byte0 - Y Position** +> Specifies the sprites vertical position on the screen (minus 16). > An offscreen value (for example, Y=0 or Y>=160) hides the sprite. -> -> **Byte1 - X Position** -> Specifies the sprites horizontal position on the screen (minus 8). -> An offscreen value (X=0 or X>=168) hides the sprite, but the sprite +> +> **Byte1 - X Position** +> Specifies the sprites horizontal position on the screen (minus 8). +> An offscreen value (X=0 or X>=168) hides the sprite, but the sprite > still affects the priority ordering - a better way to hide a sprite is to set its Y-coordinate offscreen. For more information on editing landmarks, see the tutorial on [how to add a new map and landmark](Add-a-new-map-and-landmark). @@ -134,33 +134,31 @@ Now your edited map will show up when you rebuild the project! Note that GSC Town Map Editor, like most old binary hacking tools, makes assumptions about the exact addresses of various content in the ROM. If you make extensive edits to the disassembly project, the addresses could change. Then you'll get an "Access violation" error when you try to pick a region. If that happens, you'll just have to use a hex editor. -## 6. Remove the Border Tiles -When making the map, be aware that the top 3 rows of tiles get covered from the Pokegear icons, the map name, and a row of border tiles. You can decide to work around this by leaving the top 3 rows, including the border, free of landmarks. Or, you can remove the border completely, giving you more room to plan your town map. +## 6. Remove the gray border for more map area -This section will show you how to remove the border tiles from being placed in the Pokegear and any form of the Town Map. +If you're making a large region, you may want to get rid of the gray border around the map to make room for more terrain. But there's more to it than just redesigning the .bin files without any border tiles. The top three rows of tiles are covered by the Pokégear interface, the map name, and the "Where?" prompt when using Fly. -The only file you'll need to edit is [engine/pokegear/pokegear.asm](../blob/master/engine/pokegear/pokegear.asm). +You can minimize those elements by making them only take up two rows. Edit [engine/pokegear/pokegear.asm](../blob/master/engine/pokegear/pokegear.asm): ```diff -InitPokegearTilemap: - -... - -.Map: - ld a, [wPokegearMapPlayerIconLandmark] - cp FAST_SHIP - jr z, .johto - cp KANTO_LANDMARK - jr nc, .kanto -.johto - ld e, 0 - jr .ok - -.kanto - ld e, 1 -.ok - farcall PokegearMap + InitPokegearTilemap: + ... + + .Map: + ld a, [wPokegearMapPlayerIconLandmark] + cp FAST_SHIP + jr z, .johto + cp KANTO_LANDMARK + jr nc, .kanto + .johto + ld e, 0 + jr .ok + + .kanto + ld e, 1 + .ok + farcall PokegearMap - ld a, $07 - ld bc, $12 - hlcoord 1, 2 @@ -169,26 +167,26 @@ InitPokegearTilemap: - ld [hl], $06 - hlcoord 19, 2 - ld [hl], $17 - ld a, [wPokegearMapCursorLandmark] - jp PokegearMap_UpdateLandmarkName + ld a, [wPokegearMapCursorLandmark] + call PokegearMap_UpdateLandmarkName + ret ``` -and -```diff -_TownMap: -... - -.InitTilemap: - ld a, [wTownMapPlayerIconLandmark] - cp KANTO_LANDMARK - jr nc, .kanto2 - ld e, JOHTO_REGION - jr .okay_tilemap - -.kanto2 - ld e, KANTO_REGION -.okay_tilemap - farcall PokegearMap +```diff + _TownMap: + ... + + .InitTilemap: + ld a, [wTownMapPlayerIconLandmark] + cp KANTO_LANDMARK + jr nc, .kanto2 + ld e, JOHTO_REGION + jr .okay_tilemap + + .kanto2 + ld e, KANTO_REGION + .okay_tilemap + farcall PokegearMap - ld a, $07 - ld bc, 6 - hlcoord 1, 0 @@ -207,9 +205,63 @@ _TownMap: - call ByteFill - hlcoord 19, 2 - ld [hl], $17 - ld a, [wTownMapCursorLandmark] - call PokegearMap_UpdateLandmarkName - farcall TownMapPals - ret + ld a, [wTownMapCursorLandmark] + call PokegearMap_UpdateLandmarkName + farcall TownMapPals + ret +``` + +```diff + TownMapBubble: + ; Draw the bubble containing the location text in the town map HUD + + ; Top-left corner +- hlcoord 1, 0 ++ hlcoord 0, 0 + ld a, $30 + ld [hli], a + ; Top row +- ld bc, 16 ++ ld bc, 18 + ld a, " " + call ByteFill + ; Top-right corner + ld a, $31 ++ ld [hli], a +- ld [hl], a +- hlcoord 1, 1 +- +-; Middle row +- ld bc, 18 +- ld a, " " +- call ByteFill +- + ; Bottom-left corner +- hlcoord 1, 2 + ld a, $32 + ld [hli], a + ; Bottom row +- ld bc, 16 ++ ld bc, 18 + ld a, " " + call ByteFill + ; Bottom-right corner + ld a, $33 + ld [hl], a + + ; Print "Where?" +- hlcoord 2, 0 ++ hlcoord 1, 0 + ld de, .Where + call PlaceString + ; Print the name of the default flypoint + call .Name + ; Up/down arrows + hlcoord 18, 1 + ld [hl], $34 + ret ``` -What you'll be removing is code telling the Game Boy to place certain tiles at certain coordinates. The first set deals with the Pokegear map, and the second set deals with any way a player can see the town map outside of the Pokegear. That includes if you make the Town Map item work.
\ No newline at end of file + +Now you'll have more regional real estate: + + diff --git a/screenshots/town-map-no-borders.png b/screenshots/town-map-no-borders.png Binary files differnew file mode 100644 index 0000000..b87f659 --- /dev/null +++ b/screenshots/town-map-no-borders.png |