mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-05 02:55:07 +01:00
e9f9882edc
*Changed CACHE and SECTOR size for SD Cards what increases the loading speeds if anyone's cards get compatibility problems now with saving or other stuff report as issue and it will be reverted)
58 lines
1.0 KiB
C
58 lines
1.0 KiB
C
#include <fat.h>
|
|
#include <sys/dir.h>
|
|
#include <ogc/lwp_watchdog.h>
|
|
#include <ogc/mutex.h>
|
|
#include <ogc/system.h>
|
|
#include <ogc/usbstorage.h>
|
|
#include <sdcard/wiisd_io.h>
|
|
|
|
#define CACHE 32
|
|
#define SECTORS 128
|
|
|
|
|
|
int USBDevice_Init()
|
|
{
|
|
//right now only mounts first partition and only under IOS36
|
|
__io_usbstorage.startup();
|
|
|
|
if (fatMount("USB", &__io_usbstorage, 0, CACHE, SECTORS)) {
|
|
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, SECTORS)) {
|
|
return 1;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
void SDCard_deInit()
|
|
{
|
|
//First unmount all the devs...
|
|
fatUnmount("SD:/");
|
|
//...and then shutdown em!
|
|
__io_wiisd.shutdown();
|
|
}
|