Implement nrm filename toml input, renaming list, trace mode, and context dumping flag (#111)

* implement nrm filename toml input

* change name of mod toml setting to 'mod_filename'

* add renaming and re mode

* fix --dump-context arg, fix entrypoint detection

* refactor re_mode to function_trace_mode

* adjust trace mode to use a general TRACE_ENTRY() macro

* fix some renaming and trace mode comments, revert no toml entrypoint code, add TODO to broken block

* fix arg2 check and usage string
This commit is contained in:
LittleCube 2024-12-24 02:10:26 -05:00 committed by GitHub
parent d33d381617
commit 17438755a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 95 additions and 12 deletions

View file

@ -35,6 +35,7 @@ struct ModManifest {
struct ModInputs {
std::filesystem::path elf_path;
std::string mod_filename;
std::filesystem::path func_reference_syms_file_path;
std::vector<std::filesystem::path> data_reference_syms_file_paths;
std::vector<std::filesystem::path> additional_files;
@ -316,6 +317,15 @@ ModInputs parse_mod_config_inputs(const std::filesystem::path& basedir, const to
throw toml::parse_error("Mod toml input section is missing elf file", inputs_table.source());
}
// Output NRM file
std::optional<std::string> mod_filename_opt = inputs_table["mod_filename"].value<std::string>();
if (mod_filename_opt.has_value()) {
ret.mod_filename = std::move(mod_filename_opt.value());
}
else {
throw toml::parse_error("Mod toml input section is missing the output mod filename", inputs_table.source());
}
// Function reference symbols file
std::optional<std::string> func_reference_syms_file_opt = inputs_table["func_reference_syms_file"].value<std::string>();
if (func_reference_syms_file_opt.has_value()) {
@ -879,7 +889,7 @@ N64Recomp::Context build_mod_context(const N64Recomp::Context& input_context, bo
}
bool create_mod_zip(const std::filesystem::path& output_dir, const ModConfig& config) {
std::filesystem::path output_path = output_dir / (config.manifest.mod_id + "-" + config.manifest.version_string + ".nrm");
std::filesystem::path output_path = output_dir / (config.inputs.mod_filename + ".nrm");
#ifdef _WIN32
std::filesystem::path temp_zip_path = output_path;