1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

ZX80/1: fix initial key state, wait line when NMI disabled.

This commit is contained in:
Thomas Harte 2021-03-06 21:59:45 -05:00
parent 62949d2f8b
commit f05260b839

View File

@ -101,6 +101,8 @@ template<bool is_zx81> 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<bool is_zx81> 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<bool is_zx81> 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_));