From 481487f0845776cc4ac17cb8c2e2a82b16436621 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 13 Jul 2017 22:39:30 -0400 Subject: [PATCH] Oh yuck, it looks like I've repeated this same test in two different places. Must figure out where to factor it out to. But in the meantime, the emulated Electron has just loaded its first CSW. --- Machines/Electron/Tape.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Machines/Electron/Tape.cpp b/Machines/Electron/Tape.cpp index 50c4b7e86..a95d94995 100644 --- a/Machines/Electron/Tape.cpp +++ b/Machines/Electron/Tape.cpp @@ -78,8 +78,11 @@ void Tape::process_input_pulse(Storage::Tape::Tape::Pulse pulse) { crossings_[3] = Tape::Unrecognised; if(pulse.type != Storage::Tape::Tape::Pulse::Zero) { float pulse_length = (float)pulse.length.length / (float)pulse.length.clock_rate; - if(pulse_length >= 0.35 / 2400.0 && pulse_length < 0.7 / 2400.0) crossings_[3] = Tape::Short; - if(pulse_length >= 0.35 / 1200.0 && pulse_length < 0.7 / 1200.0) crossings_[3] = Tape::Long; + if(pulse_length >= 0.35 / 2400.0 && pulse_length < 0.7 / 1200.0) { + crossings_[3] = pulse_length > 1.0 / 3000.0 ? Tape::Long : Tape::Short; + } +// if(pulse_length >= 0.35 / 2400.0 && pulse_length < 0.7 / 2400.0) crossings_[3] = Tape::Short; +// if(pulse_length >= 0.35 / 1200.0 && pulse_length < 0.7 / 1200.0) crossings_[3] = Tape::Long; } if(crossings_[0] == Tape::Long && crossings_[1] == Tape::Long) {