diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index c90038f66e..37fb6a67df 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -4835,6 +4835,16 @@ spu_thread::thread_name_t::operator std::string() const return full_name; } +spu_thread::priority_t::operator s32() const +{ + if (_this->get_type() != spu_type::threaded || !_this->group->has_scheduler_context) + { + return s32{smax}; + } + + return _this->group->prio; +} + template <> void fmt_class_string::format(std::string& out, u64 arg) { diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index d718671c4a..d104626cbe 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -857,6 +857,14 @@ public: operator std::string() const; } thread_name{ this }; + + // For lv2_obj::schedule + const struct priority_t + { + const spu_thread* _this; + + operator s32() const; + } prio{ this }; }; class spu_function_logger diff --git a/rpcs3/Emu/Cell/lv2/sys_event.cpp b/rpcs3/Emu/Cell/lv2/sys_event.cpp index 683804f576..21727ec559 100644 --- a/rpcs3/Emu/Cell/lv2/sys_event.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_event.cpp @@ -67,10 +67,7 @@ CellError lv2_event_queue::send(lv2_event event) else { // Store event in In_MBox - auto& spu = static_cast(*sq.front()); - - // TODO: use protocol? - sq.pop_front(); + auto& spu = static_cast(*schedule(sq, protocol)); const u32 data1 = static_cast(std::get<1>(event)); const u32 data2 = static_cast(std::get<2>(event));