code_80140E80 OK and preliminary documentation, Fbdemo_Wipe4 OK and documented (#1106)

* OK, start documentation

* More documentation

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Decompile func_80167F0C

* FbdemoWipe4 OK and documented

* Mark bug in Wipe4

* More docs

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Mark bug

* Few more notes

* Fix function in Play

* Format

* Review

* Name Play_PostWorldDraw

* functions.h...

* Revert func_80167F0C

* Review

* functions.h

* Review

* Update Wipe4

* Rename system

* Format

* Put skeleton back in the cupboard

* bss

* Fix build

* rename to z_visfbuf

* review

* format

* bss

* some bss cleanup

* review

* bss

* review

---------

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Co-authored-by: angie <angheloalf95@gmail.com>
This commit is contained in:
EllipticEllipsis
2023-10-26 07:42:24 +01:00
committed by GitHub
parent 7176ed4299
commit 6bdb7c31ea
30 changed files with 568 additions and 124 deletions
-11
View File
@@ -897,17 +897,6 @@ void SkinMatrix_SetYRotation(MtxF* mf, s16 a);
void SkinMatrix_MulYRotation(MtxF* mf, s16 a);
void SkinMatrix_SetZRotation(MtxF* mf, s16 a);
void func_80140E80(Struct_80140E80* arg0);
void func_80140EA0(Struct_80140E80* arg0);
// void func_80140EAC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_80141008(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
void func_8014116C(Gfx** gfxP, u16* arg1, u16* workBuffer, s32 width, s32 height, s32 arg5);
// void func_801411B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
// void func_80141200(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_8014151C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_80141678(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
void func_80141778(Struct_80140E80* arg0, Gfx** gfxp, void* unk_18E60, GraphicsContext* gfxCtx);
uintptr_t KaleidoManager_FaultAddrConv(uintptr_t address, void* param);
void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl);
void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl);
+9
View File
@@ -272,4 +272,13 @@ extern Gfx gEmptyDL[];
} \
(void)0
// used only by code_80140E80
#define gDPSetLODColor(pkt, c, m, l, d) \
_DW({ \
Gfx* _g = (Gfx*)(pkt); \
\
_g->words.w0 = (_SHIFTL(c, 24, 8) | _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
_g->words.w1 = (unsigned int)(d); \
})
#endif
+3
View File
@@ -92,7 +92,10 @@
#define ABS_ALT(x) ((x) < 0 ? -(x) : (x))
#define DECR(x) ((x) == 0 ? 0 : --(x))
//! checks min first
#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
//! checks max first
#define CLAMP_ALT(x, min, max) ((x) > (max) ? (max) : (x) < (min) ? (min) : (x))
#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))
-8
View File
@@ -271,12 +271,4 @@ typedef enum {
/* 3 */ PICTO_PHOTO_STATE_READY
} PictoPhotoState;
typedef struct {
/* 0x00 */ u8 mode;
/* 0x04 */ f32 scale;
/* 0x08 */ f32 lodProportion; // expected to be between 0.0f and 1.0f
/* 0x0C */ Color_RGBA8_u32 primColor;
/* 0x10 */ Color_RGBA8_u32 envColor;
} Struct_80140E80; // size = 0x14
#endif
+5 -1
View File
@@ -2,7 +2,11 @@
#define Z64CAMERA_H
#include "ultra64.h"
#include "z64actor.h"
#include "z64save.h"
#include "unk.h"
struct CollisionPoly;
// these two angle conversion macros are slightly inaccurate
#define CAM_DEG_TO_BINANG(degrees) (s16)((degrees) * ((f32)0xFFFF / 360) + .5f)
@@ -373,7 +377,7 @@ typedef enum {
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f norm;
/* 0x18 */ CollisionPoly* poly;
/* 0x18 */ struct CollisionPoly* poly;
/* 0x1C */ VecGeo geoNorm;
/* 0x24 */ s32 bgId;
} CameraCollision; // size = 0x28
+1 -1
View File
@@ -59,7 +59,7 @@ s16 Distortion_GetTimeLeft(void);
s16 Distortion_GetType(void);
void Distortion_RemoveRequest(s32 type);
void Distortion_Init(PlayState* play);
void Distortion_Init(struct PlayState* play);
void Distortion_Update(void);
#endif
+1
View File
@@ -5,6 +5,7 @@
#include "PR/os.h"
#include "z64item.h"
#include "z64math.h"
#include "unk.h"
struct GameState;
struct PlayState;
+1 -1
View File
@@ -81,7 +81,7 @@ typedef struct {
/* 0x8 */ u16 timer;
} TransitionFade; // size = 0xC
#define FBDEMO_CIRCLE_GET_MASK_TYPE(type) (type & 1)
#define FBDEMO_CIRCLE_GET_MASK_TYPE(type) ((type) & 1)
typedef struct {
/* 0x00 */ Color_RGBA8_u32 color;
+38
View File
@@ -0,0 +1,38 @@
#ifndef Z64_VISFBUF_H
#define Z64_VISFBUF_H
#include "ultra64.h"
#include "color.h"
#include "PR/gs2dex.h"
typedef enum VisFbufBgMode {
/* 0 */ VIS_FBUF_BG_CYC_1CYC, //!< Enable rescaling
/* 1 */ VIS_FBUF_BG_CYC_COPY //!< Direct copy, no scaling
} VisFbufBgMode;
typedef enum VisFbufMode {
/* 0 */ VIS_FBUF_MODE_NONE, //!< Do nothing but waste time loading microcode
/* 1 */ VIS_FBUF_MODE_GENERAL, //!< Interpolation, filling and scaling
/* 2 */ VIS_FBUF_MODE_INTERPOLATE
} VisFbufMode;
typedef struct VisFbuf {
/* 0x00 */ u8 mode;
/* 0x04 */ f32 scale;
/* 0x08 */ f32 lodProportion; // expected to be between 0.0f and 1.0f
/* 0x0C */ Color_RGBA8_u32 primColor;
/* 0x10 */ Color_RGBA8_u32 envColor;
} VisFbuf; // size = 0x14
void VisFbuf_Init(VisFbuf* this);
void VisFbuf_Destroy(VisFbuf* this);
void VisFbuf_DrawBgToColorImage(Gfx** gfxP, uObjBg* bg, void* img, s32 width, s32 height, VisFbufBgMode cycleMode);
void VisFbuf_SetBg(Gfx** gfxP, void* source, void* img, s32 width, s32 height, f32 x, f32 y, f32 scaleX, f32 scaleY, VisFbufBgMode cycleMode);
void VisFbuf_SetBgSimple(Gfx** gfxP, void* source, void* img, s32 width, s32 height, VisFbufBgMode cycleMode);
void VisFbuf_SetBgGeneral(Gfx** gfxP, void* source, void* img, s32 width, s32 height, f32 x, f32 y, f32 scaleX, f32 scaleY, VisFbufBgMode cycleMode);
void VisFbuf_ApplyEffects(VisFbuf* this, Gfx** gfxP, void* source, void* img, s32 width, s32 height);
void VisFbuf_DrawGeneral(VisFbuf* this, Gfx** gfxP, void* source, void* img, s32 width, s32 height);
void VisFbuf_DrawInterpolate(VisFbuf* this, Gfx** gfxP, void* img, s32 width, s32 height);
void VisFbuf_Draw(VisFbuf* this, Gfx** gfxP, void* img);
#endif