even. more. volume. slide. fixes.

so it happens on >volMax too
amazing
This commit is contained in:
tildearrow 2021-05-18 01:52:03 -05:00
parent 38b16fe5ae
commit ccd5acf1e4
2 changed files with 3 additions and 2 deletions

View file

@ -698,7 +698,7 @@ bool DivEngine::init() {
blip_set_rates(bb[1],dispatch->rate,got.rate);
for (int i=0; i<chans; i++) {
chan[i].volMax=dispatch->dispatch(DivCommand(DIV_CMD_GET_VOLMAX,i))<<8;
chan[i].volMax=(dispatch->dispatch(DivCommand(DIV_CMD_GET_VOLMAX,i))<<8)|0xff;
chan[i].volume=chan[i].volMax;
}

View file

@ -348,10 +348,11 @@ void DivEngine::nextTick() {
chan[i].volume+=chan[i].volSpeed;
if (chan[i].volume>chan[i].volMax) {
chan[i].volume=chan[i].volMax;
chan[i].volSpeed=0;
dispatch->dispatch(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));
} else if (chan[i].volume<0) {
chan[i].volSpeed=0;
chan[i].volume=chan[i].volMax+0x100;
chan[i].volume=chan[i].volMax+1;
dispatch->dispatch(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));
} else {
dispatch->dispatch(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));