diff options
Diffstat (limited to 'include/gfx.h')
| -rw-r--r-- | include/gfx.h | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/include/gfx.h b/include/gfx.h index 3a30c4b..e9a9674 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -2,6 +2,7 @@ #define GFX_H #include "ultra64.h" +#include "PR/sched.h" #include "attributes.h" #include "alignment.h" #include "THA_GA.h" @@ -12,10 +13,42 @@ #define TMEM_SIZE 0x1000 +#define GFXPOOL_HEAD_MAGIC 0x1234 +#define GFXPOOL_TAIL_MAGIC 0x5678 + +typedef struct GfxPool { + /* 0x00000 */ u16 headMagic; + /* 0x00004 */ UNK_TYPE1 unk00004[0x4]; + /* 0x00008 */ Gfx polyOpaBuffer[0x29E0]; + /* 0x14F08 */ Gfx polyXluBuffer[0x800]; + /* 0x18F08 */ Gfx overlayBuffer[0x400]; + /* 0x1AF08 */ Gfx workBuffer[0x80]; + /* 0x1B308 */ UNK_TYPE1 unk1B308[0x100]; + /* 0x1B408 */ Gfx fontBuffer[0x700]; + /* 0x1EC08 */ Gfx shadowBuffer[0x200]; + /* 0x1FC08 */ Gfx lightBuffer[0x100]; + /* 0x20408 */ u16 tailMagic; +} GfxPool; // size = 0x20410 + typedef struct GraphicsContext { - /* 0x000 */ UNK_TYPE1 unk_000[0x8]; + /* 0x000 */ Gfx* polyOpaBuffer; + /* 0x004 */ Gfx* polyXluBuffer; /* 0x008 */ UNK_PTR unk_008; - /* 0x00C */ UNK_TYPE1 unk_00C[0x250]; + /* 0x00C */ UNK_TYPE1 unk_00C[0x4]; + /* 0x010 */ Gfx* overlayBuffer; + /* 0x014 */ Gfx* fontBuffer; + /* 0x018 */ Gfx* shadowBuffer; + /* 0x01C */ Gfx* lightBuffer; + /* 0x020 */ s32 unk_20; + /* 0x024 */ UNK_TYPE1 unk_024[0x20]; + /* 0x044 */ OSMesg msgBuff[8]; + /* 0x064 */ OSMesgQueue* unk_064; + /* 0x068 */ OSMesgQueue queue; + /* 0x080 */ OSScTask task; + /* 0x0D8 */ UNK_TYPE1 unk_0E8[0x188 - 0xD8]; + /* 0x188 */ Gfx* workBuffer; + /* 0x18C */ TwoHeadGfxArena work; + /* 0x19C */ UNK_TYPE1 unk_19C[0xC0]; /* 0x25C */ OSViMode* unk_25C; /* 0x260 */ UNK_TYPE1 unk_260[0x20]; /* 0x280 */ TwoHeadGfxArena overlay; @@ -24,19 +57,20 @@ typedef struct GraphicsContext { /* 0x2B0 */ TwoHeadGfxArena font; /* 0x2C0 */ TwoHeadGfxArena shadow; /* 0x2D0 */ TwoHeadGfxArena light; - /* 0x2E0 */ UNK_TYPE1 unk_2E0[0x4]; + /* 0x2E0 */ u32 gfxPoolIndex; /* 0x2E4 */ UNK_PTR unk_2E4; /* 0x2E8 */ UNK_TYPE1 unk_2E8[0x4]; /* 0x2EC */ s32 unk_2EC; /* 0x2F0 */ u8 unk_2F0; /* 0x2F1 */ UNK_TYPE1 unk_2F1[0x1]; /* 0x2F2 */ u8 unk_2F2; - /* 0x2F3 */ UNK_TYPE1 unk_2F3[0x1]; - /* 0x2F4 */ s32 unk_2F4; - /* 0x2F8 */ s32 unk_2F8; + /* 0x2F3 */ u8 unk_2F3; + /* 0x2F4 */ void (*callback)(struct GraphicsContext*, void*); + /* 0x2F8 */ void* callbackArg; /* 0x2FC */ f32 unk_2FC; /* 0x300 */ f32 unk_300; -} GraphicsContext; // size >= 0x304 + /* 0x304 */ Gfx* unk_304; +} GraphicsContext; // size = 0x308 #define OVERLAY_DISP __gfxCtx->overlay.p #define POLY_OPA_DISP __gfxCtx->polyOpa.p @@ -44,6 +78,7 @@ typedef struct GraphicsContext { #define FONT_DISP __gfxCtx->font.p #define SHADOW_DISP __gfxCtx->shadow.p #define LIGHT_DISP __gfxCtx->light.p +#define WORK_DISP __gfxCtx->work.p // __gfxCtx shouldn't be used directly. // Use the DISP macros defined above when writing to display buffers. |
