From c4fe38a61fefdf70f4a088edc73fa309a843548d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 13 Nov 2025 18:05:13 -0500 Subject: [PATCH] Allow potentometer inputs to be set; disable SID by default. --- Analyser/Static/Acorn/Target.hpp | 2 +- Components/SID/SID.cpp | 8 ++++++-- Components/SID/SID.hpp | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Analyser/Static/Acorn/Target.hpp b/Analyser/Static/Acorn/Target.hpp index 273c31839..e97cf71fa 100644 --- a/Analyser/Static/Acorn/Target.hpp +++ b/Analyser/Static/Acorn/Target.hpp @@ -44,7 +44,7 @@ struct BBCMicroTarget: public ::Analyser::Static::Target, public Reflection::Str bool has_1770dfs = false; bool has_adfs = false; bool has_sideways_ram = true; - bool has_beebsid = true; // TODO: false is a much better default. + bool has_beebsid = false; ReflectableEnum(TubeProcessor, None, WDC65C02, Z80); TubeProcessor tube_processor = TubeProcessor::None; diff --git a/Components/SID/SID.cpp b/Components/SID/SID.cpp index 37f2f2758..eb238af1e 100644 --- a/Components/SID/SID.cpp +++ b/Components/SID/SID.cpp @@ -88,6 +88,10 @@ void SID::write(const Numeric::SizedInt<5> address, const uint8_t value) { }); } +void SID::set_potentometer_input(const int index, const uint8_t value) { + potentometers_[index] = value; +} + void SID::update_filter() { using Type = SignalProcessing::BiquadFilter::Type; Type type = Type::AllPass; @@ -136,8 +140,8 @@ uint8_t SID::read(const Numeric::SizedInt<5> address) { switch(address.get()) { default: return last_write_; - case 0x19: return 0x00; // TODO: potentometer x. - case 0x1a: return 0x00; // TODO: potentometer y. + case 0x19: return potentometers_[0]; + case 0x1a: return potentometers_[1]; case 0x1b: case 0x1c: diff --git a/Components/SID/SID.hpp b/Components/SID/SID.hpp index 79a0b3ee6..800aea528 100644 --- a/Components/SID/SID.hpp +++ b/Components/SID/SID.hpp @@ -96,6 +96,7 @@ public: void write(Numeric::SizedInt<5> address, uint8_t value); uint8_t read(Numeric::SizedInt<5> address); + void set_potentometer_input(int index, uint8_t value); // Outputs::Speaker::BufferSource. template @@ -120,6 +121,8 @@ private: void update_filter(); SignalProcessing::BiquadFilter output_filter_; + + uint8_t potentometers_[2]{}; }; }