early-access version 2799

This commit is contained in:
pineappleEA
2022-06-24 04:00:57 +02:00
parent b216437217
commit 10e9e7d9ae
39 changed files with 381 additions and 200 deletions

View File

@@ -48,7 +48,7 @@ public:
return vaddr < sizeof(InstructionType) * code_mem.size();
}
std::uint32_t MemoryReadCode(u32 vaddr) override {
std::optional<std::uint32_t> MemoryReadCode(u32 vaddr) override {
if (IsInCodeMem(vaddr)) {
u32 value;
std::memcpy(&value, &code_mem[vaddr / sizeof(InstructionType)], sizeof(u32));
@@ -95,11 +95,11 @@ public:
MemoryWrite32(vaddr + 4, static_cast<u32>(value >> 32));
}
void InterpreterFallback(u32 pc, size_t num_instructions) override { ASSERT_MSG(false, "InterpreterFallback({:08x}, {}) code = {:08x}", pc, num_instructions, MemoryReadCode(pc)); }
void InterpreterFallback(u32 pc, size_t num_instructions) override { ASSERT_MSG(false, "InterpreterFallback({:08x}, {}) code = {:08x}", pc, num_instructions, *MemoryReadCode(pc)); }
void CallSVC(std::uint32_t swi) override { ASSERT_MSG(false, "CallSVC({})", swi); }
void ExceptionRaised(u32 pc, Dynarmic::A32::Exception /*exception*/) override { ASSERT_MSG(false, "ExceptionRaised({:08x}) code = {:08x}", pc, MemoryReadCode(pc)); }
void ExceptionRaised(u32 pc, Dynarmic::A32::Exception /*exception*/) override { ASSERT_MSG(false, "ExceptionRaised({:08x}) code = {:08x}", pc, *MemoryReadCode(pc)); }
void AddTicks(std::uint64_t ticks) override {
if (ticks > ticks_left) {
@@ -135,7 +135,7 @@ public:
memcpy(backing_memory + vaddr, &value, sizeof(T));
}
std::uint32_t MemoryReadCode(std::uint32_t vaddr) override {
std::optional<std::uint32_t> MemoryReadCode(std::uint32_t vaddr) override {
return read<std::uint32_t>(vaddr);
}

View File

@@ -30,7 +30,7 @@ public:
return vaddr >= code_mem_start_address && vaddr < code_mem_start_address + code_mem.size() * 4;
}
std::uint32_t MemoryReadCode(u64 vaddr) override {
std::optional<std::uint32_t> MemoryReadCode(u64 vaddr) override {
if (!IsInCodeMem(vaddr)) {
return 0x14000000; // B .
}
@@ -145,7 +145,7 @@ public:
memcpy(backing_memory + vaddr, &value, sizeof(T));
}
std::uint32_t MemoryReadCode(u64 vaddr) override {
std::optional<std::uint32_t> MemoryReadCode(u64 vaddr) override {
return read<std::uint32_t>(vaddr);
}

View File

@@ -157,7 +157,7 @@ public:
}
void InterpreterFallback(u32 pc, size_t num_instructions) override {
fmt::print("> InterpreterFallback({:08x}, {}) code = {:08x}\n", pc, num_instructions, MemoryReadCode(pc));
fmt::print("> InterpreterFallback({:08x}, {}) code = {:08x}\n", pc, num_instructions, *MemoryReadCode(pc));
}
void CallSVC(std::uint32_t swi) override {
fmt::print("> CallSVC({})\n", swi);

View File

@@ -52,7 +52,7 @@ void A32Unicorn<TestEnvironment>::Run() {
return;
}
if (auto cerr_ = uc_emu_start(uc, pc, END_ADDRESS, 0, 1)) {
fmt::print("uc_emu_start failed @ {:08x} (code = {:08x}) with error {} ({})", pc, testenv.MemoryReadCode(pc), cerr_, uc_strerror(cerr_));
fmt::print("uc_emu_start failed @ {:08x} (code = {:08x}) with error {} ({})", pc, *testenv.MemoryReadCode(pc), cerr_, uc_strerror(cerr_));
throw "A32Unicorn::Run() failure";
}
testenv.ticks_left--;