Compare commits

..

12 Commits

Author SHA1 Message Date
ameerj
1ea303e2af ci: Use ubuntu-latest vmImage where applicable
Not specifying the vmImage defaults to ubuntu-16.04, which will be deprecated soon and is experiencing brownouts.
2021-10-11 16:57:41 -04:00
Morph
97452b9558 Merge pull request #7110 from vonchenplus/fix_extract_offline_romefs_error
applets/web: Fallback to loader to get the manual romfs if none is found
2021-10-11 02:09:42 -04:00
Feng Chen
0ee2185c59 applets/web: Fallback to loader to get the manual romfs if none is found 2021-10-11 13:12:51 +08:00
Ameer J
4fbec776d6 Merge pull request #7152 from v1993/patch-6
vic: Allow surface to be higher than frame
2021-10-09 15:51:05 -04:00
Valeri
0394e4bb8e vic: Allow surface to be higher than frame
Touhou Genso Wanderer Lotus Labyrinth R decodes 1920x1080 videos into 1920x1088 surface.
Only allow mismatch for height, since larger width would result in increasingly offset rows and somewhat defeat entire purpose of this check.
2021-10-09 20:22:09 +03:00
Mai M
39cd6306e6 Merge pull request #7138 from ameerj/vic-fmt
vic: Implement RGBX8 video frame format
2021-10-08 19:19:20 -04:00
ameerj
403fc86c11 vic: Avoid memory corruption when multiple streams with different dimensions are decoded
This is a work around to avoid buffer overflow errors until multi channel/multi stream decoding is supported.
2021-10-08 01:22:38 -04:00
Mai M
c317504b5f Merge pull request #7139 from Morph1984/service-headers
service: Reduce header include overhead
2021-10-07 21:17:19 -04:00
ameerj
5aae61775f vic: Refactor frame writing methods 2021-10-07 14:56:44 -04:00
Morph
bea7824bd1 kernel: hle_ipc: Foward declare KAutoObject 2021-10-07 13:32:36 -04:00
Morph
7bb2dd75cd service: Reduce header include overhead 2021-10-07 13:32:21 -04:00
ameerj
899fdb9c44 vic: Implement RGBX frame format 2021-10-07 11:06:57 -04:00
114 changed files with 857 additions and 894 deletions

View File

@@ -1,6 +1,8 @@
jobs:
- job: merge
displayName: 'pull requests'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: recursive
@@ -24,6 +26,8 @@ jobs:
- job: upload_source
displayName: 'upload'
dependsOn: merge
pool:
vmImage: 'ubuntu-latest'
steps:
- template: ./sync-source.yml
parameters:

View File

@@ -1,6 +1,8 @@
jobs:
- job: merge
displayName: 'pull requests'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: recursive
@@ -23,6 +25,8 @@ jobs:
- job: upload_source
displayName: 'upload'
dependsOn: merge
pool:
vmImage: 'ubuntu-latest'
steps:
- template: ./sync-source.yml
parameters:

View File

@@ -66,5 +66,7 @@ stages:
jobs:
- job: github
displayName: 'github'
pool:
vmImage: ubuntu-latest
steps:
- template: ./templates/release-github.yml

View File

@@ -29,5 +29,7 @@ stages:
jobs:
- job: release
displayName: 'source'
pool:
vmImage: 'ubuntu-latest'
steps:
- template: ./templates/release-private-tag.yml

View File

@@ -4,17 +4,14 @@
#pragma once
#include <array>
#include <cstring>
#include <memory>
#include <tuple>
#include <type_traits>
#include <utility>
#include "common/assert.h"
#include "common/common_types.h"
#include "core/hle/ipc.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_client_port.h"
#include "core/hle/kernel/k_process.h"
#include "core/hle/kernel/k_resource_limit.h"
#include "core/hle/kernel/k_session.h"

View File

@@ -15,6 +15,7 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_auto_object.h"
#include "core/hle/kernel/k_handle_table.h"
#include "core/hle/kernel/k_process.h"
#include "core/hle/kernel/k_readable_event.h"

View File

@@ -17,7 +17,6 @@
#include "common/concepts.h"
#include "common/swap.h"
#include "core/hle/ipc.h"
#include "core/hle/kernel/k_auto_object.h"
#include "core/hle/kernel/svc_common.h"
union ResultCode;
@@ -38,6 +37,7 @@ namespace Kernel {
class Domain;
class HLERequestContext;
class KAutoObject;
class KernelCore;
class KHandleTable;
class KProcess;

View File

@@ -5,7 +5,7 @@
#pragma once
#include <memory>
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/service.h"
namespace Service {

View File

@@ -5,7 +5,7 @@
#pragma once
#include <memory>
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/service.h"
namespace Service {

View File

@@ -24,6 +24,7 @@
#include "core/hle/service/am/applets/applet_web_browser.h"
#include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/ns/pl_u.h"
#include "core/loader/loader.h"
namespace Service::AM::Applets {
@@ -122,6 +123,15 @@ FileSys::VirtualFile GetOfflineRomFS(Core::System& system, u64 title_id,
const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type);
if (nca == nullptr) {
if (nca_type == FileSys::ContentRecordType::HtmlDocument) {
LOG_WARNING(Service_AM, "Falling back to AppLoader to get the RomFS.");
FileSys::VirtualFile romfs;
system.GetAppLoader().ReadManualRomFS(romfs);
if (romfs != nullptr) {
return romfs;
}
}
LOG_ERROR(Service_AM,
"NCA of type={} with title_id={:016X} is not found in the ContentProvider!",
nca_type, title_id);

View File

@@ -5,7 +5,6 @@
#include "common/logging/log.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_event.h"
#include "core/hle/service/audio/audin_u.h"

View File

@@ -13,7 +13,6 @@
#include "common/swap.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/audio/audout_u.h"

View File

@@ -15,7 +15,6 @@
#include "common/string_util.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/audio/audren_u.h"

View File

@@ -13,7 +13,6 @@
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/hwopus.h"
namespace Service::Audio {

View File

@@ -5,7 +5,6 @@
#include "common/logging/log.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/btdrv/btdrv.h"

View File

@@ -7,7 +7,6 @@
#include "common/logging/log.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/btm/btm.h"

View File

@@ -4,7 +4,8 @@
#pragma once
#include "core/hle/service/service.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
namespace Core {
class System;

View File

@@ -5,7 +5,6 @@
#include <memory>
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/fgm/fgm.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"

View File

@@ -3,7 +3,6 @@
// Refer to the license.txt file included.
#include "core/hle/service/filesystem/fsp_ldr.h"
#include "core/hle/service/service.h"
namespace Service::FileSystem {

View File

@@ -3,7 +3,6 @@
// Refer to the license.txt file included.
#include "core/hle/service/filesystem/fsp_pr.h"
#include "core/hle/service/service.h"
namespace Service::FileSystem {

View File

@@ -8,13 +8,11 @@
#include "core/core.h"
#include "core/file_sys/control_metadata.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_process.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/glue/arp.h"
#include "core/hle/service/glue/errors.h"
#include "core/hle/service/glue/glue_manager.h"
#include "core/hle/service/service.h"
namespace Service::Glue {

View File

@@ -8,12 +8,9 @@
#include "common/settings.h"
#include "core/core.h"
#include "core/core_timing.h"
#include "core/core_timing_util.h"
#include "core/frontend/emu_window.h"
#include "core/frontend/input.h"
#include "core/hardware_properties.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/k_client_port.h"
#include "core/hle/kernel/k_readable_event.h"
#include "core/hle/kernel/k_shared_memory.h"
#include "core/hle/kernel/k_transfer_memory.h"
@@ -23,7 +20,6 @@
#include "core/hle/service/hid/hid.h"
#include "core/hle/service/hid/irs.h"
#include "core/hle/service/hid/xcd.h"
#include "core/hle/service/service.h"
#include "core/memory.h"
#include "core/hle/service/hid/controllers/console_sixaxis.h"

View File

@@ -7,7 +7,6 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/lbl/lbl.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"

View File

@@ -6,7 +6,6 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/mii/mii.h"
#include "core/hle/service/mii/mii_manager.h"
#include "core/hle/service/service.h"

View File

@@ -7,7 +7,6 @@
#include "common/logging/log.h"
#include "common/settings.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/nfc/nfc.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"

View File

@@ -9,7 +9,6 @@
#include "core/file_sys/patch_manager.h"
#include "core/file_sys/vfs.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/ns/errors.h"
#include "core/hle/service/ns/language.h"
#include "core/hle/service/ns/ns.h"

View File

@@ -3,7 +3,6 @@
// Refer to the license.txt file included.
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/olsc/olsc.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"

View File

@@ -7,7 +7,6 @@
#include "core/file_sys/errors.h"
#include "core/file_sys/system_archive/system_version.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/k_client_port.h"
#include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/set/set_sys.h"

View File

@@ -5,11 +5,9 @@
#pragma once
#include <memory>
#include <string_view>
#include <vector>
#include "common/common_types.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sockets/sockets.h"

View File

@@ -4,7 +4,6 @@
#pragma once
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/service.h"
namespace Core {

View File

@@ -4,13 +4,17 @@
#pragma once
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "core/hle/service/service.h"
namespace Core {
class System;
}
namespace Service::SM {
class ServiceManager;
}
namespace Service::Sockets {
enum class Errno : u32 {

View File

@@ -3,10 +3,8 @@
// Refer to the license.txt file included.
#include <algorithm>
#include <chrono>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <vector>
#include "common/logging/log.h"
#include "common/settings.h"

View File

@@ -3,7 +3,6 @@
// Refer to the license.txt file included.
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"
#include "core/hle/service/ssl/ssl.h"

View File

@@ -8,11 +8,11 @@
#include "core/core_timing_util.h"
#include "core/hardware_properties.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/k_client_port.h"
#include "core/hle/kernel/k_scheduler.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/time/time.h"
#include "core/hle/service/time/time_interface.h"
#include "core/hle/service/time/time_manager.h"
#include "core/hle/service/time/time_sharedmemory.h"
#include "core/hle/service/time/time_zone_service.h"

View File

@@ -6,7 +6,6 @@
#include "core/hle/service/service.h"
#include "core/hle/service/time/clock_types.h"
#include "core/hle/service/time/time_manager.h"
namespace Core {
class System;

View File

@@ -6,7 +6,6 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"
#include "core/hle/service/usb/usb.h"

View File

@@ -4,7 +4,6 @@
#pragma once
#include <memory>
#include "common/common_types.h"
namespace Core {

View File

@@ -16,6 +16,7 @@ extern "C" {
}
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/logging/log.h"
#include "video_core/command_classes/nvdec.h"
@@ -26,6 +27,25 @@ extern "C" {
#include "video_core/textures/decoders.h"
namespace Tegra {
namespace {
enum class VideoPixelFormat : u64_le {
RGBA8 = 0x1f,
BGRA8 = 0x20,
RGBX8 = 0x23,
Yuv420 = 0x44,
};
} // Anonymous namespace
union VicConfig {
u64_le raw{};
BitField<0, 7, VideoPixelFormat> pixel_format;
BitField<7, 2, u64_le> chroma_loc_horiz;
BitField<9, 2, u64_le> chroma_loc_vert;
BitField<11, 4, u64_le> block_linear_kind;
BitField<15, 4, u64_le> block_linear_height_log2;
BitField<32, 14, u64_le> surface_width_minus1;
BitField<46, 14, u64_le> surface_height_minus1;
};
Vic::Vic(GPU& gpu_, std::shared_ptr<Nvdec> nvdec_processor_)
: gpu(gpu_),
@@ -65,134 +85,156 @@ void Vic::Execute() {
if (!frame) {
return;
}
const auto pixel_format = static_cast<VideoPixelFormat>(config.pixel_format.Value());
switch (pixel_format) {
const u64 surface_width = config.surface_width_minus1 + 1;
const u64 surface_height = config.surface_height_minus1 + 1;
if (static_cast<u64>(frame->width) != surface_width ||
static_cast<u64>(frame->height) > surface_height) {
// TODO: Properly support multiple video streams with differing frame dimensions
LOG_WARNING(Debug,
"Frame dimensions {}x{} can't be safely decoded into surface dimensions {}x{}",
frame->width, frame->height, surface_width, surface_height);
return;
}
switch (config.pixel_format) {
case VideoPixelFormat::RGBA8:
case VideoPixelFormat::BGRA8:
case VideoPixelFormat::RGBA8: {
LOG_TRACE(Service_NVDRV, "Writing RGB Frame");
if (scaler_ctx == nullptr || frame->width != scaler_width ||
frame->height != scaler_height) {
const AVPixelFormat target_format =
(pixel_format == VideoPixelFormat::RGBA8) ? AV_PIX_FMT_RGBA : AV_PIX_FMT_BGRA;
sws_freeContext(scaler_ctx);
scaler_ctx = nullptr;
// Frames are decoded into either YUV420 or NV12 formats. Convert to desired format
scaler_ctx = sws_getContext(frame->width, frame->height,
static_cast<AVPixelFormat>(frame->format), frame->width,
frame->height, target_format, 0, nullptr, nullptr, nullptr);
scaler_width = frame->width;
scaler_height = frame->height;
}
// Get Converted frame
const u32 width = static_cast<u32>(frame->width);
const u32 height = static_cast<u32>(frame->height);
const std::size_t linear_size = width * height * 4;
// Only allocate frame_buffer once per stream, as the size is not expected to change
if (!converted_frame_buffer) {
converted_frame_buffer = AVMallocPtr{static_cast<u8*>(av_malloc(linear_size)), av_free};
}
const std::array<int, 4> converted_stride{frame->width * 4, frame->height * 4, 0, 0};
u8* const converted_frame_buf_addr{converted_frame_buffer.get()};
sws_scale(scaler_ctx, frame->data, frame->linesize, 0, frame->height,
&converted_frame_buf_addr, converted_stride.data());
const u32 blk_kind = static_cast<u32>(config.block_linear_kind);
if (blk_kind != 0) {
// swizzle pitch linear to block linear
const u32 block_height = static_cast<u32>(config.block_linear_height_log2);
const auto size =
Tegra::Texture::CalculateSize(true, 4, width, height, 1, block_height, 0);
luma_buffer.resize(size);
Tegra::Texture::SwizzleSubrect(width, height, width * 4, width, 4, luma_buffer.data(),
converted_frame_buffer.get(), block_height, 0, 0);
gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), size);
} else {
// send pitch linear frame
gpu.MemoryManager().WriteBlock(output_surface_luma_address, converted_frame_buf_addr,
linear_size);
}
case VideoPixelFormat::RGBX8:
WriteRGBFrame(frame, config);
break;
}
case VideoPixelFormat::Yuv420: {
LOG_TRACE(Service_NVDRV, "Writing YUV420 Frame");
const std::size_t surface_width = config.surface_width_minus1 + 1;
const std::size_t surface_height = config.surface_height_minus1 + 1;
const auto frame_width = std::min(surface_width, static_cast<size_t>(frame->width));
const auto frame_height = std::min(surface_height, static_cast<size_t>(frame->height));
const std::size_t aligned_width = (surface_width + 0xff) & ~0xffUL;
const auto stride = static_cast<size_t>(frame->linesize[0]);
luma_buffer.resize(aligned_width * surface_height);
chroma_buffer.resize(aligned_width * surface_height / 2);
// Populate luma buffer
const u8* luma_src = frame->data[0];
for (std::size_t y = 0; y < frame_height; ++y) {
const std::size_t src = y * stride;
const std::size_t dst = y * aligned_width;
for (std::size_t x = 0; x < frame_width; ++x) {
luma_buffer[dst + x] = luma_src[src + x];
}
}
gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(),
luma_buffer.size());
// Chroma
const std::size_t half_height = frame_height / 2;
const auto half_stride = static_cast<size_t>(frame->linesize[1]);
switch (frame->format) {
case AV_PIX_FMT_YUV420P: {
// Frame from FFmpeg software
// Populate chroma buffer from both channels with interleaving.
const std::size_t half_width = frame_width / 2;
const u8* chroma_b_src = frame->data[1];
const u8* chroma_r_src = frame->data[2];
for (std::size_t y = 0; y < half_height; ++y) {
const std::size_t src = y * half_stride;
const std::size_t dst = y * aligned_width;
for (std::size_t x = 0; x < half_width; ++x) {
chroma_buffer[dst + x * 2] = chroma_b_src[src + x];
chroma_buffer[dst + x * 2 + 1] = chroma_r_src[src + x];
}
}
break;
}
case AV_PIX_FMT_NV12: {
// Frame from VA-API hardware
// This is already interleaved so just copy
const u8* chroma_src = frame->data[1];
for (std::size_t y = 0; y < half_height; ++y) {
const std::size_t src = y * stride;
const std::size_t dst = y * aligned_width;
for (std::size_t x = 0; x < frame_width; ++x) {
chroma_buffer[dst + x] = chroma_src[src + x];
}
}
break;
}
default:
UNREACHABLE();
break;
}
gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(),
chroma_buffer.size());
case VideoPixelFormat::Yuv420:
WriteYUVFrame(frame, config);
break;
}
default:
UNIMPLEMENTED_MSG("Unknown video pixel format {}", config.pixel_format.Value());
UNIMPLEMENTED_MSG("Unknown video pixel format {:X}", config.pixel_format.Value());
break;
}
}
void Vic::WriteRGBFrame(const AVFrame* frame, const VicConfig& config) {
LOG_TRACE(Service_NVDRV, "Writing RGB Frame");
if (!scaler_ctx || frame->width != scaler_width || frame->height != scaler_height) {
const AVPixelFormat target_format = [pixel_format = config.pixel_format]() {
switch (pixel_format) {
case VideoPixelFormat::RGBA8:
return AV_PIX_FMT_RGBA;
case VideoPixelFormat::BGRA8:
return AV_PIX_FMT_BGRA;
case VideoPixelFormat::RGBX8:
return AV_PIX_FMT_RGB0;
default:
return AV_PIX_FMT_RGBA;
}
}();
sws_freeContext(scaler_ctx);
// Frames are decoded into either YUV420 or NV12 formats. Convert to desired RGB format
scaler_ctx = sws_getContext(frame->width, frame->height,
static_cast<AVPixelFormat>(frame->format), frame->width,
frame->height, target_format, 0, nullptr, nullptr, nullptr);
scaler_width = frame->width;
scaler_height = frame->height;
converted_frame_buffer.reset();
}
// Get Converted frame
const u32 width = static_cast<u32>(frame->width);
const u32 height = static_cast<u32>(frame->height);
const std::size_t linear_size = width * height * 4;
// Only allocate frame_buffer once per stream, as the size is not expected to change
if (!converted_frame_buffer) {
converted_frame_buffer = AVMallocPtr{static_cast<u8*>(av_malloc(linear_size)), av_free};
}
const std::array<int, 4> converted_stride{frame->width * 4, frame->height * 4, 0, 0};
u8* const converted_frame_buf_addr{converted_frame_buffer.get()};
sws_scale(scaler_ctx, frame->data, frame->linesize, 0, frame->height, &converted_frame_buf_addr,
converted_stride.data());
const u32 blk_kind = static_cast<u32>(config.block_linear_kind);
if (blk_kind != 0) {
// swizzle pitch linear to block linear
const u32 block_height = static_cast<u32>(config.block_linear_height_log2);
const auto size = Texture::CalculateSize(true, 4, width, height, 1, block_height, 0);
luma_buffer.resize(size);
Texture::SwizzleSubrect(width, height, width * 4, width, 4, luma_buffer.data(),
converted_frame_buffer.get(), block_height, 0, 0);
gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), size);
} else {
// send pitch linear frame
gpu.MemoryManager().WriteBlock(output_surface_luma_address, converted_frame_buf_addr,
linear_size);
}
}
void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) {
LOG_TRACE(Service_NVDRV, "Writing YUV420 Frame");
const std::size_t surface_width = config.surface_width_minus1 + 1;
const std::size_t surface_height = config.surface_height_minus1 + 1;
const auto frame_width = std::min(surface_width, static_cast<size_t>(frame->width));
const auto frame_height = std::min(surface_height, static_cast<size_t>(frame->height));
const std::size_t aligned_width = (surface_width + 0xff) & ~0xffUL;
const auto stride = static_cast<size_t>(frame->linesize[0]);
luma_buffer.resize(aligned_width * surface_height);
chroma_buffer.resize(aligned_width * surface_height / 2);
// Populate luma buffer
const u8* luma_src = frame->data[0];
for (std::size_t y = 0; y < frame_height; ++y) {
const std::size_t src = y * stride;
const std::size_t dst = y * aligned_width;
for (std::size_t x = 0; x < frame_width; ++x) {
luma_buffer[dst + x] = luma_src[src + x];
}
}
gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(),
luma_buffer.size());
// Chroma
const std::size_t half_height = frame_height / 2;
const auto half_stride = static_cast<size_t>(frame->linesize[1]);
switch (frame->format) {
case AV_PIX_FMT_YUV420P: {
// Frame from FFmpeg software
// Populate chroma buffer from both channels with interleaving.
const std::size_t half_width = frame_width / 2;
const u8* chroma_b_src = frame->data[1];
const u8* chroma_r_src = frame->data[2];
for (std::size_t y = 0; y < half_height; ++y) {
const std::size_t src = y * half_stride;
const std::size_t dst = y * aligned_width;
for (std::size_t x = 0; x < half_width; ++x) {
chroma_buffer[dst + x * 2] = chroma_b_src[src + x];
chroma_buffer[dst + x * 2 + 1] = chroma_r_src[src + x];
}
}
break;
}
case AV_PIX_FMT_NV12: {
// Frame from VA-API hardware
// This is already interleaved so just copy
const u8* chroma_src = frame->data[1];
for (std::size_t y = 0; y < half_height; ++y) {
const std::size_t src = y * stride;
const std::size_t dst = y * aligned_width;
for (std::size_t x = 0; x < frame_width; ++x) {
chroma_buffer[dst + x] = chroma_src[src + x];
}
}
break;
}
default:
UNREACHABLE();
break;
}
gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(),
chroma_buffer.size());
}
} // namespace Tegra

View File

@@ -6,7 +6,6 @@
#include <memory>
#include <vector>
#include "common/bit_field.h"
#include "common/common_types.h"
struct SwsContext;
@@ -14,6 +13,7 @@ struct SwsContext;
namespace Tegra {
class GPU;
class Nvdec;
union VicConfig;
class Vic {
public:
@@ -27,6 +27,7 @@ public:
};
explicit Vic(GPU& gpu, std::shared_ptr<Nvdec> nvdec_processor);
~Vic();
/// Write to the device state.
@@ -35,22 +36,9 @@ public:
private:
void Execute();
enum class VideoPixelFormat : u64_le {
RGBA8 = 0x1f,
BGRA8 = 0x20,
Yuv420 = 0x44,
};
void WriteRGBFrame(const AVFrame* frame, const VicConfig& config);
union VicConfig {
u64_le raw{};
BitField<0, 7, u64_le> pixel_format;
BitField<7, 2, u64_le> chroma_loc_horiz;
BitField<9, 2, u64_le> chroma_loc_vert;
BitField<11, 4, u64_le> block_linear_kind;
BitField<15, 4, u64_le> block_linear_height_log2;
BitField<32, 14, u64_le> surface_width_minus1;
BitField<46, 14, u64_le> surface_height_minus1;
};
void WriteYUVFrame(const AVFrame* frame, const VicConfig& config);
GPU& gpu;
std::shared_ptr<Tegra::Nvdec> nvdec_processor;

View File

@@ -37,14 +37,17 @@ constexpr std::array<std::array<bool, 4>, 8> led_patterns{{
}};
void UpdateController(Settings::ControllerType controller_type, std::size_t npad_index,
bool connected, Core::System& system) {
bool connected) {
Core::System& system{Core::System::GetInstance()};
if (!system.IsPoweredOn()) {
return;
}
Service::SM::ServiceManager& sm = system.ServiceManager();
auto& npad =
system.ServiceManager()
.GetService<Service::HID::Hid>("hid")
sm.GetService<Service::HID::Hid>("hid")
->GetAppletResource()
->GetController<Service::HID::Controller_NPad>(Service::HID::HidController::NPad);
@@ -76,10 +79,10 @@ bool IsControllerCompatible(Settings::ControllerType controller_type,
QtControllerSelectorDialog::QtControllerSelectorDialog(
QWidget* parent, Core::Frontend::ControllerParameters parameters_,
InputCommon::InputSubsystem* input_subsystem_, Core::System& system_)
InputCommon::InputSubsystem* input_subsystem_)
: QDialog(parent), ui(std::make_unique<Ui::QtControllerSelectorDialog>()),
parameters(std::move(parameters_)), input_subsystem{input_subsystem_},
input_profiles(std::make_unique<InputProfiles>(system_)), system{system_} {
input_profiles(std::make_unique<InputProfiles>()) {
ui->setupUi(this);
player_widgets = {
@@ -242,7 +245,7 @@ int QtControllerSelectorDialog::exec() {
void QtControllerSelectorDialog::ApplyConfiguration() {
const bool pre_docked_mode = Settings::values.use_docked_mode.GetValue();
Settings::values.use_docked_mode.SetValue(ui->radioDocked->isChecked());
OnDockedModeChanged(pre_docked_mode, Settings::values.use_docked_mode.GetValue(), system);
OnDockedModeChanged(pre_docked_mode, Settings::values.use_docked_mode.GetValue());
Settings::values.vibration_enabled.SetValue(ui->vibrationGroup->isChecked());
Settings::values.motion_enabled.SetValue(ui->motionGroup->isChecked());
@@ -290,7 +293,7 @@ void QtControllerSelectorDialog::CallConfigureMotionTouchDialog() {
}
void QtControllerSelectorDialog::CallConfigureInputProfileDialog() {
ConfigureInputProfileDialog dialog(this, input_subsystem, input_profiles.get(), system);
ConfigureInputProfileDialog dialog(this, input_subsystem, input_profiles.get());
dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
Qt::WindowSystemMenuHint);
@@ -530,7 +533,7 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index)
}
// Disconnect the controller first.
UpdateController(controller_type, player_index, false, system);
UpdateController(controller_type, player_index, false);
player.controller_type = controller_type;
player.connected = player_connected;
@@ -545,7 +548,7 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index)
}
handheld.connected = player_groupboxes[player_index]->isChecked() &&
controller_type == Settings::ControllerType::Handheld;
UpdateController(Settings::ControllerType::Handheld, 8, handheld.connected, system);
UpdateController(Settings::ControllerType::Handheld, 8, handheld.connected);
}
if (!player.connected) {
@@ -557,7 +560,7 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index)
using namespace std::chrono_literals;
std::this_thread::sleep_for(60ms);
UpdateController(controller_type, player_index, player_connected, system);
UpdateController(controller_type, player_index, player_connected);
}
void QtControllerSelectorDialog::UpdateLEDPattern(std::size_t player_index) {
@@ -656,8 +659,7 @@ void QtControllerSelectorDialog::DisableUnsupportedPlayers() {
for (std::size_t index = max_supported_players; index < NUM_PLAYERS; ++index) {
// Disconnect any unsupported players here and disable or hide them if applicable.
Settings::values.players.GetValue()[index].connected = false;
UpdateController(Settings::values.players.GetValue()[index].controller_type, index, false,
system);
UpdateController(Settings::values.players.GetValue()[index].controller_type, index, false);
// Hide the player widgets when max_supported_controllers is less than or equal to 4.
if (max_supported_players <= 4) {
player_widgets[index]->hide();

View File

@@ -7,7 +7,6 @@
#include <array>
#include <memory>
#include <QDialog>
#include "core/core.h"
#include "core/frontend/applets/controller.h"
class GMainWindow;
@@ -37,8 +36,7 @@ class QtControllerSelectorDialog final : public QDialog {
public:
explicit QtControllerSelectorDialog(QWidget* parent,
Core::Frontend::ControllerParameters parameters_,
InputCommon::InputSubsystem* input_subsystem_,
Core::System& system_);
InputCommon::InputSubsystem* input_subsystem_);
~QtControllerSelectorDialog() override;
int exec() override;
@@ -105,8 +103,6 @@ private:
std::unique_ptr<InputProfiles> input_profiles;
Core::System& system;
// This is true if and only if all parameters are met. Otherwise, this is false.
// This determines whether the "OK" button can be clicked to exit the applet.
bool parameters_met{false};

View File

@@ -42,7 +42,7 @@
#include "yuzu/bootmanager.h"
#include "yuzu/main.h"
EmuThread::EmuThread(Core::System& system_) : system{system_} {}
EmuThread::EmuThread() = default;
EmuThread::~EmuThread() = default;
@@ -51,6 +51,7 @@ void EmuThread::run() {
MicroProfileOnThreadCreate(name.c_str());
Common::SetCurrentThreadName(name.c_str());
auto& system = Core::System::GetInstance();
auto& gpu = system.GPU();
auto stop_token = stop_source.get_token();
@@ -284,10 +285,8 @@ static Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow*
}
GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
Core::System& system_)
: QWidget(parent),
emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)}, system{system_} {
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_)
: QWidget(parent), emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)} {
setWindowTitle(QStringLiteral("yuzu %1 | %2-%3")
.arg(QString::fromUtf8(Common::g_build_name),
QString::fromUtf8(Common::g_scm_branch),
@@ -630,7 +629,8 @@ void GRenderWindow::ReleaseRenderTarget() {
}
void GRenderWindow::CaptureScreenshot(u32 res_scale, const QString& screenshot_path) {
VideoCore::RendererBase& renderer = system.Renderer();
auto& renderer = Core::System::GetInstance().Renderer();
if (res_scale == 0) {
res_scale = VideoCore::GetResolutionScaleFactor(renderer);
}

View File

@@ -34,14 +34,13 @@ enum class MouseButton;
namespace VideoCore {
enum class LoadCallbackStage;
class RendererBase;
} // namespace VideoCore
}
class EmuThread final : public QThread {
Q_OBJECT
public:
explicit EmuThread(Core::System& system_);
explicit EmuThread();
~EmuThread() override;
/**
@@ -102,7 +101,6 @@ private:
std::condition_variable_any running_cv;
Common::Event running_wait{};
std::atomic_bool running_guard{false};
Core::System& system;
signals:
/**
@@ -133,8 +131,7 @@ class GRenderWindow : public QWidget, public Core::Frontend::EmuWindow {
public:
explicit GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
Core::System& system_);
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_);
~GRenderWindow() override;
// EmuWindow implementation.
@@ -235,8 +232,6 @@ private:
std::array<std::size_t, 16> touch_ids{};
Core::System& system;
protected:
void showEvent(QShowEvent* event) override;
bool eventFilter(QObject* object, QEvent* event) override;

View File

@@ -8,13 +8,14 @@
#include <QtConcurrent/qtconcurrentrun.h>
#include "common/logging/log.h"
#include "common/telemetry.h"
#include "core/core.h"
#include "core/telemetry_session.h"
#include "ui_compatdb.h"
#include "yuzu/compatdb.h"
CompatDB::CompatDB(Core::TelemetrySession& telemetry_session_, QWidget* parent)
CompatDB::CompatDB(QWidget* parent)
: QWizard(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
ui{std::make_unique<Ui::CompatDB>()}, telemetry_session{telemetry_session_} {
ui{std::make_unique<Ui::CompatDB>()} {
ui->setupUi(this);
connect(ui->radioButton_Perfect, &QRadioButton::clicked, this, &CompatDB::EnableNext);
connect(ui->radioButton_Great, &QRadioButton::clicked, this, &CompatDB::EnableNext);
@@ -52,15 +53,16 @@ void CompatDB::Submit() {
case CompatDBPage::Final:
back();
LOG_DEBUG(Frontend, "Compatibility Rating: {}", compatibility->checkedId());
telemetry_session.AddField(Common::Telemetry::FieldType::UserFeedback, "Compatibility",
compatibility->checkedId());
Core::System::GetInstance().TelemetrySession().AddField(
Common::Telemetry::FieldType::UserFeedback, "Compatibility",
compatibility->checkedId());
button(NextButton)->setEnabled(false);
button(NextButton)->setText(tr("Submitting"));
button(CancelButton)->setVisible(false);
testcase_watcher.setFuture(
QtConcurrent::run([this] { return telemetry_session.SubmitTestcase(); }));
testcase_watcher.setFuture(QtConcurrent::run(
[] { return Core::System::GetInstance().TelemetrySession().SubmitTestcase(); }));
break;
default:
LOG_ERROR(Frontend, "Unexpected page: {}", currentId());

View File

@@ -7,7 +7,6 @@
#include <memory>
#include <QFutureWatcher>
#include <QWizard>
#include "core/telemetry_session.h"
namespace Ui {
class CompatDB;
@@ -17,7 +16,7 @@ class CompatDB : public QWizard {
Q_OBJECT
public:
explicit CompatDB(Core::TelemetrySession& telemetry_session_, QWidget* parent = nullptr);
explicit CompatDB(QWidget* parent = nullptr);
~CompatDB();
private:
@@ -28,6 +27,4 @@ private:
void Submit();
void OnTestcaseSubmitted();
void EnableNext();
Core::TelemetrySession& telemetry_session;
};

View File

@@ -16,8 +16,7 @@
namespace FS = Common::FS;
Config::Config(Core::System& system_, const std::string& config_name, ConfigType config_type)
: type(config_type), system{system_} {
Config::Config(const std::string& config_name, ConfigType config_type) : type(config_type) {
global = config_type == ConfigType::GlobalConfig;
Initialize(config_name);
@@ -1594,7 +1593,7 @@ void Config::Reload() {
ReadValues();
// To apply default value changes
SaveValues();
system.ApplySettings();
Core::System::GetInstance().ApplySettings();
}
void Config::Save() {

View File

@@ -14,10 +14,6 @@
class QSettings;
namespace Core {
class System;
}
class Config {
public:
enum class ConfigType {
@@ -26,7 +22,7 @@ public:
InputProfile,
};
explicit Config(Core::System& system_, const std::string& config_name = "qt-config",
explicit Config(const std::string& config_name = "qt-config",
ConfigType config_type = ConfigType::GlobalConfig);
~Config();
@@ -180,8 +176,6 @@ private:
std::unique_ptr<QSettings> qt_config;
std::string qt_config_loc;
bool global;
Core::System& system;
};
// These metatype declarations cannot be in common/settings.h because core is devoid of QT

View File

@@ -41,8 +41,120 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>-1</number>
<number>11</number>
</property>
<widget class="ConfigureGeneral" name="generalTab">
<property name="accessibleName">
<string>General</string>
</property>
<attribute name="title">
<string>General</string>
</attribute>
</widget>
<widget class="ConfigureUi" name="uiTab">
<property name="accessibleName">
<string>UI</string>
</property>
<attribute name="title">
<string>Game List</string>
</attribute>
</widget>
<widget class="ConfigureSystem" name="systemTab">
<property name="accessibleName">
<string>System</string>
</property>
<attribute name="title">
<string>System</string>
</attribute>
</widget>
<widget class="ConfigureProfileManager" name="profileManagerTab">
<property name="accessibleName">
<string>Profiles</string>
</property>
<attribute name="title">
<string>Profiles</string>
</attribute>
</widget>
<widget class="ConfigureFilesystem" name="filesystemTab">
<property name="accessibleName">
<string>Filesystem</string>
</property>
<attribute name="title">
<string>Filesystem</string>
</attribute>
</widget>
<widget class="ConfigureInput" name="inputTab">
<property name="accessibleName">
<string>Controls</string>
</property>
<attribute name="title">
<string>Controls</string>
</attribute>
</widget>
<widget class="ConfigureHotkeys" name="hotkeysTab">
<property name="accessibleName">
<string>Hotkeys</string>
</property>
<attribute name="title">
<string>Hotkeys</string>
</attribute>
</widget>
<widget class="ConfigureCpu" name="cpuTab">
<property name="accessibleName">
<string>CPU</string>
</property>
<attribute name="title">
<string>CPU</string>
</attribute>
</widget>
<widget class="ConfigureGraphics" name="graphicsTab">
<property name="accessibleName">
<string>Graphics</string>
</property>
<attribute name="title">
<string>Graphics</string>
</attribute>
</widget>
<widget class="ConfigureGraphicsAdvanced" name="graphicsAdvancedTab">
<property name="accessibleName">
<string>Advanced</string>
</property>
<attribute name="title">
<string>GraphicsAdvanced</string>
</attribute>
</widget>
<widget class="ConfigureAudio" name="audioTab">
<property name="accessibleName">
<string>Audio</string>
</property>
<attribute name="title">
<string>Audio</string>
</attribute>
</widget>
<widget class="ConfigureDebugTab" name="debugTab">
<property name="accessibleName">
<string>Debug</string>
</property>
<attribute name="title">
<string>Debug</string>
</attribute>
</widget>
<widget class="ConfigureWeb" name="webTab">
<property name="accessibleName">
<string>Web</string>
</property>
<attribute name="title">
<string>Web</string>
</attribute>
</widget>
<widget class="ConfigureNetwork" name="networkTab">
<property name="accessibleName">
<string>Network</string>
</property>
<attribute name="title">
<string>Network</string>
</attribute>
</widget>
</widget>
</item>
</layout>
@@ -56,6 +168,92 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ConfigureGeneral</class>
<extends>QWidget</extends>
<header>configuration/configure_general.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureSystem</class>
<extends>QWidget</extends>
<header>configuration/configure_system.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureProfileManager</class>
<extends>QWidget</extends>
<header>configuration/configure_profile_manager.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureFilesystem</class>
<extends>QWidget</extends>
<header>configuration/configure_filesystem.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureAudio</class>
<extends>QWidget</extends>
<header>configuration/configure_audio.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureCpu</class>
<extends>QWidget</extends>
<header>configuration/configure_cpu.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureGraphics</class>
<extends>QWidget</extends>
<header>configuration/configure_graphics.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureGraphicsAdvanced</class>
<extends>QWidget</extends>
<header>configuration/configure_graphics_advanced.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureWeb</class>
<extends>QWidget</extends>
<header>configuration/configure_web.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureUi</class>
<extends>QWidget</extends>
<header>configuration/configure_ui.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureInput</class>
<extends>QWidget</extends>
<header>configuration/configure_input.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureHotkeys</class>
<extends>QWidget</extends>
<header>configuration/configure_hotkeys.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureNetwork</class>
<extends>QWidget</extends>
<header>configuration/configure_network.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureDebugTab</class>
<extends>QWidget</extends>
<header>configuration/configure_debug_tab.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>

View File

@@ -14,8 +14,8 @@
#include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/configure_audio.h"
ConfigureAudio::ConfigureAudio(const Core::System& system_, QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} {
ConfigureAudio::ConfigureAudio(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()) {
ui->setupUi(this);
InitializeAudioOutputSinkComboBox();
@@ -32,7 +32,7 @@ ConfigureAudio::ConfigureAudio(const Core::System& system_, QWidget* parent)
SetConfiguration();
const bool is_powered_on = system_.IsPoweredOn();
const bool is_powered_on = Core::System::GetInstance().IsPoweredOn();
ui->output_sink_combo_box->setEnabled(!is_powered_on);
ui->audio_device_combo_box->setEnabled(!is_powered_on);
}

View File

@@ -7,10 +7,6 @@
#include <memory>
#include <QWidget>
namespace Core {
class System;
}
namespace ConfigurationShared {
enum class CheckState;
}
@@ -23,11 +19,10 @@ class ConfigureAudio : public QWidget {
Q_OBJECT
public:
explicit ConfigureAudio(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureAudio(QWidget* parent = nullptr);
~ConfigureAudio() override;
void ApplyConfiguration();
void SetConfiguration();
private:
void changeEvent(QEvent* event) override;
@@ -38,6 +33,7 @@ private:
void UpdateAudioDevices(int sink_index);
void SetConfiguration();
void SetOutputSinkFromSinkID();
void SetAudioDeviceFromDeviceID();
void SetVolumeIndicatorText(int percentage);
@@ -45,6 +41,4 @@ private:
void SetupPerGameUI();
std::unique_ptr<Ui::ConfigureAudio> ui;
const Core::System& system;
};

View File

@@ -10,9 +10,6 @@
<height>368</height>
</rect>
</property>
<property name="accessibleName">
<string>Audio</string>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QGroupBox" name="groupBox">

View File

@@ -13,8 +13,7 @@
#include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/configure_cpu.h"
ConfigureCpu::ConfigureCpu(const Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureCpu), system{system_} {
ConfigureCpu::ConfigureCpu(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureCpu) {
ui->setupUi(this);
SetupPerGameUI();
@@ -28,7 +27,7 @@ ConfigureCpu::ConfigureCpu(const Core::System& system_, QWidget* parent)
ConfigureCpu::~ConfigureCpu() = default;
void ConfigureCpu::SetConfiguration() {
const bool runtime_lock = !system.IsPoweredOn();
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
ui->accuracy->setEnabled(runtime_lock);
ui->cpuopt_unsafe_unfuse_fma->setEnabled(runtime_lock);

View File

@@ -8,10 +8,6 @@
#include <QWidget>
#include "common/settings.h"
namespace Core {
class System;
}
namespace ConfigurationShared {
enum class CheckState;
}
@@ -24,11 +20,10 @@ class ConfigureCpu : public QWidget {
Q_OBJECT
public:
explicit ConfigureCpu(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureCpu(QWidget* parent = nullptr);
~ConfigureCpu() override;
void ApplyConfiguration();
void SetConfiguration();
private:
void changeEvent(QEvent* event) override;
@@ -36,6 +31,8 @@ private:
void UpdateGroup(int index);
void SetConfiguration();
void SetupPerGameUI();
std::unique_ptr<Ui::ConfigureCpu> ui;
@@ -45,6 +42,4 @@ private:
ConfigurationShared::CheckState cpuopt_unsafe_ignore_standard_fpcr;
ConfigurationShared::CheckState cpuopt_unsafe_inaccurate_nan;
ConfigurationShared::CheckState cpuopt_unsafe_fastmem_check;
const Core::System& system;
};

View File

@@ -7,15 +7,12 @@
<x>0</x>
<y>0</y>
<width>448</width>
<height>439</height>
<height>433</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>CPU</string>
</property>
<layout class="QVBoxLayout">
<item>
<layout class="QVBoxLayout">

View File

@@ -11,8 +11,8 @@
#include "ui_configure_cpu_debug.h"
#include "yuzu/configuration/configure_cpu_debug.h"
ConfigureCpuDebug::ConfigureCpuDebug(const Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureCpuDebug), system{system_} {
ConfigureCpuDebug::ConfigureCpuDebug(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureCpuDebug) {
ui->setupUi(this);
SetConfiguration();
@@ -21,7 +21,7 @@ ConfigureCpuDebug::ConfigureCpuDebug(const Core::System& system_, QWidget* paren
ConfigureCpuDebug::~ConfigureCpuDebug() = default;
void ConfigureCpuDebug::SetConfiguration() {
const bool runtime_lock = !system.IsPoweredOn();
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
ui->cpuopt_page_tables->setEnabled(runtime_lock);
ui->cpuopt_page_tables->setChecked(Settings::values.cpuopt_page_tables.GetValue());

View File

@@ -7,10 +7,6 @@
#include <memory>
#include <QWidget>
namespace Core {
class System;
}
namespace Ui {
class ConfigureCpuDebug;
}
@@ -19,7 +15,7 @@ class ConfigureCpuDebug : public QWidget {
Q_OBJECT
public:
explicit ConfigureCpuDebug(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureCpuDebug(QWidget* parent = nullptr);
~ConfigureCpuDebug() override;
void ApplyConfiguration();
@@ -31,6 +27,4 @@ private:
void SetConfiguration();
std::unique_ptr<Ui::ConfigureCpuDebug> ui;
const Core::System& system;
};

View File

@@ -13,9 +13,6 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>CPU</string>
</property>
<layout class="QVBoxLayout">
<item>
<layout class="QVBoxLayout">

View File

@@ -14,8 +14,7 @@
#include "yuzu/debugger/console.h"
#include "yuzu/uisettings.h"
ConfigureDebug::ConfigureDebug(const Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureDebug), system{system_} {
ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureDebug) {
ui->setupUi(this);
SetConfiguration();
@@ -29,7 +28,7 @@ ConfigureDebug::ConfigureDebug(const Core::System& system_, QWidget* parent)
ConfigureDebug::~ConfigureDebug() = default;
void ConfigureDebug::SetConfiguration() {
const bool runtime_lock = !system.IsPoweredOn();
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
ui->toggle_console->setEnabled(runtime_lock);
ui->toggle_console->setChecked(UISettings::values.show_console.GetValue());

View File

@@ -7,10 +7,6 @@
#include <memory>
#include <QWidget>
namespace Core {
class System;
}
namespace Ui {
class ConfigureDebug;
}
@@ -19,7 +15,7 @@ class ConfigureDebug : public QWidget {
Q_OBJECT
public:
explicit ConfigureDebug(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureDebug(QWidget* parent = nullptr);
~ConfigureDebug() override;
void ApplyConfiguration();
@@ -31,6 +27,4 @@ private:
void SetConfiguration();
std::unique_ptr<Ui::ConfigureDebug> ui;
const Core::System& system;
};

View File

@@ -2,17 +2,16 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/core.h"
#include "ui_configure_debug_controller.h"
#include "yuzu/configuration/configure_debug_controller.h"
#include "yuzu/configuration/configure_input_player.h"
ConfigureDebugController::ConfigureDebugController(QWidget* parent,
InputCommon::InputSubsystem* input_subsystem,
InputProfiles* profiles, Core::System& system)
InputProfiles* profiles)
: QDialog(parent), ui(std::make_unique<Ui::ConfigureDebugController>()),
debug_controller(
new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles, system, true)) {
new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles, true)) {
ui->setupUi(this);
ui->controllerLayout->addWidget(debug_controller);

View File

@@ -13,10 +13,6 @@ class ConfigureInputPlayer;
class InputProfiles;
namespace Core {
class System;
}
namespace InputCommon {
class InputSubsystem;
}
@@ -30,7 +26,7 @@ class ConfigureDebugController : public QDialog {
public:
explicit ConfigureDebugController(QWidget* parent, InputCommon::InputSubsystem* input_subsystem,
InputProfiles* profiles, Core::System& system);
InputProfiles* profiles);
~ConfigureDebugController() override;
void ApplyConfiguration();

View File

@@ -2,29 +2,21 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include "ui_configure_debug_tab.h"
#include "yuzu/configuration/configure_cpu_debug.h"
#include "yuzu/configuration/configure_debug.h"
#include "yuzu/configuration/configure_debug_tab.h"
ConfigureDebugTab::ConfigureDebugTab(const Core::System& system_, QWidget* parent)
: QWidget(parent),
ui(new Ui::ConfigureDebugTab), debug_tab{std::make_unique<ConfigureDebug>(system_, this)},
cpu_debug_tab{std::make_unique<ConfigureCpuDebug>(system_, this)} {
ConfigureDebugTab::ConfigureDebugTab(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureDebugTab) {
ui->setupUi(this);
ui->tabWidget->addTab(debug_tab.get(), tr("Debug"));
ui->tabWidget->addTab(cpu_debug_tab.get(), tr("CPU"));
SetConfiguration();
}
ConfigureDebugTab::~ConfigureDebugTab() = default;
void ConfigureDebugTab::ApplyConfiguration() {
debug_tab->ApplyConfiguration();
cpu_debug_tab->ApplyConfiguration();
ui->debugTab->ApplyConfiguration();
ui->cpuDebugTab->ApplyConfiguration();
}
void ConfigureDebugTab::SetCurrentIndex(int index) {

View File

@@ -7,13 +7,6 @@
#include <memory>
#include <QWidget>
class ConfigureDebug;
class ConfigureCpuDebug;
namespace Core {
class System;
}
namespace Ui {
class ConfigureDebugTab;
}
@@ -22,7 +15,7 @@ class ConfigureDebugTab : public QWidget {
Q_OBJECT
public:
explicit ConfigureDebugTab(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureDebugTab(QWidget* parent = nullptr);
~ConfigureDebugTab() override;
void ApplyConfiguration();
@@ -36,7 +29,4 @@ private:
void SetConfiguration();
std::unique_ptr<Ui::ConfigureDebugTab> ui;
std::unique_ptr<ConfigureDebug> debug_tab;
std::unique_ptr<ConfigureCpuDebug> cpu_debug_tab;
};

View File

@@ -13,19 +13,40 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>Debug</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>-1</number>
<number>1</number>
</property>
<widget class="ConfigureDebug" name="debugTab">
<attribute name="title">
<string>General</string>
</attribute>
</widget>
<widget class="ConfigureCpuDebug" name="cpuDebugTab">
<attribute name="title">
<string>CPU</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ConfigureDebug</class>
<extends>QWidget</extends>
<header>configuration/configure_debug.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureCpuDebug</class>
<extends>QWidget</extends>
<header>configuration/configure_cpu_debug.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -2,7 +2,6 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include <QAbstractButton>
#include <QDialogButtonBox>
#include <QHash>
@@ -10,84 +9,37 @@
#include <QPushButton>
#include <QSignalBlocker>
#include <QTabWidget>
#include "common/logging/log.h"
#include "common/settings.h"
#include "core/core.h"
#include "ui_configure.h"
#include "yuzu/configuration/config.h"
#include "yuzu/configuration/configure_audio.h"
#include "yuzu/configuration/configure_cpu.h"
#include "yuzu/configuration/configure_debug_tab.h"
#include "yuzu/configuration/configure_dialog.h"
#include "yuzu/configuration/configure_filesystem.h"
#include "yuzu/configuration/configure_general.h"
#include "yuzu/configuration/configure_graphics.h"
#include "yuzu/configuration/configure_graphics_advanced.h"
#include "yuzu/configuration/configure_hotkeys.h"
#include "yuzu/configuration/configure_input.h"
#include "yuzu/configuration/configure_input_player.h"
#include "yuzu/configuration/configure_network.h"
#include "yuzu/configuration/configure_profile_manager.h"
#include "yuzu/configuration/configure_system.h"
#include "yuzu/configuration/configure_ui.h"
#include "yuzu/configuration/configure_web.h"
#include "yuzu/hotkeys.h"
ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
InputCommon::InputSubsystem* input_subsystem,
Core::System& system_)
: QDialog(parent), ui(new Ui::ConfigureDialog),
registry(registry), system{system_}, audio_tab{std::make_unique<ConfigureAudio>(system_,
this)},
cpu_tab{std::make_unique<ConfigureCpu>(system_, this)},
debug_tab_tab{std::make_unique<ConfigureDebugTab>(system_, this)},
filesystem_tab{std::make_unique<ConfigureFilesystem>(this)},
general_tab{std::make_unique<ConfigureGeneral>(system_, this)},
graphics_tab{std::make_unique<ConfigureGraphics>(system_, this)},
graphics_advanced_tab{std::make_unique<ConfigureGraphicsAdvanced>(system_, this)},
hotkeys_tab{std::make_unique<ConfigureHotkeys>(this)},
input_tab{std::make_unique<ConfigureInput>(system_, this)},
network_tab{std::make_unique<ConfigureNetwork>(system_, this)},
profile_tab{std::make_unique<ConfigureProfileManager>(system_, this)},
system_tab{std::make_unique<ConfigureSystem>(system_, this)},
ui_tab{std::make_unique<ConfigureUi>(system_, this)}, web_tab{std::make_unique<ConfigureWeb>(
this)} {
InputCommon::InputSubsystem* input_subsystem)
: QDialog(parent), ui(new Ui::ConfigureDialog), registry(registry) {
Settings::SetConfiguringGlobal(true);
ui->setupUi(this);
ui->tabWidget->addTab(audio_tab.get(), tr("Audio"));
ui->tabWidget->addTab(cpu_tab.get(), tr("CPU"));
ui->tabWidget->addTab(debug_tab_tab.get(), tr("Debug"));
ui->tabWidget->addTab(filesystem_tab.get(), tr("Filesystem"));
ui->tabWidget->addTab(general_tab.get(), tr("General"));
ui->tabWidget->addTab(graphics_tab.get(), tr("Graphics"));
ui->tabWidget->addTab(graphics_advanced_tab.get(), tr("GraphicsAdvanced"));
ui->tabWidget->addTab(hotkeys_tab.get(), tr("Hotkeys"));
ui->tabWidget->addTab(input_tab.get(), tr("Controls"));
ui->tabWidget->addTab(profile_tab.get(), tr("Profiles"));
ui->tabWidget->addTab(network_tab.get(), tr("Network"));
ui->tabWidget->addTab(system_tab.get(), tr("System"));
ui->tabWidget->addTab(ui_tab.get(), tr("Game List"));
ui->tabWidget->addTab(web_tab.get(), tr("Web"));
hotkeys_tab->Populate(registry);
ui->hotkeysTab->Populate(registry);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
input_tab->Initialize(input_subsystem);
ui->inputTab->Initialize(input_subsystem);
general_tab->SetResetCallback([&] { this->close(); });
ui->generalTab->SetResetCallback([&] { this->close(); });
SetConfiguration();
PopulateSelectionList();
connect(ui->tabWidget, &QTabWidget::currentChanged, this,
[this]() { debug_tab_tab->SetCurrentIndex(0); });
connect(ui_tab.get(), &ConfigureUi::LanguageChanged, this, &ConfigureDialog::OnLanguageChanged);
[this]() { ui->debugTab->SetCurrentIndex(0); });
connect(ui->uiTab, &ConfigureUi::LanguageChanged, this, &ConfigureDialog::OnLanguageChanged);
connect(ui->selectorList, &QListWidget::itemSelectionChanged, this,
&ConfigureDialog::UpdateVisibleTabs);
if (system.IsPoweredOn()) {
if (Core::System::GetInstance().IsPoweredOn()) {
QPushButton* apply_button = ui->buttonBox->addButton(QDialogButtonBox::Apply);
connect(apply_button, &QAbstractButton::clicked, this,
&ConfigureDialog::HandleApplyButtonClicked);
@@ -102,21 +54,21 @@ ConfigureDialog::~ConfigureDialog() = default;
void ConfigureDialog::SetConfiguration() {}
void ConfigureDialog::ApplyConfiguration() {
general_tab->ApplyConfiguration();
ui_tab->ApplyConfiguration();
system_tab->ApplyConfiguration();
profile_tab->ApplyConfiguration();
filesystem_tab->applyConfiguration();
input_tab->ApplyConfiguration();
hotkeys_tab->ApplyConfiguration(registry);
cpu_tab->ApplyConfiguration();
graphics_tab->ApplyConfiguration();
graphics_advanced_tab->ApplyConfiguration();
audio_tab->ApplyConfiguration();
debug_tab_tab->ApplyConfiguration();
web_tab->ApplyConfiguration();
network_tab->ApplyConfiguration();
system.ApplySettings();
ui->generalTab->ApplyConfiguration();
ui->uiTab->ApplyConfiguration();
ui->systemTab->ApplyConfiguration();
ui->profileManagerTab->ApplyConfiguration();
ui->filesystemTab->applyConfiguration();
ui->inputTab->ApplyConfiguration();
ui->hotkeysTab->ApplyConfiguration(registry);
ui->cpuTab->ApplyConfiguration();
ui->graphicsTab->ApplyConfiguration();
ui->graphicsAdvancedTab->ApplyConfiguration();
ui->audioTab->ApplyConfiguration();
ui->debugTab->ApplyConfiguration();
ui->webTab->ApplyConfiguration();
ui->networkTab->ApplyConfiguration();
Core::System::GetInstance().ApplySettings();
Settings::LogSettings();
}
@@ -150,14 +102,12 @@ Q_DECLARE_METATYPE(QList<QWidget*>);
void ConfigureDialog::PopulateSelectionList() {
const std::array<std::pair<QString, QList<QWidget*>>, 6> items{
{{tr("General"),
{general_tab.get(), hotkeys_tab.get(), ui_tab.get(), web_tab.get(), debug_tab_tab.get()}},
{tr("System"),
{system_tab.get(), profile_tab.get(), network_tab.get(), filesystem_tab.get()}},
{tr("CPU"), {cpu_tab.get()}},
{tr("Graphics"), {graphics_tab.get(), graphics_advanced_tab.get()}},
{tr("Audio"), {audio_tab.get()}},
{tr("Controls"), input_tab->GetSubTabs()}},
{{tr("General"), {ui->generalTab, ui->hotkeysTab, ui->uiTab, ui->webTab, ui->debugTab}},
{tr("System"), {ui->systemTab, ui->profileManagerTab, ui->networkTab, ui->filesystemTab}},
{tr("CPU"), {ui->cpuTab}},
{tr("Graphics"), {ui->graphicsTab, ui->graphicsAdvancedTab}},
{tr("Audio"), {ui->audioTab}},
{tr("Controls"), ui->inputTab->GetSubTabs()}},
};
[[maybe_unused]] const QSignalBlocker blocker(ui->selectorList);
@@ -192,7 +142,6 @@ void ConfigureDialog::UpdateVisibleTabs() {
const auto tabs = qvariant_cast<QList<QWidget*>>(items[0]->data(Qt::UserRole));
for (auto* const tab : tabs) {
LOG_DEBUG(Frontend, "{}", tab->accessibleName().toStdString());
ui->tabWidget->addTab(tab, tab->accessibleName());
}
}

View File

@@ -7,25 +7,6 @@
#include <memory>
#include <QDialog>
namespace Core {
class System;
}
class ConfigureAudio;
class ConfigureCpu;
class ConfigureDebugTab;
class ConfigureFilesystem;
class ConfigureGeneral;
class ConfigureGraphics;
class ConfigureGraphicsAdvanced;
class ConfigureHotkeys;
class ConfigureInput;
class ConfigureProfileManager;
class ConfigureSystem;
class ConfigureNetwork;
class ConfigureUi;
class ConfigureWeb;
class HotkeyRegistry;
namespace InputCommon {
@@ -41,7 +22,7 @@ class ConfigureDialog : public QDialog {
public:
explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
InputCommon::InputSubsystem* input_subsystem, Core::System& system_);
InputCommon::InputSubsystem* input_subsystem);
~ConfigureDialog() override;
void ApplyConfiguration();
@@ -64,21 +45,4 @@ private:
std::unique_ptr<Ui::ConfigureDialog> ui;
HotkeyRegistry& registry;
Core::System& system;
std::unique_ptr<ConfigureAudio> audio_tab;
std::unique_ptr<ConfigureCpu> cpu_tab;
std::unique_ptr<ConfigureDebugTab> debug_tab_tab;
std::unique_ptr<ConfigureFilesystem> filesystem_tab;
std::unique_ptr<ConfigureGeneral> general_tab;
std::unique_ptr<ConfigureGraphics> graphics_tab;
std::unique_ptr<ConfigureGraphicsAdvanced> graphics_advanced_tab;
std::unique_ptr<ConfigureHotkeys> hotkeys_tab;
std::unique_ptr<ConfigureInput> input_tab;
std::unique_ptr<ConfigureNetwork> network_tab;
std::unique_ptr<ConfigureProfileManager> profile_tab;
std::unique_ptr<ConfigureSystem> system_tab;
std::unique_ptr<ConfigureUi> ui_tab;
std::unique_ptr<ConfigureWeb> web_tab;
};

View File

@@ -13,9 +13,6 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>Filesystem</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">

View File

@@ -15,8 +15,8 @@
#include "yuzu/configuration/configure_general.h"
#include "yuzu/uisettings.h"
ConfigureGeneral::ConfigureGeneral(const Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGeneral), system{system_} {
ConfigureGeneral::ConfigureGeneral(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGeneral) {
ui->setupUi(this);
SetupPerGameUI();
@@ -35,7 +35,7 @@ ConfigureGeneral::ConfigureGeneral(const Core::System& system_, QWidget* parent)
ConfigureGeneral::~ConfigureGeneral() = default;
void ConfigureGeneral::SetConfiguration() {
const bool runtime_lock = !system.IsPoweredOn();
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
ui->use_multi_core->setEnabled(runtime_lock);
ui->use_multi_core->setChecked(Settings::values.use_multi_core.GetValue());

View File

@@ -8,10 +8,6 @@
#include <memory>
#include <QWidget>
namespace Core {
class System;
}
class ConfigureDialog;
namespace ConfigurationShared {
@@ -28,18 +24,19 @@ class ConfigureGeneral : public QWidget {
Q_OBJECT
public:
explicit ConfigureGeneral(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureGeneral(QWidget* parent = nullptr);
~ConfigureGeneral() override;
void SetResetCallback(std::function<void()> callback);
void ResetDefaults();
void ApplyConfiguration();
void SetConfiguration();
private:
void changeEvent(QEvent* event) override;
void RetranslateUI();
void SetConfiguration();
void SetupPerGameUI();
std::function<void()> reset_callback;
@@ -48,6 +45,4 @@ private:
ConfigurationShared::CheckState use_speed_limit;
ConfigurationShared::CheckState use_multi_core;
const Core::System& system;
};

View File

@@ -13,9 +13,6 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>General</string>
</property>
<layout class="QHBoxLayout" name="HorizontalLayout">
<item>
<layout class="QVBoxLayout" name="VerticalLayout">

View File

@@ -19,8 +19,8 @@
#include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/configure_graphics.h"
ConfigureGraphics::ConfigureGraphics(const Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGraphics), system{system_} {
ConfigureGraphics::ConfigureGraphics(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGraphics) {
vulkan_device = Settings::values.vulkan_device.GetValue();
RetrieveVulkanDevices();
@@ -83,7 +83,7 @@ void ConfigureGraphics::UpdateShaderBackendSelection(int backend) {
ConfigureGraphics::~ConfigureGraphics() = default;
void ConfigureGraphics::SetConfiguration() {
const bool runtime_lock = !system.IsPoweredOn();
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
ui->api_widget->setEnabled(runtime_lock);
ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock);

View File

@@ -10,10 +10,6 @@
#include <QWidget>
#include "common/settings.h"
namespace Core {
class System;
}
namespace ConfigurationShared {
enum class CheckState;
}
@@ -26,16 +22,17 @@ class ConfigureGraphics : public QWidget {
Q_OBJECT
public:
explicit ConfigureGraphics(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureGraphics(QWidget* parent = nullptr);
~ConfigureGraphics() override;
void ApplyConfiguration();
void SetConfiguration();
private:
void changeEvent(QEvent* event) override;
void RetranslateUI();
void SetConfiguration();
void UpdateBackgroundColorButton(QColor color);
void UpdateAPILayout();
void UpdateDeviceSelection(int device);
@@ -59,6 +56,4 @@ private:
std::vector<QString> vulkan_devices;
u32 vulkan_device{};
Settings::ShaderBackend shader_backend{};
const Core::System& system;
};

View File

@@ -7,15 +7,12 @@
<x>0</x>
<y>0</y>
<width>437</width>
<height>482</height>
<height>321</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>Graphics</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">

View File

@@ -8,8 +8,8 @@
#include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/configure_graphics_advanced.h"
ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(const Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGraphicsAdvanced), system{system_} {
ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGraphicsAdvanced) {
ui->setupUi(this);
@@ -21,7 +21,7 @@ ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(const Core::System& system_
ConfigureGraphicsAdvanced::~ConfigureGraphicsAdvanced() = default;
void ConfigureGraphicsAdvanced::SetConfiguration() {
const bool runtime_lock = !system.IsPoweredOn();
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
ui->use_vsync->setEnabled(runtime_lock);
ui->use_asynchronous_shaders->setEnabled(runtime_lock);
ui->anisotropic_filtering_combobox->setEnabled(runtime_lock);

View File

@@ -7,10 +7,6 @@
#include <memory>
#include <QWidget>
namespace Core {
class System;
}
namespace ConfigurationShared {
enum class CheckState;
}
@@ -23,16 +19,17 @@ class ConfigureGraphicsAdvanced : public QWidget {
Q_OBJECT
public:
explicit ConfigureGraphicsAdvanced(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureGraphicsAdvanced(QWidget* parent = nullptr);
~ConfigureGraphicsAdvanced() override;
void ApplyConfiguration();
void SetConfiguration();
private:
void changeEvent(QEvent* event) override;
void RetranslateUI();
void SetConfiguration();
void SetupPerGameUI();
std::unique_ptr<Ui::ConfigureGraphicsAdvanced> ui;
@@ -40,6 +37,4 @@ private:
ConfigurationShared::CheckState use_vsync;
ConfigurationShared::CheckState use_asynchronous_shaders;
ConfigurationShared::CheckState use_fast_gpu_time;
const Core::System& system;
};

View File

@@ -13,9 +13,6 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>Advanced</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">

View File

@@ -13,9 +13,6 @@
<property name="windowTitle">
<string>Hotkey Settings</string>
</property>
<property name="accessibleName">
<string>Hotkeys</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">

View File

@@ -39,11 +39,12 @@ void CallConfigureDialog(ConfigureInput& parent, Args&&... args) {
}
} // Anonymous namespace
void OnDockedModeChanged(bool last_state, bool new_state, Core::System& system) {
void OnDockedModeChanged(bool last_state, bool new_state) {
if (last_state == new_state) {
return;
}
Core::System& system{Core::System::GetInstance()};
if (!system.IsPoweredOn()) {
return;
}
@@ -65,9 +66,9 @@ void OnDockedModeChanged(bool last_state, bool new_state, Core::System& system)
}
}
ConfigureInput::ConfigureInput(Core::System& system_, QWidget* parent)
ConfigureInput::ConfigureInput(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureInput>()),
profiles(std::make_unique<InputProfiles>(system_)), system{system_} {
profiles(std::make_unique<InputProfiles>()) {
ui->setupUi(this);
}
@@ -76,22 +77,22 @@ ConfigureInput::~ConfigureInput() = default;
void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
std::size_t max_players) {
player_controllers = {
new ConfigureInputPlayer(this, 0, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
new ConfigureInputPlayer(this, 1, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
new ConfigureInputPlayer(this, 2, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
new ConfigureInputPlayer(this, 3, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
new ConfigureInputPlayer(this, 4, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
new ConfigureInputPlayer(this, 5, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
new ConfigureInputPlayer(this, 6, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
new ConfigureInputPlayer(this, 7, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
new ConfigureInputPlayer(this, 0, ui->consoleInputSettings, input_subsystem,
profiles.get()),
new ConfigureInputPlayer(this, 1, ui->consoleInputSettings, input_subsystem,
profiles.get()),
new ConfigureInputPlayer(this, 2, ui->consoleInputSettings, input_subsystem,
profiles.get()),
new ConfigureInputPlayer(this, 3, ui->consoleInputSettings, input_subsystem,
profiles.get()),
new ConfigureInputPlayer(this, 4, ui->consoleInputSettings, input_subsystem,
profiles.get()),
new ConfigureInputPlayer(this, 5, ui->consoleInputSettings, input_subsystem,
profiles.get()),
new ConfigureInputPlayer(this, 6, ui->consoleInputSettings, input_subsystem,
profiles.get()),
new ConfigureInputPlayer(this, 7, ui->consoleInputSettings, input_subsystem,
profiles.get()),
};
player_tabs = {
@@ -147,8 +148,7 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
ui->tabAdvanced->setLayout(new QHBoxLayout(ui->tabAdvanced));
ui->tabAdvanced->layout()->addWidget(advanced);
connect(advanced, &ConfigureInputAdvanced::CallDebugControllerDialog, [this, input_subsystem] {
CallConfigureDialog<ConfigureDebugController>(*this, input_subsystem, profiles.get(),
system);
CallConfigureDialog<ConfigureDebugController>(*this, input_subsystem, profiles.get());
});
connect(advanced, &ConfigureInputAdvanced::CallMouseConfigDialog, [this, input_subsystem] {
CallConfigureDialog<ConfigureMouseAdvanced>(*this, input_subsystem);
@@ -204,7 +204,7 @@ void ConfigureInput::ApplyConfiguration() {
const bool pre_docked_mode = Settings::values.use_docked_mode.GetValue();
Settings::values.use_docked_mode.SetValue(ui->radioDocked->isChecked());
OnDockedModeChanged(pre_docked_mode, Settings::values.use_docked_mode.GetValue(), system);
OnDockedModeChanged(pre_docked_mode, Settings::values.use_docked_mode.GetValue());
Settings::values.vibration_enabled.SetValue(ui->vibrationGroup->isChecked());
Settings::values.motion_enabled.SetValue(ui->motionGroup->isChecked());

View File

@@ -11,10 +11,6 @@
#include <QList>
#include <QWidget>
namespace Core {
class System;
}
class QCheckBox;
class QString;
class QTimer;
@@ -32,13 +28,13 @@ namespace Ui {
class ConfigureInput;
}
void OnDockedModeChanged(bool last_state, bool new_state, Core::System& system);
void OnDockedModeChanged(bool last_state, bool new_state);
class ConfigureInput : public QWidget {
Q_OBJECT
public:
explicit ConfigureInput(Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureInput(QWidget* parent = nullptr);
~ConfigureInput() override;
/// Initializes the input dialog with the given input subsystem.
@@ -73,6 +69,4 @@ private:
std::array<QWidget*, 8> player_tabs;
std::array<QCheckBox*, 8> player_connected;
ConfigureInputAdvanced* advanced;
Core::System& system;
};

View File

@@ -44,7 +44,8 @@ namespace {
constexpr std::size_t HANDHELD_INDEX = 8;
void UpdateController(Settings::ControllerType controller_type, std::size_t npad_index,
bool connected, Core::System& system) {
bool connected) {
Core::System& system{Core::System::GetInstance()};
if (!system.IsPoweredOn()) {
return;
}
@@ -231,12 +232,11 @@ QString AnalogToText(const Common::ParamPackage& param, const std::string& dir)
ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_index,
QWidget* bottom_row,
InputCommon::InputSubsystem* input_subsystem_,
InputProfiles* profiles_, Core::System& system_,
bool debug)
InputProfiles* profiles_, bool debug)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureInputPlayer>()), player_index(player_index),
debug(debug), input_subsystem{input_subsystem_}, profiles(profiles_),
timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()),
bottom_row(bottom_row), system{system_} {
bottom_row(bottom_row) {
ui->setupUi(this);
setFocusPolicy(Qt::ClickFocus);
@@ -683,7 +683,7 @@ void ConfigureInputPlayer::TryConnectSelectedController() {
controller_type == Settings::ControllerType::Handheld;
// Connect only if handheld is going from disconnected to connected
if (!handheld.connected && handheld_connected) {
UpdateController(controller_type, HANDHELD_INDEX, true, system);
UpdateController(controller_type, HANDHELD_INDEX, true);
}
handheld.connected = handheld_connected;
}
@@ -703,7 +703,7 @@ void ConfigureInputPlayer::TryConnectSelectedController() {
return;
}
UpdateController(controller_type, player_index, true, system);
UpdateController(controller_type, player_index, true);
}
void ConfigureInputPlayer::TryDisconnectSelectedController() {
@@ -721,7 +721,7 @@ void ConfigureInputPlayer::TryDisconnectSelectedController() {
controller_type == Settings::ControllerType::Handheld;
// Disconnect only if handheld is going from connected to disconnected
if (handheld.connected && !handheld_connected) {
UpdateController(controller_type, HANDHELD_INDEX, false, system);
UpdateController(controller_type, HANDHELD_INDEX, false);
}
return;
}
@@ -737,7 +737,7 @@ void ConfigureInputPlayer::TryDisconnectSelectedController() {
}
// Disconnect the controller first.
UpdateController(controller_type, player_index, false, system);
UpdateController(controller_type, player_index, false);
}
void ConfigureInputPlayer::showEvent(QShowEvent* event) {
@@ -1017,6 +1017,8 @@ void ConfigureInputPlayer::SetConnectableControllers() {
}
};
Core::System& system{Core::System::GetInstance()};
if (!system.IsPoweredOn()) {
add_controllers(true);
return;

View File

@@ -29,10 +29,6 @@ class QWidget;
class InputProfiles;
namespace Core {
class System;
}
namespace InputCommon {
class InputSubsystem;
}
@@ -52,8 +48,7 @@ class ConfigureInputPlayer : public QWidget {
public:
explicit ConfigureInputPlayer(QWidget* parent, std::size_t player_index, QWidget* bottom_row,
InputCommon::InputSubsystem* input_subsystem_,
InputProfiles* profiles_, Core::System& system_,
bool debug = false);
InputProfiles* profiles_, bool debug = false);
~ConfigureInputPlayer() override;
/// Save all button configurations to settings file.
@@ -238,6 +233,4 @@ private:
/// ConfigureInput widget. On show, add this widget to the main layout. This will change the
/// parent of the widget to this widget (but thats fine).
QWidget* bottom_row;
Core::System& system;
};

View File

@@ -2,17 +2,14 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/core.h"
#include "ui_configure_input_profile_dialog.h"
#include "yuzu/configuration/configure_input_player.h"
#include "yuzu/configuration/configure_input_profile_dialog.h"
ConfigureInputProfileDialog::ConfigureInputProfileDialog(
QWidget* parent, InputCommon::InputSubsystem* input_subsystem, InputProfiles* profiles,
Core::System& system)
QWidget* parent, InputCommon::InputSubsystem* input_subsystem, InputProfiles* profiles)
: QDialog(parent), ui(std::make_unique<Ui::ConfigureInputProfileDialog>()),
profile_widget(
new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles, system, false)) {
profile_widget(new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles, false)) {
ui->setupUi(this);
ui->controllerLayout->addWidget(profile_widget);

View File

@@ -13,10 +13,6 @@ class ConfigureInputPlayer;
class InputProfiles;
namespace Core {
class System;
}
namespace InputCommon {
class InputSubsystem;
}
@@ -31,7 +27,7 @@ class ConfigureInputProfileDialog : public QDialog {
public:
explicit ConfigureInputProfileDialog(QWidget* parent,
InputCommon::InputSubsystem* input_subsystem,
InputProfiles* profiles, Core::System& system);
InputProfiles* profiles);
~ConfigureInputProfileDialog() override;
private:

View File

@@ -10,8 +10,8 @@
#include "ui_configure_network.h"
#include "yuzu/configuration/configure_network.h"
ConfigureNetwork::ConfigureNetwork(const Core::System& system_, QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureNetwork>()), system{system_} {
ConfigureNetwork::ConfigureNetwork(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureNetwork>()) {
ui->setupUi(this);
ui->network_interface->addItem(tr("None"));
@@ -33,7 +33,7 @@ void ConfigureNetwork::RetranslateUi() {
}
void ConfigureNetwork::SetConfiguration() {
const bool runtime_lock = !system.IsPoweredOn();
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
const std::string& network_interface = Settings::values.network_interface.GetValue();

View File

@@ -16,7 +16,7 @@ class ConfigureNetwork : public QWidget {
Q_OBJECT
public:
explicit ConfigureNetwork(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureNetwork(QWidget* parent = nullptr);
~ConfigureNetwork() override;
void ApplyConfiguration();
@@ -26,6 +26,4 @@ private:
void SetConfiguration();
std::unique_ptr<Ui::ConfigureNetwork> ui;
const Core::System& system;
};

View File

@@ -13,9 +13,6 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>Network</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">

View File

@@ -30,56 +30,32 @@
#include "core/loader/loader.h"
#include "ui_configure_per_game.h"
#include "yuzu/configuration/config.h"
#include "yuzu/configuration/configure_audio.h"
#include "yuzu/configuration/configure_cpu.h"
#include "yuzu/configuration/configure_general.h"
#include "yuzu/configuration/configure_graphics.h"
#include "yuzu/configuration/configure_graphics_advanced.h"
#include "yuzu/configuration/configure_input.h"
#include "yuzu/configuration/configure_per_game.h"
#include "yuzu/configuration/configure_per_game_addons.h"
#include "yuzu/configuration/configure_system.h"
#include "yuzu/uisettings.h"
#include "yuzu/util/util.h"
ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id, const std::string& file_name,
Core::System& system_)
: QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()),
title_id(title_id), system{system_}, addons_tab{std::make_unique<ConfigurePerGameAddons>(
system_, this)},
audio_tab{std::make_unique<ConfigureAudio>(system_, this)},
cpu_tab{std::make_unique<ConfigureCpu>(system_, this)},
general_tab{std::make_unique<ConfigureGeneral>(system_, this)},
graphics_tab{std::make_unique<ConfigureGraphics>(system_, this)},
graphics_advanced_tab{std::make_unique<ConfigureGraphicsAdvanced>(system_, this)},
system_tab{std::make_unique<ConfigureSystem>(system_, this)} {
ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id, const std::string& file_name)
: QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), title_id(title_id) {
const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name));
const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename())
: fmt::format("{:016X}", title_id);
game_config =
std::make_unique<Config>(system, config_file_name, Config::ConfigType::PerGameConfig);
game_config = std::make_unique<Config>(config_file_name, Config::ConfigType::PerGameConfig);
Settings::SetConfiguringGlobal(false);
ui->setupUi(this);
ui->tabWidget->addTab(addons_tab.get(), tr("Add-Ons"));
ui->tabWidget->addTab(general_tab.get(), tr("General"));
ui->tabWidget->addTab(system_tab.get(), tr("System"));
ui->tabWidget->addTab(cpu_tab.get(), tr("CPU"));
ui->tabWidget->addTab(graphics_tab.get(), tr("Graphics"));
ui->tabWidget->addTab(graphics_advanced_tab.get(), tr("GraphicsAdvanced"));
ui->tabWidget->addTab(audio_tab.get(), tr("Audio"));
setFocusPolicy(Qt::ClickFocus);
setWindowTitle(tr("Properties"));
// remove Help question mark button from the title bar
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
addons_tab->SetTitleId(title_id);
ui->addonsTab->SetTitleId(title_id);
scene = new QGraphicsScene;
ui->icon_view->setScene(scene);
if (system.IsPoweredOn()) {
if (Core::System::GetInstance().IsPoweredOn()) {
QPushButton* apply_button = ui->buttonBox->addButton(QDialogButtonBox::Apply);
connect(apply_button, &QAbstractButton::clicked, this,
&ConfigurePerGame::HandleApplyButtonClicked);
@@ -91,15 +67,15 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id, const std::str
ConfigurePerGame::~ConfigurePerGame() = default;
void ConfigurePerGame::ApplyConfiguration() {
addons_tab->ApplyConfiguration();
general_tab->ApplyConfiguration();
cpu_tab->ApplyConfiguration();
system_tab->ApplyConfiguration();
graphics_tab->ApplyConfiguration();
graphics_advanced_tab->ApplyConfiguration();
audio_tab->ApplyConfiguration();
ui->addonsTab->ApplyConfiguration();
ui->generalTab->ApplyConfiguration();
ui->cpuTab->ApplyConfiguration();
ui->systemTab->ApplyConfiguration();
ui->graphicsTab->ApplyConfiguration();
ui->graphicsAdvancedTab->ApplyConfiguration();
ui->audioTab->ApplyConfiguration();
system.ApplySettings();
Core::System::GetInstance().ApplySettings();
Settings::LogSettings();
game_config->Save();
@@ -132,11 +108,12 @@ void ConfigurePerGame::LoadConfiguration() {
return;
}
addons_tab->LoadFromFile(file);
ui->addonsTab->LoadFromFile(file);
ui->display_title_id->setText(
QStringLiteral("%1").arg(title_id, 16, 16, QLatin1Char{'0'}).toUpper());
auto& system = Core::System::GetInstance();
const FileSys::PatchManager pm{title_id, system.GetFileSystemController(),
system.GetContentProvider()};
const auto control = pm.GetControlMetadata();
@@ -187,11 +164,4 @@ void ConfigurePerGame::LoadConfiguration() {
const auto valueText = ReadableByteSize(file->GetSize());
ui->display_size->setText(valueText);
general_tab->SetConfiguration();
cpu_tab->SetConfiguration();
system_tab->SetConfiguration();
graphics_tab->SetConfiguration();
graphics_advanced_tab->SetConfiguration();
audio_tab->SetConfiguration();
}

View File

@@ -14,18 +14,6 @@
#include "core/file_sys/vfs_types.h"
#include "yuzu/configuration/config.h"
namespace Core {
class System;
}
class ConfigurePerGameAddons;
class ConfigureAudio;
class ConfigureCpu;
class ConfigureGeneral;
class ConfigureGraphics;
class ConfigureGraphicsAdvanced;
class ConfigureSystem;
class QGraphicsScene;
class QStandardItem;
class QStandardItemModel;
@@ -41,8 +29,7 @@ class ConfigurePerGame : public QDialog {
public:
// Cannot use std::filesystem::path due to https://bugreports.qt.io/browse/QTBUG-73263
explicit ConfigurePerGame(QWidget* parent, u64 title_id, const std::string& file_name,
Core::System& system_);
explicit ConfigurePerGame(QWidget* parent, u64 title_id, const std::string& file_name);
~ConfigurePerGame() override;
/// Save all button configurations to settings file
@@ -65,14 +52,4 @@ private:
QGraphicsScene* scene;
std::unique_ptr<Config> game_config;
Core::System& system;
std::unique_ptr<ConfigurePerGameAddons> addons_tab;
std::unique_ptr<ConfigureAudio> audio_tab;
std::unique_ptr<ConfigureCpu> cpu_tab;
std::unique_ptr<ConfigureGeneral> general_tab;
std::unique_ptr<ConfigureGraphics> graphics_tab;
std::unique_ptr<ConfigureGraphicsAdvanced> graphics_advanced_tab;
std::unique_ptr<ConfigureSystem> system_tab;
};

View File

@@ -7,13 +7,12 @@
<x>0</x>
<y>0</y>
<width>900</width>
<height>630</height>
<height>600</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>900</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
@@ -215,7 +214,7 @@
<bool>true</bool>
</property>
<property name="currentIndex">
<number>-1</number>
<number>0</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
@@ -226,6 +225,41 @@
<property name="tabsClosable">
<bool>false</bool>
</property>
<widget class="ConfigurePerGameAddons" name="addonsTab">
<attribute name="title">
<string>Add-Ons</string>
</attribute>
</widget>
<widget class="ConfigureGeneral" name="generalTab">
<attribute name="title">
<string>General</string>
</attribute>
</widget>
<widget class="ConfigureSystem" name="systemTab">
<attribute name="title">
<string>System</string>
</attribute>
</widget>
<widget class="ConfigureCpu" name="cpuTab">
<attribute name="title">
<string>CPU</string>
</attribute>
</widget>
<widget class="ConfigureGraphics" name="graphicsTab">
<attribute name="title">
<string>Graphics</string>
</attribute>
</widget>
<widget class="ConfigureGraphicsAdvanced" name="graphicsAdvancedTab">
<attribute name="title">
<string>Adv. Graphics</string>
</attribute>
</widget>
<widget class="ConfigureAudio" name="audioTab">
<attribute name="title">
<string>Audio</string>
</attribute>
</widget>
</widget>
</item>
</layout>
@@ -250,6 +284,50 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ConfigureGeneral</class>
<extends>QWidget</extends>
<header>configuration/configure_general.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureSystem</class>
<extends>QWidget</extends>
<header>configuration/configure_system.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureAudio</class>
<extends>QWidget</extends>
<header>configuration/configure_audio.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureGraphics</class>
<extends>QWidget</extends>
<header>configuration/configure_graphics.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureGraphicsAdvanced</class>
<extends>QWidget</extends>
<header>configuration/configure_graphics_advanced.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigurePerGameAddons</class>
<extends>QWidget</extends>
<header>configuration/configure_per_game_addons.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ConfigureCpu</class>
<extends>QWidget</extends>
<header>configuration/configure_cpu.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
@@ -257,32 +335,12 @@
<signal>accepted()</signal>
<receiver>ConfigurePerGame</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ConfigurePerGame</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -26,8 +26,8 @@
#include "yuzu/uisettings.h"
#include "yuzu/util/util.h"
ConfigurePerGameAddons::ConfigurePerGameAddons(Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigurePerGameAddons), system{system_} {
ConfigurePerGameAddons::ConfigurePerGameAddons(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigurePerGameAddons) {
ui->setupUi(this);
layout = new QVBoxLayout;
@@ -58,7 +58,7 @@ ConfigurePerGameAddons::ConfigurePerGameAddons(Core::System& system_, QWidget* p
ui->scrollArea->setLayout(layout);
ui->scrollArea->setEnabled(!system.IsPoweredOn());
ui->scrollArea->setEnabled(!Core::System::GetInstance().IsPoweredOn());
connect(item_model, &QStandardItemModel::itemChanged,
[] { UISettings::values.is_game_list_reload_pending.exchange(true); });
@@ -112,6 +112,7 @@ void ConfigurePerGameAddons::LoadConfiguration() {
return;
}
auto& system = Core::System::GetInstance();
const FileSys::PatchManager pm{title_id, system.GetFileSystemController(),
system.GetContentProvider()};
const auto loader = Loader::GetLoader(system, file);

View File

@@ -11,10 +11,6 @@
#include "core/file_sys/vfs_types.h"
namespace Core {
class System;
}
class QGraphicsScene;
class QStandardItem;
class QStandardItemModel;
@@ -29,7 +25,7 @@ class ConfigurePerGameAddons : public QWidget {
Q_OBJECT
public:
explicit ConfigurePerGameAddons(Core::System& system_, QWidget* parent = nullptr);
explicit ConfigurePerGameAddons(QWidget* parent = nullptr);
~ConfigurePerGameAddons() override;
/// Save all button configurations to settings file
@@ -54,6 +50,4 @@ private:
QStandardItemModel* item_model;
std::vector<QList<QStandardItem*>> list_items;
Core::System& system;
};

View File

@@ -13,9 +13,6 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleDescription">
<string>Add-Ons</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">

View File

@@ -76,9 +76,9 @@ QString GetProfileUsernameFromUser(QWidget* parent, const QString& description_t
}
} // Anonymous namespace
ConfigureProfileManager::ConfigureProfileManager(const Core::System& system_, QWidget* parent)
ConfigureProfileManager::ConfigureProfileManager(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureProfileManager),
profile_manager(std::make_unique<Service::Account::ProfileManager>()), system{system_} {
profile_manager(std::make_unique<Service::Account::ProfileManager>()) {
ui->setupUi(this);
tree_view = new QTreeView;
@@ -137,7 +137,7 @@ void ConfigureProfileManager::RetranslateUI() {
}
void ConfigureProfileManager::SetConfiguration() {
enabled = !system.IsPoweredOn();
enabled = !Core::System::GetInstance().IsPoweredOn();
item_model->removeRows(0, item_model->rowCount());
list_items.clear();
@@ -180,6 +180,8 @@ void ConfigureProfileManager::ApplyConfiguration() {
if (!enabled) {
return;
}
Core::System::GetInstance().ApplySettings();
}
void ConfigureProfileManager::SelectUser(const QModelIndex& index) {

View File

@@ -9,10 +9,6 @@
#include <QList>
#include <QWidget>
namespace Core {
class System;
}
class QGraphicsScene;
class QStandardItem;
class QStandardItemModel;
@@ -31,7 +27,7 @@ class ConfigureProfileManager : public QWidget {
Q_OBJECT
public:
explicit ConfigureProfileManager(const Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureProfileManager(QWidget* parent = nullptr);
~ConfigureProfileManager() override;
void ApplyConfiguration();
@@ -62,6 +58,4 @@ private:
bool enabled = false;
std::unique_ptr<Service::Account::ProfileManager> profile_manager;
const Core::System& system;
};

View File

@@ -6,16 +6,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>390</width>
<width>366</width>
<height>483</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>Profiles</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">

View File

@@ -12,13 +12,12 @@
#include "common/assert.h"
#include "common/settings.h"
#include "core/core.h"
#include "core/hle/service/time/time.h"
#include "core/hle/service/time/time_manager.h"
#include "ui_configure_system.h"
#include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/configure_system.h"
ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureSystem), system{system_} {
ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) {
ui->setupUi(this);
connect(ui->button_regenerate_console_id, &QPushButton::clicked, this,
&ConfigureSystem::RefreshConsoleID);
@@ -60,7 +59,7 @@ void ConfigureSystem::RetranslateUI() {
}
void ConfigureSystem::SetConfiguration() {
enabled = !system.IsPoweredOn();
enabled = !Core::System::GetInstance().IsPoweredOn();
const auto rng_seed =
QStringLiteral("%1")
.arg(Settings::values.rng_seed.GetValue().value_or(0), 8, 16, QLatin1Char{'0'})
@@ -104,6 +103,8 @@ void ConfigureSystem::SetConfiguration() {
void ConfigureSystem::ReadSystemSettings() {}
void ConfigureSystem::ApplyConfiguration() {
auto& system = Core::System::GetInstance();
// Allow setting custom RTC even if system is powered on,
// to allow in-game time to be fast forwarded
if (Settings::IsConfiguringGlobal()) {
@@ -161,6 +162,8 @@ void ConfigureSystem::ApplyConfiguration() {
break;
}
}
system.ApplySettings();
}
void ConfigureSystem::RefreshConsoleID() {

View File

@@ -9,10 +9,6 @@
#include <QList>
#include <QWidget>
namespace Core {
class System;
}
namespace ConfigurationShared {
enum class CheckState;
}
@@ -25,16 +21,17 @@ class ConfigureSystem : public QWidget {
Q_OBJECT
public:
explicit ConfigureSystem(Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureSystem(QWidget* parent = nullptr);
~ConfigureSystem() override;
void ApplyConfiguration();
void SetConfiguration();
private:
void changeEvent(QEvent* event) override;
void RetranslateUI();
void SetConfiguration();
void ReadSystemSettings();
void RefreshConsoleID();
@@ -51,6 +48,4 @@ private:
ConfigurationShared::CheckState use_rng_seed;
ConfigurationShared::CheckState use_custom_rtc;
Core::System& system;
};

View File

@@ -13,9 +13,6 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="accessibleName">
<string>System</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">

View File

@@ -54,8 +54,7 @@ QString GetTranslatedRowTextName(size_t index) {
}
} // Anonymous namespace
ConfigureUi::ConfigureUi(Core::System& system_, QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureUi), system{system_} {
ConfigureUi::ConfigureUi(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureUi) {
ui->setupUi(this);
InitializeLanguageComboBox();
@@ -117,7 +116,7 @@ void ConfigureUi::ApplyConfiguration() {
UISettings::values.enable_screenshot_save_as = ui->enable_screenshot_save_as->isChecked();
Common::FS::SetYuzuPath(Common::FS::YuzuPath::ScreenshotsDir,
ui->screenshot_path_edit->text().toStdString());
system.ApplySettings();
Core::System::GetInstance().ApplySettings();
}
void ConfigureUi::RequestGameListUpdate() {

View File

@@ -7,10 +7,6 @@
#include <memory>
#include <QWidget>
namespace Core {
class System;
}
namespace Ui {
class ConfigureUi;
}
@@ -19,7 +15,7 @@ class ConfigureUi : public QWidget {
Q_OBJECT
public:
explicit ConfigureUi(Core::System& system_, QWidget* parent = nullptr);
explicit ConfigureUi(QWidget* parent = nullptr);
~ConfigureUi() override;
void ApplyConfiguration();
@@ -46,6 +42,4 @@ private:
void UpdateSecondRowComboBox(bool init = false);
std::unique_ptr<Ui::ConfigureUi> ui;
Core::System& system;
};

Some files were not shown because too many files have changed in this diff Show More