diff --git a/include/musyx/synth.h b/include/musyx/synth.h index f7cc1ef7..25a1c84d 100644 --- a/include/musyx/synth.h +++ b/include/musyx/synth.h @@ -52,7 +52,7 @@ u8 synthFXGetMaxVoices(u16 fid); void synthPauseVolume(u8 volume, u16 time, u8 vGroup); bool dataRemoveFX(u16 gid); void voiceUnblock(u32 voice); -void voiceRemovePriority(const SYNTH_VOICE* svoice); +void voiceRemovePriority(SYNTH_VOICE* svoice); #ifdef __cplusplus } #endif diff --git a/src/musyx/runtime/stream.c b/src/musyx/runtime/stream.c index 41b89ec8..d6242eeb 100644 --- a/src/musyx/runtime/stream.c +++ b/src/musyx/runtime/stream.c @@ -622,7 +622,8 @@ void sndStreamFree(u32 stid) { u32 sndStreamActivate(u32 stid) { u32 i; // r31 - bool ret = 0; // r28 + u32 ret; // r28 + ret = 0; MUSY_ASSERT_MSG(sndActive, "Sound system is not initialized."); hwDisableIrq(); i = GetPrivateIndex(stid); diff --git a/src/musyx/runtime/synthmacros.c b/src/musyx/runtime/synthmacros.c index df5e7a09..48dd09f8 100644 --- a/src/musyx/runtime/synthmacros.c +++ b/src/musyx/runtime/synthmacros.c @@ -751,7 +751,11 @@ static u32 TranslateVolume(u32 volume, u16 curve) { if (vhigh < 0x7f) { d = vlow * (ptr[vhigh + 1] - ptr[vhigh]); +#if MUSY_VERSION >= MUSY_VERSION_CHECK(2, 0, 0) + volume = d + ((u16)ptr[vhigh] << 16); +#else volume = d + (ptr[vhigh] << 16); +#endif } else { volume = ptr[vhigh] << 16; } diff --git a/src/musyx/runtime/synthvoice.c b/src/musyx/runtime/synthvoice.c index 739f91e2..d2641af4 100644 --- a/src/musyx/runtime/synthvoice.c +++ b/src/musyx/runtime/synthvoice.c @@ -194,9 +194,11 @@ static void voiceInitPrioSort() { voicePrioSortRootListRoot = 0xffff; } -void voiceRemovePriority(const SYNTH_VOICE* svoice) { - SYNTH_VOICELIST* vps = &voicePrioSortVoices[svoice->id & 0xFF]; // r31 - SYNTH_ROOTLIST* rps; // r30 +void voiceRemovePriority(SYNTH_VOICE* svoice) { + SYNTH_VOICELIST* vps; // r31 + SYNTH_ROOTLIST* rps; // r30 + + vps = &voicePrioSortVoices[svoice->id & 0xFF]; if (vps->user != 1) { return; } @@ -294,7 +296,7 @@ void voiceFree(SYNTH_VOICE* svoice) { u32 i; // r29 SYNTH_VOICELIST* sfv; // r30 i = 1; - MUSY_ASSERT(svoice->id!=0xFFFFFFFF); + MUSY_ASSERT(svoice->id != 0xFFFFFFFF); macMakeInactive(svoice, MAC_STATE_STOPPED); voiceRemovePriority(svoice); svoice->addr = NULL;