Fixed bug and spread some always_inlines

This commit is contained in:
Jaby
2022-09-11 12:06:40 +02:00
parent 54de6c3f70
commit 2024024bf1
3 changed files with 22 additions and 22 deletions

View File

@@ -51,11 +51,11 @@ namespace GPU {
}
static constexpr GP0 TopLeftPosition(uint16_t x, uint16_t y) {
return ComplexBitMap{static_cast<uint16_t>((y << 16) | x)};
return ComplexBitMap{static_cast<uint32_t>((y << 16u) | x)};
}
static constexpr GP0 WidthHeight(uint16_t w, uint16_t h) {
return ComplexBitMap{static_cast<uint16_t>((h << 16) | w)};
return ComplexBitMap{static_cast<uint32_t>((h << 16u) | w)};
}
};

View File

@@ -58,15 +58,15 @@ static constexpr uintptr_t IO_Base_Adr = 0x10000000;
#define __declare_io_port_global_const(type, name, adr) __declare_io_port_global_raw(const, type, name, adr)
#define __declare_io_port_global_array(type, name, adr, size) static __always_inline auto& name = reinterpret_cast<type(&)[size]>(*reinterpret_cast<type*>((IO_Base_Adr + (adr & ~IO_Base_Mask))));
#define __io_port_inherit_complex_bit_map(name) \
constexpr name() = default; \
constexpr name(ComplexBitMap value) : ComplexBitMap(value) { \
constexpr __always_inline name() = default; \
constexpr __always_inline name(ComplexBitMap value) : ComplexBitMap(value) { \
} \
template<typename...ARGS> \
static constexpr name with(ARGS...args) { \
static constexpr __always_inline name with(ARGS...args) { \
return {ComplexBitMap::with(args...)}; \
}\
template<typename T> \
constexpr void operator=(ComplexBitMap<T> value) volatile { \
constexpr void __always_inline operator=(ComplexBitMap<T> value) volatile { \
this->raw = value.raw; \
}