diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index 2caef8424..8cceecb2c 100644 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -375,6 +375,8 @@ extern struct TCommonSettings { strcpy(ARM9BIOS, "biosnds9.bin"); strcpy(ARM7BIOS, "biosnds7.bin"); strcpy(Firmware, "firmware.bin"); + for(int i=0;i<16;i++) + spu_muteChannels[i] = false; } bool HighResolutionInterpolateColor; @@ -400,6 +402,8 @@ extern struct TCommonSettings { //this is the user's choice of manual backup type, for cases when the autodetection can't be trusted int manualBackupType; + bool spu_muteChannels[16]; + struct _ShowGpu { _ShowGpu() : main(true), sub(true) {} union { diff --git a/desmume/src/SPU.cpp b/desmume/src/SPU.cpp index eb4f3f407..948bb1dea 100644 --- a/desmume/src/SPU.cpp +++ b/desmume/src/SPU.cpp @@ -956,7 +956,6 @@ FORCEINLINE static void _SPU_ChanUpdate(const bool actuallyMix, SPU_struct* cons template static void SPU_MixAudio(SPU_struct *SPU, int length) { - int i; u8 vol; if(actuallyMix) @@ -975,7 +974,7 @@ static void SPU_MixAudio(SPU_struct *SPU, int length) vol = T1ReadByte(MMU.ARM7_REG, 0x500) & 0x7F; - for(i=0;i<16;i++) + for(int i=0;i<16;i++) { channel_struct *chan = &SPU->channels[i]; @@ -986,12 +985,12 @@ static void SPU_MixAudio(SPU_struct *SPU, int length) SPU->buflength = length; // Mix audio - _SPU_ChanUpdate(actuallyMix, SPU, chan); + _SPU_ChanUpdate(!CommonSettings.spu_muteChannels[i] && actuallyMix, SPU, chan); } // convert from 32-bit->16-bit if(actuallyMix) - for (i = 0; i < length*2; i++) + for (int i = 0; i < length*2; i++) { // Apply Master Volume SPU->sndbuf[i] = spumuldiv7(SPU->sndbuf[i], vol);