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