diff --git a/include/PSX/System/IOPorts/ioport.hpp b/include/PSX/System/IOPorts/ioport.hpp index 1d1afa3c..cd1e7a37 100644 --- a/include/PSX/System/IOPorts/ioport.hpp +++ b/include/PSX/System/IOPorts/ioport.hpp @@ -21,9 +21,17 @@ namespace JabyEngine { #define __declare_io_type(name, type, ...) \ template typename T> \ struct name##_io_base { \ - T::Value value; \ + T::Value raw_value; \ \ + name##_io_base(type value) : raw_value(value) {} \ __VA_ARGS__ \ + \ + void operator=(type value) { \ + this->raw_value = value; \ + } \ + type operator*() const { \ + return this->raw_value; \ + } \ } template diff --git a/include/PSX/System/IOPorts/memory_io.hpp b/include/PSX/System/IOPorts/memory_io.hpp index 162c1d75..dd884d23 100644 --- a/include/PSX/System/IOPorts/memory_io.hpp +++ b/include/PSX/System/IOPorts/memory_io.hpp @@ -6,13 +6,13 @@ namespace JabyEngine { namespace Memory_IO { __declare_io_type(COM_DELAY, uint32_t, void setup() { - this->value = 0x1325; + this->raw_value = 0x1325; } ); __declare_io_type(CD_DELAY, uint32_t, void setup() { - this->value = 0x20943; + this->raw_value = 0x20943; } );