mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-11-04 14:57:09 +00:00
Remove bin2c, load the PPC context header by path.
This commit is contained in:
@@ -2,12 +2,6 @@ cmake_minimum_required (VERSION 3.8)
|
||||
|
||||
project("PowerRecomp")
|
||||
|
||||
BIN2H(SOURCE_FILE
|
||||
${POWERUTILS_ROOT}/ppc_context.h
|
||||
HEADER_FILE "generated/ppc_context.gen.h"
|
||||
ARRAY_TYPE "char"
|
||||
VARIABLE_NAME "g_PPCContextText")
|
||||
|
||||
add_executable(PowerRecomp
|
||||
"main.cpp"
|
||||
"recompiler.cpp"
|
||||
|
||||
3
PowerRecomp/generated/.gitignore
vendored
3
PowerRecomp/generated/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
*
|
||||
|
||||
!.gitignore
|
||||
@@ -23,7 +23,15 @@ int main(int argc, char* argv[])
|
||||
entry->name = "_xstart";
|
||||
}
|
||||
|
||||
recompiler.Recompile();
|
||||
const char* headerFilePath =
|
||||
#ifdef HEADER_FILE_PATH
|
||||
HEADER_FILE_PATH
|
||||
#else
|
||||
argv[2]
|
||||
#endif
|
||||
;
|
||||
|
||||
recompiler.Recompile(headerFilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -17,4 +17,3 @@
|
||||
#include <xxhash.h>
|
||||
#include <fmt/core.h>
|
||||
#include <xmmintrin.h>
|
||||
#include "generated/ppc_context.gen.h"
|
||||
|
||||
@@ -2361,7 +2361,7 @@ bool Recompiler::Recompile(const Function& fn)
|
||||
return allRecompiled;
|
||||
}
|
||||
|
||||
void Recompiler::Recompile()
|
||||
void Recompiler::Recompile(const std::filesystem::path& headerFilePath)
|
||||
{
|
||||
out.reserve(10 * 1024 * 1024);
|
||||
|
||||
@@ -2403,7 +2403,14 @@ void Recompiler::Recompile()
|
||||
println("#pragma once");
|
||||
|
||||
println("#include \"ppc_config.h\"\n");
|
||||
println("{}", std::string_view{g_PPCContextText, g_PPCContextText_size});
|
||||
|
||||
std::ifstream stream(headerFilePath);
|
||||
if (stream.good())
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << stream.rdbuf();
|
||||
out += ss.str();
|
||||
}
|
||||
|
||||
SaveCurrentOutData("ppc_context.h");
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ struct Recompiler
|
||||
|
||||
bool Recompile(const Function& fn);
|
||||
|
||||
void Recompile();
|
||||
void Recompile(const std::filesystem::path& headerFilePath);
|
||||
|
||||
void SaveCurrentOutData(const std::string_view& name = std::string_view());
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user