commit ad4ff821384dec0976300610071020a2b0889368
parent e4416264e83b74c23920205afd419e9149c35595
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Fri, 20 Aug 2021 22:43:35 +0100
Made Audio*/output return a minimum of 1 on a playing non-muted channel
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/devices/apu.c b/src/devices/apu.c
@@ -85,10 +85,11 @@ Uint8
apu_get_vu(Apu *c)
{
int i;
- Sint32 sum[2];
+ Sint32 sum[2] = {0, 0};
if(!c->advance || !c->period) return 0;
for(i = 0; i < 2; ++i) {
- sum[i] = envelope(c, c->age) * c->volume[i] / 0x800;
+ if(!c->volume[i]) continue;
+ sum[i] = 1 + envelope(c, c->age) * c->volume[i] / 0x800;
if(sum[i] > 0xf) sum[i] = 0xf;
}
return (sum[0] << 4) | sum[1];