Merge branch 'master' of https://github.com/switchbrew/libnx into dev

This commit is contained in:
shchmue 2020-03-23 13:20:11 -06:00
commit 2bbcfffc3c
5 changed files with 46 additions and 6 deletions

View File

@ -18,9 +18,15 @@ typedef enum {
/// Type of keyboard. /// Type of keyboard.
typedef enum { typedef enum {
SwkbdType_Normal = 0, ///< Normal keyboard. SwkbdType_Normal = 0, ///< Normal keyboard.
SwkbdType_NumPad = 1, ///< Number pad. The buttons at the bottom left/right are only available when they're set by \ref swkbdConfigSetLeftOptionalSymbolKey / \ref swkbdConfigSetRightOptionalSymbolKey. SwkbdType_NumPad = 1, ///< Number pad. The buttons at the bottom left/right are only available when they're set by \ref swkbdConfigSetLeftOptionalSymbolKey / \ref swkbdConfigSetRightOptionalSymbolKey.
SwkbdType_QWERTY = 2, ///< QWERTY (and variants) keyboard only. SwkbdType_QWERTY = 2, ///< QWERTY (and variants) keyboard only.
SwkbdType_Unknown3 = 3, ///< The same as SwkbdType_Normal keyboard.
SwkbdType_Latin = 4, ///< All Latin like languages keyboard only (without CJK keyboard).
SwkbdType_ZhHans = 5, ///< Chinese Simplified keyboard only.
SwkbdType_ZhHant = 6, ///< Chinese Traditional keyboard only.
SwkbdType_Korean = 7, ///< Korean keyboard only.
SwkbdType_All = 8, ///< All language keyboards.
} SwkbdType; } SwkbdType;
/// Bitmask for SwkbdArgCommon::keySetDisableBitmask. This disables keys on the keyboard when the corresponding bit(s) are set. /// Bitmask for SwkbdArgCommon::keySetDisableBitmask. This disables keys on the keyboard when the corresponding bit(s) are set.

View File

@ -33,6 +33,9 @@ Result fsdevMountSdmc(void);
/// Mounts the specified save data. /// Mounts the specified save data.
Result fsdevMountSaveData(const char *name, u64 application_id, AccountUid uid); Result fsdevMountSaveData(const char *name, u64 application_id, AccountUid uid);
/// Mounts the specified DeviceSaveData.
Result fsdevMountDeviceSaveData(const char *name, u64 application_id);
/// Mounts the specified system save data. /// Mounts the specified system save data.
Result fsdevMountSystemSaveData(const char *name, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid); Result fsdevMountSystemSaveData(const char *name, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid);

View File

@ -367,10 +367,14 @@ Result fsGetGlobalAccessLogMode(u32* out_mode);
Result fsCreate_SystemSaveDataWithOwner(FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid, u64 owner_id, s64 size, s64 journal_size, u32 flags); Result fsCreate_SystemSaveDataWithOwner(FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid, u64 owner_id, s64 size, s64 journal_size, u32 flags);
Result fsCreate_SystemSaveData(FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, s64 size, s64 journal_size, u32 flags); Result fsCreate_SystemSaveData(FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, s64 size, s64 journal_size, u32 flags);
/// Wrapper(s) for fsOpenSaveDataFileSystem. /// Wrapper for fsOpenSaveDataFileSystem.
/// See FsSave for program_id and uid. /// See \ref FsSaveDataAttribute for application_id and uid.
Result fsOpen_SaveData(FsFileSystem* out, u64 application_id, AccountUid uid); Result fsOpen_SaveData(FsFileSystem* out, u64 application_id, AccountUid uid);
/// Wrapper for fsOpenSaveDataFileSystem, for opening DeviceSaveData.
/// See \ref FsSaveDataAttribute for application_id.
Result fsOpen_DeviceSaveData(FsFileSystem* out, u64 application_id);
/// Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId. /// Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId.
/// WARNING: You can brick when writing to SystemSaveData, if the data is corrupted etc. /// WARNING: You can brick when writing to SystemSaveData, if the data is corrupted etc.
Result fsOpen_SystemSaveData(FsFileSystem* out, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid); Result fsOpen_SystemSaveData(FsFileSystem* out, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid);

View File

@ -465,6 +465,19 @@ Result fsdevMountSaveData(const char *name, u64 application_id, AccountUid uid)
return rc; return rc;
} }
Result fsdevMountDeviceSaveData(const char *name, u64 application_id)
{
FsFileSystem fs;
Result rc = fsOpen_DeviceSaveData(&fs, application_id);
if(R_SUCCEEDED(rc))
{
int ret = fsdevMountDevice(name, fs);
if(ret==-1)
rc = MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
}
return rc;
}
Result fsdevMountSystemSaveData(const char *name, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid) Result fsdevMountSystemSaveData(const char *name, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid)
{ {
FsFileSystem fs; FsFileSystem fs;

View File

@ -483,6 +483,10 @@ Result fsCreate_SystemSaveData(FsSaveDataSpaceId save_data_space_id, u64 system_
} }
// Wrapper(s) for fsOpenSaveDataFileSystem. // Wrapper(s) for fsOpenSaveDataFileSystem.
static Result _fsOpen_SaveDataFs(FsFileSystem* out, FsSaveDataAttribute *attr) {
return fsOpenSaveDataFileSystem(out, FsSaveDataSpaceId_User, attr);
}
Result fsOpen_SaveData(FsFileSystem* out, u64 application_id, AccountUid uid) { Result fsOpen_SaveData(FsFileSystem* out, u64 application_id, AccountUid uid) {
FsSaveDataAttribute attr; FsSaveDataAttribute attr;
@ -491,7 +495,17 @@ Result fsOpen_SaveData(FsFileSystem* out, u64 application_id, AccountUid uid) {
attr.uid = uid; attr.uid = uid;
attr.save_data_type = FsSaveDataType_Account; attr.save_data_type = FsSaveDataType_Account;
return fsOpenSaveDataFileSystem(out, FsSaveDataSpaceId_User, &attr); return _fsOpen_SaveDataFs(out, &attr);
}
Result fsOpen_DeviceSaveData(FsFileSystem* out, u64 application_id) {
FsSaveDataAttribute attr;
memset(&attr, 0, sizeof(attr));
attr.application_id = application_id;
attr.save_data_type = FsSaveDataType_Device;
return _fsOpen_SaveDataFs(out, &attr);
} }
Result fsOpen_SystemSaveData(FsFileSystem* out, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid) { Result fsOpen_SystemSaveData(FsFileSystem* out, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid) {