fix: fix recompile from single file to multi file

This commit is contained in:
Ran-j
2025-04-14 02:02:56 -03:00
parent 8707c26dae
commit e5cef40032
3 changed files with 14 additions and 13 deletions
+7 -4
View File
@@ -391,13 +391,16 @@ namespace ps2recomp
return ss.str();
}
std::string CodeGenerator::generateFunction(const Function &function, const std::vector<Instruction> &instructions)
std::string CodeGenerator::generateFunction(const Function &function, const std::vector<Instruction> &instructions, const bool &useHeaders)
{
std::stringstream ss;
ss << "#include \"ps2_runtime_macros.h\"\n";
ss << "#include \"ps2_runtime.h\"\n";
ss << "#include \"ps2_recompiled_functions.h\"\n\n";
if (useHeaders)
{
ss << "#include \"ps2_runtime_macros.h\"\n";
ss << "#include \"ps2_runtime.h\"\n";
ss << "#include \"ps2_recompiled_functions.h\"\n\n";
}
ss << "// Function: " << function.name << "\n";
ss << "// Address: 0x" << std::hex << function.start << " - 0x" << function.end << std::dec << "\n";