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:
engineer124
2022-05-10 02:59:23 +10:00
committed by GitHub
parent 6cd8029cd5
commit 95b4317931
26 changed files with 1872 additions and 1593 deletions
+129 -129
View File
@@ -404,135 +404,135 @@ f32 gBendPitchTwoSemitonesFrequencies[] = {
1.117368f, 1.118385f, 1.119403f, 1.120422f, 1.121441f, 1.122462f,
};
f32 gNoteFrequencies[] = {
/* 0x00 */ 0.105112f, // NOTE_A0
/* 0x01 */ 0.111362f, // NOTE_BFLAT0
/* 0x02 */ 0.117984f, // NOTE_B0
/* 0x03 */ 0.125f, // NOTE_C1
/* 0x04 */ 0.132433f, // NOTE_DFLAT1
/* 0x05 */ 0.140308f, // NOTE_D1
/* 0x06 */ 0.148651f, // NOTE_EFLAT1
/* 0x07 */ 0.15749f, // NOTE_E1
/* 0x08 */ 0.166855f, // NOTE_F1
/* 0x09 */ 0.176777f, // NOTE_GFLAT1
/* 0x0A */ 0.187288f, // NOTE_G1
/* 0x0B */ 0.198425f, // NOTE_AFLAT1
/* 0x0C */ 0.210224f, // NOTE_A1
/* 0x0D */ 0.222725f, // NOTE_BFLAT1
/* 0x0E */ 0.235969f, // NOTE_B1
/* 0x0F */ 0.25f, // NOTE_C2
/* 0x10 */ 0.264866f, // NOTE_DFLAT2
/* 0x11 */ 0.280616f, // NOTE_D2
/* 0x12 */ 0.297302f, // NOTE_EFLAT2
/* 0x13 */ 0.31498f, // NOTE_E2
/* 0x14 */ 0.33371f, // NOTE_F2
/* 0x15 */ 0.353553f, // NOTE_GFLAT2
/* 0x16 */ 0.374577f, // NOTE_G2
/* 0x17 */ 0.39685f, // NOTE_AFLAT2
/* 0x18 */ 0.420448f, // NOTE_A2
/* 0x19 */ 0.445449f, // NOTE_BFLAT2
/* 0x1A */ 0.471937f, // NOTE_B2
/* 0x1B */ 0.5f, // NOTE_C3
/* 0x1C */ 0.529732f, // NOTE_DFLAT3
/* 0x1D */ 0.561231f, // NOTE_D3
/* 0x1E */ 0.594604f, // NOTE_EFLAT3
/* 0x1F */ 0.629961f, // NOTE_E3
/* 0x20 */ 0.66742f, // NOTE_F3
/* 0x21 */ 0.707107f, // NOTE_GFLAT3
/* 0x22 */ 0.749154f, // NOTE_G3
/* 0x23 */ 0.793701f, // NOTE_AFLAT3
/* 0x24 */ 0.840897f, // NOTE_A3
/* 0x25 */ 0.890899f, // NOTE_BFLAT3
/* 0x26 */ 0.943875f, // NOTE_B3
/* 0x27 */ 1.0f, // NOTE_C4 (Middle C)
/* 0x28 */ 1.059463f, // NOTE_DFLAT4
/* 0x29 */ 1.122462f, // NOTE_D4
/* 0x2A */ 1.189207f, // NOTE_EFLAT4
/* 0x2B */ 1.259921f, // NOTE_E4
/* 0x2C */ 1.33484f, // NOTE_F4
/* 0x2D */ 1.414214f, // NOTE_GFLAT4
/* 0x2E */ 1.498307f, // NOTE_G4
/* 0x2F */ 1.587401f, // NOTE_AFLAT4
/* 0x30 */ 1.681793f, // NOTE_A4
/* 0x31 */ 1.781798f, // NOTE_BFLAT4
/* 0x32 */ 1.887749f, // NOTE_B4
/* 0x33 */ 2.0f, // NOTE_C5
/* 0x34 */ 2.118926f, // NOTE_DFLAT5
/* 0x35 */ 2.244924f, // NOTE_D5
/* 0x36 */ 2.378414f, // NOTE_EFLAT5
/* 0x37 */ 2.519842f, // NOTE_E5
/* 0x38 */ 2.66968f, // NOTE_F5
/* 0x39 */ 2.828428f, // NOTE_GFLAT5
/* 0x3A */ 2.996615f, // NOTE_G5
/* 0x3B */ 3.174803f, // NOTE_AFLAT5
/* 0x3C */ 3.363586f, // NOTE_A5
/* 0x3D */ 3.563596f, // NOTE_BFLAT5
/* 0x3E */ 3.775498f, // NOTE_B5
/* 0x3F */ 4.0f, // NOTE_C6
/* 0x40 */ 4.237853f, // NOTE_DFLAT6
/* 0x41 */ 4.489849f, // NOTE_D6
/* 0x42 */ 4.756829f, // NOTE_EFLAT6
/* 0x43 */ 5.039685f, // NOTE_E6
/* 0x44 */ 5.33936f, // NOTE_F6
/* 0x45 */ 5.656855f, // NOTE_GFLAT6
/* 0x46 */ 5.993229f, // NOTE_G6
/* 0x47 */ 6.349606f, // NOTE_AFLAT6
/* 0x48 */ 6.727173f, // NOTE_A6
/* 0x49 */ 7.127192f, // NOTE_BFLAT6
/* 0x4A */ 7.550996f, // NOTE_B6
/* 0x4B */ 8.0f, // NOTE_C7
/* 0x4C */ 8.475705f, // NOTE_DFLAT7
/* 0x4D */ 8.979697f, // NOTE_D7
/* 0x4E */ 9.513658f, // NOTE_EFLAT7
/* 0x4F */ 10.07937f, // NOTE_E7
/* 0x50 */ 10.6787205f, // NOTE_F7
/* 0x51 */ 11.31371f, // NOTE_GFLAT7
/* 0x52 */ 11.986459f, // NOTE_G7
/* 0x53 */ 12.699211f, // NOTE_AFLAT7
/* 0x54 */ 13.454346f, // NOTE_A7
/* 0x55 */ 14.254383f, // NOTE_BFLAT7
/* 0x56 */ 15.101993f, // NOTE_B7
/* 0x57 */ 16.0f, // NOTE_C8
/* 0x58 */ 16.95141f, // NOTE_DFLAT8
/* 0x59 */ 17.959395f, // NOTE_D8
/* 0x5A */ 19.027315f, // NOTE_EFLAT8
/* 0x5B */ 20.15874f, // NOTE_E8
/* 0x5C */ 21.35744f, // NOTE_F8
/* 0x5D */ 22.62742f, // NOTE_GFLAT8
/* 0x5E */ 23.972918f, // NOTE_G8
/* 0x5F */ 25.398422f, // NOTE_AFLAT8
/* 0x60 */ 26.908691f, // NOTE_A8
/* 0x61 */ 28.508766f, // NOTE_BFLAT8
/* 0x62 */ 30.203985f, // NOTE_B8
/* 0x63 */ 32.0f, // NOTE_C9
/* 0x64 */ 33.90282f, // NOTE_DFLAT9
/* 0x65 */ 35.91879f, // NOTE_D9
/* 0x66 */ 38.05463f, // NOTE_EFLAT9
/* 0x67 */ 40.31748f, // NOTE_E9
/* 0x68 */ 42.71488f, // NOTE_F9
/* 0x69 */ 45.25484f, // NOTE_GFLAT9
/* 0x6A */ 47.945835f, // NOTE_G9
/* 0x6B */ 50.796845f, // NOTE_AFLAT9
/* 0x6C */ 53.817383f, // NOTE_A9
/* 0x6D */ 57.017532f, // NOTE_BFLAT9
/* 0x6E */ 60.40797f, // NOTE_B9
/* 0x6F */ 64.0f, // NOTE_C10
/* 0x70 */ 67.80564f, // NOTE_DFLAT10
/* 0x71 */ 71.83758f, // NOTE_D10
/* 0x72 */ 76.10926f, // NOTE_EFLAT10
/* 0x73 */ 80.63496f, // NOTE_E10
/* 0x74 */ 85.42976f, // NOTE_F10
/* 0x75 */ 0.055681f, // NOTE_BFLATNEG1
/* 0x76 */ 0.058992f, // NOTE_BNEG1
/* 0x77 */ 0.0625f, // NOTE_C0
/* 0x78 */ 0.066216f, // NOTE_DFLAT0
/* 0x79 */ 0.070154f, // NOTE_D0
/* 0x7A */ 0.074325f, // NOTE_EFLAT0
/* 0x7B */ 0.078745f, // NOTE_E0
/* 0x7C */ 0.083427f, // NOTE_F0
/* 0x7D */ 0.088388f, // NOTE_GFLAT0
/* 0x7E */ 0.093644f, // NOTE_G0
/* 0x7F */ 0.099213f, // NOTE_AFLAT0
f32 gPitchFrequencies[] = {
/* 0x00 */ 0.105112f, // PITCH_A0
/* 0x01 */ 0.111362f, // PITCH_BFLAT0
/* 0x02 */ 0.117984f, // PITCH_B0
/* 0x03 */ 0.125f, // PITCH_C1
/* 0x04 */ 0.132433f, // PITCH_DFLAT1
/* 0x05 */ 0.140308f, // PITCH_D1
/* 0x06 */ 0.148651f, // PITCH_EFLAT1
/* 0x07 */ 0.15749f, // PITCH_E1
/* 0x08 */ 0.166855f, // PITCH_F1
/* 0x09 */ 0.176777f, // PITCH_GFLAT1
/* 0x0A */ 0.187288f, // PITCH_G1
/* 0x0B */ 0.198425f, // PITCH_AFLAT1
/* 0x0C */ 0.210224f, // PITCH_A1
/* 0x0D */ 0.222725f, // PITCH_BFLAT1
/* 0x0E */ 0.235969f, // PITCH_B1
/* 0x0F */ 0.25f, // PITCH_C2
/* 0x10 */ 0.264866f, // PITCH_DFLAT2
/* 0x11 */ 0.280616f, // PITCH_D2
/* 0x12 */ 0.297302f, // PITCH_EFLAT2
/* 0x13 */ 0.31498f, // PITCH_E2
/* 0x14 */ 0.33371f, // PITCH_F2
/* 0x15 */ 0.353553f, // PITCH_GFLAT2
/* 0x16 */ 0.374577f, // PITCH_G2
/* 0x17 */ 0.39685f, // PITCH_AFLAT2
/* 0x18 */ 0.420448f, // PITCH_A2
/* 0x19 */ 0.445449f, // PITCH_BFLAT2
/* 0x1A */ 0.471937f, // PITCH_B2
/* 0x1B */ 0.5f, // PITCH_C3
/* 0x1C */ 0.529732f, // PITCH_DFLAT3
/* 0x1D */ 0.561231f, // PITCH_D3
/* 0x1E */ 0.594604f, // PITCH_EFLAT3
/* 0x1F */ 0.629961f, // PITCH_E3
/* 0x20 */ 0.66742f, // PITCH_F3
/* 0x21 */ 0.707107f, // PITCH_GFLAT3
/* 0x22 */ 0.749154f, // PITCH_G3
/* 0x23 */ 0.793701f, // PITCH_AFLAT3
/* 0x24 */ 0.840897f, // PITCH_A3
/* 0x25 */ 0.890899f, // PITCH_BFLAT3
/* 0x26 */ 0.943875f, // PITCH_B3
/* 0x27 */ 1.0f, // PITCH_C4 (Middle C)
/* 0x28 */ 1.059463f, // PITCH_DFLAT4
/* 0x29 */ 1.122462f, // PITCH_D4
/* 0x2A */ 1.189207f, // PITCH_EFLAT4
/* 0x2B */ 1.259921f, // PITCH_E4
/* 0x2C */ 1.33484f, // PITCH_F4
/* 0x2D */ 1.414214f, // PITCH_GFLAT4
/* 0x2E */ 1.498307f, // PITCH_G4
/* 0x2F */ 1.587401f, // PITCH_AFLAT4
/* 0x30 */ 1.681793f, // PITCH_A4
/* 0x31 */ 1.781798f, // PITCH_BFLAT4
/* 0x32 */ 1.887749f, // PITCH_B4
/* 0x33 */ 2.0f, // PITCH_C5
/* 0x34 */ 2.118926f, // PITCH_DFLAT5
/* 0x35 */ 2.244924f, // PITCH_D5
/* 0x36 */ 2.378414f, // PITCH_EFLAT5
/* 0x37 */ 2.519842f, // PITCH_E5
/* 0x38 */ 2.66968f, // PITCH_F5
/* 0x39 */ 2.828428f, // PITCH_GFLAT5
/* 0x3A */ 2.996615f, // PITCH_G5
/* 0x3B */ 3.174803f, // PITCH_AFLAT5
/* 0x3C */ 3.363586f, // PITCH_A5
/* 0x3D */ 3.563596f, // PITCH_BFLAT5
/* 0x3E */ 3.775498f, // PITCH_B5
/* 0x3F */ 4.0f, // PITCH_C6
/* 0x40 */ 4.237853f, // PITCH_DFLAT6
/* 0x41 */ 4.489849f, // PITCH_D6
/* 0x42 */ 4.756829f, // PITCH_EFLAT6
/* 0x43 */ 5.039685f, // PITCH_E6
/* 0x44 */ 5.33936f, // PITCH_F6
/* 0x45 */ 5.656855f, // PITCH_GFLAT6
/* 0x46 */ 5.993229f, // PITCH_G6
/* 0x47 */ 6.349606f, // PITCH_AFLAT6
/* 0x48 */ 6.727173f, // PITCH_A6
/* 0x49 */ 7.127192f, // PITCH_BFLAT6
/* 0x4A */ 7.550996f, // PITCH_B6
/* 0x4B */ 8.0f, // PITCH_C7
/* 0x4C */ 8.475705f, // PITCH_DFLAT7
/* 0x4D */ 8.979697f, // PITCH_D7
/* 0x4E */ 9.513658f, // PITCH_EFLAT7
/* 0x4F */ 10.07937f, // PITCH_E7
/* 0x50 */ 10.6787205f, // PITCH_F7
/* 0x51 */ 11.31371f, // PITCH_GFLAT7
/* 0x52 */ 11.986459f, // PITCH_G7
/* 0x53 */ 12.699211f, // PITCH_AFLAT7
/* 0x54 */ 13.454346f, // PITCH_A7
/* 0x55 */ 14.254383f, // PITCH_BFLAT7
/* 0x56 */ 15.101993f, // PITCH_B7
/* 0x57 */ 16.0f, // PITCH_C8
/* 0x58 */ 16.95141f, // PITCH_DFLAT8
/* 0x59 */ 17.959395f, // PITCH_D8
/* 0x5A */ 19.027315f, // PITCH_EFLAT8
/* 0x5B */ 20.15874f, // PITCH_E8
/* 0x5C */ 21.35744f, // PITCH_F8
/* 0x5D */ 22.62742f, // PITCH_GFLAT8
/* 0x5E */ 23.972918f, // PITCH_G8
/* 0x5F */ 25.398422f, // PITCH_AFLAT8
/* 0x60 */ 26.908691f, // PITCH_A8
/* 0x61 */ 28.508766f, // PITCH_BFLAT8
/* 0x62 */ 30.203985f, // PITCH_B8
/* 0x63 */ 32.0f, // PITCH_C9
/* 0x64 */ 33.90282f, // PITCH_DFLAT9
/* 0x65 */ 35.91879f, // PITCH_D9
/* 0x66 */ 38.05463f, // PITCH_EFLAT9
/* 0x67 */ 40.31748f, // PITCH_E9
/* 0x68 */ 42.71488f, // PITCH_F9
/* 0x69 */ 45.25484f, // PITCH_GFLAT9
/* 0x6A */ 47.945835f, // PITCH_G9
/* 0x6B */ 50.796845f, // PITCH_AFLAT9
/* 0x6C */ 53.817383f, // PITCH_A9
/* 0x6D */ 57.017532f, // PITCH_BFLAT9
/* 0x6E */ 60.40797f, // PITCH_B9
/* 0x6F */ 64.0f, // PITCH_C10
/* 0x70 */ 67.80564f, // PITCH_DFLAT10
/* 0x71 */ 71.83758f, // PITCH_D10
/* 0x72 */ 76.10926f, // PITCH_EFLAT10
/* 0x73 */ 80.63496f, // PITCH_E10
/* 0x74 */ 85.42976f, // PITCH_F10
/* 0x75 */ 0.055681f, // PITCH_BFLATNEG1
/* 0x76 */ 0.058992f, // PITCH_BNEG1
/* 0x77 */ 0.0625f, // PITCH_C0
/* 0x78 */ 0.066216f, // PITCH_DFLAT0
/* 0x79 */ 0.070154f, // PITCH_D0
/* 0x7A */ 0.074325f, // PITCH_EFLAT0
/* 0x7B */ 0.078745f, // PITCH_E0
/* 0x7C */ 0.083427f, // PITCH_F0
/* 0x7D */ 0.088388f, // PITCH_GFLAT0
/* 0x7E */ 0.093644f, // PITCH_G0
/* 0x7F */ 0.099213f, // PITCH_AFLAT0
};
u8 gDefaultShortNoteVelocityTable[] = {
+2 -2
View File
@@ -1098,7 +1098,7 @@ void AudioLoad_Init(void* heap, u32 heapSize) {
gAudioContext.aiBufLengths[i] = 0xA0;
}
gAudioContext.totalTaskCnt = 0;
gAudioContext.totalTaskCount = 0;
gAudioContext.rspTaskIdx = 0;
gAudioContext.curAIBufIdx = 0;
gAudioContext.soundMode = 0;
@@ -1162,7 +1162,7 @@ void AudioLoad_Init(void* heap, u32 heapSize) {
AudioHeap_AllocPoolInit(&gAudioContext.permanentPool, temp_v0_3, D_8014A6C4.permanentPoolSize);
gAudioContextInitalized = true;
osSendMesg(gAudioContext.taskStartQueueP, (OSMesg)gAudioContext.totalTaskCnt, OS_MESG_NOBLOCK);
osSendMesg(gAudioContext.taskStartQueueP, (OSMesg)gAudioContext.totalTaskCount, OS_MESG_NOBLOCK);
}
void AudioLoad_InitSlowLoads(void) {
+4 -4
View File
@@ -716,8 +716,8 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) {
}
}
temp_f2 = gNoteFrequencies[semitone2] * tuning;
temp_f14 = gNoteFrequencies[layer->portamentoTargetNote] * tuning;
temp_f2 = gPitchFrequencies[semitone2] * tuning;
temp_f14 = gPitchFrequencies[layer->portamentoTargetNote] * tuning;
switch (PORTAMENTO_MODE(*portamento)) {
case PORTAMENTO_MODE_1:
@@ -767,10 +767,10 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) {
sound = Audio_InstrumentGetSound(instrument, semitone);
sameSound = (sound == layer->sound);
layer->sound = sound;
layer->freqScale = gNoteFrequencies[semitone2] * sound->tuning;
layer->freqScale = gPitchFrequencies[semitone2] * sound->tuning;
} else {
layer->sound = NULL;
layer->freqScale = gNoteFrequencies[semitone2];
layer->freqScale = gPitchFrequencies[semitone2];
if (instOrWave >= 0xC0) {
layer->sound = &gAudioContext.synthesisReverbs[instOrWave - 0xC0].sound;
}
+10 -7
View File
@@ -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;
}
+1066 -867
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -533,8 +533,8 @@ void func_80111070(void) {
VREG(25) = 0;
VREG(26) = 0;
VREG(27) = 0;
R_OCARINA_NOTES_XPOS = 98;
R_OCARINA_NOTES_XPOS_OFFSET = 18;
R_OCARINA_BUTTONS_XPOS = 98;
R_OCARINA_BUTTONS_XPOS_OFFSET = 18;
VREG(30) = 0;
VREG(31) = 0;
VREG(32) = 0;
@@ -551,13 +551,13 @@ void func_80111070(void) {
VREG(42) = 250;
VREG(43) = 440;
VREG(44) = 10;
R_OCARINA_NOTES_YPOS(0) = 190;
R_OCARINA_NOTES_YPOS(1) = 184;
R_OCARINA_NOTES_YPOS(2) = 176;
R_OCARINA_NOTES_YPOS(3) = 172;
R_OCARINA_NOTES_YPOS(4) = 170;
R_OCARINA_BUTTONS_YPOS(0) = 190;
R_OCARINA_BUTTONS_YPOS(1) = 184;
R_OCARINA_BUTTONS_YPOS(2) = 176;
R_OCARINA_BUTTONS_YPOS(3) = 172;
R_OCARINA_BUTTONS_YPOS(4) = 170;
VREG(50) = 30;
R_OCARINA_NOTES_YPOS_OFFSET = 0;
R_OCARINA_BUTTONS_YPOS_OFFSET = 0;
VREG(52) = -16;
VREG(53) = 230;
VREG(54) = 230;
+1 -1
View File
@@ -420,7 +420,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
}
break;
case 35:
func_800EE824();
AudioOcarina_PlayLongScarecrowAfterCredits();
csCtx->frames = cmd->startFrame - 1;
break;
}
+359 -344
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -47,8 +47,8 @@ typedef struct {
/* 0x0F18 */ char unk_F18[0x04];
/* 0x0F1C */ u32 worldMapAreaData; // "area_arrival"
/* 0x0F20 */ char unk_F20[0x4];
/* 0x0F24 */ u8 scarecrowCustomSongSet;
/* 0x0F25 */ u8 scarecrowCustomSong[0x360];
/* 0x0F24 */ u8 scarecrowLongSongSet;
/* 0x0F25 */ u8 scarecrowLongSong[0x360];
/* 0x1285 */ char unk_1285[0x24];
/* 0x12A9 */ u8 scarecrowSpawnSongSet;
/* 0x12AA */ u8 scarecrowSpawnSong[0x80];
@@ -393,14 +393,14 @@ void Sram_OpenSave(SramContext* sramCtx) {
gSaveContext.health = 0x30;
}
if (gSaveContext.scarecrowCustomSongSet) {
if (gSaveContext.scarecrowLongSongSet) {
osSyncPrintf(VT_FGCOL(BLUE));
osSyncPrintf("\n====================================================================\n");
MemCpy(gScarecrowCustomSongPtr, gSaveContext.scarecrowCustomSong, sizeof(gSaveContext.scarecrowCustomSong));
MemCpy(gScarecrowLongSongPtr, gSaveContext.scarecrowLongSong, sizeof(gSaveContext.scarecrowLongSong));
ptr = (u8*)gScarecrowCustomSongPtr;
for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowCustomSong); i++, ptr++) {
ptr = (u8*)gScarecrowLongSongPtr;
for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowLongSong); i++, ptr++) {
osSyncPrintf("%d, ", *ptr);
}
+18 -17
View File
@@ -208,7 +208,7 @@ static u8 sJumpOrder[] = {
};
static u8 sOcarinaNotes[] = {
OCARINA_NOTE_A, OCARINA_NOTE_C_DOWN, OCARINA_NOTE_C_RIGHT, OCARINA_NOTE_C_LEFT, OCARINA_NOTE_C_UP,
OCARINA_BTN_A, OCARINA_BTN_C_DOWN, OCARINA_BTN_C_RIGHT, OCARINA_BTN_C_LEFT, OCARINA_BTN_C_UP,
};
void EnFr_OrientUnderwater(EnFr* this) {
@@ -696,21 +696,22 @@ void EnFr_ListeningToOcarinaNotes(EnFr* this, GlobalContext* globalCtx) {
case OCARINA_MODE_04:
EnFr_OcarinaMistake(this, globalCtx);
break;
case OCARINA_MODE_01: // Ocarina note played, but no song played
switch (globalCtx->msgCtx.lastOcaNoteIdx) { // Jumping frogs in open ocarina based on ocarina note played
case OCARINA_NOTE_A:
case OCARINA_MODE_01: // Ocarina note played, but no song played
switch (globalCtx->msgCtx.lastOcarinaButtonIndex) {
// Jumping frogs in open ocarina based on ocarina note played
case OCARINA_BTN_A:
EnFr_SetupJumpingUp(this, FROG_BLUE);
break;
case OCARINA_NOTE_C_DOWN:
case OCARINA_BTN_C_DOWN:
EnFr_SetupJumpingUp(this, FROG_YELLOW);
break;
case OCARINA_NOTE_C_RIGHT:
case OCARINA_BTN_C_RIGHT:
EnFr_SetupJumpingUp(this, FROG_RED);
break;
case OCARINA_NOTE_C_LEFT:
case OCARINA_BTN_C_LEFT:
EnFr_SetupJumpingUp(this, FROG_PURPLE);
break;
case OCARINA_NOTE_C_UP:
case OCARINA_BTN_C_UP:
EnFr_SetupJumpingUp(this, FROG_WHITE);
break;
}
@@ -834,7 +835,7 @@ s32 EnFr_IsFrogSongComplete(EnFr* this, GlobalContext* globalCtx) {
MessageContext* msgCtx = &globalCtx->msgCtx;
u8 ocarinaNoteIndex;
if (this->ocarinaNote == (*msgCtx).lastOcaNoteIdx) { // required to match, possibly an array?
if (this->ocarinaNote == (*msgCtx).lastOcarinaButtonIndex) { // required to match, possibly an array?
this->ocarinaNoteIndex++;
ocarinaNoteIndex = this->ocarinaNoteIndex;
if (1) {}
@@ -856,7 +857,7 @@ void EnFr_OcarinaMistake(EnFr* this, GlobalContext* globalCtx) {
Message_CloseTextbox(globalCtx);
this->reward = GI_NONE;
func_80078884(NA_SE_SY_OCARINA_ERROR);
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
sEnFrPointers.flags = 12;
EnFr_DeactivateButterfly();
this->actionFunc = EnFr_Deactivate;
@@ -889,20 +890,20 @@ void EnFr_ContinueFrogSong(EnFr* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.msgMode == MSGMODE_FROGS_WAITING) {
globalCtx->msgCtx.msgMode = MSGMODE_FROGS_START;
switch (globalCtx->msgCtx.lastOcaNoteIdx) {
case OCARINA_NOTE_A:
switch (globalCtx->msgCtx.lastOcarinaButtonIndex) {
case OCARINA_BTN_A:
EnFr_SetupJumpingUp(this, FROG_BLUE);
break;
case OCARINA_NOTE_C_DOWN:
case OCARINA_BTN_C_DOWN:
EnFr_SetupJumpingUp(this, FROG_YELLOW);
break;
case OCARINA_NOTE_C_RIGHT:
case OCARINA_BTN_C_RIGHT:
EnFr_SetupJumpingUp(this, FROG_RED);
break;
case OCARINA_NOTE_C_LEFT:
case OCARINA_BTN_C_LEFT:
EnFr_SetupJumpingUp(this, FROG_PURPLE);
break;
case OCARINA_NOTE_C_UP:
case OCARINA_BTN_C_UP:
EnFr_SetupJumpingUp(this, FROG_WHITE);
}
if (EnFr_IsFrogSongComplete(this, globalCtx)) {
@@ -921,7 +922,7 @@ void EnFr_SetupReward(EnFr* this, GlobalContext* globalCtx, u8 unkCondition) {
func_80078884(NA_SE_SY_CORRECT_CHIME);
}
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
globalCtx->msgCtx.msgMode = MSGMODE_PAUSED;
this->actionFunc = EnFr_PrintTextBox;
}
+2 -1
View File
@@ -203,7 +203,8 @@ void EnFu_TeachSong(EnFu* this, GlobalContext* globalCtx) {
// if dialog state is 2, start song demonstration
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
this->behaviorFlags &= ~FU_WAIT;
Audio_OcaSetInstrument(4); // seems to be related to setting instrument type
// Ocarina is set to harp here but is immediately overwritten to the grind organ in the message system
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_HARP);
func_8010BD58(globalCtx, OCARINA_ACTION_TEACH_STORMS);
this->actionFunc = EnFu_WaitForPlayback;
}
@@ -92,7 +92,7 @@ void func_80A8F28C(EnKakasi* this) {
}
void func_80A8F320(EnKakasi* this, GlobalContext* globalCtx, s16 arg) {
s16 ocarinaNote = globalCtx->msgCtx.lastOcaNoteIdx;
s16 ocarinaNote = globalCtx->msgCtx.lastOcarinaButtonIndex;
s16 currentFrame;
if (arg != 0) {
@@ -105,30 +105,30 @@ void func_80A8F320(EnKakasi* this, GlobalContext* globalCtx, s16 arg) {
ocarinaNote = this->unk_1A6;
}
switch (ocarinaNote) {
case OCARINA_NOTE_A:
case OCARINA_BTN_A:
this->unk_19A++;
if (this->unk_1A4 == 0) {
this->unk_1A4 = 1;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_KAKASHI_ROLL);
}
break;
case OCARINA_NOTE_C_DOWN:
case OCARINA_BTN_C_DOWN:
this->unk_19A++;
this->unk_1B8 = 1.0f;
break;
case OCARINA_NOTE_C_RIGHT:
case OCARINA_BTN_C_RIGHT:
this->unk_19A++;
if (this->unk_1AC == 0) {
this->unk_1AC = 0x1388;
}
break;
case OCARINA_NOTE_C_LEFT:
case OCARINA_BTN_C_LEFT:
this->unk_19A++;
if (this->unk_1A8 == 0) {
this->unk_1A8 = 0x1388;
}
break;
case OCARINA_NOTE_C_UP:
case OCARINA_BTN_C_UP:
this->unk_19A++;
this->unk_1B8 = 2.0f;
break;
@@ -178,13 +178,13 @@ void func_80A8F660(EnKakasi* this, GlobalContext* globalCtx) {
this->unk_196 = TEXT_STATE_DONE;
if (!LINK_IS_ADULT) {
this->unk_194 = false;
if (gSaveContext.scarecrowCustomSongSet) {
if (gSaveContext.scarecrowLongSongSet) {
this->actor.textId = 0x407A;
this->unk_196 = TEXT_STATE_EVENT;
}
} else {
this->unk_194 = true;
if (gSaveContext.scarecrowCustomSongSet) {
if (gSaveContext.scarecrowLongSongSet) {
this->actor.textId = 0x4079;
this->unk_196 = TEXT_STATE_EVENT;
}
@@ -341,7 +341,7 @@ void EnKakasi_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (BREG(3) != 0) {
osSyncPrintf("\n\n");
// "flag!"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.scarecrowCustomSongSet);
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.scarecrowLongSongSet);
}
func_80093D18(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelanime.skeleton, this->skelanime.jointTable, this->skelanime.dListCount,
@@ -96,7 +96,7 @@ void func_80A90E28(EnKakasi3* this) {
void func_80A90EBC(EnKakasi3* this, GlobalContext* globalCtx, s32 arg) {
s16 currentFrame;
s16 ocarinaNote = globalCtx->msgCtx.lastOcaNoteIdx;
s16 ocarinaNote = globalCtx->msgCtx.lastOcarinaButtonIndex;
if (arg != 0) {
if (this->unk_19C[3] == 0) {
@@ -108,30 +108,30 @@ void func_80A90EBC(EnKakasi3* this, GlobalContext* globalCtx, s32 arg) {
ocarinaNote = this->unk_1A6;
}
switch (ocarinaNote) {
case OCARINA_NOTE_A:
case OCARINA_BTN_A:
this->unk_19A++;
if (this->unk_1A4 == 0) {
this->unk_1A4 = 1;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_KAKASHI_ROLL);
}
break;
case OCARINA_NOTE_C_DOWN:
case OCARINA_BTN_C_DOWN:
this->unk_19A++;
this->unk_1B8 = 1.0f;
break;
case OCARINA_NOTE_C_RIGHT:
case OCARINA_BTN_C_RIGHT:
this->unk_19A++;
if (this->unk_1AE == 0x0) {
this->unk_1AE = 0x1388;
}
break;
case OCARINA_NOTE_C_LEFT:
case OCARINA_BTN_C_LEFT:
this->unk_19A++;
if (this->unk_1AA == 0x0) {
this->unk_1AA = 0x1388;
}
break;
case OCARINA_NOTE_C_UP:
case OCARINA_BTN_C_UP:
this->unk_19A++;
this->unk_1B8 = 2.0f;
break;
@@ -269,7 +269,7 @@ void func_80A91348(EnKakasi3* this, GlobalContext* globalCtx) {
void func_80A915B8(EnKakasi3* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT && Message_ShouldAdvance(globalCtx)) {
Message_CloseTextbox(globalCtx);
func_8010BD58(globalCtx, OCARINA_ACTION_SCARECROW_RECORDING);
func_8010BD58(globalCtx, OCARINA_ACTION_SCARECROW_SPAWN_RECORDING);
this->actionFunc = func_80A91620;
}
}
@@ -312,7 +312,7 @@ void func_80A91760(EnKakasi3* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if (this->dialogState == Message_GetState(&globalCtx->msgCtx) && Message_ShouldAdvance(globalCtx)) {
globalCtx->msgCtx.msgMode = MSGMODE_PAUSED;
func_8010BD58(globalCtx, OCARINA_ACTION_SCARECROW_PLAYBACK);
func_8010BD58(globalCtx, OCARINA_ACTION_SCARECROW_SPAWN_PLAYBACK);
this->actionFunc = func_80A917FC;
this->camId = OnePointCutscene_Init(globalCtx, 2280, -99, &this->actor, MAIN_CAM);
}
@@ -333,7 +333,7 @@ void func_80A917FC(EnKakasi3* this, GlobalContext* globalCtx) {
void func_80A9187C(EnKakasi3* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT && Message_ShouldAdvance(globalCtx)) {
Message_CloseTextbox(globalCtx);
func_8010BD58(globalCtx, OCARINA_ACTION_CHECK_SCARECROW);
func_8010BD58(globalCtx, OCARINA_ACTION_CHECK_SCARECROW_SPAWN);
this->actionFunc = func_80A918E4;
}
}
+1 -1
View File
@@ -367,7 +367,7 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) {
void func_80AA106C(EnMa1* this, GlobalContext* globalCtx) {
GET_PLAYER(globalCtx)->stateFlags2 |= PLAYER_STATE2_23;
if (this->unk_1E8.unk_00 == 2) {
Audio_OcaSetInstrument(2);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_MALON);
func_8010BD58(globalCtx, OCARINA_ACTION_TEACH_EPONA);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actionFunc = func_80AA10EC;
+4 -4
View File
@@ -1440,7 +1440,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState =
SKULL_KID_OCARINA_PLAY_NOTES;
}
Message_UpdateOcarinaGame(globalCtx);
Message_UpdateOcarinaMemoryGame(globalCtx);
}
break;
case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_WAIT:
@@ -1448,7 +1448,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState = SKULL_KID_OCARINA_WAIT;
}
if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
Message_UpdateOcarinaGame(globalCtx);
Message_UpdateOcarinaMemoryGame(globalCtx);
this->songFailTimer = 160;
}
break;
@@ -1472,8 +1472,8 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
SKULL_KID_OCARINA_PLAY_NOTES;
}
this->songFailTimer = 160;
Audio_OcaSetInstrument(6); // related instrument sound (flute?)
Audio_OcaSetSongPlayback(OCARINA_SONG_MEMORY_GAME + 1, 1);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_FLUTE);
AudioOcarina_SetPlaybackSong(OCARINA_SONG_MEMORY_GAME + 1, 1);
globalCtx->msgCtx.msgMode = MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING;
globalCtx->msgCtx.stateTimer = 2;
}
@@ -2779,7 +2779,7 @@ s32 func_80835C58(GlobalContext* globalCtx, Player* this, PlayerFunc674 func, s3
}
if (func_8084E3C4 == this->func_674) {
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
this->stateFlags2 &= ~(PLAYER_STATE2_24 | PLAYER_STATE2_25);
} else if (func_808507F4 == this->func_674) {
func_80832340(globalCtx, this);
@@ -187,9 +187,9 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
}
D_8082A11C = 0;
Audio_OcaSetInstrument(1);
func_800ECC04((1 << pauseCtx->ocarinaSongIdx) + 0x8000);
pauseCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff();
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT);
AudioOcarina_Start((1 << pauseCtx->ocarinaSongIdx) + 0x8000);
pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
pauseCtx->ocarinaStaff->pos = 0;
pauseCtx->ocarinaStaff->state = 0xFF;
VREG(21) = -62;
@@ -198,13 +198,13 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
VREG(24) = -46;
VREG(25) = -41;
pauseCtx->unk_1E4 = 8;
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
}
}
} else if (pauseCtx->unk_1E4 == 5) {
if ((pauseCtx->stickRelX != 0) || (pauseCtx->stickRelY != 0)) {
pauseCtx->unk_1E4 = 0;
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
}
} else if (pauseCtx->unk_1E4 == 8) {
if (CHECK_BTN_ALL(input->press.button, BTN_A) && (sp216 >= QUEST_SONG_MINUET) &&
@@ -274,12 +274,12 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
VREG(24) = -46;
VREG(25) = -41;
sp216 = pauseCtx->cursorSlot[PAUSE_QUEST];
Audio_OcaSetInstrument(1);
Audio_OcaSetInstrument(1);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT);
pauseCtx->ocarinaSongIdx = gOcarinaSongItemMap[sp216 - QUEST_SONG_MINUET];
Audio_OcaSetSongPlayback(pauseCtx->ocarinaSongIdx + 1, 1);
AudioOcarina_SetPlaybackSong(pauseCtx->ocarinaSongIdx + 1, 1);
pauseCtx->unk_1E4 = 2;
pauseCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff();
pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
pauseCtx->ocarinaStaff->pos = 0;
sp216 = pauseCtx->cursorSlot[PAUSE_QUEST];
KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx);
@@ -471,12 +471,12 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
}
if (pauseCtx->unk_1E4 == 2) {
pauseCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff();
pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
if (pauseCtx->ocarinaStaff->pos != 0) {
if (D_8082A11C + 1 == pauseCtx->ocarinaStaff->pos) {
D_8082A11C++;
D_8082A124[pauseCtx->ocarinaStaff->pos - 1] = pauseCtx->ocarinaStaff->noteIdx;
D_8082A124[pauseCtx->ocarinaStaff->pos - 1] = pauseCtx->ocarinaStaff->buttonIndex;
}
for (sp218 = 0, phi_s3 = 0; sp218 < 8; sp218++, phi_s3 += 4, sp21A += 4) {
@@ -517,11 +517,11 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
}
} else if (((pauseCtx->unk_1E4 >= 4) && (pauseCtx->unk_1E4 <= 6)) || (pauseCtx->unk_1E4 == 8)) {
sp224 = pauseCtx->ocarinaSongIdx;
sp226 = gOcarinaSongNotes[sp224].len;
sp226 = gOcarinaSongButtons[sp224].numButtons;
for (sp218 = sp21A, phi_s3 = 0; phi_s3 < sp226; phi_s3++, sp21A += 4) {
pauseCtx->questVtx[sp21A + 0].v.ob[1] = pauseCtx->questVtx[sp21A + 1].v.ob[1] =
VREG(21 + gOcarinaSongNotes[sp224].notesIdx[phi_s3]);
VREG(21 + gOcarinaSongButtons[sp224].buttonsIndex[phi_s3]);
pauseCtx->questVtx[sp21A + 2].v.ob[1] = pauseCtx->questVtx[sp21A + 3].v.ob[1] =
pauseCtx->questVtx[sp21A + 0].v.ob[1] - 12;
@@ -529,7 +529,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
gDPPipeSync(POLY_OPA_DISP++);
if (pauseCtx->unk_1E4 == 8) {
if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == 0) {
if (gOcarinaSongButtons[sp224].buttonsIndex[phi_s3] == OCARINA_BTN_A) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 80, 255, 150, 200);
} else {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, 200);
@@ -542,21 +542,21 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
gDPLoadTextureBlock(POLY_OPA_DISP++, D_8082A130[gOcarinaSongNotes[sp224].notesIdx[phi_s3]], G_IM_FMT_IA,
G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTextureBlock(POLY_OPA_DISP++, D_8082A130[gOcarinaSongButtons[sp224].buttonsIndex[phi_s3]],
G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);
}
if (pauseCtx->unk_1E4 != 8) {
pauseCtx->ocarinaStaff = Audio_OcaGetPlayingStaff();
pauseCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff();
if (pauseCtx->ocarinaStaff->pos != 0) {
if (D_8082A11C == (pauseCtx->ocarinaStaff->pos - 1)) {
if ((pauseCtx->ocarinaStaff->noteIdx >= OCARINA_NOTE_A) &&
(pauseCtx->ocarinaStaff->noteIdx <= OCARINA_NOTE_C_UP)) {
D_8082A124[pauseCtx->ocarinaStaff->pos - 1] = pauseCtx->ocarinaStaff->noteIdx;
if ((pauseCtx->ocarinaStaff->buttonIndex >= OCARINA_BTN_A) &&
(pauseCtx->ocarinaStaff->buttonIndex <= OCARINA_BTN_C_UP)) {
D_8082A124[pauseCtx->ocarinaStaff->pos - 1] = pauseCtx->ocarinaStaff->buttonIndex;
D_8082A124[pauseCtx->ocarinaStaff->pos] = 0xFF;
D_8082A11C++;
}
@@ -608,9 +608,9 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
}
D_8082A11C = 0;
Audio_OcaSetInstrument(1);
func_800ECC04((1 << pauseCtx->ocarinaSongIdx) + 0x8000);
pauseCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff();
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT);
AudioOcarina_Start((1 << pauseCtx->ocarinaSongIdx) + 0x8000);
pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
pauseCtx->ocarinaStaff->pos = 0;
pauseCtx->ocarinaStaff->state = 0xFE;
pauseCtx->unk_1E4 = 5;
@@ -2927,10 +2927,10 @@ void KaleidoScope_Update(GlobalContext* globalCtx) {
break;
case 2:
pauseCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff();
pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
if (pauseCtx->ocarinaStaff->state == 0) {
pauseCtx->unk_1E4 = 4;
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
}
break;
@@ -2942,10 +2942,10 @@ void KaleidoScope_Update(GlobalContext* globalCtx) {
break;
case 5:
pauseCtx->ocarinaStaff = Audio_OcaGetPlayingStaff();
pauseCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff();
if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
Interface_SetDoAction(globalCtx, DO_ACTION_NONE);
pauseCtx->state = 0x12;
WREG(2) = -6240;
@@ -2953,7 +2953,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) {
pauseCtx->unk_1E4 = 0;
break;
} else if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
pauseCtx->unk_1E4 = 0;
pauseCtx->mode = 0;
pauseCtx->promptChoice = 0;
@@ -2986,7 +2986,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) {
if (D_8082B25C == 0) {
pauseCtx->unk_1E4 = D_8082B258;
if (pauseCtx->unk_1E4 == 0) {
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
}
}
break;
@@ -2996,14 +2996,14 @@ void KaleidoScope_Update(GlobalContext* globalCtx) {
case 8:
if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
Interface_SetDoAction(globalCtx, DO_ACTION_NONE);
pauseCtx->state = 0x12;
WREG(2) = -6240;
func_800F64E0(0);
pauseCtx->unk_1E4 = 0;
} else if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
Audio_OcaSetInstrument(0);
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
pauseCtx->unk_1E4 = 0;
pauseCtx->mode = 0;
pauseCtx->promptChoice = 0;