summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-01 03:08:44 +0200
committerGitHub <noreply@github.com>2018-10-01 03:08:44 +0200
commitdecc3196348aefa9a4d58bd317461e4fa0788294 (patch)
treea8052f3c01b7d1cc885e109ce71218b54ef6bed8
parentMerge pull request #1338 from raven02/service_vi (diff)
parentqt: Install System TitleTypes to System NAND (diff)
downloadyuzu-decc3196348aefa9a4d58bd317461e4fa0788294.tar
yuzu-decc3196348aefa9a4d58bd317461e4fa0788294.tar.gz
yuzu-decc3196348aefa9a4d58bd317461e4fa0788294.tar.bz2
yuzu-decc3196348aefa9a4d58bd317461e4fa0788294.tar.lz
yuzu-decc3196348aefa9a4d58bd317461e4fa0788294.tar.xz
yuzu-decc3196348aefa9a4d58bd317461e4fa0788294.tar.zst
yuzu-decc3196348aefa9a4d58bd317461e4fa0788294.zip
-rw-r--r--src/yuzu/main.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 681758ad2..27015d02c 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1055,11 +1055,21 @@ void GMainWindow::OnMenuInstallToNAND() {
return;
}
- if (index >= 5)
- index += 0x7B;
+ // If index is equal to or past Game, add the jump in TitleType.
+ if (index >= 5) {
+ index += static_cast<size_t>(FileSys::TitleType::Application) -
+ static_cast<size_t>(FileSys::TitleType::FirmwarePackageB);
+ }
+
+ FileSys::InstallResult res;
+ if (index >= static_cast<size_t>(FileSys::TitleType::Application)) {
+ res = Service::FileSystem::GetUserNANDContents()->InstallEntry(
+ nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
+ } else {
+ res = Service::FileSystem::GetSystemNANDContents()->InstallEntry(
+ nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
+ }
- const auto res = Service::FileSystem::GetUserNANDContents()->InstallEntry(
- nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
if (res == FileSys::InstallResult::Success) {
success();
} else if (res == FileSys::InstallResult::ErrorAlreadyExists) {