diff options
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/main.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f711a337f..e2b6462bb 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1244,13 +1244,24 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target | |||
| 1244 | std::string path; | 1244 | std::string path; |
| 1245 | QString open_target; | 1245 | QString open_target; |
| 1246 | 1246 | ||
| 1247 | FileSys::PatchManager pm{program_id}; | 1247 | const auto [user_save_size, device_save_size] = [this, &program_id, &game_path] { |
| 1248 | const auto control = pm.GetControlMetadata(); | 1248 | FileSys::PatchManager pm{program_id}; |
| 1249 | const auto v_file = Core::GetGameFileFromPath(vfs, game_path); | 1249 | const auto control = pm.GetControlMetadata().first; |
| 1250 | const auto loader = Loader::GetLoader(v_file); | 1250 | if (control != nullptr) { |
| 1251 | return std::make_pair(control->GetDefaultNormalSaveSize(), | ||
| 1252 | control->GetDeviceSaveDataSize()); | ||
| 1253 | } else { | ||
| 1254 | const auto file = Core::GetGameFileFromPath(vfs, game_path); | ||
| 1255 | const auto loader = Loader::GetLoader(file); | ||
| 1256 | |||
| 1257 | FileSys::NACP nacp{}; | ||
| 1258 | loader->ReadControlData(nacp); | ||
| 1259 | return std::make_pair(nacp.GetDefaultNormalSaveSize(), nacp.GetDeviceSaveDataSize()); | ||
| 1260 | } | ||
| 1261 | }(); | ||
| 1251 | 1262 | ||
| 1252 | const bool has_user_save{control.first->GetDefaultNormalSaveSize() > 0}; | 1263 | const bool has_user_save{user_save_size > 0}; |
| 1253 | const bool has_device_save{control.first->GetDeviceSaveDataSize() > 0}; | 1264 | const bool has_device_save{device_save_size > 0}; |
| 1254 | 1265 | ||
| 1255 | ASSERT_MSG(has_user_save != has_device_save, "Game uses both user and device savedata?"); | 1266 | ASSERT_MSG(has_user_save != has_device_save, "Game uses both user and device savedata?"); |
| 1256 | 1267 | ||