From 2c23289caa5095aa8ed47e8d40d38a798170a16c Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sun, 5 May 2019 10:28:24 +0100 Subject: [PATCH] Expose the clock tick as an externally driven action. Signed-off-by: Adrian Conlon --- inc/ClockedChip.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/ClockedChip.h b/inc/ClockedChip.h index 564f733..3f2b828 100644 --- a/inc/ClockedChip.h +++ b/inc/ClockedChip.h @@ -11,12 +11,12 @@ namespace EightBit { Signal Ticked; + void tick(const int extra) { for (int i = 0; i < extra; ++i) tick(); } + void tick() { ++m_cycles; Ticked.fire(EventArgs::empty()); } [[nodiscard]] auto cycles() const noexcept { return m_cycles; } protected: void resetCycles() noexcept { m_cycles = 0; } - void tick(const int extra) { for (int i = 0; i < extra; ++i) tick(); } - void tick() { ++m_cycles; Ticked.fire(EventArgs::empty()); } private: int m_cycles = 0;