From 1d0185d7d56e6f96d0cfa89096d8caeecb26d841 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Wed, 24 May 2017 15:20:31 -0700 Subject: [PATCH] DSPDisassembler: remove unused base_addr parameter --- Source/Core/Core/DSP/DSPCodeUtil.cpp | 8 ++++---- Source/Core/Core/DSP/DSPDisassembler.cpp | 7 +++---- Source/Core/Core/DSP/DSPDisassembler.h | 4 ++-- Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp | 2 +- Source/UnitTests/Core/DSP/DSPAssemblyTest.cpp | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Source/Core/Core/DSP/DSPCodeUtil.cpp b/Source/Core/Core/DSP/DSPCodeUtil.cpp index a5c789716b..b33dcb416f 100644 --- a/Source/Core/Core/DSP/DSPCodeUtil.cpp +++ b/Source/Core/Core/DSP/DSPCodeUtil.cpp @@ -56,7 +56,7 @@ bool Disassemble(const std::vector& code, bool line_numbers, std::string& t settings.decode_registers = true; DSPDisassembler disasm(settings); - bool success = disasm.Disassemble(code, 0x0000, text); + bool success = disasm.Disassemble(code, text); return success; } @@ -79,9 +79,9 @@ bool Compare(const std::vector& code1, const std::vector& code2) { std::string line1, line2; u16 pc = i; - disassembler.DisassembleOpcode(&code1[0], 0x0000, &pc, line1); + disassembler.DisassembleOpcode(&code1[0], &pc, line1); pc = i; - disassembler.DisassembleOpcode(&code2[0], 0x0000, &pc, line2); + disassembler.DisassembleOpcode(&code2[0], &pc, line2); printf("!! %04x : %04x vs %04x - %s vs %s\n", i, code1[i], code2[i], line1.c_str(), line2.c_str()); } @@ -94,7 +94,7 @@ bool Compare(const std::vector& code1, const std::vector& code2) { u16 pc = i; std::string line; - disassembler.DisassembleOpcode(&longest[0], 0x0000, &pc, line); + disassembler.DisassembleOpcode(&longest[0], &pc, line); printf("!! %s\n", line.c_str()); } } diff --git a/Source/Core/Core/DSP/DSPDisassembler.cpp b/Source/Core/Core/DSP/DSPDisassembler.cpp index 7422852f18..ce911aeca9 100644 --- a/Source/Core/Core/DSP/DSPDisassembler.cpp +++ b/Source/Core/Core/DSP/DSPDisassembler.cpp @@ -25,11 +25,11 @@ DSPDisassembler::DSPDisassembler(const AssemblerSettings& settings) : settings_( { } -bool DSPDisassembler::Disassemble(const std::vector& code, int base_addr, std::string& text) +bool DSPDisassembler::Disassemble(const std::vector& code, std::string& text) { for (u16 pc = 0; pc < code.size();) { - if (!DisassembleOpcode(code.data(), base_addr, &pc, text)) + if (!DisassembleOpcode(code.data(), &pc, text)) return false; text.append("\n"); } @@ -129,8 +129,7 @@ std::string DSPDisassembler::DisassembleParameters(const DSPOPCTemplate& opc, u1 return buf; } -bool DSPDisassembler::DisassembleOpcode(const u16* binbuf, int base_addr, u16* pc, - std::string& dest) +bool DSPDisassembler::DisassembleOpcode(const u16* binbuf, u16* pc, std::string& dest) { if ((*pc & 0x7fff) >= 0x1000) { diff --git a/Source/Core/Core/DSP/DSPDisassembler.h b/Source/Core/Core/DSP/DSPDisassembler.h index 0eb4c301c7..e02e221d9b 100644 --- a/Source/Core/Core/DSP/DSPDisassembler.h +++ b/Source/Core/Core/DSP/DSPDisassembler.h @@ -34,10 +34,10 @@ class DSPDisassembler public: explicit DSPDisassembler(const AssemblerSettings& settings); - bool Disassemble(const std::vector& code, int base_addr, std::string& text); + bool Disassemble(const std::vector& code, std::string& text); // Warning - this one is trickier to use right. - bool DisassembleOpcode(const u16* binbuf, int base_addr, u16* pc, std::string& dest); + bool DisassembleOpcode(const u16* binbuf, u16* pc, std::string& dest); private: std::string DisassembleParameters(const DSPOPCTemplate& opc, u16 op1, u16 op2); diff --git a/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp b/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp index 093389761f..868fd3443c 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp @@ -230,7 +230,7 @@ void AutoDisassembly(u16 start_addr, u16 end_addr) addr_to_line[addr] = line_counter; std::string buf; - if (!disasm.DisassembleOpcode(ptr, 0, &addr, buf)) + if (!disasm.DisassembleOpcode(ptr, &addr, buf)) { ERROR_LOG(DSPLLE, "disasm failed at %04x", addr); break; diff --git a/Source/UnitTests/Core/DSP/DSPAssemblyTest.cpp b/Source/UnitTests/Core/DSP/DSPAssemblyTest.cpp index b1b0ba68d8..4dd3395a46 100644 --- a/Source/UnitTests/Core/DSP/DSPAssemblyTest.cpp +++ b/Source/UnitTests/Core/DSP/DSPAssemblyTest.cpp @@ -23,7 +23,7 @@ static bool RoundTrippableDissassemble(const std::vector& code, std::string settings.show_pc = false; DSP::DSPDisassembler disasm(settings); - return disasm.Disassemble(code, 0x0000, text); + return disasm.Disassemble(code, text); } // This test goes from text ASM to binary to text ASM and once again back to binary.