From a776f1555706a3f522bc32ed19bd186032c65e82 Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 19 May 2023 18:41:35 +0300 Subject: [PATCH] SPU: fix event count with ACK and mask write --- rpcs3/Emu/Cell/SPUThread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index 787f2e378f..af86f12b8a 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -5335,7 +5335,7 @@ bool spu_thread::set_ch_value(u32 ch, u32 value) case SPU_WrEventMask: { - get_events(value); + get_events(value | static_cast(ch_events.load().mask)); if (ch_events.atomic_op([&](ch_events_t& events) { @@ -5347,7 +5347,7 @@ bool spu_thread::set_ch_value(u32 ch, u32 value) return true; } - return false; + return !!events.count; })) { // Check interrupts in case count is 1 @@ -5363,7 +5363,7 @@ bool spu_thread::set_ch_value(u32 ch, u32 value) case SPU_WrEventAck: { // "Collect" events before final acknowledgment - get_events(value); + get_events(value | static_cast(ch_events.load().mask)); bool freeze_dec = false; @@ -5379,7 +5379,7 @@ bool spu_thread::set_ch_value(u32 ch, u32 value) return true; } - return false; + return !!events.count; }); if (!is_dec_frozen && freeze_dec)