Add functions used in SCI lib (#211)

* Add functions used in SCI lib

* fix for older code using FSStateChangeInfo
just a typedef `typedef struct FSStateChangeParams FSStateChangeInfo`
This commit is contained in:
Miku-666
2022-05-07 12:29:53 +02:00
committed by GitHub
parent f0da3d7236
commit 6e547c154f
3 changed files with 22 additions and 14 deletions

View File

@@ -35,7 +35,8 @@ typedef struct FSDirectoryEntry FSDirectoryEntry;
typedef struct FSMessage FSMessage;
typedef struct FSMountSource FSMountSource;
typedef struct FSStat FSStat;
typedef struct FSStateChangeInfo FSStateChangeInfo;
typedef struct FSStateChangeParams FSStateChangeParams;
typedef struct FSStateChangeParams FSStateChangeInfo;
typedef struct FSVolumeInfo FSVolumeInfo;
typedef enum FSErrorFlag
@@ -175,6 +176,7 @@ typedef enum FSMountSourceType
} FSMountSourceType;
typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
typedef void(*FSStateChangeCallback)(FSClient *, FSVolumeState, void *);
struct FSClient
{
@@ -214,11 +216,13 @@ WUT_CHECK_OFFSET(FSStat, 0x24, created);
WUT_CHECK_OFFSET(FSStat, 0x2C, modified);
WUT_CHECK_SIZE(FSStat, 0x64);
struct FSStateChangeInfo
struct FSStateChangeParams
{
WUT_UNKNOWN_BYTES(0xC);
FSStateChangeCallback callback;
void *param;
uint32_t unk_0x08;
};
WUT_CHECK_SIZE(FSStateChangeInfo, 0xC);
WUT_CHECK_SIZE(FSStateChangeParams, 0xC);
struct FSMessage
{
@@ -321,7 +325,7 @@ FSSetCmdPriority(FSCmdBlock *block,
void
FSSetStateChangeNotification(FSClient *client,
FSStateChangeInfo *info);
FSStateChangeParams *info);
FSStatus
FSGetCwd(FSClient *client,
@@ -690,6 +694,9 @@ FSRenameAsync(FSClient *client,
FSVolumeState
FSGetVolumeState(FSClient *client);
FSError
FSGetLastError(FSClient *client);
FSError
FSGetLastErrorCodeForViewer(FSClient *client);

View File

@@ -14,6 +14,7 @@ extern "C" {
#endif
typedef int32_t UCError;
typedef int32_t UCHandle;
typedef struct UCSysConfig UCSysConfig;
typedef struct UCAsyncParams UCAsyncParams;
@@ -135,41 +136,41 @@ WUT_CHECK_OFFSET(UCAsyncParams, 0x14, settings);
WUT_CHECK_OFFSET(UCAsyncParams, 0x18, vecs);
WUT_CHECK_SIZE(UCAsyncParams, 0x1C);
UCError
UCHandle
UCOpen();
UCError
UCClose(IOSHandle handle);
UCClose(UCHandle handle);
UCError
UCDeleteSysConfig(int32_t handle,
UCDeleteSysConfig(UCHandle handle,
uint32_t count,
UCSysConfig *settings);
UCError
UCDeleteSysConfigAsync(int32_t handle,
UCDeleteSysConfigAsync(UCHandle handle,
uint32_t count,
UCSysConfig *settings,
UCAsyncParams *asyncParams);
UCError
UCReadSysConfig(int32_t handle,
UCReadSysConfig(UCHandle handle,
uint32_t count,
UCSysConfig *settings);
UCError
UCReadSysConfigAsync(int32_t handle,
UCReadSysConfigAsync(UCHandle handle,
uint32_t count,
UCSysConfig *settings,
UCAsyncParams *asyncParams);
UCError
UCWriteSysConfig(int32_t handle,
UCWriteSysConfig(UCHandle handle,
uint32_t count,
UCSysConfig *settings);
UCError
UCWriteSysConfigAsync(int32_t handle,
UCWriteSysConfigAsync(UCHandle handle,
uint32_t count,
UCSysConfig *settings,
UCAsyncParams *asyncParams);

View File

@@ -109,7 +109,7 @@ GetParentalControlsSlotNo(void)
asm("GetParentalControlSlotNo__Q2_2nn3actFv");
nn::Result
GetParentalControlsSlotNoEx(void)
GetParentalControlsSlotNoEx(SlotNo *outSlotNo, SlotNo slot)
asm("GetParentalControlSlotNoEx__Q2_2nn3actFPUcUc");
PersistentId