diff options
author | Diegoisawesome <diego@domoreaweso.me> | 2016-10-31 03:14:22 -0500 |
---|---|---|
committer | Diegoisawesome <diego@domoreaweso.me> | 2016-10-31 09:43:17 -0500 |
commit | 4df1937738c4dc39d23f5c4e4b0d6a3774ff1b17 (patch) | |
tree | 4035a8314efc3149a5f818a2589c099643b08850 /include/gba/defines.h | |
parent | 6874afafe545365a52c2262da4e4a84ddf14afaf (diff) |
Ported task.c and others from pokeruby
Diffstat (limited to 'include/gba/defines.h')
-rw-r--r-- | include/gba/defines.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/include/gba/defines.h b/include/gba/defines.h new file mode 100644 index 000000000..0f7f06755 --- /dev/null +++ b/include/gba/defines.h @@ -0,0 +1,61 @@ +#ifndef GUARD_GBA_DEFINES +#define GUARD_GBA_DEFINES + +#include <stddef.h> + +#define TRUE 1 +#define FALSE 0 + +#define IWRAM_DATA __attribute__((section("iwram_data"))) +#define EWRAM_DATA __attribute__((section("ewram_data"))) + +#define ALIGNED(n) __attribute__((aligned(n))) + +#define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) +#define INTR_CHECK (*(u16 *)0x3007FF8) +#define INTR_VECTOR (*(void **)0x3007FFC) + +#define PLTT 0x5000000 +#define PLTT_SIZE 0x400 + +#define BG_PLTT PLTT +#define BG_PLTT_SIZE 0x200 + +#define OBJ_PLTT (PLTT + 0x200) +#define OBJ_PLTT_SIZE 0x200 + +#define VRAM 0x6000000 +#define VRAM_SIZE 0x18000 + +#define BG_VRAM VRAM +#define BG_VRAM_SIZE 0x10000 +#define BG_CHAR_ADDR(n) (BG_VRAM + (0x4000 * (n))) +#define BG_SCREEN_ADDR(n) (BG_VRAM + (0x800 * (n))) + +// text-mode BG +#define OBJ_VRAM0 (VRAM + 0x10000) +#define OBJ_VRAM0_SIZE 0x8000 + +// bitmap-mode BG +#define OBJ_VRAM1 (VRAM + 0x14000) +#define OBJ_VRAM1_SIZE 0x4000 + +#define OAM 0x7000000 +#define OAM_SIZE 0x400 + +#define DISPLAY_WIDTH 240 +#define DISPLAY_HEIGHT 160 + +#define TILE_SIZE_4BPP 32 +#define TILE_SIZE_8BPP 64 + +#define TOTAL_OBJ_TILE_COUNT 1024 + +#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) + +#define RGB_BLACK RGB(0, 0, 0) +#define RGB_WHITE RGB(31, 31, 31) + +#define WIN_RANGE(a, b) (((a) << 8) | (b)) + +#endif // GUARD_GBA_DEFINES |