mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
format
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
/**
|
||||
* Initializes Voice Recognition System word registration dictionary.
|
||||
*
|
||||
*
|
||||
* The dictionary is initialized so that the specified "numWords" can be
|
||||
* registered in the dictionary. 1-255 words can be registered in the dictionary.
|
||||
*
|
||||
* Words cannot be registered with the osVoiceSetWord before the dictionary
|
||||
*
|
||||
* Words cannot be registered with the osVoiceSetWord before the dictionary
|
||||
* is initialized with the osVoiceClearDictionary function
|
||||
*/
|
||||
s32 osVoiceClearDictionary(OSVoiceHandle* hd, u8 numWords) {
|
||||
|
||||
@@ -35,7 +35,7 @@ s32 __osVoiceContRead2(OSMesgQueue* mq, s32 port, u16 arg2, u8 dst[2]) {
|
||||
|
||||
ptr[4] = arg2 >> 3;
|
||||
ptr[5] = __osContAddressCrc(arg2) | (arg2 << 5);
|
||||
|
||||
|
||||
__osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
|
||||
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||
__osSiRawStartDma(OS_READ, &__osPfsPifRam);
|
||||
@@ -64,4 +64,3 @@ s32 __osVoiceContRead2(OSMesgQueue* mq, s32 port, u16 arg2, u8 dst[2]) {
|
||||
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ s32 __osVoiceContRead36(OSMesgQueue* mq, s32 port, u16 arg2, u8 dst[36]) {
|
||||
|
||||
ptr[4] = arg2 >> 3;
|
||||
ptr[5] = __osContAddressCrc(arg2) | (arg2 << 5);
|
||||
|
||||
|
||||
__osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
|
||||
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||
__osSiRawStartDma(OS_READ, &__osPfsPifRam);
|
||||
|
||||
@@ -7,7 +7,6 @@ s32 osVoiceControlGain(OSVoiceHandle* hd, s32 analog, s32 digital) {
|
||||
s32 errorCode;
|
||||
u8 phi_a2;
|
||||
|
||||
|
||||
if (analog == 0) {
|
||||
phi_a2 = 0x18;
|
||||
} else {
|
||||
@@ -18,22 +17,22 @@ s32 osVoiceControlGain(OSVoiceHandle* hd, s32 analog, s32 digital) {
|
||||
if (errorCode != 0) {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
if (!((digital < 8) && (digital >= 0))){
|
||||
|
||||
if (!((digital < 8) && (digital >= 0))) {
|
||||
goto dummy;
|
||||
}
|
||||
|
||||
phi_a2 = D_80098180[digital] + 2;
|
||||
|
||||
if (0) {
|
||||
dummy:
|
||||
dummy:
|
||||
return CONT_ERR_INVALID;
|
||||
}
|
||||
|
||||
errorCode = __osVoiceSetADConverter(hd->mq, hd->port, phi_a2);
|
||||
if (errorCode != 0) {
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ s32 __osVoiceContWrite20(OSMesgQueue* mq, s32 port, u16 arg2, u8 dst[20]) {
|
||||
ptr[5] = __osContAddressCrc(arg2) | (arg2 << 5);
|
||||
|
||||
bcopy(dst, &ptr[6], 20);
|
||||
|
||||
|
||||
__osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
|
||||
temp_s2 = __osVoiceContDataCrc(dst, 20);
|
||||
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||
|
||||
@@ -38,7 +38,7 @@ s32 __osVoiceContWrite4(OSMesgQueue* mq, s32 port, u16 arg2, u8 dst[4]) {
|
||||
ptr[5] = __osContAddressCrc(arg2) | (arg2 << 5);
|
||||
|
||||
bcopy(dst, &ptr[6], 4);
|
||||
|
||||
|
||||
__osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
|
||||
temp_s2 = __osVoiceContDataCrc(dst, 4);
|
||||
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||
|
||||
@@ -54,6 +54,6 @@ s32 __osVoiceGetStatus(OSMesgQueue* mq, s32 port, u8* status) {
|
||||
} while ((errorCode == CONT_ERR_CONTRFAIL) && (retryCount-- >= 0));
|
||||
|
||||
__osSiRelAccess();
|
||||
|
||||
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ s32 osVoiceInit(OSMesgQueue* siMessageQ, OSVoiceHandle* hd, s32 channel) {
|
||||
hd->port = channel;
|
||||
hd->mq = siMessageQ;
|
||||
hd->mode = 0;
|
||||
|
||||
|
||||
errorCode = __osVoiceGetStatus(siMessageQ, channel, &status);
|
||||
if (errorCode != 0) {
|
||||
return errorCode;
|
||||
@@ -55,14 +55,13 @@ s32 osVoiceInit(OSMesgQueue* siMessageQ, OSVoiceHandle* hd, s32 channel) {
|
||||
if (errorCode != 0) {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
|
||||
errorCode = __osVoiceCheckResult(hd, &status);
|
||||
if (errorCode & 0xFF00) {
|
||||
errorCode = CONT_ERR_INVALID;
|
||||
}
|
||||
|
||||
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ s32 osVoiceMaskDictionary(OSVoiceHandle* hd, u8* maskPattern, s32 size) {
|
||||
|
||||
for (i = 0; i < sp3C; i += 2) {
|
||||
data[i + 20 - sp3C] = maskPattern[i];
|
||||
data[i + 21 - sp3C] = maskPattern[i+1];
|
||||
data[i + 21 - sp3C] = maskPattern[i + 1];
|
||||
}
|
||||
|
||||
if (size & 1) {
|
||||
@@ -46,4 +46,3 @@ s32 osVoiceMaskDictionary(OSVoiceHandle* hd, u8* maskPattern, s32 size) {
|
||||
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ s32 __osVoiceSetADConverter(OSMesgQueue* mq, s32 port, u8 arg2) {
|
||||
|
||||
ptr[3] = arg2;
|
||||
ptr[4] = __osContAddressCrc(sp48);
|
||||
|
||||
|
||||
__osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
|
||||
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||
__osSiRawStartDma(OS_READ, &__osPfsPifRam);
|
||||
|
||||
@@ -37,7 +37,7 @@ s32 osVoiceSetWord(OSVoiceHandle* hd, u8* word) {
|
||||
if (errorCode != 0) {
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
errorCode = __osVoiceContWrite20(hd->mq, hd->port, 0, &data[20]);
|
||||
if (errorCode != 0) {
|
||||
|
||||
@@ -33,7 +33,7 @@ s32 osVoiceStartReadData(OSVoiceHandle* hd) {
|
||||
|
||||
if (errorCode == 0) {
|
||||
errorCode = __osVoiceCheckResult(hd, &status);
|
||||
|
||||
|
||||
if (errorCode & 0xFF00) {
|
||||
errorCode = CONT_ERR_INVALID;
|
||||
} else {
|
||||
|
||||
@@ -31,7 +31,7 @@ s32 osVoiceStopReadData(OSVoiceHandle* hd) {
|
||||
*/
|
||||
u.data32 = 0x700;
|
||||
errorCode = __osVoiceContWrite4(hd->mq, hd->port, 0, u.data);
|
||||
|
||||
|
||||
if (errorCode == 0) {
|
||||
i = 0;
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user