Wii/GameCube: Fix broken due to last commit, and respond to wiit shutdown signal

This commit is contained in:
UnknownShadow200 2023-07-29 10:26:25 +10:00
parent c47f48d187
commit d43dbefab4
2 changed files with 13 additions and 5 deletions

View File

@ -637,9 +637,8 @@ static void AppendDevice(cc_string* path, char* cwd) {
int deviceEnd = String_IndexOf(&cwd_, ':');
if (deviceEnd >= 0) {
cc_string dev = String_UNSAFE_Substring(&cwd_, 0, deviceEnd);
// e.g. "card0:/" becomes "card0"
String_Append(path, &dev);
String_AppendAll(path, cwd, deviceEnd);
} else {
String_AppendConst(path, "sd");
}

View File

@ -16,8 +16,17 @@
static void* xfb;
static GXRModeObj* rmode;
void* Window_XFB;
static void OnPowerOff(void) {
Event_RaiseVoid(&WindowEvents.Closing);
WindowInfo.Exists = false;
}
void Window_Init(void) {
void Window_Init(void) {
// TODO: SYS_SetResetCallback(reload); too? not sure how reset differs on GC/WII
#if defined HW_RVL
SYS_SetPowerCallback(OnPowerOff);
#endif
// Initialise the video system
VIDEO_Init();
@ -81,6 +90,7 @@ void Window_Close(void) {
/* TODO implement */
}
static void HandlePADInput(void) {
PADStatus pads[4];
PAD_Read(pads);
@ -356,5 +366,4 @@ void Window_DisableRawMouse(void) {
RegrabMouse();
Input_RawMode = false;
}
#endif
#endif