diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-07-19 07:14:46 -0400 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-08-04 21:14:20 -0400 |
commit | 1146049de0c56d5be14001abc6c2afa4e7ebb132 (patch) | |
tree | 217e9cd76600814a6003c6151d33878f486b7751 /src/yuzu/main.cpp | |
parent | 142930e60929daedebded1b83066a7e7edcf0af5 (diff) |
main: Fix Open Save/Mod Locations for installed titles
Previously NAND/SDMC installed titles would open device saves when they are supposed to be user saves. This is due to the control nca not being read and thus returns 0 for both GetDefaultNormalSaveSize() and GetDeviceSaveDataSize(). Fix this by utilizing the patch manager to read the control nca.
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 592993c363..f711a337fc 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1239,20 +1239,18 @@ void GMainWindow::OnGameListLoadFile(QString game_path) { BootGame(game_path); } -void GMainWindow::OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path) { +void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target, + const std::string& game_path) { std::string path; QString open_target; + FileSys::PatchManager pm{program_id}; + const auto control = pm.GetControlMetadata(); const auto v_file = Core::GetGameFileFromPath(vfs, game_path); const auto loader = Loader::GetLoader(v_file); - FileSys::NACP control{}; - u64 program_id{}; - loader->ReadControlData(control); - loader->ReadProgramId(program_id); - - const bool has_user_save{control.GetDefaultNormalSaveSize() > 0}; - const bool has_device_save{control.GetDeviceSaveDataSize() > 0}; + const bool has_user_save{control.first->GetDefaultNormalSaveSize() > 0}; + const bool has_device_save{control.first->GetDeviceSaveDataSize() > 0}; ASSERT_MSG(has_user_save != has_device_save, "Game uses both user and device savedata?"); |