Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
3 changed files with 25 additions and 25 deletions
Showing only changes of commit 1792038283 - Show all commits

View File

@ -17,47 +17,47 @@ namespace JabyEngine {
return T{0}.set_va(args...);
}
constexpr T& set(Bit bit) {
constexpr T& set2(Bit bit) {
this->raw = bit::set(this->raw, bit);
return static_cast<T&>(*this);
}
constexpr T& set(ClearBit bit) {
constexpr T& set2(ClearBit bit) {
this->raw = bit::set(this->raw, bit);
return *this;
}
constexpr T& set(BitRange bits, T value) {
constexpr T& set2(BitRange bits, T value) {
this->raw = bit::value::set_normalized(this->raw, bits, value);
return *this;
}
template<typename U>
constexpr T& set(const BitRange::RangeValuePair<U>& value) {
constexpr T& set2(const BitRange::RangeValuePair<U>& value) {
this->raw = bit::value::set_normalized(this->raw, value);
return *this;
}
template<typename U>
constexpr T& set_va(const U& head) {
return this->set(head);
return this->set2(head);
}
template<typename U, typename...ARGS>
constexpr T& set_va(const U& head, const ARGS&...tail) {
return this->set(head).set_va(tail...);
return this->set2(head).set_va(tail...);
}
constexpr IOValue<T, S>::UnderlyingType get(BitRange bits) const {
constexpr IOValue<T, S>::UnderlyingType get2(BitRange bits) const {
return bit::value::get_normalized(this->raw, bits.pos, bits.length);
}
constexpr T& clear(Bit bit) {
constexpr T& clear2(Bit bit) {
this->raw = bit::clear(this->raw, bit);
return *this;
}
constexpr bool is_set(Bit bit) const {
constexpr bool is_set2(Bit bit) const {
return bit::is_set(this->raw, bit);
}
};
@ -107,8 +107,8 @@ namespace JabyEngine {
}
};
#define __new_declare_io_value(name, type) struct name : public New::internal::IOValue<name, type>
#define __new_declare_io_port_w_type(type, name, adr) static auto& name = *reinterpret_cast<New::IOPort<struct type>*>(IOAdress::patch_adr(adr))
#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)
}

View File

@ -4,20 +4,20 @@
namespace JabyEngine {
namespace Memory_IO {
__declare_io_type(COM_DELAY, uint32_t,
void setup() {
this->raw_value = 0x1325;
}
);
__new_declare_io_value(COM_DELAY, uint32_t) {
static constexpr COM_DELAY create() {
return COM_DELAY{0x1325};
}
};
__declare_io_type(CD_DELAY, uint32_t,
void setup() {
this->raw_value = 0x20943;
}
);
__new_declare_io_value(CD_DELAY, uint32_t) {
static constexpr CD_DELAY create() {
return CD_DELAY{0x20943};
}
};
__declare_new_io_port(COM_DELAY, 0x1F801020);
__declare_new_io_port(CD_DELAY, 0x1F801018);
__new_declare_io_port(COM_DELAY, 0x1F801020);
__new_declare_io_port(CD_DELAY, 0x1F801018);
}
}

View File

@ -17,8 +17,8 @@ namespace JabyEngine {
void setup() {
__syscall_EnterCriticalSection();
Memory_IO::COM_DELAY.setup();
Memory_IO::CD_DELAY.setup();
Memory_IO::COM_DELAY.write(Memory_IO::COM_DELAY::create());
Memory_IO::CD_DELAY.write(Memory_IO::CD_DELAY::create());
__syscall_SysEnqIntRP(CdromIoIrq, &::JabyEngine::CD::internal::callback);