diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..dfaf460 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,93 @@ +cmake_minimum_required(VERSION 3.20) +project(Zelda64Recompiled) +set(CMAKE_C_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +# set(CMAKE_CXX_VISIBILITY_PRESET hidden) + +# fmtlib +add_subdirectory(lib/fmt) + +# Rabbitizer +project(rabbitizer) +add_library(rabbitizer STATIC) + +target_sources(rabbitizer PRIVATE + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/analysis/LoPairingInfo.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/analysis/RegistersTracker.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/instructions/InstrId.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/instructions/InstrIdType.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/instructions/InstructionBase.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/instructions/InstructionCpu.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/instructions/InstructionR3000GTE.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/instructions/InstructionR5900.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/src/instructions/InstructionRsp.cpp" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/analysis/RabbitizerLoPairingInfo.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/analysis/RabbitizerRegistersTracker.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/analysis/RabbitizerTrackedRegisterState.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/common/RabbitizerConfig.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/common/RabbitizerVersion.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/common/Utils.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstrCategory.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstrDescriptor.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstrId.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstrIdType.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstrSuffix.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionCpu/RabbitizerInstructionCpu_OperandType.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionR3000GTE/RabbitizerInstructionR3000GTE.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionR3000GTE/RabbitizerInstructionR3000GTE_OperandType.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionR3000GTE/RabbitizerInstructionR3000GTE_ProcessUniqueId.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionR5900/RabbitizerInstructionR5900.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionR5900/RabbitizerInstructionR5900_OperandType.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionR5900/RabbitizerInstructionR5900_ProcessUniqueId.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionRsp/RabbitizerInstructionRsp.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionRsp/RabbitizerInstructionRsp_OperandType.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstructionRsp/RabbitizerInstructionRsp_ProcessUniqueId.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstruction/RabbitizerInstruction.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Disassemble.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Operand.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerInstruction/RabbitizerInstruction_ProcessUniqueId.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerRegister.c" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/src/instructions/RabbitizerRegisterDescriptor.c") + +target_include_directories(rabbitizer PRIVATE + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/include" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/include" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/tables") + +# N64 recompiler +project(N64Recomp) +add_executable(N64Recomp) + +target_sources(N64Recomp PRIVATE + ${CMAKE_SOURCE_DIR}/src/analysis.cpp + ${CMAKE_SOURCE_DIR}/src/config.cpp + ${CMAKE_SOURCE_DIR}/src/main.cpp + ${CMAKE_SOURCE_DIR}/src/recompilation.cpp) + +target_include_directories(N64Recomp PRIVATE + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/include" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/include" + "${CMAKE_SOURCE_DIR}/lib/ELFIO" + "${CMAKE_SOURCE_DIR}/lib/fmt/include" + "${CMAKE_SOURCE_DIR}/lib/toml11" + "${CMAKE_SOURCE_DIR}/include") + + target_link_libraries(N64Recomp fmt rabbitizer) + +# RSP recompiler +project(RSPRecomp) +add_executable(RSPRecomp) + +target_include_directories(RSPRecomp PRIVATE + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/include" + "${CMAKE_SOURCE_DIR}/lib/rabbitizer/cplusplus/include" + "${CMAKE_SOURCE_DIR}/lib/fmt/include" + "${CMAKE_SOURCE_DIR}/include") + +target_link_libraries(RSPRecomp fmt rabbitizer) + +target_sources(RSPRecomp PRIVATE + ${CMAKE_SOURCE_DIR}/RSPRecomp/src/rsp_recomp.cpp) diff --git a/RSPRecomp/RSPRecomp.vcxproj b/RSPRecomp/RSPRecomp.vcxproj deleted file mode 100644 index 952a4c9..0000000 --- a/RSPRecomp/RSPRecomp.vcxproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - {b56d9db2-fb5d-4241-848a-159d17120f35} - - - {17be354c-2b15-4175-8535-7d0d046217a6} - - - - 16.0 - Win32Proj - {31e04b52-67ad-4cef-803f-09a10f81b100} - RSPRecomp - 10.0 - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)lib\rabbitizer\include;$(SolutionDir)lib\rabbitizer\cplusplus\include;$(SolutionDir)lib\ELFIO;$(SolutionDir)lib\fmt\include;$(ProjectDir)include;%(AdditionalIncludeDirectories) - stdcpp20 - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)lib\rabbitizer\include;$(SolutionDir)lib\rabbitizer\cplusplus\include;$(SolutionDir)lib\ELFIO;$(SolutionDir)lib\fmt\include;$(ProjectDir)include;%(AdditionalIncludeDirectories) - stdcpp20 - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)lib\rabbitizer\include;$(SolutionDir)lib\rabbitizer\cplusplus\include;$(SolutionDir)lib\ELFIO;$(SolutionDir)lib\fmt\include;$(ProjectDir)include;%(AdditionalIncludeDirectories) - stdcpp20 - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)lib\rabbitizer\include;$(SolutionDir)lib\rabbitizer\cplusplus\include;$(SolutionDir)lib\ELFIO;$(SolutionDir)lib\fmt\include;$(ProjectDir)include;%(AdditionalIncludeDirectories) - stdcpp20 - - - Console - true - true - true - - - - - - \ No newline at end of file diff --git a/RSPRecomp/RSPRecomp.vcxproj.filters b/RSPRecomp/RSPRecomp.vcxproj.filters deleted file mode 100644 index fae6693..0000000 --- a/RSPRecomp/RSPRecomp.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - \ No newline at end of file diff --git a/RSPRecomp/src/rsp_recomp.cpp b/RSPRecomp/src/rsp_recomp.cpp index d266799..9e06719 100644 --- a/RSPRecomp/src/rsp_recomp.cpp +++ b/RSPRecomp/src/rsp_recomp.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -130,10 +131,11 @@ uint32_t expected_c0_reg_value(int cop0_reg) { return 0; // Always acquire the semaphore case Cop0Reg::RSP_COP0_DPC_STATUS: return 0; // Good enough for the microcodes that would be recompiled (i.e. non-graphics ones) + default: + fmt::print(stderr, "Unhandled mfc0: {}\n", cop0_reg); + throw std::runtime_error("Unhandled mfc0"); + return 0; } - fmt::print(stderr, "Unhandled mfc0: {}\n", cop0_reg); - assert(false); - return 0; } std::string_view c0_reg_write_action(int cop0_reg) { @@ -150,10 +152,11 @@ std::string_view c0_reg_write_action(int cop0_reg) { return "DO_DMA_READ"; case Cop0Reg::RSP_COP0_SP_WR_LEN: return "DO_DMA_WRITE"; + default: + fmt::print(stderr, "Unhandled mtc0: {}\n", cop0_reg); + throw std::runtime_error("Unhandled mtc0"); } - fmt::print(stderr, "Unhandled mtc0: {}\n", cop0_reg); - assert(false); - return ""; + } std::optional get_rsp_element(const rabbitizer::InstructionRsp& instr) { @@ -217,35 +220,35 @@ bool process_instruction(size_t instr_index, const std::vector(fmt::format_string fmt_str, Ts ...args) { + auto print_line = [&](fmt::format_string fmt_str, Ts&& ...args) { print_indent(); - fmt::print(output_file, fmt_str, args...); + fmt::print(output_file, fmt_str, std::forward(args)...); fmt::print(output_file, ";\n"); }; - auto print_branch_condition = [&](fmt::format_string fmt_str, Ts ...args) { - fmt::print(output_file, fmt_str, args...); + auto print_branch_condition = [&](fmt::format_string fmt_str, Ts&& ...args) { + fmt::print(output_file, fmt_str, std::forward(args)...); fmt::print(output_file, " "); }; - auto print_unconditional_branch = [&](fmt::format_string fmt_str, Ts ...args) { + auto print_unconditional_branch = [&](fmt::format_string fmt_str, Ts&& ...args) { if (instr_index < instructions.size() - 1) { uint32_t next_vram = instr_vram + 4; process_instruction(instr_index + 1, instructions, output_file, branch_targets, unsupported_instructions, false, true); } print_indent(); - fmt::print(output_file, fmt_str, args...); + fmt::print(output_file, fmt_str, std::forward(args)...); fmt::print(output_file, ";\n"); }; - auto print_branch = [&](fmt::format_string fmt_str, Ts ...args) { + auto print_branch = [&](fmt::format_string fmt_str, Ts&& ...args) { fmt::print(output_file, "{{\n "); if (instr_index < instructions.size() - 1) { uint32_t next_vram = instr_vram + 4; process_instruction(instr_index + 1, instructions, output_file, branch_targets, unsupported_instructions, true, true); } fmt::print(output_file, " "); - fmt::print(output_file, fmt_str, args...); + fmt::print(output_file, fmt_str, std::forward(args)...); fmt::print(output_file, ";\n }}\n"); }; @@ -316,6 +319,8 @@ bool process_instruction(size_t instr_index, const std::vector> 1); break; + case RspOperand::None: + break; } } // Trim the trailing comma off the operands diff --git a/RecompPort.sln b/RecompPort.sln deleted file mode 100644 index 9de0456..0000000 --- a/RecompPort.sln +++ /dev/null @@ -1,61 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.32929.386 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RecompPort", "RecompPort.vcxproj", "{23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Rabbitizer", "lib\Rabbitizer.vcxproj", "{17BE354C-2B15-4175-8535-7D0D046217A6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmtlib", "lib\fmtlib.vcxproj", "{B56D9DB2-FB5D-4241-848A-159D17120F35}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RSPRecomp", "RSPRecomp\RSPRecomp.vcxproj", "{31E04B52-67AD-4CEF-803F-09A10F81B100}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}.Debug|x64.ActiveCfg = Debug|x64 - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}.Debug|x64.Build.0 = Debug|x64 - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}.Debug|x86.ActiveCfg = Debug|Win32 - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}.Debug|x86.Build.0 = Debug|Win32 - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}.Release|x64.ActiveCfg = Release|x64 - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}.Release|x64.Build.0 = Release|x64 - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}.Release|x86.ActiveCfg = Release|Win32 - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD}.Release|x86.Build.0 = Release|Win32 - {17BE354C-2B15-4175-8535-7D0D046217A6}.Debug|x64.ActiveCfg = Debug|x64 - {17BE354C-2B15-4175-8535-7D0D046217A6}.Debug|x64.Build.0 = Debug|x64 - {17BE354C-2B15-4175-8535-7D0D046217A6}.Debug|x86.ActiveCfg = Debug|Win32 - {17BE354C-2B15-4175-8535-7D0D046217A6}.Debug|x86.Build.0 = Debug|Win32 - {17BE354C-2B15-4175-8535-7D0D046217A6}.Release|x64.ActiveCfg = Release|x64 - {17BE354C-2B15-4175-8535-7D0D046217A6}.Release|x64.Build.0 = Release|x64 - {17BE354C-2B15-4175-8535-7D0D046217A6}.Release|x86.ActiveCfg = Release|Win32 - {17BE354C-2B15-4175-8535-7D0D046217A6}.Release|x86.Build.0 = Release|Win32 - {B56D9DB2-FB5D-4241-848A-159D17120F35}.Debug|x64.ActiveCfg = Debug|x64 - {B56D9DB2-FB5D-4241-848A-159D17120F35}.Debug|x64.Build.0 = Debug|x64 - {B56D9DB2-FB5D-4241-848A-159D17120F35}.Debug|x86.ActiveCfg = Debug|Win32 - {B56D9DB2-FB5D-4241-848A-159D17120F35}.Debug|x86.Build.0 = Debug|Win32 - {B56D9DB2-FB5D-4241-848A-159D17120F35}.Release|x64.ActiveCfg = Release|x64 - {B56D9DB2-FB5D-4241-848A-159D17120F35}.Release|x64.Build.0 = Release|x64 - {B56D9DB2-FB5D-4241-848A-159D17120F35}.Release|x86.ActiveCfg = Release|Win32 - {B56D9DB2-FB5D-4241-848A-159D17120F35}.Release|x86.Build.0 = Release|Win32 - {31E04B52-67AD-4CEF-803F-09A10F81B100}.Debug|x64.ActiveCfg = Debug|x64 - {31E04B52-67AD-4CEF-803F-09A10F81B100}.Debug|x64.Build.0 = Debug|x64 - {31E04B52-67AD-4CEF-803F-09A10F81B100}.Debug|x86.ActiveCfg = Debug|Win32 - {31E04B52-67AD-4CEF-803F-09A10F81B100}.Debug|x86.Build.0 = Debug|Win32 - {31E04B52-67AD-4CEF-803F-09A10F81B100}.Release|x64.ActiveCfg = Release|x64 - {31E04B52-67AD-4CEF-803F-09A10F81B100}.Release|x64.Build.0 = Release|x64 - {31E04B52-67AD-4CEF-803F-09A10F81B100}.Release|x86.ActiveCfg = Release|Win32 - {31E04B52-67AD-4CEF-803F-09A10F81B100}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {060DB2CD-23B2-4BDA-82D2-ACAC7BB5450B} - EndGlobalSection -EndGlobal diff --git a/RecompPort.vcxproj b/RecompPort.vcxproj deleted file mode 100644 index 3ea3d73..0000000 --- a/RecompPort.vcxproj +++ /dev/null @@ -1,152 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {23C26E84-DC01-43A6-B11B-0B4A2D79A5DD} - Win32Proj - 10.0 - - - - Application - true - v142 - - - Application - false - v142 - - - Application - true - v142 - - - Application - false - v142 - - - - - - - - - - - - - - - - - - - - - true - - - true - - - - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - stdcpp20 - $(SolutionDir)lib\rabbitizer\include;$(SolutionDir)lib\rabbitizer\cplusplus\include;$(SolutionDir)lib\ELFIO;$(SolutionDir)lib\fmt\include;$(SolutionDir)lib\toml11;$(ProjectDir)include;%(AdditionalIncludeDirectories) - true - - - MachineX86 - true - Console - mainCRTStartup - - - - - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - stdcpp20 - $(SolutionDir)lib\rabbitizer\include;$(SolutionDir)lib\rabbitizer\cplusplus\include;$(SolutionDir)lib\ELFIO;$(SolutionDir)lib\fmt\include;$(SolutionDir)lib\toml11;$(ProjectDir)include;%(AdditionalIncludeDirectories) - true - - - MachineX86 - true - Console - true - true - mainCRTStartup - - - - - stdcpp20 - $(SolutionDir)lib\rabbitizer\include;$(SolutionDir)lib\rabbitizer\cplusplus\include;$(SolutionDir)lib\ELFIO;$(SolutionDir)lib\fmt\include;$(SolutionDir)lib\toml11;$(ProjectDir)include;%(AdditionalIncludeDirectories) - true - - - Console - mainCRTStartup - - - - - stdcpp20 - $(SolutionDir)lib\rabbitizer\include;$(SolutionDir)lib\rabbitizer\cplusplus\include;$(SolutionDir)lib\ELFIO;$(SolutionDir)lib\fmt\include;$(SolutionDir)lib\toml11;$(ProjectDir)include;%(AdditionalIncludeDirectories) - true - - - Console - mainCRTStartup - - - - - {b56d9db2-fb5d-4241-848a-159d17120f35} - - - {17be354c-2b15-4175-8535-7d0d046217a6} - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RecompPort.vcxproj.filters b/RecompPort.vcxproj.filters deleted file mode 100644 index 4fac5c7..0000000 --- a/RecompPort.vcxproj.filters +++ /dev/null @@ -1,39 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/lib/Rabbitizer.vcxproj b/lib/Rabbitizer.vcxproj deleted file mode 100644 index c725806..0000000 --- a/lib/Rabbitizer.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 16.0 - Win32Proj - {17be354c-2b15-4175-8535-7d0d046217a6} - Rabbitizer - 10.0 - - - - StaticLibrary - true - v142 - Unicode - - - StaticLibrary - false - v142 - true - Unicode - - - StaticLibrary - true - v142 - Unicode - - - StaticLibrary - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)$(Configuration)\rabbitizer_build\ - $(Configuration)\rabbitizer_build\ - - - false - $(SolutionDir)$(Configuration)\rabbitizer_build\ - $(Configuration)\rabbitizer_build\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\rabbitizer_build\ - $(Platform)\$(Configuration)\rabbitizer_build\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\rabbitizer_build\ - $(Platform)\$(Configuration)\rabbitizer_build\ - - - - - - true - - - $(ProjectDir)rabbitizer\include;$(ProjectDir)rabbitizer\cplusplus\include;$(ProjectDir)rabbitizer\tables - stdcpp17 - - - - - - - true - true - true - - - $(ProjectDir)rabbitizer\include;$(ProjectDir)rabbitizer\cplusplus\include;$(ProjectDir)rabbitizer\tables - stdcpp17 - - - - - - - true - - - $(ProjectDir)rabbitizer\include;$(ProjectDir)rabbitizer\cplusplus\include;$(ProjectDir)rabbitizer\tables - stdcpp17 - - - - - - - true - true - true - - - $(ProjectDir)rabbitizer\include;$(ProjectDir)rabbitizer\cplusplus\include;$(ProjectDir)rabbitizer\tables - stdcpp17 - - - - - - \ No newline at end of file diff --git a/lib/Rabbitizer.vcxproj.filters b/lib/Rabbitizer.vcxproj.filters deleted file mode 100644 index 7d59c9f..0000000 --- a/lib/Rabbitizer.vcxproj.filters +++ /dev/null @@ -1,216 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/lib/fmtlib.vcxproj b/lib/fmtlib.vcxproj deleted file mode 100644 index 4c2cfae..0000000 --- a/lib/fmtlib.vcxproj +++ /dev/null @@ -1,159 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {b56d9db2-fb5d-4241-848a-159d17120f35} - fmtlib - 10.0 - - - - StaticLibrary - true - v142 - Unicode - - - StaticLibrary - false - v142 - true - Unicode - - - StaticLibrary - true - v142 - Unicode - - - StaticLibrary - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)$(Configuration)\fmtlib_build\ - $(Configuration)\fmtlib_build\ - - - false - $(SolutionDir)$(Configuration)\fmtlib_build\ - $(Configuration)\fmtlib_build\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\fmtlib_build\ - $(Platform)\$(Configuration)\fmtlib_build\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\fmtlib_build\ - $(Platform)\$(Configuration)\fmtlib_build\ - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(ProjectDir)fmt\include;%(AdditionalIncludeDirectories) - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(ProjectDir)fmt\include;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(ProjectDir)fmt\include;%(AdditionalIncludeDirectories) - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(ProjectDir)fmt\include;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/lib/fmtlib.vcxproj.filters b/lib/fmtlib.vcxproj.filters deleted file mode 100644 index 48d6a1f..0000000 --- a/lib/fmtlib.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 6501747..3cdf1dd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "rabbitizer.hpp" #include "elfio/elfio.hpp" @@ -611,7 +612,8 @@ bool read_symbols(RecompPort::Context& context, const ELFIO::elfio& elf_file, EL std::move(name), 0, true, - reimplemented + reimplemented, + false ); continue; } diff --git a/src/recompilation.cpp b/src/recompilation.cpp index 77fab21..2d82499 100644 --- a/src/recompilation.cpp +++ b/src/recompilation.cpp @@ -232,6 +232,8 @@ bool process_instruction(const RecompPort::Context& context, const RecompPort::C signed_imm_string = "(int16_t)" + unsigned_imm_string; reloc_handled = true; break; + default: + throw std::runtime_error(fmt::format("Unexpected reloc type {} in {}\n", static_cast(reloc_type), func.name)); } }