d/jx: More files (#4360)

Breaks the 300 file milestone, also includes the majority of mips2c
functions carried forward. Some functions need some fixes in the c++
code to mips2c properly, and a small handful of the mips2c functions
require manual patching -- all spots were marked with `TODO - fix` that
had to be commented out to get things compiling.
This commit is contained in:
Tyler Wilding
2026-09-04 09:27:06 -04:00
committed by GitHub
parent 65fc564c16
commit 9c86c86c74
335 changed files with 213866 additions and 4131 deletions
+36 -8
View File
@@ -30,20 +30,20 @@ std::string get_expected(const std::string& name) {
}
} // namespace
// TEST(VuDisasm, DumpResults_Jak3) {
// TEST(VuDisasm, DumpResults_JakX_Draft) {
// struct VuData {
// std::string name;
// std::vector<u32> data;
// VuDisassembler::VuKind kind;
// std::string disasm;
//
// VuData(const std::string& name, VuDisassembler::VuKind kind)
// : name(name), data(get_test_data("jak3/" + name)), kind(kind) {
// : name(name), data(get_test_data("jakx/" + name)), kind(kind) {
// VuDisassembler vu_disasm(kind);
// disasm = vu_disasm.to_string(vu_disasm.disassemble(data.data(), data.size() * 4, false));
// }
// };
// auto path = file_util::get_file_path({"test/decompiler/vu_reference/jak3"});
// auto path = file_util::get_file_path({"test/decompiler/vu_reference/jakx"});
// for (const auto& entry : fs::directory_iterator(path)) {
// if (entry.is_regular_file() &&
// entry.path().filename().string().find("result") == std::string::npos) {
@@ -56,20 +56,22 @@ std::string get_expected(const std::string& name) {
// }
// }
// TEST(VuDisasm, DumpResults_Jak2) {
// TODO - add the jakx tests here, have only compared the programs so far with jak3
// TEST(VuDisasm, DumpResults_Jak3_Draft) {
// struct VuData {
// std::string name;
// std::vector<u32> data;
// VuDisassembler::VuKind kind;
// std::string disasm;
//
// VuData(const std::string& name, VuDisassembler::VuKind kind)
// : name(name), data(get_test_data("jak2/" + name)), kind(kind) {
// : name(name), data(get_test_data("jak3/" + name)), kind(kind) {
// VuDisassembler vu_disasm(kind);
// disasm = vu_disasm.to_string(vu_disasm.disassemble(data.data(), data.size() * 4, false));
// }
// };
// auto path = file_util::get_file_path({"test/decompiler/vu_reference/jak2"});
// auto path = file_util::get_file_path({"test/decompiler/vu_reference/jak3"});
// for (const auto& entry : fs::directory_iterator(path)) {
// if (entry.is_regular_file() &&
// entry.path().filename().string().find("result") == std::string::npos) {
@@ -264,6 +266,32 @@ TEST(VuDisasm, ForegroundVu0_Jak3) {
EXPECT_EQ(disasm.to_string(prog), get_expected("jak3/foreground-vu0"));
}
// TEST(VuDisasm, DumpResults_Jak2) {
// struct VuData {
// std::string name;
// std::vector<u32> data;
// VuDisassembler::VuKind kind;
// std::string disasm;
//
// VuData(const std::string& name, VuDisassembler::VuKind kind)
// : name(name), data(get_test_data("jak2/" + name)), kind(kind) {
// VuDisassembler vu_disasm(kind);
// disasm = vu_disasm.to_string(vu_disasm.disassemble(data.data(), data.size() * 4, false));
// }
// };
// auto path = file_util::get_file_path({"test/decompiler/vu_reference/jak2"});
// for (const auto& entry : fs::directory_iterator(path)) {
// if (entry.is_regular_file() &&
// entry.path().filename().string().find("result") == std::string::npos) {
// auto name = entry.path().filename().stem().string();
// auto kind = name.find("vu0") != std::string::npos ? VuDisassembler::VuKind::VU0
// : VuDisassembler::VuKind::VU1;
// VuData prog(name, kind);
// file_util::write_text_file(path + "/" + prog.name + "-result.txt", prog.disasm);
// }
// }
// }
TEST(VuDisasm, ShadowVu0_Jak2) {
auto data = get_test_data("jak2/shadow-vu0");
VuDisassembler disasm(VuDisassembler::VuKind::VU0);