diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nfc/nfc_user.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/nfp/nfp_user.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/camera.h | 1 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 18 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.h | 8 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 5 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/startup_checks.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/util/overlay_dialog.cpp | 12 |
9 files changed, 37 insertions, 16 deletions
diff --git a/src/core/hle/service/nfc/nfc_user.cpp b/src/core/hle/service/nfc/nfc_user.cpp index 4615697e2..89aa6b3f5 100644 --- a/src/core/hle/service/nfc/nfc_user.cpp +++ b/src/core/hle/service/nfc/nfc_user.cpp | |||
| @@ -97,7 +97,7 @@ void IUser::IsNfcEnabled(Kernel::HLERequestContext& ctx) { | |||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | void IUser::ListDevices(Kernel::HLERequestContext& ctx) { | 99 | void IUser::ListDevices(Kernel::HLERequestContext& ctx) { |
| 100 | LOG_INFO(Service_NFC, "called"); | 100 | LOG_DEBUG(Service_NFC, "called"); |
| 101 | 101 | ||
| 102 | if (state == State::NonInitialized) { | 102 | if (state == State::NonInitialized) { |
| 103 | IPC::ResponseBuilder rb{ctx, 2}; | 103 | IPC::ResponseBuilder rb{ctx, 2}; |
diff --git a/src/core/hle/service/nfp/nfp_user.cpp b/src/core/hle/service/nfp/nfp_user.cpp index 49816b4c7..a4d3d1bc7 100644 --- a/src/core/hle/service/nfp/nfp_user.cpp +++ b/src/core/hle/service/nfp/nfp_user.cpp | |||
| @@ -83,7 +83,7 @@ void IUser::Finalize(Kernel::HLERequestContext& ctx) { | |||
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | void IUser::ListDevices(Kernel::HLERequestContext& ctx) { | 85 | void IUser::ListDevices(Kernel::HLERequestContext& ctx) { |
| 86 | LOG_INFO(Service_NFP, "called"); | 86 | LOG_DEBUG(Service_NFP, "called"); |
| 87 | 87 | ||
| 88 | if (state == State::NonInitialized) { | 88 | if (state == State::NonInitialized) { |
| 89 | IPC::ResponseBuilder rb{ctx, 2}; | 89 | IPC::ResponseBuilder rb{ctx, 2}; |
diff --git a/src/input_common/drivers/camera.h b/src/input_common/drivers/camera.h index 38fb1ae4c..ead3e0fde 100644 --- a/src/input_common/drivers/camera.h +++ b/src/input_common/drivers/camera.h | |||
| @@ -25,6 +25,7 @@ public: | |||
| 25 | Common::Input::CameraError SetCameraFormat(const PadIdentifier& identifier_, | 25 | Common::Input::CameraError SetCameraFormat(const PadIdentifier& identifier_, |
| 26 | Common::Input::CameraFormat camera_format) override; | 26 | Common::Input::CameraFormat camera_format) override; |
| 27 | 27 | ||
| 28 | private: | ||
| 28 | Common::Input::CameraStatus status{}; | 29 | Common::Input::CameraStatus status{}; |
| 29 | }; | 30 | }; |
| 30 | 31 | ||
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 682b37f47..1368b20d5 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -764,7 +764,9 @@ void GRenderWindow::InitializeCamera() { | |||
| 764 | return; | 764 | return; |
| 765 | } | 765 | } |
| 766 | 766 | ||
| 767 | camera_data.resize(CAMERA_WIDTH * CAMERA_HEIGHT); | 767 | const auto camera_width = input_subsystem->GetCamera()->getImageWidth(); |
| 768 | const auto camera_height = input_subsystem->GetCamera()->getImageHeight(); | ||
| 769 | camera_data.resize(camera_width * camera_height); | ||
| 768 | camera_capture->setCaptureDestination(QCameraImageCapture::CaptureDestination::CaptureToBuffer); | 770 | camera_capture->setCaptureDestination(QCameraImageCapture::CaptureDestination::CaptureToBuffer); |
| 769 | connect(camera_capture.get(), &QCameraImageCapture::imageCaptured, this, | 771 | connect(camera_capture.get(), &QCameraImageCapture::imageCaptured, this, |
| 770 | &GRenderWindow::OnCameraCapture); | 772 | &GRenderWindow::OnCameraCapture); |
| @@ -820,14 +822,22 @@ void GRenderWindow::RequestCameraCapture() { | |||
| 820 | } | 822 | } |
| 821 | 823 | ||
| 822 | void GRenderWindow::OnCameraCapture(int requestId, const QImage& img) { | 824 | void GRenderWindow::OnCameraCapture(int requestId, const QImage& img) { |
| 825 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 823 | // TODO: Capture directly in the format and resolution needed | 826 | // TODO: Capture directly in the format and resolution needed |
| 827 | const auto camera_width = input_subsystem->GetCamera()->getImageWidth(); | ||
| 828 | const auto camera_height = input_subsystem->GetCamera()->getImageHeight(); | ||
| 824 | const auto converted = | 829 | const auto converted = |
| 825 | img.scaled(CAMERA_WIDTH, CAMERA_HEIGHT, Qt::AspectRatioMode::IgnoreAspectRatio, | 830 | img.scaled(static_cast<int>(camera_width), static_cast<int>(camera_height), |
| 831 | Qt::AspectRatioMode::IgnoreAspectRatio, | ||
| 826 | Qt::TransformationMode::SmoothTransformation) | 832 | Qt::TransformationMode::SmoothTransformation) |
| 827 | .mirrored(false, true); | 833 | .mirrored(false, true); |
| 828 | std::memcpy(camera_data.data(), converted.bits(), CAMERA_WIDTH * CAMERA_HEIGHT * sizeof(u32)); | 834 | if (camera_data.size() != camera_width * camera_height) { |
| 829 | input_subsystem->GetCamera()->SetCameraData(CAMERA_WIDTH, CAMERA_HEIGHT, camera_data); | 835 | camera_data.resize(camera_width * camera_height); |
| 836 | } | ||
| 837 | std::memcpy(camera_data.data(), converted.bits(), camera_width * camera_height * sizeof(u32)); | ||
| 838 | input_subsystem->GetCamera()->SetCameraData(camera_width, camera_height, camera_data); | ||
| 830 | pending_camera_snapshots = 0; | 839 | pending_camera_snapshots = 0; |
| 840 | #endif | ||
| 831 | } | 841 | } |
| 832 | 842 | ||
| 833 | bool GRenderWindow::event(QEvent* event) { | 843 | bool GRenderWindow::event(QEvent* event) { |
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index 5bbcf61f7..b24141fd9 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h | |||
| @@ -242,16 +242,14 @@ private: | |||
| 242 | bool first_frame = false; | 242 | bool first_frame = false; |
| 243 | InputCommon::TasInput::TasState last_tas_state; | 243 | InputCommon::TasInput::TasState last_tas_state; |
| 244 | 244 | ||
| 245 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 245 | bool is_virtual_camera; | 246 | bool is_virtual_camera; |
| 246 | int pending_camera_snapshots; | 247 | int pending_camera_snapshots; |
| 247 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | 248 | std::vector<u32> camera_data; |
| 248 | std::unique_ptr<QCamera> camera; | 249 | std::unique_ptr<QCamera> camera; |
| 249 | std::unique_ptr<QCameraImageCapture> camera_capture; | 250 | std::unique_ptr<QCameraImageCapture> camera_capture; |
| 250 | static constexpr std::size_t CAMERA_WIDTH = 320; | ||
| 251 | static constexpr std::size_t CAMERA_HEIGHT = 240; | ||
| 252 | std::vector<u32> camera_data; | ||
| 253 | #endif | ||
| 254 | std::unique_ptr<QTimer> camera_timer; | 251 | std::unique_ptr<QTimer> camera_timer; |
| 252 | #endif | ||
| 255 | 253 | ||
| 256 | Core::System& system; | 254 | Core::System& system; |
| 257 | 255 | ||
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index a8d47a2f9..2ea4f367b 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -783,8 +783,6 @@ void Config::ReadSystemValues() { | |||
| 783 | } | 783 | } |
| 784 | } | 784 | } |
| 785 | 785 | ||
| 786 | ReadBasicSetting(Settings::values.device_name); | ||
| 787 | |||
| 788 | if (global) { | 786 | if (global) { |
| 789 | ReadBasicSetting(Settings::values.current_user); | 787 | ReadBasicSetting(Settings::values.current_user); |
| 790 | Settings::values.current_user = std::clamp<int>(Settings::values.current_user.GetValue(), 0, | 788 | Settings::values.current_user = std::clamp<int>(Settings::values.current_user.GetValue(), 0, |
| @@ -797,6 +795,7 @@ void Config::ReadSystemValues() { | |||
| 797 | } else { | 795 | } else { |
| 798 | Settings::values.custom_rtc = std::nullopt; | 796 | Settings::values.custom_rtc = std::nullopt; |
| 799 | } | 797 | } |
| 798 | ReadBasicSetting(Settings::values.device_name); | ||
| 800 | } | 799 | } |
| 801 | 800 | ||
| 802 | ReadGlobalSetting(Settings::values.sound_index); | 801 | ReadGlobalSetting(Settings::values.sound_index); |
| @@ -1407,7 +1406,6 @@ void Config::SaveSystemValues() { | |||
| 1407 | Settings::values.rng_seed.UsingGlobal()); | 1406 | Settings::values.rng_seed.UsingGlobal()); |
| 1408 | WriteSetting(QStringLiteral("rng_seed"), Settings::values.rng_seed.GetValue(global).value_or(0), | 1407 | WriteSetting(QStringLiteral("rng_seed"), Settings::values.rng_seed.GetValue(global).value_or(0), |
| 1409 | 0, Settings::values.rng_seed.UsingGlobal()); | 1408 | 0, Settings::values.rng_seed.UsingGlobal()); |
| 1410 | WriteBasicSetting(Settings::values.device_name); | ||
| 1411 | 1409 | ||
| 1412 | if (global) { | 1410 | if (global) { |
| 1413 | WriteBasicSetting(Settings::values.current_user); | 1411 | WriteBasicSetting(Settings::values.current_user); |
| @@ -1416,6 +1414,7 @@ void Config::SaveSystemValues() { | |||
| 1416 | false); | 1414 | false); |
| 1417 | WriteSetting(QStringLiteral("custom_rtc"), | 1415 | WriteSetting(QStringLiteral("custom_rtc"), |
| 1418 | QVariant::fromValue<long long>(Settings::values.custom_rtc.value_or(0)), 0); | 1416 | QVariant::fromValue<long long>(Settings::values.custom_rtc.value_or(0)), 0); |
| 1417 | WriteBasicSetting(Settings::values.device_name); | ||
| 1419 | } | 1418 | } |
| 1420 | 1419 | ||
| 1421 | WriteGlobalSetting(Settings::values.sound_index); | 1420 | WriteGlobalSetting(Settings::values.sound_index); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 2e6c2311a..fe140dce0 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -2661,6 +2661,9 @@ void GMainWindow::OnMenuInstallToNAND() { | |||
| 2661 | return; | 2661 | return; |
| 2662 | } | 2662 | } |
| 2663 | 2663 | ||
| 2664 | // Save folder location of the first selected file | ||
| 2665 | UISettings::values.roms_path = QFileInfo(filenames[0]).path(); | ||
| 2666 | |||
| 2664 | int remaining = filenames.size(); | 2667 | int remaining = filenames.size(); |
| 2665 | 2668 | ||
| 2666 | // This would only overflow above 2^43 bytes (8.796 TB) | 2669 | // This would only overflow above 2^43 bytes (8.796 TB) |
diff --git a/src/yuzu/startup_checks.cpp b/src/yuzu/startup_checks.cpp index 563818362..9f702fe95 100644 --- a/src/yuzu/startup_checks.cpp +++ b/src/yuzu/startup_checks.cpp | |||
| @@ -186,7 +186,7 @@ pid_t SpawnChild(const char* arg0) { | |||
| 186 | return pid; | 186 | return pid; |
| 187 | } else if (pid == 0) { | 187 | } else if (pid == 0) { |
| 188 | // child | 188 | // child |
| 189 | execl(arg0, arg0, nullptr); | 189 | execlp(arg0, arg0, nullptr); |
| 190 | const int err = errno; | 190 | const int err = errno; |
| 191 | fmt::print(stderr, "execl failed with error {}\n", err); | 191 | fmt::print(stderr, "execl failed with error {}\n", err); |
| 192 | _exit(0); | 192 | _exit(0); |
diff --git a/src/yuzu/util/overlay_dialog.cpp b/src/yuzu/util/overlay_dialog.cpp index b27954512..3fa3d0afb 100644 --- a/src/yuzu/util/overlay_dialog.cpp +++ b/src/yuzu/util/overlay_dialog.cpp | |||
| @@ -42,7 +42,7 @@ OverlayDialog::OverlayDialog(QWidget* parent, Core::System& system, const QStrin | |||
| 42 | MoveAndResizeWindow(); | 42 | MoveAndResizeWindow(); |
| 43 | 43 | ||
| 44 | // TODO (Morph): Remove this when InputInterpreter no longer relies on the HID backend | 44 | // TODO (Morph): Remove this when InputInterpreter no longer relies on the HID backend |
| 45 | if (system.IsPoweredOn()) { | 45 | if (system.IsPoweredOn() && !ui->buttonsDialog->isHidden()) { |
| 46 | input_interpreter = std::make_unique<InputInterpreter>(system); | 46 | input_interpreter = std::make_unique<InputInterpreter>(system); |
| 47 | 47 | ||
| 48 | StartInputThread(); | 48 | StartInputThread(); |
| @@ -83,6 +83,11 @@ void OverlayDialog::InitializeRegularTextDialog(const QString& title_text, const | |||
| 83 | ui->button_ok_label->setEnabled(false); | 83 | ui->button_ok_label->setEnabled(false); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | if (ui->button_cancel->isHidden() && ui->button_ok_label->isHidden()) { | ||
| 87 | ui->buttonsDialog->hide(); | ||
| 88 | return; | ||
| 89 | } | ||
| 90 | |||
| 86 | connect( | 91 | connect( |
| 87 | ui->button_cancel, &QPushButton::clicked, this, | 92 | ui->button_cancel, &QPushButton::clicked, this, |
| 88 | [this](bool) { | 93 | [this](bool) { |
| @@ -130,6 +135,11 @@ void OverlayDialog::InitializeRichTextDialog(const QString& title_text, const QS | |||
| 130 | ui->button_ok_rich->setEnabled(false); | 135 | ui->button_ok_rich->setEnabled(false); |
| 131 | } | 136 | } |
| 132 | 137 | ||
| 138 | if (ui->button_cancel_rich->isHidden() && ui->button_ok_rich->isHidden()) { | ||
| 139 | ui->buttonsRichDialog->hide(); | ||
| 140 | return; | ||
| 141 | } | ||
| 142 | |||
| 133 | connect( | 143 | connect( |
| 134 | ui->button_cancel_rich, &QPushButton::clicked, this, | 144 | ui->button_cancel_rich, &QPushButton::clicked, this, |
| 135 | [this](bool) { | 145 | [this](bool) { |