Utilities for affine background on GBA. More...
Go to the source code of this file.
Macros | |
| #define | AFFINE_BG_IDX 2 |
| The index of the affine background BGCNT register etc. | |
| #define | AFFINE_BG_PAL_LEN 16 |
| Number of u16 colors available in the palette. | |
| #define | AFFINE_BG_PB (PAL_ROW_LEN * 15) |
| The starting index of the background palette. | |
Enumerations | |
| enum | AffineBackgroundID { AFFINE_BG_NONE , AFFINE_BG_MAIN_MENU , AFFINE_BG_GAME } |
| An ID to specify background rendering types. More... | |
Functions | |
| void | affine_background_init () |
| Initialize resources for affine background rendering. | |
| IWRAM_CODE void | affine_background_hblank () |
| Interrupt routine to update display on HBLANK. | |
| IWRAM_CODE void | affine_background_update () |
| Per-frame update of the affine background. | |
| void | affine_background_set_color (COLOR color) |
| Update the affine background color. | |
| void | affine_background_load_palette (const u16 *src) |
| Set the background palette. | |
| void | affine_background_change_background (enum AffineBackgroundID new_bg) |
| Update the background id. | |
Utilities for affine background on GBA.
Definition in file affine_background.h.
| #define AFFINE_BG_IDX 2 |
The index of the affine background BGCNT register etc.
Definition at line 17 of file affine_background.h.
| #define AFFINE_BG_PAL_LEN 16 |
Number of u16 colors available in the palette.
Definition at line 23 of file affine_background.h.
| #define AFFINE_BG_PB (PAL_ROW_LEN * 15) |
The starting index of the background palette.
Definition at line 29 of file affine_background.h.
| enum AffineBackgroundID |
An ID to specify background rendering types.
Definition at line 34 of file affine_background.h.
| void affine_background_change_background | ( | enum AffineBackgroundID | new_bg | ) |
Update the background id.
Update the background id by configuring display registers and loading the image and palette used for the specified id.
| new_bg | AffineBackgrounID to set |
Definition at line 81 of file affine_background.c.
| IWRAM_CODE void affine_background_hblank | ( | ) |
Interrupt routine to update display on HBLANK.
Definition at line 26 of file affine_background.c.
| void affine_background_init | ( | ) |
Initialize resources for affine background rendering.
Definition at line 19 of file affine_background.c.
| void affine_background_load_palette | ( | const u16 * | src | ) |
Set the background palette.
Must be called with an array of size at least AFFINE_BG_PAL_LEN
| src | pointer to palette to set |
Definition at line 76 of file affine_background.c.
| void affine_background_set_color | ( | COLOR | color | ) |
Update the affine background color.
| color | COLOR to set |
Definition at line 64 of file affine_background.c.
| IWRAM_CODE void affine_background_update | ( | ) |
Per-frame update of the affine background.
Definition at line 39 of file affine_background.c.