Fix PPC branch display; update README.md

This commit is contained in:
Luke Street 2024-03-22 23:06:41 -06:00
parent 30d14870ef
commit 106652ae7d
4 changed files with 13 additions and 6 deletions

View File

@ -7,7 +7,7 @@ A local diffing tool for decompilation projects. Inspired by [decomp.me](https:/
Features:
- Compare entire object files: functions and data.
- Built-in symbol demangling for C++.
- Built-in symbol demangling for C++. (CodeWarrior, Itanium & MSVC)
- Automatic rebuild on source file changes.
- Project integration via [configuration file](#configuration).
- Search and filter all of a project's objects and quickly switch.
@ -15,7 +15,8 @@ Features:
Supports:
- PowerPC 750CL (GameCube & Wii)
- MIPS (Nintendo 64)
- MIPS (Nintendo 64 & PS2)
- x86 (PE only at the moment)
See [Usage](#usage) for more information.

View File

@ -89,9 +89,7 @@ pub fn run(args: Args) -> Result<()> {
return Some(obj);
}
let Some(up) = unit_path.as_deref() else {
return None;
};
let up = unit_path.as_deref()?;
resolve_paths(obj);

View File

@ -74,7 +74,11 @@ pub fn display_diff<E>(
display_reloc_name(ins.reloc.as_ref().unwrap(), &mut cb)?;
}
ObjInsArg::BranchDest(dest) => {
cb(DiffText::BranchDest(*dest))?;
if let Some(dest) = dest.checked_sub(base_addr) {
cb(DiffText::BranchDest(dest))?;
} else {
cb(DiffText::Basic("<unknown>"))?;
}
}
}
}

View File

@ -23,10 +23,14 @@ pub enum X86Formatter {
Masm,
}
#[inline]
const fn default_true() -> bool { true }
#[derive(Debug, Clone, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default)]
pub struct DiffObjConfig {
pub relax_reloc_diffs: bool,
#[serde(default = "default_true")]
pub space_between_args: bool,
pub x86_formatter: X86Formatter,
}