mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-29 23:03:18 +00:00
review comments applied
This commit is contained in:
parent
37014394fd
commit
d804a66aa2
5 changed files with 32 additions and 24 deletions
|
@ -1307,8 +1307,8 @@ static inline s32 PatchFlipRequest(u32* cmdbuf, u32 size, u32 vo_handle, u32 buf
|
|||
auto* write_lock = reinterpret_cast<PM4CmdWriteData*>(cmdbuf);
|
||||
write_lock->header = PM4Type3Header{PM4ItOpcode::WriteData, 3};
|
||||
write_lock->raw = 0x500u;
|
||||
*reinterpret_cast<uintptr_t*>(&write_lock->dst_addr_lo) =
|
||||
(label_addr + buf_idx * sizeof(uintptr_t)) & ~0x3ull;
|
||||
const auto addr = (label_addr + buf_idx * sizeof(label_addr)) & ~0x3ull;
|
||||
write_lock->Address<uintptr_t>(addr);
|
||||
write_lock->data[0] = 1;
|
||||
|
||||
auto* nop = reinterpret_cast<PM4CmdNop*>(cmdbuf + 5);
|
||||
|
|
|
@ -21,8 +21,8 @@ int EqueueInternal::addEvent(const EqueueEvent& event) {
|
|||
}
|
||||
|
||||
int EqueueInternal::removeEvent(u64 id) {
|
||||
const auto& event_q = std::find_if(m_events.cbegin(), m_events.cend(),
|
||||
[id](auto& ev) { return ev.event.ident == id; });
|
||||
const auto& event_q =
|
||||
std::ranges::find_if(m_events, [id](auto& ev) { return ev.event.ident == id; });
|
||||
ASSERT(event_q != m_events.cend());
|
||||
m_events.erase(event_q);
|
||||
return 0;
|
||||
|
|
|
@ -38,10 +38,9 @@ struct IrqController {
|
|||
void Register(IrqHandler handler) {
|
||||
ASSERT_MSG(!persistent_handler.has_value(),
|
||||
"Too many persistent handlers"); // Add a slot map if so
|
||||
{
|
||||
std::unique_lock lock{m_lock};
|
||||
persistent_handler.emplace(handler);
|
||||
}
|
||||
|
||||
std::unique_lock lock{m_lock};
|
||||
persistent_handler.emplace(handler);
|
||||
}
|
||||
|
||||
void Unregister() {
|
||||
|
@ -50,20 +49,19 @@ struct IrqController {
|
|||
}
|
||||
|
||||
void Signal(InterruptId irq) {
|
||||
std::unique_lock lock{m_lock};
|
||||
|
||||
LOG_TRACE(Core, "IRQ signaled: {}", magic_enum::enum_name(irq));
|
||||
{
|
||||
std::unique_lock lock{m_lock};
|
||||
|
||||
if (persistent_handler) {
|
||||
persistent_handler.value()(irq);
|
||||
}
|
||||
if (persistent_handler) {
|
||||
persistent_handler.value()(irq);
|
||||
}
|
||||
|
||||
while (!one_time_subscribers.empty()) {
|
||||
const auto& h = one_time_subscribers.front();
|
||||
h(irq);
|
||||
while (!one_time_subscribers.empty()) {
|
||||
const auto& h = one_time_subscribers.front();
|
||||
h(irq);
|
||||
|
||||
one_time_subscribers.pop();
|
||||
}
|
||||
one_time_subscribers.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue