usbloadergx/source/fatmounter.c
dimok321 feda5a7ba6 *Changed some functions.
*Fixed one bug that you couldnt get to FormatMenu
*Added USB functions, not yet implemented (they dont work under cIOS249/cIOS222, only under IOS36 (original). right now function only works if partition 1 is fat/fat32)
2009-05-15 20:03:19 +00:00

56 lines
1001 B
C

#include <fat.h>
#include <ogc/lwp_watchdog.h>
#include <ogc/mutex.h>
#include <ogc/usbstorage.h>
#include <sdcard/wiisd_io.h>
#include <sys/dir.h>
#define CACHE 8
int USBDevice_Init()
{
//right now only mounts first partition and only under IOS36
__io_usbstorage.startup();
if (fatMountSimple("USB", &__io_usbstorage, 0, CACHE)) {
return 1;
}
return -1;
}
void USBDevice_deInit()
{
//First unmount all the devs...
fatUnmount("USB");
//...and then shutdown em!
__io_usbstorage.shutdown();
}
int isSdInserted()
{
return __io_wiisd.isInserted();
}
int SDCard_Init()
{
//mount SD if inserted
__io_wiisd.startup();
if (!isSdInserted()){
return -1;
}
if (fatMount("SD", &__io_wiisd, 0, CACHE)) {
return 1;
}
return -1;
}
void SDCard_deInit()
{
//First unmount all the devs...
fatUnmount("SD");
//...and then shutdown em!
__io_wiisd.shutdown();
}