VERY experimental Nintendo Switch 2 emulator
C++
configure_debug: Move reporting option to logging
Zach Hilman04078a2139bd
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cppindex d1ef1e72d2..ac3fbd849e 100644--- a/src/core/file_sys/registered_cache.cpp+++ b/src/core/file_sys/registered_cache.cpp@@ -59,12 +59,12 @@ static std::string GetRelativePathFromNcaID(const std::array<u8, 16>& nca_id, bobool within_two_digit, bool cnmt_suffix) {if (!within_two_digit)return fmt::format(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca",- Common::HexArrayToString(nca_id, second_hex_upper));+ Common::HexToString(nca_id, second_hex_upper));Core::Crypto::SHA256Hash hash{};mbedtls_sha256(nca_id.data(), nca_id.size(), hash.data(), 0);return fmt::format(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca", hash[0],- Common::HexArrayToString(nca_id, second_hex_upper));+ Common::HexToString(nca_id, second_hex_upper));}static std::string GetCNMTName(TitleType type, u64 title_id) {@@ -149,7 +149,7 @@ bool PlaceholderCache::Create(const NcaID& id, u64 size) const {if (dir2 == nullptr)return false;- const auto file = dir2->CreateFile(fmt::format("{}.nca", Common::HexArrayToString(id, false)));+ const auto file = dir2->CreateFile(fmt::format("{}.nca", Common::HexToString(id, false)));if (file == nullptr)return false;@@ -170,7 +170,7 @@ bool PlaceholderCache::Delete(const NcaID& id) const {const auto dir2 = GetOrCreateDirectoryRelative(dir, dirname);- const auto res = dir2->DeleteFile(fmt::format("{}.nca", Common::HexArrayToString(id, false)));+ const auto res = dir2->DeleteFile(fmt::format("{}.nca", Common::HexToString(id, false)));return res;}diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cppindex 7f8514b0de..6c594dcafd 100644--- a/src/core/hle/service/am/am.cpp+++ b/src/core/hle/service/am/am.cpp@@ -1151,7 +1151,8 @@ void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {descriptor.title_id = Core::CurrentProcess()->GetTitleID();descriptor.user_id = user_id;descriptor.type = FileSys::SaveDataType::SaveData;- const auto res = fsc.CreateSaveData(FileSys::SaveDataSpaceId::NandUser, descriptor);+ const auto res = system.GetFileSystemController().CreateSaveData(+ FileSys::SaveDataSpaceId::NandUser, descriptor);IPC::ResponseBuilder rb{ctx, 4};rb.Push(res.Code());@@ -1268,8 +1269,8 @@ void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) {"new_journal={:016X}",static_cast<u8>(type), user_id[1], user_id[0], new_normal_size, new_journal_size);- fsc.WriteSaveDataSize(type, system.CurrentProcess()->GetTitleID(), user_id,- {new_normal_size, new_journal_size});+ system.GetFileSystemController().WriteSaveDataSize(+ type, system.CurrentProcess()->GetTitleID(), user_id, {new_normal_size, new_journal_size});IPC::ResponseBuilder rb{ctx, 4};rb.Push(RESULT_SUCCESS);@@ -1288,7 +1289,7 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type),user_id[1], user_id[0]);- const auto size = system.FileSystemController().ReadSaveDataSize(+ const auto size = system.GetFileSystemController().ReadSaveDataSize(type, system.CurrentProcess()->GetTitleID(), user_id);IPC::ResponseBuilder rb{ctx, 6};diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cppindex d04476ae0f..e454b77d80 100644--- a/src/core/hle/service/am/applet_ae.cpp+++ b/src/core/hle/service/am/applet_ae.cpp@@ -106,7 +106,7 @@ private:IPC::ResponseBuilder rb{ctx, 2, 0, 1};rb.Push(RESULT_SUCCESS);- rb.PushIpcInterface<IApplicationFunctions>(system.FileSystemController());+ rb.PushIpcInterface<IApplicationFunctions>(system);}std::shared_ptr<NVFlinger::NVFlinger> nvflinger;diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cppindex 2ee21620b5..a2ffaa4408 100644--- a/src/core/hle/service/am/applet_oe.cpp+++ b/src/core/hle/service/am/applet_oe.cpp@@ -95,7 +95,7 @@ private:IPC::ResponseBuilder rb{ctx, 2, 0, 1};rb.Push(RESULT_SUCCESS);- rb.PushIpcInterface<IApplicationFunctions>(system.FileSystemController());+ rb.PushIpcInterface<IApplicationFunctions>(system);}std::shared_ptr<NVFlinger::NVFlinger> nvflinger;diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cppindex 31d5fd79b3..14cd0e3229 100644--- a/src/core/hle/service/filesystem/filesystem.cpp+++ b/src/core/hle/service/filesystem/filesystem.cpp@@ -711,11 +711,10 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove}void InstallInterfaces(Core::System& system) {- romfs_factory = nullptr;- CreateFactories(*system.GetFilesystem(), false);std::make_shared<FSP_LDR>()->InstallAsService(system.ServiceManager());std::make_shared<FSP_PR>()->InstallAsService(system.ServiceManager());- std::make_shared<FSP_SRV>(system.GetReporter())->InstallAsService(system.ServiceManager());+ std::make_shared<FSP_SRV>(system.GetFileSystemController(), system.GetReporter())+ ->InstallAsService(system.ServiceManager());}} // namespace Service::FileSystemdiff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.hindex 4d7da3b6f3..3e0c03ec0f 100644--- a/src/core/hle/service/filesystem/filesystem.h+++ b/src/core/hle/service/filesystem/filesystem.h@@ -125,7 +125,7 @@ private:std::unique_ptr<FileSys::PlaceholderCache> gamecard_placeholder;};-void InstallInterfaces(SM::ServiceManager& service_manager, FileSystemController& controller);+void InstallInterfaces(Core::System& system);// A class that wraps a VfsDirectory with methods that return ResultVal and ResultCode instead of// pointers and booleans. This makes using a VfsDirectory with switch services much easier anddiff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cppindex 305d9e1762..eb982ad49f 100644--- a/src/core/hle/service/filesystem/fsp_srv.cpp+++ b/src/core/hle/service/filesystem/fsp_srv.cpp@@ -650,7 +650,8 @@ private:u64 next_entry_index = 0;};-FSP_SRV::FSP_SRV(FileSystemController& fsc) : ServiceFramework("fsp-srv"), fsc(fsc) {+FSP_SRV::FSP_SRV(FileSystemController& fsc, const Core::Reporter& reporter)+ : ServiceFramework("fsp-srv"), fsc(fsc), reporter(reporter) {// clang-format offstatic const FunctionInfo functions[] = {{0, nullptr, "OpenFileSystem"},diff --git a/src/core/hle/service/filesystem/fsp_srv.h b/src/core/hle/service/filesystem/fsp_srv.hindex 494348598a..d52b55999a 100644--- a/src/core/hle/service/filesystem/fsp_srv.h+++ b/src/core/hle/service/filesystem/fsp_srv.h@@ -32,7 +32,7 @@ enum class LogMode : u32 {class FSP_SRV final : public ServiceFramework<FSP_SRV> {public:- explicit FSP_SRV(FileSystemController& fsc);+ explicit FSP_SRV(FileSystemController& fsc, const Core::Reporter& reporter);~FSP_SRV() override;private:diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cppindex 3d6a5990fd..4543874672 100644--- a/src/core/hle/service/service.cpp+++ b/src/core/hle/service/service.cpp@@ -199,7 +199,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system) {// NVFlinger needs to be accessed by several services like Vi and AppletOE so we instantiate it// here and pass it into the respective InstallInterfaces functions.auto nv_flinger = std::make_shared<NVFlinger::NVFlinger>(system.CoreTiming());- fsc.CreateFactories(*system.GetFilesystem(), false);+ system.GetFileSystemController().CreateFactories(*system.GetFilesystem(), false);SM::ServiceManager::InstallInterfaces(sm);@@ -236,7 +236,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system) {NIFM::InstallInterfaces(*sm);NIM::InstallInterfaces(*sm);NPNS::InstallInterfaces(*sm);- NS::InstallInterfaces(*sm, fsc);+ NS::InstallInterfaces(*sm, system.GetFileSystemController());Nvidia::InstallInterfaces(*sm, *nv_flinger, system);PCIe::InstallInterfaces(*sm);PCTL::InstallInterfaces(*sm);diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txtindex c50ca317d5..dc6fa07fc2 100644--- a/src/yuzu/CMakeLists.txt+++ b/src/yuzu/CMakeLists.txt@@ -35,6 +35,7 @@ add_executable(yuzuconfiguration/configure_dialog.hconfiguration/configure_filesystem.cppconfiguration/configure_filesystem.h+ configuration/configure_filesystem.uiconfiguration/configure_gamelist.cppconfiguration/configure_gamelist.hconfiguration/configure_gamelist.uidiff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cppindex 7c286af62f..92d9fb1610 100644--- a/src/yuzu/configuration/config.cpp+++ b/src/yuzu/configuration/config.cpp@@ -488,18 +488,19 @@ void Config::ReadDataStorageValues() {ReadSetting(QStringLiteral("gamecard_path"), QStringLiteral("")).toString().toStdString();Settings::values.nand_total_size = static_cast<Settings::NANDTotalSize>(ReadSetting(QStringLiteral("nand_total_size"),- static_cast<u64>(Settings::NANDTotalSize::S29_1GB))+ QVariant::fromValue<u64>(static_cast<u64>(Settings::NANDTotalSize::S29_1GB))).toULongLong());Settings::values.nand_user_size = static_cast<Settings::NANDUserSize>(ReadSetting(QStringLiteral("nand_user_size"),- static_cast<u64>(Settings::NANDUserSize::S26GB))+ QVariant::fromValue<u64>(static_cast<u64>(Settings::NANDUserSize::S26GB))).toULongLong());Settings::values.nand_system_size = static_cast<Settings::NANDSystemSize>(ReadSetting(QStringLiteral("nand_system_size"),- static_cast<u64>(Settings::NANDSystemSize::S2_5GB))+ QVariant::fromValue<u64>(static_cast<u64>(Settings::NANDSystemSize::S2_5GB))).toULongLong());Settings::values.sdmc_size = static_cast<Settings::SDMCSize>(- ReadSetting(QStringLiteral("sdmc_size"), static_cast<u64>(Settings::SDMCSize::S16GB))+ ReadSetting(QStringLiteral("sdmc_size"),+ QVariant::fromValue<u64>(static_cast<u64>(Settings::SDMCSize::S16GB))).toULongLong());qt_config->endGroup();@@ -932,16 +933,17 @@ void Config::SaveDataStorageValues() {WriteSetting(QStringLiteral("gamecard_path"),QString::fromStdString(Settings::values.gamecard_path), QStringLiteral(""));WriteSetting(QStringLiteral("nand_total_size"),- static_cast<u64>(Settings::values.nand_total_size),- static_cast<u64>(Settings::NANDTotalSize::S29_1GB));+ QVariant::fromValue<u64>(static_cast<u64>(Settings::values.nand_total_size)),+ QVariant::fromValue<u64>(static_cast<u64>(Settings::NANDTotalSize::S29_1GB)));WriteSetting(QStringLiteral("nand_user_size"),- static_cast<u64>(Settings::values.nand_user_size),- static_cast<u64>(Settings::NANDUserSize::S26GB));+ QVariant::fromValue<u64>(static_cast<u64>(Settings::values.nand_user_size)),+ QVariant::fromValue<u64>(static_cast<u64>(Settings::NANDUserSize::S26GB)));WriteSetting(QStringLiteral("nand_system_size"),- static_cast<u64>(Settings::values.nand_system_size),- static_cast<u64>(Settings::NANDSystemSize::S2_5GB));- WriteSetting(QStringLiteral("sdmc_size"), static_cast<u64>(Settings::values.sdmc_size),- static_cast<u64>(Settings::SDMCSize::S16GB));+ QVariant::fromValue<u64>(static_cast<u64>(Settings::values.nand_system_size)),+ QVariant::fromValue<u64>(static_cast<u64>(Settings::NANDSystemSize::S2_5GB)));+ WriteSetting(QStringLiteral("sdmc_size"),+ QVariant::fromValue<u64>(static_cast<u64>(Settings::values.sdmc_size)),+ QVariant::fromValue<u64>(static_cast<u64>(Settings::SDMCSize::S16GB)));qt_config->endGroup();}diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.uiindex db254f560d..ce49569bb1 100644--- a/src/yuzu/configuration/configure_debug.ui+++ b/src/yuzu/configuration/configure_debug.ui@@ -103,33 +103,6 @@</item></layout></item>- </layout>- </widget>- </item>- <item>- <widget class="QGroupBox" name="groupBox_3">- <property name="title">- <string>Homebrew</string>- </property>- <layout class="QVBoxLayout" name="verticalLayout_5">- <item>- <layout class="QHBoxLayout" name="horizontalLayout_4">- <item>- <widget class="QLabel" name="label_3">- <property name="text">- <string>Arguments String</string>- </property>- </widget>- </item>- <item>- <widget class="QLineEdit" name="homebrew_args_edit"/>- </item>- </layout>- </item>- </layout>- </widget>- </item>- <item><item><widget class="QCheckBox" name="reporting_services"><property name="text">@@ -138,7 +111,7 @@</widget></item><item>- <widget class="QLabel" name="label_3">+ <widget class="QLabel" name="label"><property name="font"><font><italic>true</italic>@@ -172,15 +145,36 @@</widget></item><item>- <widget class="QGroupBox" name="groupBox_4">+ <widget class="QGroupBox" name="groupBox_3"><property name="title">- <string>Dump</string>+ <string>Homebrew</string></property>- <layout class="QVBoxLayout" name="verticalLayout_6">+ <layout class="QVBoxLayout" name="verticalLayout_5">+ <item>+ <layout class="QHBoxLayout" name="horizontalLayout_4">+ <item>+ <widget class="QLabel" name="label_3">+ <property name="text">+ <string>Arguments String</string>+ </property>+ </widget>+ </item>+ <item>+ <widget class="QLineEdit" name="homebrew_args_edit"/>+ </item>+ </layout>+ </item>+ </layout>+ </widget>+ </item>+ <item><spacer name="verticalSpacer"><property name="orientation"><enum>Qt::Vertical</enum></property>+ <property name="sizeType">+ <enum>QSizePolicy::Expanding</enum>+ </property><property name="sizeHint" stdset="0"><size><width>20</width>diff --git a/src/yuzu/configuration/configure_filesystem.cpp b/src/yuzu/configuration/configure_filesystem.cppindex b8b9daf2aa..29f540eb7c 100644--- a/src/yuzu/configuration/configure_filesystem.cpp+++ b/src/yuzu/configuration/configure_filesystem.cpp@@ -9,7 +9,7 @@#include "core/settings.h"#include "ui_configure_filesystem.h"#include "yuzu/configuration/configure_filesystem.h"-#include "yuzu/ui_settings.h"+#include "yuzu/uisettings.h"namespace {diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cppindex 10bcd650ea..b49446be96 100644--- a/src/yuzu/configuration/configure_general.cpp+++ b/src/yuzu/configuration/configure_general.cpp@@ -2,6 +2,7 @@// Licensed under GPLv2 or any later version// Refer to the license.txt file included.+#include <QSpinBox>#include "core/core.h"#include "core/settings.h"#include "ui_configure_general.h"diff --git a/src/yuzu_tester/yuzu.cpp b/src/yuzu_tester/yuzu.cppindex 0ee97aa54a..94ad50cb33 100644--- a/src/yuzu_tester/yuzu.cpp+++ b/src/yuzu_tester/yuzu.cpp@@ -22,6 +22,7 @@#include "common/telemetry.h"#include "core/core.h"#include "core/crypto/key_manager.h"+#include "core/file_sys/registered_cache.h"#include "core/file_sys/vfs_real.h"#include "core/hle/service/filesystem/filesystem.h"#include "core/loader/loader.h"@@ -216,8 +217,9 @@ int main(int argc, char** argv) {};Core::System& system{Core::System::GetInstance()};+ system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>());system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>());- Service::FileSystem::CreateFactories(*system.GetFilesystem());+ system.GetFileSystemController().CreateFactories(*system.GetFilesystem());SCOPE_EXIT({ system.Shutdown(); });