mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 14:54:53 -04:00
Process Text Files in Decompiler (#122)
* begin support for v2 * export game text * generate text files * working text load * fix windows * add test and clean up game tests a bit * load the right file * add separate program to launch the data compiler * add offline test script
This commit is contained in:
+13
-4
@@ -11,8 +11,8 @@ int main(int argc, char** argv) {
|
||||
spdlog::info("Beginning disassembly. This may take a few minutes...");
|
||||
|
||||
spdlog::set_level(spdlog::level::debug);
|
||||
auto lu = spdlog::basic_logger_mt("GOAL Decompiler", "logs/decompiler.log");
|
||||
spdlog::set_default_logger(lu);
|
||||
// auto lu = spdlog::basic_logger_mt("GOAL Decompiler", "logs/decompiler.log");
|
||||
// spdlog::set_default_logger(lu);
|
||||
spdlog::flush_on(spdlog::level::info);
|
||||
|
||||
file_util::init_crc();
|
||||
@@ -27,12 +27,16 @@ int main(int argc, char** argv) {
|
||||
std::string in_folder = argv[2];
|
||||
std::string out_folder = argv[3];
|
||||
|
||||
std::vector<std::string> dgos;
|
||||
std::vector<std::string> dgos, objs;
|
||||
for (const auto& dgo_name : get_config().dgo_names) {
|
||||
dgos.push_back(file_util::combine_path(in_folder, dgo_name));
|
||||
}
|
||||
|
||||
ObjectFileDB db(dgos, get_config().obj_file_name_map_file);
|
||||
for (const auto& obj_name : get_config().object_file_names) {
|
||||
objs.push_back(file_util::combine_path(in_folder, obj_name));
|
||||
}
|
||||
|
||||
ObjectFileDB db(dgos, get_config().obj_file_name_map_file, objs);
|
||||
file_util::write_text_file(file_util::combine_path(out_folder, "dgo.txt"),
|
||||
db.generate_dgo_listing());
|
||||
file_util::write_text_file(file_util::combine_path(out_folder, "obj.txt"),
|
||||
@@ -54,6 +58,11 @@ int main(int argc, char** argv) {
|
||||
db.analyze_functions();
|
||||
}
|
||||
|
||||
if (get_config().process_game_text) {
|
||||
auto result = db.process_game_text();
|
||||
file_util::write_text_file(file_util::get_file_path({"assets", "game_text.txt"}), result);
|
||||
}
|
||||
|
||||
if (get_config().process_tpages) {
|
||||
db.process_tpages();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user