From c8cee88e3386b0ead620fa54409f37881d112c41 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 18 Jul 2017 22:49:11 -0400 Subject: [PATCH] Ensured that a stopped tape outputs a `false` level and took an extra safety check in instantiation. --- Storage/Tape/Tape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Storage/Tape/Tape.cpp b/Storage/Tape/Tape.cpp index b615fcf50..24528e58b 100644 --- a/Storage/Tape/Tape.cpp +++ b/Storage/Tape/Tape.cpp @@ -85,7 +85,7 @@ void TapePlayer::process_next_event() { #pragma mark - Binary Player BinaryTapePlayer::BinaryTapePlayer(unsigned int input_clock_rate) : - TapePlayer(input_clock_rate), motor_is_running_(false) + TapePlayer(input_clock_rate), motor_is_running_(false), input_level_(false) {} void BinaryTapePlayer::set_motor_control(bool enabled) { @@ -97,7 +97,7 @@ void BinaryTapePlayer::set_tape_output(bool set) { } bool BinaryTapePlayer::get_input() { - return input_level_; + return motor_is_running_ && input_level_; } void BinaryTapePlayer::run_for_cycles(int number_of_cycles) {