1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-27 02:55:07 +00:00

Simplifies the test for resetting the ZX80/81 line counter.

This commit is contained in:
Thomas Harte 2018-05-01 21:31:37 -04:00
parent ac4948c4b1
commit eecea93b3b

View File

@ -124,14 +124,12 @@ template<bool is_zx81> 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) {