mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-09 04:38:50 -04:00
feat(fs): Cross-Compatible Emulator Save Pathing w/ Custom Save Paths
Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
@@ -252,9 +252,11 @@ Result FSP_SRV::CreateSaveDataFileSystemBySystemSaveDataId(
|
|||||||
Result FSP_SRV::OpenSaveDataFileSystem(OutInterface<IFileSystem> out_interface,
|
Result FSP_SRV::OpenSaveDataFileSystem(OutInterface<IFileSystem> out_interface,
|
||||||
FileSys::SaveDataSpaceId space_id,
|
FileSys::SaveDataSpaceId space_id,
|
||||||
FileSys::SaveDataAttribute attribute) {
|
FileSys::SaveDataAttribute attribute) {
|
||||||
LOG_INFO(Service_FS, "called.");
|
LOG_INFO(Service_FS, "called, space_id={:02X}, program_id={:016X}",
|
||||||
|
static_cast<u8>(space_id), attribute.program_id);
|
||||||
|
|
||||||
FileSys::VirtualDir dir{};
|
FileSys::VirtualDir dir{};
|
||||||
|
// This triggers the 'Smart Pull' (Ryujinx -> Citron) in savedata_factory.cpp
|
||||||
R_TRY(save_data_controller->OpenSaveData(&dir, space_id, attribute));
|
R_TRY(save_data_controller->OpenSaveData(&dir, space_id, attribute));
|
||||||
|
|
||||||
FileSys::StorageId id{};
|
FileSys::StorageId id{};
|
||||||
@@ -267,19 +269,15 @@ Result FSP_SRV::OpenSaveDataFileSystem(OutInterface<IFileSystem> out_interface,
|
|||||||
id = FileSys::StorageId::SdCard;
|
id = FileSys::StorageId::SdCard;
|
||||||
break;
|
break;
|
||||||
case FileSys::SaveDataSpaceId::System:
|
case FileSys::SaveDataSpaceId::System:
|
||||||
id = FileSys::StorageId::NandSystem;
|
|
||||||
break;
|
|
||||||
case FileSys::SaveDataSpaceId::Temporary:
|
case FileSys::SaveDataSpaceId::Temporary:
|
||||||
id = FileSys::StorageId::NandSystem;
|
|
||||||
break;
|
|
||||||
case FileSys::SaveDataSpaceId::ProperSystem:
|
case FileSys::SaveDataSpaceId::ProperSystem:
|
||||||
id = FileSys::StorageId::NandSystem;
|
|
||||||
break;
|
|
||||||
case FileSys::SaveDataSpaceId::SafeMode:
|
case FileSys::SaveDataSpaceId::SafeMode:
|
||||||
id = FileSys::StorageId::NandSystem;
|
id = FileSys::StorageId::NandSystem;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wrap the directory in the IFileSystem interface.
|
||||||
|
// We pass 'save_data_controller->GetFactory()' so the Commit function can find the Mirror.
|
||||||
*out_interface = std::make_shared<IFileSystem>(
|
*out_interface = std::make_shared<IFileSystem>(
|
||||||
system, std::move(dir), SizeGetter::FromStorageId(fsc, id),
|
system, std::move(dir), SizeGetter::FromStorageId(fsc, id),
|
||||||
save_data_controller->GetFactory(), space_id, attribute);
|
save_data_controller->GetFactory(), space_id, attribute);
|
||||||
|
|||||||
Reference in New Issue
Block a user