From 43238e0a565e35fc34497b3fa2f1aa49b7e9b842 Mon Sep 17 00:00:00 2001 From: BoiledElectricity Date: Fri, 5 Jun 2026 19:37:49 -0400 Subject: [PATCH] [hle/fs] fix: handle Temporary/ProperSystem/SafeMode save spaces instead of ASSERT(false) OpenSaveDataFileSystem and OpenSaveDataFileSystemBySystemSaveDataId mapped the SaveDataSpaceId to a StorageId with a switch that fell into ASSERT(false) for Temporary, ProperSystem, and SafeMode. So any game that opens cache storage (SaveDataSpaceId::Temporary, TOTK being the obvious one) tripped the assert during save enumeration, before the game even finished loading, which made those titles completely unplayable. Nothing exceptional is going on with those spaces, they just were never mapped. Temporary is user-space scratch storage so it goes on user nand, and ProperSystem/SafeMode are system spaces so they go on system nand. The id only feeds the free-space reporter here, so these mappings are safe and just need to be sane. Fixes: https://github.com/eden-emulator/Issue-Reports/issues/368 --- .../hle/service/filesystem/fsp/fsp_srv.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index 0ee68c0332..78a1dac81b 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp @@ -284,9 +284,17 @@ Result FSP_SRV::OpenSaveDataFileSystem(OutInterface out_interface, id = FileSys::StorageId::NandSystem; break; case FileSys::SaveDataSpaceId::Temporary: + // ok this is definitely wrong. ASSERT(false) here just kills the whole game the first + // time it opens cache storage, and plenty of games do that (TOTK for one). there is + // user-space scratch storage so it belongs on user nand. map it, do not crash. + id = FileSys::StorageId::NandUser; + break; case FileSys::SaveDataSpaceId::ProperSystem: case FileSys::SaveDataSpaceId::SafeMode: - ASSERT(false); + // same deal for these two. they are system-level spaces so they go on system nand. + // way better than nuking the title over a save-space id we just did not list out. + id = FileSys::StorageId::NandSystem; + break; } *out_interface = @@ -324,9 +332,15 @@ Result FSP_SRV::OpenSaveDataFileSystemBySystemSaveDataId(OutInterface system nand. handled, not crashed. + id = FileSys::StorageId::NandSystem; + break; } *out_interface =