summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2025-01-03 12:05:50 -0800
committerGitHub <noreply@github.com>2025-01-03 13:05:50 -0700
commitf319c8125023f966901131c7ebe479a6f15a750d (patch)
tree4d0fb626927306305408e4b19b35fa786cd91192 /include
parentcb54eb49e47301ca806a754954bee17e23fe6f40 (diff)
Graph OK (#236)
* graph_proc * game_get_next_game_dlftbl * graph_ct * func_800D38E0_jp * func_800D3C94_jp * graph_dt * graph_main * graph_setup_double_buffer * graph_task_set00 WIP * graph_draw_finish * func_800D3E40_jp * func_800D3E14_jp * Some cleanup * Fix m2ctx.py * graph_task_set00
Diffstat (limited to 'include')
-rw-r--r--include/6FB340.h4
-rw-r--r--include/6FD410.h2
-rw-r--r--include/buffers.h12
-rw-r--r--include/cfbinfo.h16
-rw-r--r--include/code_variables.h5
-rw-r--r--include/game.h2
-rw-r--r--include/gfx.h49
-rw-r--r--include/graph.h16
-rw-r--r--include/speed_meter.h2
-rw-r--r--include/sys_ucode.h10
10 files changed, 86 insertions, 32 deletions
diff --git a/include/6FB340.h b/include/6FB340.h
index ec13f92..f2df10e 100644
--- a/include/6FB340.h
+++ b/include/6FB340.h
@@ -8,7 +8,7 @@
// void func_800D78F4_jp();
// void func_800D7948_jp();
// void func_800D79BC_jp();
-// void func_800D79F4_jp();
+void func_800D79F4_jp(void);
// void func_800D7AE0_jp();
// void func_800D7B60_jp();
// void func_800D7BAC_jp();
@@ -22,7 +22,7 @@
// void func_800D8500_jp();
void func_800D85EC_jp(void);
void func_800D8618_jp(void);
-// void func_800D8644_jp();
+void func_800D8644_jp(void);
// void func_800D8670_jp();
void func_800D87C0_jp(void*, OSPri);
diff --git a/include/6FD410.h b/include/6FD410.h
index 3420caf..71e347a 100644
--- a/include/6FD410.h
+++ b/include/6FD410.h
@@ -10,7 +10,7 @@ UNK_PTR func_800D97A0_jp(u32 arg0);
UNK_PTR func_800D97F8_jp(u32 arg0);
void func_800D986C_jp(s32 arg0);
-extern u32 B_80146080_jp;
+extern s32 B_80146080_jp;
extern UNK_PTR B_80146084_jp;
#endif
diff --git a/include/buffers.h b/include/buffers.h
new file mode 100644
index 0000000..bf8d815
--- /dev/null
+++ b/include/buffers.h
@@ -0,0 +1,12 @@
+#ifndef BUFFERS_H
+#define BUFFERS_H
+
+#include "gfx.h"
+#include "stack.h"
+
+extern STACK(D_80153CC0_jp, 0x400);
+extern STACK(D_801530C0_jp, 0xC00);
+extern STACK(D_801524C0_jp, 0xC00);
+extern GfxPool gGfxPools[2];
+
+#endif
diff --git a/include/cfbinfo.h b/include/cfbinfo.h
index 4f099ac..b8241da 100644
--- a/include/cfbinfo.h
+++ b/include/cfbinfo.h
@@ -2,8 +2,22 @@
#define CFBINFO_H
#include "ultra64.h"
+#include "unk.h"
-// void func_800D2C10_jp();
+typedef struct cfbStruct {
+ /* 0x00 */ void* unk_00;
+ /* 0x04 */ UNK_PTR unk_04;
+ /* 0x08 */ UNK_TYPE1 unk_08[0x1];
+ /* 0x09 */ u8 unk_09;
+ /* 0x0A */ u8 unk_0A;
+ /* 0x0B */ s8 unk_0B;
+ /* 0x0C */ OSViMode* unk_0C;
+ /* 0x10 */ s32 unk_10;
+ /* 0x14 */ f32 unk_14;
+ /* 0x18 */ f32 unk_18;
+} cfbStruct; // size >= 0x1C
+
+cfbStruct* func_800D2C10_jp(void);
// void func_800D2CB4_jp();
// void func_800D2CDC_jp();
diff --git a/include/code_variables.h b/include/code_variables.h
index fd72184..e7d8a9f 100644
--- a/include/code_variables.h
+++ b/include/code_variables.h
@@ -766,7 +766,6 @@ extern s32 fuusen_DEBUG_mode_flag;
// extern UNK_TYPE D_8010EF60_jp;
// extern UNK_TYPE D_8010EF70_jp;
-// extern UNK_TYPE D_8010EFA0_jp;
extern vs32 D_8010EFB0_jp; // TODO: Determine where this goes
// extern UNK_TYPE D_8010EFB8_jp;
// extern UNK_TYPE D_8010EFC0_jp;
@@ -1927,10 +1926,6 @@ extern u16 D_80000400[];
// extern UNK_TYPE B_80144FC0_jp;
// extern UNK_TYPE B_80145014_jp;
-// extern UNK_TYPE B_80145060_jp;
-// extern UNK_TYPE B_80145070_jp;
-// extern UNK_TYPE B_80145080_jp;
-extern u8 B_80145370_jp;
// extern UNK_TYPE B_80145390_jp;
// extern UNK_TYPE B_80145610_jp;
extern OSThread graphThread;
diff --git a/include/game.h b/include/game.h
index 4cb109a..92a873c 100644
--- a/include/game.h
+++ b/include/game.h
@@ -56,7 +56,7 @@ typedef struct Game {
/* 0x88 */ GameAlloc alloc;
/* 0x9C */ u8 unk_9C;
/* 0x9D */ u8 unk_9D;
- /* 0x9E */ s8 unk9E;
+ /* 0x9E */ u8 unk_9E;
/* 0x9F */ u8 running;
/* 0xA0 */ s32 frameCounter;
/* 0xA4 */ s32 unk_A4;
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.
diff --git a/include/graph.h b/include/graph.h
index fe4cc41..7873648 100644
--- a/include/graph.h
+++ b/include/graph.h
@@ -3,20 +3,18 @@
#include "ultra64.h"
+#include "fault.h"
+
struct GraphicsContext;
extern OSThread graphThread;
-// void func_800D38E0_jp();
-// void graph_setup_double_buffer();
-// void game_get_next_game_dlftbl();
-// void func_800D3C94_jp();
-// void graph_ct();
-// void graph_dt();
void func_800D3E14_jp(struct GraphicsContext *gfxCtx);
void func_800D3E40_jp(struct GraphicsContext *gfxCtx);
-// void graph_task_set00();
-// void graph_draw_finish();
-// void graph_main();
+
void graph_proc(void* arg);
+extern FaultClient sGraphFaultClient;
+extern FaultAddrConvClient sGraphFaultAddrConvClient;
+extern struct GraphicsContext graph_class;
+
#endif
diff --git a/include/speed_meter.h b/include/speed_meter.h
index d63d843..57e5ea2 100644
--- a/include/speed_meter.h
+++ b/include/speed_meter.h
@@ -19,6 +19,6 @@ void func_800D8A54_jp(struct_80145020_jp *arg0, struct GraphicsContext* gfxCtx);
// void func_800D8DD4_jp();
// void func_800D8E18_jp();
void func_800D9018_jp(struct_80145020_jp *arg0, struct GraphicsContext* gfxCtx, struct Game *game);
-// void func_800D93F4_jp();
+void func_800D93F4_jp(void);
#endif
diff --git a/include/sys_ucode.h b/include/sys_ucode.h
index 8fc3eb4..8152939 100644
--- a/include/sys_ucode.h
+++ b/include/sys_ucode.h
@@ -3,18 +3,18 @@
#include "ultra64.h"
-extern s64 gspF3DZEX2_NoN_PosLight_fifoTextStart[];
-extern s64 gspF3DZEX2_NoN_PosLight_fifoDataStart[];
+extern u64 gspF3DZEX2_NoN_PosLight_fifoTextStart[];
+extern u64 gspF3DZEX2_NoN_PosLight_fifoDataStart[];
extern u64 gspS2DEX2_fifoTextStart[];
extern u64 gspS2DEX2_fifoDataStart[];
-s64* ucode_GetRspBootTextStart(void);
+u64* ucode_GetRspBootTextStart(void);
size_t ucode_GetRspBootTextSize(void);
-s64* ucode_GetPolyTextStart(void);
-s64* ucode_GetPolyDataStart(void);
+u64* ucode_GetPolyTextStart(void);
+u64* ucode_GetPolyDataStart(void);
u64* ucode_GetSpriteTextStart(void);
u64* ucode_GetSpriteDataStart(void);