mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-26 16:36:50 -04:00
Decomp, three audio functions (#7069)
This commit is contained in:
@@ -165,8 +165,8 @@ u8 Message_ShouldAdvance(PlayState* play) {
|
||||
: CHECK_BTN_ALL(input->press.button, BTN_B);
|
||||
|
||||
if (CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
return CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP);
|
||||
}
|
||||
@@ -191,8 +191,8 @@ void Message_CloseTextbox(PlayState* play) {
|
||||
msgCtx->stateTimer = 2;
|
||||
msgCtx->msgMode = MSGMODE_TEXT_CLOSING;
|
||||
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT;
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,8 +208,8 @@ void Message_HandleChoiceSelection(PlayState* play, u8 numChoices) {
|
||||
if (msgCtx->choiceIndex > 128) {
|
||||
msgCtx->choiceIndex = 0;
|
||||
} else {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
} else if ((input->rel.stick_y <= -30 && !sAnalogStickHeld) ||
|
||||
(dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) {
|
||||
@@ -218,8 +218,8 @@ void Message_HandleChoiceSelection(PlayState* play, u8 numChoices) {
|
||||
if (msgCtx->choiceIndex > numChoices) {
|
||||
msgCtx->choiceIndex = numChoices;
|
||||
} else {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
} else if (ABS(input->rel.stick_y) < 30) {
|
||||
sAnalogStickHeld = false;
|
||||
@@ -844,7 +844,7 @@ u16 Message_DrawItemIcon(PlayState* play, u16 itemId, Gfx** p, u16 i) {
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
|
||||
// clang-format off
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); }
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); }
|
||||
// clang-format on
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
@@ -990,8 +990,8 @@ void Message_DrawTextJPN(PlayState* play, Gfx** gfxP) {
|
||||
case MESSAGE_BOX_BREAK_JPN:
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
|
||||
if (!sTextboxSkipped) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT;
|
||||
Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE);
|
||||
} else {
|
||||
@@ -1009,8 +1009,8 @@ void Message_DrawTextJPN(PlayState* play, Gfx** gfxP) {
|
||||
GameInteractor_Should(VB_FIX_TEXT_SPEED_SOFTLOCK, false, i + 1);
|
||||
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT;
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_TEXT_DONE;
|
||||
Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE);
|
||||
}
|
||||
@@ -1066,9 +1066,8 @@ void Message_DrawTextJPN(PlayState* play, Gfx** gfxP) {
|
||||
case MESSAGE_SFX_JPN:
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && !sMessageHasSetSfx) {
|
||||
sMessageHasSetSfx = true;
|
||||
Audio_PlaySoundGeneral(msgCtx->msgBufDecodedWide[i + 1], &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(msgCtx->msgBufDecodedWide[i + 1], &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
i++;
|
||||
break;
|
||||
@@ -1078,7 +1077,7 @@ void Message_DrawTextJPN(PlayState* play, Gfx** gfxP) {
|
||||
case MESSAGE_BACKGROUND_JPN:
|
||||
// clang-format off
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { \
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
// clang-format on
|
||||
gDPPipeSync(gfx++);
|
||||
@@ -1161,8 +1160,8 @@ void Message_DrawTextJPN(PlayState* play, Gfx** gfxP) {
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
|
||||
msgCtx->msgMode = MSGMODE_TEXT_DONE;
|
||||
if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_DEFAULT) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE);
|
||||
if (play->csCtx.state == 0) {
|
||||
Interface_SetDoAction(play, DO_ACTION_RETURN);
|
||||
@@ -1193,8 +1192,8 @@ void Message_DrawTextJPN(PlayState* play, Gfx** gfxP) {
|
||||
return;
|
||||
case MESSAGE_PERSISTENT_JPN:
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_TEXT_DONE;
|
||||
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT;
|
||||
}
|
||||
@@ -1205,8 +1204,8 @@ void Message_DrawTextJPN(PlayState* play, Gfx** gfxP) {
|
||||
msgCtx->msgMode = MSGMODE_TEXT_DONE;
|
||||
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_EVENT;
|
||||
Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE);
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
*gfxP = gfx;
|
||||
return;
|
||||
@@ -1228,8 +1227,8 @@ void Message_DrawTextJPN(PlayState* play, Gfx** gfxP) {
|
||||
}
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i + 1 == msgCtx->textDrawPos &&
|
||||
msgCtx->textDelayTimer == msgCtx->textDelay) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx);
|
||||
charTexIdx += FONT_CHAR_TEX_SIZE;
|
||||
@@ -1331,8 +1330,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
case MESSAGE_BOX_BREAK:
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
|
||||
if (!sTextboxSkipped) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT;
|
||||
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE);
|
||||
} else {
|
||||
@@ -1349,8 +1348,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
case MESSAGE_TEXTID:
|
||||
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT;
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_TEXT_DONE;
|
||||
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE);
|
||||
}
|
||||
@@ -1423,9 +1422,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
// "Sound (SE)"
|
||||
osSyncPrintf("サウンド(SE)\n");
|
||||
sfxHi = msgCtx->msgBufDecoded[i + 1] << 8;
|
||||
Audio_PlaySoundGeneral(sfxHi | msgCtx->msgBufDecoded[i + 2], &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(sfxHi | msgCtx->msgBufDecoded[i + 2], &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
i += 2;
|
||||
break;
|
||||
@@ -1434,7 +1432,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
break;
|
||||
case MESSAGE_BACKGROUND:
|
||||
// clang-format off
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); }
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); }
|
||||
// clang-format on
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
@@ -1517,8 +1515,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
|
||||
msgCtx->msgMode = MSGMODE_TEXT_DONE;
|
||||
if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_DEFAULT) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE);
|
||||
if (play->csCtx.state == 0) {
|
||||
Interface_SetDoAction(play, DO_ACTION_RETURN);
|
||||
@@ -1549,8 +1547,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
return;
|
||||
case MESSAGE_PERSISTENT:
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_TEXT_DONE;
|
||||
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT;
|
||||
}
|
||||
@@ -1561,8 +1559,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
msgCtx->msgMode = MSGMODE_TEXT_DONE;
|
||||
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_EVENT;
|
||||
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE);
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
*gfxP = gfx;
|
||||
return;
|
||||
@@ -1572,8 +1570,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
gSaveContext.ship.filenameLanguage == NAME_LANGUAGE_NTSC_JPN) {
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i + 1 == msgCtx->textDrawPos &&
|
||||
msgCtx->textDelayTimer == msgCtx->textDelay) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx);
|
||||
charTexIdx += FONT_CHAR_TEX_SIZE;
|
||||
@@ -1586,8 +1584,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
default:
|
||||
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i + 1 == msgCtx->textDrawPos &&
|
||||
msgCtx->textDelayTimer == msgCtx->textDelay) {
|
||||
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx);
|
||||
charTexIdx += FONT_CHAR_TEX_SIZE;
|
||||
@@ -2951,8 +2949,8 @@ void Message_StartOcarina(PlayState* play, u16 ocarinaActionId) {
|
||||
osSyncPrintf("ocarina_set 000000000000000000 = %d\n", ocarinaActionId);
|
||||
msgCtx->ocarinaAction = ocarinaActionId;
|
||||
if (ocarinaActionId >= OCARINA_ACTION_CHECK_SARIA && ocarinaActionId <= OCARINA_ACTION_CHECK_STORMS) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
if (ocarinaActionId == OCARINA_ACTION_SCARECROW_PLAYBACK) {
|
||||
Message_OpenText(play, 0x86F); // Ocarina
|
||||
@@ -3442,9 +3440,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SARIAS ||
|
||||
msgCtx->ocarinaStaff->state == OCARINA_SONG_SCARECROW_SPAWN) {
|
||||
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_OCARINA_STARTING;
|
||||
} else {
|
||||
// "Ocarina_Flog Correct Example Performance"
|
||||
@@ -3453,17 +3451,17 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
msgCtx->msgMode = MSGMODE_SONG_PLAYED;
|
||||
msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA;
|
||||
msgCtx->stateTimer = 10;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Interface_ChangeHudVisibilityMode(1);
|
||||
}
|
||||
} else if (msgCtx->ocarinaAction == OCARINA_ACTION_CHECK_SCARECROW) {
|
||||
if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SCARECROW_SPAWN) {
|
||||
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
msgCtx->stateTimer = 10;
|
||||
msgCtx->msgMode = MSGMODE_OCARINA_FAIL;
|
||||
} else {
|
||||
@@ -3473,9 +3471,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
msgCtx->msgMode = MSGMODE_SONG_PLAYED;
|
||||
msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA;
|
||||
msgCtx->stateTimer = 10;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Interface_ChangeHudVisibilityMode(1);
|
||||
}
|
||||
} else if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) {
|
||||
@@ -3485,25 +3483,25 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
msgCtx->msgMode = MSGMODE_SONG_PLAYED;
|
||||
msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA;
|
||||
msgCtx->stateTimer = 10;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
} else {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
}
|
||||
Interface_ChangeHudVisibilityMode(1);
|
||||
} else {
|
||||
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_OCARINA_STARTING;
|
||||
}
|
||||
} else if (msgCtx->ocarinaStaff->state == 0xFF) {
|
||||
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->stateTimer = 10;
|
||||
msgCtx->msgMode = MSGMODE_OCARINA_FAIL;
|
||||
} else if (isB_Held) {
|
||||
@@ -3854,11 +3852,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
osSyncPrintf("z_message.c 取得メロディ=%d\n", ITEM_SONG_MINUET + msgCtx->ocarinaStaff->state);
|
||||
osSyncPrintf(VT_RST);
|
||||
msgCtx->stateTimer = 20;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
} else if (msgCtx->ocarinaStaff->state == 0xFF) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->stateTimer = 10;
|
||||
msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_FAIL;
|
||||
}
|
||||
@@ -3923,8 +3921,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
msgCtx->ocarinaStaff->state);
|
||||
gSaveContext.scarecrowLongSongSet = true;
|
||||
}
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
osSyncPrintf("aaaaaaaaaaaaaa\n");
|
||||
AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF);
|
||||
msgCtx->stateTimer = 10;
|
||||
@@ -4002,8 +4000,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
msgCtx->stateTimer = 20;
|
||||
gSaveContext.scarecrowSpawnSongSet = true;
|
||||
msgCtx->msgMode = MSGMODE_SCARECROW_RECORDING_DONE;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("\n====================================================================\n");
|
||||
memcpy(gSaveContext.scarecrowSpawnSong, gScarecrowSpawnSongPtr,
|
||||
@@ -4017,8 +4015,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
// "Played an existing song!!!"
|
||||
osSyncPrintf("すでに存在する曲吹いた!!! \n");
|
||||
AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF);
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Message_CloseTextbox(play);
|
||||
msgCtx->msgMode = MSGMODE_SCARECROW_RECORDING_FAILED;
|
||||
}
|
||||
@@ -4047,8 +4045,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
break;
|
||||
case MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING:
|
||||
case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_PLAYING:
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
|
||||
if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) {
|
||||
sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex;
|
||||
@@ -4058,12 +4056,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
if (msgCtx->stateTimer == 0) {
|
||||
if (msgCtx->ocarinaStaff->state == 0) {
|
||||
if (msgCtx->msgMode == MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
} else {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_2, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_2, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
msgCtx->msgMode++;
|
||||
}
|
||||
@@ -4081,8 +4078,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
}
|
||||
break;
|
||||
case MSGMODE_MEMORY_GAME_PLAYER_PLAYING:
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff();
|
||||
if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) {
|
||||
sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex;
|
||||
@@ -4093,15 +4090,15 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
// "Musical round failed!!!!!!!!!"
|
||||
osSyncPrintf("輪唱失敗!!!!!!!!!\n");
|
||||
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->stateTimer = 10;
|
||||
play->msgCtx.ocarinaMode = OCARINA_MODE_03;
|
||||
} else if (msgCtx->ocarinaStaff->state == 0xD) {
|
||||
// "Musical round succeeded!!!!!!!!!"
|
||||
osSyncPrintf("輪唱成功!!!!!!!!!\n");
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->msgMode = MSGMODE_MEMORY_GAME_ROUND_SUCCESS;
|
||||
msgCtx->stateTimer = 30;
|
||||
}
|
||||
@@ -4121,8 +4118,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
|
||||
msgCtx->stateTimer--;
|
||||
if (msgCtx->stateTimer == 0) {
|
||||
if (AudioOcarina_MemoryGameNextNote() != 1) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff();
|
||||
msgCtx->ocarinaStaff->pos = sOcarinaButtonIndexBufPos = 0;
|
||||
Message_ResetOcarinaNoteState();
|
||||
@@ -4531,7 +4528,7 @@ void Message_Update(PlayState* play) {
|
||||
R_TEXTBOX_TEXHEIGHT = 512;
|
||||
} else {
|
||||
Message_GrowTextbox(msgCtx);
|
||||
Audio_PlaySoundIfNotInCutscene(0);
|
||||
Audio_PlaySfxIfNotInCutscene(0);
|
||||
msgCtx->stateTimer = 0;
|
||||
msgCtx->msgMode = MSGMODE_TEXT_BOX_GROWING;
|
||||
}
|
||||
@@ -4608,16 +4605,16 @@ void Message_Update(PlayState* play) {
|
||||
} else if (Message_ShouldAdvanceSilent(play)) {
|
||||
osSyncPrintf("select=%d\n", msgCtx->textboxEndType);
|
||||
if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_HAS_NEXT) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (gSaveContext.language == LANGUAGE_JPN && !sTextIsCredits && !sDisplayNextMessageAsEnglish) {
|
||||
Message_ContinueTextbox(play, msgCtx->msgBufDecodedWide[msgCtx->textDrawPos]);
|
||||
} else {
|
||||
Message_ContinueTextbox(play, sNextTextId);
|
||||
}
|
||||
} else {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Message_CloseTextbox(play);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user