summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorengineer124 <engineer124engineer124@gmail.com>2021-11-08 01:03:04 +1100
committerengineer124 <engineer124engineer124@gmail.com>2021-11-08 01:03:04 +1100
commitb0c4073267b8a97b8fdf09a44287c64ad6e71fb9 (patch)
tree80dddc8a6365f170b9160c43850d3b61f24c29ed /src
parent23d3f1980eab2f755e887826be61224525f360da (diff)
Really close to matching osVoiceStopReadData
Diffstat (limited to 'src')
-rw-r--r--src/libultra/voice/voicestopread.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/libultra/voice/voicestopread.c b/src/libultra/voice/voicestopread.c
index 16ecddef8..d7dad3291 100644
--- a/src/libultra/voice/voicestopread.c
+++ b/src/libultra/voice/voicestopread.c
@@ -1,4 +1,52 @@
#include "global.h"
// Forcibly stops voice recognition processing by the Voice Recognition System
+#ifdef NON_EQUIVALENT
+s32 osVoiceStopReadData(OSVoiceHandle* hd) {
+ s32 i;
+ s32 errorCode;
+ u8 sp3F;
+ s32 sp38;
+
+ errorCode = __osVoiceGetStatus(hd->mq, hd->port, &sp3F);
+ if (errorCode != 0) {
+ return errorCode;
+ }
+
+ if (sp3F & 2) {
+ return 0xF;
+ }
+
+ if (hd->mode == 0) {
+ return 5;
+ }
+
+ sp38 = 0x700;
+ errorCode = __osVoiceContWrite4(hd->mq, hd->port, 0, &sp38);
+
+ if (errorCode == 0) {
+ for (i = 0; i < 20; i++) {
+ errorCode = __osVoiceCheckResult(hd, &sp3F);
+ if (errorCode & 0xFF00) {
+ if (((errorCode & 7) == 0) || ((errorCode & 7) == 7)) {
+ if (hd) {}
+ errorCode = 0;
+ hd->mode = 0;
+ } else {
+ errorCode = 5;
+ }
+ } else {
+ hd->mode = 0;
+ }
+
+ if (errorCode != 0xF) {
+ break;
+ }
+ }
+ }
+
+ return errorCode;
+}
+#else
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicestopread/osVoiceStopReadData.s")
+#endif