Feature/runtime review codegen fixes (#87)

* feat: small fixes on code gen

* feat: added code gen test

* feat: rename IOP

* fix: fix special case on JR
feat: added code generator test

* feat: ps2 logs now need special macros

* feat: a lot of regressions test
feat: use test to fix bugs on runtime
fix: fix incorrect instructions on code generator
feat: added missing decode on r5900 decoder
feat: added scissor on rasterizer

* feat: better ghidra plugin analyzer
fix: fix real bug on function finding on elf analyzer

* feat: some logs on GS
feat: added more syscalls stubs
feat: added more ps2 stubs

* feat: added missing stub
This commit is contained in:
Ranieri
2026-02-27 03:44:59 -03:00
committed by GitHub
parent 8d1f1c5672
commit 669114f3f6
51 changed files with 7912 additions and 382 deletions
+22
View File
@@ -1,6 +1,7 @@
#include "MiniTest.h"
#include "ps2_runtime.h"
#include "ps2_syscalls.h"
#include "ps2_stubs.h"
#include <filesystem>
#include <fstream>
@@ -274,5 +275,26 @@ void register_ps2_runtime_io_tests()
t.IsFalse(std::filesystem::exists(test.paths.cdRoot / "ISOLATED"),
"mc0: directory should NOT exist under cdRoot");
});
tc.Run("sceIoctl cmd1 updates wait flag state", [](TestCase &t)
{
TestContext test;
constexpr uint32_t statusAddr = GUEST_BUFFER_AREA_START + 0x1800;
const uint32_t busy = 1u;
std::memcpy(test.rdram.data() + statusAddr, &busy, sizeof(busy));
setRegU32(test.ctx, 4, 3u); // fd
setRegU32(test.ctx, 5, 1u); // cmd
setRegU32(test.ctx, 6, statusAddr); // arg
ps2_stubs::sceIoctl(test.rdram.data(), &test.ctx, nullptr);
t.Equals(getRegS32(&test.ctx, 2), 0, "sceIoctl cmd1 should return success");
uint32_t state = 0xFFFFFFFFu;
std::memcpy(&state, test.rdram.data() + statusAddr, sizeof(state));
t.Equals(state, 0u, "sceIoctl cmd1 should clear wait state from busy to ready");
});
});
}