|
|
@ -1242,20 +1242,29 @@ void GMainWindow::OnGameListLoadFile(QString game_path) {
|
|
|
|
BootGame(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;
|
|
|
|
std::string path;
|
|
|
|
QString open_target;
|
|
|
|
QString open_target;
|
|
|
|
|
|
|
|
|
|
|
|
const auto v_file = Core::GetGameFileFromPath(vfs, game_path);
|
|
|
|
const auto [user_save_size, device_save_size] = [this, &program_id, &game_path] {
|
|
|
|
const auto loader = Loader::GetLoader(v_file);
|
|
|
|
FileSys::PatchManager pm{program_id};
|
|
|
|
FileSys::NACP control{};
|
|
|
|
const auto control = pm.GetControlMetadata().first;
|
|
|
|
u64 program_id{};
|
|
|
|
if (control != nullptr) {
|
|
|
|
|
|
|
|
return std::make_pair(control->GetDefaultNormalSaveSize(),
|
|
|
|
|
|
|
|
control->GetDeviceSaveDataSize());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
const auto file = Core::GetGameFileFromPath(vfs, game_path);
|
|
|
|
|
|
|
|
const auto loader = Loader::GetLoader(file);
|
|
|
|
|
|
|
|
|
|
|
|
loader->ReadControlData(control);
|
|
|
|
FileSys::NACP nacp{};
|
|
|
|
loader->ReadProgramId(program_id);
|
|
|
|
loader->ReadControlData(nacp);
|
|
|
|
|
|
|
|
return std::make_pair(nacp.GetDefaultNormalSaveSize(), nacp.GetDeviceSaveDataSize());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
|
|
const bool has_user_save{control.GetDefaultNormalSaveSize() > 0};
|
|
|
|
const bool has_user_save{user_save_size > 0};
|
|
|
|
const bool has_device_save{control.GetDeviceSaveDataSize() > 0};
|
|
|
|
const bool has_device_save{device_save_size > 0};
|
|
|
|
|
|
|
|
|
|
|
|
ASSERT_MSG(has_user_save != has_device_save, "Game uses both user and device savedata?");
|
|
|
|
ASSERT_MSG(has_user_save != has_device_save, "Game uses both user and device savedata?");
|
|
|
|
|
|
|
|
|
|
|
|