From 106e56600da21638a5f6adf680af11f46d068831 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 21 Jun 2016 07:31:14 -0400 Subject: [PATCH] Added a DC offset for 6560 volume level, albeit one plucked from thin air. --- Components/6560/6560.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Components/6560/6560.cpp b/Components/6560/6560.cpp index 32c2b02d5..e63002535 100644 --- a/Components/6560/6560.cpp +++ b/Components/6560/6560.cpp @@ -429,12 +429,14 @@ void MOS6560::Speaker::get_samples(unsigned int number_of_samples, int16_t *targ update(2, 0, shift); update(3, 1, increment); + // this sums the output of all three sounds channels plus a DC offset for volume; + // TODO: what's the real ratio of this stuff? target[c] = ( (_shift_registers[0]&1) + (_shift_registers[1]&1) + (_shift_registers[2]&1) + ((noise_pattern[_shift_registers[3] >> 3] >> (_shift_registers[3]&7))&(_control_registers[3] >> 7)&1) - ) * _volume * 700; + ) * _volume * 700 + _volume * 44; } }