From b672788548fecbe7f4c0e6d93921509ba5f2f828 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 21 Dec 2014 06:20:28 +0100 Subject: [PATCH] Zelda HLE: Skip command words that are not commands. Zelda Twilight Princess (GC) seems to push null words into the command buffer. The command handler in the UCode ignores initial command mails that do not have the MSB set. --- Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp index 7026727704..8a2dd4229b 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp @@ -173,13 +173,16 @@ void ZeldaUCode::RunPendingCommands() while (m_pending_commands_count) { - m_pending_commands_count--; - u32 cmd_mail = Read32(); + if (!(cmd_mail & 0x80000000)) + continue; + u32 command = (cmd_mail >> 24) & 0x7f; u32 sync = cmd_mail >> 16; u32 extra_data = cmd_mail & 0xFFFF; + m_pending_commands_count--; + switch (command) { case 0x00: