From 644ef13acde3b351b923da6997c90afbfc0b8136 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 22 Jun 2017 20:20:31 -0400 Subject: [PATCH] Connected up the fast-tape GUI option for the ZX80 and '81. --- Machines/ZX8081/ZX8081.cpp | 7 ++++--- Machines/ZX8081/ZX8081.hpp | 4 ++++ OSBindings/Mac/Clock Signal/Machine/Wrappers/CSZX8081.mm | 9 +++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index 184434791..3f772c133 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -21,7 +21,8 @@ Machine::Machine() : vsync_(false), hsync_(false), nmi_is_enabled_(false), - tape_player_(ZX8081ClockRate) { + tape_player_(ZX8081ClockRate), + use_fast_tape_hack_(false) { set_clock_rate(ZX8081ClockRate); tape_player_.set_motor_control(true); clear_all_keys(); @@ -118,7 +119,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) { case CPU::Z80::PartialMachineCycle::ReadOpcodeStart: case CPU::Z80::PartialMachineCycle::ReadOpcodeWait: // Check for use of the fast tape hack. -/* if(address == tape_trap_address_) { // TODO: && fast_tape_hack_enabled_ + if(use_fast_tape_hack_ && address == tape_trap_address_) { int next_byte = parser_.get_next_byte(tape_player_.get_tape()); if(next_byte != -1) { uint16_t hl = get_value_of_register(CPU::Z80::Register::HL); @@ -127,7 +128,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) { set_value_of_register(CPU::Z80::Register::ProgramCounter, tape_return_address_ - 1); return 0; } - }*/ + } is_opcode_read = true; case CPU::Z80::PartialMachineCycle::Read: diff --git a/Machines/ZX8081/ZX8081.hpp b/Machines/ZX8081/ZX8081.hpp index f44d7580d..9bd9044a5 100644 --- a/Machines/ZX8081/ZX8081.hpp +++ b/Machines/ZX8081/ZX8081.hpp @@ -62,6 +62,8 @@ class Machine: void set_key_state(uint16_t key, bool isPressed); void clear_all_keys(); + inline void set_use_fast_tape_hack(bool activate) { use_fast_tape_hack_ = activate; } + private: std::shared_ptr