Refine new IO port concept

This commit is contained in:
Jaby
2023-03-14 22:53:32 +01:00
parent 37192b537b
commit a361f8e4a0
3 changed files with 27 additions and 33 deletions

View File

@@ -4,27 +4,20 @@
namespace JabyEngine {
namespace Memory_IO {
template<template<typename> typename T>
struct COM_DELAY_base {
T<uint32_t>::Value value;
__declare_io_type(COM_DELAY, uint32_t,
void setup() {
this->value = 0x1325;
}
};
typedef COM_DELAY_base<VolatileValue> COM_DELAY_v;
typedef COM_DELAY_base<NormalValue> COM_DELAY_t;
}
);
struct CD_DELAY {
typedef uint32_t Type;
__declare_io_type(CD_DELAY, uint32_t,
void setup() {
this->value = 0x20943;
}
);
static constexpr uint32_t SetupValue = 0x20943;
};
static auto& COM_DELAY = *reinterpret_cast<COM_DELAY_v*>(0x1F801020);
//__declare_io_port_global_simple(COM_DELAY::Type, COM_DELAY, 0x1F801020);
__declare_io_port_global_simple(CD_DELAY::Type, CD_DELAY, 0x1F801018);
__declare_new_io_port(COM_DELAY, 0x1F801020);
__declare_new_io_port(CD_DELAY, 0x1F801018);
}
}