summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2023-10-31 14:50:11 +1100
committerGitHub <noreply@github.com>2023-10-31 14:50:11 +1100
commit83ceaf371748aa4b0fe6e54e8aaf879de01ce1d1 (patch)
tree4f0faffc953c1017c01245878aeedec72bfa2607 /include
parent0492c8e89af3806707e44a88379a3c8d9c503ca1 (diff)
z_kankyo Decompiled (3 non-matching) (#1451)
* z_Kankyo progress * build OK * progress * more progress * Kankyo WIP * Add docs * func_800FEAF4 * more docs * func_800FEAF4 * improve Init * Small cleanup * kankyo data * data cleanup * Environment_DrawLensFlare * Match Environment_UpdateSkybox * Match Environment_DrawRainImpl * Start on Environment_UpdateLights * Match Environment_DrawSandstorm * gRainDropDL * Some light renamings * Fix merge * cleanup * improve non-equivalents * cleanup * PR Review * match Environment_UpdatePostmanEvents * PR Review * small improvement to Environment_UpdatePostmanEvents from anon * more cleanup * void * bits * fix comment * improve Environment_UpdateLights * Skybox Stars Docs * PR Review * fix merge * macros * Add comments * PR Review * gRandFloat * bug --------- Co-authored-by: Rozelette <Uberpanzermensch@gmail.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/functions.h2
-rw-r--r--include/regs.h4
-rw-r--r--include/variables.h2
-rw-r--r--include/z64math.h3
-rw-r--r--include/z64save.h14
5 files changed, 19 insertions, 6 deletions
diff --git a/include/functions.h b/include/functions.h
index 907c35b5f..5519036a3 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -537,7 +537,7 @@ void Lib_PlaySfx(u16 sfxId);
void Lib_PlaySfx_2(u16 sfxId);
void Lib_PlaySfx_AtPos(Vec3f* pos, u16 sfxId);
void Lib_Vec3f_TranslateAndRotateY(Vec3f* translation, s16 rotAngle, Vec3f* src, Vec3f* dst);
-void Color_RGB8_Lerp(Color_RGB8* a, Color_RGB8* b, f32 t, Color_RGB8* dst);
+void Color_RGB8_Lerp(Color_RGB8* from, Color_RGB8* to, f32 lerp, Color_RGB8* dst);
void Lib_Nop801004FC(void);
void* Lib_SegmentedToVirtual(void* ptr);
void* Lib_SegmentedToVirtualNull(void* ptr);
diff --git a/include/regs.h b/include/regs.h
index 2d113ea48..354408378 100644
--- a/include/regs.h
+++ b/include/regs.h
@@ -61,6 +61,7 @@ extern RegEditor* gRegEditor;
/* TODO: There are still a few OoT defines here that need confirmation */
+#define R_ENV_DISABLE_DBG REG(9)
#define R_TIME_SPEED REG(15)
#define R_RUN_SPEED_LIMIT REG(45)
@@ -148,6 +149,9 @@ extern RegEditor* gRegEditor;
#define R_REVERSE_FLOOR_INDEX XREG(94)
#define R_MINIMAP_DISABLED XREG(95)
+#define R_ENV_LIGHT1_DIR(i) cREG(3 + (i))
+#define R_ENV_LIGHT2_DIR(i) cREG(6 + (i))
+
#define R_TRANS_FADE_FLASH_ALPHA_STEP iREG(50) // Set to a negative number to start the flash
#define R_ROOM_CULL_DEBUG_MODE iREG(86)
#define R_ROOM_CULL_NUM_ENTRIES iREG(87)
diff --git a/include/variables.h b/include/variables.h
index 743f138ca..2b088fa0c 100644
--- a/include/variables.h
+++ b/include/variables.h
@@ -32,7 +32,7 @@ extern u8* sYaz0MaxPtr;
extern void* gYaz0DecompressDstEnd;
// extern UNK_TYPE4 D_8009CD10;
-extern u32 sRandFloat;
+extern u32 gRandFloat;
// extern UNK_TYPE4 sArenaLockMsg;
extern DmaEntry dmadata[1568];
diff --git a/include/z64math.h b/include/z64math.h
index 4a4d15b98..fa9b0a4ff 100644
--- a/include/z64math.h
+++ b/include/z64math.h
@@ -131,7 +131,10 @@ typedef union {
} MtxF; // size = 0x40
#define LERPIMP(v0, v1, t) ((v0) + (((v1) - (v0)) * (t)))
+#define LERPIMP_ALT(v0, v1, t) (((v1) - (v0)) * (t) + (v0))
+#define S16_LERP(v0, v1, t) ((s16)(((v1) - (v0)) * (t)) + (v0))
#define F32_LERP(v0, v1, t) ((1.0f - (t)) * (f32)(v0) + (t) * (f32)(v1))
+#define F32_LERP_ALT(v0, v1, t) ((f32)(v0) * (1.0f - (t)) + (t) * (f32)(v1))
#define F32_LERPIMP(v0, v1, t) ((f32)(v0) + (((f32)(v1) - (f32)(v0)) * (t)))
#define F32_LERPIMPINV(v0, v1, t) ((f32)(v0) + (((f32)(v1) - (f32)(v0)) / (t)))
#define BINANG_LERPIMP(v0, v1, t) ((v0) + (s16)(BINANG_SUB((v1), (v0)) * (t)))
diff --git a/include/z64save.h b/include/z64save.h
index 25ce107f8..5fffb73c3 100644
--- a/include/z64save.h
+++ b/include/z64save.h
@@ -240,7 +240,7 @@ typedef struct PermanentSceneFlags {
/* 0x08 */ u32 switch1;
/* 0x0C */ u32 clearedRoom;
/* 0x10 */ u32 collectible;
- /* 0x14 */ u32 unk_14; // varies based on scene. For dungeons, floors visited.
+ /* 0x14 */ u32 unk_14; // varies based on scene. For dungeons, floors visited.
/* 0x18 */ u32 rooms;
} PermanentSceneFlags; // size = 0x1C
@@ -1598,9 +1598,8 @@ typedef enum {
#define EVENTINF_THREEDAYRESET_LOST_STICK_AMMO 0x73
#define EVENTINF_THREEDAYRESET_LOST_ARROW_AMMO 0x74
-#define EVENTINF_75 0x75
-#define EVENTINF_76 0x76
-#define EVENTINF_77 0x77
+// Checked in Kankyo as one to store the day: gSaveContext.eventInf[7] & 0xE0
+// EVENTINF_75 to EVENTINF_77
#define CHECK_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] & (1 << ((flag) & 0xF)))
#define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag) & 0xF)))
@@ -1628,6 +1627,13 @@ typedef enum {
#define SET_EVENTINF_DOG_RACE_RACE_STANDING(raceStanding) \
(gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & EVENTINF_DOG_RACE_STATE_MASK) | (raceStanding << 3))
+#define EVENTINF_GET_7_E0 ((gSaveContext.eventInf[7] & 0xE0) >> 5)
+
+#define EVENTINF_SET_7_E0(day, temp) \
+ (temp) = gSaveContext.eventInf[7] & (u8)~0xE0; \
+ (temp) |= (u8)((day) << 5); \
+ gSaveContext.eventInf[7] = (temp)
+
typedef enum {
/* 0 */ DUNGEON_INDEX_WOODFALL_TEMPLE,
/* 1 */ DUNGEON_INDEX_SNOWHEAD_TEMPLE,