Use original IOPort code again
This commit is contained in:
parent
97de034458
commit
0fb71beff2
|
@ -77,13 +77,14 @@ namespace JabyEngine {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct IOPort {
|
struct IOPort {
|
||||||
using Value = T;
|
using Value = T;
|
||||||
|
T value;
|
||||||
|
|
||||||
T read() const {
|
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) {
|
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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue