mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-11-16 13:04:48 +00:00
31 lines
532 B
C++
31 lines
532 B
C++
#pragma once
|
|
|
|
#include "Chip.h"
|
|
#include "EventArgs.h"
|
|
#include "Signal.h"
|
|
|
|
namespace EightBit {
|
|
class ClockedChip : public Chip {
|
|
public:
|
|
virtual ~ClockedChip() noexcept {};
|
|
|
|
ClockedChip(const ClockedChip& rhs);
|
|
bool operator==(const ClockedChip& rhs) const;
|
|
|
|
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;
|
|
};
|
|
}
|