Fixed missing digit voices.

This commit is contained in:
Dual Tachyon 2023-08-29 01:37:33 +01:00
parent b636c07536
commit 116025f08b

17
audio.c
View File

@ -265,19 +265,22 @@ uint8_t AUDIO_SetDigitVoice(uint8_t Index, uint32_t Value)
Count = 0;
Result = Value / 1000;
Remainder = Value % 1000;
if (Remainder >= 100) {
if (Remainder < 100) {
if (Remainder < 10) {
goto Skip;
}
} else {
Result = Remainder / 100;
gVoiceID[gVoiceWriteIndex++] = Result;
Count++;
Remainder -= Result * 100;
}
if (Remainder >= 10) {
Result = Remainder / 10;
gVoiceID[gVoiceWriteIndex++] = Result;
Count += 1;
Remainder -= Result * 10;
}
Result = Remainder / 10;
gVoiceID[gVoiceWriteIndex++] = Result;
Count++;
Remainder -= Result * 10;
Skip:
gVoiceID[gVoiceWriteIndex++] = Remainder;
return Count + 1;