From f7eaea424d07e971d0279257d20d408b64ef05b6 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 25 Aug 2018 11:50:04 -0400 Subject: registration: Add support for installing NSP files --- src/yuzu/main.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 262e33487..c4eda4bab 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -806,22 +806,34 @@ void GMainWindow::OnMenuInstallToNAND() { QMessageBox::Yes; }; - if (filename.endsWith("xci", Qt::CaseInsensitive)) { - const auto xci = std::make_shared( - vfs->OpenFile(filename.toStdString(), FileSys::Mode::Read)); - if (xci->GetStatus() != Loader::ResultStatus::Success) { + if (filename.endsWith("xci", Qt::CaseInsensitive) || + filename.endsWith("nsp", Qt::CaseInsensitive)) { + + std::shared_ptr nsp; + if (filename.endsWith("nsp", Qt::CaseInsensitive)) { + nsp = std::make_shared( + vfs->OpenFile(filename.toStdString(), FileSys::Mode::Read)); + if (!nsp->IsExtractedType()) + failed(); + } else { + const auto xci = std::make_shared( + vfs->OpenFile(filename.toStdString(), FileSys::Mode::Read)); + nsp = xci->GetSecurePartitionNSP(); + } + + if (nsp->GetStatus() != Loader::ResultStatus::Success) { failed(); return; } const auto res = - Service::FileSystem::GetUserNANDContents()->InstallEntry(xci, false, qt_raw_copy); + Service::FileSystem::GetUserNANDContents()->InstallEntry(nsp, false, qt_raw_copy); if (res == FileSys::InstallResult::Success) { success(); } else { if (res == FileSys::InstallResult::ErrorAlreadyExists) { if (overwrite()) { const auto res2 = Service::FileSystem::GetUserNANDContents()->InstallEntry( - xci, true, qt_raw_copy); + nsp, true, qt_raw_copy); if (res2 == FileSys::InstallResult::Success) { success(); } else { -- cgit v1.2.3 From 58473309a08979d657dc09d5594833791e5c920c Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 25 Aug 2018 11:50:15 -0400 Subject: qt: Add UI support for NSP files --- src/yuzu/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c4eda4bab..e7722cf95 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -746,7 +746,8 @@ void GMainWindow::OnMenuLoadFolder() { void GMainWindow::OnMenuInstallToNAND() { const QString file_filter = - tr("Installable Switch File (*.nca *.xci);;Nintendo Content Archive (*.nca);;NX Cartridge " + tr("Installable Switch File (*.nca *.nsp *.xci);;Nintendo Content Archive " + "(*.nca);;Nintendo Submissions Package (*.nsp);;NX Cartridge " "Image (*.xci)"); QString filename = QFileDialog::getOpenFileName(this, tr("Install File"), UISettings::values.roms_path, file_filter); -- cgit v1.2.3 From 8974771334aceaaba0912887dacfd3eb1eb0bee6 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 30 Aug 2018 16:59:30 -0400 Subject: registration: Fix NSP installation errors --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e7722cf95..d7c5d813f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -814,7 +814,7 @@ void GMainWindow::OnMenuInstallToNAND() { if (filename.endsWith("nsp", Qt::CaseInsensitive)) { nsp = std::make_shared( vfs->OpenFile(filename.toStdString(), FileSys::Mode::Read)); - if (!nsp->IsExtractedType()) + if (nsp->IsExtractedType()) failed(); } else { const auto xci = std::make_shared( -- cgit v1.2.3 From 128006172578390d7c83575f591dbd8df9361e84 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 30 Aug 2018 16:59:49 -0400 Subject: qt: Add deprecation warnings for DRD format --- src/yuzu/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index d7c5d813f..037bf2aef 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -488,6 +488,16 @@ bool GMainWindow::LoadROM(const QString& filename) { const Core::System::ResultStatus result{system.Load(*render_window, filename.toStdString())}; + if (system.GetAppLoader().GetFileType() == Loader::FileType::DeconstructedRomDirectory) { + QMessageBox::warning( + this, tr("Warning Outdated Game Format"), + tr("You are using the deconstructed ROM directory format for this game, which is an " + "outdated format that has been superseded by others such as NCA, NAX, XCI, or " + "NSP.

For an explanation of the various Switch formats yuzu supports, check out our " + "wiki.")); + } + render_window->DoneCurrent(); if (result != Core::System::ResultStatus::Success) { -- cgit v1.2.3 From 87be4bc283eee72a51b5e8391147c60671351b80 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Tue, 4 Sep 2018 14:44:40 -0400 Subject: main: Only show DRD deprecation warning once --- src/yuzu/main.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 037bf2aef..56bd3ee2e 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -34,7 +34,9 @@ #include "core/file_sys/content_archive.h" #include "core/file_sys/registered_cache.h" #include "core/file_sys/savedata_factory.h" +#include "core/file_sys/submission_package.h" #include "core/file_sys/vfs_real.h" +#include "core/hle/kernel/process.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/loader.h" #include "core/perf_stats.h" @@ -76,6 +78,7 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; */ enum class CalloutFlag : uint32_t { Telemetry = 0x1, + DRDDeprecation = 0x2, }; static void ShowCalloutMessage(const QString& message, CalloutFlag flag) { @@ -488,14 +491,21 @@ bool GMainWindow::LoadROM(const QString& filename) { const Core::System::ResultStatus result{system.Load(*render_window, filename.toStdString())}; - if (system.GetAppLoader().GetFileType() == Loader::FileType::DeconstructedRomDirectory) { + const auto drd_callout = + (UISettings::values.callout_flags & static_cast(CalloutFlag::DRDDeprecation)) == 0; + + if (result == Core::System::ResultStatus::Success && + system.GetAppLoader().GetFileType() == Loader::FileType::DeconstructedRomDirectory && + drd_callout) { + UISettings::values.callout_flags |= static_cast(CalloutFlag::DRDDeprecation); QMessageBox::warning( this, tr("Warning Outdated Game Format"), tr("You are using the deconstructed ROM directory format for this game, which is an " "outdated format that has been superseded by others such as NCA, NAX, XCI, or " - "NSP.

For an explanation of the various Switch formats yuzu supports,
For an explanation of the various Switch formats yuzu supports,
check out our " - "wiki.")); + "wiki. This message will not be shown again.")); } render_window->DoneCurrent(); -- cgit v1.2.3