diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index 3d955c268..9bec922da 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -124,7 +124,8 @@ 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(use_fast_tape_hack_ && address == tape_trap_address_) { + if(use_fast_tape_hack_ && address == tape_trap_address_ && tape_player_.has_tape()) { + Storage::Time time = tape_player_.get_tape()->get_current_time(); 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); @@ -132,6 +133,8 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) { *cycle.value = 0x00; set_value_of_register(CPU::Z80::Register::ProgramCounter, tape_return_address_ - 1); return 0; + } else { + tape_player_.get_tape()->seek(time); } } is_opcode_read = true;