Clean Up Sequence Structs in Scene/Save/z64 (#1051)

* Clean up sound scene struct

* Follow-up cleaning

* cleanup

* Document forcedSeqId

* Update include/z64save.h

Co-authored-by: fig02 <fig02srl@gmail.com>

* Update include/z64.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
engineer124
2021-12-04 01:49:32 +11:00
committed by GitHub
parent 21a92ab95f
commit 5e9d24fca4
20 changed files with 96 additions and 97 deletions
+2 -2
View File
@@ -899,8 +899,8 @@ void Environment_AdjustLights(GlobalContext* globalCtx, f32 arg1, f32 arg2, f32
s32 Environment_GetBgsDayCount(void);
void Environment_ClearBgsDayCount(void);
s32 Environment_GetTotalDays(void);
void func_800775F0(u16);
s32 func_80077600(void);
void Environment_ForcePlaySequence(u16);
s32 Environment_IsForcedSequenceDisabled(void);
void func_80077624(GlobalContext* globalCtx);
void func_80077684(GlobalContext* globalCtx);
void Environment_WarpSongLeave(GlobalContext* globalCtx);
+3 -3
View File
@@ -1,10 +1,10 @@
#ifndef BGM_H
#define BGM_H
#ifndef SEQUENCE_H
#define SEQUENCE_H
#define NA_BGM_STOP 0x100000FF
#define NA_BGM_GENERAL_SFX 0x0 // General Sound Effects
#define NA_BGM_NATURE_BACKGROUND 0x1 // Environmental nature background sounds
#define NA_BGM_NATURE_AMBIENCE 0x1 // Environmental nature background sounds
#define NA_BGM_FIELD_LOGIC 0x2 // Hyrule Field
#define NA_BGM_FIELD_INIT 0x3 // Hyrule Field Initial Segment From Loading Area
#define NA_BGM_FIELD_MOVE_1 0x4 // Hyrule Field Moving Segment 1
+4 -5
View File
@@ -185,10 +185,9 @@ typedef struct {
} View; // size = 0x128
typedef struct {
/* 0x00 */ u8 seqIndex;
/* 0x01 */ u8 nightSeqIndex;
/* 0x02 */ char unk_02[0x2];
} SoundContext; // size = 0x4
/* 0x00 */ u8 seqId;
/* 0x01 */ u8 natureAmbienceId;
} SequenceContext; // size = 0x2
typedef struct {
/* 0x00 */ s32 enabled;
@@ -1138,7 +1137,7 @@ typedef struct GlobalContext {
/* 0x00790 */ Camera* cameraPtrs[NUM_CAMS];
/* 0x007A0 */ s16 activeCamera;
/* 0x007A2 */ s16 nextCamera;
/* 0x007A4 */ SoundContext soundCtx;
/* 0x007A4 */ SequenceContext sequenceCtx;
/* 0x007A8 */ LightContext lightCtx;
/* 0x007B8 */ FrameAdvanceContext frameAdvCtx;
/* 0x007C0 */ CollisionContext colCtx;
+3 -3
View File
@@ -135,8 +135,8 @@ typedef struct {
/* 0x13D6 */ s16 timerX[2];
/* 0x13DA */ s16 timerY[2];
/* 0x13DE */ char unk_13DE[0x0002];
/* 0x13E0 */ u8 seqIndex;
/* 0x13E1 */ u8 nightSeqIndex;
/* 0x13E0 */ u8 seqId;
/* 0x13E1 */ u8 natureAmbienceId;
/* 0x13E2 */ u8 buttonStatus[5];
/* 0x13E7 */ u8 unk_13E7; // alpha related
/* 0x13E8 */ u16 unk_13E8; // alpha type?
@@ -157,7 +157,7 @@ typedef struct {
/* 0x140A */ u8 audioSetting;
/* 0x140B */ char unk_140B[0x0001];
/* 0x140C */ u8 zTargetSetting; // 0: Switch; 1: Hold
/* 0x140E */ u16 unk_140E; // bgm related
/* 0x140E */ u16 forcedSeqId; // immediately start playing the sequence if set
/* 0x1410 */ u8 unk_1410; // transition related
/* 0x1411 */ char unk_1411[0x0001];
/* 0x1412 */ u16 nextCutsceneIndex;
+5 -5
View File
@@ -157,10 +157,10 @@ typedef struct {
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 bgmId;
/* 0x01 */ u8 specId;
/* 0x02 */ char pad[4];
/* 0x06 */ u8 nightSeqIndex;
/* 0x07 */ u8 seqIndex;
/* 0x06 */ u8 natureAmbienceId;
/* 0x07 */ u8 seqId;
} SCmdSoundSettings;
typedef struct {
@@ -513,8 +513,8 @@ typedef enum {
#define SCENE_CMD_END() \
{ SCENE_CMD_ID_END, 0, CMD_W(0) }
#define SCENE_CMD_SOUND_SETTINGS(audioSessionId, nighttimeSfx, bgmId) \
{ SCENE_CMD_ID_SOUND_SETTINGS, audioSessionId, CMD_BBBB(0, 0, nighttimeSfx, bgmId) }
#define SCENE_CMD_SOUND_SETTINGS(specId, natureAmbienceId, seqId) \
{ SCENE_CMD_ID_SOUND_SETTINGS, specId, CMD_BBBB(0, 0, natureAmbienceId, seqId) }
#define SCENE_CMD_ECHO_SETTINGS(echo) \
{ SCENE_CMD_ID_ECHO_SETTINGS, 0, CMD_BBBB(0, 0, 0, echo) }