From 6315c22b80441f5bb08b3930185ef8ee7fdaabbf Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 20 Aug 2017 12:39:45 -0400 Subject: [PATCH] Removed repeated checking of bus_request_line_. It's now checked only after each outward `perform_machine_cycle`. --- Processors/Z80/Z80.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Processors/Z80/Z80.hpp b/Processors/Z80/Z80.hpp index 98eb74639..8dde6906a 100644 --- a/Processors/Z80/Z80.hpp +++ b/Processors/Z80/Z80.hpp @@ -909,6 +909,7 @@ template class Processor { while(1) { + do_bus_acknowledge: while(bus_request_line_) { static PartialMachineCycle bus_acknowledge_cycle = {PartialMachineCycle::BusAcknowledge, HalfCycles(2), nullptr, nullptr, false}; number_of_cycles_ -= bus_handler_.perform_machine_cycle(bus_acknowledge_cycle) + HalfCycles(1); @@ -918,7 +919,7 @@ template class Processor { } } - while(!bus_request_line_) { + while(true) { const MicroOp *operation = scheduled_program_counter_; scheduled_program_counter_++; @@ -945,6 +946,7 @@ template class Processor { number_of_cycles_ -= operation->machine_cycle.length; last_request_status_ = request_status_; number_of_cycles_ -= bus_handler_.perform_machine_cycle(operation->machine_cycle); + if(bus_request_line_) goto do_bus_acknowledge; break; case MicroOp::MoveToNextProgram: advance_operation();