From f05260b839d226a8f11a682a965e8a4b1ef8f460 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 6 Mar 2021 21:59:45 -0500 Subject: [PATCH] ZX80/1: fix initial key state, wait line when NMI disabled. --- Machines/ZX8081/ZX8081.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index 96a10efbc..be604d1be 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -101,6 +101,8 @@ template class ConcreteMachine: } Memory::Fuzz(ram_); + // Ensure valid initial key state. + clear_all_keys(); if(!target.loading_command.empty()) { type_string(target.loading_command); should_autorun_ = true; @@ -163,6 +165,7 @@ template class ConcreteMachine: } if(!(address & 2)) nmi_is_enabled_ = false; if(!(address & 1)) nmi_is_enabled_ = is_zx81; + if(!nmi_is_enabled_) z80_.set_wait_line(false); // The below emulates the ZonX AY expansion device. if constexpr (is_zx81) { @@ -255,8 +258,6 @@ template class ConcreteMachine: should_autorun_ = false; } - if(address >= 0x24d && address < 0x256) printf("PC: %04x\n", address); - // Check for automatic tape control. if(use_automatic_tape_motor_control_) { tape_player_.set_motor_control((address >= automatic_tape_motor_start_address_) && (address < automatic_tape_motor_end_address_));