EightBit/inc/ClockedChip.h

26 lines
386 B
C
Raw Normal View History

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