Skip to content

Commit

Permalink
ZeldaHLE: Properly implement light command 03.
Browse files Browse the repository at this point in the history
On at least one version (AC/Pikmin 1 NTSC) it doesn't even send a sync mail and
just reloops to the dispatcher.
  • Loading branch information
delroth committed Aug 8, 2015
1 parent 04a075f commit 9b7ba41
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp
Expand Up @@ -264,6 +264,8 @@ void ZeldaUCode::HandleMailDefault(u32 mail)

void ZeldaUCode::HandleMailLight(u32 mail)
{
bool add_command = true;

switch (m_mail_current_state)
{
case MailState::WAITING:
Expand All @@ -274,11 +276,15 @@ void ZeldaUCode::HandleMailLight(u32 mail)
// for each command - the alternative is to rewrite command handling as
// an asynchronous procedure, and we wouldn't want that, would we?
Write32(mail);

switch ((mail >> 24) & 0x7F)
{
case 0: m_mail_expected_cmd_mails = 0; break;
case 1: m_mail_expected_cmd_mails = 4; break;
case 2: m_mail_expected_cmd_mails = 2; break;
// Doesn't even register as a command, just rejumps to the dispatcher.
case 3: add_command = false; break;

default:
PanicAlert("Received unknown command in light protocol: %08x", mail);
break;
Expand All @@ -287,7 +293,7 @@ void ZeldaUCode::HandleMailLight(u32 mail)
{
SetMailState(MailState::WRITING_CMD);
}
else
else if (add_command)
{
m_pending_commands_count += 1;
RunPendingCommands();
Expand Down

0 comments on commit 9b7ba41

Please sign in to comment.