summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/functions.h11
-rw-r--r--include/gfx.h9
-rw-r--r--include/macros.h3
-rw-r--r--include/z64.h8
-rw-r--r--include/z64camera.h6
-rw-r--r--include/z64quake.h2
-rw-r--r--include/z64save.h1
-rw-r--r--include/z64transition.h2
-rw-r--r--include/z64visfbuf.h38
9 files changed, 58 insertions, 22 deletions
diff --git a/include/functions.h b/include/functions.h
index c6ac82845..10037d5a4 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -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);
diff --git a/include/gfx.h b/include/gfx.h
index 63b3eadfc..bc309001e 100644
--- a/include/gfx.h
+++ b/include/gfx.h
@@ -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
diff --git a/include/macros.h b/include/macros.h
index bc7439394..c81d50449 100644
--- a/include/macros.h
+++ b/include/macros.h
@@ -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))
diff --git a/include/z64.h b/include/z64.h
index f4a057c23..072a1296a 100644
--- a/include/z64.h
+++ b/include/z64.h
@@ -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
diff --git a/include/z64camera.h b/include/z64camera.h
index ba0f6a614..da27353fd 100644
--- a/include/z64camera.h
+++ b/include/z64camera.h
@@ -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
diff --git a/include/z64quake.h b/include/z64quake.h
index 0150b5404..e98bfbbac 100644
--- a/include/z64quake.h
+++ b/include/z64quake.h
@@ -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
diff --git a/include/z64save.h b/include/z64save.h
index 0b6821038..25ce107f8 100644
--- a/include/z64save.h
+++ b/include/z64save.h
@@ -5,6 +5,7 @@
#include "PR/os.h"
#include "z64item.h"
#include "z64math.h"
+#include "unk.h"
struct GameState;
struct PlayState;
diff --git a/include/z64transition.h b/include/z64transition.h
index fe6027a9f..267098997 100644
--- a/include/z64transition.h
+++ b/include/z64transition.h
@@ -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;
diff --git a/include/z64visfbuf.h b/include/z64visfbuf.h
new file mode 100644
index 000000000..00961b7da
--- /dev/null
+++ b/include/z64visfbuf.h
@@ -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