mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 06:54:31 -04:00
extractor: cleanup, support unicode properly, and add multi-game support (#1609)
* extractor: refactor and cleanup for multi-game support * deps: switch to `ghc::filesystem` as it is utf-8 everywhere by default * extractor: finally working with unicode * unicode: fix unicode cli args on windows in all `main` functions
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
|
||||
#include "decompiler/analysis/symbol_def_map.h"
|
||||
#include "decompiler/data/TextureDB.h"
|
||||
@@ -144,30 +145,28 @@ struct LetRewriteStats {
|
||||
|
||||
class ObjectFileDB {
|
||||
public:
|
||||
ObjectFileDB(const std::vector<std::filesystem::path>& _dgos,
|
||||
const std::filesystem::path& obj_file_name_map_file,
|
||||
const std::vector<std::filesystem::path>& object_files,
|
||||
const std::vector<std::filesystem::path>& str_files,
|
||||
ObjectFileDB(const std::vector<fs::path>& _dgos,
|
||||
const fs::path& obj_file_name_map_file,
|
||||
const std::vector<fs::path>& object_files,
|
||||
const std::vector<fs::path>& str_files,
|
||||
const Config& config);
|
||||
std::string generate_dgo_listing();
|
||||
std::string generate_obj_listing(const std::unordered_set<std::string>& merged_objs);
|
||||
void process_link_data(const Config& config);
|
||||
void process_labels();
|
||||
void find_code(const Config& config);
|
||||
void find_and_write_scripts(const std::filesystem::path& output_dir);
|
||||
void find_and_write_scripts(const fs::path& output_dir);
|
||||
void extract_art_info();
|
||||
void dump_art_info(const std::filesystem::path& output_dir);
|
||||
void dump_raw_objects(const std::filesystem::path& output_dir);
|
||||
void write_object_file_words(const std::filesystem::path& output_dir,
|
||||
bool dump_data,
|
||||
bool dump_code);
|
||||
void write_disassembly(const std::filesystem::path& output_dir,
|
||||
void dump_art_info(const fs::path& output_dir);
|
||||
void dump_raw_objects(const fs::path& output_dir);
|
||||
void write_object_file_words(const fs::path& output_dir, bool dump_data, bool dump_code);
|
||||
void write_disassembly(const fs::path& output_dir,
|
||||
bool disassemble_data,
|
||||
bool disassemble_code,
|
||||
bool print_hex);
|
||||
|
||||
void analyze_functions_ir2(
|
||||
const std::filesystem::path& output_dir,
|
||||
const fs::path& output_dir,
|
||||
const Config& config,
|
||||
const std::unordered_set<std::string>& skip_functions,
|
||||
const std::unordered_map<std::string, std::unordered_set<std::string>>& skip_states = {});
|
||||
@@ -185,7 +184,7 @@ class ObjectFileDB {
|
||||
void ir2_rewrite_inline_asm_instructions(int seg, ObjectFileData& data);
|
||||
void ir2_insert_anonymous_functions(int seg, ObjectFileData& data);
|
||||
void ir2_symbol_definition_map(ObjectFileData& data);
|
||||
void ir2_write_results(const std::filesystem::path& output_dir,
|
||||
void ir2_write_results(const fs::path& output_dir,
|
||||
const Config& config,
|
||||
const std::vector<std::string>& imports,
|
||||
ObjectFileData& data);
|
||||
@@ -193,7 +192,7 @@ class ObjectFileDB {
|
||||
void ir2_do_segment_analysis_phase2(int seg, const Config& config, ObjectFileData& data);
|
||||
void ir2_setup_labels(const Config& config, ObjectFileData& data);
|
||||
void ir2_run_mips2c(const Config& config, ObjectFileData& data);
|
||||
void ir2_analyze_all_types(const std::filesystem::path& output_file,
|
||||
void ir2_analyze_all_types(const fs::path& output_file,
|
||||
const std::optional<std::string>& previous_game_types,
|
||||
const std::unordered_set<std::string>& bad_types);
|
||||
std::string ir2_to_file(ObjectFileData& data, const Config& config);
|
||||
@@ -202,7 +201,7 @@ class ObjectFileDB {
|
||||
const std::vector<std::string>& imports,
|
||||
const std::unordered_set<std::string>& skip_functions);
|
||||
|
||||
std::string process_tpages(TextureDB& tex_db, const std::filesystem::path& output_path);
|
||||
std::string process_tpages(TextureDB& tex_db, const fs::path& output_path);
|
||||
std::string process_game_count_file();
|
||||
std::string process_game_text_files(const Config& cfg);
|
||||
|
||||
@@ -216,7 +215,7 @@ class ObjectFileDB {
|
||||
|
||||
public:
|
||||
void load_map_file(const std::string& map_data);
|
||||
void get_objs_from_dgo(const std::filesystem::path& filename, const Config& config);
|
||||
void get_objs_from_dgo(const fs::path& filename, const Config& config);
|
||||
void add_obj_from_dgo(const std::string& obj_name,
|
||||
const std::string& name_in_dgo,
|
||||
const uint8_t* obj_data,
|
||||
|
||||
Reference in New Issue
Block a user