mirror of
https://github.com/mogzol/sharpii.git
synced 2024-11-13 06:05:05 +01:00
bc65416cf7
- You can now download an IOS with -ios # in NUSD - Downloaded IOS wads are now named like so: IOS##-64-####.wad - Under certain conditions, when downloading a wad with NUS, it will not be saved in a folder, just as the WAD (see ReadMe) - If missing dll's are detected (WadInstaller or libWiiSharp), Sharpii will ask to download them, if they are required. - You can now use a .dol file instead of a .wad with the '-dol' in the WAD editor/packer - Probably a few other little things I have forgotten - Even more code cleanup and bug fixes
58 lines
964 B
C
58 lines
964 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <ogcsys.h>
|
|
|
|
#include "fat.h"
|
|
|
|
|
|
s32 Fat_Mount(fatDevice *dev)
|
|
{
|
|
s32 ret;
|
|
|
|
/* Initialize interface */
|
|
ret = dev->interface->startup();
|
|
if (!ret)
|
|
return -1;
|
|
|
|
/* Mount device */
|
|
ret = fatMountSimple(dev->mount, dev->interface);
|
|
if (!ret)
|
|
return -1;
|
|
|
|
return 0;
|
|
}
|
|
|
|
void Fat_Unmount(fatDevice *dev)
|
|
{
|
|
/* Unmount device */
|
|
fatUnmount(dev->mount);
|
|
|
|
/* Shutdown interface */
|
|
dev->interface->shutdown();
|
|
}
|
|
|
|
char *Fat_ToFilename(const char *filename)
|
|
{
|
|
static char buffer[128];
|
|
|
|
u32 cnt, idx, len;
|
|
|
|
/* Clear buffer */
|
|
memset(buffer, 0, sizeof(buffer));
|
|
|
|
/* Get filename length */
|
|
len = strlen(filename);
|
|
|
|
for (cnt = idx = 0; idx < len; idx++) {
|
|
char c = filename[idx];
|
|
|
|
/* Valid characters */
|
|
if ( (c >= '#' && c <= ')') || (c >= '-' && c <= '.') ||
|
|
(c >= '0' && c <= '9') || (c >= 'A' && c <= 'z') ||
|
|
(c >= 'a' && c <= 'z') || (c == '!') )
|
|
buffer[cnt++] = c;
|
|
}
|
|
|
|
return buffer;
|
|
}
|