mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-26 08:51:05 -04:00
feat: sync recompile and codegen output to match what are expected on runtime
This commit is contained in:
@@ -2421,17 +2421,6 @@ namespace ps2recomp
|
||||
ss << "#include \"ps2_recompiled_functions.h\"\n";
|
||||
ss << "#include \"ps2_stubs.h\"\n\n";
|
||||
|
||||
ss << "// Default handler for unimplemented syscalls/functions\n";
|
||||
ss << "void ps2_syscalls::TODO(uint8_t* rdram, R5900Context* ctx) {\n";
|
||||
ss << " std::cout << \"Unimplemented syscall/function called at PC=0x\" << std::hex << ctx->pc << std::dec << std::endl;\n";
|
||||
ss << " ctx->r[2] = 0; // Return 0 by default\n";
|
||||
ss << "}\n\n";
|
||||
|
||||
ss << "void ps2_stubs::TODO(uint8_t* rdram, R5900Context* ctx) {\n";
|
||||
ss << " std::cout << \"Unimplemented library function called at PC=0x\" << std::hex << ctx->pc << std::dec << std::endl;\n";
|
||||
ss << " ctx->r[2] = 0; // Return 0 by default\n";
|
||||
ss << "}\n\n";
|
||||
|
||||
// Registration function
|
||||
ss << "void registerAllFunctions(PS2Runtime& runtime) {\n";
|
||||
|
||||
|
||||
@@ -116,8 +116,9 @@ namespace ps2recomp
|
||||
{
|
||||
std::stringstream combinedOutput;
|
||||
|
||||
combinedOutput << "#include \"ps2_recompiled_functions.h\"\n\n";
|
||||
combinedOutput << "#include \"ps2_runtime_macros.h\"\n";
|
||||
combinedOutput << "#include \"ps2_runtime.h\"\n\n";
|
||||
combinedOutput << "#include \"ps2_runtime.h\"\n";
|
||||
|
||||
for (const auto &function : m_functions)
|
||||
{
|
||||
@@ -149,7 +150,7 @@ namespace ps2recomp
|
||||
}
|
||||
}
|
||||
|
||||
fs::path outputPath = fs::path(m_config.outputPath) / "recompiled.cpp";
|
||||
fs::path outputPath = fs::path(m_config.outputPath) / "ps2_recompiled_functions.cpp";
|
||||
writeToFile(outputPath.string(), combinedOutput.str());
|
||||
std::cout << "Wrote recompiled to combined output to: " << outputPath << std::endl;
|
||||
}
|
||||
@@ -215,7 +216,7 @@ namespace ps2recomp
|
||||
ss << "#define PS2_RECOMPILED_FUNCTIONS_H\n\n";
|
||||
|
||||
ss << "#include <cstdint>\n\n";
|
||||
ss << "struct R5900Context;\n\n";
|
||||
ss << "struct R5900Context;\n";
|
||||
ss << "class PS2Runtime;\n\n";
|
||||
|
||||
for (const auto &function : m_functions)
|
||||
|
||||
Reference in New Issue
Block a user