diff options
-rw-r--r-- | Add-a-new-tileset.md | 118 | ||||
-rw-r--r-- | Tutorials.md | 2 | ||||
-rw-r--r-- | screenshots/museum-palette.png | bin | 0 -> 1096 bytes |
3 files changed, 113 insertions, 7 deletions
diff --git a/Add-a-new-tileset.md b/Add-a-new-tileset.md index fd3d19e..cdddbd4 100644 --- a/Add-a-new-tileset.md +++ b/Add-a-new-tileset.md @@ -37,7 +37,7 @@ Edit [data/tilesets.asm](../blob/master/data/tilesets.asm): ; - The *GFX, *Meta, and *Coll are defined in gfx/tilesets.asm ; - The *PalMap are defined in gfx/tileset_palette_maps.asm ; - The *Anim are defined in engine/tilesets/tileset_anims.asm - + Tilesets:: ; entries correspond to TILESET_* constants tileset Tileset0 @@ -185,16 +185,16 @@ Edit [gfx/tilesets.asm](../blob/master/gfx/tilesets.asm): ```diff SECTION "Tileset Data 8", ROMX - + TilesetHoOhWordRoomMeta: INCBIN "data/tilesets/ho_oh_word_room_metatiles.bin" - + TilesetKabutoWordRoomMeta: INCBIN "data/tilesets/kabuto_word_room_metatiles.bin" - + TilesetOmanyteWordRoomMeta: INCBIN "data/tilesets/omanyte_word_room_metatiles.bin" - + TilesetAerodactylWordRoomMeta: INCBIN "data/tilesets/aerodactyl_word_room_metatiles.bin" + @@ -251,4 +251,110 @@ Anyway, that's it. Now maps can use `TILESET_MUSEUM` like any other tileset. A few tilesets in pokecrystal have custom palettes. For example, Ice Path uses an entirely different palette from most caves; and Radio Tower uses a subtly different palette that makes `YELLOW` look green and `GREEN` look green-on-blue, so the tops of potted plants look natural against the blue walls. -TODO: custom palette +Here the yellow seats look kind of bright. We could use a different color like `GRAY` or `BROWN`, but let's instead make a custom palette that changes `YELLOW`. + +Create **gfx/tilesets/museum.pal**: + +```diff ++; gray ++ RGB 30, 28, 26 ++ RGB 19, 19, 19 ++ RGB 13, 13, 13 ++ RGB 07, 07, 07 ++; red ++ RGB 30, 28, 26 ++ RGB 31, 19, 24 ++ RGB 30, 10, 06 ++ RGB 07, 07, 07 ++; green ++ RGB 30, 28, 26 ++ RGB 15, 20, 01 ++ RGB 09, 13, 00 ++ RGB 07, 07, 07 ++; water (blue) ++ RGB 30, 28, 26 ++ RGB 15, 16, 31 ++ RGB 09, 09, 31 ++ RGB 07, 07, 07 ++; yellow ++ RGB 30, 28, 26 ++ RGB 28, 22, 03 ++ RGB 21, 14, 02 ++ RGB 07, 07, 07 ++; brown ++ RGB 26, 24, 17 ++ RGB 21, 17, 07 ++ RGB 16, 13, 03 ++ RGB 07, 07, 07 ++; roof (glass) ++ RGB 30, 28, 26 ++ RGB 17, 19, 31 ++ RGB 14, 16, 31 ++ RGB 07, 07, 07 ++; text ++ RGB 31, 31, 16 ++ RGB 31, 31, 16 ++ RGB 14, 09, 00 ++ RGB 00, 00, 00 +``` + +This is based on [gfx/tilesets/house.pal](../blob/master/gfx/tilesets/house.pal), but with the glass-blue indoor `ROOF` colors from [gfx/tilesets/bg_tiles.pal](../blob/master/gfx/tilesets/bg_tiles.pal), and custom `YELLOW` colors that don't look glowing bright. + +Now edit [engine/tilesets/tileset_palettes.asm](../blob/master/engine/tilesets/tileset_palettes.asm): + +```diff + LoadSpecialMapPalette: + ld a, [wMapTileset] + cp TILESET_POKECOM_CENTER + jr z, .pokecom_2f + cp TILESET_BATTLE_TOWER + jr z, .battle_tower + cp TILESET_ICE_PATH + jr z, .ice_path + cp TILESET_HOUSE + jr z, .house + cp TILESET_RADIO_TOWER + jr z, .radio_tower + cp TILESET_MANSION + jr z, .mansion_mobile ++ cp TILESET_MUSEUM ++ jr z, .museum + jr .do_nothing + + ... + + .mansion_mobile + call LoadMansionPalette + scf + ret ++ ++.museum ++ call LoadMuseumPalette ++ scf ++ ret + + .do_nothing + and a + ret + + ... + ++LoadMuseumPalette: ++ ld a, BANK(wBGPals1) ++ ld de, wBGPals1 ++ ld hl, MuseumPalette ++ ld bc, 8 palettes ++ call FarCopyWRAM ++ ret ++ ++MuseumPalette: ++INCLUDE "gfx/tilesets/museum.pal" +``` + +This calls `LoadMuseumPalette` to, er, load `MuseumPalette`, if `[wMapTileset]` is `TILESET_MUSEUM`. + +Now the museum will appear differently: + + + +Note that you can do any sort of condition check in `LoadSpecialMapPalette`, not just for the value of `[wMapTileset]`. You can check for a particular map in `[wMapGroup]` and `[wMapNumber]`; or for the time of day in `[wTimeOfDayPal]`; or so on. diff --git a/Tutorials.md b/Tutorials.md index b2d258a..0a587a6 100644 --- a/Tutorials.md +++ b/Tutorials.md @@ -10,7 +10,7 @@ Tutorials may use diff syntax to show edits: **How to add a new…** - [Map and landmark](Add-a-new-map-and-landmark) -- [Tileset](Add-a-new-tileset) +- [Tileset (with custom palette)](Add-a-new-tileset) - [Pokémon species (up to 253)](Add-a-new-Pokémon) - [Trainer class](Add-a-new-trainer-class) - [Type (Fairy)](Add-a-new-type) diff --git a/screenshots/museum-palette.png b/screenshots/museum-palette.png Binary files differnew file mode 100644 index 0000000..c018d83 --- /dev/null +++ b/screenshots/museum-palette.png |