diff options
| author | Henny022p <73211432+Henny022p@users.noreply.github.com> | 2026-02-08 18:32:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-08 18:32:38 +0100 |
| commit | 5ab63f00e522ff69c5bc987e379f0163943f2833 (patch) | |
| tree | 53622222ac729c6ab6dc75ef7f9bafa8031daf18 /include/vram.h | |
| parent | 73901a0a012d55ebb66a4627dcb246d19737fcb5 (diff) | |
| parent | 5b2cafdc894823d57beee8f3947a391d881d91de (diff) | |
Various code cleanup changes
Diffstat (limited to 'include/vram.h')
| -rw-r--r-- | include/vram.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/include/vram.h b/include/vram.h new file mode 100644 index 00000000..26fa4412 --- /dev/null +++ b/include/vram.h @@ -0,0 +1,81 @@ +#ifndef VRAM_H +#define VRAM_H + +#include "global.h" +#include "entity.h" + +#define MAX_GFX_SLOTS 44 + +typedef enum { + GFX_SLOT_FREE, + GFX_SLOT_UNLOADED, // some sort of free? no longer in use? + GFX_SLOT_STATUS2, // some sort of free? + GFX_SLOT_FOLLOWER, // Set by SetGFXSlotStatus for the following slots + GFX_SLOT_RESERVED, // maybe ready to be loaded? + GFX_SLOT_GFX, + GFX_SLOT_PALETTE +} GfxSlotStatus; + +typedef enum { + GFX_VRAM_0, + GFX_VRAM_1, // uploaded to vram? + GFX_VRAM_2, + GFX_VRAM_3, // not yet uploaded to vram? +} GfxSlotVramStatus; + +typedef struct { + /*0x00*/ u8 status : 4; + /*0x00*/ u8 vramStatus : 4; // Whether the gfx was uploaded to the vram? + /*0x01*/ u8 slotCount; + /*0x02*/ u8 referenceCount; /**< How many entities use this gfx slot */ + /*0x03*/ u8 unk_3; + /*0x04*/ u16 gfxIndex; + /*0x06*/ u16 paletteIndex; + /*0x08*/ const void* palettePointer; +} GfxSlot; + +typedef struct { + /*0x00*/ u8 unk0; + /*0x01*/ u8 unk_1; + /*0x02*/ u8 unk_2; + /*0x03*/ u8 unk_3; + /*0x04*/ GfxSlot slots[MAX_GFX_SLOTS]; +} GfxSlotList; +extern GfxSlotList gGFXSlots; + +static_assert(sizeof(GfxSlotList) == 0x214); + +extern bool32 LoadFixedGFX(Entity*, u32); +extern bool32 LoadSwapGFX(Entity*, u32, u32); +extern void UnloadGFXSlots(Entity*); +extern void sub_080ADD70(void); + +extern u16 gBG0Buffer[0x400]; +extern u16 gBG1Buffer[0x400]; +extern u16 gBG2Buffer[0x400]; +extern u16 gBG3Buffer[0x800]; + +typedef struct { + u8 unk0; + u8 unk1; + u16 unk2; + u8 unk4; + u8 unk5; + u8 unk6; + u8 unk7; +} OAMObj; + +typedef struct { + u8 field_0x0; + u8 field_0x1; + u8 spritesOffset; + u8 updated; + u16 _4; + u16 _6; + u8 _0[0x18]; + struct OamData oam[0x80]; + OAMObj unk[0xA0]; /* todo: affine */ +} OAMControls; +extern OAMControls gOAMControls; + +#endif // VRAM_H |
