Skip to content

Commit 5858a36

Browse files
committed
Fix compile errors with latest libogc2
Fix unmounting FAT devices on Wii
1 parent 378aa20 commit 5858a36

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

gx/fileio/file_load.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ static u8 dvdInited = 0;
8282
static u8 dvdMounted = 0;
8383

8484
#ifndef HW_RVL
85-
static bool dvdStartup()
85+
static bool dvdStartup(DISC_INTERFACE *disc)
8686
{
8787
DVD_Mount();
8888
return true;
8989
}
9090

91-
static bool dvdIsInserted()
91+
static bool dvdIsInserted(DISC_INTERFACE *disc)
9292
{
9393
return true;
9494
}
@@ -112,8 +112,8 @@ static int MountDVD(void)
112112
DVD_Init();
113113

114114
/* patch libogc DVD interface which appears to be broken on Gamecube */
115-
dvd->startup = (FN_MEDIUM_STARTUP)dvdStartup;
116-
dvd->isInserted = (FN_MEDIUM_ISINSERTED)dvdIsInserted;
115+
*(FN_MEDIUM_STARTUP *)&dvd->startup = dvdStartup;
116+
*(FN_MEDIUM_ISINSERTED *)&dvd->isInserted = dvdIsInserted;
117117
#endif
118118
dvdInited = 1;
119119
}
@@ -127,7 +127,11 @@ static int MountDVD(void)
127127
}
128128

129129
/* check if disc is found */
130+
#ifdef HW_RVL
130131
if(!dvd->isInserted())
132+
#else
133+
if(!dvd->isInserted(dvd))
134+
#endif
131135
{
132136
GUI_WaitPrompt("Error","No Disc inserted !");
133137
return 0;

gx/main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ void shutdown(void)
319319
#ifdef HW_RVL
320320
/* unmount all devices */
321321
ISO9660_Unmount("dvd:");
322-
fatUnmount("sd");
323-
fatUnmount("usb");
322+
fatUnmount("sd:");
323+
fatUnmount("usb:");
324324

325325
/* shutdown all devices */
326326
DI_Close();

0 commit comments

Comments
 (0)