summaryrefslogtreecommitdiff
path: root/include/vram.h
diff options
context:
space:
mode:
authorHenny022p <info@henny022.de>2025-03-05 17:09:01 +0000
committerHenny022p <info@henny022.de>2025-03-09 18:58:01 +0000
commit3b9b1a388beba1d8293bea15352775a6139d3d52 (patch)
tree5c858381f0fe8880b162f1688192d0255c2e589e /include/vram.h
parentd602b93c8d5a81d9d92425d16dd45a36f6450878 (diff)
cleanup headers
Diffstat (limited to 'include/vram.h')
-rw-r--r--include/vram.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/vram.h b/include/vram.h
new file mode 100644
index 00000000..a3fde71c
--- /dev/null
+++ b/include/vram.h
@@ -0,0 +1,53 @@
+#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);
+
+#endif //VRAM_H