From 8bb254664fb22b48f9f1ea4030d2abeb65f0f006 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 18 Dec 2022 17:39:01 +0100 Subject: [PATCH] early-access version 3229 --- README.md | 2 +- src/input_common/drivers/camera.h | 1 + .../host_shaders/vulkan_quad_indexed.comp | 5 +++-- src/yuzu/bootmanager.cpp | 18 ++++++++++++++---- src/yuzu/bootmanager.h | 8 +++----- src/yuzu/configuration/config.cpp | 5 ++--- src/yuzu/main.cpp | 3 +++ 7 files changed, 27 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c66d1e0cd..2ee3ef3b6 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3228. +This is the source code for early-access 3229. ## Legal Notice diff --git a/src/input_common/drivers/camera.h b/src/input_common/drivers/camera.h index 257cdc7c2..833ca0768 100755 --- 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/video_core/host_shaders/vulkan_quad_indexed.comp b/src/video_core/host_shaders/vulkan_quad_indexed.comp index 53f116b58..e032f06f0 100755 --- a/src/video_core/host_shaders/vulkan_quad_indexed.comp +++ b/src/video_core/host_shaders/vulkan_quad_indexed.comp @@ -29,9 +29,10 @@ void main() { int flipped_shift = 2 - index_shift; int mask = (1 << flipped_shift) - 1; - const int quad_swizzle[6] = (is_strip == 0 ? int[](0, 1, 2, 0, 2, 3) : int[](0, 3, 1, 0, 2, 3)); + const int quads_swizzle[6] = int[](0, 1, 2, 0, 2, 3); + const int quad_strip_swizzle[6] = int[](0, 3, 1, 0, 2, 3); for (uint vertex = 0; vertex < 6; ++vertex) { - int offset = quad_swizzle[vertex] + (is_strip == 0 ? primitive * 4 : primitive * 2); + int offset = (is_strip == 0 ? primitive * 4 + quads_swizzle[vertex] : primitive * 2 + quad_strip_swizzle[vertex]); int int_offset = offset >> flipped_shift; int bit_offset = (offset & mask) * index_size; uint packed_input = input_indexes[int_offset]; diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 40f14ea3e..306de635e 100755 --- 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(camera_width), static_cast(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 478d324c5..37fcf41aa 100755 --- 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 camera_data; std::unique_ptr camera; std::unique_ptr camera_capture; - static constexpr std::size_t CAMERA_WIDTH = 320; - static constexpr std::size_t CAMERA_HEIGHT = 240; - std::vector camera_data; -#endif std::unique_ptr camera_timer; +#endif Core::System& system; diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 746dcdd8f..69587eb66 100755 --- 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(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(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 aa725d8c2..666a1cf81 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2660,6 +2660,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)