summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortustin2121 <tustin2121@gmail.com>2020-09-22 14:17:06 -0400
committertustin2121 <tustin2121@gmail.com>2020-09-22 14:17:06 -0400
commit741e345b3084b371fa7ddd2eff24bd9d741e4eb6 (patch)
tree54b9d7d1f2c83b54c9101dc94d08e764c689175b
parent9cdf68ead9a4fcebec07277e8348b98356d5e4f4 (diff)
Palette information
-rw-r--r--Random-Info,-Tips,-and-Tricks.md12
1 files changed, 11 insertions, 1 deletions
diff --git a/Random-Info,-Tips,-and-Tricks.md b/Random-Info,-Tips,-and-Tricks.md
index 0a1bfe1..7a526f0 100644
--- a/Random-Info,-Tips,-and-Tricks.md
+++ b/Random-Info,-Tips,-and-Tricks.md
@@ -46,7 +46,8 @@ Every map has a scripting header, which can contain a number of scripts that can
- It's most common to do metatile changes to the map during `ON_LOAD` or rarely `ON_RESUME`, as the tiles haven't yet been drawn when these scripts are called. Other times you will likely need to make the special script call to `DrawWholeMapView` in order to redraw the map.
- The `ON_RETURN_TO_FIELD` script is used to set up transient field effects which are not part of the tilemap or object list, such as the rotation gates in Fortree Gym.
-## VRAM
+## Video
+### VRAM
VRAM, or Video RAM, is the part of memory where the GBA graphics are stored for use on the screen itself.
- VRAM is not just another part of memory. It has special write access limitations.
- On hardware and emulators that are accurate enough like mGBA, VRAM can only be written to during VBLANK.
@@ -57,3 +58,12 @@ VRAM, or Video RAM, is the part of memory where the GBA graphics are stored for
- Backgrounds have tile data and tilemap data. The latter references the former. Tile data is the actual pixels that make up a graphic. Tilemap data is which blocks of tile data make up the background map.
- `BG_CHAR_ADDR()` resolves a pointer to the tile data.
- `BG_SCREEN_ADDR()` resolves a pointer to the tilemap data.
+
+### Palettes
+The GBA has 32 palettes of 16 colors each: 16 palettes are for backgrounds, and 16 are for sprites.
+- See the Overworld section for palettes used in the overworld.
+- The game has two palette buffers in Working RAM: `gPlttBufferUnfaded` holds the unprocessed palettes, and `gPlttBufferFaded` holds the same palettes after they've been processed through fading effects. Every frame, the game copies from `gPlttBufferFaded` directly into Palette Memory in VRAM.
+ - Some modifications may tell you to add a third palette buffer for screen effects like weather or time of day. The vanilla game uses the faded buffer for weather effects.
+ - There are several blending and tinting functions for the palettes already in vanilla emerald, including a sepia tone and monochrome ons.
+ - Take care when using the blending functions, as the functions do not have any concept of clamping, and so can easily wrap around and cause odd (but harmless) visual effects, especially when blending with a color that's not black or white.
+ - The vanilla game's lightning effect uses a table of tints per color, carefully selected to not do the above wrapping.