summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaizu <jaizu85@gmail.com>2021-11-02 07:27:02 +0100
committerJaizu <jaizu85@gmail.com>2021-11-02 07:27:02 +0100
commit09f2b74d6e2291fa7e4e8004ae7eedc9b7df389e (patch)
treedf811bae18b3ae1ef6fb44cc74f54889aa252a46
parent3154e48dfb1ae597dcc91e5b397fdbf014c10c03 (diff)
Fix Secret Bases (thanks to Citrus Bolt)
-rw-r--r--Triple-layer-metatiles.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/Triple-layer-metatiles.md b/Triple-layer-metatiles.md
index 7affc2c..95aa620 100644
--- a/Triple-layer-metatiles.md
+++ b/Triple-layer-metatiles.md
@@ -199,6 +199,31 @@ static bool8 IsMetatileLayerEmpty(const u16 *src)
Note that when using the `pokemart` you have to absolutely make sure that no triple layer tiles are around the UI elements when the mart is open. The mart uses one BG layer for itself, which we need to take into account here.
+### Fixing Secret Bases
+
+This one is a bit easier. All those changes go to `src/decoration.c`
+
+In `PlaceDecorationGraphicsDataBuffer`:
+
+```diff
+- data->tiles[sDecorTilemaps[shape].tiles[i]] = GetMetatile(data->decoration->tiles[sDecorTilemaps[shape].y[i]] * 8 + sDecorTilemaps[shape].x[i]);
++ data->tiles[sDecorTilemaps[shape].tiles[i]] = GetMetatile(data->decoration->tiles[sDecorTilemaps[shape].y[i]] * 12 + sDecorTilemaps[shape].x[i]);
+```
+
+In `PlaceDecorationGraphics`:
+
+```diff
+- CopyPalette(data->palette, ((u16 *)gTilesetPointer_SecretBaseRedCave->metatiles)[(data->decoration->tiles[0] * 8) + 7] >> 12);
++ CopyPalette(data->palette, ((u16 *)gTilesetPointer_SecretBaseRedCave->metatiles)[(data->decoration->tiles[0] * 12) + 7] >> 12);
+```
+
+In `AddDecorationIconObjectFromObjectEvent`:
+
+```diff
+- CopyPalette(sPlaceDecorationGraphicsDataBuffer.palette, ((u16 *)gTilesetPointer_SecretBaseRedCave->metatiles)[(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0] * 8) + 7] >> 12);
++ CopyPalette(sPlaceDecorationGraphicsDataBuffer.palette, ((u16 *)gTilesetPointer_SecretBaseRedCave->metatiles)[(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0] * 12) + 7] >> 12);
+```
+
## Updating existing tilesets
As mentioned previously this method requires us 4 additional tilemap entries for each metatile. The normal tileset data does not contain that data and at this stage your game will just look corrupted. Luckily we can just run a simple python script to migrate old tilesets. It can be found here: https://gist.github.com/SBird1337/ccfa47b5ef41c454b637735d4574592a