mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-15 14:27:29 +00:00
Ensured tape position is unaffected if the attempt at loading quickly fails.
This commit is contained in:
@@ -124,7 +124,8 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
|
|||||||
case CPU::Z80::PartialMachineCycle::ReadOpcodeStart:
|
case CPU::Z80::PartialMachineCycle::ReadOpcodeStart:
|
||||||
case CPU::Z80::PartialMachineCycle::ReadOpcodeWait:
|
case CPU::Z80::PartialMachineCycle::ReadOpcodeWait:
|
||||||
// Check for use of the fast tape hack.
|
// 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());
|
int next_byte = parser_.get_next_byte(tape_player_.get_tape());
|
||||||
if(next_byte != -1) {
|
if(next_byte != -1) {
|
||||||
uint16_t hl = get_value_of_register(CPU::Z80::Register::HL);
|
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;
|
*cycle.value = 0x00;
|
||||||
set_value_of_register(CPU::Z80::Register::ProgramCounter, tape_return_address_ - 1);
|
set_value_of_register(CPU::Z80::Register::ProgramCounter, tape_return_address_ - 1);
|
||||||
return 0;
|
return 0;
|
||||||
|
} else {
|
||||||
|
tape_player_.get_tape()->seek(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is_opcode_read = true;
|
is_opcode_read = true;
|
||||||
|
Reference in New Issue
Block a user