summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/nfc/nfc_user.cpp2
-rw-r--r--src/core/hle/service/nfp/nfp_user.cpp2
-rw-r--r--src/input_common/drivers/camera.h1
-rw-r--r--src/yuzu/bootmanager.cpp18
-rw-r--r--src/yuzu/bootmanager.h8
-rw-r--r--src/yuzu/configuration/config.cpp5
-rw-r--r--src/yuzu/main.cpp3
-rw-r--r--src/yuzu/startup_checks.cpp2
-rw-r--r--src/yuzu/util/overlay_dialog.cpp12
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) {
}
void IUser::ListDevices(Kernel::HLERequestContext& ctx) {
- LOG_INFO(Service_NFC, "called");
+ LOG_DEBUG(Service_NFC, "called");
if (state == State::NonInitialized) {
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) {
}
void IUser::ListDevices(Kernel::HLERequestContext& ctx) {
- LOG_INFO(Service_NFP, "called");
+ LOG_DEBUG(Service_NFP, "called");
if (state == State::NonInitialized) {
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:
Common::Input::CameraError SetCameraFormat(const PadIdentifier& identifier_,
Common::Input::CameraFormat camera_format) override;
+private:
Common::Input::CameraStatus status{};
};
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() {
return;
}
- camera_data.resize(CAMERA_WIDTH * CAMERA_HEIGHT);
+ const auto camera_width = input_subsystem->GetCamera()->getImageWidth();
+ const auto camera_height = input_subsystem->GetCamera()->getImageHeight();
+ camera_data.resize(camera_width * camera_height);
camera_capture->setCaptureDestination(QCameraImageCapture::CaptureDestination::CaptureToBuffer);
connect(camera_capture.get(), &QCameraImageCapture::imageCaptured, this,
&GRenderWindow::OnCameraCapture);
@@ -820,14 +822,22 @@ void GRenderWindow::RequestCameraCapture() {
}
void GRenderWindow::OnCameraCapture(int requestId, const QImage& img) {
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
// TODO: Capture directly in the format and resolution needed
+ const auto camera_width = input_subsystem->GetCamera()->getImageWidth();
+ const auto camera_height = input_subsystem->GetCamera()->getImageHeight();
const auto converted =
- img.scaled(CAMERA_WIDTH, CAMERA_HEIGHT, Qt::AspectRatioMode::IgnoreAspectRatio,
+ img.scaled(static_cast<int>(camera_width), static_cast<int>(camera_height),
+ Qt::AspectRatioMode::IgnoreAspectRatio,
Qt::TransformationMode::SmoothTransformation)
.mirrored(false, true);
- std::memcpy(camera_data.data(), converted.bits(), CAMERA_WIDTH * CAMERA_HEIGHT * sizeof(u32));
- input_subsystem->GetCamera()->SetCameraData(CAMERA_WIDTH, CAMERA_HEIGHT, camera_data);
+ if (camera_data.size() != camera_width * camera_height) {
+ camera_data.resize(camera_width * camera_height);
+ }
+ std::memcpy(camera_data.data(), converted.bits(), camera_width * camera_height * sizeof(u32));
+ input_subsystem->GetCamera()->SetCameraData(camera_width, camera_height, camera_data);
pending_camera_snapshots = 0;
+#endif
}
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:
bool first_frame = false;
InputCommon::TasInput::TasState last_tas_state;
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
bool is_virtual_camera;
int pending_camera_snapshots;
-#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
+ std::vector<u32> camera_data;
std::unique_ptr<QCamera> camera;
std::unique_ptr<QCameraImageCapture> camera_capture;
- static constexpr std::size_t CAMERA_WIDTH = 320;
- static constexpr std::size_t CAMERA_HEIGHT = 240;
- std::vector<u32> camera_data;
-#endif
std::unique_ptr<QTimer> camera_timer;
+#endif
Core::System& system;
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() {
}
}
- ReadBasicSetting(Settings::values.device_name);
-
if (global) {
ReadBasicSetting(Settings::values.current_user);
Settings::values.current_user = std::clamp<int>(Settings::values.current_user.GetValue(), 0,
@@ -797,6 +795,7 @@ void Config::ReadSystemValues() {
} else {
Settings::values.custom_rtc = std::nullopt;
}
+ ReadBasicSetting(Settings::values.device_name);
}
ReadGlobalSetting(Settings::values.sound_index);
@@ -1407,7 +1406,6 @@ void Config::SaveSystemValues() {
Settings::values.rng_seed.UsingGlobal());
WriteSetting(QStringLiteral("rng_seed"), Settings::values.rng_seed.GetValue(global).value_or(0),
0, Settings::values.rng_seed.UsingGlobal());
- WriteBasicSetting(Settings::values.device_name);
if (global) {
WriteBasicSetting(Settings::values.current_user);
@@ -1416,6 +1414,7 @@ void Config::SaveSystemValues() {
false);
WriteSetting(QStringLiteral("custom_rtc"),
QVariant::fromValue<long long>(Settings::values.custom_rtc.value_or(0)), 0);
+ WriteBasicSetting(Settings::values.device_name);
}
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() {
return;
}
+ // Save folder location of the first selected file
+ UISettings::values.roms_path = QFileInfo(filenames[0]).path();
+
int remaining = filenames.size();
// 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) {
return pid;
} else if (pid == 0) {
// child
- execl(arg0, arg0, nullptr);
+ execlp(arg0, arg0, nullptr);
const int err = errno;
fmt::print(stderr, "execl failed with error {}\n", err);
_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
MoveAndResizeWindow();
// TODO (Morph): Remove this when InputInterpreter no longer relies on the HID backend
- if (system.IsPoweredOn()) {
+ if (system.IsPoweredOn() && !ui->buttonsDialog->isHidden()) {
input_interpreter = std::make_unique<InputInterpreter>(system);
StartInputThread();
@@ -83,6 +83,11 @@ void OverlayDialog::InitializeRegularTextDialog(const QString& title_text, const
ui->button_ok_label->setEnabled(false);
}
+ if (ui->button_cancel->isHidden() && ui->button_ok_label->isHidden()) {
+ ui->buttonsDialog->hide();
+ return;
+ }
+
connect(
ui->button_cancel, &QPushButton::clicked, this,
[this](bool) {
@@ -130,6 +135,11 @@ void OverlayDialog::InitializeRichTextDialog(const QString& title_text, const QS
ui->button_ok_rich->setEnabled(false);
}
+ if (ui->button_cancel_rich->isHidden() && ui->button_ok_rich->isHidden()) {
+ ui->buttonsRichDialog->hide();
+ return;
+ }
+
connect(
ui->button_cancel_rich, &QPushButton::clicked, this,
[this](bool) {