mirror of
https://github.com/Ryujinx-NX/Ryujinx.git
synced 2024-11-14 21:17:43 -07:00
Implement OpenReadOnlySaveDataFileSystem (#748)
This commit is contained in:
parent
edafce57be
commit
cbbbf175fb
@ -109,14 +109,21 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
|
||||
// OpenSaveDataFileSystem(u8 save_data_space_id, nn::fssrv::sf::SaveStruct saveStruct) -> object<nn::fssrv::sf::IFileSystem> saveDataFs
|
||||
public ResultCode OpenSaveDataFileSystem(ServiceCtx context)
|
||||
{
|
||||
return LoadSaveDataFileSystem(context);
|
||||
return LoadSaveDataFileSystem(context, false);
|
||||
}
|
||||
|
||||
[Command(52)]
|
||||
// OpenSaveDataFileSystemBySystemSaveDataId(u8 save_data_space_id, nn::fssrv::sf::SaveStruct saveStruct) -> object<nn::fssrv::sf::IFileSystem> systemSaveDataFs
|
||||
public ResultCode OpenSaveDataFileSystemBySystemSaveDataId(ServiceCtx context)
|
||||
{
|
||||
return LoadSaveDataFileSystem(context);
|
||||
return LoadSaveDataFileSystem(context, false);
|
||||
}
|
||||
|
||||
[Command(53)]
|
||||
// OpenReadOnlySaveDataFileSystem(u8 save_data_space_id, nn::fssrv::sf::SaveStruct save_struct) -> object<nn::fssrv::sf::IFileSystem>
|
||||
public ResultCode OpenReadOnlySaveDataFileSystem(ServiceCtx context)
|
||||
{
|
||||
return LoadSaveDataFileSystem(context, true);
|
||||
}
|
||||
|
||||
[Command(200)]
|
||||
@ -221,7 +228,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
public ResultCode LoadSaveDataFileSystem(ServiceCtx context)
|
||||
public ResultCode LoadSaveDataFileSystem(ServiceCtx context, bool readOnly)
|
||||
{
|
||||
SaveSpaceId saveSpaceId = (SaveSpaceId)context.RequestData.ReadInt64();
|
||||
|
||||
@ -237,7 +244,12 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
|
||||
try
|
||||
{
|
||||
LocalFileSystem fileSystem = new LocalFileSystem(savePath);
|
||||
DirectorySaveDataFileSystem saveFileSystem = new DirectorySaveDataFileSystem(fileSystem);
|
||||
LibHac.Fs.IFileSystem saveFileSystem = new DirectorySaveDataFileSystem(fileSystem);
|
||||
|
||||
if (readOnly)
|
||||
{
|
||||
saveFileSystem = new ReadOnlyFileSystem(saveFileSystem);
|
||||
}
|
||||
|
||||
MakeObject(context, new IFileSystem(saveFileSystem));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user