From adcd580d5b0fc7187f4028187047de8111bc042e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 3 Jul 2021 19:06:15 -0400 Subject: [PATCH 1/3] Ensure LEDs are cleared upon a new machine. --- OSBindings/Qt/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/OSBindings/Qt/mainwindow.cpp b/OSBindings/Qt/mainwindow.cpp index e29ed0b86..7851dcfde 100644 --- a/OSBindings/Qt/mainwindow.cpp +++ b/OSBindings/Qt/mainwindow.cpp @@ -1309,6 +1309,7 @@ void MainWindow::restoreSelections() { // MARK: - Activity observation void MainWindow::addActivityObserver() { + ledStatuses.clear(); auto activitySource = machine->activity_source(); if(!activitySource) return; From 3ef28a4f03d3d1d5be0ae5181c9f840f1df738d9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 3 Jul 2021 19:10:29 -0400 Subject: [PATCH 2/3] Remove unused instance variable. --- Machines/Enterprise/Nick.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Machines/Enterprise/Nick.hpp b/Machines/Enterprise/Nick.hpp index 3092895de..fa9e670f7 100644 --- a/Machines/Enterprise/Nick.hpp +++ b/Machines/Enterprise/Nick.hpp @@ -94,9 +94,6 @@ class Nick { bool vres_ = false; bool reload_line_parameter_pointer_ = false; - // An accumulator for border output regions. - int border_duration_ = 0; - // The destination for new pixels. static constexpr int allocation_size = 336; static_assert((allocation_size % 16) == 0, "Allocation size must be a multiple of 16"); From 43ceca8711edfa40b3929efb778da470d404599d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 3 Jul 2021 19:10:39 -0400 Subject: [PATCH 3/3] Use type alias. --- Machines/Enterprise/Enterprise.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Machines/Enterprise/Enterprise.cpp b/Machines/Enterprise/Enterprise.cpp index a2e1255aa..7153c1795 100644 --- a/Machines/Enterprise/Enterprise.cpp +++ b/Machines/Enterprise/Enterprise.cpp @@ -270,13 +270,13 @@ template class ConcreteMachine: default: break; // For non-video pauses, insert during the initial part of the bus cycle. - case CPU::Z80::PartialMachineCycle::ReadStart: - case CPU::Z80::PartialMachineCycle::WriteStart: + case PartialMachineCycle::ReadStart: + case PartialMachineCycle::WriteStart: if(!is_video_[address >> 14] && wait_mode_ == WaitMode::OnAllAccesses) { penalty = HalfCycles(2); } break; - case CPU::Z80::PartialMachineCycle::ReadOpcodeStart: + case PartialMachineCycle::ReadOpcodeStart: if(!is_video_[address >> 14] && wait_mode_ != WaitMode::None) { penalty = HalfCycles(2); } else { @@ -289,7 +289,7 @@ template class ConcreteMachine: break; // Video pauses: insert right at the end of the bus cycle. - case CPU::Z80::PartialMachineCycle::Write: + case PartialMachineCycle::Write: // Ensure all video that should have been collected prior to // this write has been. if(is_video_[address >> 14]) { @@ -297,7 +297,7 @@ template class ConcreteMachine: } [[fallthrough]]; - case CPU::Z80::PartialMachineCycle::Read: + case PartialMachineCycle::Read: if(is_video_[address >> 14]) { // Get delay, in Nick cycles, for a Z80 access that occurs in 0.5 // cycles from now (i.e. with one cycle left to run). @@ -307,8 +307,8 @@ template class ConcreteMachine: } break; - case CPU::Z80::PartialMachineCycle::Input: - case CPU::Z80::PartialMachineCycle::Output: { + case PartialMachineCycle::Input: + case PartialMachineCycle::Output: { if((address & 0xf0) == 0x80) { // Get delay, in Nick cycles, for a Z80 access that occurs in 0.5 // cycles from now (i.e. with one cycle left to run). @@ -334,7 +334,7 @@ template class ConcreteMachine: switch(cycle.operation) { default: break; - case CPU::Z80::PartialMachineCycle::Input: + case PartialMachineCycle::Input: switch(address & 0xff) { default: LOG("Unhandled input from " << PADHEX(2) << (address & 0xff)); @@ -399,7 +399,7 @@ template class ConcreteMachine: } break; - case CPU::Z80::PartialMachineCycle::Output: + case PartialMachineCycle::Output: switch(address & 0xff) { default: LOG("Unhandled output: " << PADHEX(2) << *cycle.value << " to " << PADHEX(2) << (address & 0xff)); @@ -506,8 +506,8 @@ template class ConcreteMachine: } break; - case CPU::Z80::PartialMachineCycle::Read: - case CPU::Z80::PartialMachineCycle::ReadOpcode: + case PartialMachineCycle::Read: + case PartialMachineCycle::ReadOpcode: if(read_pointers_[address >> 14]) { *cycle.value = read_pointers_[address >> 14][address]; } else { @@ -515,7 +515,7 @@ template class ConcreteMachine: } break; - case CPU::Z80::PartialMachineCycle::Write: + case PartialMachineCycle::Write: if(write_pointers_[address >> 14]) { write_pointers_[address >> 14][address] = *cycle.value; }