Fix plugin home menu event notification.

This commit is contained in:
PabloMK7 2023-07-23 17:43:50 +02:00 committed by TuxSH
parent 3ecce3fc3e
commit dd22a0cd93
2 changed files with 4 additions and 2 deletions

View File

@ -277,5 +277,5 @@ void MemoryBlock__ResetSwapSettings(void)
PluginHeader* MemoryBlock__GetMappedPluginHeader() {
MemoryBlock *memblock = &PluginLoaderCtx.memblock;
return memblock->isReady ? NULL : (PluginHeader*)memblock->memblock;
return memblock->isReady ? (PluginHeader*)memblock->memblock : NULL;
}

View File

@ -563,7 +563,9 @@ void PluginLoader__HandleKernelEvent(u32 notifId)
ctx->pluginIsSwapped = !ctx->pluginIsSwapped;
} else {
// Needed for compatibility with old plugins that don't expect the PLG_HOME events.
volatile PluginHeader* mappedHeader = PA_FROM_VA_PTR(MemoryBlock__GetMappedPluginHeader());
// Evades cache by using physical address.
volatile PluginHeader* mappedHeader = MemoryBlock__GetMappedPluginHeader();
mappedHeader = mappedHeader ? PA_FROM_VA_PTR(mappedHeader) : NULL;
bool doNotification = mappedHeader ? mappedHeader->notifyHomeEvent : false;
if (ctx->pluginIsHome)
{