1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-12 00:30:31 +00:00

Slightly simplified code, fixed divider.

This commit is contained in:
Thomas Harte 2016-10-21 22:12:44 -04:00
parent d7c0c49715
commit 46a3c0922f

View File

@ -129,6 +129,8 @@ void AY38910::get_samples(unsigned int number_of_samples, int16_t *target)
c++;
}
}
_master_divider &= 15;
}
void AY38910::evaluate_output_volume()
@ -190,15 +192,15 @@ void AY38910::set_register_value(uint8_t value)
switch(selected_register)
{
case 0: case 2: case 4:
_tone_generator_controls[selected_register >> 1] =
(_tone_generator_controls[selected_register >> 1] & ~0xff) | value;
_channel_dividers[selected_register >> 1] = _tone_generator_controls[selected_register >> 1];
break;
case 1: case 3: case 5:
_tone_generator_controls[selected_register >> 1] =
(_tone_generator_controls[selected_register >> 1] & 0xff) | (uint16_t)((value&0xf) << 8);
_channel_dividers[selected_register >> 1] = _tone_generator_controls[selected_register >> 1];
{
int channel = selected_register >> 1;
if(selected_register & 1)
_tone_generator_controls[channel] = (_tone_generator_controls[channel] & 0xff) | (uint16_t)((value&0xf) << 8);
else
_tone_generator_controls[channel] = (_tone_generator_controls[channel] & ~0xff) | value;
_channel_dividers[channel] = _tone_generator_controls[channel];
}
break;
case 6: