From c3ea6dc1f52eef9cb2705deb3fb321a8a5f6bc1f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 22 May 2017 19:15:55 -0400 Subject: [PATCH] Added respect for limiting to the requested number of cycles in the Z80. --- Processors/Z80/Z80.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Processors/Z80/Z80.hpp b/Processors/Z80/Z80.hpp index d4c28c06a..ae162af93 100644 --- a/Processors/Z80/Z80.hpp +++ b/Processors/Z80/Z80.hpp @@ -538,7 +538,8 @@ template class Processor: public MicroOpScheduler { if(number_of_cycles_ < operation->machine_cycle.length) { return; } - static_cast(this)->perform_machine_cycle(&operation->machine_cycle); + number_of_cycles_ -= operation->machine_cycle.length; + number_of_cycles_ -= static_cast(this)->perform_machine_cycle(&operation->machine_cycle); break; case MicroOp::MoveToNextProgram: move_to_next_program();