1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Make room for an ID field on Event.

This commit is contained in:
Thomas Harte 2023-02-16 22:10:16 -05:00
parent bbccc5d6d6
commit 211e145230

View File

@ -51,8 +51,8 @@ template <Personality personality> struct Storage<personality, std::enable_if_t<
struct Event {
/// Offset of the _beginning_ of the event. Not completely arbitrarily: this is when
/// external data must be ready by in order to take part in those slots.
int offset = 1368;
enum class Type {
uint16_t offset = 1368;
enum class Type: uint8_t {
/// A slot for reading or writing data on behalf of the CPU or the command engine.
External,
@ -75,13 +75,12 @@ template <Personality personality> struct Storage<personality, std::enable_if_t<
Colour,
Pattern,
} type = Type::External;
uint8_t id = 0;
constexpr Event(int offset, Type type) noexcept :
offset(grauw_to_internal(offset)),
type(type) {}
constexpr Event(int offset) noexcept :
offset(grauw_to_internal(offset)) {}
constexpr Event(int offset, Type type, uint8_t id = 0) noexcept :
offset(uint16_t(grauw_to_internal(offset))),
type(type),
id(id) {}
constexpr Event() noexcept {}
};