mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-12 09:50:50 +00: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:
parent
6cd8029cd5
commit
95b4317931
26 changed files with 1872 additions and 1593 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue