SNES Video / PPU Functions. More...
#include <snes/types.h>Go to the source code of this file.
Macros | |
| #define | BG3_MODE1_PRIORITY_HIGH 0x08 |
| #define | BG_MODE0 0 |
| #define | BG_MODE1 1 |
| #define | BG_MODE2 2 |
| #define | BG_MODE3 3 |
| #define | BG_MODE4 4 |
| #define | BG_MODE5 5 |
| #define | BG_MODE6 6 |
| #define | BG_MODE7 7 |
| #define | LAYER_BG1 0x01 |
| #define | LAYER_BG2 0x02 |
| #define | LAYER_BG3 0x04 |
| #define | LAYER_BG4 0x08 |
| #define | LAYER_OBJ 0x10 |
| #define | RGB(r, g, b) (((b) << 10) | ((g) << 5) | (r)) |
| Create RGB color value. | |
| #define | RGB24(r, g, b) RGB((r) >> 3, (g) >> 3, (b) >> 3) |
| Convert 24-bit RGB to SNES format. | |
| #define | setColor(index, color) |
| Set a single CGRAM color. | |
| #define | setMainScreen(layers) (REG_TM = (u8)(layers)) |
| Enable layers on the main screen. | |
| #define | setSubScreen(layers) (REG_TS = (u8)(layers)) |
| Enable layers on the sub screen. | |
Functions | |
| void | setMode (u8 mode, u8 flags) |
| Set background mode. | |
SNES Video / PPU Functions.
Low-level video functions for PPU control, palette management, and screen modes.
Create RGB color value.
| r | Red (0-31) |
| g | Green (0-31) |
| b | Blue (0-31) |
Convert 24-bit RGB to SNES format.
| r | Red (0-255) |
| g | Green (0-255) |
| b | Blue (0-255) |
| #define setColor | ( | index, | |
| color | |||
| ) |
Set a single CGRAM color.
Writes a 15-bit BGR color to the specified palette index. Works during VBlank or force blank only.
Enable layers on the main screen.
Sets which layers are visible on the main screen (REG_TM $212C). Forgetting to call this (or set REG_TM directly) is the #1 cause of blank screens after consoleInit().
| layers | OR'd combination of LAYER_BG1..LAYER_OBJ |
Enable layers on the sub screen.
Sets which layers are visible on the sub screen (REG_TS $212D). The sub screen is used as the second operand for color math.
| layers | OR'd combination of LAYER_BG1..LAYER_OBJ |
Set background mode.
| mode | Background mode (BG_MODE0-BG_MODE7), optionally OR'd with priority flags |
Mode overview: