unsigned int bRVBActive:1; // reverb active flag\r
unsigned int bNoise:1; // noise active flag\r
unsigned int bFMod:2; // freq mod (0=off, 1=sound channel, 2=freq channel)\r
+ unsigned int bJump:1; // last decoded block jumped\r
\r
int iLeftVolume; // left volume\r
int iRightVolume; // right volume\r
d->bOn = !!(dwChannelOn & (1<<ch));\r
d->bStop = s->bStop;\r
d->bReverb = s->bReverb;\r
+ d->bIgnoreLoop = s->bJump;\r
d->iActFreq = 1;\r
d->iUsedFreq = 2;\r
d->iLeftVolume = s->iLeftVolume;\r
d->bRVBActive = s->bRVBActive;\r
d->bNoise = s->bNoise;\r
d->bFMod = s->bFMod;\r
+ d->bJump = s->bIgnoreLoop;\r
d->ADSRX.State = s->ADSRX.State;\r
d->ADSRX.AttackModeExp = s->ADSRX.AttackModeExp;\r
d->ADSRX.AttackRate = s->ADSRX.AttackRate;\r
//------------------------------------------------//\r
case 14: // loop?\r
s_chan[ch].pLoop=spuMemC+((val&~1)<<3);\r
+ if(s_chan[ch].bJump)\r
+ // real machine would be most likely still doing the last block and use new value for the jump;\r
+ // but we decode ahead a bit and already did the jump part, so compensate for that now.\r
+ s_chan[ch].pCurr=s_chan[ch].pLoop;\r
break;\r
//------------------------------------------------//\r
}\r
s_chan[ch].bStop=0;\r
s_chan[ch].pCurr=spuMemC+((regAreaGet(ch,6)&~1)<<3); // must be block aligned\r
s_chan[ch].pLoop=spuMemC+((regAreaGet(ch,14)&~1)<<3);\r
+ s_chan[ch].bJump=0;\r
\r
dwNewChannel|=(1<<ch); // bitfield for faster testing\r
dwChannelOn|=1<<ch;\r
}
s_chan[ch].pCurr = start; // store values for next cycle
+ s_chan[ch].bJump = flags & 1;
return ret;
}
}
if(flags & 4)
- s_chan[ch].pLoop=start;
+ s_chan[ch].pLoop = start;
s_chan[ch].pCurr += 16;
if(flags & 1)
s_chan[ch].pCurr = s_chan[ch].pLoop;
+ s_chan[ch].bJump = flags & 1;
return ret;
}