From dab358011195dda172b4cef2c45438848d7f117c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 22 Aug 2016 22:18:05 -0400 Subject: [PATCH] Experimental: can I afford a lower sampling rate if there's a low-pass filter in effect? --- Machines/Commodore/Vic-20/Vic20.cpp | 3 +++ Outputs/Speaker.hpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index 408ae8735..140f243d0 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -139,6 +139,9 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin _tape.run_for_cycles(1); } } + + // f7af: find tape header, exit with header in buffer + // F8C0: Read tape block } else { diff --git a/Outputs/Speaker.hpp b/Outputs/Speaker.hpp index 72e595aa9..413a37bf4 100644 --- a/Outputs/Speaker.hpp +++ b/Outputs/Speaker.hpp @@ -34,6 +34,9 @@ class Speaker { float get_ideal_clock_rate_in_range(float minimum, float maximum) { + // return twice the cut off, if applicable + if(_high_frequency_cut_off > 0.0f && _input_cycles_per_second >= _high_frequency_cut_off * 2.0f && _input_cycles_per_second <= _high_frequency_cut_off * 2.0f) return _high_frequency_cut_off * 2.0f; + // return exactly the input rate if possible if(_input_cycles_per_second >= minimum && _input_cycles_per_second <= maximum) return _input_cycles_per_second;