fix: implement DeleteCacheStorage stub to prevent TOTK crashes

- Add stubbed DeleteCacheStorage function to FSP_SRV service
- Return success instead of causing assertion failure
- Prevents userspace PANIC when games attempt to delete cache storage

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-10-22 13:25:16 +10:00
parent 7107f4cfd7
commit 8cc5aa143f
2 changed files with 8 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ FSP_SRV::FSP_SRV(Core::System& system_)
{30, D<&FSP_SRV::OpenGameCardStorage>, "OpenGameCardStorage"},
{31, D<&FSP_SRV::OpenGameCardFileSystem>, "OpenGameCardFileSystem"},
{32, D<&FSP_SRV::ExtendSaveDataFileSystem>, "ExtendSaveDataFileSystem"},
{33, nullptr, "DeleteCacheStorage"},
{33, D<&FSP_SRV::DeleteCacheStorage>, "DeleteCacheStorage"},
{34, D<&FSP_SRV::GetCacheStorageSize>, "GetCacheStorageSize"},
{35, nullptr, "CreateSaveDataFileSystemByHashSalt"},
{36, nullptr, "OpenHostFileSystemWithOption"},
@@ -606,6 +606,12 @@ Result FSP_SRV::ExtendSaveDataFileSystem(FileSys::SaveDataSpaceId space_id, u64
R_SUCCEED();
}
Result FSP_SRV::DeleteCacheStorage(u16 index) {
LOG_WARNING(Service_FS, "(STUBBED) called, index={}", index);
// Cache storage deletion is not implemented, but we return success to prevent crashes
R_SUCCEED();
}
Result FSP_SRV::GetCacheStorageSize(s32 index, Out<s64> out_data_size, Out<s64> out_journal_size) {
LOG_WARNING(Service_FS, "(STUBBED) called with index={}", index);

View File

@@ -110,6 +110,7 @@ private:
Result OpenMultiCommitManager(OutInterface<IMultiCommitManager> out_interface);
Result ExtendSaveDataFileSystem(FileSys::SaveDataSpaceId space_id, u64 save_data_id,
s64 available_size, s64 journal_size);
Result DeleteCacheStorage(u16 index);
Result GetCacheStorageSize(s32 index, Out<s64> out_data_size, Out<s64> out_journal_size);
Result OpenDeviceOperator(OutInterface<IDeviceOperator> out_interface);
Result OpenSdCardDetectionEventNotifier(OutInterface<IEventNotifier> out_interface);