Use original IOPort code again

This commit is contained in:
Jaby 2024-09-08 22:57:29 +02:00
parent 7b99fd4de8
commit 628fb89771
1 changed files with 3 additions and 2 deletions

View File

@ -77,13 +77,14 @@ namespace JabyEngine {
template<typename T>
struct IOPort {
using Value = T;
T value;
T read() const {
return {const_cast<const volatile Value*>(reinterpret_cast<const Value*>(this))->raw};
return {const_cast<const volatile IOPort<T>*>(this)->value.raw};
}
void write(T value) {
const_cast<volatile Value*>(reinterpret_cast<Value*>(this))->raw = value.raw;
const_cast<volatile IOPort<T>*>(this)->value.raw = value.raw;
}
};