EightBit/inc/ClockedChip.h
2021-07-18 14:28:40 +01:00

28 lines
443 B
C++

#pragma once
#include "Chip.h"
#include "EventArgs.h"
#include "Signal.h"
namespace EightBit {
class ClockedChip : public Chip {
public:
virtual ~ClockedChip() noexcept {};
Signal<EventArgs> Ticked;
[[nodiscard]] constexpr auto cycles() const noexcept { return m_cycles; }
void tick(int extra);
void tick();
protected:
ClockedChip() noexcept = default;
void resetCycles() noexcept;
private:
int m_cycles = 0;
};
}