Support DMA with new IO
This commit is contained in:
@@ -24,20 +24,31 @@ namespace JabyEngine {
|
||||
|
||||
constexpr T& set2(ClearBit bit) {
|
||||
this->raw = bit::set(this->raw, bit);
|
||||
return *this;
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
constexpr T& set2(BitRange bits, T value) {
|
||||
this->raw = bit::value::set_normalized(this->raw, bits, value);
|
||||
return *this;
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
constexpr T& set2(const BitRange::RangeValuePair<U>& value) {
|
||||
this->raw = bit::value::set_normalized(this->raw, value);
|
||||
return *this;
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
constexpr T& set2(const U& first) {
|
||||
return IOValue<T, S>::set2(first);
|
||||
}
|
||||
|
||||
template<typename U, typename...ARGS>
|
||||
constexpr T& set2(const U& first, const ARGS& ...args) {
|
||||
IOValue<T, S>::set2(first);
|
||||
return IOValue<T, S>::set2(args...);
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
constexpr T& set_va(const U& head) {
|
||||
return this->set2(head);
|
||||
@@ -108,8 +119,9 @@ namespace JabyEngine {
|
||||
};
|
||||
|
||||
#define __new_declare_io_value(name, type) struct name : public ::JabyEngine::New::internal::IOValue<struct name, type>
|
||||
#define __new_declare_io_port_w_type(type, name, adr) static auto& name = *reinterpret_cast<::JabyEngine::New::IOPort<struct type>*>(IOAdress::patch_adr(adr))
|
||||
#define __new_declare_io_port(name, adr) __new_declare_io_port_w_type(name, name, adr)
|
||||
#define __new_declare_value_at(type, name, adr) static auto& name = *reinterpret_cast<type*>(IOAdress::patch_adr(adr))
|
||||
#define __new_declare_io_port_w_type(type, name, adr) __new_declare_value_at(::JabyEngine::New::IOPort<type>, name, adr)
|
||||
#define __new_declare_io_port(name, adr) __new_declare_io_port_w_type(struct name, name, adr)
|
||||
}
|
||||
|
||||
namespace IOPort {
|
||||
|
||||
Reference in New Issue
Block a user