1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Capture attachment flags.

This commit is contained in:
Thomas Harte 2021-12-04 18:02:43 -05:00
parent fdf2b9cd7b
commit 7320f96ae7
2 changed files with 14 additions and 1 deletions

View File

@ -60,7 +60,16 @@ void Audio::set_channel_enables(uint16_t enables) {
channels_[3].dma_enabled = enables & 8;
}
void Audio::set_modulation_flags(uint16_t) {
void Audio::set_modulation_flags(uint16_t flags) {
channels_[3].attach_period = flags & 0x80;
channels_[2].attach_period = flags & 0x40;
channels_[1].attach_period = flags & 0x20;
channels_[0].attach_period = flags & 0x10;
channels_[3].attach_volume = flags & 0x08;
channels_[2].attach_volume = flags & 0x04;
channels_[1].attach_volume = flags & 0x02;
channels_[0].attach_volume = flags & 0x01;
}
void Audio::set_interrupt_requests(uint16_t requests) {

View File

@ -85,6 +85,10 @@ class Audio: public DMADevice<4> {
uint16_t period = 0;
uint16_t period_counter = 0;
// Modulation / attach flags.
bool attach_period = false;
bool attach_volume = false;
// Output volume, [0, 64].
uint8_t volume;