Clear MainVolume and improve port code

This commit is contained in:
2022-09-02 11:02:56 +02:00
parent 5c15b66873
commit dac33a77c6
3 changed files with 95 additions and 70 deletions

View File

@@ -52,13 +52,13 @@ public:
template<typename S>
constexpr IOPort<T>& clear_bit(S bit) {
this->value = bit::set(this->value, static_cast<size_t>(bit));
this->value = bit::clear(this->value, static_cast<size_t>(bit));
return *this;
}
template<typename S>
constexpr void clear_bit(S bit) volatile {
this->value = bit::set(this->value, static_cast<size_t>(bit));
this->value = bit::clear(this->value, static_cast<size_t>(bit));
}
template<typename S>
@@ -164,4 +164,10 @@ static constexpr uintptr_t IO_Base_Mask = 0xF0000000;
static constexpr uintptr_t IO_Base_Adr = 0x10000000;
#define __declare_io_port_global(type, name, adr) static __always_inline auto& name = *reinterpret_cast<IOPort<type>*>((IO_Base_Adr + (adr & ~IO_Base_Mask)))
#define __io_port_inherit(name) \
using IOPort::operator=; \
constexpr name() = default; \
constexpr name(IOPort value) : IOPort(value) { \
}
#endif //!__JABYENGINE_IOPORT_HPP__