From 0ade0a44b583db8e4edbb211e71dff80e5ebba25 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Sun, 2 Mar 2014 10:46:43 +0100 Subject: [PATCH] Detect and skip padding nops at the end of functions --- pcsx2/DebugTools/MIPSAnalyst.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcsx2/DebugTools/MIPSAnalyst.cpp b/pcsx2/DebugTools/MIPSAnalyst.cpp index dd70f345d9..0e3c7852b2 100644 --- a/pcsx2/DebugTools/MIPSAnalyst.cpp +++ b/pcsx2/DebugTools/MIPSAnalyst.cpp @@ -115,6 +115,11 @@ namespace MIPSAnalyst } */ if (end) { + // most functions are aligned to 8 or 16 bytes + // add the padding to this one + while (r5900Debug.read32(addr+8) == 0) + addr += 4; + currentFunction.end = addr + 4; currentFunction.isStraightLeaf = isStraightLeaf; functions.push_back(currentFunction); @@ -123,6 +128,7 @@ namespace MIPSAnalyst looking = false; end = false; isStraightLeaf = true; + currentFunction.start = addr+4; } }