From b7858effd5c4f1e729f6bd08ade1b2b536fbaddc Mon Sep 17 00:00:00 2001 From: engineer124 Date: Wed, 10 Nov 2021 22:09:52 +1100 Subject: [PATCH] Meme matched osVoiceStopReadData --- src/libultra/voice/voicestopread.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/libultra/voice/voicestopread.c b/src/libultra/voice/voicestopread.c index 4c9a1dc88..a5d9456e1 100644 --- a/src/libultra/voice/voicestopread.c +++ b/src/libultra/voice/voicestopread.c @@ -1,10 +1,9 @@ #include "global.h" // Forcibly stops voice recognition processing by the Voice Recognition System -#ifdef NON_EQUIVALENT s32 osVoiceStopReadData(OSVoiceHandle* hd) { - s32 i; s32 errorCode; + s32 i; u8 sp3F; s32 sp38; @@ -25,28 +24,24 @@ s32 osVoiceStopReadData(OSVoiceHandle* hd) { errorCode = __osVoiceContWrite4(hd->mq, hd->port, 0, &sp38); if (errorCode == 0) { - for (i = 0; i < 20; i++) { + i = 0; + do { errorCode = __osVoiceCheckResult(hd, &sp3F); if (errorCode & 0xFF00) { if (((errorCode & 7) == 0) || ((errorCode & 7) == 7)) { - if (hd) {} errorCode = 0; hd->mode = 0; } else { - errorCode = CONT_ERR_INVALID; + errorCode = 5; } } else { hd->mode = 0; } - - if (errorCode != CONT_ERR_VOICE_NO_RESPONSE) { - break; - } - } + i++; + } while ((errorCode == 15) && (i < 20)); } + if (i) {} + return errorCode; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/boot/voicestopread/osVoiceStopReadData.s") -#endif