diff options
Diffstat (limited to '')
-rw-r--r-- | src/common/settings.cpp | 2 | ||||
-rw-r--r-- | src/common/settings.h | 3 | ||||
-rw-r--r-- | src/core/crypto/key_manager.cpp | 8 | ||||
-rw-r--r-- | src/core/hid/emulated_devices.cpp | 1 | ||||
-rw-r--r-- | src/input_common/main.cpp | 10 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_fsr.cpp | 6 | ||||
-rw-r--r-- | src/yuzu/CMakeLists.txt | 26 | ||||
-rw-r--r-- | src/yuzu/bootmanager.cpp | 8 | ||||
-rw-r--r-- | src/yuzu/bootmanager.h | 2 | ||||
-rw-r--r-- | src/yuzu/configuration/config.cpp | 5 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_camera.cpp | 7 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_camera.h | 2 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 38 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics.h | 2 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 146 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_input_advanced.cpp | 4 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 3 | ||||
-rw-r--r-- | src/yuzu/multiplayer/direct_connect.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/multiplayer/validation.h | 16 | ||||
-rw-r--r-- | src/yuzu_cmd/config.cpp | 1 | ||||
-rw-r--r-- | src/yuzu_cmd/default_ini.h | 29 | ||||
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 2 |
22 files changed, 300 insertions, 23 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 8173462cb..d8ffe34c3 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -48,6 +48,7 @@ void LogSettings() { log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue()); log_setting("Renderer_UseResolutionScaling", values.resolution_setup.GetValue()); log_setting("Renderer_ScalingFilter", values.scaling_filter.GetValue()); + log_setting("Renderer_FSRSlider", values.fsr_sharpening_slider.GetValue()); log_setting("Renderer_AntiAliasing", values.anti_aliasing.GetValue()); log_setting("Renderer_UseSpeedLimit", values.use_speed_limit.GetValue()); log_setting("Renderer_SpeedLimit", values.speed_limit.GetValue()); @@ -181,6 +182,7 @@ void RestoreGlobalState(bool is_powered_on) { values.cpuopt_unsafe_ignore_global_monitor.SetGlobal(true); // Renderer + values.fsr_sharpening_slider.SetGlobal(true); values.renderer_backend.SetGlobal(true); values.vulkan_device.SetGlobal(true); values.aspect_ratio.SetGlobal(true); diff --git a/src/common/settings.h b/src/common/settings.h index 0eb98939c..00e4421f7 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -421,6 +421,7 @@ struct Values { ResolutionScalingInfo resolution_info{}; SwitchableSetting<ResolutionSetup> resolution_setup{ResolutionSetup::Res1X, "resolution_setup"}; SwitchableSetting<ScalingFilter> scaling_filter{ScalingFilter::Bilinear, "scaling_filter"}; + SwitchableSetting<int, true> fsr_sharpening_slider{25, 0, 200, "fsr_sharpening_slider"}; SwitchableSetting<AntiAliasing> anti_aliasing{AntiAliasing::None, "anti_aliasing"}; // *nix platforms may have issues with the borderless windowed fullscreen mode. // Default to exclusive fullscreen on these platforms for now. @@ -442,7 +443,7 @@ struct Values { SwitchableSetting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; SwitchableSetting<bool> accelerate_astc{true, "accelerate_astc"}; SwitchableSetting<bool> use_vsync{true, "use_vsync"}; - SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLASM, ShaderBackend::GLSL, + SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLSL, ShaderBackend::GLSL, ShaderBackend::SPIRV, "shader_backend"}; SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index 443323390..65a9fe802 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -578,18 +578,18 @@ KeyManager::KeyManager() { if (Settings::values.use_dev_keys) { dev_mode = true; - LoadFromFile(yuzu_keys_dir / "dev.keys", false); LoadFromFile(yuzu_keys_dir / "dev.keys_autogenerated", false); + LoadFromFile(yuzu_keys_dir / "dev.keys", false); } else { dev_mode = false; - LoadFromFile(yuzu_keys_dir / "prod.keys", false); LoadFromFile(yuzu_keys_dir / "prod.keys_autogenerated", false); + LoadFromFile(yuzu_keys_dir / "prod.keys", false); } - LoadFromFile(yuzu_keys_dir / "title.keys", true); LoadFromFile(yuzu_keys_dir / "title.keys_autogenerated", true); - LoadFromFile(yuzu_keys_dir / "console.keys", false); + LoadFromFile(yuzu_keys_dir / "title.keys", true); LoadFromFile(yuzu_keys_dir / "console.keys_autogenerated", false); + LoadFromFile(yuzu_keys_dir / "console.keys", false); } static bool ValidCryptoRevisionString(std::string_view base, size_t begin, size_t length) { diff --git a/src/core/hid/emulated_devices.cpp b/src/core/hid/emulated_devices.cpp index 8d367b546..658dbd318 100644 --- a/src/core/hid/emulated_devices.cpp +++ b/src/core/hid/emulated_devices.cpp @@ -145,6 +145,7 @@ void EmulatedDevices::UnloadInput() { for (auto& button : keyboard_modifier_devices) { button.reset(); } + ring_analog_device.reset(); } void EmulatedDevices::EnableConfiguration() { diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index b2064ef95..76df133f3 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp @@ -138,6 +138,16 @@ struct InputSubsystem::Impl { Common::Input::UnregisterFactory<Common::Input::OutputDevice>(tas_input->GetEngineName()); tas_input.reset(); + Common::Input::UnregisterFactory<Common::Input::InputDevice>(camera->GetEngineName()); + Common::Input::UnregisterFactory<Common::Input::OutputDevice>(camera->GetEngineName()); + camera.reset(); + + Common::Input::UnregisterFactory<Common::Input::InputDevice>( + virtual_amiibo->GetEngineName()); + Common::Input::UnregisterFactory<Common::Input::OutputDevice>( + virtual_amiibo->GetEngineName()); + virtual_amiibo.reset(); + #ifdef HAVE_SDL2 Common::Input::UnregisterFactory<Common::Input::InputDevice>(sdl->GetEngineName()); Common::Input::UnregisterFactory<Common::Input::OutputDevice>(sdl->GetEngineName()); diff --git a/src/video_core/renderer_vulkan/vk_fsr.cpp b/src/video_core/renderer_vulkan/vk_fsr.cpp index dd450169e..33daa8c1c 100644 --- a/src/video_core/renderer_vulkan/vk_fsr.cpp +++ b/src/video_core/renderer_vulkan/vk_fsr.cpp @@ -5,6 +5,7 @@ #include "common/bit_cast.h" #include "common/common_types.h" #include "common/div_ceil.h" +#include "common/settings.h" #include "video_core/host_shaders/vulkan_fidelityfx_fsr_easu_fp16_comp_spv.h" #include "video_core/host_shaders/vulkan_fidelityfx_fsr_easu_fp32_comp_spv.h" @@ -227,7 +228,10 @@ VkImageView FSR::Draw(Scheduler& scheduler, size_t image_index, VkImageView imag cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, *rcas_pipeline); - FsrRcasCon(push_constants.data(), 0.25f); + const float sharpening = + static_cast<float>(Settings::values.fsr_sharpening_slider.GetValue()) / 100.0f; + + FsrRcasCon(push_constants.data(), sharpening); cmdbuf.PushConstants(*pipeline_layout, VK_SHADER_STAGE_COMPUTE_BIT, push_constants); { diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index adad36221..0aa109dd3 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -295,7 +295,7 @@ if (APPLE) set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) elseif(WIN32) # compile as a win32 gui application instead of a console application - if (QT_VERSION VERSION_GREATER 6) + if (QT_VERSION VERSION_GREATER_EQUAL 6) target_link_libraries(yuzu PRIVATE Qt6::EntryPointPrivate) else() target_link_libraries(yuzu PRIVATE Qt5::WinMain) @@ -311,15 +311,15 @@ endif() create_target_directory_groups(yuzu) target_link_libraries(yuzu PRIVATE common core input_common network video_core) -target_link_libraries(yuzu PRIVATE Boost::boost glad Qt::Widgets Qt::Multimedia) +target_link_libraries(yuzu PRIVATE Boost::boost glad Qt${QT_MAJOR_VERSION}::Widgets) target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) target_include_directories(yuzu PRIVATE ../../externals/Vulkan-Headers/include) if (NOT WIN32) - target_include_directories(yuzu PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) + target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS}) endif() if (UNIX AND NOT APPLE) - target_link_libraries(yuzu PRIVATE Qt::DBus) + target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus) endif() target_compile_definitions(yuzu PRIVATE @@ -358,8 +358,13 @@ if (ENABLE_WEB_SERVICE) target_compile_definitions(yuzu PRIVATE -DENABLE_WEB_SERVICE) endif() +if (YUZU_USE_QT_MULTIMEDIA) + target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::Multimedia) + target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_MULTIMEDIA) +endif () + if (YUZU_USE_QT_WEB_ENGINE) - target_link_libraries(yuzu PRIVATE Qt::WebEngineCore Qt::WebEngineWidgets) + target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::WebEngineCore Qt${QT_MAJOR_VERSION}::WebEngineWidgets) target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE) endif () @@ -367,7 +372,16 @@ if(UNIX AND NOT APPLE) install(TARGETS yuzu) endif() -if (YUZU_USE_BUNDLED_QT) +if (WIN32 AND QT_VERSION VERSION_GREATER_EQUAL 6) + if (MSVC AND NOT ${CMAKE_GENERATOR} STREQUAL "Ninja") + set(YUZU_EXE_DIR "${CMAKE_BINARY_DIR}/bin/$<CONFIG>") + else() + set(YUZU_EXE_DIR "${CMAKE_BINARY_DIR}/bin") + endif() + add_custom_command(TARGET yuzu POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${YUZU_EXE_DIR}/yuzu.exe" --dir "${YUZU_EXE_DIR}" --libdir "${YUZU_EXE_DIR}" --plugindir "${YUZU_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0) +endif() + +if (YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_LESS 6) include(CopyYuzuQt5Deps) copy_yuzu_Qt5_deps(yuzu) endif() diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index d88efacd7..c934069dd 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -4,8 +4,10 @@ #include <glad/glad.h> #include <QApplication> +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA #include <QCameraImageCapture> #include <QCameraInfo> +#endif #include <QHBoxLayout> #include <QMessageBox> #include <QPainter> @@ -707,6 +709,7 @@ void GRenderWindow::TouchEndEvent() { } void GRenderWindow::InitializeCamera() { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA constexpr auto camera_update_ms = std::chrono::milliseconds{50}; // (50ms, 20Hz) if (!Settings::values.enable_ir_sensor) { return; @@ -760,18 +763,22 @@ void GRenderWindow::InitializeCamera() { connect(camera_timer.get(), &QTimer::timeout, [this] { RequestCameraCapture(); }); // This timer should be dependent of camera resolution 5ms for every 100 pixels camera_timer->start(camera_update_ms); +#endif } void GRenderWindow::FinalizeCamera() { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA if (camera_timer) { camera_timer->stop(); } if (camera) { camera->unload(); } +#endif } void GRenderWindow::RequestCameraCapture() { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA if (!Settings::values.enable_ir_sensor) { return; } @@ -788,6 +795,7 @@ void GRenderWindow::RequestCameraCapture() { pending_camera_snapshots++; camera_capture->capture(); +#endif } void GRenderWindow::OnCameraCapture(int requestId, const QImage& img) { diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index c45ebf1a2..4a01481cd 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h @@ -241,8 +241,10 @@ private: bool is_virtual_camera; int pending_camera_snapshots; +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA std::unique_ptr<QCamera> camera; std::unique_ptr<QCameraImageCapture> camera_capture; +#endif std::unique_ptr<QTimer> camera_timer; Core::System& system; diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 343f3b8e5..0c93df428 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -672,6 +672,7 @@ void Config::ReadRendererValues() { ReadGlobalSetting(Settings::values.aspect_ratio); ReadGlobalSetting(Settings::values.resolution_setup); ReadGlobalSetting(Settings::values.scaling_filter); + ReadGlobalSetting(Settings::values.fsr_sharpening_slider); ReadGlobalSetting(Settings::values.anti_aliasing); ReadGlobalSetting(Settings::values.max_anisotropy); ReadGlobalSetting(Settings::values.use_speed_limit); @@ -1282,6 +1283,10 @@ void Config::SaveRendererValues() { static_cast<u32>(Settings::values.scaling_filter.GetValue(global)), static_cast<u32>(Settings::values.scaling_filter.GetDefault()), Settings::values.scaling_filter.UsingGlobal()); + WriteSetting(QString::fromStdString(Settings::values.fsr_sharpening_slider.GetLabel()), + static_cast<u32>(Settings::values.fsr_sharpening_slider.GetValue(global)), + static_cast<u32>(Settings::values.fsr_sharpening_slider.GetDefault()), + Settings::values.fsr_sharpening_slider.UsingGlobal()); WriteSetting(QString::fromStdString(Settings::values.anti_aliasing.GetLabel()), static_cast<u32>(Settings::values.anti_aliasing.GetValue(global)), static_cast<u32>(Settings::values.anti_aliasing.GetDefault()), diff --git a/src/yuzu/configuration/configure_camera.cpp b/src/yuzu/configuration/configure_camera.cpp index 2a61de2a1..d95e96696 100644 --- a/src/yuzu/configuration/configure_camera.cpp +++ b/src/yuzu/configuration/configure_camera.cpp @@ -2,8 +2,11 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include <memory> +#include <QtCore> +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA #include <QCameraImageCapture> #include <QCameraInfo> +#endif #include <QStandardItemModel> #include <QTimer> @@ -33,6 +36,7 @@ ConfigureCamera::ConfigureCamera(QWidget* parent, InputCommon::InputSubsystem* i ConfigureCamera::~ConfigureCamera() = default; void ConfigureCamera::PreviewCamera() { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA const auto index = ui->ir_sensor_combo_box->currentIndex(); bool camera_found = false; const QList<QCameraInfo> cameras = QCameraInfo::availableCameras(); @@ -101,6 +105,7 @@ void ConfigureCamera::PreviewCamera() { }); camera_timer->start(250); +#endif } void ConfigureCamera::DisplayCapturedFrame(int requestId, const QImage& img) { @@ -133,11 +138,13 @@ void ConfigureCamera::LoadConfiguration() { ui->ir_sensor_combo_box->clear(); input_devices.push_back("Auto"); ui->ir_sensor_combo_box->addItem(tr("Auto")); +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA const auto cameras = QCameraInfo::availableCameras(); for (const QCameraInfo& cameraInfo : cameras) { input_devices.push_back(cameraInfo.deviceName().toStdString()); ui->ir_sensor_combo_box->addItem(cameraInfo.description()); } +#endif const auto current_device = Settings::values.ir_sensor_device.GetValue(); diff --git a/src/yuzu/configuration/configure_camera.h b/src/yuzu/configuration/configure_camera.h index db9833b5c..9a90512b3 100644 --- a/src/yuzu/configuration/configure_camera.h +++ b/src/yuzu/configuration/configure_camera.h @@ -46,8 +46,10 @@ private: bool is_virtual_camera; int pending_snapshots; +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA std::unique_ptr<QCamera> camera; std::unique_ptr<QCameraImageCapture> camera_capture; +#endif std::unique_ptr<QTimer> camera_timer; std::vector<std::string> input_devices; std::unique_ptr<Ui::ConfigureCamera> ui; diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index bd69d04a6..f1385e972 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -63,6 +63,11 @@ ConfigureGraphics::ConfigureGraphics(const Core::System& system_, QWidget* paren ui->api_widget->isEnabled()); ui->bg_label->setVisible(Settings::IsConfiguringGlobal()); ui->bg_combobox->setVisible(!Settings::IsConfiguringGlobal()); + + connect(ui->fsr_sharpening_slider, &QSlider::valueChanged, this, + &ConfigureGraphics::SetFSRIndicatorText); + ui->fsr_sharpening_combobox->setVisible(!Settings::IsConfiguringGlobal()); + ui->fsr_sharpening_label->setVisible(Settings::IsConfiguringGlobal()); } void ConfigureGraphics::UpdateDeviceSelection(int device) { @@ -110,6 +115,7 @@ void ConfigureGraphics::SetConfiguration() { static_cast<int>(Settings::values.resolution_setup.GetValue())); ui->scaling_filter_combobox->setCurrentIndex( static_cast<int>(Settings::values.scaling_filter.GetValue())); + ui->fsr_sharpening_slider->setValue(Settings::values.fsr_sharpening_slider.GetValue()); ui->anti_aliasing_combobox->setCurrentIndex( static_cast<int>(Settings::values.anti_aliasing.GetValue())); } else { @@ -147,6 +153,15 @@ void ConfigureGraphics::SetConfiguration() { ConfigurationShared::SetHighlight(ui->anti_aliasing_label, !Settings::values.anti_aliasing.UsingGlobal()); + ui->fsr_sharpening_combobox->setCurrentIndex( + Settings::values.fsr_sharpening_slider.UsingGlobal() ? 0 : 1); + ui->fsr_sharpening_slider->setEnabled( + !Settings::values.fsr_sharpening_slider.UsingGlobal()); + ui->fsr_sharpening_value->setEnabled(!Settings::values.fsr_sharpening_slider.UsingGlobal()); + ConfigurationShared::SetHighlight(ui->fsr_sharpening_layout, + !Settings::values.fsr_sharpening_slider.UsingGlobal()); + ui->fsr_sharpening_slider->setValue(Settings::values.fsr_sharpening_slider.GetValue()); + ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal()); @@ -155,6 +170,12 @@ void ConfigureGraphics::SetConfiguration() { Settings::values.bg_green.GetValue(), Settings::values.bg_blue.GetValue())); UpdateAPILayout(); + SetFSRIndicatorText(ui->fsr_sharpening_slider->sliderPosition()); +} + +void ConfigureGraphics::SetFSRIndicatorText(int percentage) { + ui->fsr_sharpening_value->setText( + tr("%1%", "FSR sharpening percentage (e.g. 50%)").arg(100 - (percentage / 2))); } void ConfigureGraphics::ApplyConfiguration() { @@ -210,6 +231,7 @@ void ConfigureGraphics::ApplyConfiguration() { if (Settings::values.anti_aliasing.UsingGlobal()) { Settings::values.anti_aliasing.SetValue(anti_aliasing); } + Settings::values.fsr_sharpening_slider.SetValue(ui->fsr_sharpening_slider->value()); } else { if (ui->resolution_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { Settings::values.resolution_setup.SetGlobal(true); @@ -269,6 +291,13 @@ void ConfigureGraphics::ApplyConfiguration() { Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green())); Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue())); } + + if (ui->fsr_sharpening_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { + Settings::values.fsr_sharpening_slider.SetGlobal(true); + } else { + Settings::values.fsr_sharpening_slider.SetGlobal(false); + Settings::values.fsr_sharpening_slider.SetValue(ui->fsr_sharpening_slider->value()); + } } } @@ -380,6 +409,7 @@ void ConfigureGraphics::SetupPerGameUI() { ui->aspect_ratio_combobox->setEnabled(Settings::values.aspect_ratio.UsingGlobal()); ui->resolution_combobox->setEnabled(Settings::values.resolution_setup.UsingGlobal()); ui->scaling_filter_combobox->setEnabled(Settings::values.scaling_filter.UsingGlobal()); + ui->fsr_sharpening_slider->setEnabled(Settings::values.fsr_sharpening_slider.UsingGlobal()); ui->anti_aliasing_combobox->setEnabled(Settings::values.anti_aliasing.UsingGlobal()); ui->use_asynchronous_gpu_emulation->setEnabled( Settings::values.use_asynchronous_gpu_emulation.UsingGlobal()); @@ -387,6 +417,7 @@ void ConfigureGraphics::SetupPerGameUI() { ui->accelerate_astc->setEnabled(Settings::values.accelerate_astc.UsingGlobal()); ui->use_disk_shader_cache->setEnabled(Settings::values.use_disk_shader_cache.UsingGlobal()); ui->bg_button->setEnabled(Settings::values.bg_red.UsingGlobal()); + ui->fsr_slider_layout->setEnabled(Settings::values.fsr_sharpening_slider.UsingGlobal()); return; } @@ -396,6 +427,13 @@ void ConfigureGraphics::SetupPerGameUI() { ConfigurationShared::SetHighlight(ui->bg_layout, index == 1); }); + connect(ui->fsr_sharpening_combobox, qOverload<int>(&QComboBox::activated), this, + [this](int index) { + ui->fsr_sharpening_slider->setEnabled(index == 1); + ui->fsr_sharpening_value->setEnabled(index == 1); + ConfigurationShared::SetHighlight(ui->fsr_sharpening_layout, index == 1); + }); + ConfigurationShared::SetColoredTristate( ui->use_disk_shader_cache, Settings::values.use_disk_shader_cache, use_disk_shader_cache); ConfigurationShared::SetColoredTristate(ui->accelerate_astc, Settings::values.accelerate_astc, diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index 70034eb1b..d98d6624e 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h @@ -42,6 +42,8 @@ private: void RetrieveVulkanDevices(); + void SetFSRIndicatorText(int percentage); + void SetupPerGameUI(); Settings::RendererBackend GetCurrentGraphicsBackend() const; diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index fdbb33372..37271f956 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui @@ -152,6 +152,12 @@ </item> <item> <widget class="QGroupBox" name="groupBox"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> <property name="title"> <string>Graphics Settings</string> </property> @@ -482,6 +488,146 @@ </widget> </item> <item> + <widget class="QWidget" name="fsr_sharpening_layout" native="true"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="fsr_sharpening_label_group"> + <item> + <widget class="QComboBox" name="fsr_sharpening_combobox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>Use global FSR Sharpness</string> + </property> + </item> + <item> + <property name="text"> + <string>Set FSR Sharpness</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QLabel" name="fsr_sharpening_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>FSR Sharpness:</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="fsr_slider_layout"> + <property name="spacing"> + <number>6</number> + </property> + <item> + <widget class="QSlider" name="fsr_sharpening_slider"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximum"> + <number>200</number> + </property> + <property name="sliderPosition"> + <number>25</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="invertedAppearance"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="fsr_sharpening_value"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>32</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>100%</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> <widget class="QWidget" name="bg_layout" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index 10f841b98..235b813d9 100644 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp @@ -194,4 +194,8 @@ void ConfigureInputAdvanced::UpdateUIEnabled() { ui->mouse_panning->setEnabled(!ui->mouse_enabled->isChecked()); ui->mouse_panning_sensitivity->setEnabled(!ui->mouse_enabled->isChecked()); ui->ring_controller_configure->setEnabled(ui->enable_ring_controller->isChecked()); +#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0) || !defined(YUZU_USE_QT_MULTIMEDIA) + ui->enable_ir_sensor->setEnabled(false); + ui->camera_configure->setEnabled(false); +#endif } diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4081af391..2aae746f0 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -237,6 +237,7 @@ static void LogRuntimes() { LOG_INFO(Frontend, "Unable to inspect {}", runtime_dll_name); } #endif + LOG_INFO(Frontend, "Qt Compile: {} Runtime: {}", QT_VERSION_STR, qVersion()); } static QString PrettyProductName() { @@ -4217,10 +4218,12 @@ int main(int argc, char* argv[]) { // so we can see if we get \u3008 instead // TL;DR all other number formats are consecutive in unicode code points // This bug is fixed in Qt6, specifically 6.0.0-alpha1 +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) const QLocale locale = QLocale::system(); if (QStringLiteral("\u3008") == locale.toString(1)) { QLocale::setDefault(QLocale::system().name()); } +#endif // Qt changes the locale and causes issues in float conversion using std::to_string() when // generating shaders diff --git a/src/yuzu/multiplayer/direct_connect.cpp b/src/yuzu/multiplayer/direct_connect.cpp index 10bf0a4fb..cbd52da85 100644 --- a/src/yuzu/multiplayer/direct_connect.cpp +++ b/src/yuzu/multiplayer/direct_connect.cpp @@ -4,7 +4,7 @@ #include <QComboBox> #include <QFuture> #include <QIntValidator> -#include <QRegExpValidator> +#include <QRegularExpressionValidator> #include <QString> #include <QtConcurrent/QtConcurrentRun> #include "common/settings.h" diff --git a/src/yuzu/multiplayer/validation.h b/src/yuzu/multiplayer/validation.h index dabf860be..dd25af280 100644 --- a/src/yuzu/multiplayer/validation.h +++ b/src/yuzu/multiplayer/validation.h @@ -3,7 +3,7 @@ #pragma once -#include <QRegExp> +#include <QRegularExpression> #include <QString> #include <QValidator> @@ -29,19 +29,21 @@ public: private: /// room name can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 - QRegExp room_name_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); - QRegExpValidator room_name; + QRegularExpression room_name_regex = + QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); + QRegularExpressionValidator room_name; /// nickname can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 - QRegExp nickname_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); - QRegExpValidator nickname; + const QRegularExpression nickname_regex = + QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); + QRegularExpressionValidator nickname; /// ipv4 address only // TODO remove this when we support hostnames in direct connect - QRegExp ip_regex = QRegExp(QStringLiteral( + QRegularExpression ip_regex = QRegularExpression(QStringLiteral( "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|" "2[0-4][0-9]|25[0-5])")); - QRegExpValidator ip; + QRegularExpressionValidator ip; /// port must be between 0 and 65535 QIntValidator port; diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 70ab7276c..59f9c8e09 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -303,6 +303,7 @@ void Config::ReadValues() { ReadSetting("Renderer", Settings::values.resolution_setup); ReadSetting("Renderer", Settings::values.scaling_filter); + ReadSetting("Renderer", Settings::values.fsr_sharpening_slider); ReadSetting("Renderer", Settings::values.anti_aliasing); ReadSetting("Renderer", Settings::values.fullscreen_mode); ReadSetting("Renderer", Settings::values.aspect_ratio); diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index d214771b0..5bbc3f532 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -6,16 +6,22 @@ namespace DefaultINI { const char* sdl2_config_file = R"( -[ControlsGeneral] + +[ControlsP0] # The input devices and parameters for each Switch native input +# The config section determines the player number where the config will be applied on. For example "ControlsP0", "ControlsP1", ... # It should be in the format of "engine:[engine_name],[param1]:[value1],[param2]:[value2]..." # Escape characters $0 (for ':'), $1 (for ',') and $2 (for '$') can be used in values +# Indicates if this player should be connected at boot +connected= + # for button input, the following devices are available: # - "keyboard" (default) for keyboard input. Required parameters: # - "code": the code of the key to bind # - "sdl" for joystick input using SDL. Required parameters: -# - "joystick": the index of the joystick to bind +# - "guid": SDL identification GUID of the joystick +# - "port": the index of the joystick to bind # - "button"(optional): the index of the button to bind # - "hat"(optional): the index of the hat to bind as direction buttons # - "axis"(optional): the index of the axis to bind @@ -58,12 +64,29 @@ button_screenshot= # - "modifier_scale": a float number representing the applied modifier scale to the analog input. # Must be in range of 0.0-1.0. Defaults to 0.5 # - "sdl" for joystick input using SDL. Required parameters: -# - "joystick": the index of the joystick to bind +# - "guid": SDL identification GUID of the joystick +# - "port": the index of the joystick to bind # - "axis_x": the index of the axis to bind as x-axis (default to 0) # - "axis_y": the index of the axis to bind as y-axis (default to 1) lstick= rstick= +# for motion input, the following devices are available: +# - "keyboard" (default) for emulating random motion input from buttons. Required parameters: +# - "code": the code of the key to bind +# - "sdl" for motion input using SDL. Required parameters: +# - "guid": SDL identification GUID of the joystick +# - "port": the index of the joystick to bind +# - "motion": the index of the motion sensor to bind +# - "cemuhookudp" for motion input using Cemu Hook protocol. Required parameters: +# - "guid": the IP address of the cemu hook server encoded to a hex string. for example 192.168.0.1 = "c0a80001" +# - "port": the port of the cemu hook server +# - "pad": the index of the joystick +# - "motion": the index of the motion sensor of the joystick to bind +motionleft= +motionright= + +[ControlsGeneral] # To use the debug_pad, prepend `debug_pad_` before each button setting above. # i.e. debug_pad_button_a= diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 4ac72c2f6..37dd1747c 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -7,6 +7,7 @@ #include "common/scm_rev.h" #include "common/settings.h" #include "core/core.h" +#include "core/hid/hid_core.h" #include "core/perf_stats.h" #include "input_common/drivers/keyboard.h" #include "input_common/drivers/mouse.h" @@ -26,6 +27,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem_, Co } EmuWindow_SDL2::~EmuWindow_SDL2() { + system.HIDCore().UnloadInputDevices(); input_subsystem->Shutdown(); SDL_Quit(); } |