mirror of
https://github.com/modmii/YAWM-ModMii-Edition.git
synced 2024-11-13 03:45:11 +01:00
- Disable Wii front buttons (Power + Reset) while installing / removing a title
This commit is contained in:
parent
31d2402d59
commit
384ffbd8a1
13
source/sys.c
13
source/sys.c
@ -13,16 +13,20 @@
|
||||
/* Variables */
|
||||
static const char certs_fs[] ATTRIBUTE_ALIGN(32) = "/sys/cert.sys";
|
||||
u32 boot2version;
|
||||
static bool gDisablePRButtons = false;
|
||||
|
||||
void __Sys_ResetCallback(__attribute__((unused)) u32 irq, __attribute__((unused)) void *ctx)
|
||||
{
|
||||
/* Reboot console */
|
||||
Sys_Reboot();
|
||||
if (!gDisablePRButtons)
|
||||
Sys_Reboot();
|
||||
}
|
||||
|
||||
void __Sys_PowerCallback(void)
|
||||
{
|
||||
/* Poweroff console */
|
||||
Sys_Shutdown();
|
||||
if (!gDisablePRButtons)
|
||||
Sys_Shutdown();
|
||||
}
|
||||
|
||||
bool isIOSstub(u8 ios_number)
|
||||
@ -186,3 +190,8 @@ s32 Sys_GetCerts(signed_blob **certs, u32 *len)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SetPRButtons(bool enabled)
|
||||
{
|
||||
gDisablePRButtons = !enabled;
|
||||
}
|
||||
|
@ -10,5 +10,6 @@ void Sys_Reboot(void);
|
||||
void Sys_Shutdown(void);
|
||||
void Sys_LoadMenu(void);
|
||||
s32 Sys_GetCerts(signed_blob **, u32 *);
|
||||
void SetPRButtons(bool enabled);
|
||||
|
||||
#endif
|
||||
|
@ -479,6 +479,7 @@ bool skipRegionSafetyCheck = false;
|
||||
|
||||
s32 Wad_Install(FILE *fp)
|
||||
{
|
||||
SetPRButtons(false);
|
||||
wadHeader *header = NULL;
|
||||
signed_blob *p_certs = NULL, *p_crl = NULL, *p_tik = NULL, *p_tmd = NULL;
|
||||
|
||||
@ -892,11 +893,13 @@ out:
|
||||
if (gForcedInstall)
|
||||
return Wad_Install(fp);
|
||||
|
||||
SetPRButtons(true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 Wad_Uninstall(FILE *fp)
|
||||
{
|
||||
SetPRButtons(false);
|
||||
wadHeader *header = NULL;
|
||||
tikview *viewData = NULL;
|
||||
|
||||
@ -1047,5 +1050,7 @@ s32 Wad_Uninstall(FILE *fp)
|
||||
out:
|
||||
/* Free memory */
|
||||
free(header);
|
||||
|
||||
SetPRButtons(true);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user