From b5f3d9799a99e10492aa3bd28f52fa01581551f8 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 02:54:58 +0000 Subject: [PATCH 01/14] Removed reference to old api url https://api.yuzu-emu.org --- src/common/settings.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/settings.h b/src/common/settings.h index 61969af2bf..d4f04c72c2 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -609,8 +609,8 @@ struct Values { Category::Network}; // WebService - Setting enable_telemetry{linkage, true, "enable_telemetry", Category::WebService}; - Setting web_api_url{linkage, "https://api.yuzu-emu.org", "web_api_url", + Setting enable_telemetry{linkage, false, "enable_telemetry", Category::WebService}; + Setting web_api_url{linkage, "https://api.suyu.dev", "web_api_url", Category::WebService}; Setting yuzu_username{linkage, std::string(), "yuzu_username", Category::WebService}; From 83533e7d3cfda152ceba77e1a32187110b52ef62 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 03:30:53 +0000 Subject: [PATCH 02/14] Remove dumpRomFs --- src/yuzu/main.cpp | 176 ---------------------------------------------- 1 file changed, 176 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 98f4ca42b1..5af9e5829f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1489,7 +1489,6 @@ void GMainWindow::ConnectWidgetEvents() { connect(game_list, &GameList::RemoveFileRequested, this, &GMainWindow::OnGameListRemoveFile); connect(game_list, &GameList::RemovePlayTimeRequested, this, &GMainWindow::OnGameListRemovePlayTimeData); - connect(game_list, &GameList::DumpRomFSRequested, this, &GMainWindow::OnGameListDumpRomFS); connect(game_list, &GameList::VerifyIntegrityRequested, this, &GMainWindow::OnGameListVerifyIntegrity); connect(game_list, &GameList::CopyTIDRequested, this, &GMainWindow::OnGameListCopyTID); @@ -2682,121 +2681,6 @@ void GMainWindow::RemoveCacheStorage(u64 program_id) { Common::FS::RemoveDirRecursively(path); } -void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_path, - DumpRomFSTarget target) { - const auto failed = [this] { - QMessageBox::warning(this, tr("RomFS Extraction Failed!"), - tr("There was an error copying the RomFS files or the user " - "cancelled the operation.")); - }; - - const auto loader = - Loader::GetLoader(*system, vfs->OpenFile(game_path, FileSys::OpenMode::Read)); - if (loader == nullptr) { - failed(); - return; - } - - FileSys::VirtualFile packed_update_raw{}; - loader->ReadUpdateRaw(packed_update_raw); - - const auto& installed = system->GetContentProvider(); - - u64 title_id{}; - u8 raw_type{}; - if (!SelectRomFSDumpTarget(installed, program_id, &title_id, &raw_type)) { - failed(); - return; - } - - const auto type = static_cast(raw_type); - const auto base_nca = installed.GetEntry(title_id, type); - if (!base_nca) { - failed(); - return; - } - - const FileSys::NCA update_nca{packed_update_raw, nullptr}; - if (type != FileSys::ContentRecordType::Program || - update_nca.GetStatus() != Loader::ResultStatus::ErrorMissingBKTRBaseRomFS || - update_nca.GetTitleId() != FileSys::GetUpdateTitleID(title_id)) { - packed_update_raw = {}; - } - - const auto base_romfs = base_nca->GetRomFS(); - const auto dump_dir = - target == DumpRomFSTarget::Normal - ? Common::FS::GetYuzuPath(Common::FS::YuzuPath::DumpDir) - : Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir) / "atmosphere" / "contents"; - const auto romfs_dir = fmt::format("{:016X}/romfs", title_id); - - const auto path = Common::FS::PathToUTF8String(dump_dir / romfs_dir); - - const FileSys::PatchManager pm{title_id, system->GetFileSystemController(), installed}; - auto romfs = pm.PatchRomFS(base_nca.get(), base_romfs, type, packed_update_raw, false); - - const auto out = VfsFilesystemCreateDirectoryWrapper(vfs, path, FileSys::OpenMode::ReadWrite); - - if (out == nullptr) { - failed(); - vfs->DeleteDirectory(path); - return; - } - - bool ok = false; - const QStringList selections{tr("Full"), tr("Skeleton")}; - const auto res = QInputDialog::getItem( - this, tr("Select RomFS Dump Mode"), - tr("Please select the how you would like the RomFS dumped.
Full will copy all of the " - "files into the new directory while
skeleton will only create the directory " - "structure."), - selections, 0, false, &ok); - if (!ok) { - failed(); - vfs->DeleteDirectory(path); - return; - } - - const auto extracted = FileSys::ExtractRomFS(romfs); - if (extracted == nullptr) { - failed(); - return; - } - - const auto full = res == selections.constFirst(); - - // The expected required space is the size of the RomFS + 1 GiB - const auto minimum_free_space = romfs->GetSize() + 0x40000000; - - if (full && Common::FS::GetFreeSpaceSize(path) < minimum_free_space) { - QMessageBox::warning(this, tr("RomFS Extraction Failed!"), - tr("There is not enough free space at %1 to extract the RomFS. Please " - "free up space or select a different dump directory at " - "Emulation > Configure > System > Filesystem > Dump Root") - .arg(QString::fromStdString(path))); - return; - } - - QProgressDialog progress(tr("Extracting RomFS..."), tr("Cancel"), 0, 100, this); - progress.setWindowModality(Qt::WindowModal); - progress.setMinimumDuration(100); - progress.setAutoClose(false); - progress.setAutoReset(false); - - size_t read_size = 0; - - if (RomFSRawCopy(romfs->GetSize(), read_size, progress, extracted, out, full)) { - progress.close(); - QMessageBox::information(this, tr("RomFS Extraction Succeeded!"), - tr("The operation completed successfully.")); - QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(path))); - } else { - progress.close(); - failed(); - vfs->DeleteDirectory(path); - } -} - void GMainWindow::OnGameListVerifyIntegrity(const std::string& game_path) { const auto NotImplemented = [this] { QMessageBox::warning(this, tr("Integrity verification couldn't be performed!"), @@ -4838,66 +4722,6 @@ void GMainWindow::SetFirmwareVersion() { firmware_label->setToolTip(QString::fromStdString(display_title)); } -bool GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installed, u64 program_id, - u64* selected_title_id, u8* selected_content_record_type) { - using ContentInfo = std::tuple; - boost::container::flat_set available_title_ids; - - const auto RetrieveEntries = [&](FileSys::TitleType title_type, - FileSys::ContentRecordType record_type) { - const auto entries = installed.ListEntriesFilter(title_type, record_type); - for (const auto& entry : entries) { - if (FileSys::GetBaseTitleID(entry.title_id) == program_id && - installed.GetEntry(entry)->GetStatus() == Loader::ResultStatus::Success) { - available_title_ids.insert({entry.title_id, title_type, record_type}); - } - } - }; - - RetrieveEntries(FileSys::TitleType::Application, FileSys::ContentRecordType::Program); - RetrieveEntries(FileSys::TitleType::Application, FileSys::ContentRecordType::HtmlDocument); - RetrieveEntries(FileSys::TitleType::Application, FileSys::ContentRecordType::LegalInformation); - RetrieveEntries(FileSys::TitleType::AOC, FileSys::ContentRecordType::Data); - - if (available_title_ids.empty()) { - return false; - } - - size_t title_index = 0; - - if (available_title_ids.size() > 1) { - QStringList list; - for (auto& [title_id, title_type, record_type] : available_title_ids) { - const auto hex_title_id = QString::fromStdString(fmt::format("{:X}", title_id)); - if (record_type == FileSys::ContentRecordType::Program) { - list.push_back(QStringLiteral("Program [%1]").arg(hex_title_id)); - } else if (record_type == FileSys::ContentRecordType::HtmlDocument) { - list.push_back(QStringLiteral("HTML document [%1]").arg(hex_title_id)); - } else if (record_type == FileSys::ContentRecordType::LegalInformation) { - list.push_back(QStringLiteral("Legal information [%1]").arg(hex_title_id)); - } else { - list.push_back( - QStringLiteral("DLC %1 [%2]").arg(title_id & 0x7FF).arg(hex_title_id)); - } - } - - bool ok; - const auto res = QInputDialog::getItem( - this, tr("Select RomFS Dump Target"), - tr("Please select which RomFS you would like to dump."), list, 0, false, &ok); - if (!ok) { - return false; - } - - title_index = list.indexOf(res); - } - - const auto& [title_id, title_type, record_type] = *available_title_ids.nth(title_index); - *selected_title_id = title_id; - *selected_content_record_type = static_cast(record_type); - return true; -} - bool GMainWindow::ConfirmClose() { if (emu_thread == nullptr || UISettings::values.confirm_before_stopping.GetValue() == ConfirmStop::Ask_Never) { From 0d444ff6612b9b27d4820eac0ad380ea9c19ce7c Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 03:38:59 +0000 Subject: [PATCH 03/14] Update main.cpp --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5af9e5829f..1ab0735248 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2014 Citra Emulator Project +// SPDX-FileCopyrightText: 2014 Citra Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Modified by JuanCStar on 2024/03/06 From 7652009ebb42a8b09e3f53f9edc86c1d082f8cd5 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 04:25:27 +0000 Subject: [PATCH 04/14] Update game_list.cpp --- src/yuzu/game_list.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index b40af957c7..402d1cfa7a 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -631,12 +631,6 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri connect(remove_cache_storage, &QAction::triggered, [this, program_id, path] { emit RemoveFileRequested(program_id, GameListRemoveTarget::CacheStorage, path); }); - connect(dump_romfs, &QAction::triggered, [this, program_id, path]() { - emit DumpRomFSRequested(program_id, path, DumpRomFSTarget::Normal); - }); - connect(dump_romfs_sdmc, &QAction::triggered, [this, program_id, path]() { - emit DumpRomFSRequested(program_id, path, DumpRomFSTarget::SDMC); - }); connect(verify_integrity, &QAction::triggered, [this, path]() { emit VerifyIntegrityRequested(path); }); connect(copy_tid, &QAction::triggered, From 4f389a21fbbac47825d11228c29b3002ee91c18a Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 04:27:19 +0000 Subject: [PATCH 05/14] Update game_list.h --- src/yuzu/game_list.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 79f9c7ec0f..418b85b85c 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h @@ -50,11 +50,6 @@ enum class GameListRemoveTarget { CacheStorage, }; -enum class DumpRomFSTarget { - Normal, - SDMC, -}; - enum class GameListShortcutTarget { Desktop, Applications, @@ -115,7 +110,6 @@ signals: void RemoveFileRequested(u64 program_id, GameListRemoveTarget target, const std::string& game_path); void RemovePlayTimeRequested(u64 program_id); - void DumpRomFSRequested(u64 program_id, const std::string& game_path, DumpRomFSTarget target); void VerifyIntegrityRequested(const std::string& game_path); void CopyTIDRequested(u64 program_id); void CreateShortcut(u64 program_id, const std::string& game_path, From 9b48bd330beb8a14e14a9d76f92b185b4424ddcd Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 04:28:21 +0000 Subject: [PATCH 06/14] Update game_list.h --- src/yuzu/game_list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 418b85b85c..ff51d19e47 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2015 Citra Emulator Project +// SPDX-FileCopyrightText: 2015 Citra Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once From 436d5dcad2e35997037fff9fc4fb9d4fbf577b8b Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 04:28:49 +0000 Subject: [PATCH 07/14] Update game_list.cpp --- src/yuzu/game_list.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 402d1cfa7a..886e6fba6d 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2015 Citra Emulator Project +// SPDX-FileCopyrightText: 2015 Citra Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include From 6bede3e4d8bec4eb7237bcc60b8dd5cb55db2013 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 04:30:50 +0000 Subject: [PATCH 08/14] Update main.h --- src/yuzu/main.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/yuzu/main.h b/src/yuzu/main.h index fce643f3f8..85ee4fc8e7 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2014 Citra Emulator Project +// SPDX-FileCopyrightText: 2014 Citra Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -49,7 +49,6 @@ class WaitTreeWidget; enum class GameListOpenTarget; enum class GameListRemoveTarget; enum class GameListShortcutTarget; -enum class DumpRomFSTarget; enum class InstalledEntryType; class GameListPlaceholder; @@ -348,7 +347,6 @@ private slots: void OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target, const std::string& game_path); void OnGameListRemovePlayTimeData(u64 program_id); - void OnGameListDumpRomFS(u64 program_id, const std::string& game_path, DumpRomFSTarget target); void OnGameListVerifyIntegrity(const std::string& game_path); void OnGameListCopyTID(u64 program_id); void OnGameListNavigateToGamedbEntry(u64 program_id, From 2e299360386468de5c6c3aae3596129e9fca89be Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 08:13:49 +0000 Subject: [PATCH 09/14] Update game_list.cpp --- src/yuzu/game_list.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 886e6fba6d..2b9f2f06d1 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -561,9 +561,6 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri remove_menu->addSeparator(); QAction* remove_shader_cache = remove_menu->addAction(tr("Remove All Pipeline Caches")); QAction* remove_all_content = remove_menu->addAction(tr("Remove All Installed Contents")); - QMenu* dump_romfs_menu = context_menu.addMenu(tr("Dump RomFS")); - QAction* dump_romfs = dump_romfs_menu->addAction(tr("Dump RomFS")); - QAction* dump_romfs_sdmc = dump_romfs_menu->addAction(tr("Dump RomFS to SDMC")); QAction* verify_integrity = context_menu.addAction(tr("Verify Integrity")); QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard")); QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry")); From d1c7e1c974c8c7235e61346414359a2eeb12a743 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 08:52:41 +0000 Subject: [PATCH 10/14] Update game_list.h --- src/yuzu/game_list.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index ff51d19e47..0a163794ac 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2015 Citra Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +// Modified by palfaiate on <2024/03/07> + #pragma once #include From c146e875250e7f76e14e992d665906d43ff24dc6 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 08:53:19 +0000 Subject: [PATCH 11/14] Update game_list.cpp --- src/yuzu/game_list.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 2b9f2f06d1..7098506d33 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2015 Citra Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +// Modified by palfaiate on <2024/03/07> + #include #include #include From fbbc664ba6599fbc8bb680474b9250433b8657a2 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 08:54:32 +0000 Subject: [PATCH 12/14] Update main.cpp --- src/yuzu/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f7bdbf4ed6..43dc0e9ef3 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Modified by JuanCStar on 2024/03/06 +// Modified by palfaiate on <2024/03/07> #include #include From 76409f9e563d023ffe89ae981d13749c7430d515 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 08:54:49 +0000 Subject: [PATCH 13/14] Update main.h --- src/yuzu/main.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 85ee4fc8e7..ba217fbce6 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2014 Citra Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +// Modified by palfaiate on <2024/03/07> + #pragma once #include From ee6174d97dddc3d6dfc1860853df72038717cad9 Mon Sep 17 00:00:00 2001 From: Paulo Alfaiate Date: Thu, 7 Mar 2024 09:17:26 +0000 Subject: [PATCH 14/14] Update settings.h --- src/common/settings.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/settings.h b/src/common/settings.h index d4f04c72c2..57e1ad7f2a 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project & 2024 suyu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +// Modified by palfaiate on <2024/03/07> + #pragma once #include