diff --git a/include/PSX/System/IOPorts/ioport.hpp b/include/PSX/System/IOPorts/ioport.hpp index 7bec4c6d..63c72ce0 100644 --- a/include/PSX/System/IOPorts/ioport.hpp +++ b/include/PSX/System/IOPorts/ioport.hpp @@ -77,13 +77,14 @@ namespace JabyEngine { template struct IOPort { using Value = T; + T value; T read() const { - return {const_cast(reinterpret_cast(this))->raw}; + return {const_cast*>(this)->value.raw}; } void write(T value) { - const_cast(reinterpret_cast(this))->raw = value.raw; + const_cast*>(this)->value.raw = value.raw; } };