1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00

Hit up the other two kinds of audio generator.

This commit is contained in:
Thomas Harte 2016-10-07 17:10:00 -04:00
parent 002e923cf1
commit 922dd6a586
2 changed files with 16 additions and 6 deletions

View File

@ -19,12 +19,16 @@ Speaker::Speaker() :
void Speaker::set_volume(uint8_t volume)
{
_volume = volume;
enqueue([=]() {
_volume = volume;
});
}
void Speaker::set_control(int channel, uint8_t value)
{
_control_registers[channel] = value;
enqueue([=]() {
_control_registers[channel] = value;
});
}
// Source: VICE. Not original.

View File

@ -804,18 +804,24 @@ Atari2600::Speaker::~Speaker()
void Atari2600::Speaker::set_volume(int channel, uint8_t volume)
{
_volume[channel] = volume & 0xf;
enqueue([=]() {
_volume[channel] = volume & 0xf;
});
}
void Atari2600::Speaker::set_divider(int channel, uint8_t divider)
{
_divider[channel] = divider & 0x1f;
_divider_counter[channel] = 0;
enqueue([=]() {
_divider[channel] = divider & 0x1f;
_divider_counter[channel] = 0;
});
}
void Atari2600::Speaker::set_control(int channel, uint8_t control)
{
_control[channel] = control & 0xf;
enqueue([=]() {
_control[channel] = control & 0xf;
});
}
#define advance_poly4(c) _poly4_counter[channel] = (_poly4_counter[channel] >> 1) | (((_poly4_counter[channel] << 3) ^ (_poly4_counter[channel] << 2))&0x008)