Expose the clock tick as an externally driven action.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2019-05-05 10:28:24 +01:00
parent 4f8d3287d4
commit 2c23289caa

View File

@ -11,12 +11,12 @@ namespace EightBit {
Signal<EventArgs> Ticked; Signal<EventArgs> 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; } [[nodiscard]] auto cycles() const noexcept { return m_cycles; }
protected: protected:
void resetCycles() noexcept { m_cycles = 0; } 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: private:
int m_cycles = 0; int m_cycles = 0;