DSPDisassembler: Fix LSR/ASR formatting

Originally, 1479 (for example) would disassemble as `lsr $ACC0, #-7`.  At some point (likely the conversion to fmt), this regressed to `lsr $ACC0, #4294967289`.  Now, it disassembles as `lsr $ACC0, #7`.
This commit is contained in:
Pokechu22 2021-07-31 13:06:57 -07:00
parent d4cd289297
commit f3f466ae82
1 changed files with 3 additions and 2 deletions

View File

@ -105,8 +105,9 @@ std::string DSPDisassembler::DisassembleParameters(const DSPOPCTemplate& opc, u1
// LSL, LSR, ASL, ASR
if (opc.params[j].mask == 0x003f)
{
// 6-bit sign extension
buf += fmt::format("#{}", (val & 0x20) != 0 ? (val | 0xFFFFFFC0) : val);
// Left and right shifts function essentially as a single shift by a 7-bit signed value,
// but are split into two intructions for clarity.
buf += fmt::format("#{}", (val & 0x20) != 0 ? (64 - val) : val);
}
else
{