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