From eecea93b3b235777c3256bd1173ea154279e3355 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 1 May 2018 21:31:37 -0400 Subject: [PATCH] Simplifies the test for resetting the ZX80/81 line counter. --- Machines/ZX8081/ZX8081.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index fd15e1e46..ade679f17 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -124,14 +124,12 @@ template class ConcreteMachine: bool is_opcode_read = false; switch(cycle.operation) { case CPU::Z80::PartialMachineCycle::Output: - if(!(address & 2)) nmi_is_enabled_ = false; - if(!(address & 1)) nmi_is_enabled_ = is_zx81_; if(!nmi_is_enabled_) { - // Line counter reset is held low while vsync is active; simulate that lazily by performing - // an instant reset upon the transition from active to inactive. - if(vsync_) line_counter_ = 0; + line_counter_ = 0; set_vsync(false); } + if(!(address & 2)) nmi_is_enabled_ = false; + if(!(address & 1)) nmi_is_enabled_ = is_zx81_; // The below emulates the ZonX AY expansion device. if(is_zx81) {