Skip to content

Commit 5035f8e

Browse files
authored
Update rabbitizer integration for 2.0.0-alpha.9 (#347)
1 parent b8f401b commit 5035f8e

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎objdiff-core/config-schema.json‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@
345345
"name": "Register '$' prefix",
346346
"description": "Display MIPS register names with a '$' prefix."
347347
},
348+
{
349+
"id": "mips.prodgSnAsInvertedRegs",
350+
"type": "boolean",
351+
"default": false,
352+
"name": "ProDG SN AS VU register order",
353+
"description": "Changes the register order for specific R5900EE instructions to match the syntax used by the SN AS from ProDG (-snas flag)."
354+
},
348355
{
349356
"id": "ppc.calculatePoolRelocations",
350357
"type": "boolean",
@@ -409,7 +416,7 @@
409416
{
410417
"id": "mips",
411418
"name": "MIPS",
412-
"properties": ["mips.abi", "mips.instrCategory", "mips.registerPrefix"]
419+
"properties": ["mips.abi", "mips.instrCategory", "mips.registerPrefix", "mips.prodgSnAsInvertedRegs"]
413420
},
414421
{
415422
"id": "ppc",

‎objdiff-core/src/arch/mips.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ impl ArchMips {
188188
rabbitizer::InstructionDisplayFlags::default()
189189
.with_unknown_instr_comment(false)
190190
.with_use_dollar(diff_config.mips_register_prefix)
191+
.with_r5900ee_prodg_sn_as_inverted_regs(diff_config.mips_prodg_sn_as_inverted_regs)
191192
}
192193

193194
fn parse_ins_ref(
@@ -237,7 +238,8 @@ impl Arch for ArchMips {
237238
let instruction = self.parse_ins_ref(resolved.ins_ref, resolved.code, diff_config)?;
238239
let display_flags = self.instruction_display_flags(diff_config);
239240
let opcode = instruction.opcode();
240-
cb(InstructionPart::opcode(opcode.name(), opcode as u16))?;
241+
let mnemonic = instruction.mnemonic_display(&display_flags).to_string();
242+
cb(InstructionPart::opcode(mnemonic, opcode as u16))?;
241243
push_args(&instruction, resolved.relocation, &display_flags, cb)?;
242244
Ok(())
243245
}

0 commit comments

Comments
 (0)