spu: rename dwChannelOn to something more suitable
[pcsx_rearmed.git] / plugins / dfsound / registers.c
index 61d0b81..eba4015 100644 (file)
@@ -296,7 +296,7 @@ unsigned short CALLBACK SPUreadRegister(unsigned long reg)
       {\r
        const int ch=(r>>4)-0xc0;\r
        if(spu.dwNewChannel&(1<<ch)) return 1;          // we are started, but not processed? return 1\r
-       if((spu.dwChannelOn&(1<<ch)) &&                 // same here... we haven't decoded one sample yet, so no envelope yet. return 1 as well\r
+       if((spu.dwChannelsAudible&(1<<ch)) &&           // same here... we haven't decoded one sample yet, so no envelope yet. return 1 as well\r
           !spu.s_chan[ch].ADSRX.EnvelopeVol)\r
         return 1;\r
        return (unsigned short)(spu.s_chan[ch].ADSRX.EnvelopeVol>>16);\r
@@ -488,6 +488,10 @@ static void SetPitch(int ch,unsigned short val)               // SET PITCH
  spu.s_chan[ch].sinc = NP << 4;\r
  spu.s_chan[ch].sinc_inv = 0;\r
  spu.SB[ch * SB_SIZE + 32] = 1; // -> freq change in simple interpolation mode: set flag\r
+ if (val)\r
+  spu.dwChannelsAudible |= 1u << ch;\r
+ else\r
+  spu.dwChannelsAudible &= ~(1u << ch);\r
 }\r
 \r
 ////////////////////////////////////////////////////////////////////////\r