mirror of
https://github.com/fail0verflow/mini.git
synced 2024-09-29 18:38:56 +02:00
detect shutdown from GameCube mode; pass through to the system menu
to let it shut the system down instead of launching the ccat UI
This commit is contained in:
parent
bfc3d0b3b7
commit
8daf6db9ac
22
main.c
22
main.c
@ -73,18 +73,24 @@ u32 _main(void *base)
|
|||||||
gecko_printf("Initializing IPC...\n");
|
gecko_printf("Initializing IPC...\n");
|
||||||
ipc_initialize();
|
ipc_initialize();
|
||||||
|
|
||||||
gecko_printf("Initializing SDHC...\n");
|
|
||||||
sdhc_init();
|
|
||||||
|
|
||||||
gecko_printf("Mounting SD...\n");
|
|
||||||
fres = f_mount(0, &fatfs);
|
|
||||||
|
|
||||||
if (read32(0x0d800190) & 2) {
|
if (read32(0x0d800190) & 2) {
|
||||||
gecko_printf("GameCube compatibility mode detected...\n");
|
gecko_printf("GameCube compatibility mode detected...\n");
|
||||||
vector = boot2_run(1, 0x101);
|
vector = boot2_run(1, 0x101);
|
||||||
goto shutdown;
|
goto shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (read32(0x3130) == 0xFFFFFFFF) {
|
||||||
|
gecko_printf("GameCube shutdown detected, bypassing.\n");
|
||||||
|
vector = boot2_run(1,2);
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
gecko_printf("Initializing SDHC...\n");
|
||||||
|
sdhc_init();
|
||||||
|
|
||||||
|
gecko_printf("Mounting SD...\n");
|
||||||
|
fres = f_mount(0, &fatfs);
|
||||||
|
|
||||||
if(fres != FR_OK) {
|
if(fres != FR_OK) {
|
||||||
gecko_printf("Error %d while trying to mount SD\n", fres);
|
gecko_printf("Error %d while trying to mount SD\n", fres);
|
||||||
panic2(0, PANIC_MOUNT);
|
panic2(0, PANIC_MOUNT);
|
||||||
@ -95,7 +101,9 @@ u32 _main(void *base)
|
|||||||
res = powerpc_boot_file(PPC_BOOT_FILE);
|
res = powerpc_boot_file(PPC_BOOT_FILE);
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
gecko_printf("Failed to boot PPC: %d\n", res);
|
gecko_printf("Failed to boot PPC: %d\n", res);
|
||||||
gecko_printf("Continuing anyway\n");
|
gecko_printf("booting system menu\n");
|
||||||
|
vector = boot2_run(1,2);
|
||||||
|
goto shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
gecko_printf("Going into IPC mainloop...\n");
|
gecko_printf("Going into IPC mainloop...\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user