aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2020-11-24 20:45:23 +0100
committerGitHub <noreply@github.com>2020-11-24 20:45:23 +0100
commit44c1f16280de38239254bc0d0bf312c1c8e14e0b (patch)
tree0c16aae51502c1c7e9e50b2e8bb88b40439c4b79 /Ryujinx.HLE/HOS/Services
parentfd0b9d192612d67036297fe276f1cd68343c977b (diff)
am: Fix GetSaveDataSize stub (#1748)
Diffstat (limited to 'Ryujinx.HLE/HOS/Services')
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs
index 413ea1bb..b9dfee30 100644
--- a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs
@@ -159,18 +159,19 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success;
}
- // GetSaveDataSize(u8, nn::account::Uid) -> (u64, u64)
[Command(26)] // 3.0.0+
+ // GetSaveDataSize(u8 save_data_type, nn::account::Uid) -> (u64 save_size, u64 journal_size)
public ResultCode GetSaveDataSize(ServiceCtx context)
{
- SaveDataType saveDataType = (SaveDataType)context.RequestData.ReadByte();
+ SaveDataType saveDataType = (SaveDataType)context.RequestData.ReadUInt64();
+ Uid userId = context.RequestData.ReadStruct<AccountUid>().ToLibHacUid();
- context.RequestData.BaseStream.Seek(7, System.IO.SeekOrigin.Current);
+ // NOTE: Service calls nn::fs::FindSaveDataWithFilter with SaveDataType = 1 hardcoded.
+ // Then it calls nn::fs::GetSaveDataAvailableSize and nn::fs::GetSaveDataJournalSize to get the sizes.
+ // Since LibHac currently doesn't support the 2 last methods, we can hardcode the values to 200mb.
- Uid userId = context.RequestData.ReadStruct<AccountUid>().ToLibHacUid();
-
- // TODO: We return a size of 2GB as we use a directory based save system. This should be enough for most of the games.
- context.ResponseData.Write(2000000000u);
+ context.ResponseData.Write((long)200000000);
+ context.ResponseData.Write((long)200000000);
Logger.Stub?.PrintStub(LogClass.ServiceAm, new { saveDataType, userId });