summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.clang-format3
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/audio_core/CMakeLists.txt3
-rw-r--r--src/common/CMakeLists.txt3
-rw-r--r--src/common/alignment.h3
-rw-r--r--src/common/atomic_helpers.h5
-rw-r--r--src/common/detached_tasks.cpp5
-rw-r--r--src/common/detached_tasks.h5
-rw-r--r--src/common/error.cpp6
-rw-r--r--src/common/error.h6
-rw-r--r--src/common/fixed_point.h26
-rw-r--r--src/common/hash.h5
-rw-r--r--src/common/input.h5
-rw-r--r--src/common/logging/backend.cpp5
-rw-r--r--src/common/logging/backend.h5
-rw-r--r--src/common/logging/filter.cpp5
-rw-r--r--src/common/logging/filter.h5
-rw-r--r--src/common/logging/log.h5
-rw-r--r--src/common/logging/text_formatter.cpp5
-rw-r--r--src/common/logging/text_formatter.h5
-rw-r--r--src/common/microprofile.cpp5
-rw-r--r--src/common/microprofile.h5
-rw-r--r--src/common/microprofileui.h5
-rw-r--r--src/common/param_package.cpp5
-rw-r--r--src/common/param_package.h5
-rw-r--r--src/common/quaternion.h5
-rw-r--r--src/common/reader_writer_queue.h5
-rw-r--r--src/common/scm_rev.cpp.in5
-rw-r--r--src/common/scm_rev.h5
-rw-r--r--src/common/scope_exit.h5
-rw-r--r--src/common/telemetry.cpp5
-rw-r--r--src/common/telemetry.h5
-rw-r--r--src/common/uint128.h5
-rw-r--r--src/common/x64/native_clock.cpp2
-rw-r--r--src/common/x64/xbyak_abi.h5
-rw-r--r--src/common/x64/xbyak_util.h5
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/arm/arm_interface.h5
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_cp15.cpp5
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_cp15.h5
-rw-r--r--src/core/core.cpp5
-rw-r--r--src/core/core.h5
-rw-r--r--src/core/core_timing.cpp151
-rw-r--r--src/core/core_timing.h25
-rw-r--r--src/core/file_sys/errors.h5
-rw-r--r--src/core/frontend/applets/software_keyboard.h2
-rw-r--r--src/core/frontend/emu_window.cpp5
-rw-r--r--src/core/frontend/emu_window.h5
-rw-r--r--src/core/hle/ipc.h5
-rw-r--r--src/core/hle/ipc_helpers.h5
-rw-r--r--src/core/hle/kernel/k_client_port.cpp5
-rw-r--r--src/core/hle/kernel/k_client_port.h5
-rw-r--r--src/core/hle/kernel/k_process.cpp5
-rw-r--r--src/core/hle/kernel/k_process.h5
-rw-r--r--src/core/hle/kernel/k_shared_memory.cpp5
-rw-r--r--src/core/hle/kernel/k_shared_memory.h5
-rw-r--r--src/core/hle/result.h5
-rw-r--r--src/core/hle/service/am/applets/applet_software_keyboard.cpp6
-rw-r--r--src/core/hle/service/hid/irs.cpp2
-rw-r--r--src/core/hle/service/hid/irs_ring_lifo.h47
-rw-r--r--src/core/hle/service/hid/irsensor/clustering_processor.cpp239
-rw-r--r--src/core/hle/service/hid/irsensor/clustering_processor.h38
-rw-r--r--src/core/memory.cpp5
-rw-r--r--src/core/memory.h5
-rw-r--r--src/core/perf_stats.cpp5
-rw-r--r--src/core/perf_stats.h5
-rw-r--r--src/core/telemetry_session.cpp5
-rw-r--r--src/core/telemetry_session.h5
-rw-r--r--src/input_common/CMakeLists.txt3
-rw-r--r--src/input_common/drivers/sdl_driver.cpp5
-rw-r--r--src/input_common/drivers/sdl_driver.h5
-rw-r--r--src/input_common/drivers/tas_input.cpp2
-rw-r--r--src/input_common/drivers/udp_client.cpp5
-rw-r--r--src/input_common/drivers/udp_client.h5
-rw-r--r--src/input_common/helpers/stick_from_buttons.cpp5
-rw-r--r--src/input_common/helpers/stick_from_buttons.h5
-rw-r--r--src/input_common/helpers/touch_from_buttons.cpp5
-rw-r--r--src/input_common/helpers/touch_from_buttons.h5
-rw-r--r--src/input_common/helpers/udp_protocol.cpp5
-rw-r--r--src/input_common/helpers/udp_protocol.h5
-rw-r--r--src/input_common/main.cpp5
-rw-r--r--src/input_common/main.h5
-rw-r--r--src/network/CMakeLists.txt3
-rw-r--r--src/shader_recompiler/CMakeLists.txt3
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py6
-rw-r--r--src/tests/CMakeLists.txt3
-rw-r--r--src/tests/common/bit_field.cpp5
-rw-r--r--src/tests/common/param_package.cpp5
-rw-r--r--src/tests/core/core_timing.cpp4
-rw-r--r--src/tests/tests.cpp5
-rw-r--r--src/video_core/CMakeLists.txt3
-rw-r--r--src/video_core/gpu_thread.cpp3
-rw-r--r--src/video_core/gpu_thread.h4
-rw-r--r--src/video_core/host_shaders/CMakeLists.txt3
-rw-r--r--src/video_core/host_shaders/StringShaderHeader.cmake3
-rw-r--r--src/video_core/host_shaders/source_shader.h.in3
-rw-r--r--src/video_core/host_shaders/vulkan_present_scaleforce_fp16.frag3
-rw-r--r--src/video_core/host_shaders/vulkan_present_scaleforce_fp32.frag3
-rw-r--r--src/video_core/renderer_base.cpp5
-rw-r--r--src/video_core/renderer_base.h5
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp5
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h5
-rw-r--r--src/video_core/renderer_opengl/gl_resource_manager.cpp5
-rw-r--r--src/video_core/renderer_opengl/gl_resource_manager.h5
-rw-r--r--src/video_core/renderer_opengl/gl_shader_util.cpp5
-rw-r--r--src/video_core/renderer_opengl/gl_shader_util.h5
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp5
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h5
-rw-r--r--src/video_core/surface.cpp5
-rw-r--r--src/video_core/surface.h5
-rw-r--r--src/video_core/video_core.cpp5
-rw-r--r--src/video_core/video_core.h5
-rw-r--r--src/web_service/CMakeLists.txt3
-rw-r--r--src/web_service/telemetry_json.cpp5
-rw-r--r--src/web_service/telemetry_json.h5
-rw-r--r--src/web_service/verify_login.cpp5
-rw-r--r--src/web_service/verify_login.h5
-rw-r--r--src/web_service/web_backend.cpp5
-rw-r--r--src/web_service/web_backend.h5
-rw-r--r--src/yuzu/CMakeLists.txt3
-rw-r--r--src/yuzu/Info.plist6
-rw-r--r--src/yuzu/aboutdialog.ui2
-rw-r--r--src/yuzu/applets/qt_software_keyboard.cpp37
-rw-r--r--src/yuzu/applets/qt_software_keyboard.h2
-rw-r--r--src/yuzu/applets/qt_software_keyboard.ui38
-rw-r--r--src/yuzu/bootmanager.cpp8
-rw-r--r--src/yuzu/bootmanager.h5
-rw-r--r--src/yuzu/compatdb.cpp5
-rw-r--r--src/yuzu/compatdb.h5
-rw-r--r--src/yuzu/configuration/config.cpp5
-rw-r--r--src/yuzu/configuration/config.h5
-rw-r--r--src/yuzu/configuration/configuration_shared.cpp5
-rw-r--r--src/yuzu/configuration/configuration_shared.h5
-rw-r--r--src/yuzu/configuration/configure_debug.cpp5
-rw-r--r--src/yuzu/configuration/configure_debug.h5
-rw-r--r--src/yuzu/configuration/configure_dialog.cpp5
-rw-r--r--src/yuzu/configuration/configure_dialog.h5
-rw-r--r--src/yuzu/configuration/configure_general.cpp5
-rw-r--r--src/yuzu/configuration/configure_general.h5
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp5
-rw-r--r--src/yuzu/configuration/configure_graphics.h5
-rw-r--r--src/yuzu/configuration/configure_hotkeys.cpp5
-rw-r--r--src/yuzu/configuration/configure_hotkeys.h5
-rw-r--r--src/yuzu/configuration/configure_input.cpp5
-rw-r--r--src/yuzu/configuration/configure_input.h5
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp5
-rw-r--r--src/yuzu/configuration/configure_input_player.h5
-rw-r--r--src/yuzu/configuration/configure_motion_touch.cpp5
-rw-r--r--src/yuzu/configuration/configure_motion_touch.h5
-rw-r--r--src/yuzu/configuration/configure_per_game_addons.cpp5
-rw-r--r--src/yuzu/configuration/configure_per_game_addons.h5
-rw-r--r--src/yuzu/configuration/configure_profile_manager.cpp5
-rw-r--r--src/yuzu/configuration/configure_profile_manager.h5
-rw-r--r--src/yuzu/configuration/configure_system.cpp5
-rw-r--r--src/yuzu/configuration/configure_system.h5
-rw-r--r--src/yuzu/configuration/configure_touch_from_button.cpp5
-rw-r--r--src/yuzu/configuration/configure_touch_from_button.h5
-rw-r--r--src/yuzu/configuration/configure_touch_widget.h5
-rw-r--r--src/yuzu/configuration/configure_touchscreen_advanced.cpp5
-rw-r--r--src/yuzu/configuration/configure_touchscreen_advanced.h5
-rw-r--r--src/yuzu/configuration/configure_ui.cpp5
-rw-r--r--src/yuzu/configuration/configure_ui.h5
-rw-r--r--src/yuzu/configuration/configure_web.cpp5
-rw-r--r--src/yuzu/configuration/configure_web.h5
-rw-r--r--src/yuzu/debugger/controller.cpp5
-rw-r--r--src/yuzu/debugger/controller.h5
-rw-r--r--src/yuzu/debugger/profiler.cpp5
-rw-r--r--src/yuzu/debugger/profiler.h5
-rw-r--r--src/yuzu/debugger/wait_tree.cpp5
-rw-r--r--src/yuzu/debugger/wait_tree.h5
-rw-r--r--src/yuzu/discord.h5
-rw-r--r--src/yuzu/discord_impl.cpp5
-rw-r--r--src/yuzu/discord_impl.h5
-rw-r--r--src/yuzu/game_list.cpp5
-rw-r--r--src/yuzu/game_list.h5
-rw-r--r--src/yuzu/game_list_p.h5
-rw-r--r--src/yuzu/hotkeys.cpp5
-rw-r--r--src/yuzu/hotkeys.h5
-rw-r--r--src/yuzu/main.cpp104
-rw-r--r--src/yuzu/main.h21
-rw-r--r--src/yuzu/uisettings.cpp5
-rw-r--r--src/yuzu/uisettings.h5
-rw-r--r--src/yuzu/util/sequence_dialog/sequence_dialog.cpp5
-rw-r--r--src/yuzu/util/sequence_dialog/sequence_dialog.h5
-rw-r--r--src/yuzu/util/util.cpp5
-rw-r--r--src/yuzu/util/util.h5
-rw-r--r--src/yuzu/yuzu.qrc5
-rw-r--r--src/yuzu/yuzu.rc3
-rw-r--r--src/yuzu_cmd/CMakeLists.txt3
-rw-r--r--src/yuzu_cmd/config.cpp5
-rw-r--r--src/yuzu_cmd/config.h5
-rw-r--r--src/yuzu_cmd/default_ini.h5
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.cpp5
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.h5
-rw-r--r--src/yuzu_cmd/yuzu.cpp5
-rw-r--r--src/yuzu_cmd/yuzu.rc3
196 files changed, 980 insertions, 621 deletions
diff --git a/src/.clang-format b/src/.clang-format
index 1c6b71b2e..f92771ec3 100644
--- a/src/.clang-format
+++ b/src/.clang-format
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2016 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1--- 4---
2Language: Cpp 5Language: Cpp
3# BasedOnStyle: LLVM 6# BasedOnStyle: LLVM
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9367f67c1..fc177fa52 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1# Enable modules to include each other's files 4# Enable modules to include each other's files
2include_directories(.) 5include_directories(.)
3 6
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt
index 2971c42a2..5fe1d5fa5 100644
--- a/src/audio_core/CMakeLists.txt
+++ b/src/audio_core/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1add_library(audio_core STATIC 4add_library(audio_core STATIC
2 audio_core.cpp 5 audio_core.cpp
3 audio_core.h 6 audio_core.h
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 05fdfea82..a6dc31b53 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1if (DEFINED ENV{AZURECIREPO}) 4if (DEFINED ENV{AZURECIREPO})
2 set(BUILD_REPOSITORY $ENV{AZURECIREPO}) 5 set(BUILD_REPOSITORY $ENV{AZURECIREPO})
3endif() 6endif()
diff --git a/src/common/alignment.h b/src/common/alignment.h
index 8570c7d3c..7e897334b 100644
--- a/src/common/alignment.h
+++ b/src/common/alignment.h
@@ -1,4 +1,5 @@
1// This file is under the public domain. 1// SPDX-FileCopyrightText: 2014 Jannik Vogel <email@jannikvogel.de>
2// SPDX-License-Identifier: CC0-1.0
2 3
3#pragma once 4#pragma once
4 5
diff --git a/src/common/atomic_helpers.h b/src/common/atomic_helpers.h
index 6d912b52e..bef5015c1 100644
--- a/src/common/atomic_helpers.h
+++ b/src/common/atomic_helpers.h
@@ -1,4 +1,7 @@
1// ©2013-2016 Cameron Desrochers. 1// SPDX-FileCopyrightText: 2013-2016 Cameron Desrochers
2// SPDX-FileCopyrightText: 2015 Jeff Preshing
3// SPDX-License-Identifier: BSD-2-Clause AND Zlib
4
2// Distributed under the simplified BSD license (see the license file that 5// Distributed under the simplified BSD license (see the license file that
3// should have come with this header). 6// should have come with this header).
4// Uses Jeff Preshing's semaphore implementation (under the terms of its 7// Uses Jeff Preshing's semaphore implementation (under the terms of its
diff --git a/src/common/detached_tasks.cpp b/src/common/detached_tasks.cpp
index ec31d0b88..da64848da 100644
--- a/src/common/detached_tasks.cpp
+++ b/src/common/detached_tasks.cpp
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <thread> 4#include <thread>
6#include "common/assert.h" 5#include "common/assert.h"
diff --git a/src/common/detached_tasks.h b/src/common/detached_tasks.h
index 5dd8fc27b..416a2d7f3 100644
--- a/src/common/detached_tasks.h
+++ b/src/common/detached_tasks.h
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/error.cpp b/src/common/error.cpp
index d4455e310..ddb03bd45 100644
--- a/src/common/error.cpp
+++ b/src/common/error.cpp
@@ -1,6 +1,6 @@
1// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-FileCopyrightText: 2014 Citra Emulator Project
3// Refer to the license.txt file included. 3// SPDX-License-Identifier: GPL-2.0-or-later
4 4
5#include <cstddef> 5#include <cstddef>
6#ifdef _WIN32 6#ifdef _WIN32
diff --git a/src/common/error.h b/src/common/error.h
index e084d4b0f..62a3bd835 100644
--- a/src/common/error.h
+++ b/src/common/error.h
@@ -1,6 +1,6 @@
1// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-FileCopyrightText: 2014 Citra Emulator Project
3// Refer to the license.txt file included. 3// SPDX-License-Identifier: GPL-2.0-or-later
4 4
5#pragma once 5#pragma once
6 6
diff --git a/src/common/fixed_point.h b/src/common/fixed_point.h
index 1d45e51b3..4a0f72cc9 100644
--- a/src/common/fixed_point.h
+++ b/src/common/fixed_point.h
@@ -1,28 +1,8 @@
1// SPDX-FileCopyrightText: 2015 Evan Teran
2// SPDX-License-Identifier: MIT
3
1// From: https://github.com/eteran/cpp-utilities/blob/master/fixed/include/cpp-utilities/fixed.h 4// From: https://github.com/eteran/cpp-utilities/blob/master/fixed/include/cpp-utilities/fixed.h
2// See also: http://stackoverflow.com/questions/79677/whats-the-best-way-to-do-fixed-point-math 5// See also: http://stackoverflow.com/questions/79677/whats-the-best-way-to-do-fixed-point-math
3/*
4 * The MIT License (MIT)
5 *
6 * Copyright (c) 2015 Evan Teran
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in all
16 * copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
25 */
26 6
27#ifndef FIXED_H_ 7#ifndef FIXED_H_
28#define FIXED_H_ 8#define FIXED_H_
diff --git a/src/common/hash.h b/src/common/hash.h
index 298930702..b6f3e6d6f 100644
--- a/src/common/hash.h
+++ b/src/common/hash.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/input.h b/src/common/input.h
index 995c35d9d..213aa2384 100644
--- a/src/common/input.h
+++ b/src/common/input.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index b3793106d..8ce1c2fd1 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <atomic> 4#include <atomic>
6#include <chrono> 5#include <chrono>
diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h
index a0e80fe3c..12e5e2498 100644
--- a/src/common/logging/backend.h
+++ b/src/common/logging/backend.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp
index 6de9bacbf..a959acb74 100644
--- a/src/common/logging/filter.cpp
+++ b/src/common/logging/filter.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include "common/logging/filter.h" 5#include "common/logging/filter.h"
diff --git a/src/common/logging/filter.h b/src/common/logging/filter.h
index 29419f051..54d172cc0 100644
--- a/src/common/logging/filter.h
+++ b/src/common/logging/filter.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 0c80d01ee..c00c01a9e 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp
index b2cad58d8..09398ea64 100644
--- a/src/common/logging/text_formatter.cpp
+++ b/src/common/logging/text_formatter.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <cstdio> 5#include <cstdio>
diff --git a/src/common/logging/text_formatter.h b/src/common/logging/text_formatter.h
index 92c0bf0c5..0d0ec4370 100644
--- a/src/common/logging/text_formatter.h
+++ b/src/common/logging/text_formatter.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/microprofile.cpp b/src/common/microprofile.cpp
index ee25dd37f..e6657c82f 100644
--- a/src/common/microprofile.cpp
+++ b/src/common/microprofile.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5// Includes the MicroProfile implementation in this file for compilation 4// Includes the MicroProfile implementation in this file for compilation
6#define MICROPROFILE_IMPL 1 5#define MICROPROFILE_IMPL 1
diff --git a/src/common/microprofile.h b/src/common/microprofile.h
index 54e7f3cc4..91d14d5e1 100644
--- a/src/common/microprofile.h
+++ b/src/common/microprofile.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/microprofileui.h b/src/common/microprofileui.h
index 41abe6b75..39ed18ffa 100644
--- a/src/common/microprofileui.h
+++ b/src/common/microprofileui.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/param_package.cpp b/src/common/param_package.cpp
index 462502e34..629babb81 100644
--- a/src/common/param_package.cpp
+++ b/src/common/param_package.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <stdexcept> 5#include <stdexcept>
diff --git a/src/common/param_package.h b/src/common/param_package.h
index c13e45479..d7c13cb1f 100644
--- a/src/common/param_package.h
+++ b/src/common/param_package.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/quaternion.h b/src/common/quaternion.h
index 4d0871eb4..5bb5f2af0 100644
--- a/src/common/quaternion.h
+++ b/src/common/quaternion.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/reader_writer_queue.h b/src/common/reader_writer_queue.h
index 8d2c9408c..60c41a8cb 100644
--- a/src/common/reader_writer_queue.h
+++ b/src/common/reader_writer_queue.h
@@ -1,6 +1,5 @@
1// ©2013-2020 Cameron Desrochers. 1// SPDX-FileCopyrightText: 2013-2020 Cameron Desrochers
2// Distributed under the simplified BSD license (see the license file that 2// SPDX-License-Identifier: BSD-2-Clause
3// should have come with this header).
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in
index cc88994c6..f0c124d69 100644
--- a/src/common/scm_rev.cpp.in
+++ b/src/common/scm_rev.cpp.in
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/scm_rev.h" 4#include "common/scm_rev.h"
6 5
diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h
index 563015ec9..88404316a 100644
--- a/src/common/scm_rev.h
+++ b/src/common/scm_rev.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index 35dac3a8f..e9c789c88 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/telemetry.cpp b/src/common/telemetry.cpp
index 67261c55b..d26394359 100644
--- a/src/common/telemetry.cpp
+++ b/src/common/telemetry.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <cstring> 5#include <cstring>
diff --git a/src/common/telemetry.h b/src/common/telemetry.h
index f9a824a7d..ba633d5a5 100644
--- a/src/common/telemetry.h
+++ b/src/common/telemetry.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/uint128.h b/src/common/uint128.h
index 199d0f55e..f890ffec2 100644
--- a/src/common/uint128.h
+++ b/src/common/uint128.h
@@ -31,17 +31,12 @@ namespace Common {
31 return _udiv128(r[1], r[0], d, &remainder); 31 return _udiv128(r[1], r[0], d, &remainder);
32#endif 32#endif
33#else 33#else
34#ifdef __SIZEOF_INT128__
35 const auto product = static_cast<unsigned __int128>(a) * static_cast<unsigned __int128>(b);
36 return static_cast<u64>(product / d);
37#else
38 const u64 diva = a / d; 34 const u64 diva = a / d;
39 const u64 moda = a % d; 35 const u64 moda = a % d;
40 const u64 divb = b / d; 36 const u64 divb = b / d;
41 const u64 modb = b % d; 37 const u64 modb = b % d;
42 return diva * b + moda * divb + moda * modb / d; 38 return diva * b + moda * divb + moda * modb / d;
43#endif 39#endif
44#endif
45} 40}
46 41
47// This function multiplies 2 u64 values and produces a u128 value; 42// This function multiplies 2 u64 values and produces a u128 value;
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp
index 6aaa8cdf9..8b08332ab 100644
--- a/src/common/x64/native_clock.cpp
+++ b/src/common/x64/native_clock.cpp
@@ -75,8 +75,8 @@ NativeClock::NativeClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequen
75} 75}
76 76
77u64 NativeClock::GetRTSC() { 77u64 NativeClock::GetRTSC() {
78 TimePoint current_time_point{};
79 TimePoint new_time_point{}; 78 TimePoint new_time_point{};
79 TimePoint current_time_point{};
80 80
81 current_time_point.pack = Common::AtomicLoad128(time_point.pack.data()); 81 current_time_point.pack = Common::AtomicLoad128(time_point.pack.data());
82 do { 82 do {
diff --git a/src/common/x64/xbyak_abi.h b/src/common/x64/xbyak_abi.h
index 87b3d63a4..67e6e63c8 100644
--- a/src/common/x64/xbyak_abi.h
+++ b/src/common/x64/xbyak_abi.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/common/x64/xbyak_util.h b/src/common/x64/xbyak_util.h
index 44d2558f1..250e5cddb 100644
--- a/src/common/x64/xbyak_util.h
+++ b/src/common/x64/xbyak_util.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index c1cc62a45..40b1ea4a2 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1add_library(core STATIC 4add_library(core STATIC
2 announce_multiplayer_session.cpp 5 announce_multiplayer_session.cpp
3 announce_multiplayer_session.h 6 announce_multiplayer_session.h
@@ -448,6 +451,7 @@ add_library(core STATIC
448 hle/service/hid/hidbus.h 451 hle/service/hid/hidbus.h
449 hle/service/hid/irs.cpp 452 hle/service/hid/irs.cpp
450 hle/service/hid/irs.h 453 hle/service/hid/irs.h
454 hle/service/hid/irs_ring_lifo.h
451 hle/service/hid/ring_lifo.h 455 hle/service/hid/ring_lifo.h
452 hle/service/hid/xcd.cpp 456 hle/service/hid/xcd.cpp
453 hle/service/hid/xcd.h 457 hle/service/hid/xcd.h
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index c092db9ff..73f259525 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp
index 6aae79c48..e9123c13d 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <fmt/format.h> 4#include <fmt/format.h>
6#include "common/logging/log.h" 5#include "common/logging/log.h"
diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.h b/src/core/arm/dynarmic/arm_dynarmic_cp15.h
index f271b2070..5b2a51636 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_cp15.h
+++ b/src/core/arm/dynarmic/arm_dynarmic_cp15.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 95791a07f..ea32a4a8d 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <atomic> 5#include <atomic>
diff --git a/src/core/core.h b/src/core/core.h
index 13122dd61..0ce3b1d60 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 5425637f5..2dbb99c8b 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -6,9 +6,7 @@
6#include <string> 6#include <string>
7#include <tuple> 7#include <tuple>
8 8
9#include "common/logging/log.h"
10#include "common/microprofile.h" 9#include "common/microprofile.h"
11#include "common/thread.h"
12#include "core/core_timing.h" 10#include "core/core_timing.h"
13#include "core/core_timing_util.h" 11#include "core/core_timing_util.h"
14#include "core/hardware_properties.h" 12#include "core/hardware_properties.h"
@@ -44,10 +42,10 @@ CoreTiming::CoreTiming()
44 42
45CoreTiming::~CoreTiming() = default; 43CoreTiming::~CoreTiming() = default;
46 44
47void CoreTiming::ThreadEntry(CoreTiming& instance, size_t id) { 45void CoreTiming::ThreadEntry(CoreTiming& instance) {
48 const std::string name = "yuzu:HostTiming_" + std::to_string(id); 46 constexpr char name[] = "yuzu:HostTiming";
49 MicroProfileOnThreadCreate(name.c_str()); 47 MicroProfileOnThreadCreate(name);
50 Common::SetCurrentThreadName(name.c_str()); 48 Common::SetCurrentThreadName(name);
51 Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); 49 Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical);
52 instance.on_thread_init(); 50 instance.on_thread_init();
53 instance.ThreadLoop(); 51 instance.ThreadLoop();
@@ -63,127 +61,100 @@ void CoreTiming::Initialize(std::function<void()>&& on_thread_init_) {
63 -> std::optional<std::chrono::nanoseconds> { return std::nullopt; }; 61 -> std::optional<std::chrono::nanoseconds> { return std::nullopt; };
64 ev_lost = CreateEvent("_lost_event", empty_timed_callback); 62 ev_lost = CreateEvent("_lost_event", empty_timed_callback);
65 if (is_multicore) { 63 if (is_multicore) {
66 worker_threads.emplace_back(ThreadEntry, std::ref(*this), 0); 64 timer_thread = std::make_unique<std::thread>(ThreadEntry, std::ref(*this));
67 } 65 }
68} 66}
69 67
70void CoreTiming::Shutdown() { 68void CoreTiming::Shutdown() {
71 is_paused = true; 69 paused = true;
72 shutting_down = true; 70 shutting_down = true;
73 std::atomic_thread_fence(std::memory_order_release); 71 pause_event.Set();
74 72 event.Set();
75 event_cv.notify_all(); 73 if (timer_thread) {
76 wait_pause_cv.notify_all(); 74 timer_thread->join();
77 for (auto& thread : worker_threads) {
78 thread.join();
79 } 75 }
80 worker_threads.clear();
81 pause_callbacks.clear(); 76 pause_callbacks.clear();
82 ClearPendingEvents(); 77 ClearPendingEvents();
78 timer_thread.reset();
83 has_started = false; 79 has_started = false;
84} 80}
85 81
86void CoreTiming::Pause(bool is_paused_) { 82void CoreTiming::Pause(bool is_paused) {
87 std::unique_lock main_lock(event_mutex); 83 paused = is_paused;
88 if (is_paused_ == paused_state.load(std::memory_order_relaxed)) { 84 pause_event.Set();
89 return;
90 }
91 if (is_multicore) {
92 is_paused = is_paused_;
93 event_cv.notify_all();
94 if (!is_paused_) {
95 wait_pause_cv.notify_all();
96 }
97 }
98 paused_state.store(is_paused_, std::memory_order_relaxed);
99 85
100 if (!is_paused_) { 86 if (!is_paused) {
101 pause_end_time = GetGlobalTimeNs().count(); 87 pause_end_time = GetGlobalTimeNs().count();
102 } 88 }
103 89
104 for (auto& cb : pause_callbacks) { 90 for (auto& cb : pause_callbacks) {
105 cb(is_paused_); 91 cb(is_paused);
106 } 92 }
107} 93}
108 94
109void CoreTiming::SyncPause(bool is_paused_) { 95void CoreTiming::SyncPause(bool is_paused) {
110 std::unique_lock main_lock(event_mutex); 96 if (is_paused == paused && paused_set == paused) {
111 if (is_paused_ == paused_state.load(std::memory_order_relaxed)) {
112 return; 97 return;
113 } 98 }
114 99
115 if (is_multicore) { 100 Pause(is_paused);
116 is_paused = is_paused_; 101 if (timer_thread) {
117 event_cv.notify_all(); 102 if (!is_paused) {
118 if (!is_paused_) { 103 pause_event.Set();
119 wait_pause_cv.notify_all();
120 }
121 }
122 paused_state.store(is_paused_, std::memory_order_relaxed);
123 if (is_multicore) {
124 if (is_paused_) {
125 wait_signal_cv.wait(main_lock, [this] { return pause_count == worker_threads.size(); });
126 } else {
127 wait_signal_cv.wait(main_lock, [this] { return pause_count == 0; });
128 } 104 }
105 event.Set();
106 while (paused_set != is_paused)
107 ;
129 } 108 }
130 109
131 if (!is_paused_) { 110 if (!is_paused) {
132 pause_end_time = GetGlobalTimeNs().count(); 111 pause_end_time = GetGlobalTimeNs().count();
133 } 112 }
134 113
135 for (auto& cb : pause_callbacks) { 114 for (auto& cb : pause_callbacks) {
136 cb(is_paused_); 115 cb(is_paused);
137 } 116 }
138} 117}
139 118
140bool CoreTiming::IsRunning() const { 119bool CoreTiming::IsRunning() const {
141 return !paused_state.load(std::memory_order_acquire); 120 return !paused_set;
142} 121}
143 122
144bool CoreTiming::HasPendingEvents() const { 123bool CoreTiming::HasPendingEvents() const {
145 std::unique_lock main_lock(event_mutex); 124 return !(wait_set && event_queue.empty());
146 return !event_queue.empty() || pending_events.load(std::memory_order_relaxed) != 0;
147} 125}
148 126
149void CoreTiming::ScheduleEvent(std::chrono::nanoseconds ns_into_future, 127void CoreTiming::ScheduleEvent(std::chrono::nanoseconds ns_into_future,
150 const std::shared_ptr<EventType>& event_type, 128 const std::shared_ptr<EventType>& event_type,
151 std::uintptr_t user_data, bool absolute_time) { 129 std::uintptr_t user_data, bool absolute_time) {
130 {
131 std::scoped_lock scope{basic_lock};
132 const auto next_time{absolute_time ? ns_into_future : GetGlobalTimeNs() + ns_into_future};
152 133
153 std::unique_lock main_lock(event_mutex); 134 event_queue.emplace_back(
154 const auto next_time{absolute_time ? ns_into_future : GetGlobalTimeNs() + ns_into_future}; 135 Event{next_time.count(), event_fifo_id++, user_data, event_type, 0});
155 136 std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>());
156 event_queue.emplace_back(Event{next_time.count(), event_fifo_id++, user_data, event_type, 0});
157 pending_events.fetch_add(1, std::memory_order_relaxed);
158
159 std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>());
160
161 if (is_multicore) {
162 event_cv.notify_one();
163 } 137 }
138
139 event.Set();
164} 140}
165 141
166void CoreTiming::ScheduleLoopingEvent(std::chrono::nanoseconds start_time, 142void CoreTiming::ScheduleLoopingEvent(std::chrono::nanoseconds start_time,
167 std::chrono::nanoseconds resched_time, 143 std::chrono::nanoseconds resched_time,
168 const std::shared_ptr<EventType>& event_type, 144 const std::shared_ptr<EventType>& event_type,
169 std::uintptr_t user_data, bool absolute_time) { 145 std::uintptr_t user_data, bool absolute_time) {
170 std::unique_lock main_lock(event_mutex); 146 std::scoped_lock scope{basic_lock};
171 const auto next_time{absolute_time ? start_time : GetGlobalTimeNs() + start_time}; 147 const auto next_time{absolute_time ? start_time : GetGlobalTimeNs() + start_time};
172 148
173 event_queue.emplace_back( 149 event_queue.emplace_back(
174 Event{next_time.count(), event_fifo_id++, user_data, event_type, resched_time.count()}); 150 Event{next_time.count(), event_fifo_id++, user_data, event_type, resched_time.count()});
175 pending_events.fetch_add(1, std::memory_order_relaxed);
176 151
177 std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>()); 152 std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>());
178
179 if (is_multicore) {
180 event_cv.notify_one();
181 }
182} 153}
183 154
184void CoreTiming::UnscheduleEvent(const std::shared_ptr<EventType>& event_type, 155void CoreTiming::UnscheduleEvent(const std::shared_ptr<EventType>& event_type,
185 std::uintptr_t user_data) { 156 std::uintptr_t user_data) {
186 std::unique_lock main_lock(event_mutex); 157 std::scoped_lock scope{basic_lock};
187 const auto itr = std::remove_if(event_queue.begin(), event_queue.end(), [&](const Event& e) { 158 const auto itr = std::remove_if(event_queue.begin(), event_queue.end(), [&](const Event& e) {
188 return e.type.lock().get() == event_type.get() && e.user_data == user_data; 159 return e.type.lock().get() == event_type.get() && e.user_data == user_data;
189 }); 160 });
@@ -192,7 +163,6 @@ void CoreTiming::UnscheduleEvent(const std::shared_ptr<EventType>& event_type,
192 if (itr != event_queue.end()) { 163 if (itr != event_queue.end()) {
193 event_queue.erase(itr, event_queue.end()); 164 event_queue.erase(itr, event_queue.end());
194 std::make_heap(event_queue.begin(), event_queue.end(), std::greater<>()); 165 std::make_heap(event_queue.begin(), event_queue.end(), std::greater<>());
195 pending_events.fetch_sub(1, std::memory_order_relaxed);
196 } 166 }
197} 167}
198 168
@@ -232,12 +202,11 @@ u64 CoreTiming::GetClockTicks() const {
232} 202}
233 203
234void CoreTiming::ClearPendingEvents() { 204void CoreTiming::ClearPendingEvents() {
235 std::unique_lock main_lock(event_mutex);
236 event_queue.clear(); 205 event_queue.clear();
237} 206}
238 207
239void CoreTiming::RemoveEvent(const std::shared_ptr<EventType>& event_type) { 208void CoreTiming::RemoveEvent(const std::shared_ptr<EventType>& event_type) {
240 std::unique_lock main_lock(event_mutex); 209 std::scoped_lock lock{basic_lock};
241 210
242 const auto itr = std::remove_if(event_queue.begin(), event_queue.end(), [&](const Event& e) { 211 const auto itr = std::remove_if(event_queue.begin(), event_queue.end(), [&](const Event& e) {
243 return e.type.lock().get() == event_type.get(); 212 return e.type.lock().get() == event_type.get();
@@ -251,28 +220,27 @@ void CoreTiming::RemoveEvent(const std::shared_ptr<EventType>& event_type) {
251} 220}
252 221
253void CoreTiming::RegisterPauseCallback(PauseCallback&& callback) { 222void CoreTiming::RegisterPauseCallback(PauseCallback&& callback) {
254 std::unique_lock main_lock(event_mutex); 223 std::scoped_lock lock{basic_lock};
255 pause_callbacks.emplace_back(std::move(callback)); 224 pause_callbacks.emplace_back(std::move(callback));
256} 225}
257 226
258std::optional<s64> CoreTiming::Advance() { 227std::optional<s64> CoreTiming::Advance() {
228 std::scoped_lock lock{advance_lock, basic_lock};
259 global_timer = GetGlobalTimeNs().count(); 229 global_timer = GetGlobalTimeNs().count();
260 230
261 std::unique_lock main_lock(event_mutex);
262 while (!event_queue.empty() && event_queue.front().time <= global_timer) { 231 while (!event_queue.empty() && event_queue.front().time <= global_timer) {
263 Event evt = std::move(event_queue.front()); 232 Event evt = std::move(event_queue.front());
264 std::pop_heap(event_queue.begin(), event_queue.end(), std::greater<>()); 233 std::pop_heap(event_queue.begin(), event_queue.end(), std::greater<>());
265 event_queue.pop_back(); 234 event_queue.pop_back();
266 235
267 if (const auto event_type{evt.type.lock()}) { 236 if (const auto event_type{evt.type.lock()}) {
268 event_mutex.unlock(); 237 basic_lock.unlock();
269 238
270 const auto new_schedule_time{event_type->callback( 239 const auto new_schedule_time{event_type->callback(
271 evt.user_data, evt.time, 240 evt.user_data, evt.time,
272 std::chrono::nanoseconds{GetGlobalTimeNs().count() - evt.time})}; 241 std::chrono::nanoseconds{GetGlobalTimeNs().count() - evt.time})};
273 242
274 event_mutex.lock(); 243 basic_lock.lock();
275 pending_events.fetch_sub(1, std::memory_order_relaxed);
276 244
277 if (evt.reschedule_time != 0) { 245 if (evt.reschedule_time != 0) {
278 // If this event was scheduled into a pause, its time now is going to be way behind. 246 // If this event was scheduled into a pause, its time now is going to be way behind.
@@ -285,9 +253,9 @@ std::optional<s64> CoreTiming::Advance() {
285 const auto next_schedule_time{new_schedule_time.has_value() 253 const auto next_schedule_time{new_schedule_time.has_value()
286 ? new_schedule_time.value().count() 254 ? new_schedule_time.value().count()
287 : evt.reschedule_time}; 255 : evt.reschedule_time};
256
288 event_queue.emplace_back( 257 event_queue.emplace_back(
289 Event{next_time, event_fifo_id++, evt.user_data, evt.type, next_schedule_time}); 258 Event{next_time, event_fifo_id++, evt.user_data, evt.type, next_schedule_time});
290 pending_events.fetch_add(1, std::memory_order_relaxed);
291 std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>()); 259 std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>());
292 } 260 }
293 } 261 }
@@ -304,34 +272,27 @@ std::optional<s64> CoreTiming::Advance() {
304} 272}
305 273
306void CoreTiming::ThreadLoop() { 274void CoreTiming::ThreadLoop() {
307 const auto predicate = [this] { return !event_queue.empty() || is_paused; };
308 has_started = true; 275 has_started = true;
309 while (!shutting_down) { 276 while (!shutting_down) {
310 while (!is_paused && !shutting_down) { 277 while (!paused) {
278 paused_set = false;
311 const auto next_time = Advance(); 279 const auto next_time = Advance();
312 if (next_time) { 280 if (next_time) {
313 if (*next_time > 0) { 281 if (*next_time > 0) {
314 std::chrono::nanoseconds next_time_ns = std::chrono::nanoseconds(*next_time); 282 std::chrono::nanoseconds next_time_ns = std::chrono::nanoseconds(*next_time);
315 std::unique_lock main_lock(event_mutex); 283 event.WaitFor(next_time_ns);
316 event_cv.wait_for(main_lock, next_time_ns, predicate);
317 } 284 }
318 } else { 285 } else {
319 std::unique_lock main_lock(event_mutex); 286 wait_set = true;
320 event_cv.wait(main_lock, predicate); 287 event.Wait();
321 } 288 }
289 wait_set = false;
322 } 290 }
323 std::unique_lock main_lock(event_mutex); 291
324 pause_count++; 292 paused_set = true;
325 if (pause_count == worker_threads.size()) { 293 clock->Pause(true);
326 clock->Pause(true); 294 pause_event.Wait();
327 wait_signal_cv.notify_all(); 295 clock->Pause(false);
328 }
329 wait_pause_cv.wait(main_lock, [this] { return !is_paused || shutting_down; });
330 pause_count--;
331 if (pause_count == 0) {
332 clock->Pause(false);
333 wait_signal_cv.notify_all();
334 }
335 } 296 }
336} 297}
337 298
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index 09b6ed81a..6aa3ae923 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -5,7 +5,6 @@
5 5
6#include <atomic> 6#include <atomic>
7#include <chrono> 7#include <chrono>
8#include <condition_variable>
9#include <functional> 8#include <functional>
10#include <memory> 9#include <memory>
11#include <mutex> 10#include <mutex>
@@ -15,6 +14,7 @@
15#include <vector> 14#include <vector>
16 15
17#include "common/common_types.h" 16#include "common/common_types.h"
17#include "common/thread.h"
18#include "common/wall_clock.h" 18#include "common/wall_clock.h"
19 19
20namespace Core::Timing { 20namespace Core::Timing {
@@ -143,7 +143,7 @@ private:
143 /// Clear all pending events. This should ONLY be done on exit. 143 /// Clear all pending events. This should ONLY be done on exit.
144 void ClearPendingEvents(); 144 void ClearPendingEvents();
145 145
146 static void ThreadEntry(CoreTiming& instance, size_t id); 146 static void ThreadEntry(CoreTiming& instance);
147 void ThreadLoop(); 147 void ThreadLoop();
148 148
149 std::unique_ptr<Common::WallClock> clock; 149 std::unique_ptr<Common::WallClock> clock;
@@ -156,24 +156,21 @@ private:
156 // accomodated by the standard adaptor class. 156 // accomodated by the standard adaptor class.
157 std::vector<Event> event_queue; 157 std::vector<Event> event_queue;
158 u64 event_fifo_id = 0; 158 u64 event_fifo_id = 0;
159 std::atomic<size_t> pending_events{};
160 159
161 std::shared_ptr<EventType> ev_lost; 160 std::shared_ptr<EventType> ev_lost;
161 Common::Event event{};
162 Common::Event pause_event{};
163 std::mutex basic_lock;
164 std::mutex advance_lock;
165 std::unique_ptr<std::thread> timer_thread;
166 std::atomic<bool> paused{};
167 std::atomic<bool> paused_set{};
168 std::atomic<bool> wait_set{};
169 std::atomic<bool> shutting_down{};
162 std::atomic<bool> has_started{}; 170 std::atomic<bool> has_started{};
163 std::function<void()> on_thread_init{}; 171 std::function<void()> on_thread_init{};
164 172
165 std::vector<std::thread> worker_threads;
166
167 std::condition_variable event_cv;
168 std::condition_variable wait_pause_cv;
169 std::condition_variable wait_signal_cv;
170 mutable std::mutex event_mutex;
171
172 std::atomic<bool> paused_state{};
173 bool is_paused{};
174 bool shutting_down{};
175 bool is_multicore{}; 173 bool is_multicore{};
176 size_t pause_count{};
177 s64 pause_end_time{}; 174 s64 pause_end_time{};
178 175
179 /// Cycle timing 176 /// Cycle timing
diff --git a/src/core/file_sys/errors.h b/src/core/file_sys/errors.h
index ff15b3e23..7cee0c7df 100644
--- a/src/core/file_sys/errors.h
+++ b/src/core/file_sys/errors.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h
index a405e3c94..094d1e713 100644
--- a/src/core/frontend/applets/software_keyboard.h
+++ b/src/core/frontend/applets/software_keyboard.h
@@ -17,6 +17,8 @@ struct KeyboardInitializeParameters {
17 std::u16string sub_text; 17 std::u16string sub_text;
18 std::u16string guide_text; 18 std::u16string guide_text;
19 std::u16string initial_text; 19 std::u16string initial_text;
20 char16_t left_optional_symbol_key;
21 char16_t right_optional_symbol_key;
20 u32 max_text_length; 22 u32 max_text_length;
21 u32 min_text_length; 23 u32 min_text_length;
22 s32 initial_cursor_position; 24 s32 initial_cursor_position;
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp
index 57c6ffc43..1be2dccb0 100644
--- a/src/core/frontend/emu_window.cpp
+++ b/src/core/frontend/emu_window.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <mutex> 4#include <mutex>
6#include "core/frontend/emu_window.h" 5#include "core/frontend/emu_window.h"
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h
index b3bffecb2..ac1906d5e 100644
--- a/src/core/frontend/emu_window.h
+++ b/src/core/frontend/emu_window.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/hle/ipc.h b/src/core/hle/ipc.h
index 602e12606..416da15ec 100644
--- a/src/core/hle/ipc.h
+++ b/src/core/hle/ipc.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index 004bb2005..d631c0357 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/hle/kernel/k_client_port.cpp b/src/core/hle/kernel/k_client_port.cpp
index d63e77d15..3cb22ff4d 100644
--- a/src/core/hle/kernel/k_client_port.cpp
+++ b/src/core/hle/kernel/k_client_port.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 Citra Emulator Project 1// SPDX-FileCopyrightText: 2021 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/scope_exit.h" 4#include "common/scope_exit.h"
6#include "core/hle/kernel/hle_ipc.h" 5#include "core/hle/kernel/hle_ipc.h"
diff --git a/src/core/hle/kernel/k_client_port.h b/src/core/hle/kernel/k_client_port.h
index ef8583efc..e17eff28f 100644
--- a/src/core/hle/kernel/k_client_port.h
+++ b/src/core/hle/kernel/k_client_port.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp
index b662788b3..d3e99665f 100644
--- a/src/core/hle/kernel/k_process.cpp
+++ b/src/core/hle/kernel/k_process.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <bitset> 5#include <bitset>
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h
index 5e3e22ad8..d56d73bab 100644
--- a/src/core/hle/kernel/k_process.h
+++ b/src/core/hle/kernel/k_process.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/hle/kernel/k_shared_memory.cpp b/src/core/hle/kernel/k_shared_memory.cpp
index b77735736..8ff1545b6 100644
--- a/src/core/hle/kernel/k_shared_memory.cpp
+++ b/src/core/hle/kernel/k_shared_memory.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/assert.h" 4#include "common/assert.h"
6#include "core/core.h" 5#include "core/core.h"
diff --git a/src/core/hle/kernel/k_shared_memory.h b/src/core/hle/kernel/k_shared_memory.h
index 2c1db0e70..34cb98456 100644
--- a/src/core/hle/kernel/k_shared_memory.h
+++ b/src/core/hle/kernel/k_shared_memory.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index aa9e5b89d..4de44cd06 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/applets/applet_software_keyboard.cpp
index faa092957..c18236045 100644
--- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp
+++ b/src/core/hle/service/am/applets/applet_software_keyboard.cpp
@@ -536,6 +536,8 @@ void SoftwareKeyboard::InitializeFrontendNormalKeyboard() {
536 .sub_text{std::move(sub_text)}, 536 .sub_text{std::move(sub_text)},
537 .guide_text{std::move(guide_text)}, 537 .guide_text{std::move(guide_text)},
538 .initial_text{initial_text}, 538 .initial_text{initial_text},
539 .left_optional_symbol_key{swkbd_config_common.left_optional_symbol_key},
540 .right_optional_symbol_key{swkbd_config_common.right_optional_symbol_key},
539 .max_text_length{max_text_length}, 541 .max_text_length{max_text_length},
540 .min_text_length{min_text_length}, 542 .min_text_length{min_text_length},
541 .initial_cursor_position{initial_cursor_position}, 543 .initial_cursor_position{initial_cursor_position},
@@ -591,6 +593,8 @@ void SoftwareKeyboard::InitializeFrontendInlineKeyboardOld() {
591 .sub_text{}, 593 .sub_text{},
592 .guide_text{}, 594 .guide_text{},
593 .initial_text{current_text}, 595 .initial_text{current_text},
596 .left_optional_symbol_key{appear_arg.left_optional_symbol_key},
597 .right_optional_symbol_key{appear_arg.right_optional_symbol_key},
594 .max_text_length{max_text_length}, 598 .max_text_length{max_text_length},
595 .min_text_length{min_text_length}, 599 .min_text_length{min_text_length},
596 .initial_cursor_position{initial_cursor_position}, 600 .initial_cursor_position{initial_cursor_position},
@@ -632,6 +636,8 @@ void SoftwareKeyboard::InitializeFrontendInlineKeyboardNew() {
632 .sub_text{}, 636 .sub_text{},
633 .guide_text{}, 637 .guide_text{},
634 .initial_text{current_text}, 638 .initial_text{current_text},
639 .left_optional_symbol_key{appear_arg.left_optional_symbol_key},
640 .right_optional_symbol_key{appear_arg.right_optional_symbol_key},
635 .max_text_length{max_text_length}, 641 .max_text_length{max_text_length},
636 .min_text_length{min_text_length}, 642 .min_text_length{min_text_length},
637 .initial_cursor_position{initial_cursor_position}, 643 .initial_cursor_position{initial_cursor_position},
diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp
index d5107e41f..c4b44cbf9 100644
--- a/src/core/hle/service/hid/irs.cpp
+++ b/src/core/hle/service/hid/irs.cpp
@@ -166,7 +166,7 @@ void IRS::RunClusteringProcessor(Kernel::HLERequestContext& ctx) {
166 166
167 if (result.IsSuccess()) { 167 if (result.IsSuccess()) {
168 auto& device = GetIrCameraSharedMemoryDeviceEntry(parameters.camera_handle); 168 auto& device = GetIrCameraSharedMemoryDeviceEntry(parameters.camera_handle);
169 MakeProcessor<ClusteringProcessor>(parameters.camera_handle, device); 169 MakeProcessorWithCoreContext<ClusteringProcessor>(parameters.camera_handle, device);
170 auto& image_transfer_processor = 170 auto& image_transfer_processor =
171 GetProcessor<ClusteringProcessor>(parameters.camera_handle); 171 GetProcessor<ClusteringProcessor>(parameters.camera_handle);
172 image_transfer_processor.SetConfig(parameters.processor_config); 172 image_transfer_processor.SetConfig(parameters.processor_config);
diff --git a/src/core/hle/service/hid/irs_ring_lifo.h b/src/core/hle/service/hid/irs_ring_lifo.h
new file mode 100644
index 000000000..255d1d296
--- /dev/null
+++ b/src/core/hle/service/hid/irs_ring_lifo.h
@@ -0,0 +1,47 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include <array>
7
8#include "common/common_types.h"
9
10namespace Service::IRS {
11
12template <typename State, std::size_t max_buffer_size>
13struct Lifo {
14 s64 sampling_number{};
15 s64 buffer_count{};
16 std::array<State, max_buffer_size> entries{};
17
18 const State& ReadCurrentEntry() const {
19 return entries[GetBufferTail()];
20 }
21
22 const State& ReadPreviousEntry() const {
23 return entries[GetPreviousEntryIndex()];
24 }
25
26 s64 GetBufferTail() const {
27 return sampling_number % max_buffer_size;
28 }
29
30 std::size_t GetPreviousEntryIndex() const {
31 return static_cast<size_t>((GetBufferTail() + max_buffer_size - 1) % max_buffer_size);
32 }
33
34 std::size_t GetNextEntryIndex() const {
35 return static_cast<size_t>((GetBufferTail() + 1) % max_buffer_size);
36 }
37
38 void WriteNextEntry(const State& new_state) {
39 if (buffer_count < static_cast<s64>(max_buffer_size)) {
40 buffer_count++;
41 }
42 sampling_number++;
43 entries[GetBufferTail()] = new_state;
44 }
45};
46
47} // namespace Service::IRS
diff --git a/src/core/hle/service/hid/irsensor/clustering_processor.cpp b/src/core/hle/service/hid/irsensor/clustering_processor.cpp
index 6479af212..e2f4ae876 100644
--- a/src/core/hle/service/hid/irsensor/clustering_processor.cpp
+++ b/src/core/hle/service/hid/irsensor/clustering_processor.cpp
@@ -1,34 +1,265 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-3.0-or-later 2// SPDX-License-Identifier: GPL-3.0-or-later
3 3
4#include <queue>
5
6#include "core/hid/emulated_controller.h"
7#include "core/hid/hid_core.h"
4#include "core/hle/service/hid/irsensor/clustering_processor.h" 8#include "core/hle/service/hid/irsensor/clustering_processor.h"
5 9
6namespace Service::IRS { 10namespace Service::IRS {
7ClusteringProcessor::ClusteringProcessor(Core::IrSensor::DeviceFormat& device_format) 11ClusteringProcessor::ClusteringProcessor(Core::HID::HIDCore& hid_core_,
8 : device(device_format) { 12 Core::IrSensor::DeviceFormat& device_format,
13 std::size_t npad_index)
14 : device{device_format} {
15 npad_device = hid_core_.GetEmulatedControllerByIndex(npad_index);
16
9 device.mode = Core::IrSensor::IrSensorMode::ClusteringProcessor; 17 device.mode = Core::IrSensor::IrSensorMode::ClusteringProcessor;
10 device.camera_status = Core::IrSensor::IrCameraStatus::Unconnected; 18 device.camera_status = Core::IrSensor::IrCameraStatus::Unconnected;
11 device.camera_internal_status = Core::IrSensor::IrCameraInternalStatus::Stopped; 19 device.camera_internal_status = Core::IrSensor::IrCameraInternalStatus::Stopped;
20 SetDefaultConfig();
21
22 shared_memory = std::construct_at(
23 reinterpret_cast<ClusteringSharedMemory*>(&device_format.state.processor_raw_data));
24
25 Core::HID::ControllerUpdateCallback engine_callback{
26 .on_change = [this](Core::HID::ControllerTriggerType type) { OnControllerUpdate(type); },
27 .is_npad_service = true,
28 };
29 callback_key = npad_device->SetCallback(engine_callback);
12} 30}
13 31
14ClusteringProcessor::~ClusteringProcessor() = default; 32ClusteringProcessor::~ClusteringProcessor() {
33 npad_device->DeleteCallback(callback_key);
34};
15 35
16void ClusteringProcessor::StartProcessor() {} 36void ClusteringProcessor::StartProcessor() {
37 device.camera_status = Core::IrSensor::IrCameraStatus::Available;
38 device.camera_internal_status = Core::IrSensor::IrCameraInternalStatus::Ready;
39}
17 40
18void ClusteringProcessor::SuspendProcessor() {} 41void ClusteringProcessor::SuspendProcessor() {}
19 42
20void ClusteringProcessor::StopProcessor() {} 43void ClusteringProcessor::StopProcessor() {}
21 44
45void ClusteringProcessor::OnControllerUpdate(Core::HID::ControllerTriggerType type) {
46 if (type != Core::HID::ControllerTriggerType::IrSensor) {
47 return;
48 }
49
50 next_state = {};
51 const auto camera_data = npad_device->GetCamera();
52 auto filtered_image = camera_data.data;
53
54 RemoveLowIntensityData(filtered_image);
55
56 const auto window_start_x = static_cast<std::size_t>(current_config.window_of_interest.x);
57 const auto window_start_y = static_cast<std::size_t>(current_config.window_of_interest.y);
58 const auto window_end_x =
59 window_start_x + static_cast<std::size_t>(current_config.window_of_interest.width);
60 const auto window_end_y =
61 window_start_y + static_cast<std::size_t>(current_config.window_of_interest.height);
62
63 for (std::size_t y = window_start_y; y < window_end_y; y++) {
64 for (std::size_t x = window_start_x; x < window_end_x; x++) {
65 u8 pixel = GetPixel(filtered_image, x, y);
66 if (pixel == 0) {
67 continue;
68 }
69 const auto cluster = GetClusterProperties(filtered_image, x, y);
70 if (cluster.pixel_count > current_config.pixel_count_max) {
71 continue;
72 }
73 if (cluster.pixel_count < current_config.pixel_count_min) {
74 continue;
75 }
76 // Cluster object limit reached
77 if (next_state.object_count >= next_state.data.size()) {
78 continue;
79 }
80 next_state.data[next_state.object_count] = cluster;
81 next_state.object_count++;
82 }
83 }
84
85 next_state.sampling_number = camera_data.sample;
86 next_state.timestamp = next_state.timestamp + 131;
87 next_state.ambient_noise_level = Core::IrSensor::CameraAmbientNoiseLevel::Low;
88 shared_memory->clustering_lifo.WriteNextEntry(next_state);
89
90 if (!IsProcessorActive()) {
91 StartProcessor();
92 }
93}
94
95void ClusteringProcessor::RemoveLowIntensityData(std::vector<u8>& data) {
96 for (u8& pixel : data) {
97 if (pixel < current_config.pixel_count_min) {
98 pixel = 0;
99 }
100 }
101}
102
103ClusteringProcessor::ClusteringData ClusteringProcessor::GetClusterProperties(std::vector<u8>& data,
104 std::size_t x,
105 std::size_t y) {
106 using DataPoint = Common::Point<std::size_t>;
107 std::queue<DataPoint> search_points{};
108 ClusteringData current_cluster = GetPixelProperties(data, x, y);
109 SetPixel(data, x, y, 0);
110 search_points.emplace<DataPoint>({x, y});
111
112 while (!search_points.empty()) {
113 const auto point = search_points.front();
114 search_points.pop();
115
116 // Avoid negative numbers
117 if (point.x == 0 || point.y == 0) {
118 continue;
119 }
120
121 std::array<DataPoint, 4> new_points{
122 DataPoint{point.x - 1, point.y},
123 {point.x, point.y - 1},
124 {point.x + 1, point.y},
125 {point.x, point.y + 1},
126 };
127
128 for (const auto new_point : new_points) {
129 if (new_point.x >= width) {
130 continue;
131 }
132 if (new_point.y >= height) {
133 continue;
134 }
135 if (GetPixel(data, new_point.x, new_point.y) < current_config.object_intensity_min) {
136 continue;
137 }
138 const ClusteringData cluster = GetPixelProperties(data, new_point.x, new_point.y);
139 current_cluster = MergeCluster(current_cluster, cluster);
140 SetPixel(data, new_point.x, new_point.y, 0);
141 search_points.emplace<DataPoint>({new_point.x, new_point.y});
142 }
143 }
144
145 return current_cluster;
146}
147
148ClusteringProcessor::ClusteringData ClusteringProcessor::GetPixelProperties(
149 const std::vector<u8>& data, std::size_t x, std::size_t y) const {
150 return {
151 .average_intensity = GetPixel(data, x, y) / 255.0f,
152 .centroid =
153 {
154 .x = static_cast<f32>(x),
155 .y = static_cast<f32>(y),
156
157 },
158 .pixel_count = 1,
159 .bound =
160 {
161 .x = static_cast<s16>(x),
162 .y = static_cast<s16>(y),
163 .width = 1,
164 .height = 1,
165 },
166 };
167}
168
169ClusteringProcessor::ClusteringData ClusteringProcessor::MergeCluster(
170 const ClusteringData a, const ClusteringData b) const {
171 const f32 a_pixel_count = static_cast<f32>(a.pixel_count);
172 const f32 b_pixel_count = static_cast<f32>(b.pixel_count);
173 const f32 pixel_count = a_pixel_count + b_pixel_count;
174 const f32 average_intensity =
175 (a.average_intensity * a_pixel_count + b.average_intensity * b_pixel_count) / pixel_count;
176 const Core::IrSensor::IrsCentroid centroid = {
177 .x = (a.centroid.x * a_pixel_count + b.centroid.x * b_pixel_count) / pixel_count,
178 .y = (a.centroid.y * a_pixel_count + b.centroid.y * b_pixel_count) / pixel_count,
179 };
180 s16 bound_start_x = a.bound.x < b.bound.x ? a.bound.x : b.bound.x;
181 s16 bound_start_y = a.bound.y < b.bound.y ? a.bound.y : b.bound.y;
182 s16 a_bound_end_x = a.bound.x + a.bound.width;
183 s16 a_bound_end_y = a.bound.y + a.bound.height;
184 s16 b_bound_end_x = b.bound.x + b.bound.width;
185 s16 b_bound_end_y = b.bound.y + b.bound.height;
186
187 const Core::IrSensor::IrsRect bound = {
188 .x = bound_start_x,
189 .y = bound_start_y,
190 .width = a_bound_end_x > b_bound_end_x ? static_cast<s16>(a_bound_end_x - bound_start_x)
191 : static_cast<s16>(b_bound_end_x - bound_start_x),
192 .height = a_bound_end_y > b_bound_end_y ? static_cast<s16>(a_bound_end_y - bound_start_y)
193 : static_cast<s16>(b_bound_end_y - bound_start_y),
194 };
195
196 return {
197 .average_intensity = average_intensity,
198 .centroid = centroid,
199 .pixel_count = static_cast<u32>(pixel_count),
200 .bound = bound,
201 };
202}
203
204u8 ClusteringProcessor::GetPixel(const std::vector<u8>& data, std::size_t x, std::size_t y) const {
205 if ((y * width) + x > data.size()) {
206 return 0;
207 }
208 return data[(y * width) + x];
209}
210
211void ClusteringProcessor::SetPixel(std::vector<u8>& data, std::size_t x, std::size_t y, u8 value) {
212 if ((y * width) + x > data.size()) {
213 return;
214 }
215 data[(y * width) + x] = value;
216}
217
218void ClusteringProcessor::SetDefaultConfig() {
219 using namespace std::literals::chrono_literals;
220 current_config.camera_config.exposure_time = std::chrono::microseconds(200ms).count();
221 current_config.camera_config.gain = 2;
222 current_config.camera_config.is_negative_used = false;
223 current_config.camera_config.light_target = Core::IrSensor::CameraLightTarget::BrightLeds;
224 current_config.window_of_interest = {
225 .x = 0,
226 .y = 0,
227 .width = width,
228 .height = height,
229 };
230 current_config.pixel_count_min = 3;
231 current_config.pixel_count_max = static_cast<u32>(GetDataSize(format));
232 current_config.is_external_light_filter_enabled = true;
233 current_config.object_intensity_min = 150;
234
235 npad_device->SetCameraFormat(format);
236}
237
22void ClusteringProcessor::SetConfig(Core::IrSensor::PackedClusteringProcessorConfig config) { 238void ClusteringProcessor::SetConfig(Core::IrSensor::PackedClusteringProcessorConfig config) {
23 current_config.camera_config.exposure_time = config.camera_config.exposure_time; 239 current_config.camera_config.exposure_time = config.camera_config.exposure_time;
24 current_config.camera_config.gain = config.camera_config.gain; 240 current_config.camera_config.gain = config.camera_config.gain;
25 current_config.camera_config.is_negative_used = config.camera_config.is_negative_used; 241 current_config.camera_config.is_negative_used = config.camera_config.is_negative_used;
26 current_config.camera_config.light_target = 242 current_config.camera_config.light_target =
27 static_cast<Core::IrSensor::CameraLightTarget>(config.camera_config.light_target); 243 static_cast<Core::IrSensor::CameraLightTarget>(config.camera_config.light_target);
244 current_config.window_of_interest = config.window_of_interest;
28 current_config.pixel_count_min = config.pixel_count_min; 245 current_config.pixel_count_min = config.pixel_count_min;
29 current_config.pixel_count_max = config.pixel_count_max; 246 current_config.pixel_count_max = config.pixel_count_max;
30 current_config.is_external_light_filter_enabled = config.is_external_light_filter_enabled; 247 current_config.is_external_light_filter_enabled = config.is_external_light_filter_enabled;
31 current_config.object_intensity_min = config.object_intensity_min; 248 current_config.object_intensity_min = config.object_intensity_min;
249
250 LOG_INFO(Service_IRS,
251 "Processor config, exposure_time={}, gain={}, is_negative_used={}, "
252 "light_target={}, window_of_interest=({}, {}, {}, {}), pixel_count_min={}, "
253 "pixel_count_max={}, is_external_light_filter_enabled={}, object_intensity_min={}",
254 current_config.camera_config.exposure_time, current_config.camera_config.gain,
255 current_config.camera_config.is_negative_used,
256 current_config.camera_config.light_target, current_config.window_of_interest.x,
257 current_config.window_of_interest.y, current_config.window_of_interest.width,
258 current_config.window_of_interest.height, current_config.pixel_count_min,
259 current_config.pixel_count_max, current_config.is_external_light_filter_enabled,
260 current_config.object_intensity_min);
261
262 npad_device->SetCameraFormat(format);
32} 263}
33 264
34} // namespace Service::IRS 265} // namespace Service::IRS
diff --git a/src/core/hle/service/hid/irsensor/clustering_processor.h b/src/core/hle/service/hid/irsensor/clustering_processor.h
index 6e2ba8846..dc01a8ea7 100644
--- a/src/core/hle/service/hid/irsensor/clustering_processor.h
+++ b/src/core/hle/service/hid/irsensor/clustering_processor.h
@@ -5,12 +5,19 @@
5 5
6#include "common/common_types.h" 6#include "common/common_types.h"
7#include "core/hid/irs_types.h" 7#include "core/hid/irs_types.h"
8#include "core/hle/service/hid/irs_ring_lifo.h"
8#include "core/hle/service/hid/irsensor/processor_base.h" 9#include "core/hle/service/hid/irsensor/processor_base.h"
9 10
11namespace Core::HID {
12class EmulatedController;
13} // namespace Core::HID
14
10namespace Service::IRS { 15namespace Service::IRS {
11class ClusteringProcessor final : public ProcessorBase { 16class ClusteringProcessor final : public ProcessorBase {
12public: 17public:
13 explicit ClusteringProcessor(Core::IrSensor::DeviceFormat& device_format); 18 explicit ClusteringProcessor(Core::HID::HIDCore& hid_core_,
19 Core::IrSensor::DeviceFormat& device_format,
20 std::size_t npad_index);
14 ~ClusteringProcessor() override; 21 ~ClusteringProcessor() override;
15 22
16 // Called when the processor is initialized 23 // Called when the processor is initialized
@@ -26,6 +33,10 @@ public:
26 void SetConfig(Core::IrSensor::PackedClusteringProcessorConfig config); 33 void SetConfig(Core::IrSensor::PackedClusteringProcessorConfig config);
27 34
28private: 35private:
36 static constexpr auto format = Core::IrSensor::ImageTransferProcessorFormat::Size320x240;
37 static constexpr std::size_t width = 320;
38 static constexpr std::size_t height = 240;
39
29 // This is nn::irsensor::ClusteringProcessorConfig 40 // This is nn::irsensor::ClusteringProcessorConfig
30 struct ClusteringProcessorConfig { 41 struct ClusteringProcessorConfig {
31 Core::IrSensor::CameraConfig camera_config; 42 Core::IrSensor::CameraConfig camera_config;
@@ -68,7 +79,32 @@ private:
68 static_assert(sizeof(ClusteringProcessorState) == 0x198, 79 static_assert(sizeof(ClusteringProcessorState) == 0x198,
69 "ClusteringProcessorState is an invalid size"); 80 "ClusteringProcessorState is an invalid size");
70 81
82 struct ClusteringSharedMemory {
83 Service::IRS::Lifo<ClusteringProcessorState, 6> clustering_lifo;
84 static_assert(sizeof(clustering_lifo) == 0x9A0, "clustering_lifo is an invalid size");
85 INSERT_PADDING_WORDS(0x11F);
86 };
87 static_assert(sizeof(ClusteringSharedMemory) == 0xE20,
88 "ClusteringSharedMemory is an invalid size");
89
90 void OnControllerUpdate(Core::HID::ControllerTriggerType type);
91 void RemoveLowIntensityData(std::vector<u8>& data);
92 ClusteringData GetClusterProperties(std::vector<u8>& data, std::size_t x, std::size_t y);
93 ClusteringData GetPixelProperties(const std::vector<u8>& data, std::size_t x,
94 std::size_t y) const;
95 ClusteringData MergeCluster(const ClusteringData a, const ClusteringData b) const;
96 u8 GetPixel(const std::vector<u8>& data, std::size_t x, std::size_t y) const;
97 void SetPixel(std::vector<u8>& data, std::size_t x, std::size_t y, u8 value);
98
99 // Sets config parameters of the camera
100 void SetDefaultConfig();
101
102 ClusteringSharedMemory* shared_memory = nullptr;
103 ClusteringProcessorState next_state{};
104
71 ClusteringProcessorConfig current_config{}; 105 ClusteringProcessorConfig current_config{};
72 Core::IrSensor::DeviceFormat& device; 106 Core::IrSensor::DeviceFormat& device;
107 Core::HID::EmulatedController* npad_device;
108 int callback_key{};
73}; 109};
74} // namespace Service::IRS 110} // namespace Service::IRS
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 635449fce..1b44280b5 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <cstring> 5#include <cstring>
diff --git a/src/core/memory.h b/src/core/memory.h
index 780c45385..2a21fbcfd 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp
index 6ef459b7a..f09c176f8 100644
--- a/src/core/perf_stats.cpp
+++ b/src/core/perf_stats.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <chrono> 5#include <chrono>
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h
index 816202588..dd6becc02 100644
--- a/src/core/perf_stats.h
+++ b/src/core/perf_stats.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index 654db0b52..abcf6eb11 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6 5
diff --git a/src/core/telemetry_session.h b/src/core/telemetry_session.h
index 6f3d45bea..887dc98f3 100644
--- a/src/core/telemetry_session.h
+++ b/src/core/telemetry_session.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt
index 90dd629c6..4b91b88ce 100644
--- a/src/input_common/CMakeLists.txt
+++ b/src/input_common/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1add_library(input_common STATIC 4add_library(input_common STATIC
2 drivers/camera.cpp 5 drivers/camera.cpp
3 drivers/camera.h 6 drivers/camera.h
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp
index 00474ac77..de388ec4c 100644
--- a/src/input_common/drivers/sdl_driver.cpp
+++ b/src/input_common/drivers/sdl_driver.cpp
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/logging/log.h" 4#include "common/logging/log.h"
6#include "common/math_util.h" 5#include "common/math_util.h"
diff --git a/src/input_common/drivers/sdl_driver.h b/src/input_common/drivers/sdl_driver.h
index 7dc7a93c7..fc3a44572 100644
--- a/src/input_common/drivers/sdl_driver.h
+++ b/src/input_common/drivers/sdl_driver.h
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp
index 66dbefe00..21c6ed405 100644
--- a/src/input_common/drivers/tas_input.cpp
+++ b/src/input_common/drivers/tas_input.cpp
@@ -1,5 +1,5 @@
1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later. 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include <cstring> 4#include <cstring>
5#include <fmt/format.h> 5#include <fmt/format.h>
diff --git a/src/input_common/drivers/udp_client.cpp b/src/input_common/drivers/udp_client.cpp
index 825262a07..808b21069 100644
--- a/src/input_common/drivers/udp_client.cpp
+++ b/src/input_common/drivers/udp_client.cpp
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <random> 4#include <random>
6#include <boost/asio.hpp> 5#include <boost/asio.hpp>
diff --git a/src/input_common/drivers/udp_client.h b/src/input_common/drivers/udp_client.h
index dece2a45b..cea9f579a 100644
--- a/src/input_common/drivers/udp_client.h
+++ b/src/input_common/drivers/udp_client.h
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/input_common/helpers/stick_from_buttons.cpp b/src/input_common/helpers/stick_from_buttons.cpp
index 31e6f62ab..536d413a5 100644
--- a/src/input_common/helpers/stick_from_buttons.cpp
+++ b/src/input_common/helpers/stick_from_buttons.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <chrono> 4#include <chrono>
6#include <cmath> 5#include <cmath>
diff --git a/src/input_common/helpers/stick_from_buttons.h b/src/input_common/helpers/stick_from_buttons.h
index 437ace4f7..e8d865743 100644
--- a/src/input_common/helpers/stick_from_buttons.h
+++ b/src/input_common/helpers/stick_from_buttons.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/input_common/helpers/touch_from_buttons.cpp b/src/input_common/helpers/touch_from_buttons.cpp
index f1b57d03a..da4a3dca5 100644
--- a/src/input_common/helpers/touch_from_buttons.cpp
+++ b/src/input_common/helpers/touch_from_buttons.cpp
@@ -1,6 +1,5 @@
1// Copyright 2020 Citra Emulator Project 1// SPDX-FileCopyrightText: 2020 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include "common/settings.h" 5#include "common/settings.h"
diff --git a/src/input_common/helpers/touch_from_buttons.h b/src/input_common/helpers/touch_from_buttons.h
index 628f18215..c6cb3ab3c 100644
--- a/src/input_common/helpers/touch_from_buttons.h
+++ b/src/input_common/helpers/touch_from_buttons.h
@@ -1,6 +1,5 @@
1// Copyright 2020 Citra Emulator Project 1// SPDX-FileCopyrightText: 2020 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/input_common/helpers/udp_protocol.cpp b/src/input_common/helpers/udp_protocol.cpp
index cdeab7e11..994380d21 100644
--- a/src/input_common/helpers/udp_protocol.cpp
+++ b/src/input_common/helpers/udp_protocol.cpp
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <cstddef> 4#include <cstddef>
6#include <cstring> 5#include <cstring>
diff --git a/src/input_common/helpers/udp_protocol.h b/src/input_common/helpers/udp_protocol.h
index 889693e73..d9643ffe0 100644
--- a/src/input_common/helpers/udp_protocol.h
+++ b/src/input_common/helpers/udp_protocol.h
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp
index ca1cb9542..75a57b9fc 100644
--- a/src/input_common/main.cpp
+++ b/src/input_common/main.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <memory> 4#include <memory>
6#include "common/input.h" 5#include "common/input.h"
diff --git a/src/input_common/main.h b/src/input_common/main.h
index b756bb5c6..9a969e747 100644
--- a/src/input_common/main.h
+++ b/src/input_common/main.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt
index 382a69e2f..312f79b68 100644
--- a/src/network/CMakeLists.txt
+++ b/src/network/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-3.0-or-later
3
1add_library(network STATIC 4add_library(network STATIC
2 network.cpp 5 network.cpp
3 network.h 6 network.h
diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txt
index ae1dbe619..af8e51fe8 100644
--- a/src/shader_recompiler/CMakeLists.txt
+++ b/src/shader_recompiler/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1add_library(shader_recompiler STATIC 4add_library(shader_recompiler STATIC
2 backend/bindings.h 5 backend/bindings.h
3 backend/glasm/emit_glasm.cpp 6 backend/glasm/emit_glasm.cpp
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py b/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py
index 8f547c266..e66d50d61 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py
@@ -1,7 +1,5 @@
1# Copyright © 2022 degasus <markus@selfnet.de> 1# SPDX-FileCopyrightText: 2022 degasus <markus@selfnet.de>
2# This work is free. You can redistribute it and/or modify it under the 2# SPDX-License-Identifier: WTFPL
3# terms of the Do What The Fuck You Want To Public License, Version 2,
4# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 3
6from itertools import product 4from itertools import product
7 5
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index fbbcf673a..43ad2c7ff 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1add_executable(tests 4add_executable(tests
2 common/bit_field.cpp 5 common/bit_field.cpp
3 common/cityhash.cpp 6 common/cityhash.cpp
diff --git a/src/tests/common/bit_field.cpp b/src/tests/common/bit_field.cpp
index 182638000..0071ae52e 100644
--- a/src/tests/common/bit_field.cpp
+++ b/src/tests/common/bit_field.cpp
@@ -1,6 +1,5 @@
1// Copyright 2019 Citra Emulator Project 1// SPDX-FileCopyrightText: 2019 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <cstring> 5#include <cstring>
diff --git a/src/tests/common/param_package.cpp b/src/tests/common/param_package.cpp
index e31ca3544..d036cc83a 100644
--- a/src/tests/common/param_package.cpp
+++ b/src/tests/common/param_package.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <catch2/catch.hpp> 4#include <catch2/catch.hpp>
6#include <math.h> 5#include <math.h>
diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp
index 894975e6f..7c432a63c 100644
--- a/src/tests/core/core_timing.cpp
+++ b/src/tests/core/core_timing.cpp
@@ -8,7 +8,6 @@
8#include <chrono> 8#include <chrono>
9#include <cstdlib> 9#include <cstdlib>
10#include <memory> 10#include <memory>
11#include <mutex>
12#include <optional> 11#include <optional>
13#include <string> 12#include <string>
14 13
@@ -23,15 +22,14 @@ std::array<s64, 5> delays{};
23 22
24std::bitset<CB_IDS.size()> callbacks_ran_flags; 23std::bitset<CB_IDS.size()> callbacks_ran_flags;
25u64 expected_callback = 0; 24u64 expected_callback = 0;
26std::mutex control_mutex;
27 25
28template <unsigned int IDX> 26template <unsigned int IDX>
29std::optional<std::chrono::nanoseconds> HostCallbackTemplate(std::uintptr_t user_data, s64 time, 27std::optional<std::chrono::nanoseconds> HostCallbackTemplate(std::uintptr_t user_data, s64 time,
30 std::chrono::nanoseconds ns_late) { 28 std::chrono::nanoseconds ns_late) {
31 std::unique_lock<std::mutex> lk(control_mutex);
32 static_assert(IDX < CB_IDS.size(), "IDX out of range"); 29 static_assert(IDX < CB_IDS.size(), "IDX out of range");
33 callbacks_ran_flags.set(IDX); 30 callbacks_ran_flags.set(IDX);
34 REQUIRE(CB_IDS[IDX] == user_data); 31 REQUIRE(CB_IDS[IDX] == user_data);
32 REQUIRE(CB_IDS[IDX] == CB_IDS[calls_order[expected_callback]]);
35 delays[IDX] = ns_late.count(); 33 delays[IDX] = ns_late.count();
36 ++expected_callback; 34 ++expected_callback;
37 return std::nullopt; 35 return std::nullopt;
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp
index 275b430d9..3f905c05c 100644
--- a/src/tests/tests.cpp
+++ b/src/tests/tests.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#define CATCH_CONFIG_MAIN 4#define CATCH_CONFIG_MAIN
6#include <catch2/catch.hpp> 5#include <catch2/catch.hpp>
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index 14de7bc89..5b3808351 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1add_subdirectory(host_shaders) 4add_subdirectory(host_shaders)
2 5
3if(LIBVA_FOUND) 6if(LIBVA_FOUND)
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp
index b0ce9f000..d43f7175a 100644
--- a/src/video_core/gpu_thread.cpp
+++ b/src/video_core/gpu_thread.cpp
@@ -31,8 +31,7 @@ static void RunThread(std::stop_token stop_token, Core::System& system,
31 VideoCore::RasterizerInterface* const rasterizer = renderer.ReadRasterizer(); 31 VideoCore::RasterizerInterface* const rasterizer = renderer.ReadRasterizer();
32 32
33 while (!stop_token.stop_requested()) { 33 while (!stop_token.stop_requested()) {
34 CommandDataContainer next; 34 CommandDataContainer next = state.queue.PopWait(stop_token);
35 state.queue.Pop(next, stop_token);
36 if (stop_token.stop_requested()) { 35 if (stop_token.stop_requested()) {
37 break; 36 break;
38 } 37 }
diff --git a/src/video_core/gpu_thread.h b/src/video_core/gpu_thread.h
index be0ac2214..2f8210cb9 100644
--- a/src/video_core/gpu_thread.h
+++ b/src/video_core/gpu_thread.h
@@ -10,7 +10,7 @@
10#include <thread> 10#include <thread>
11#include <variant> 11#include <variant>
12 12
13#include "common/bounded_threadsafe_queue.h" 13#include "common/threadsafe_queue.h"
14#include "video_core/framebuffer_config.h" 14#include "video_core/framebuffer_config.h"
15 15
16namespace Tegra { 16namespace Tegra {
@@ -96,7 +96,7 @@ struct CommandDataContainer {
96 96
97/// Struct used to synchronize the GPU thread 97/// Struct used to synchronize the GPU thread
98struct SynchState final { 98struct SynchState final {
99 using CommandQueue = Common::MPSCQueue<CommandDataContainer>; 99 using CommandQueue = Common::MPSCQueue<CommandDataContainer, true>;
100 std::mutex write_lock; 100 std::mutex write_lock;
101 CommandQueue queue; 101 CommandQueue queue;
102 u64 last_fence{}; 102 u64 last_fence{};
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt
index 190fc6aea..2149ab93e 100644
--- a/src/video_core/host_shaders/CMakeLists.txt
+++ b/src/video_core/host_shaders/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1set(FIDELITYFX_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/externals/FidelityFX-FSR/ffx-fsr) 4set(FIDELITYFX_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/externals/FidelityFX-FSR/ffx-fsr)
2 5
3set(GLSL_INCLUDES 6set(GLSL_INCLUDES
diff --git a/src/video_core/host_shaders/StringShaderHeader.cmake b/src/video_core/host_shaders/StringShaderHeader.cmake
index 1b4bc6103..9f7525535 100644
--- a/src/video_core/host_shaders/StringShaderHeader.cmake
+++ b/src/video_core/host_shaders/StringShaderHeader.cmake
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1set(SOURCE_FILE ${CMAKE_ARGV3}) 4set(SOURCE_FILE ${CMAKE_ARGV3})
2set(HEADER_FILE ${CMAKE_ARGV4}) 5set(HEADER_FILE ${CMAKE_ARGV4})
3set(INPUT_FILE ${CMAKE_ARGV5}) 6set(INPUT_FILE ${CMAKE_ARGV5})
diff --git a/src/video_core/host_shaders/source_shader.h.in b/src/video_core/host_shaders/source_shader.h.in
index 929dec39b..f189ee06b 100644
--- a/src/video_core/host_shaders/source_shader.h.in
+++ b/src/video_core/host_shaders/source_shader.h.in
@@ -1,3 +1,6 @@
1// SPDX-FileCopyrightText: 2020 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
1#pragma once 4#pragma once
2 5
3#include <string_view> 6#include <string_view>
diff --git a/src/video_core/host_shaders/vulkan_present_scaleforce_fp16.frag b/src/video_core/host_shaders/vulkan_present_scaleforce_fp16.frag
index 924c03060..3dc9c0df5 100644
--- a/src/video_core/host_shaders/vulkan_present_scaleforce_fp16.frag
+++ b/src/video_core/host_shaders/vulkan_present_scaleforce_fp16.frag
@@ -1,3 +1,6 @@
1// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
1#version 460 4#version 460
2 5
3#extension GL_GOOGLE_include_directive : enable 6#extension GL_GOOGLE_include_directive : enable
diff --git a/src/video_core/host_shaders/vulkan_present_scaleforce_fp32.frag b/src/video_core/host_shaders/vulkan_present_scaleforce_fp32.frag
index a594b83ca..77ed07552 100644
--- a/src/video_core/host_shaders/vulkan_present_scaleforce_fp32.frag
+++ b/src/video_core/host_shaders/vulkan_present_scaleforce_fp32.frag
@@ -1,3 +1,6 @@
1// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
1#version 460 4#version 460
2 5
3#extension GL_GOOGLE_include_directive : enable 6#extension GL_GOOGLE_include_directive : enable
diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp
index 9756a81d6..45791aa75 100644
--- a/src/video_core/renderer_base.cpp
+++ b/src/video_core/renderer_base.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/logging/log.h" 4#include "common/logging/log.h"
6#include "core/frontend/emu_window.h" 5#include "core/frontend/emu_window.h"
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h
index 30d19b178..8d20cbece 100644
--- a/src/video_core/renderer_base.h
+++ b/src/video_core/renderer_base.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 159b71161..a0d048b0b 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <array> 5#include <array>
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index c79461d59..31a16fcba 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/video_core/renderer_opengl/gl_resource_manager.cpp b/src/video_core/renderer_opengl/gl_resource_manager.cpp
index f6839a657..3a664fdec 100644
--- a/src/video_core/renderer_opengl/gl_resource_manager.cpp
+++ b/src/video_core/renderer_opengl/gl_resource_manager.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <string_view> 4#include <string_view>
6#include <glad/glad.h> 5#include <glad/glad.h>
diff --git a/src/video_core/renderer_opengl/gl_resource_manager.h b/src/video_core/renderer_opengl/gl_resource_manager.h
index 84e07f8bd..bc05ba4bd 100644
--- a/src/video_core/renderer_opengl/gl_resource_manager.h
+++ b/src/video_core/renderer_opengl/gl_resource_manager.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp
index 129966e72..f83ad0a5b 100644
--- a/src/video_core/renderer_opengl/gl_shader_util.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_util.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <string_view> 4#include <string_view>
6#include <vector> 5#include <vector>
diff --git a/src/video_core/renderer_opengl/gl_shader_util.h b/src/video_core/renderer_opengl/gl_shader_util.h
index a64ef37dc..43ebcdeba 100644
--- a/src/video_core/renderer_opengl/gl_shader_util.h
+++ b/src/video_core/renderer_opengl/gl_shader_util.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 9a9243544..01028cee0 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <cstddef> 5#include <cstddef>
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h
index ae9558a33..1a32e739d 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.h
+++ b/src/video_core/renderer_opengl/renderer_opengl.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index eecd0deff..079d5f028 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "common/math_util.h" 5#include "common/math_util.h"
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 0175432ff..16273f185 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp
index 2f2594585..04ac4af11 100644
--- a/src/video_core/video_core.cpp
+++ b/src/video_core/video_core.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <memory> 4#include <memory>
6 5
diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h
index 084df641f..f8e2444f3 100644
--- a/src/video_core/video_core.h
+++ b/src/video_core/video_core.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/web_service/CMakeLists.txt b/src/web_service/CMakeLists.txt
index 753fb6e7a..3f75d97d1 100644
--- a/src/web_service/CMakeLists.txt
+++ b/src/web_service/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1add_library(web_service STATIC 4add_library(web_service STATIC
2 announce_room_json.cpp 5 announce_room_json.cpp
3 announce_room_json.h 6 announce_room_json.h
diff --git a/src/web_service/telemetry_json.cpp b/src/web_service/telemetry_json.cpp
index 46faddb61..51c792004 100644
--- a/src/web_service/telemetry_json.cpp
+++ b/src/web_service/telemetry_json.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <nlohmann/json.hpp> 4#include <nlohmann/json.hpp>
6#include "common/detached_tasks.h" 5#include "common/detached_tasks.h"
diff --git a/src/web_service/telemetry_json.h b/src/web_service/telemetry_json.h
index df51e00f8..504002c04 100644
--- a/src/web_service/telemetry_json.h
+++ b/src/web_service/telemetry_json.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/web_service/verify_login.cpp b/src/web_service/verify_login.cpp
index ceb55ca6b..050080278 100644
--- a/src/web_service/verify_login.cpp
+++ b/src/web_service/verify_login.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <nlohmann/json.hpp> 4#include <nlohmann/json.hpp>
6#include "web_service/verify_login.h" 5#include "web_service/verify_login.h"
diff --git a/src/web_service/verify_login.h b/src/web_service/verify_login.h
index 821b345d7..8d0adce74 100644
--- a/src/web_service/verify_login.h
+++ b/src/web_service/verify_login.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp
index dce9772fe..378804c08 100644
--- a/src/web_service/web_backend.cpp
+++ b/src/web_service/web_backend.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <mutex> 5#include <mutex>
diff --git a/src/web_service/web_backend.h b/src/web_service/web_backend.h
index 81f58583c..11b5f558c 100644
--- a/src/web_service/web_backend.h
+++ b/src/web_service/web_backend.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt
index 66873143e..f6b389ede 100644
--- a/src/yuzu/CMakeLists.txt
+++ b/src/yuzu/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1set(CMAKE_AUTOMOC ON) 4set(CMAKE_AUTOMOC ON)
2set(CMAKE_AUTORCC ON) 5set(CMAKE_AUTORCC ON)
3set(CMAKE_AUTOUIC ON) 6set(CMAKE_AUTOUIC ON)
diff --git a/src/yuzu/Info.plist b/src/yuzu/Info.plist
index 5f1c95d54..0eb377926 100644
--- a/src/yuzu/Info.plist
+++ b/src/yuzu/Info.plist
@@ -1,4 +1,10 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2
3<!--
4SPDX-FileCopyrightText: 2015 Pierre de La Morinerie <kemenaran@gmail.com>
5SPDX-License-Identifier: GPL-2.0-or-later
6-->
7
2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 8<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0"> 9<plist version="1.0">
4<dict> 10<dict>
diff --git a/src/yuzu/aboutdialog.ui b/src/yuzu/aboutdialog.ui
index 1dd7b74bf..c4ffb293e 100644
--- a/src/yuzu/aboutdialog.ui
+++ b/src/yuzu/aboutdialog.ui
@@ -127,7 +127,7 @@ p, li { white-space: pre-wrap; }
127 <item> 127 <item>
128 <widget class="QLabel" name="labelLinks"> 128 <widget class="QLabel" name="labelLinks">
129 <property name="text"> 129 <property name="text">
130 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://yuzu-emu.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#039be5;&quot;&gt;Website&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#039be5;&quot;&gt;Source Code&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu/yuzu/graphs/contributors&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#039be5;&quot;&gt;Contributors&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu/yuzu/blob/master/license.txt&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#039be5;&quot;&gt;License&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 130 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://yuzu-emu.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#039be5;&quot;&gt;Website&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#039be5;&quot;&gt;Source Code&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu/yuzu/graphs/contributors&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#039be5;&quot;&gt;Contributors&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu/yuzu/blob/master/LICENSE.txt&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#039be5;&quot;&gt;License&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
131 </property> 131 </property>
132 <property name="openExternalLinks"> 132 <property name="openExternalLinks">
133 <bool>true</bool> 133 <bool>true</bool>
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp
index e8b217d90..e60506197 100644
--- a/src/yuzu/applets/qt_software_keyboard.cpp
+++ b/src/yuzu/applets/qt_software_keyboard.cpp
@@ -213,9 +213,9 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog(
213 ui->button_ok_num, 213 ui->button_ok_num,
214 }, 214 },
215 { 215 {
216 nullptr, 216 ui->button_left_optional_num,
217 ui->button_0_num, 217 ui->button_0_num,
218 nullptr, 218 ui->button_right_optional_num,
219 ui->button_ok_num, 219 ui->button_ok_num,
220 }, 220 },
221 }}; 221 }};
@@ -330,7 +330,9 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog(
330 ui->button_7_num, 330 ui->button_7_num,
331 ui->button_8_num, 331 ui->button_8_num,
332 ui->button_9_num, 332 ui->button_9_num,
333 ui->button_left_optional_num,
333 ui->button_0_num, 334 ui->button_0_num,
335 ui->button_right_optional_num,
334 }; 336 };
335 337
336 SetupMouseHover(); 338 SetupMouseHover();
@@ -342,6 +344,9 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog(
342 ui->label_header->setText(QString::fromStdU16String(initialize_parameters.header_text)); 344 ui->label_header->setText(QString::fromStdU16String(initialize_parameters.header_text));
343 ui->label_sub->setText(QString::fromStdU16String(initialize_parameters.sub_text)); 345 ui->label_sub->setText(QString::fromStdU16String(initialize_parameters.sub_text));
344 346
347 ui->button_left_optional_num->setText(QChar{initialize_parameters.left_optional_symbol_key});
348 ui->button_right_optional_num->setText(QChar{initialize_parameters.right_optional_symbol_key});
349
345 current_text = initialize_parameters.initial_text; 350 current_text = initialize_parameters.initial_text;
346 cursor_position = initialize_parameters.initial_cursor_position; 351 cursor_position = initialize_parameters.initial_cursor_position;
347 352
@@ -932,6 +937,15 @@ void QtSoftwareKeyboardDialog::DisableKeyboardButtons() {
932 button->setEnabled(true); 937 button->setEnabled(true);
933 } 938 }
934 } 939 }
940
941 const auto enable_left_optional = initialize_parameters.left_optional_symbol_key != '\0';
942 const auto enable_right_optional = initialize_parameters.right_optional_symbol_key != '\0';
943
944 ui->button_left_optional_num->setEnabled(enable_left_optional);
945 ui->button_left_optional_num->setVisible(enable_left_optional);
946
947 ui->button_right_optional_num->setEnabled(enable_right_optional);
948 ui->button_right_optional_num->setVisible(enable_right_optional);
935 break; 949 break;
936 } 950 }
937 } 951 }
@@ -1019,7 +1033,10 @@ bool QtSoftwareKeyboardDialog::ValidateInputText(const QString& input_text) {
1019 } 1033 }
1020 1034
1021 if (bottom_osk_index == BottomOSKIndex::NumberPad && 1035 if (bottom_osk_index == BottomOSKIndex::NumberPad &&
1022 std::any_of(input_text.begin(), input_text.end(), [](QChar c) { return !c.isDigit(); })) { 1036 std::any_of(input_text.begin(), input_text.end(), [this](QChar c) {
1037 return !c.isDigit() && c != QChar{initialize_parameters.left_optional_symbol_key} &&
1038 c != QChar{initialize_parameters.right_optional_symbol_key};
1039 })) {
1023 return false; 1040 return false;
1024 } 1041 }
1025 1042
@@ -1384,6 +1401,10 @@ void QtSoftwareKeyboardDialog::MoveButtonDirection(Direction direction) {
1384 } 1401 }
1385 }; 1402 };
1386 1403
1404 // Store the initial row and column.
1405 const auto initial_row = row;
1406 const auto initial_column = column;
1407
1387 switch (bottom_osk_index) { 1408 switch (bottom_osk_index) {
1388 case BottomOSKIndex::LowerCase: 1409 case BottomOSKIndex::LowerCase:
1389 case BottomOSKIndex::UpperCase: { 1410 case BottomOSKIndex::UpperCase: {
@@ -1394,6 +1415,11 @@ void QtSoftwareKeyboardDialog::MoveButtonDirection(Direction direction) {
1394 auto* curr_button = keyboard_buttons[index][row][column]; 1415 auto* curr_button = keyboard_buttons[index][row][column];
1395 1416
1396 while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) { 1417 while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) {
1418 // If we returned back to where we started from, break the loop.
1419 if (row == initial_row && column == initial_column) {
1420 break;
1421 }
1422
1397 move_direction(NUM_ROWS_NORMAL, NUM_COLUMNS_NORMAL); 1423 move_direction(NUM_ROWS_NORMAL, NUM_COLUMNS_NORMAL);
1398 curr_button = keyboard_buttons[index][row][column]; 1424 curr_button = keyboard_buttons[index][row][column];
1399 } 1425 }
@@ -1408,6 +1434,11 @@ void QtSoftwareKeyboardDialog::MoveButtonDirection(Direction direction) {
1408 auto* curr_button = numberpad_buttons[row][column]; 1434 auto* curr_button = numberpad_buttons[row][column];
1409 1435
1410 while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) { 1436 while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) {
1437 // If we returned back to where we started from, break the loop.
1438 if (row == initial_row && column == initial_column) {
1439 break;
1440 }
1441
1411 move_direction(NUM_ROWS_NUMPAD, NUM_COLUMNS_NUMPAD); 1442 move_direction(NUM_ROWS_NUMPAD, NUM_COLUMNS_NUMPAD);
1412 curr_button = numberpad_buttons[row][column]; 1443 curr_button = numberpad_buttons[row][column];
1413 } 1444 }
diff --git a/src/yuzu/applets/qt_software_keyboard.h b/src/yuzu/applets/qt_software_keyboard.h
index 1c489fbb6..35d4ee2ef 100644
--- a/src/yuzu/applets/qt_software_keyboard.h
+++ b/src/yuzu/applets/qt_software_keyboard.h
@@ -211,7 +211,7 @@ private:
211 std::array<std::array<QPushButton*, NUM_COLUMNS_NUMPAD>, NUM_ROWS_NUMPAD> numberpad_buttons; 211 std::array<std::array<QPushButton*, NUM_COLUMNS_NUMPAD>, NUM_ROWS_NUMPAD> numberpad_buttons;
212 212
213 // Contains a set of all buttons used in keyboard_buttons and numberpad_buttons. 213 // Contains a set of all buttons used in keyboard_buttons and numberpad_buttons.
214 std::array<QPushButton*, 110> all_buttons; 214 std::array<QPushButton*, 112> all_buttons;
215 215
216 std::size_t row{0}; 216 std::size_t row{0};
217 std::size_t column{0}; 217 std::size_t column{0};
diff --git a/src/yuzu/applets/qt_software_keyboard.ui b/src/yuzu/applets/qt_software_keyboard.ui
index b0a1fcde9..9661cb260 100644
--- a/src/yuzu/applets/qt_software_keyboard.ui
+++ b/src/yuzu/applets/qt_software_keyboard.ui
@@ -3298,6 +3298,24 @@ p, li { white-space: pre-wrap; }
3298 </property> 3298 </property>
3299 </widget> 3299 </widget>
3300 </item> 3300 </item>
3301 <item row="4" column="2">
3302 <widget class="QPushButton" name="button_left_optional_num">
3303 <property name="sizePolicy">
3304 <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
3305 <horstretch>1</horstretch>
3306 <verstretch>1</verstretch>
3307 </sizepolicy>
3308 </property>
3309 <property name="font">
3310 <font>
3311 <pointsize>28</pointsize>
3312 </font>
3313 </property>
3314 <property name="text">
3315 <string notr="true"></string>
3316 </property>
3317 </widget>
3318 </item>
3301 <item row="4" column="3"> 3319 <item row="4" column="3">
3302 <widget class="QPushButton" name="button_0_num"> 3320 <widget class="QPushButton" name="button_0_num">
3303 <property name="sizePolicy"> 3321 <property name="sizePolicy">
@@ -3316,6 +3334,24 @@ p, li { white-space: pre-wrap; }
3316 </property> 3334 </property>
3317 </widget> 3335 </widget>
3318 </item> 3336 </item>
3337 <item row="4" column="4">
3338 <widget class="QPushButton" name="button_right_optional_num">
3339 <property name="sizePolicy">
3340 <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
3341 <horstretch>1</horstretch>
3342 <verstretch>1</verstretch>
3343 </sizepolicy>
3344 </property>
3345 <property name="font">
3346 <font>
3347 <pointsize>28</pointsize>
3348 </font>
3349 </property>
3350 <property name="text">
3351 <string notr="true"></string>
3352 </property>
3353 </widget>
3354 </item>
3319 <item row="1" column="4"> 3355 <item row="1" column="4">
3320 <widget class="QPushButton" name="button_3_num"> 3356 <widget class="QPushButton" name="button_3_num">
3321 <property name="sizePolicy"> 3357 <property name="sizePolicy">
@@ -3494,7 +3530,9 @@ p, li { white-space: pre-wrap; }
3494 <tabstop>button_7_num</tabstop> 3530 <tabstop>button_7_num</tabstop>
3495 <tabstop>button_8_num</tabstop> 3531 <tabstop>button_8_num</tabstop>
3496 <tabstop>button_9_num</tabstop> 3532 <tabstop>button_9_num</tabstop>
3533 <tabstop>button_left_optional_num</tabstop>
3497 <tabstop>button_0_num</tabstop> 3534 <tabstop>button_0_num</tabstop>
3535 <tabstop>button_right_optional_num</tabstop>
3498 </tabstops> 3536 </tabstops>
3499 <resources> 3537 <resources>
3500 <include location="../../../dist/icons/overlay/overlay.qrc"/> 3538 <include location="../../../dist/icons/overlay/overlay.qrc"/>
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 0ee3820a2..ef3bdfb1a 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <glad/glad.h> 4#include <glad/glad.h>
6 5
@@ -805,6 +804,7 @@ void GRenderWindow::TouchEndEvent() {
805} 804}
806 805
807void GRenderWindow::InitializeCamera() { 806void GRenderWindow::InitializeCamera() {
807 constexpr auto camera_update_ms = std::chrono::milliseconds{50}; // (50ms, 20Hz)
808 if (!Settings::values.enable_ir_sensor) { 808 if (!Settings::values.enable_ir_sensor) {
809 return; 809 return;
810 } 810 }
@@ -838,7 +838,7 @@ void GRenderWindow::InitializeCamera() {
838 camera_timer = std::make_unique<QTimer>(); 838 camera_timer = std::make_unique<QTimer>();
839 connect(camera_timer.get(), &QTimer::timeout, [this] { RequestCameraCapture(); }); 839 connect(camera_timer.get(), &QTimer::timeout, [this] { RequestCameraCapture(); });
840 // This timer should be dependent of camera resolution 5ms for every 100 pixels 840 // This timer should be dependent of camera resolution 5ms for every 100 pixels
841 camera_timer->start(100); 841 camera_timer->start(camera_update_ms);
842} 842}
843 843
844void GRenderWindow::FinalizeCamera() { 844void GRenderWindow::FinalizeCamera() {
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h
index b4781e697..c45ebf1a2 100644
--- a/src/yuzu/bootmanager.h
+++ b/src/yuzu/bootmanager.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/compatdb.cpp b/src/yuzu/compatdb.cpp
index 2442bb3c3..f46fff340 100644
--- a/src/yuzu/compatdb.cpp
+++ b/src/yuzu/compatdb.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QButtonGroup> 4#include <QButtonGroup>
6#include <QMessageBox> 5#include <QMessageBox>
diff --git a/src/yuzu/compatdb.h b/src/yuzu/compatdb.h
index e2b2522bd..3252fc47a 100644
--- a/src/yuzu/compatdb.h
+++ b/src/yuzu/compatdb.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 3b22102a8..58f1239bf 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <QKeySequence> 5#include <QKeySequence>
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h
index 937b2d95b..486ceea94 100644
--- a/src/yuzu/configuration/config.h
+++ b/src/yuzu/configuration/config.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp
index dd4959417..97fb664bf 100644
--- a/src/yuzu/configuration/configuration_shared.cpp
+++ b/src/yuzu/configuration/configuration_shared.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QCheckBox> 4#include <QCheckBox>
6#include <QObject> 5#include <QObject>
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h
index 56800b6ff..e597dcdb5 100644
--- a/src/yuzu/configuration/configuration_shared.h
+++ b/src/yuzu/configuration/configuration_shared.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp
index 84808f678..e16d127a8 100644
--- a/src/yuzu/configuration/configure_debug.cpp
+++ b/src/yuzu/configuration/configure_debug.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QDesktopServices> 4#include <QDesktopServices>
6#include <QUrl> 5#include <QUrl>
diff --git a/src/yuzu/configuration/configure_debug.h b/src/yuzu/configuration/configure_debug.h
index 73f71c9e3..64d68ab8f 100644
--- a/src/yuzu/configuration/configure_debug.h
+++ b/src/yuzu/configuration/configure_debug.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp
index 92ef4467b..4301313cf 100644
--- a/src/yuzu/configuration/configure_dialog.cpp
+++ b/src/yuzu/configuration/configure_dialog.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <memory> 4#include <memory>
6#include "common/logging/log.h" 5#include "common/logging/log.h"
diff --git a/src/yuzu/configuration/configure_dialog.h b/src/yuzu/configuration/configure_dialog.h
index cec1610ad..1f724834a 100644
--- a/src/yuzu/configuration/configure_dialog.h
+++ b/src/yuzu/configuration/configure_dialog.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp
index 2a446205b..7ade01ba6 100644
--- a/src/yuzu/configuration/configure_general.cpp
+++ b/src/yuzu/configuration/configure_general.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <functional> 4#include <functional>
6#include <utility> 5#include <utility>
diff --git a/src/yuzu/configuration/configure_general.h b/src/yuzu/configuration/configure_general.h
index b6f3bb5ed..a090c1a3f 100644
--- a/src/yuzu/configuration/configure_general.h
+++ b/src/yuzu/configuration/configure_general.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp
index 6b33c4535..87e5d0f48 100644
--- a/src/yuzu/configuration/configure_graphics.cpp
+++ b/src/yuzu/configuration/configure_graphics.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5// Include this early to include Vulkan headers how we want to 4// Include this early to include Vulkan headers how we want to
6#include "video_core/vulkan_common/vulkan_wrapper.h" 5#include "video_core/vulkan_common/vulkan_wrapper.h"
diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h
index 1b101c940..70034eb1b 100644
--- a/src/yuzu/configuration/configure_graphics.h
+++ b/src/yuzu/configuration/configure_graphics.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_hotkeys.cpp b/src/yuzu/configuration/configure_hotkeys.cpp
index edf0893c4..daa77a8f8 100644
--- a/src/yuzu/configuration/configure_hotkeys.cpp
+++ b/src/yuzu/configuration/configure_hotkeys.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QMenu> 4#include <QMenu>
6#include <QMessageBox> 5#include <QMessageBox>
diff --git a/src/yuzu/configuration/configure_hotkeys.h b/src/yuzu/configuration/configure_hotkeys.h
index f943ec538..b45ecb185 100644
--- a/src/yuzu/configuration/configure_hotkeys.h
+++ b/src/yuzu/configuration/configure_hotkeys.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_input.cpp b/src/yuzu/configuration/configure_input.cpp
index f1b061b13..16fba3deb 100644
--- a/src/yuzu/configuration/configure_input.cpp
+++ b/src/yuzu/configuration/configure_input.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <memory> 4#include <memory>
6#include <thread> 5#include <thread>
diff --git a/src/yuzu/configuration/configure_input.h b/src/yuzu/configuration/configure_input.h
index 4cafa3dab..c89189c36 100644
--- a/src/yuzu/configuration/configure_input.h
+++ b/src/yuzu/configuration/configure_input.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index f3be9a374..00bee85b2 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <memory> 5#include <memory>
diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h
index 47df6b3d3..79434fdd8 100644
--- a/src/yuzu/configuration/configure_input_player.h
+++ b/src/yuzu/configuration/configure_input_player.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_motion_touch.cpp b/src/yuzu/configuration/configure_motion_touch.cpp
index c313b0919..d1b870c72 100644
--- a/src/yuzu/configuration/configure_motion_touch.cpp
+++ b/src/yuzu/configuration/configure_motion_touch.cpp
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <sstream> 4#include <sstream>
6 5
diff --git a/src/yuzu/configuration/configure_motion_touch.h b/src/yuzu/configuration/configure_motion_touch.h
index 91d1ae671..7dcc9318e 100644
--- a/src/yuzu/configuration/configure_motion_touch.h
+++ b/src/yuzu/configuration/configure_motion_touch.h
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_per_game_addons.cpp b/src/yuzu/configuration/configure_per_game_addons.cpp
index 4906997ab..674a75a62 100644
--- a/src/yuzu/configuration/configure_per_game_addons.cpp
+++ b/src/yuzu/configuration/configure_per_game_addons.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <memory> 5#include <memory>
diff --git a/src/yuzu/configuration/configure_per_game_addons.h b/src/yuzu/configuration/configure_per_game_addons.h
index 14690fba8..53db405c1 100644
--- a/src/yuzu/configuration/configure_per_game_addons.h
+++ b/src/yuzu/configuration/configure_per_game_addons.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp
index 5442fe328..5c0217ba8 100644
--- a/src/yuzu/configuration/configure_profile_manager.cpp
+++ b/src/yuzu/configuration/configure_profile_manager.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <QFileDialog> 5#include <QFileDialog>
diff --git a/src/yuzu/configuration/configure_profile_manager.h b/src/yuzu/configuration/configure_profile_manager.h
index 575cb89d5..fe9033779 100644
--- a/src/yuzu/configuration/configure_profile_manager.h
+++ b/src/yuzu/configuration/configure_profile_manager.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp
index ecebb0fb7..bc9d9d77a 100644
--- a/src/yuzu/configuration/configure_system.cpp
+++ b/src/yuzu/configuration/configure_system.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <chrono> 4#include <chrono>
6#include <optional> 5#include <optional>
diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h
index 5a1633192..8f02880a7 100644
--- a/src/yuzu/configuration/configure_system.h
+++ b/src/yuzu/configuration/configure_system.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_touch_from_button.cpp b/src/yuzu/configuration/configure_touch_from_button.cpp
index 06cc452c3..18e2eba69 100644
--- a/src/yuzu/configuration/configure_touch_from_button.cpp
+++ b/src/yuzu/configuration/configure_touch_from_button.cpp
@@ -1,6 +1,5 @@
1// Copyright 2020 Citra Emulator Project 1// SPDX-FileCopyrightText: 2020 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QInputDialog> 4#include <QInputDialog>
6#include <QKeyEvent> 5#include <QKeyEvent>
diff --git a/src/yuzu/configuration/configure_touch_from_button.h b/src/yuzu/configuration/configure_touch_from_button.h
index b8c55db66..5a1416d00 100644
--- a/src/yuzu/configuration/configure_touch_from_button.h
+++ b/src/yuzu/configuration/configure_touch_from_button.h
@@ -1,6 +1,5 @@
1// Copyright 2020 Citra Emulator Project 1// SPDX-FileCopyrightText: 2020 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_touch_widget.h b/src/yuzu/configuration/configure_touch_widget.h
index 347b46583..49f533afe 100644
--- a/src/yuzu/configuration/configure_touch_widget.h
+++ b/src/yuzu/configuration/configure_touch_widget.h
@@ -1,6 +1,5 @@
1// Copyright 2020 Citra Emulator Project 1// SPDX-FileCopyrightText: 2020 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_touchscreen_advanced.cpp b/src/yuzu/configuration/configure_touchscreen_advanced.cpp
index 29c86c7bc..5a03e48df 100644
--- a/src/yuzu/configuration/configure_touchscreen_advanced.cpp
+++ b/src/yuzu/configuration/configure_touchscreen_advanced.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <memory> 4#include <memory>
6#include "ui_configure_touchscreen_advanced.h" 5#include "ui_configure_touchscreen_advanced.h"
diff --git a/src/yuzu/configuration/configure_touchscreen_advanced.h b/src/yuzu/configuration/configure_touchscreen_advanced.h
index 72061492c..034dc0d46 100644
--- a/src/yuzu/configuration/configure_touchscreen_advanced.h
+++ b/src/yuzu/configuration/configure_touchscreen_advanced.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_ui.cpp b/src/yuzu/configuration/configure_ui.cpp
index d3a60cdd1..2e98ede8e 100644
--- a/src/yuzu/configuration/configure_ui.cpp
+++ b/src/yuzu/configuration/configure_ui.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <utility> 5#include <utility>
diff --git a/src/yuzu/configuration/configure_ui.h b/src/yuzu/configuration/configure_ui.h
index 48b6e6d82..95af8370e 100644
--- a/src/yuzu/configuration/configure_ui.h
+++ b/src/yuzu/configuration/configure_ui.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/configuration/configure_web.cpp b/src/yuzu/configuration/configure_web.cpp
index ff4bf44f4..d668c992b 100644
--- a/src/yuzu/configuration/configure_web.cpp
+++ b/src/yuzu/configuration/configure_web.cpp
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QIcon> 4#include <QIcon>
6#include <QMessageBox> 5#include <QMessageBox>
diff --git a/src/yuzu/configuration/configure_web.h b/src/yuzu/configuration/configure_web.h
index 041b51149..03feb55f8 100644
--- a/src/yuzu/configuration/configure_web.h
+++ b/src/yuzu/configuration/configure_web.h
@@ -1,6 +1,5 @@
1// Copyright 2017 Citra Emulator Project 1// SPDX-FileCopyrightText: 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/debugger/controller.cpp b/src/yuzu/debugger/controller.cpp
index 6b834c42e..e4bf16a04 100644
--- a/src/yuzu/debugger/controller.cpp
+++ b/src/yuzu/debugger/controller.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QAction> 4#include <QAction>
6#include <QLayout> 5#include <QLayout>
diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h
index 52cea3326..9651dfaa9 100644
--- a/src/yuzu/debugger/controller.h
+++ b/src/yuzu/debugger/controller.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp
index 33110685a..d3e2d3c12 100644
--- a/src/yuzu/debugger/profiler.cpp
+++ b/src/yuzu/debugger/profiler.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QAction> 4#include <QAction>
6#include <QLayout> 5#include <QLayout>
diff --git a/src/yuzu/debugger/profiler.h b/src/yuzu/debugger/profiler.h
index 8e69fdb06..4c8ccd3c2 100644
--- a/src/yuzu/debugger/profiler.h
+++ b/src/yuzu/debugger/profiler.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp
index 0ea31cd33..7f7c5fc42 100644
--- a/src/yuzu/debugger/wait_tree.cpp
+++ b/src/yuzu/debugger/wait_tree.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <fmt/format.h> 5#include <fmt/format.h>
diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h
index f21b9f467..7e528b592 100644
--- a/src/yuzu/debugger/wait_tree.h
+++ b/src/yuzu/debugger/wait_tree.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/discord.h b/src/yuzu/discord.h
index a867cc4d6..e08784498 100644
--- a/src/yuzu/discord.h
+++ b/src/yuzu/discord.h
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/discord_impl.cpp b/src/yuzu/discord_impl.cpp
index 66f928af6..c351e9b83 100644
--- a/src/yuzu/discord_impl.cpp
+++ b/src/yuzu/discord_impl.cpp
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <chrono> 4#include <chrono>
6#include <string> 5#include <string>
diff --git a/src/yuzu/discord_impl.h b/src/yuzu/discord_impl.h
index 03ad42681..84710b9c6 100644
--- a/src/yuzu/discord_impl.h
+++ b/src/yuzu/discord_impl.h
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 5bcf582bf..041e6ac11 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <regex> 4#include <regex>
6#include <QApplication> 5#include <QApplication>
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h
index 9605985cc..f783283c9 100644
--- a/src/yuzu/game_list.h
+++ b/src/yuzu/game_list.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h
index cd7d63536..e7667cf60 100644
--- a/src/yuzu/game_list_p.h
+++ b/src/yuzu/game_list_p.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/hotkeys.cpp b/src/yuzu/hotkeys.cpp
index d59aa5d18..13723f6e5 100644
--- a/src/yuzu/hotkeys.cpp
+++ b/src/yuzu/hotkeys.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <sstream> 4#include <sstream>
6#include <QShortcut> 5#include <QShortcut>
diff --git a/src/yuzu/hotkeys.h b/src/yuzu/hotkeys.h
index 57a7c7da5..dc5b7f628 100644
--- a/src/yuzu/hotkeys.h
+++ b/src/yuzu/hotkeys.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index e56fcabff..e8a57f4b4 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <cinttypes> 4#include <cinttypes>
6#include <clocale> 5#include <clocale>
@@ -9,6 +8,10 @@
9#ifdef __APPLE__ 8#ifdef __APPLE__
10#include <unistd.h> // for chdir 9#include <unistd.h> // for chdir
11#endif 10#endif
11#ifdef __linux__
12#include <csignal>
13#include <sys/socket.h>
14#endif
12 15
13// VFS includes must be before glad as they will conflict with Windows file api, which uses defines. 16// VFS includes must be before glad as they will conflict with Windows file api, which uses defines.
14#include "applets/qt_controller.h" 17#include "applets/qt_controller.h"
@@ -260,6 +263,10 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
260 config{std::make_unique<Config>(*system)}, 263 config{std::make_unique<Config>(*system)},
261 vfs{std::make_shared<FileSys::RealVfsFilesystem>()}, 264 vfs{std::make_shared<FileSys::RealVfsFilesystem>()},
262 provider{std::make_unique<FileSys::ManualContentProvider>()} { 265 provider{std::make_unique<FileSys::ManualContentProvider>()} {
266#ifdef __linux__
267 SetupSigInterrupts();
268#endif
269
263 Common::Log::Initialize(); 270 Common::Log::Initialize();
264 LoadTranslation(); 271 LoadTranslation();
265 272
@@ -379,6 +386,8 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
379 SDL_EnableScreenSaver(); 386 SDL_EnableScreenSaver();
380#endif 387#endif
381 388
389 SetupPrepareForSleep();
390
382 Common::Log::Start(); 391 Common::Log::Start();
383 392
384 QStringList args = QApplication::arguments(); 393 QStringList args = QApplication::arguments();
@@ -463,7 +472,13 @@ GMainWindow::~GMainWindow() {
463 if (render_window->parent() == nullptr) { 472 if (render_window->parent() == nullptr) {
464 delete render_window; 473 delete render_window;
465 } 474 }
475
466 system->GetRoomNetwork().Shutdown(); 476 system->GetRoomNetwork().Shutdown();
477
478#ifdef __linux__
479 ::close(sig_interrupt_fds[0]);
480 ::close(sig_interrupt_fds[1]);
481#endif
467} 482}
468 483
469void GMainWindow::RegisterMetaTypes() { 484void GMainWindow::RegisterMetaTypes() {
@@ -1314,6 +1329,43 @@ void GMainWindow::OnDisplayTitleBars(bool show) {
1314 } 1329 }
1315} 1330}
1316 1331
1332void GMainWindow::SetupPrepareForSleep() {
1333#ifdef __linux__
1334 auto bus = QDBusConnection::systemBus();
1335 if (bus.isConnected()) {
1336 const bool success = bus.connect(
1337 QStringLiteral("org.freedesktop.login1"), QStringLiteral("/org/freedesktop/login1"),
1338 QStringLiteral("org.freedesktop.login1.Manager"), QStringLiteral("PrepareForSleep"),
1339 QStringLiteral("b"), this, SLOT(OnPrepareForSleep(bool)));
1340
1341 if (!success) {
1342 LOG_WARNING(Frontend, "Couldn't register PrepareForSleep signal");
1343 }
1344 } else {
1345 LOG_WARNING(Frontend, "QDBusConnection system bus is not connected");
1346 }
1347#endif // __linux__
1348}
1349
1350void GMainWindow::OnPrepareForSleep(bool prepare_sleep) {
1351 if (emu_thread == nullptr) {
1352 return;
1353 }
1354
1355 if (prepare_sleep) {
1356 if (emu_thread->IsRunning()) {
1357 auto_paused = true;
1358 OnPauseGame();
1359 }
1360 } else {
1361 if (!emu_thread->IsRunning() && auto_paused) {
1362 auto_paused = false;
1363 RequestGameResume();
1364 OnStartGame();
1365 }
1366 }
1367}
1368
1317#ifdef __linux__ 1369#ifdef __linux__
1318static std::optional<QDBusObjectPath> HoldWakeLockLinux(u32 window_id = 0) { 1370static std::optional<QDBusObjectPath> HoldWakeLockLinux(u32 window_id = 0) {
1319 if (!QDBusConnection::sessionBus().isConnected()) { 1371 if (!QDBusConnection::sessionBus().isConnected()) {
@@ -1353,6 +1405,52 @@ static void ReleaseWakeLockLinux(QDBusObjectPath lock) {
1353 QString::fromLatin1("org.freedesktop.portal.Request")); 1405 QString::fromLatin1("org.freedesktop.portal.Request"));
1354 unlocker.call(QString::fromLatin1("Close")); 1406 unlocker.call(QString::fromLatin1("Close"));
1355} 1407}
1408
1409std::array<int, 3> GMainWindow::sig_interrupt_fds{0, 0, 0};
1410
1411void GMainWindow::SetupSigInterrupts() {
1412 if (sig_interrupt_fds[2] == 1) {
1413 return;
1414 }
1415 socketpair(AF_UNIX, SOCK_STREAM, 0, sig_interrupt_fds.data());
1416 sig_interrupt_fds[2] = 1;
1417
1418 struct sigaction sa;
1419 sa.sa_handler = &GMainWindow::HandleSigInterrupt;
1420 sigemptyset(&sa.sa_mask);
1421 sa.sa_flags = SA_RESETHAND;
1422 sigaction(SIGINT, &sa, nullptr);
1423 sigaction(SIGTERM, &sa, nullptr);
1424
1425 sig_interrupt_notifier = new QSocketNotifier(sig_interrupt_fds[1], QSocketNotifier::Read, this);
1426 connect(sig_interrupt_notifier, &QSocketNotifier::activated, this,
1427 &GMainWindow::OnSigInterruptNotifierActivated);
1428 connect(this, &GMainWindow::SigInterrupt, this, &GMainWindow::close);
1429}
1430
1431void GMainWindow::HandleSigInterrupt(int sig) {
1432 if (sig == SIGINT) {
1433 exit(1);
1434 }
1435
1436 // Calling into Qt directly from a signal handler is not safe,
1437 // so wake up a QSocketNotifier with this hacky write call instead.
1438 char a = 1;
1439 int ret = write(sig_interrupt_fds[0], &a, sizeof(a));
1440 (void)ret;
1441}
1442
1443void GMainWindow::OnSigInterruptNotifierActivated() {
1444 sig_interrupt_notifier->setEnabled(false);
1445
1446 char a;
1447 int ret = read(sig_interrupt_fds[1], &a, sizeof(a));
1448 (void)ret;
1449
1450 sig_interrupt_notifier->setEnabled(true);
1451
1452 emit SigInterrupt();
1453}
1356#endif // __linux__ 1454#endif // __linux__
1357 1455
1358void GMainWindow::PreventOSSleep() { 1456void GMainWindow::PreventOSSleep() {
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 8d5c1398f..23b67a14e 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
@@ -164,6 +163,8 @@ signals:
164 void WebBrowserExtractOfflineRomFS(); 163 void WebBrowserExtractOfflineRomFS();
165 void WebBrowserClosed(Service::AM::Applets::WebExitReason exit_reason, std::string last_url); 164 void WebBrowserClosed(Service::AM::Applets::WebExitReason exit_reason, std::string last_url);
166 165
166 void SigInterrupt();
167
167public slots: 168public slots:
168 void OnLoadComplete(); 169 void OnLoadComplete();
169 void OnExecuteProgram(std::size_t program_index); 170 void OnExecuteProgram(std::size_t program_index);
@@ -203,7 +204,7 @@ private:
203 void ConnectMenuEvents(); 204 void ConnectMenuEvents();
204 void UpdateMenuState(); 205 void UpdateMenuState();
205 206
206 MultiplayerState* multiplayer_state = nullptr; 207 void SetupPrepareForSleep();
207 208
208 void PreventOSSleep(); 209 void PreventOSSleep();
209 void AllowOSSleep(); 210 void AllowOSSleep();
@@ -252,12 +253,19 @@ private:
252 void RequestGameResume(); 253 void RequestGameResume();
253 void closeEvent(QCloseEvent* event) override; 254 void closeEvent(QCloseEvent* event) override;
254 255
256#ifdef __linux__
257 void SetupSigInterrupts();
258 static void HandleSigInterrupt(int);
259 void OnSigInterruptNotifierActivated();
260#endif
261
255private slots: 262private slots:
256 void OnStartGame(); 263 void OnStartGame();
257 void OnRestartGame(); 264 void OnRestartGame();
258 void OnPauseGame(); 265 void OnPauseGame();
259 void OnPauseContinueGame(); 266 void OnPauseContinueGame();
260 void OnStopGame(); 267 void OnStopGame();
268 void OnPrepareForSleep(bool prepare_sleep);
261 void OnMenuReportCompatibility(); 269 void OnMenuReportCompatibility();
262 void OnOpenModsPage(); 270 void OnOpenModsPage();
263 void OnOpenQuickstartGuide(); 271 void OnOpenQuickstartGuide();
@@ -348,6 +356,8 @@ private:
348 std::unique_ptr<DiscordRPC::DiscordInterface> discord_rpc; 356 std::unique_ptr<DiscordRPC::DiscordInterface> discord_rpc;
349 std::shared_ptr<InputCommon::InputSubsystem> input_subsystem; 357 std::shared_ptr<InputCommon::InputSubsystem> input_subsystem;
350 358
359 MultiplayerState* multiplayer_state = nullptr;
360
351 GRenderWindow* render_window; 361 GRenderWindow* render_window;
352 GameList* game_list; 362 GameList* game_list;
353 LoadingScreen* loading_screen; 363 LoadingScreen* loading_screen;
@@ -420,6 +430,9 @@ private:
420 bool is_tas_recording_dialog_active{}; 430 bool is_tas_recording_dialog_active{};
421 431
422#ifdef __linux__ 432#ifdef __linux__
433 QSocketNotifier* sig_interrupt_notifier;
434 static std::array<int, 3> sig_interrupt_fds;
435
423 QDBusObjectPath wake_lock{}; 436 QDBusObjectPath wake_lock{};
424#endif 437#endif
425 438
diff --git a/src/yuzu/uisettings.cpp b/src/yuzu/uisettings.cpp
index f683b80f7..2c1b547fb 100644
--- a/src/yuzu/uisettings.cpp
+++ b/src/yuzu/uisettings.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "yuzu/uisettings.h" 4#include "yuzu/uisettings.h"
6 5
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h
index 6cd4d6cb2..25d1bf1e6 100644
--- a/src/yuzu/uisettings.h
+++ b/src/yuzu/uisettings.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/util/sequence_dialog/sequence_dialog.cpp b/src/yuzu/util/sequence_dialog/sequence_dialog.cpp
index bb5f74ec4..4b10fa517 100644
--- a/src/yuzu/util/sequence_dialog/sequence_dialog.cpp
+++ b/src/yuzu/util/sequence_dialog/sequence_dialog.cpp
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <QDialogButtonBox> 4#include <QDialogButtonBox>
6#include <QKeySequenceEdit> 5#include <QKeySequenceEdit>
diff --git a/src/yuzu/util/sequence_dialog/sequence_dialog.h b/src/yuzu/util/sequence_dialog/sequence_dialog.h
index 969c77740..85e146d40 100644
--- a/src/yuzu/util/sequence_dialog/sequence_dialog.h
+++ b/src/yuzu/util/sequence_dialog/sequence_dialog.h
@@ -1,6 +1,5 @@
1// Copyright 2018 Citra Emulator Project 1// SPDX-FileCopyrightText: 2018 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/util/util.cpp b/src/yuzu/util/util.cpp
index ef31bc2d2..5c3e4589e 100644
--- a/src/yuzu/util/util.cpp
+++ b/src/yuzu/util/util.cpp
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <cmath> 5#include <cmath>
diff --git a/src/yuzu/util/util.h b/src/yuzu/util/util.h
index e6790f260..39dd2d895 100644
--- a/src/yuzu/util/util.h
+++ b/src/yuzu/util/util.h
@@ -1,6 +1,5 @@
1// Copyright 2015 Citra Emulator Project 1// SPDX-FileCopyrightText: 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu/yuzu.qrc b/src/yuzu/yuzu.qrc
index 5733cac98..855df05fd 100644
--- a/src/yuzu/yuzu.qrc
+++ b/src/yuzu/yuzu.qrc
@@ -1,3 +1,8 @@
1<!--
2SPDX-FileCopyrightText: 2021 yuzu Emulator Project
3SPDX-License-Identifier: GPL-2.0-or-later
4-->
5
1<RCC> 6<RCC>
2 <qresource prefix="/img"> 7 <qresource prefix="/img">
3 <file alias="yuzu.ico">../../dist/yuzu.ico</file> 8 <file alias="yuzu.ico">../../dist/yuzu.ico</file>
diff --git a/src/yuzu/yuzu.rc b/src/yuzu/yuzu.rc
index 4a3645a71..1fc74d065 100644
--- a/src/yuzu/yuzu.rc
+++ b/src/yuzu/yuzu.rc
@@ -1,3 +1,6 @@
1// SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
1#include "winresrc.h" 4#include "winresrc.h"
2///////////////////////////////////////////////////////////////////////////// 5/////////////////////////////////////////////////////////////////////////////
3// 6//
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt
index c8901f2df..7d8ca3d8a 100644
--- a/src/yuzu_cmd/CMakeLists.txt
+++ b/src/yuzu_cmd/CMakeLists.txt
@@ -1,3 +1,6 @@
1# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
1set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) 4set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
2 5
3# Credits to Samantas5855 and others for this function. 6# Credits to Samantas5855 and others for this function.
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index ad7f9d239..bd0fb75f8 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <memory> 4#include <memory>
6#include <optional> 5#include <optional>
diff --git a/src/yuzu_cmd/config.h b/src/yuzu_cmd/config.h
index 32c03075f..021438b17 100644
--- a/src/yuzu_cmd/config.h
+++ b/src/yuzu_cmd/config.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index d9a2a460c..1168cf136 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
index 8e38724db..4ac72c2f6 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <SDL.h> 4#include <SDL.h>
6 5
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.h b/src/yuzu_cmd/emu_window/emu_window_sdl2.h
index 58b885465..90bb0b415 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.h
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.h
@@ -1,6 +1,5 @@
1// Copyright 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index e10d3f5b4..003890c07 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -1,6 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// SPDX-FileCopyrightText: 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <chrono> 4#include <chrono>
6#include <iostream> 5#include <iostream>
diff --git a/src/yuzu_cmd/yuzu.rc b/src/yuzu_cmd/yuzu.rc
index 0cde75e2f..e230cf680 100644
--- a/src/yuzu_cmd/yuzu.rc
+++ b/src/yuzu_cmd/yuzu.rc
@@ -1,3 +1,6 @@
1// SPDX-FileCopyrightText: 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
1#include "winresrc.h" 4#include "winresrc.h"
2///////////////////////////////////////////////////////////////////////////// 5/////////////////////////////////////////////////////////////////////////////
3// 6//