diff options
| author | djevangelia <263709373+djevangelia@users.noreply.github.com> | 2026-07-09 17:44:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-09 15:44:29 +0000 |
| commit | 50837308b77ed5ddb0dfe86b2b9fbcb0ce71db80 (patch) | |
| tree | 814c86630028cdd6443b30981864a3406ca1c47d /soh/include | |
| parent | 3249b963432d66a3e71d1b9feca8aa4ceefccb52 (diff) | |
Decomp, update `z_en_holl.c` (#6890)
Diffstat (limited to 'soh/include')
| -rw-r--r-- | soh/include/functions.h | 4 | ||||
| -rw-r--r-- | soh/include/z64.h | 4 | ||||
| -rw-r--r-- | soh/include/z64actor.h | 37 | ||||
| -rw-r--r-- | soh/include/z64save.h | 4 |
4 files changed, 43 insertions, 6 deletions
diff --git a/soh/include/functions.h b/soh/include/functions.h index d371bdd19..611b55be3 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -1238,10 +1238,10 @@ void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 hei u16 tlutCount, f32 offsetX, f32 offsetY); void func_80096FD4(PlayState* play, Room* room); u32 func_80096FE8(PlayState* play, RoomContext* roomCtx); -s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum); +s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 roomNum); s32 func_800973FC(PlayState* play, RoomContext* roomCtx); void Room_Draw(PlayState* play, Room* room, u32 flags); -void func_80097534(PlayState* play, RoomContext* roomCtx); +void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx); void Sample_Destroy(GameState* thisx); void Sample_Init(GameState* thisx); void Inventory_ChangeEquipment(s16 equipment, u16 value); diff --git a/soh/include/z64.h b/soh/include/z64.h index 3c4daf91c..9e46d3c28 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -1084,7 +1084,7 @@ typedef struct { /* 0x00 */ Room curRoom; /* 0x14 */ Room prevRoom; /* 0x28 */ void* bufPtrs[2]; - /* 0x30 */ u8 unk_30; + /* 0x30 */ u8 activeBufPage; /* 0x31 */ s8 status; /* 0x34 */ void* unk_34; /* 0x38 */ DmaRequest dmaRequest; @@ -1477,7 +1477,7 @@ typedef struct PlayState { /* 0x11E14 */ u8 skyboxId; /* 0x11E15 */ s8 transitionTrigger; // "fade_direction" /* 0x11E16 */ s16 unk_11E16; - /* 0x11E18 */ s16 unk_11E18; + /* 0x11E18 */ s16 bgCoverAlpha; /* 0x11E1A */ s16 nextEntranceIndex; /* 0x11E1C */ char unk_11E1C[0x40]; /* 0x11E5C */ s8 shootingGalleryStatus; diff --git a/soh/include/z64actor.h b/soh/include/z64actor.h index 77172bda4..1fbc688b2 100644 --- a/soh/include/z64actor.h +++ b/soh/include/z64actor.h @@ -472,4 +472,41 @@ typedef struct { /* 0x24 */ char unk_24[0x4]; } NpcInteractInfo; // size = 0x28 +// Converts a number of bits to a bitmask, helper for params macros +// e.g. 3 becomes 0b111 (7) +#define NBITS_TO_MASK(n) \ + ((1 << (n)) - 1) + +// Extracts the `n`-bit value at position `s` in `p`, shifts then masks +// Unsigned variant, no possibility of sign extension +#define PARAMS_GET_U(p, s, n) \ + (((p) >> (s)) & NBITS_TO_MASK(n)) + +// Extracts the `n`-bit value at position `s` in `p`, masks then shifts +// Signed variant, possibility of sign extension +#define PARAMS_GET_S(p, s, n) \ + (((p) & (NBITS_TO_MASK(n) << (s))) >> (s)) + +// Extracts all bits past position `s` in `p` +#define PARAMS_GET_NOMASK(p, s) \ + ((p) >> (s)) + +// Extracts the `n`-bit value at position `s` in `p` without shifting it from its current position +#define PARAMS_GET_NOSHIFT(p, s, n) \ + ((p) & (NBITS_TO_MASK(n) << (s))) + +// Moves the `n`-bit value `p` to bit position `s` for building actor parameters by OR-ing these together +#define PARAMS_PACK(p, s, n) \ + (((p) & NBITS_TO_MASK(n)) << (s)) + +// Moves the value `p` to bit position `s` for building actor parameters by OR-ing these together. +#define PARAMS_PACK_NOMASK(p, s) \ + ((p) << (s)) + +// Generates a bitmask for bit position `s` of length `n` +#define PARAMS_MAKE_MASK(s, n) PARAMS_GET_NOSHIFT(~0, s, n) + +#define TRANSITION_ACTOR_PARAMS_INDEX_SHIFT 10 +#define GET_TRANSITION_ACTOR_INDEX(actor) PARAMS_GET_NOMASK((u16)(actor)->params, 10) + #endif diff --git a/soh/include/z64save.h b/soh/include/z64save.h index 35f30c263..baf192aad 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -292,7 +292,7 @@ typedef struct { /* 0x1354 */ s32 fileNum; // "file_no" /* 0x1358 */ char unk_1358[0x0004]; /* 0x135C */ s32 gameMode; - /* 0x1360 */ s32 sceneSetupIndex; // "counter" // Upstream TODO: sceneLayer + /* 0x1360 */ s32 sceneLayer; // "counter" /* 0x1364 */ s32 respawnFlag; // "restart_flag" /* 0x1368 */ RespawnData respawn[RESPAWN_MODE_MAX]; // "restart_data" /* 0x13BC */ f32 entranceSpeed; @@ -423,7 +423,7 @@ typedef enum { /* 4 */ SCENE_LAYER_CUTSCENE_FIRST } SceneLayer; -#define IS_CUTSCENE_LAYER (gSaveContext.sceneSetupIndex >= SCENE_LAYER_CUTSCENE_FIRST) +#define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST) typedef enum { /* 0 */ LINK_AGE_ADULT, |
