diff --git a/desmume/src/SPU.cpp b/desmume/src/SPU.cpp index 4045be3c6..96c449bbf 100644 --- a/desmume/src/SPU.cpp +++ b/desmume/src/SPU.cpp @@ -1179,7 +1179,6 @@ template static FORCEINLINE void TestForLoop(SPU_struct *SPU, channe if(chan->repeat != 1) { SPU->KeyOff(chan->num); - SPU->bufpos = SPU->buflength; return; } @@ -1235,13 +1234,16 @@ template { s16 data = 0; s32 pos = chan->sampcntInt; - switch(FORMAT) + if(chan->status != CHANSTAT_STOPPED) { - case 0: data = Fetch8BitData (chan, pos); break; - case 1: data = Fetch16BitData(chan, pos); break; - case 2: data = FetchADPCMData(chan, pos); break; - case 3: data = FetchPSGData (chan, pos); break; - default: break; + switch(FORMAT) + { + case 0: data = Fetch8BitData (chan, pos); break; + case 1: data = Fetch16BitData(chan, pos); break; + case 2: data = FetchADPCMData(chan, pos); break; + case 3: data = FetchPSGData (chan, pos); break; + default: break; + } } chan->pcm16bOffs++; chan->pcm16b[SPUCHAN_PCM16B_AT(chan->pcm16bOffs)] = data;