Skip zeroes that sometimes pad function to 16 byte boundary (eg. Donkey Kong Country Returns).

This fixes function detection in the debugger, and prevents functions showing up as four bytes inside another function.
This commit is contained in:
CarlKenner 2015-01-22 02:00:35 +10:30
parent 5cd8a80553
commit 0ab1517134
1 changed files with 3 additions and 0 deletions

View File

@ -313,6 +313,9 @@ static void FindFunctionsAfterBLR(PPCSymbolDB *func_db)
{
while (true)
{
// skip zeroes that sometimes pad function to 16 byte boundary (eg. Donkey Kong Country Returns)
while (Memory::Read_Instruction(location) == 0 && ((location & 0xf) != 0))
location += 4;
if (PPCTables::IsValidInstruction(Memory::Read_Instruction(location)))
{
//check if this function is already mapped