diff options
-rw-r--r-- | Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md | 34 | ||||
-rw-r--r-- | screenshots/hex-edit-attributes.png | bin | 37508 -> 0 bytes | |||
-rw-r--r-- | screenshots/polished-map-plusplus-goldenrod-city.png | bin | 0 -> 34327 bytes | |||
-rw-r--r-- | screenshots/polished-map-redplusplus-goldenrod-city.png | bin | 28719 -> 0 bytes |
4 files changed, 23 insertions, 11 deletions
diff --git a/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md b/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md index a244f51..d95bb1c 100644 --- a/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md +++ b/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md @@ -21,7 +21,8 @@ This tutorial will show you how to switch from per-tile \*_palette_map.asm files 6. [Declare space in WRAM for on-screen tile attributes](#6-declare-space-in-wram-for-on-screen-tile-attributes) 7. [Continue changing how tile attributes are loaded](#7-continue-changing-how-tile-attributes-are-loaded) 8. [Finish changing how tile attributes are loaded](#8-finish-changing-how-tile-attributes-are-loaded) -9. [Remove unreferenced code in home/ to make room](#9-remove-unreferenced-code-in-home-to-make-room) +9. [Rename \*.blk to \*.ablk](#9-rename-blk-to-ablk) +10. [Remove unreferenced code in home/ to make room](#10-remove-unreferenced-code-in-home-to-make-room) ## 1. Review how tilesets and VRAM work @@ -697,7 +698,24 @@ One more thing: edit [engine/overworld/load_map_part.asm](../blob/master/engine/ The `_LoadMapPart` routine initializes `wSurroundingTiles` with the relevant area of map data. Here we've updated it to also initialize `wSurroundingAttributes`, and switch to the new WRAM bank that both of them are in. -## 9. Remove unreferenced code in home/ to make room +## 9. Rename \*.blk to \*.ablk + +This has no effect on the ROM itself; it's just for convenience when using Polished Map++, as we'll see later. + +Edit [data/maps/blocks.asm](../blob/master/data/maps/blocks.asm), replacing each occurrence of ".blk" with ".ablk". + +Then run this command in the terminal: + +```bash +for f in maps/*.blk; do git mv $f ${f%.blk}.ablk; done +``` + +It will rename every \*.blk file to \*.ablk. + +(If you're not using Git, then just use `mv` instead of `git mv`.) + + +## 10. Remove unreferenced code in home/ to make room We're almost done, but if you run `make` now, it gives an error: @@ -734,14 +752,8 @@ The same tiles can appear in different colors, like lit `YELLOW` and unlit `BROW (By the way, notice that tile $7F is the space character, but is also used as a solid white tile in maps. The [tileset expansion tutorial](Expand-tilesets-from-192-to-255-tiles) emphasizes that you shouldn't use tile $7F in maps because it will always be `TEXT`-colored, but with this block attribute system, that's no longer the case. So you don't need an extra white tile just for mapping.) -The downside to this system is that editing attributes will be a pain in the neck. You can use [Polished Map](https://github.com/Rangi42/polished-map) with the **Monochrome** option (meant for [pokered](https://github.com/pret/pokered/)) to edit maps and tilesets, but none of the attribute data will be applied—which is especially inconvenient if you have flipped tiles. For example, here's how that Goldenrod City map looks in it: - -[](screenshots/polished-map-redplusplus-goldenrod-city.png) - -To edit the attribute.bin files, a hex editor is your only option. Some free hex editors for Windows are [FlexHEX](http://www.flexhex.com/), [HxD](https://mh-nexus.de/en/hxd/), [Frhed](http://frhed.sourceforge.net/en/), [wxMEdit](https://wxmedit.github.io/), [Catch22 HexEdit](https://www.catch22.net/software/hexedit), or [wxHexEditor](https://www.wxhexeditor.org/). - -If your hex editor supports coloring by value, that can make editing a lot easier. For example, here's [Hex Workshop](http://www.hexworkshop.com/) (not a free program) using eight background colors for the different tile colors, eight more for flipped tiles, and yellow foreground text for priority tiles: +Before 2019, this system would have had a major downside: no map editor support for attributes.bin files. You would have had to edit them directly in a hex editor, which is a pain in the neck. However, [Polished Map++](https://github.com/Rangi42/polished-map/tree/plusplus) now exists: a fork of Polished Map specifically for this system. For example, here's how that Goldenrod City map looks in it: -[](screenshots/hex-edit-attributes.png) +[](screenshots/polished-map-plusplus-goldenrod-city.png) -Of course, that's still not as convenient as a map editor that directly supports block attributes, so you can always write one of those and publish it for the community. ;) +That's the reason why we renamed the .blk files to .ablk. You can install Polished Map and Polished Map++ side by side, associating Polished Map with standard .blk files and Polished Map++ with attribute.bin-enabled .ablk files. diff --git a/screenshots/hex-edit-attributes.png b/screenshots/hex-edit-attributes.png Binary files differdeleted file mode 100644 index 9a2b55e..0000000 --- a/screenshots/hex-edit-attributes.png +++ /dev/null diff --git a/screenshots/polished-map-plusplus-goldenrod-city.png b/screenshots/polished-map-plusplus-goldenrod-city.png Binary files differnew file mode 100644 index 0000000..151fd43 --- /dev/null +++ b/screenshots/polished-map-plusplus-goldenrod-city.png diff --git a/screenshots/polished-map-redplusplus-goldenrod-city.png b/screenshots/polished-map-redplusplus-goldenrod-city.png Binary files differdeleted file mode 100644 index 4c733b6..0000000 --- a/screenshots/polished-map-redplusplus-goldenrod-city.png +++ /dev/null |