MCPcopy Create free account
hub / github.com/cemu-project/Cemu / InitVirtualMlcStorage

Function InitVirtualMlcStorage

src/Cafe/CafeSystem.cpp:1013–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1011 /* Virtual mlc storage */
1012
1013 void InitVirtualMlcStorage()
1014 {
1015 // starting with Cemu 1.27.0 /vol/storage_mlc01/ is virtualized, meaning that it doesn't point to one singular host os folder anymore
1016 // instead it now uses a more complex solution to source titles with various formats (folder, wud, wua) from the game paths and host mlc path
1017
1018 // todo - mount /vol/storage_mlc01/ with base priority to the host mlc?
1019
1020 // since mounting titles is an expensive operation we have to avoid mounting all titles at once
1021 // only the current title gets mounted immediately, every other title should be mounted lazily on first access
1022
1023 // always mount the currently running title
1024 if (sGameInfo_ForegroundTitle.GetBase().IsValid())
1025 MlcStorageMountTitle(sGameInfo_ForegroundTitle.GetBase());
1026 if (sGameInfo_ForegroundTitle.GetUpdate().IsValid())
1027 MlcStorageMountTitle(sGameInfo_ForegroundTitle.GetUpdate());
1028 for(auto& it : sGameInfo_ForegroundTitle.GetAOC())
1029 MlcStorageMountTitle(it);
1030
1031 // setup system for lazy-mounting of other known titles
1032 // todo - how to handle this?
1033 // when something iterates /vol/storage_mlc01/usr/title/ we can use a fake FS device mounted to /vol/storage_mlc01/usr/title and sys/title that simulates the title id folders
1034 // the same device would then have to mount titles when their folders are actually accessed
1035 }
1036
1037 // /vol/storage_mlc01/<usr or sys>/title/<titleIdHigh>/<titleIdLow>
1038 std::string GetMlcStoragePath(TitleId titleId)

Callers 2

PrepareForegroundTitleFunction · 0.85

Calls 3

MlcStorageMountTitleFunction · 0.85
GetAOCMethod · 0.80
IsValidMethod · 0.45

Tested by

no test coverage detected