#ifndef PS2RECOMP_PS2_RECOMPILER_H #define PS2RECOMP_PS2_RECOMPILER_H #include "ps2recomp/types.h" #include "ps2recomp/elf_parser.h" #include "ps2recomp/r5900_decoder.h" #include "ps2recomp/code_generator.h" #include "ps2recomp/config_manager.h" #include #include #include #include namespace ps2recomp { class PS2Recompiler { public: PS2Recompiler(const std::string &configPath); ~PS2Recompiler() = default; bool initialize(); bool recompile(); void generateOutput(); private: ConfigManager m_configManager; std::unique_ptr m_elfParser; std::unique_ptr m_decoder; std::unique_ptr m_codeGenerator; RecompilerConfig m_config; std::vector m_functions; std::vector m_symbols; std::vector
m_sections; std::vector m_relocations; std::unordered_map> m_decodedFunctions; std::unordered_map m_skipFunctions; std::map m_generatedStubs; bool decodeFunction(Function &function); bool shouldSkipFunction(const std::string &name) const; std::string generateRuntimeHeader(); bool generateFunctionHeader(); bool writeToFile(const std::string &path, const std::string &content); std::filesystem::path getOutputPath(const Function &function) const; }; } #endif