diff --git a/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp b/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp index cba648d6e..88bf2a60b 100644 --- a/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp +++ b/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp @@ -551,11 +551,11 @@ template class ConcreteMachine: if(!(address&0x1000)) *cycle.value &= static_cast(joysticks_[0].get())->get_sinclair(0); if(!(address&0x0800)) *cycle.value &= static_cast(joysticks_[1].get())->get_sinclair(1); - // If this read is within 200 cycles of the previous, - // count it as an adjacent hit; if 20 of those have - // occurred then start the tape motor. + // If this read is between 50 and 200 cycles since the + // previous, count it as an adjacent hit; if 20 of those + // have occurred then start the tape motor. if(use_automatic_tape_motor_control_) { - if(cycles_since_tape_input_read_ < HalfCycles(400)) { + if(cycles_since_tape_input_read_ >= HalfCycles(100) && cycles_since_tape_input_read_ < HalfCycles(200)) { ++recent_tape_hits_; if(recent_tape_hits_ == 20) { @@ -627,11 +627,11 @@ template class ConcreteMachine: if(!tape_player_is_sleeping_) tape_player_.run_for(duration.as_integral()); // Update automatic tape motor control, if enabled; if it's been - // 3 seconds since software last possibly polled the tape, stop it. - if(use_automatic_tape_motor_control_ && cycles_since_tape_input_read_ < HalfCycles(clock_rate() * 6)) { + // 0.5 seconds since software last possibly polled the tape, stop it. + if(use_automatic_tape_motor_control_ && cycles_since_tape_input_read_ < HalfCycles(clock_rate())) { cycles_since_tape_input_read_ += duration; - if(cycles_since_tape_input_read_ >= HalfCycles(clock_rate() * 6)) { + if(cycles_since_tape_input_read_ >= HalfCycles(clock_rate())) { tape_player_.set_motor_control(false); recent_tape_hits_ = 0; } diff --git a/OSBindings/Qt/audiobuffer.h b/OSBindings/Qt/audiobuffer.h index 96964c495..b4beaaede 100644 --- a/OSBindings/Qt/audiobuffer.h +++ b/OSBindings/Qt/audiobuffer.h @@ -8,16 +8,18 @@ #include /*! - * \brief Provides an intermediate receipticle for audio data. + * \brief An intermediate recepticle for audio data. * * Provides a QIODevice that will attempt to buffer the minimum amount * of data before handing it off to a polling QAudioOutput. * - * Adding an extra buffer increases worst-case latency but resolves a - * startup race condition in which it is difficult to tell how much data a - * QAudioOutput that is populated by pushing data currently has buffered; - * it also works around what empirically seemed to be a minimum 16384-byte - * latency on push audio generation. + * Adding an extra buffer increases worst-case latency but resolves two + * issues uncovered with use of a QAudioOutput by push: + * + * 1. knowing how much data is currently buffered, to avoid being at a + * permanent disadvantage after startup; and + * 2. that such QAudioOutputs empirically seem to introduce a minimum + * 16384-byte latency. */ struct AudioBuffer: public QIODevice { AudioBuffer() { diff --git a/README.md b/README.md index 33062d978..0aecf6fe1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ ![Clock Signal Application Icon](READMEImages/Icon.png) # Clock Signal -Clock Signal ('CLK') is an emulator for tourists that seeks to be invisible. Users directly launch classic software with no emulator or per-emulated-machine learning curve. - -macOS and source releases are [hosted on GitHub](https://github.com/TomHarte/CLK/releases). For desktop Linux it is also available as a [Snap](https://snapcraft.io/clock-signal). On the Mac it is a native Cocoa and Metal application; under Linux, BSD and other UNIXes and UNIX-alikes it uses OpenGL and can be built either with Qt or with SDL. +Clock Signal ('CLK') is an emulator for tourists that seeks to be invisible. Users directly launch classic software, avoiding the learning curve associated with emulators and with classic machines. This emulator seeks to offer: * single-click load of any piece of source media for any supported platform; @@ -24,6 +22,8 @@ It currently contains emulations of the: * Sinclair ZX80/81; and * Sinclair ZX Spectrum. +macOS and source releases are [hosted on GitHub](https://github.com/TomHarte/CLK/releases). For desktop Linux it is also available as a [Snap](https://snapcraft.io/clock-signal). On the Mac it is a native Cocoa and Metal application; under Linux, BSD and other UNIXes and UNIX-alikes it uses OpenGL and can be built either with Qt or with SDL. + ## Single-step Loading Through static and runtime analysis CLK seeks automatically to select and configure the appropriate machine to run any provided disk, tape or ROM; to issue any commands necessary to run the software contained on the disk, tape or ROM; and to provide accelerated loading where feasible.