mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2025-05-14 08:12:19 +00:00
fix some renaming and trace mode comments, revert no toml entrypoint code, add TODO to broken block
This commit is contained in:
parent
f2e58c106d
commit
fe84307d7f
3 changed files with 19 additions and 8 deletions
|
@ -413,7 +413,7 @@ N64Recomp::Config::Config(const char* path) {
|
|||
function_hooks = get_function_hooks(table);
|
||||
}
|
||||
|
||||
// Use RE mode if enabled (optional)
|
||||
// Use trace mode if enabled (optional)
|
||||
std::optional<bool> trace_mode_opt = input_data["trace_mode"].value<bool>();
|
||||
if (trace_mode_opt.has_value()) {
|
||||
trace_mode = trace_mode_opt.value();
|
||||
|
|
21
src/elf.cpp
21
src/elf.cpp
|
@ -58,7 +58,20 @@ bool read_symbols(N64Recomp::Context& context, const ELFIO::elfio& elf_file, ELF
|
|||
continue;
|
||||
}
|
||||
|
||||
if (section_index < context.sections.size()) {
|
||||
if (section_index < context.sections.size()) {
|
||||
// Check if this symbol is the entrypoint
|
||||
// TODO this never fires, the check is broken due to signedness
|
||||
if (elf_config.has_entrypoint && value == elf_config.entrypoint_address && type == ELFIO::STT_FUNC) {
|
||||
if (found_entrypoint_func) {
|
||||
fmt::print(stderr, "Ambiguous entrypoint: {}\n", name);
|
||||
return false;
|
||||
}
|
||||
found_entrypoint_func = true;
|
||||
fmt::print("Found entrypoint, original name: {}\n", name);
|
||||
size = 0x50; // dummy size for entrypoints, should cover them all
|
||||
name = "recomp_entrypoint";
|
||||
}
|
||||
|
||||
// Check if this symbol has a size override
|
||||
auto size_find = elf_config.manually_sized_funcs.find(name);
|
||||
if (size_find != elf_config.manually_sized_funcs.end()) {
|
||||
|
@ -100,10 +113,8 @@ bool read_symbols(N64Recomp::Context& context, const ELFIO::elfio& elf_file, ELF
|
|||
context.functions_by_vram[vram].push_back(context.functions.size());
|
||||
|
||||
// Find the entrypoint by rom address in case it doesn't have vram as its value
|
||||
if (rom_address == 0x1000 && type == ELFIO::STT_FUNC) {
|
||||
if (elf_config.has_entrypoint) {
|
||||
vram = elf_config.entrypoint_address;
|
||||
}
|
||||
if (elf_config.has_entrypoint && rom_address == 0x1000 && type == ELFIO::STT_FUNC) {
|
||||
vram = elf_config.entrypoint_address;
|
||||
found_entrypoint_func = true;
|
||||
name = "recomp_entrypoint";
|
||||
if (size == 0) {
|
||||
|
|
|
@ -499,7 +499,7 @@ int main(int argc, char** argv) {
|
|||
// Check if the specified function exists.
|
||||
auto func_find = context.functions_by_name.find(renamed_func);
|
||||
if (func_find == context.functions_by_name.end()) {
|
||||
// Function doesn't exist, present an error to the user instead of silently failing to mark it as ignored.
|
||||
// Function doesn't exist, present an error to the user instead of silently failing to rename it.
|
||||
// This helps prevent typos in the config file or functions renamed between versions from causing issues.
|
||||
exit_failure(fmt::format("Function {} is set as renamed in the config file but does not exist!", renamed_func));
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ int main(int argc, char** argv) {
|
|||
func->name = func->name + "_recomp";
|
||||
}
|
||||
|
||||
// Propogate the re_mode parameter.
|
||||
// Propogate the trace mode parameter.
|
||||
context.trace_mode = config.trace_mode;
|
||||
|
||||
// Apply any single-instruction patches.
|
||||
|
|
Loading…
Add table
Reference in a new issue