1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Decided to go with divide by 256 for the envelope counter after all.

This commit is contained in:
Thomas Harte 2016-11-09 21:51:56 -05:00
parent 77ce200fbb
commit 77987bf31e

View File

@ -124,7 +124,7 @@ void AY38910::get_samples(unsigned int number_of_samples, int16_t *target)
if(_envelope_divider) _envelope_divider--; if(_envelope_divider) _envelope_divider--;
else else
{ {
_envelope_divider = _envelope_period; _envelope_divider = _envelope_period * 16;
_envelope_position ++; _envelope_position ++;
if(_envelope_position == 32) _envelope_position = _envelope_overflow_masks[_output_registers[13]]; if(_envelope_position == 32) _envelope_position = _envelope_overflow_masks[_output_registers[13]];
} }
@ -215,12 +215,12 @@ void AY38910::set_register_value(uint8_t value)
case 11: case 11:
_envelope_period = (_envelope_period & ~0xff) | value; _envelope_period = (_envelope_period & ~0xff) | value;
_envelope_divider = _envelope_period; _envelope_divider = _envelope_period * 16;
break; break;
case 12: case 12:
_envelope_period = (_envelope_period & 0xff) | (int)(value << 8); _envelope_period = (_envelope_period & 0xff) | (int)(value << 8);
_envelope_divider = _envelope_period; _envelope_divider = _envelope_period * 16;
break; break;
case 13: case 13: