From ee8d853fcb0d6d49a62a0f040021bd85cc107d3d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 17 Jul 2019 14:20:27 -0400 Subject: [PATCH] Ensures you can't get a phase 2 for free with `run_for(0)`. --- Components/6522/Implementation/6522Implementation.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Components/6522/Implementation/6522Implementation.hpp b/Components/6522/Implementation/6522Implementation.hpp index 296d83e87..9b6f5118e 100644 --- a/Components/6522/Implementation/6522Implementation.hpp +++ b/Components/6522/Implementation/6522Implementation.hpp @@ -347,6 +347,7 @@ template void MOS6522::do_phase1() { /*! Runs for a specified number of half cycles. */ template void MOS6522::run_for(const HalfCycles half_cycles) { int number_of_half_cycles = half_cycles.as_int(); + if(!number_of_half_cycles) return; if(is_phase2_) { do_phase2();