2009-05-15 22:03:19 +02:00
|
|
|
#include <fat.h>
|
2009-05-19 02:46:14 +02:00
|
|
|
#include <sys/dir.h>
|
2009-06-01 17:50:18 +02:00
|
|
|
#include <sys/iosupport.h>
|
2009-05-15 22:03:19 +02:00
|
|
|
#include <ogc/lwp_watchdog.h>
|
|
|
|
#include <ogc/mutex.h>
|
2009-05-19 02:46:14 +02:00
|
|
|
#include <ogc/system.h>
|
2009-05-15 22:03:19 +02:00
|
|
|
#include <ogc/usbstorage.h>
|
|
|
|
#include <sdcard/wiisd_io.h>
|
|
|
|
|
2009-06-01 19:50:42 +02:00
|
|
|
//these are the only stable and speed is good
|
|
|
|
#define CACHE 32
|
|
|
|
#define SECTORS 128
|
2009-05-15 22:03:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
int USBDevice_Init()
|
|
|
|
{
|
2009-06-01 19:50:42 +02:00
|
|
|
return 0;
|
2009-06-01 17:50:18 +02:00
|
|
|
//closing all open Files write back the cache and then shutdown em!
|
|
|
|
fatUnmount("USB:/");
|
|
|
|
//right now only mounts first partition
|
|
|
|
if (fatMount("USB", &__io_usbstorage, 0, CACHE, SECTORS)) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return -1;
|
2009-05-15 22:03:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void USBDevice_deInit()
|
|
|
|
{
|
2009-06-01 19:50:42 +02:00
|
|
|
return;
|
2009-06-01 17:50:18 +02:00
|
|
|
//closing all open Files write back the cache and then shutdown em!
|
|
|
|
fatUnmount("USB:/");
|
2009-05-15 22:03:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int isSdInserted()
|
|
|
|
{
|
|
|
|
return __io_wiisd.isInserted();
|
|
|
|
}
|
|
|
|
|
|
|
|
int SDCard_Init()
|
|
|
|
{
|
2009-06-01 17:50:18 +02:00
|
|
|
//closing all open Files write back the cache and then shutdown em!
|
|
|
|
fatUnmount("SD:/");
|
|
|
|
//right now only mounts first partition
|
|
|
|
if (fatMount("SD", &__io_wiisd, 0, CACHE, SECTORS))
|
|
|
|
return 1;
|
|
|
|
return -1;
|
2009-05-15 22:03:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void SDCard_deInit()
|
|
|
|
{
|
2009-06-01 17:50:18 +02:00
|
|
|
//closing all open Files write back the cache and then shutdown em!
|
|
|
|
fatUnmount("SD:/");
|
2009-05-15 22:03:19 +02:00
|
|
|
}
|