poweroff/reboot for Rosalina misc. menu
This commit is contained in:
parent
52a18831a7
commit
37eb21d297
@ -34,3 +34,5 @@ extern Menu miscellaneousMenu;
|
||||
void MiscellaneousMenu_SwitchBoot3dsxTargetTitle(void);
|
||||
void MiscellaneousMenu_ChangeMenuCombo(void);
|
||||
void MiscellaneousMenu_InputRedirection(void);
|
||||
void MiscellaneousMenu_PowerOff(void);
|
||||
void MiscellaneousMenu_Reboot(void);
|
||||
|
@ -36,11 +36,13 @@
|
||||
|
||||
Menu miscellaneousMenu = {
|
||||
"Miscellaneous options menu",
|
||||
.nbItems = 3,
|
||||
.nbItems = 5,
|
||||
{
|
||||
{ "Switch the hb. title to the current app.", METHOD, .method = &MiscellaneousMenu_SwitchBoot3dsxTargetTitle },
|
||||
{ "Change the menu combo", METHOD, .method = MiscellaneousMenu_ChangeMenuCombo },
|
||||
{ "Start InputRedirection", METHOD, .method = &MiscellaneousMenu_InputRedirection },
|
||||
{ "Power off", METHOD, .method = &MiscellaneousMenu_PowerOff },
|
||||
{ "Reboot", METHOD, .method = &MiscellaneousMenu_Reboot },
|
||||
}
|
||||
};
|
||||
|
||||
@ -259,3 +261,52 @@ void MiscellaneousMenu_InputRedirection(void)
|
||||
}
|
||||
while(!(waitInput() & BUTTON_B) && !terminationRequest);
|
||||
}
|
||||
|
||||
void MiscellaneousMenu_Reboot()
|
||||
{
|
||||
Draw_Lock();
|
||||
Draw_DrawString(10, 10, COLOR_TITLE, "Miscellaneous options menu");
|
||||
Draw_DrawString(10, 30, COLOR_WHITE, "Press A to reboot, press B to go back.");
|
||||
Draw_FlushFramebuffer();
|
||||
Draw_Unlock();
|
||||
|
||||
do
|
||||
{
|
||||
u32 pressed = waitInputWithTimeout(1000);
|
||||
|
||||
if(pressed & BUTTON_A)
|
||||
{
|
||||
svcKernelSetState(7);
|
||||
}
|
||||
else if(pressed & BUTTON_B)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
while(!terminationRequest);
|
||||
}
|
||||
|
||||
void MiscellaneousMenu_PowerOff() // Soft shutdown.
|
||||
{
|
||||
Draw_Lock();
|
||||
Draw_DrawString(10, 10, COLOR_TITLE, "Miscellaneous options menu");
|
||||
Draw_DrawString(10, 30, COLOR_WHITE, "Press A to power off, press B to go back.");
|
||||
Draw_FlushFramebuffer();
|
||||
Draw_Unlock();
|
||||
|
||||
do
|
||||
{
|
||||
u32 pressed = waitInputWithTimeout(1000);
|
||||
|
||||
if(pressed & BUTTON_A)
|
||||
{
|
||||
menuLeave();
|
||||
srvPublishToSubscriber(0x203, 0);
|
||||
}
|
||||
else if(pressed & BUTTON_B)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
while(!terminationRequest);
|
||||
}
|
Reference in New Issue
Block a user