mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-13 04:29:30 -04:00
Decomp, update AudioOcarina (code_800EC960.c) (#6941)
This commit is contained in:
+13
-13
@@ -2050,20 +2050,20 @@ void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer);
|
||||
void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer);
|
||||
void AudioSeq_InitSequencePlayerChannels(s32 playerIdx);
|
||||
void AudioSeq_InitSequencePlayers(void);
|
||||
void func_800ECC04(u16);
|
||||
void AudioOcarina_Start(u16);
|
||||
void AudioOcarina_SetInstrument(u8);
|
||||
void Audio_OcaSetSongPlayback(s8 songIdxPlusOne, s8 playbackState);
|
||||
void Audio_OcaSetRecordingState(u8);
|
||||
OcarinaStaff* Audio_OcaGetRecordingStaff(void);
|
||||
OcarinaStaff* Audio_OcaGetPlayingStaff(void);
|
||||
OcarinaStaff* Audio_OcaGetDisplayingStaff(void);
|
||||
void Audio_OcaMemoryGameStart(u8 minigameIdx);
|
||||
s32 Audio_OcaMemoryGameGenNote(void);
|
||||
void func_800EE824(void);
|
||||
void AudioOcarina_SetPlaybackSong(s8 songIdxPlusOne, s8 playbackState);
|
||||
void AudioOcarina_SetRecordingState(u8);
|
||||
OcarinaStaff* AudioOcarina_GetRecordingStaff(void);
|
||||
OcarinaStaff* AudioOcarina_GetPlayingStaff(void);
|
||||
OcarinaStaff* AudioOcarina_GetPlaybackStaff(void);
|
||||
void AudioOcarina_MemoryGameInit(u8 minigameIdx);
|
||||
s32 AudioOcarina_MemoryGameNextNote(void);
|
||||
void AudioOcarina_PlayLongScarecrowSong(void);
|
||||
void AudioDebug_Draw(GfxPrint* printer);
|
||||
void AudioDebug_ScrPrt(const s8* str, u16 num);
|
||||
void func_800F3054(void);
|
||||
void Audio_SetSoundProperties(u8 bankId, u8 entryIdx, u8 channelIdx);
|
||||
void Audio_Update(void);
|
||||
void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIdx);
|
||||
void func_800F3F3C(u8);
|
||||
void func_800F4010(Vec3f* pos, u16 sfxId, f32);
|
||||
void Audio_PlaySoundRandom(Vec3f* pos, u16 baseSfxId, u8 randLim);
|
||||
@@ -2132,7 +2132,7 @@ void Audio_Init();
|
||||
void Audio_InitSound();
|
||||
void func_800F7170(void);
|
||||
void func_800F71BC(s32 arg0);
|
||||
void Audio_SetSoundBanksMute(u16 muteMask);
|
||||
void Audio_SetSfxBanksMute(u16 muteMask);
|
||||
void Audio_QueueSeqCmdMute(u8 channelIdx);
|
||||
void Audio_ClearBGMMute(u8 channelIdx);
|
||||
void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32* a4, s8* reverbAdd);
|
||||
@@ -2143,7 +2143,7 @@ void Audio_StopSfxByBank(u8 bankId);
|
||||
void func_800F8884(u8, Vec3f*);
|
||||
void Audio_StopSfxByPosAndBank(u8, Vec3f*);
|
||||
void Audio_StopSfxByPos(Vec3f*);
|
||||
void func_800F9280(u8 playerIdx, u8 seqId, u8 arg2, u16 fadeTimer);
|
||||
void Audio_StartSequence(u8 playerIdx, u8 seqId, u8 arg2, u16 fadeTimer);
|
||||
void Audio_QueueSeqCmd(u32 bgmID);
|
||||
void Audio_QueuePreviewSeqCmd(u16 seqId);
|
||||
void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId);
|
||||
|
||||
@@ -150,9 +150,10 @@ extern "C"
|
||||
extern u8 gUsedChannelsPerBank[4][7];
|
||||
extern u8 gMorphaTransposeTable[16];
|
||||
extern u8* gFrogsSongPtr;
|
||||
extern OcarinaNote* gScarecrowCustomSongPtr;
|
||||
extern OcarinaNote* gScarecrowLongSongPtr;
|
||||
extern u8* gScarecrowSpawnSongPtr;
|
||||
extern OcarinaSongInfo gOcarinaSongNotes[];
|
||||
extern OcarinaNote sOcarinaSongNotes[OCARINA_SONG_MAX][20];
|
||||
extern OcarinaSongButtons gOcarinaSongButtons[OCARINA_SONG_MAX];
|
||||
extern SoundParams* gSoundParams[7];
|
||||
extern char D_80133390[];
|
||||
extern char D_80133398[];
|
||||
|
||||
+5
-5
@@ -439,7 +439,7 @@ typedef struct {
|
||||
char unk_150[0x10];
|
||||
} SkyboxContext;
|
||||
|
||||
typedef enum {
|
||||
typedef enum OcarinaSongId {
|
||||
/* 0 */ OCARINA_SONG_MINUET,
|
||||
/* 1 */ OCARINA_SONG_BOLERO,
|
||||
/* 2 */ OCARINA_SONG_SERENADE,
|
||||
@@ -452,7 +452,7 @@ typedef enum {
|
||||
/* 9 */ OCARINA_SONG_SUNS,
|
||||
/* 10 */ OCARINA_SONG_TIME,
|
||||
/* 11 */ OCARINA_SONG_STORMS,
|
||||
/* 12 */ OCARINA_SONG_SCARECROW,
|
||||
/* 12 */ OCARINA_SONG_SCARECROW_SPAWN,
|
||||
/* 13 */ OCARINA_SONG_MEMORY_GAME,
|
||||
/* 14 */ OCARINA_SONG_MAX,
|
||||
/* 14 */ OCARINA_SONG_SCARECROW_LONG = OCARINA_SONG_MAX // anything larger than 13 is considered the long scarecrow's song
|
||||
@@ -509,14 +509,14 @@ typedef enum {
|
||||
/* 0x2F */ OCARINA_ACTION_FROGS,
|
||||
/* 0x30 */ OCARINA_ACTION_CHECK_NOWARP, // Check for any of sarias - storms
|
||||
/* 0x31 */ OCARINA_ACTION_CHECK_NOWARP_DONE
|
||||
} OcarinaSongActionIDs;
|
||||
} OcarinaSongActionId;
|
||||
|
||||
typedef enum {
|
||||
typedef enum OcarinaMode {
|
||||
/* 0x00 */ OCARINA_MODE_00,
|
||||
/* 0x01 */ OCARINA_MODE_01,
|
||||
/* 0x02 */ OCARINA_MODE_02,
|
||||
/* 0x03 */ OCARINA_MODE_03,
|
||||
/* 0x04 */ OCARINA_MODE_04,
|
||||
/* 0x04 */ OCARINA_MODE_04, // Stop playing
|
||||
/* 0x05 */ OCARINA_MODE_05,
|
||||
/* 0x06 */ OCARINA_MODE_06,
|
||||
/* 0x07 */ OCARINA_MODE_07,
|
||||
|
||||
+65
-25
@@ -1085,35 +1085,46 @@ typedef struct {
|
||||
u16 params;
|
||||
} SoundParams;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ u8 noteIdx;
|
||||
/* 0x0001 */ u8 unk_01;
|
||||
/* 0x0002 */ u16 unk_02;
|
||||
/* 0x0004 */ u8 volume;
|
||||
/* 0x0005 */ u8 vibrato;
|
||||
/* 0x0006 */ s8 tone;
|
||||
/* 0x0007 */ u8 semitone;
|
||||
/**
|
||||
* semitone Note:
|
||||
* Flag for resolving whether (pitch = OCARINA_PITCH_BFLAT4)
|
||||
* gets mapped to either C_RIGHT and C_LEFT
|
||||
*
|
||||
* This is required as C_RIGHT and C_LEFT are the only notes
|
||||
* that map to two semitones apart (OCARINA_PITCH_A4 and OCARINA_PITCH_B4)
|
||||
* 0x40 - BTN_Z is pressed to lower note by a semitone
|
||||
* 0x80 - BTN_R is pressed to raise note by a semitone
|
||||
*/
|
||||
|
||||
typedef struct OcarinaNote {
|
||||
/* 0x0 */ u8 pitch; // number of semitones above middle C
|
||||
/* 0x2 */ u16 length; // number of frames the note is sustained
|
||||
/* 0x4 */ u8 volume;
|
||||
/* 0x5 */ u8 vibrato;
|
||||
/* 0x6 */ s8 bend; // frequency multiplicative offset from the pitch
|
||||
/* 0x7 */ u8 bFlat4Flag; // See note above
|
||||
} OcarinaNote; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
u8 len;
|
||||
u8 notesIdx[8];
|
||||
} OcarinaSongInfo;
|
||||
typedef struct OcarinaSongButtons {
|
||||
/* 0x0 */ u8 numButtons;
|
||||
/* 0x1 */ u8 buttonsIndex[8];
|
||||
} OcarinaSongButtons; // size = 0x9
|
||||
|
||||
typedef struct {
|
||||
u8 noteIdx;
|
||||
u8 state; // original name: "status"
|
||||
u8 pos; // original name: "locate"
|
||||
} OcarinaStaff;
|
||||
typedef struct OcarinaStaff {
|
||||
/* 0x0 */ u8 buttonIndex;
|
||||
/* 0x1 */ u8 state; // multi-use. Playing: used as songIndex. Playback: used as repeat count of song. Recording: used as OcarinaRecordingState. "status"
|
||||
/* 0x2 */ u8 pos; // "locate"
|
||||
} OcarinaStaff; // size = 0x3
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ OCARINA_NOTE_D4,
|
||||
/* 1 */ OCARINA_NOTE_F4,
|
||||
/* 2 */ OCARINA_NOTE_A4,
|
||||
/* 3 */ OCARINA_NOTE_B4,
|
||||
/* 4 */ OCARINA_NOTE_D5,
|
||||
/* -1 */ OCARINA_NOTE_INVALID = 0xFF
|
||||
} OcarinaNoteIdx;
|
||||
typedef enum OcarinaButtonIndex {
|
||||
/* 0 */ OCARINA_BTN_A,
|
||||
/* 1 */ OCARINA_BTN_C_DOWN,
|
||||
/* 2 */ OCARINA_BTN_C_RIGHT,
|
||||
/* 3 */ OCARINA_BTN_C_LEFT,
|
||||
/* 4 */ OCARINA_BTN_C_UP,
|
||||
/* 5 */ OCARINA_BTN_C_RIGHT_OR_C_LEFT, // Special case for bFlat4: Interface/Overlap between C_RIGHT and C_LEFT
|
||||
/* 0xFF */ OCARINA_BTN_INVALID = 0xFF
|
||||
} OcarinaButtonIndex;
|
||||
|
||||
typedef enum OcarinaInstrumentId {
|
||||
/* 0 */ OCARINA_INSTRUMENT_OFF,
|
||||
@@ -1128,6 +1139,35 @@ typedef enum OcarinaInstrumentId {
|
||||
/* 8 */ OCARINA_INSTRUMENT_DEFAULT_COPY2 = OCARINA_INSTRUMENT_MAX + 1 // Unused but present in Sequence 0 table
|
||||
} OcarinaInstrumentId;
|
||||
|
||||
typedef enum OcarinaRecordingState {
|
||||
/* 0 */ OCARINA_RECORD_OFF,
|
||||
/* 1 */ OCARINA_RECORD_SCARECROW_LONG,
|
||||
/* 2 */ OCARINA_RECORD_SCARECROW_SPAWN,
|
||||
/* 0xFF */ OCARINA_RECORD_REJECTED = 0xFF
|
||||
} OcarinaRecordingState;
|
||||
|
||||
// Uses scientific pitch notation relative to middle C
|
||||
// https://en.wikipedia.org/wiki/Scientific_pitch_notation
|
||||
typedef enum OcarinaPitch {
|
||||
/* 0x0 */ OCARINA_PITCH_C4,
|
||||
/* 0x1 */ OCARINA_PITCH_DFLAT4,
|
||||
/* 0x2 */ OCARINA_PITCH_D4,
|
||||
/* 0x3 */ OCARINA_PITCH_EFLAT4,
|
||||
/* 0x4 */ OCARINA_PITCH_E4,
|
||||
/* 0x5 */ OCARINA_PITCH_F4,
|
||||
/* 0x6 */ OCARINA_PITCH_GFLAT4,
|
||||
/* 0x7 */ OCARINA_PITCH_G4,
|
||||
/* 0x8 */ OCARINA_PITCH_AFLAT4,
|
||||
/* 0x9 */ OCARINA_PITCH_A4,
|
||||
/* 0xA */ OCARINA_PITCH_BFLAT4,
|
||||
/* 0xB */ OCARINA_PITCH_B4,
|
||||
/* 0xC */ OCARINA_PITCH_C5,
|
||||
/* 0xD */ OCARINA_PITCH_DFLAT5,
|
||||
/* 0xE */ OCARINA_PITCH_D5,
|
||||
/* 0xF */ OCARINA_PITCH_EFLAT5,
|
||||
/* 0xFF */ OCARINA_PITCH_NONE = 0xFF
|
||||
} OcarinaPitch;
|
||||
|
||||
typedef struct {
|
||||
char* seqData;
|
||||
int32_t seqDataSize;
|
||||
|
||||
Reference in New Issue
Block a user