ZXHawk: Fixed AY-3-8912 volume control (values under 50 were registering as maxvolume) - #1158

This commit is contained in:
Asnivor 2018-03-27 16:38:08 +01:00
parent f1fbd2b64e
commit 35c87c5aea
1 changed files with 5 additions and 2 deletions

View File

@ -526,7 +526,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// <summary>
/// The current volume
/// </summary>
private int _volume = 50;
private int _volume = 75;
/// <summary>
/// Volume tables state
@ -553,7 +553,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// </summary>
private void UpdateVolume()
{
var vol = ((ulong)0xFFFF * (ulong)_volume / 100UL) - 20000 ;
int upperFloor = 40000;
var inc = (0xFFFF - upperFloor) / 100;
var vol = inc * _volume; // ((ulong)0xFFFF * (ulong)_volume / 100UL) - 20000 ;
_volumeTables = new uint[6][];
// parent array