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:
water111
2020-11-19 21:22:16 -05:00
committed by GitHub
parent ae053870c3
commit 953c1512db
48 changed files with 1794 additions and 200 deletions
+13 -4
View File
@@ -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();
}