mirror of
https://github.com/zeldaret/oot
synced 2026-06-01 17:57:57 -04:00
Audio Ocarina Documentation (#1026)
* Begin ocarina documentation * Many ocarina-related docs * More ocarina docs * Introduce Ocarina Fonts Enum * Fix ocarina font enum * Fix incorrect documentation, more documentation * Ocarina recording documentation * cleanup * Small touch-ups * Fix font -> instrument * format * Better docs on playback, memory game * more cleanup * Add z64ocarina.h * Clean up names * final cleanup * typo * Fix description * better docs * Fix channel -> channelIdx * Fix old "font" name to correct "instrument" name, add io port docs * Add comments to clarify certain lines/functions * format * Rename noteIdx to pitch * Missed a name * Add comment on pitch * `reset` -> `SetInstrument` and `displayed` -> `playback` * Clarify audio_update and windmill comment * Minor PR fixes * Revert Audio_Update because there are 2 different Audio_Update functions * PR Feedback * Ocarina Idx -> Index * Introduce OCARINA_BTN_C_RIGHT_OR_C_LEFT * PR Suggestions * Next PR Suggestions * Next PR Feedback * consistency * Better docs (PR) * Better comment
This commit is contained in:
@@ -35,6 +35,9 @@ AudioTask* func_800E4FE0(void) {
|
||||
return func_800E5000();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is Audio_Update for the audio thread
|
||||
*/
|
||||
AudioTask* func_800E5000(void) {
|
||||
static s32 sMaxAbiCmdCnt = 0x80;
|
||||
static AudioTask* sWaitingAudioTask = NULL;
|
||||
@@ -50,13 +53,13 @@ AudioTask* func_800E5000(void) {
|
||||
s32 sp48;
|
||||
s32 i;
|
||||
|
||||
gAudioContext.totalTaskCnt++;
|
||||
if (gAudioContext.totalTaskCnt % (gAudioContext.audioBufferParameters.specUnk4) != 0) {
|
||||
gAudioContext.totalTaskCount++;
|
||||
if (gAudioContext.totalTaskCount % (gAudioContext.audioBufferParameters.specUnk4) != 0) {
|
||||
if (D_801755D0 != NULL) {
|
||||
D_801755D0();
|
||||
}
|
||||
|
||||
if ((gAudioContext.totalTaskCnt % gAudioContext.audioBufferParameters.specUnk4) + 1 ==
|
||||
if ((gAudioContext.totalTaskCount % gAudioContext.audioBufferParameters.specUnk4) + 1 ==
|
||||
gAudioContext.audioBufferParameters.specUnk4) {
|
||||
return sWaitingAudioTask;
|
||||
} else {
|
||||
@@ -64,7 +67,7 @@ AudioTask* func_800E5000(void) {
|
||||
}
|
||||
}
|
||||
|
||||
osSendMesg(gAudioContext.taskStartQueueP, (OSMesg)gAudioContext.totalTaskCnt, OS_MESG_NOBLOCK);
|
||||
osSendMesg(gAudioContext.taskStartQueueP, (OSMesg)gAudioContext.totalTaskCount, OS_MESG_NOBLOCK);
|
||||
gAudioContext.rspTaskIdx ^= 1;
|
||||
gAudioContext.curAIBufIdx++;
|
||||
gAudioContext.curAIBufIdx %= 3;
|
||||
@@ -163,9 +166,9 @@ AudioTask* func_800E5000(void) {
|
||||
|
||||
gAudioContext.curAbiCmdBuf =
|
||||
AudioSynth_Update(gAudioContext.curAbiCmdBuf, &abiCmdCnt, currAiBuffer, gAudioContext.aiBufLengths[index]);
|
||||
gAudioContext.audioRandom = (gAudioContext.audioRandom + gAudioContext.totalTaskCnt) * osGetCount();
|
||||
gAudioContext.audioRandom = (gAudioContext.audioRandom + gAudioContext.totalTaskCount) * osGetCount();
|
||||
gAudioContext.audioRandom =
|
||||
gAudioContext.aiBuffers[index][gAudioContext.totalTaskCnt & 0xFF] + gAudioContext.audioRandom;
|
||||
gAudioContext.aiBuffers[index][gAudioContext.totalTaskCount & 0xFF] + gAudioContext.audioRandom;
|
||||
gWaveSamples[8] = (s16*)(((u8*)func_800E4FE0) + (gAudioContext.audioRandom & 0xFFF0));
|
||||
|
||||
index = gAudioContext.rspTaskIdx;
|
||||
@@ -809,7 +812,7 @@ s32 func_800E66C0(s32 arg0) {
|
||||
u32 Audio_NextRandom(void) {
|
||||
static u32 audRand = 0x12345678;
|
||||
|
||||
audRand = ((osGetCount() + 0x1234567) * (audRand + gAudioContext.totalTaskCnt));
|
||||
audRand = ((osGetCount() + 0x1234567) * (audRand + gAudioContext.totalTaskCount));
|
||||
audRand += gAudioContext.audioRandom;
|
||||
return audRand;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user