mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Match osVoiceStartReadData
This commit is contained in:
+3
-3
@@ -280,7 +280,7 @@ void __osDispatchThread(void);
|
||||
void __osCleanupThread(void);
|
||||
void __osDequeueThread(OSThread** param_1, OSThread* param_2);
|
||||
void osDestroyThread(OSThread* puParm1);
|
||||
// void __osVoiceCheckResult(void);
|
||||
s32 __osVoiceCheckResult(OSVoiceHandle* hd, u8* status);
|
||||
void bzero(void* begin, s32 length);
|
||||
// void osSetRumble(void);
|
||||
// void osSetUpMempakWrite(void);
|
||||
@@ -473,8 +473,8 @@ float __ll_to_f(long long l);
|
||||
double __ull_to_d(unsigned long long l);
|
||||
float __ull_to_f(unsigned long long l);
|
||||
// void osVoiceCheckWord(void);
|
||||
s32 osVoiceControlGain(OSVoiceHandle *hd, s32 analog, s32 digital);
|
||||
// void osVoiceStartReadData(void);
|
||||
s32 osVoiceControlGain(OSVoiceHandle* hd, s32 analog, s32 digital);
|
||||
s32 osVoiceStartReadData(OSVoiceHandle* hd);
|
||||
void* osViGetCurrentFramebuffer(void);
|
||||
s32 __osSpSetPc(void* data);
|
||||
s32 __osVoiceContWrite4(OSMesgQueue* hd, s32 arg1, s32 arg2, OSVoiceData* voiceData);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "global.h"
|
||||
|
||||
s32 __osVoiceCheckResult(OSVoiceHandle* handle, u8* status) {
|
||||
s32 __osVoiceCheckResult(OSVoiceHandle* hd, u8* status) {
|
||||
s32 phi_v1;
|
||||
u8 sp20[2];
|
||||
|
||||
if (phi_v1 = __osVoiceGetStatus(handle->mq, handle->port, status), phi_v1 == 0) {
|
||||
if (phi_v1 = __osVoiceGetStatus(hd->mq, hd->port, status), phi_v1 == 0) {
|
||||
if (*status & 1) {
|
||||
phi_v1 = 0xF;
|
||||
} else if (phi_v1 = __osVoiceContRead2(handle->mq, handle->port, 0, sp20), phi_v1 == 0) {
|
||||
handle->status = sp20[0] & 7;
|
||||
} else if (phi_v1 = __osVoiceContRead2(hd->mq, hd->port, 0, sp20), phi_v1 == 0) {
|
||||
hd->status = sp20[0] & 7;
|
||||
|
||||
if (sp20[0] & 0x40) {
|
||||
phi_v1 = 0xF;
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
#include "global.h"
|
||||
|
||||
// Start voice recognition by the Voice Recognition System
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicestartreaddata/osVoiceStartReadData.s")
|
||||
s32 osVoiceStartReadData(OSVoiceHandle* hd) {
|
||||
s32 temp_v0;
|
||||
u8 sp2B;
|
||||
s32 sp24;
|
||||
|
||||
temp_v0 = __osVoiceGetStatus(hd->mq, hd->port, &sp2B);
|
||||
if (temp_v0 != 0) {
|
||||
return temp_v0;
|
||||
}
|
||||
|
||||
if ((sp2B & 2) != 0) {
|
||||
return 0xF;
|
||||
}
|
||||
|
||||
if (hd->mode != 0) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
sp24 = 0x5000000;
|
||||
temp_v0 = __osVoiceContWrite4(hd->mq, hd->port, 0, &sp24);
|
||||
|
||||
if (temp_v0 == 0) {
|
||||
temp_v0 = __osVoiceCheckResult(hd, &sp2B);
|
||||
if ((temp_v0 & 0xFF00) != 0) {
|
||||
temp_v0 = 5;
|
||||
} else {
|
||||
hd->mode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return temp_v0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user