From 7320f96ae76472e723f7962c8c96b476de029ffb Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 4 Dec 2021 18:02:43 -0500 Subject: [PATCH] Capture attachment flags. --- Machines/Amiga/Audio.cpp | 11 ++++++++++- Machines/Amiga/Audio.hpp | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Machines/Amiga/Audio.cpp b/Machines/Amiga/Audio.cpp index 3c2520911..08c9d0fbe 100644 --- a/Machines/Amiga/Audio.cpp +++ b/Machines/Amiga/Audio.cpp @@ -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) { diff --git a/Machines/Amiga/Audio.hpp b/Machines/Amiga/Audio.hpp index 685ef48c0..e78872178 100644 --- a/Machines/Amiga/Audio.hpp +++ b/Machines/Amiga/Audio.hpp @@ -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;