mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2024-11-05 18:35:08 +01:00
[Loader] Check the current titleid before calling hooks.
This commit is contained in:
parent
720762d891
commit
a8d1960dc3
@ -2,6 +2,7 @@
|
||||
#include "myutils/overlay_helper.h"
|
||||
replacement_data_t gbl_replacement_data __attribute__((section(".data")));
|
||||
u8 gAppStatus __attribute__((section(".data"))) = 0;
|
||||
u64 gGameTitleID __attribute__((section(".data"))) = 0;
|
||||
volatile u8 gSDInitDone __attribute__((section(".data"))) = 0;
|
||||
|
||||
void * ntfs_mounts __attribute__((section(".data"))) = NULL;
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
extern replacement_data_t gbl_replacement_data;
|
||||
extern u8 gAppStatus;
|
||||
extern u64 gGameTitleID;
|
||||
extern volatile u8 gSDInitDone;
|
||||
|
||||
|
||||
|
@ -86,6 +86,7 @@ extern "C" int Menu_Main(int argc, char **argv) {
|
||||
//setup_os_exceptions();
|
||||
|
||||
Init();
|
||||
gGameTitleID = OSGetTitleID();
|
||||
|
||||
s32 result = 0;
|
||||
|
||||
|
@ -7,18 +7,20 @@
|
||||
#include "utils.h"
|
||||
|
||||
DECL(void, __PPCExit, void) {
|
||||
DEBUG_FUNCTION_LINE("__PPCExit\n");
|
||||
|
||||
CallHook(WUPS_LOADER_HOOK_ENDING_APPLICATION);
|
||||
|
||||
DeInit();
|
||||
// Only continue if we are in the "right" application.
|
||||
if(OSGetTitleID() == gGameTitleID) {
|
||||
DEBUG_FUNCTION_LINE("__PPCExit\n");
|
||||
CallHook(WUPS_LOADER_HOOK_ENDING_APPLICATION);
|
||||
DeInit();
|
||||
}
|
||||
|
||||
real___PPCExit();
|
||||
}
|
||||
|
||||
DECL(u32, ProcUIProcessMessages, u32 u) {
|
||||
u32 res = real_ProcUIProcessMessages(u);
|
||||
if(res != gAppStatus) {
|
||||
// Only continue if we are in the "right" application.
|
||||
if(res != gAppStatus && OSGetTitleID() == gGameTitleID) {
|
||||
DEBUG_FUNCTION_LINE("App status changed from %d to %d \n",gAppStatus,res);
|
||||
gAppStatus = res;
|
||||
CallHook(WUPS_LOADER_HOOK_APP_STATUS_CHANGED);
|
||||
|
Loading…
Reference in New Issue
Block a user