From d029f2a7b6544933fcd35befceae456da29cf280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 28 Feb 2018 17:00:26 +0100 Subject: [PATCH] IPC: Clear X1 when acknowledging a reply Hardware tests indicate that IOS clears X1 when it acknowledges an IPC request. --- Source/Core/Core/HW/WII_IPC.cpp | 5 +++++ Source/Core/Core/HW/WII_IPC.h | 1 + Source/Core/Core/IOS/IOS.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/Source/Core/Core/HW/WII_IPC.cpp b/Source/Core/Core/HW/WII_IPC.cpp index 5a60b0f04f..d231adcfd2 100644 --- a/Source/Core/Core/HW/WII_IPC.cpp +++ b/Source/Core/Core/HW/WII_IPC.cpp @@ -211,6 +211,11 @@ static void UpdateInterrupts(u64 userdata, s64 cyclesLate) !!(ppc_irq_flags & ppc_irq_masks)); } +void ClearX1() +{ + ctrl.X1 = 0; +} + void GenerateAck(u32 _Address) { ctrl.Y2 = 1; diff --git a/Source/Core/Core/HW/WII_IPC.h b/Source/Core/Core/HW/WII_IPC.h index d97e7eab0c..34419b8988 100644 --- a/Source/Core/Core/HW/WII_IPC.h +++ b/Source/Core/Core/HW/WII_IPC.h @@ -42,6 +42,7 @@ void DoState(PointerWrap& p); void RegisterMMIO(MMIO::Mapping* mmio, u32 base); +void ClearX1(); void GenerateAck(u32 _Address); void GenerateReply(u32 _Address); diff --git a/Source/Core/Core/IOS/IOS.cpp b/Source/Core/Core/IOS/IOS.cpp index 90d63c0f4f..cd94693723 100644 --- a/Source/Core/Core/IOS/IOS.cpp +++ b/Source/Core/Core/IOS/IOS.cpp @@ -629,6 +629,7 @@ void Kernel::UpdateIPC() if (m_request_queue.size()) { + ClearX1(); GenerateAck(m_request_queue.front()); u32 command = m_request_queue.front(); m_request_queue.pop_front();