better logs

This commit is contained in:
2026-05-18 23:00:43 +02:00
parent eee9fcfb17
commit c2e22fb742
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -147,7 +147,7 @@ void broadway::stwu(ircolib::u32 instr, mem &mem) {
auto _ = mem.write32(EA, gpr[utils::RS(instr)]) auto _ = mem.write32(EA, gpr[utils::RS(instr)])
.and_then([&] { return std::expected<void, std::string>(); }) .and_then([&] { return std::expected<void, std::string>(); })
.or_else([&](std::string e) { .or_else([&](std::string e) {
ircolib::panic("broadway write failed. Reason: {} (pc: 0x{:08X})", e, pc - 4); ircolib::panic("stwu broadway write failed. Reason: {} (pc: 0x{:08X})", e, pc - 4);
return std::expected<void, std::string>(); return std::expected<void, std::string>();
}); });
gpr[utils::RA(instr)] = EA; gpr[utils::RA(instr)] = EA;
@@ -161,7 +161,7 @@ void broadway::stbu(ircolib::u32 instr, mem &mem) {
auto _ = mem.write8(EA, gpr[utils::RS(instr)]) auto _ = mem.write8(EA, gpr[utils::RS(instr)])
.and_then([&] { return std::expected<void, std::string>(); }) .and_then([&] { return std::expected<void, std::string>(); })
.or_else([&](std::string e) { .or_else([&](std::string e) {
ircolib::panic("broadway write failed. Reason: {} (pc: 0x{:08X})", e, pc - 4); ircolib::panic("stbu broadway write failed. Reason: {} (pc: 0x{:08X})", e, pc - 4);
return std::expected<void, std::string>(); return std::expected<void, std::string>();
}); });
gpr[utils::RA(instr)] = EA; gpr[utils::RA(instr)] = EA;
@@ -176,7 +176,7 @@ void broadway::stw(ircolib::u32 instr, mem &mem) {
auto _ = mem.write32(EA, gpr[utils::RS(instr)]) auto _ = mem.write32(EA, gpr[utils::RS(instr)])
.and_then([&] { return std::expected<void, std::string>(); }) .and_then([&] { return std::expected<void, std::string>(); })
.or_else([&](std::string e) { .or_else([&](std::string e) {
ircolib::panic("broadway write failed. Reason: {} (pc: 0x{:08X})", e, pc - 4); ircolib::panic("stw broadway write failed. Reason: {} (pc: 0x{:08X})", e, pc - 4);
return std::expected<void, std::string>(); return std::expected<void, std::string>();
}); });
} }
@@ -192,7 +192,7 @@ void broadway::sth(ircolib::u32 instr, mem &mem) {
auto _ = mem.write16(EA, ircolib::u16(gpr[utils::RS(instr)])) auto _ = mem.write16(EA, ircolib::u16(gpr[utils::RS(instr)]))
.and_then([&] { return std::expected<void, std::string>(); }) .and_then([&] { return std::expected<void, std::string>(); })
.or_else([&](std::string e) { .or_else([&](std::string e) {
ircolib::panic("broadway write failed. Reason: {} (pc: 0x{:08X})", e, pc - 4); ircolib::panic("sth broadway write failed. Reason: {} (pc: 0x{:08X})", e, pc - 4);
return std::expected<void, std::string>(); return std::expected<void, std::string>();
}); });
} }
+4 -4
View File
@@ -11,23 +11,23 @@ using s16 = int16_t;
using s32 = int32_t; using s32 = int32_t;
using s64 = int64_t; using s64 = int64_t;
template <typename T, size_t bit> template <typename T, std::size_t bit>
static constexpr bool is_bit_set(const T &val) { static constexpr bool is_bit_set(const T &val) {
return val & (1 << bit); return val & (1 << bit);
} }
template <typename T, size_t bit> template <typename T, std::size_t bit>
static constexpr void set_bit(T &val) { static constexpr void set_bit(T &val) {
val |= 1 << bit; val |= 1 << bit;
} }
template <typename T> template <typename T>
inline bool is_bit_set(const T &val, const size_t &bit) { inline bool is_bit_set(const T &val, const std::size_t &bit) {
return val & (1 << bit); return val & (1 << bit);
} }
template <typename T> template <typename T>
inline void set_bit(T &val, const size_t &bit) { inline void set_bit(T &val, const std::size_t &bit) {
val |= 1 << bit; val |= 1 << bit;
} }
} // namespace ircolib } // namespace ircolib