diff --git a/README.md b/README.md index 57911ac..1dc0107 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Instructions are processed one-by-one and corresponding C code is emitted as eac Every output function created by the recompiler is currently emitted into its own file. An option may be provided in the future to group functions together into output files, which should help improve build times of the recompiler output by reducing file I/O in the build process. -Recompiler output can be compiled with any C compiler (tested with msvc, gcc and clang). The output is expected to be used with a runtime that can provide the necessary functionality and macro implementations to run it. An example of most of the required macro implementations can be found in the Zelda 64: Recompiled project [here](https://github.com/Mr-Wiseguy/Zelda64Recomp/blob/dev/include/recomp.h), with the project also containing accompanying code for implementing the rest of the required runtime. +Recompiler output can be compiled with any C compiler (tested with msvc, gcc and clang). The output is expected to be used with a runtime that can provide the necessary functionality and macro implementations to run it. A runtime is provided in [N64ModernRuntime](https://github.com/N64Recomp/N64ModernRuntime) which can be seen in action in the [Zelda 64: Recompiled](https://github.com/Zelda64Recomp/Zelda64Recomp) project. ## Overlays Statically linked and relocatable overlays can both be handled by this tool. In both cases, the tool emits function lookups for jump-and-link-register (i.e. function pointers or virtual functions) which the provided runtime can implement using any sort of lookup table. For example, the instruction `jalr $25` would get recompiled as `LOOKUP_FUNC(ctx->r25)(rdram, ctx);` The runtime can then maintain a list of which program sections are loaded and at what address they are at in order to determine which function to run whenever a lookup is triggered during runtime. diff --git a/RSPRecomp/src/rsp_recomp.cpp b/RSPRecomp/src/rsp_recomp.cpp index 38b914a..b634bd5 100644 --- a/RSPRecomp/src/rsp_recomp.cpp +++ b/RSPRecomp/src/rsp_recomp.cpp @@ -729,8 +729,8 @@ int main(int argc, const char** argv) { std::filesystem::create_directories(std::filesystem::path{ config.output_file_path }.parent_path()); std::ofstream output_file(config.output_file_path); fmt::print(output_file, - "#include \"rsp.h\"\n" - "#include \"rsp_vu_impl.h\"\n" + "#include \"librecomp/rsp.hpp\"\n" + "#include \"librecomp/rsp_vu_impl.hpp\"\n" "RspExitReason {}(uint8_t* rdram) {{\n" " uint32_t r1 = 0, r2 = 0, r3 = 0, r4 = 0, r5 = 0, r6 = 0, r7 = 0;\n" " uint32_t r8 = 0, r9 = 0, r10 = 0, r11 = 0, r12 = 0, r13 = 0, r14 = 0, r15 = 0;\n" diff --git a/src/main.cpp b/src/main.cpp index 8faae53..2b08242 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1434,7 +1434,7 @@ int main(int argc, char** argv) { std::ofstream func_header_file{ config.output_func_path / "funcs.h" }; fmt::print(func_header_file, - "#include \"recomp.h\"\n" + "#include \"librecomp/recomp.h\"\n" "\n" "#ifdef __cplusplus\n" "extern \"C\" {{\n" @@ -1541,7 +1541,7 @@ int main(int argc, char** argv) { single_output_file.open(config.output_func_path / config.elf_path.stem().replace_extension(".c")); // Write the file header fmt::print(single_output_file, - "#include \"recomp.h\"\n" + "#include \"librecomp/recomp.h\"\n" "#include \"disable_warnings.h\"\n" "#include \"funcs.h\"\n" "\n"); @@ -1659,7 +1659,7 @@ int main(int argc, char** argv) { std::ofstream lookup_file{ config.output_func_path / "lookup.cpp" }; fmt::print(lookup_file, - "#include \"recomp.h\"\n" + "#include \"librecomp/recomp.h\"\n" "\n" ); @@ -1685,9 +1685,9 @@ int main(int argc, char** argv) { std::string section_load_table = "static SectionTableEntry section_table[] = {\n"; fmt::print(overlay_file, - "#include \"recomp.h\"\n" + "#include \"librecomp/recomp.h\"\n" "#include \"funcs.h\"\n" - "#include \"sections.h\"\n" + "#include \"librecomp/sections.h\"\n" "\n" ); diff --git a/src/recompilation.cpp b/src/recompilation.cpp index e34ed3c..0c88b44 100644 --- a/src/recompilation.cpp +++ b/src/recompilation.cpp @@ -1103,7 +1103,7 @@ bool RecompPort::recompile_function(const RecompPort::Context& context, const Re if (write_header) { // Write the file header fmt::print(output_file, - "#include \"recomp.h\"\n" + "#include \"librecomp/recomp.h\"\n" "#include \"disable_warnings.h\"\n" "\n"); }