Revert "effects for controlling volume slides"

This reverts commit 629667d460.
This commit is contained in:
tildearrow 2024-07-23 14:44:14 -05:00
parent b1a4ddd9af
commit 5a961a5485
5 changed files with 10 additions and 31 deletions

View file

@ -932,14 +932,6 @@ void DivEngine::processRow(int i, bool afterDelay) {
clockDrift=0;
subticks=0;
break;
case 0xd8: // vol slide bottom
chan[i].volBottom=(effectVal<<8)|0xff;
if (chan[i].volBottom>chan[i].volMax) chan[i].volBottom=chan[i].volMax;
break;
case 0xd9: // vol slide top
chan[i].volTop=(effectVal<<8)|0xff;
if (chan[i].volTop>chan[i].volMax) chan[i].volTop=chan[i].volMax;
break;
case 0xdc: // delayed mute
if (effectVal>0 && (song.delayBehavior==2 || effectVal<nextSpeed)) {
chan[i].volCut=effectVal+1;
@ -1103,13 +1095,13 @@ void DivEngine::processRow(int i, bool afterDelay) {
break;
case 0xf8: // single volume ramp up
chan[i].volSpeed=0; // add compat flag?
chan[i].volume=MIN(chan[i].volume+effectVal*256,chan[i].volTop);
chan[i].volume=MIN(chan[i].volume+effectVal*256,chan[i].volMax);
dispatchCmd(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));
dispatchCmd(DivCommand(DIV_CMD_HINT_VOLUME,i,chan[i].volume>>8));
break;
case 0xf9: // single volume ramp down
chan[i].volSpeed=0; // add compat flag?
chan[i].volume=MAX(chan[i].volume-effectVal*256,chan[i].volBottom);
chan[i].volume=MAX(chan[i].volume-effectVal*256,0);
dispatchCmd(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));
dispatchCmd(DivCommand(DIV_CMD_HINT_VOLUME,i,chan[i].volume>>8));
break;
@ -1596,19 +1588,19 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
if (chan[i].volSpeed!=0) {
chan[i].volume=(chan[i].volume&0xff)|(dispatchCmd(DivCommand(DIV_CMD_GET_VOLUME,i))<<8);
chan[i].volume+=chan[i].volSpeed;
if (chan[i].volume>chan[i].volTop) {
chan[i].volume=chan[i].volTop;
if (chan[i].volume>chan[i].volMax) {
chan[i].volume=chan[i].volMax;
chan[i].volSpeed=0;
dispatchCmd(DivCommand(DIV_CMD_HINT_VOLUME,i,chan[i].volume>>8));
dispatchCmd(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));
dispatchCmd(DivCommand(DIV_CMD_HINT_VOL_SLIDE,i,0));
} else if (chan[i].volume<chan[i].volBottom) {
} else if (chan[i].volume<0) {
chan[i].volSpeed=0;
dispatchCmd(DivCommand(DIV_CMD_HINT_VOL_SLIDE,i,0));
if (song.legacyVolumeSlides) {
chan[i].volume=chan[i].volTop+1;
chan[i].volume=chan[i].volMax+1;
} else {
chan[i].volume=chan[i].volBottom;
chan[i].volume=0;
}
dispatchCmd(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));
dispatchCmd(DivCommand(DIV_CMD_HINT_VOLUME,i,chan[i].volume>>8));