Decompile PreRender.c (#319)

* Decompile PreRender.c

* use NON_EQUIVALENT and run format.sh

* Get rid of some magic values

* rename dList/dListp to dListHead/dList

* make func_800C213C NON_MATCHING

* replace more values with SCREEN_WIDTH/SCREEN_HEIGHT

* dList/dListHead with gfxp/gfx
This commit is contained in:
Random
2020-09-15 21:10:19 +02:00
committed by GitHub
parent 203cd19f8a
commit bfef7f8d9d
39 changed files with 699 additions and 1585 deletions
+20 -16
View File
@@ -1520,22 +1520,26 @@ void Gameplay_TriggerRespawn(GlobalContext* globalCtx);
s32 func_800C0CB8(GlobalContext* globalCtx);
s32 func_800C0D28(GlobalContext* globalCtx);
s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw);
// ? func_800C0E70(?);
// ? func_800C0EA8(?);
// ? func_800C0ED8(?);
// ? func_800C0F08(?);
// ? func_800C0F28(?);
// ? func_800C1258(?);
// ? func_800C170C(?);
// ? func_800C1AE8(?);
// ? func_800C1B24(?);
// ? func_800C1F20(?);
// ? func_800C1FA4(?);
// ? func_800C20B4(?);
// ? func_800C24BC(?);
// ? func_800C2500(?);
// ? func_800C2FE4(?);
// ? func_800C3770(?);
void PreRender_SetValuesSave(PreRenderContext* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg);
void PreRender_Init(PreRenderContext* this);
void PreRender_SetValues(PreRenderContext* this, u32 width, u32 height, void* fbuf, void* zbuf);
void PreRender_Destroy(PreRenderContext* this);
void func_800C0F28(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave);
void func_800C1258(PreRenderContext* this, Gfx** gfxp);
void func_800C170C(PreRenderContext* this, Gfx** gfxp, void* fbuf, void* fbufSave, u32 r, u32 g, u32 b, u32 a);
void func_800C1AE8(PreRenderContext* this, Gfx** gfxp, void* fbuf, void* fbufSave);
void func_800C1B24(PreRenderContext* this, Gfx** gfxp, void* fbuf, void* cvgSave);
void func_800C1E9C(PreRenderContext* this, Gfx** gfxp);
void func_800C1F20(PreRenderContext* this, Gfx** gfxp);
void func_800C1FA4(PreRenderContext* this, Gfx** gfxp);
void func_800C20B4(PreRenderContext* this, Gfx** gfxp);
void func_800C2118(PreRenderContext* this, Gfx** gfxp);
void func_800C213C(PreRenderContext* this, Gfx** gfxp);
void func_800C24BC(PreRenderContext* this, Gfx** gfxp);
void func_800C24E0(PreRenderContext* this, Gfx** gfxp);
void func_800C2500(PreRenderContext *this, s32 x, s32 y);
void func_800C2FE4(PreRenderContext* this);
void PreRender_Calc(PreRenderContext* this);
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size);
void THGA_Dt(TwoHeadGfxArena* thga);
u32 THGA_IsCrash(TwoHeadGfxArena* thga);
+27 -12
View File
@@ -1048,14 +1048,32 @@ typedef struct {
} CollisionCheckContext; // size = 0x29C SubGlobalContext11E60
typedef struct ListAlloc {
/* 0x00 */ struct ListAlloc* prev;
/* 0x04 */ struct ListAlloc* next;
} ListAlloc; // size = 0x8
typedef struct {
/* 0x00 */ char unk_00[0x10];
/* 0x10 */ u16* unk_10;
/* 0x14 */ u16* unk_14;
/* 0x18 */ u16* unk_18;
/* 0x1C */ char unk_1C[0x87];
/* 0xA3 */ s8 unk_A3;
} PreRenderContext; // size = 0xA4
/* 0x00 */ s32 width;
/* 0x04 */ s32 height;
/* 0x08 */ s32 widthSave;
/* 0x0C */ s32 heightSave;
/* 0x10 */ u16* fbuf;
/* 0x14 */ u16* fbufSave;
/* 0x18 */ u8* cvgSave;
/* 0x1C */ u16* zbuf;
/* 0x20 */ u16* zbufSave;
/* 0x24 */ s32 ulxSave;
/* 0x28 */ s32 ulySave;
/* 0x2C */ s32 lrxSave;
/* 0x30 */ s32 lrySave;
/* 0x34 */ s32 ulx;
/* 0x38 */ s32 uly;
/* 0x3C */ s32 lrx;
/* 0x40 */ s32 lry;
/* 0x44 */ ListAlloc alloc;
/* 0x4C */ u32 unk_4C;
} PreRenderContext; // size = 0x50
typedef struct {
union {
@@ -1269,6 +1287,8 @@ typedef struct GlobalContext {
/* 0x11E60 */ CollisionCheckContext colChkCtx;
/* 0x120FC */ u16 envFlags[20];
/* 0x12124 */ PreRenderContext preRenderCtx;
/* 0x12174 */ char unk_12174[0x53];
/* 0x121C7 */ s8 unk_121C7;
/* 0x121C8 */ TransitionContext transitionCtx;
/* 0x12418 */ char unk_12418[0x3];
/* 0x1241B */ u8 transitionMode; // "fbdemo_wipe_modem"
@@ -1743,11 +1763,6 @@ typedef struct {
#define KALEIDO_OVL_PLAYER_ACTOR 1
#define KALEIDO_OVL_COUNT 2
typedef struct ListAlloc {
/* 0x00 */ struct ListAlloc* prev;
/* 0x04 */ struct ListAlloc* next;
} ListAlloc; // size = 0x8
typedef struct {
/* 0x00 */ u32 resetting;
/* 0x04 */ u32 resetCount;