From e2575d6de4d9a74efe7f81a1fa40e749b3a6a7da Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 8 Jul 2017 19:21:12 -0400 Subject: [PATCH] Routed tape motor selections through to the C++ side of the world, and ensured that manual tape playback works properly. --- Machines/ZX8081/ZX8081.cpp | 2 +- Machines/ZX8081/ZX8081.hpp | 7 +++++++ .../Mac/Clock Signal/Machine/Wrappers/CSZX8081.mm | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index cf3c24ed0..d716cd303 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -55,7 +55,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) { if(is_zx81_) horizontal_counter_ %= 207; if(!tape_advance_delay_) { - tape_player_.run_for_cycles(cycle.length); + if(tape_is_automatically_playing_ || tape_is_playing_) tape_player_.run_for_cycles(cycle.length); } else { tape_advance_delay_ = std::max(tape_advance_delay_ - cycle.length, 0); } diff --git a/Machines/ZX8081/ZX8081.hpp b/Machines/ZX8081/ZX8081.hpp index d07ed461a..95b96635d 100644 --- a/Machines/ZX8081/ZX8081.hpp +++ b/Machines/ZX8081/ZX8081.hpp @@ -63,6 +63,11 @@ class Machine: void clear_all_keys(); inline void set_use_fast_tape_hack(bool activate) { use_fast_tape_hack_ = activate; } + inline void set_use_automatic_tape_motor_control(bool enabled) { + use_automatic_tape_motor_control_ = enabled; + if(!enabled) tape_is_automatically_playing_ = false; + } + inline void set_tape_is_playing(bool is_playing) { tape_is_playing_ = is_playing; } private: std::shared_ptr