mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-06 14:48:17 +01:00
Add FSMountSource struct, use filesystem structs in devoptab
This commit is contained in:
parent
e8067e8754
commit
0d4fe1f052
@ -31,6 +31,7 @@ typedef struct FSClient FSClient;
|
||||
typedef struct FSDirectoryEntry FSDirectoryEntry;
|
||||
typedef struct FSStat FSStat;
|
||||
typedef struct FSStateChangeInfo FSStateChangeInfo;
|
||||
typedef struct FSMountSource FSMountSource;
|
||||
|
||||
typedef enum FSStatus
|
||||
{
|
||||
@ -189,6 +190,12 @@ struct FSDirectoryEntry
|
||||
CHECK_OFFSET(FSDirectoryEntry, 0x64, name);
|
||||
CHECK_SIZE(FSDirectoryEntry, 0x164);
|
||||
|
||||
struct FSMountSource
|
||||
{
|
||||
UNKNOWN(0x300);
|
||||
};
|
||||
CHECK_SIZE(FSMountSource, 0x300);
|
||||
|
||||
FSStatus
|
||||
fsDevInit();
|
||||
|
||||
@ -548,13 +555,13 @@ FSStatus
|
||||
FSGetMountSource(FSClient *client,
|
||||
FSCmdBlock *cmd,
|
||||
FSMountSourceType type,
|
||||
void *out,
|
||||
FSMountSource *out,
|
||||
uint32_t flags);
|
||||
|
||||
FSStatus
|
||||
FSMount(FSClient *client,
|
||||
FSCmdBlock *cmd,
|
||||
void *source,
|
||||
FSMountSource *source,
|
||||
const char *target,
|
||||
uint32_t bytes,
|
||||
uint32_t flags);
|
||||
|
@ -90,8 +90,8 @@ fs_devoptab =
|
||||
};
|
||||
|
||||
/* FS structs */
|
||||
void *fsClient;
|
||||
void *fsCmd;
|
||||
FSClient *fsClient;
|
||||
FSCmdBlock *fsCmd;
|
||||
|
||||
static bool fsInitialised = false;
|
||||
|
||||
@ -103,9 +103,9 @@ FSStatus fsDevInit(void)
|
||||
if(fsInitialised)
|
||||
return rc;
|
||||
|
||||
fsClient = memalign(0x20, 0x1700);
|
||||
fsCmd = memalign(0x20, 0xA80);
|
||||
u8 mountSource[0x300];
|
||||
fsClient = memalign(0x20, sizeof(FSClient));
|
||||
fsCmd = memalign(0x20, sizeof(FSCmdBlock));
|
||||
FSMountSource mountSource;
|
||||
char mountPath[0x80];
|
||||
char workDir[0x83];
|
||||
|
||||
@ -130,11 +130,11 @@ FSStatus fsDevInit(void)
|
||||
fsInitialised = true;
|
||||
|
||||
// Mount the SD card
|
||||
rc = FSGetMountSource(fsClient, fsCmd, FS_MOUNT_SOURCE_SD, (void*)mountSource, -1);
|
||||
rc = FSGetMountSource(fsClient, fsCmd, FS_MOUNT_SOURCE_SD, &mountSource, -1);
|
||||
if(rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = FSMount(fsClient, fsCmd, (void*)mountSource, mountPath, 0x80, -1);
|
||||
rc = FSMount(fsClient, fsCmd, &mountSource, mountPath, 0x80, -1);
|
||||
if(rc >= 0)
|
||||
{
|
||||
// chdir to SD root for general use
|
||||
|
Loading…
Reference in New Issue
Block a user