mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2025-05-18 01:14:54 +00:00
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:
parent
d33d381617
commit
17438755a1
9 changed files with 95 additions and 12 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue