aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-07-19 07:14:46 -0400
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-08-04 21:14:20 -0400
commit1146049de0c56d5be14001abc6c2afa4e7ebb132 (patch)
tree217e9cd76600814a6003c6151d33878f486b7751 /src/yuzu/main.cpp
parent142930e60929daedebded1b83066a7e7edcf0af5 (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.cpp14
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?");