Skip to content

Commit

Permalink
Fix compile errors with latest libogc2
Browse files Browse the repository at this point in the history
Fix unmounting FAT devices on Wii
  • Loading branch information
Extrems committed Nov 15, 2024
1 parent 378aa20 commit 5858a36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions gx/fileio/file_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ static u8 dvdInited = 0;
static u8 dvdMounted = 0;

#ifndef HW_RVL
static bool dvdStartup()
static bool dvdStartup(DISC_INTERFACE *disc)
{
DVD_Mount();
return true;
}

static bool dvdIsInserted()
static bool dvdIsInserted(DISC_INTERFACE *disc)
{
return true;
}
Expand All @@ -112,8 +112,8 @@ static int MountDVD(void)
DVD_Init();

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

/* check if disc is found */
#ifdef HW_RVL
if(!dvd->isInserted())
#else
if(!dvd->isInserted(dvd))
#endif
{
GUI_WaitPrompt("Error","No Disc inserted !");
return 0;
Expand Down
4 changes: 2 additions & 2 deletions gx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ void shutdown(void)
#ifdef HW_RVL
/* unmount all devices */
ISO9660_Unmount("dvd:");
fatUnmount("sd");
fatUnmount("usb");
fatUnmount("sd:");
fatUnmount("usb:");

/* shutdown all devices */
DI_Close();
Expand Down

0 comments on commit 5858a36

Please sign in to comment.