From ccd5acf1e49763d2bc64092462cf3f35e9d07b4b Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 18 May 2021 01:52:03 -0500 Subject: [PATCH] even. more. volume. slide. fixes. so it happens on >volMax too amazing --- src/engine/engine.cpp | 2 +- src/engine/playback.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index e165fa165..19202e2ed 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -698,7 +698,7 @@ bool DivEngine::init() { blip_set_rates(bb[1],dispatch->rate,got.rate); for (int i=0; idispatch(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; } diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 62b972a63..520f19cec 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -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));