From e7eaa74d41b8d1fc067b83603148150590ecfcfa Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 5 Nov 2021 01:43:11 +0100 Subject: [PATCH] early-access version 2186 --- README.md | 2 +- src/core/arm/dynarmic/arm_dynarmic_32.h | 1 - src/core/arm/dynarmic/arm_dynarmic_64.cpp | 1 - src/core/arm/dynarmic/arm_dynarmic_cp15.cpp | 1 - src/core/arm/dynarmic/arm_dynarmic_cp15.h | 1 - .../arm/dynarmic/arm_exclusive_monitor.cpp | 2 - src/core/arm/dynarmic/arm_exclusive_monitor.h | 1 - src/core/core.cpp | 4 - src/core/core_timing.h | 1 - src/core/cpu_manager.cpp | 1 - src/core/crypto/ctr_encryption_layer.cpp | 1 - src/core/crypto/key_manager.cpp | 3 - src/core/crypto/key_manager.h | 1 - src/core/crypto/partition_data_manager.cpp | 1 - src/core/crypto/xts_encryption_layer.cpp | 1 - src/core/file_sys/card_image.cpp | 1 - src/core/file_sys/control_metadata.h | 1 - src/core/file_sys/directory.h | 1 - src/core/file_sys/nca_metadata.h | 1 - src/core/file_sys/romfs_factory.cpp | 1 - src/core/file_sys/romfs_factory.h | 3 +- src/core/file_sys/savedata_factory.h | 1 - src/core/file_sys/submission_package.cpp | 1 - .../system_archive/time_zone_binary.h | 1 - src/core/file_sys/vfs.h | 1 - src/core/file_sys/vfs_concat.h | 1 - src/core/file_sys/vfs_offset.h | 1 - src/core/frontend/applets/controller.cpp | 10 +- src/core/frontend/applets/general_frontend.h | 1 - src/core/frontend/applets/software_keyboard.h | 1 - src/core/frontend/applets/web_browser.h | 1 - src/core/frontend/emu_window.cpp | 1 - src/core/frontend/emu_window.h | 1 - src/core/hid/emulated_controller.cpp | 48 +++--- src/core/hid/emulated_controller.h | 18 +- src/core/hid/hid_types.h | 13 +- .../kernel/board/nintendo/nx/secure_monitor.h | 2 - src/core/hle/kernel/code_set.h | 1 - src/core/hle/kernel/hle_ipc.cpp | 6 - src/core/hle/kernel/init/init_slab_setup.cpp | 2 - src/core/hle/kernel/k_auto_object_container.h | 5 - src/core/hle/kernel/k_class_token.h | 1 - src/core/hle/kernel/k_client_session.cpp | 1 - src/core/hle/kernel/k_client_session.h | 2 - src/core/hle/kernel/k_condition_variable.cpp | 2 - src/core/hle/kernel/k_handle_table.h | 1 - .../hle/kernel/k_light_condition_variable.h | 1 - src/core/hle/kernel/k_light_lock.h | 1 - src/core/hle/kernel/k_memory_manager.h | 1 - src/core/hle/kernel/k_page_heap.cpp | 1 - src/core/hle/kernel/k_page_heap.h | 3 - src/core/hle/kernel/k_port.h | 1 - src/core/hle/kernel/k_process.h | 1 - src/core/hle/kernel/k_scheduler_lock.h | 1 - src/core/hle/kernel/k_scoped_lock.h | 3 +- .../k_scoped_scheduler_lock_and_sleep.h | 1 - src/core/hle/kernel/k_server_port.cpp | 1 - src/core/hle/kernel/k_server_port.h | 3 - src/core/hle/kernel/k_server_session.cpp | 2 +- src/core/hle/kernel/k_server_session.h | 3 - src/core/hle/kernel/k_session.cpp | 1 - src/core/hle/kernel/k_shared_memory.h | 1 - src/core/hle/kernel/k_shared_memory_info.h | 4 - src/core/hle/kernel/k_thread.cpp | 4 - src/core/hle/kernel/k_trace.h | 2 - src/core/hle/kernel/k_transfer_memory.h | 2 - src/core/hle/kernel/kernel.cpp | 2 - src/core/hle/kernel/physical_core.h | 1 - src/core/hle/kernel/service_thread.cpp | 4 - src/core/hle/kernel/slab_helpers.h | 8 - src/core/hle/kernel/svc.cpp | 10 -- src/core/hle/kernel/time_manager.cpp | 3 - src/core/hle/kernel/time_manager.h | 1 - src/core/hle/service/acc/acc.cpp | 2 - src/core/hle/service/am/am.cpp | 3 - .../am/applets/applet_general_backend.cpp | 2 - .../am/applets/applet_software_keyboard.h | 1 - .../service/am/applets/applet_web_browser.h | 1 - src/core/hle/service/aoc/aoc_u.cpp | 27 ++- src/core/hle/service/aoc/aoc_u.h | 3 + src/core/hle/service/apm/apm.cpp | 1 - src/core/hle/service/audio/audout_u.cpp | 1 - src/core/hle/service/audio/audren_u.cpp | 3 - src/core/hle/service/bcat/backend/backend.h | 1 - src/core/hle/service/bcat/bcat_module.cpp | 1 - src/core/hle/service/btdrv/btdrv.cpp | 1 - src/core/hle/service/btm/btm.cpp | 1 - .../hle/service/filesystem/filesystem.cpp | 1 - src/core/hle/service/glue/arp.cpp | 1 - src/core/hle/service/glue/glue_manager.h | 1 - src/core/hle/service/hid/controllers/npad.cpp | 161 +++++++++++------- src/core/hle/service/hid/controllers/npad.h | 11 +- src/core/hle/service/hid/hid.cpp | 16 +- src/core/hle/service/hid/irs.cpp | 1 - src/core/hle/service/lm/lm.cpp | 3 - src/core/hle/service/mii/raw_data.h | 1 - src/core/hle/service/nfp/nfp.cpp | 2 - src/core/hle/service/nifm/nifm.cpp | 1 - src/core/hle/service/nim/nim.cpp | 1 - src/core/hle/service/ns/language.h | 3 +- src/core/hle/service/nvdrv/devices/nvdevice.h | 3 - .../service/nvdrv/devices/nvdisp_disp0.cpp | 1 - .../service/nvdrv/devices/nvhost_as_gpu.cpp | 2 - .../service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 1 - .../hle/service/nvdrv/devices/nvhost_gpu.cpp | 1 - .../service/nvdrv/devices/nvhost_nvdec.cpp | 1 - .../nvdrv/devices/nvhost_nvdec_common.h | 1 - .../hle/service/nvdrv/devices/nvhost_vic.cpp | 1 - src/core/hle/service/nvdrv/nvdrv.cpp | 1 - .../hle/service/nvdrv/nvdrv_interface.cpp | 3 - src/core/hle/service/nvflinger/buffer_queue.h | 1 - src/core/hle/service/ptm/psm.cpp | 1 - src/core/hle/service/service.cpp | 4 - src/core/hle/service/sm/sm.cpp | 2 - src/core/hle/service/sm/sm.h | 1 - src/core/hle/service/sm/sm_controller.cpp | 2 - src/core/hle/service/sockets/bsd.cpp | 1 - .../time/local_system_clock_context_writer.h | 1 - .../time/standard_steady_clock_core.cpp | 1 - .../time/tick_based_steady_clock_core.cpp | 1 - src/core/hle/service/time/time.cpp | 2 - src/core/hle/service/time/time_manager.cpp | 2 + src/core/hle/service/time/time_manager.h | 3 - .../hle/service/time/time_sharedmemory.cpp | 1 - src/core/hle/service/time/time_sharedmemory.h | 1 - .../hle/service/time/time_zone_manager.cpp | 2 - src/core/hle/service/vi/vi.cpp | 2 - .../loader/deconstructed_rom_directory.cpp | 3 - src/core/loader/elf.cpp | 1 - src/core/loader/elf.h | 2 - src/core/loader/nax.cpp | 1 - src/core/loader/nca.cpp | 1 - src/core/loader/nca.h | 1 - src/core/loader/nsp.cpp | 1 - src/core/loader/nsp.h | 1 - src/core/loader/xci.cpp | 1 - src/core/loader/xci.h | 1 - src/core/memory/cheat_engine.cpp | 2 - src/core/network/network.h | 1 - src/core/perf_stats.cpp | 1 - src/core/tools/freezer.cpp | 2 - src/yuzu/applets/qt_controller.cpp | 65 +++---- src/yuzu/applets/qt_controller.h | 8 +- src/yuzu/applets/qt_software_keyboard.cpp | 14 +- .../configuration/configure_input_player.cpp | 87 +++++----- .../configuration/configure_input_player.h | 8 +- .../configuration/configure_input_player.ui | 15 +- .../configure_input_player_widget.cpp | 18 +- .../configure_input_player_widget.h | 2 +- src/yuzu/main.cpp | 5 +- 150 files changed, 307 insertions(+), 447 deletions(-) diff --git a/README.md b/README.md index 2ca30a9c0..ea41b84ac 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2185. +This is the source code for early-access 2186. ## Legal Notice diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.h b/src/core/arm/dynarmic/arm_dynarmic_32.h index 063605b46..5d47b600d 100755 --- a/src/core/arm/dynarmic/arm_dynarmic_32.h +++ b/src/core/arm/dynarmic/arm_dynarmic_32.h @@ -9,7 +9,6 @@ #include #include -#include #include "common/common_types.h" #include "common/hash.h" #include "core/arm/arm_interface.h" diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 4fd15f111..4e73cc03a 100755 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -18,7 +18,6 @@ #include "core/core_timing.h" #include "core/hardware_properties.h" #include "core/hle/kernel/k_process.h" -#include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/svc.h" #include "core/memory.h" diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp index ebd506121..a043e6735 100755 --- a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp @@ -8,7 +8,6 @@ #include "core/arm/dynarmic/arm_dynarmic_cp15.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" using Callback = Dynarmic::A32::Coprocessor::Callback; using CallbackOrAccessOneWord = Dynarmic::A32::Coprocessor::CallbackOrAccessOneWord; diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.h b/src/core/arm/dynarmic/arm_dynarmic_cp15.h index 7c7ede79e..f271b2070 100755 --- a/src/core/arm/dynarmic/arm_dynarmic_cp15.h +++ b/src/core/arm/dynarmic/arm_dynarmic_cp15.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include diff --git a/src/core/arm/dynarmic/arm_exclusive_monitor.cpp b/src/core/arm/dynarmic/arm_exclusive_monitor.cpp index 9426a3edf..397d054a8 100755 --- a/src/core/arm/dynarmic/arm_exclusive_monitor.cpp +++ b/src/core/arm/dynarmic/arm_exclusive_monitor.cpp @@ -2,8 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include -#include #include "core/arm/dynarmic/arm_exclusive_monitor.h" #include "core/memory.h" diff --git a/src/core/arm/dynarmic/arm_exclusive_monitor.h b/src/core/arm/dynarmic/arm_exclusive_monitor.h index 73d41f223..265c4ecef 100755 --- a/src/core/arm/dynarmic/arm_exclusive_monitor.h +++ b/src/core/arm/dynarmic/arm_exclusive_monitor.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include diff --git a/src/core/core.cpp b/src/core/core.cpp index 0fffd6d57..3b77533b4 100755 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -19,21 +19,17 @@ #include "core/cpu_manager.h" #include "core/device_memory.h" #include "core/file_sys/bis_factory.h" -#include "core/file_sys/card_image.h" #include "core/file_sys/mode.h" #include "core/file_sys/patch_manager.h" #include "core/file_sys/registered_cache.h" #include "core/file_sys/romfs_factory.h" #include "core/file_sys/savedata_factory.h" -#include "core/file_sys/sdmc_factory.h" #include "core/file_sys/vfs_concat.h" #include "core/file_sys/vfs_real.h" #include "core/hardware_interrupt_manager.h" #include "core/hid/hid_core.h" -#include "core/hle/kernel/k_client_port.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_scheduler.h" -#include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/physical_core.h" #include "core/hle/service/am/applets/applets.h" diff --git a/src/core/core_timing.h b/src/core/core_timing.h index b64caacda..888828fd0 100755 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp index 77efcabf0..5d43c6e5d 100755 --- a/src/core/cpu_manager.cpp +++ b/src/core/cpu_manager.cpp @@ -6,7 +6,6 @@ #include "common/microprofile.h" #include "common/scope_exit.h" #include "common/thread.h" -#include "core/arm/exclusive_monitor.h" #include "core/core.h" #include "core/core_timing.h" #include "core/cpu_manager.h" diff --git a/src/core/crypto/ctr_encryption_layer.cpp b/src/core/crypto/ctr_encryption_layer.cpp index 1231da8e3..3a2af4f50 100755 --- a/src/core/crypto/ctr_encryption_layer.cpp +++ b/src/core/crypto/ctr_encryption_layer.cpp @@ -4,7 +4,6 @@ #include #include -#include "common/assert.h" #include "core/crypto/ctr_encryption_layer.h" namespace Core::Crypto { diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index a98daed89..9244907b5 100755 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -10,14 +10,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include "common/common_funcs.h" #include "common/fs/file.h" #include "common/fs/fs.h" #include "common/fs/path_util.h" @@ -30,7 +28,6 @@ #include "core/crypto/partition_data_manager.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/nca_metadata.h" -#include "core/file_sys/partition_filesystem.h" #include "core/file_sys/registered_cache.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/loader.h" diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h index e771625e1..ac1eb8962 100755 --- a/src/core/crypto/key_manager.h +++ b/src/core/crypto/key_manager.h @@ -15,7 +15,6 @@ #include "common/common_funcs.h" #include "common/common_types.h" #include "core/crypto/partition_data_manager.h" -#include "core/file_sys/vfs_types.h" namespace Common::FS { class IOFile; diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cpp index 5f1c86a09..d18252a54 100755 --- a/src/core/crypto/partition_data_manager.cpp +++ b/src/core/crypto/partition_data_manager.cpp @@ -12,7 +12,6 @@ #include #include #include -#include "common/assert.h" #include "common/common_funcs.h" #include "common/common_types.h" #include "common/hex_util.h" diff --git a/src/core/crypto/xts_encryption_layer.cpp b/src/core/crypto/xts_encryption_layer.cpp index 8f0ba4ee7..c2b7ea309 100755 --- a/src/core/crypto/xts_encryption_layer.cpp +++ b/src/core/crypto/xts_encryption_layer.cpp @@ -4,7 +4,6 @@ #include #include -#include "common/assert.h" #include "core/crypto/xts_encryption_layer.h" namespace Core::Crypto { diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index 755d3303e..c6300be59 100755 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp @@ -14,7 +14,6 @@ #include "core/file_sys/nca_metadata.h" #include "core/file_sys/partition_filesystem.h" #include "core/file_sys/submission_package.h" -#include "core/file_sys/vfs_concat.h" #include "core/file_sys/vfs_offset.h" #include "core/file_sys/vfs_vector.h" #include "core/loader/loader.h" diff --git a/src/core/file_sys/control_metadata.h b/src/core/file_sys/control_metadata.h index af2b723df..3e0b45630 100755 --- a/src/core/file_sys/control_metadata.h +++ b/src/core/file_sys/control_metadata.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/core/file_sys/directory.h b/src/core/file_sys/directory.h index 0d73eecc9..21c7aefc8 100755 --- a/src/core/file_sys/directory.h +++ b/src/core/file_sys/directory.h @@ -6,7 +6,6 @@ #include #include -#include #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/core/file_sys/nca_metadata.h b/src/core/file_sys/nca_metadata.h index ce1138a17..75c74ae28 100755 --- a/src/core/file_sys/nca_metadata.h +++ b/src/core/file_sys/nca_metadata.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index 3d9ce863b..291b746b6 100755 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -6,7 +6,6 @@ #include "common/assert.h" #include "common/common_types.h" #include "common/logging/log.h" -#include "core/file_sys/card_image.h" #include "core/file_sys/common_funcs.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/nca_metadata.h" diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h index 39db09e4e..2c93a49a5 100755 --- a/src/core/file_sys/romfs_factory.h +++ b/src/core/file_sys/romfs_factory.h @@ -5,8 +5,9 @@ #pragma once #include + #include "common/common_types.h" -#include "core/file_sys/vfs.h" +#include "core/file_sys/vfs_types.h" #include "core/hle/result.h" namespace Loader { diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 1d8dc981f..de415b0c4 100755 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h @@ -8,7 +8,6 @@ #include #include "common/common_funcs.h" #include "common/common_types.h" -#include "common/swap.h" #include "core/file_sys/vfs.h" #include "core/hle/result.h" diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp index f192dffa5..f03124e3d 100755 --- a/src/core/file_sys/submission_package.cpp +++ b/src/core/file_sys/submission_package.cpp @@ -4,7 +4,6 @@ #include #include -#include #include diff --git a/src/core/file_sys/system_archive/time_zone_binary.h b/src/core/file_sys/system_archive/time_zone_binary.h index ed2b78227..266c23537 100755 --- a/src/core/file_sys/system_archive/time_zone_binary.h +++ b/src/core/file_sys/system_archive/time_zone_binary.h @@ -4,7 +4,6 @@ #pragma once -#include #include "core/file_sys/vfs_types.h" namespace FileSys::SystemArchive { diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h index ff6935da6..3e625fad6 100755 --- a/src/core/file_sys/vfs.h +++ b/src/core/file_sys/vfs.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include diff --git a/src/core/file_sys/vfs_concat.h b/src/core/file_sys/vfs_concat.h index cd32960a5..bd091451e 100755 --- a/src/core/file_sys/vfs_concat.h +++ b/src/core/file_sys/vfs_concat.h @@ -6,7 +6,6 @@ #include #include -#include #include "core/file_sys/vfs.h" namespace FileSys { diff --git a/src/core/file_sys/vfs_offset.h b/src/core/file_sys/vfs_offset.h index 42f78b3d9..7ce1eb336 100755 --- a/src/core/file_sys/vfs_offset.h +++ b/src/core/file_sys/vfs_offset.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include "core/file_sys/vfs.h" diff --git a/src/core/frontend/applets/controller.cpp b/src/core/frontend/applets/controller.cpp index 212ace892..6dbd38ffa 100755 --- a/src/core/frontend/applets/controller.cpp +++ b/src/core/frontend/applets/controller.cpp @@ -44,26 +44,26 @@ void DefaultControllerApplet::ReconfigureControllers(std::function callb // Connect controllers based on the following priority list from highest to lowest priority: // Pro Controller -> Dual Joycons -> Left Joycon/Right Joycon -> Handheld if (parameters.allow_pro_controller) { - controller->SetNpadType(Core::HID::NpadType::ProController); + controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); controller->Connect(); } else if (parameters.allow_dual_joycons) { - controller->SetNpadType(Core::HID::NpadType::JoyconDual); + controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::JoyconDual); controller->Connect(); } else if (parameters.allow_left_joycon && parameters.allow_right_joycon) { // Assign left joycons to even player indices and right joycons to odd player indices. // We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and // a right Joycon for Player 2 in 2 Player Assist mode. if (index % 2 == 0) { - controller->SetNpadType(Core::HID::NpadType::JoyconLeft); + controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::JoyconLeft); controller->Connect(); } else { - controller->SetNpadType(Core::HID::NpadType::JoyconRight); + controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::JoyconRight); controller->Connect(); } } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld && !Settings::values.use_docked_mode.GetValue()) { // We should *never* reach here under any normal circumstances. - controller->SetNpadType(Core::HID::NpadType::Handheld); + controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); controller->Connect(); } else { UNREACHABLE_MSG("Unable to add a new controller based on the given parameters!"); diff --git a/src/core/frontend/applets/general_frontend.h b/src/core/frontend/applets/general_frontend.h index b713b14ee..1647aa975 100755 --- a/src/core/frontend/applets/general_frontend.h +++ b/src/core/frontend/applets/general_frontend.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include "common/common_types.h" namespace Core::Frontend { diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h index 228a548d4..29109306b 100755 --- a/src/core/frontend/applets/software_keyboard.h +++ b/src/core/frontend/applets/software_keyboard.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include "common/common_types.h" diff --git a/src/core/frontend/applets/web_browser.h b/src/core/frontend/applets/web_browser.h index 915dde677..b6a60c994 100755 --- a/src/core/frontend/applets/web_browser.h +++ b/src/core/frontend/applets/web_browser.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include "core/hle/service/am/applets/applet_web_browser_types.h" diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 2d64121ec..57c6ffc43 100755 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include "core/frontend/emu_window.h" diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index fbbaf7796..e413a520a 100755 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include #include "common/common_types.h" #include "core/frontend/framebuffer_layout.h" diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 6fe3744fd..a9038e06f 100755 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -13,38 +13,38 @@ EmulatedController::EmulatedController(NpadIdType npad_id_type_) : npad_id_type( EmulatedController::~EmulatedController() = default; -NpadType EmulatedController::MapSettingsTypeToNPad(Settings::ControllerType type) { +NpadStyleIndex EmulatedController::MapSettingsTypeToNPad(Settings::ControllerType type) { switch (type) { case Settings::ControllerType::ProController: - return NpadType::ProController; + return NpadStyleIndex::ProController; case Settings::ControllerType::DualJoyconDetached: - return NpadType::JoyconDual; + return NpadStyleIndex::JoyconDual; case Settings::ControllerType::LeftJoycon: - return NpadType::JoyconLeft; + return NpadStyleIndex::JoyconLeft; case Settings::ControllerType::RightJoycon: - return NpadType::JoyconRight; + return NpadStyleIndex::JoyconRight; case Settings::ControllerType::Handheld: - return NpadType::Handheld; + return NpadStyleIndex::Handheld; case Settings::ControllerType::GameCube: - return NpadType::GameCube; + return NpadStyleIndex::GameCube; default: - return NpadType::ProController; + return NpadStyleIndex::ProController; } } -Settings::ControllerType EmulatedController::MapNPadToSettingsType(NpadType type) { +Settings::ControllerType EmulatedController::MapNPadToSettingsType(NpadStyleIndex type) { switch (type) { - case NpadType::ProController: + case NpadStyleIndex::ProController: return Settings::ControllerType::ProController; - case NpadType::JoyconDual: + case NpadStyleIndex::JoyconDual: return Settings::ControllerType::DualJoyconDetached; - case NpadType::JoyconLeft: + case NpadStyleIndex::JoyconLeft: return Settings::ControllerType::LeftJoycon; - case NpadType::JoyconRight: + case NpadStyleIndex::JoyconRight: return Settings::ControllerType::RightJoycon; - case NpadType::Handheld: + case NpadStyleIndex::Handheld: return Settings::ControllerType::Handheld; - case NpadType::GameCube: + case NpadStyleIndex::GameCube: return Settings::ControllerType::GameCube; default: return Settings::ControllerType::ProController; @@ -79,9 +79,9 @@ void EmulatedController::ReloadFromSettings() { // Other or debug controller should always be a pro controller if (npad_id_type != NpadIdType::Other) { - SetNpadType(MapSettingsTypeToNPad(player.controller_type)); + SetNpadStyleIndex(MapSettingsTypeToNPad(player.controller_type)); } else { - SetNpadType(NpadType::ProController); + SetNpadStyleIndex(NpadStyleIndex::ProController); } if (player.connected) { @@ -306,7 +306,7 @@ void EmulatedController::DisableConfiguration() { if (is_connected) { Disconnect(); } - SetNpadType(tmp_npad_type); + SetNpadStyleIndex(tmp_npad_type); } // Apply temporary connected status to the real controller @@ -569,10 +569,10 @@ void EmulatedController::SetButton(Common::Input::CallbackStatus callback, std:: } } if (!is_connected) { - if (npad_id_type == NpadIdType::Player1 && npad_type != NpadType::Handheld) { + if (npad_id_type == NpadIdType::Player1 && npad_type != NpadStyleIndex::Handheld) { Connect(); } - if (npad_id_type == NpadIdType::Handheld && npad_type == NpadType::Handheld) { + if (npad_id_type == NpadIdType::Handheld && npad_type == NpadStyleIndex::Handheld) { Connect(); } } @@ -880,7 +880,7 @@ void EmulatedController::Disconnect() { } bool EmulatedController::IsConnected(bool get_temporary_value) const { - if (get_temporary_value) { + if (get_temporary_value && is_configuring) { return tmp_is_connected; } return is_connected; @@ -896,14 +896,14 @@ NpadIdType EmulatedController::GetNpadIdType() const { return npad_id_type; } -NpadType EmulatedController::GetNpadType(bool get_temporary_value) const { - if (get_temporary_value) { +NpadStyleIndex EmulatedController::GetNpadStyleIndex(bool get_temporary_value) const { + if (get_temporary_value && is_configuring) { return tmp_npad_type; } return npad_type; } -void EmulatedController::SetNpadType(NpadType npad_type_) { +void EmulatedController::SetNpadStyleIndex(NpadStyleIndex npad_type_) { { std::lock_guard lock{mutex}; diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index 9a8bdf14d..fa2e89c0b 100755 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h @@ -142,23 +142,23 @@ public: YUZU_NON_MOVEABLE(EmulatedController); /// Converts the controller type from settings to npad type - static NpadType MapSettingsTypeToNPad(Settings::ControllerType type); + static NpadStyleIndex MapSettingsTypeToNPad(Settings::ControllerType type); /// Converts npad type to the equivalent of controller type from settings - static Settings::ControllerType MapNPadToSettingsType(NpadType type); + static Settings::ControllerType MapNPadToSettingsType(NpadStyleIndex type); /// Gets the NpadIdType for this controller NpadIdType GetNpadIdType() const; - /// Sets the NpadType for this controller - void SetNpadType(NpadType npad_type_); + /// Sets the NpadStyleIndex for this controller + void SetNpadStyleIndex(NpadStyleIndex npad_type_); /** - * Gets the NpadType for this controller + * Gets the NpadStyleIndex for this controller * @param If true tmp_npad_type will be returned - * @return NpadType set on the controller + * @return NpadStyleIndex set on the controller */ - NpadType GetNpadType(bool get_temporary_value = false) const; + NpadStyleIndex GetNpadStyleIndex(bool get_temporary_value = false) const; /// Sets the connected status to true void Connect(); @@ -351,14 +351,14 @@ private: void TriggerOnChange(ControllerTriggerType type, bool is_service_update); NpadIdType npad_id_type; - NpadType npad_type{NpadType::None}; + NpadStyleIndex npad_type{NpadStyleIndex::None}; bool is_connected{false}; bool is_configuring{false}; f32 motion_sensitivity{0.01f}; bool force_update_motion{false}; // Temporary values to avoid doing changes while the controller is on configuration mode - NpadType tmp_npad_type{NpadType::None}; + NpadStyleIndex tmp_npad_type{NpadStyleIndex::None}; bool tmp_is_connected{false}; ButtonParams button_params; diff --git a/src/core/hid/hid_types.h b/src/core/hid/hid_types.h index f8a0d5edd..22177b5ed 100755 --- a/src/core/hid/hid_types.h +++ b/src/core/hid/hid_types.h @@ -84,17 +84,24 @@ constexpr NpadIdType IndexToNpadIdType(size_t index) { } } -// This is nn::hid::NpadType -enum class NpadType : u8 { +// This is nn::hid::NpadStyleIndex +enum class NpadStyleIndex : u8 { None = 0, ProController = 3, Handheld = 4, + HandheldNES = 4, JoyconDual = 5, JoyconLeft = 6, JoyconRight = 7, GameCube = 8, Pokeball = 9, - MaxNpadType = 10, + NES = 10, + SNES = 12, + N64 = 13, + SegaGenesis = 14, + SystemExt = 32, + System = 33, + MaxNpadType = 34, }; // This is nn::hid::NpadStyleTag diff --git a/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h b/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h index 0c366b252..f77a91dec 100755 --- a/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h +++ b/src/core/hle/kernel/board/nintendo/nx/secure_monitor.h @@ -4,8 +4,6 @@ #pragma once -#include "common/common_types.h" - namespace Kernel::Board::Nintendo::Nx::Smc { enum MemorySize { diff --git a/src/core/hle/kernel/code_set.h b/src/core/hle/kernel/code_set.h index d8ad54030..5cc3b9829 100755 --- a/src/core/hle/kernel/code_set.h +++ b/src/core/hle/kernel/code_set.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include "common/common_types.h" #include "core/hle/kernel/physical_memory.h" diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index cee96dd9b..e19544c54 100755 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include @@ -19,14 +18,9 @@ #include "core/hle/kernel/k_handle_table.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_readable_event.h" -#include "core/hle/kernel/k_scheduler.h" -#include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h" #include "core/hle/kernel/k_server_session.h" #include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/k_writable_event.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/svc_results.h" -#include "core/hle/kernel/time_manager.h" #include "core/memory.h" namespace Kernel { diff --git a/src/core/hle/kernel/init/init_slab_setup.cpp b/src/core/hle/kernel/init/init_slab_setup.cpp index 10edede17..8ff0f695d 100755 --- a/src/core/hle/kernel/init/init_slab_setup.cpp +++ b/src/core/hle/kernel/init/init_slab_setup.cpp @@ -20,8 +20,6 @@ #include "core/hle/kernel/k_system_control.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/k_transfer_memory.h" -#include "core/hle/kernel/memory_types.h" -#include "core/memory.h" namespace Kernel::Init { diff --git a/src/core/hle/kernel/k_auto_object_container.h b/src/core/hle/kernel/k_auto_object_container.h index 459953450..4eadfe99d 100755 --- a/src/core/hle/kernel/k_auto_object_container.h +++ b/src/core/hle/kernel/k_auto_object_container.h @@ -4,14 +4,9 @@ #pragma once -#include - #include -#include "common/assert.h" #include "common/common_funcs.h" -#include "common/common_types.h" -#include "common/intrusive_red_black_tree.h" #include "core/hle/kernel/k_auto_object.h" #include "core/hle/kernel/k_light_lock.h" diff --git a/src/core/hle/kernel/k_class_token.h b/src/core/hle/kernel/k_class_token.h index c28db49ec..980010150 100755 --- a/src/core/hle/kernel/k_class_token.h +++ b/src/core/hle/kernel/k_class_token.h @@ -6,7 +6,6 @@ #include -#include "common/assert.h" #include "common/bit_util.h" #include "common/common_types.h" diff --git a/src/core/hle/kernel/k_client_session.cpp b/src/core/hle/kernel/k_client_session.cpp index 8ad1be762..242582f8f 100755 --- a/src/core/hle/kernel/k_client_session.cpp +++ b/src/core/hle/kernel/k_client_session.cpp @@ -7,7 +7,6 @@ #include "core/hle/kernel/k_server_session.h" #include "core/hle/kernel/k_session.h" #include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/svc_results.h" #include "core/hle/result.h" namespace Kernel { diff --git a/src/core/hle/kernel/k_client_session.h b/src/core/hle/kernel/k_client_session.h index 230e3b6b8..ad6cc4ed1 100755 --- a/src/core/hle/kernel/k_client_session.h +++ b/src/core/hle/kernel/k_client_session.h @@ -4,11 +4,9 @@ #pragma once -#include #include #include "core/hle/kernel/k_auto_object.h" -#include "core/hle/kernel/k_synchronization_object.h" #include "core/hle/kernel/slab_helpers.h" #include "core/hle/result.h" diff --git a/src/core/hle/kernel/k_condition_variable.cpp b/src/core/hle/kernel/k_condition_variable.cpp index ef14ad1d2..7fa9b8cc3 100755 --- a/src/core/hle/kernel/k_condition_variable.cpp +++ b/src/core/hle/kernel/k_condition_variable.cpp @@ -2,8 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include - #include "core/arm/exclusive_monitor.h" #include "core/core.h" #include "core/hle/kernel/k_condition_variable.h" diff --git a/src/core/hle/kernel/k_handle_table.h b/src/core/hle/kernel/k_handle_table.h index 2ff6aa160..95ec905ae 100755 --- a/src/core/hle/kernel/k_handle_table.h +++ b/src/core/hle/kernel/k_handle_table.h @@ -8,7 +8,6 @@ #include "common/assert.h" #include "common/bit_field.h" -#include "common/bit_util.h" #include "common/common_types.h" #include "core/hle/kernel/k_auto_object.h" #include "core/hle/kernel/k_spin_lock.h" diff --git a/src/core/hle/kernel/k_light_condition_variable.h b/src/core/hle/kernel/k_light_condition_variable.h index a95fa41f3..fb0ad783a 100755 --- a/src/core/hle/kernel/k_light_condition_variable.h +++ b/src/core/hle/kernel/k_light_condition_variable.h @@ -10,7 +10,6 @@ #include "common/common_types.h" #include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h" -#include "core/hle/kernel/k_thread_queue.h" #include "core/hle/kernel/time_manager.h" namespace Kernel { diff --git a/src/core/hle/kernel/k_light_lock.h b/src/core/hle/kernel/k_light_lock.h index f4c45f76a..ad853661d 100755 --- a/src/core/hle/kernel/k_light_lock.h +++ b/src/core/hle/kernel/k_light_lock.h @@ -6,7 +6,6 @@ #include -#include "common/common_types.h" #include "core/hle/kernel/k_scoped_lock.h" namespace Kernel { diff --git a/src/core/hle/kernel/k_memory_manager.h b/src/core/hle/kernel/k_memory_manager.h index ac840b3d0..39badc5f1 100755 --- a/src/core/hle/kernel/k_memory_manager.h +++ b/src/core/hle/kernel/k_memory_manager.h @@ -8,7 +8,6 @@ #include #include -#include "common/common_funcs.h" #include "common/common_types.h" #include "core/hle/kernel/k_page_heap.h" #include "core/hle/result.h" diff --git a/src/core/hle/kernel/k_page_heap.cpp b/src/core/hle/kernel/k_page_heap.cpp index 07e062922..29d996d62 100755 --- a/src/core/hle/kernel/k_page_heap.cpp +++ b/src/core/hle/kernel/k_page_heap.cpp @@ -4,7 +4,6 @@ #include "core/core.h" #include "core/hle/kernel/k_page_heap.h" -#include "core/memory.h" namespace Kernel { diff --git a/src/core/hle/kernel/k_page_heap.h b/src/core/hle/kernel/k_page_heap.h index de5d6a189..8d9f30523 100755 --- a/src/core/hle/kernel/k_page_heap.h +++ b/src/core/hle/kernel/k_page_heap.h @@ -5,12 +5,9 @@ #pragma once #include -#include #include #include "common/alignment.h" -#include "common/assert.h" -#include "common/common_funcs.h" #include "common/common_types.h" #include "core/hle/kernel/k_page_bitmap.h" #include "core/hle/kernel/memory_types.h" diff --git a/src/core/hle/kernel/k_port.h b/src/core/hle/kernel/k_port.h index 4018ea2df..b6e4a1fcd 100755 --- a/src/core/hle/kernel/k_port.h +++ b/src/core/hle/kernel/k_port.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include "common/common_types.h" diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h index 1a53e2be7..76ece119f 100755 --- a/src/core/hle/kernel/k_process.h +++ b/src/core/hle/kernel/k_process.h @@ -8,7 +8,6 @@ #include #include #include -#include #include #include "common/common_types.h" #include "core/hle/kernel/k_address_arbiter.h" diff --git a/src/core/hle/kernel/k_scheduler_lock.h b/src/core/hle/kernel/k_scheduler_lock.h index 47e315555..c571f2992 100755 --- a/src/core/hle/kernel/k_scheduler_lock.h +++ b/src/core/hle/kernel/k_scheduler_lock.h @@ -5,7 +5,6 @@ #pragma once #include "common/assert.h" -#include "core/hardware_properties.h" #include "core/hle/kernel/k_spin_lock.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" diff --git a/src/core/hle/kernel/k_scoped_lock.h b/src/core/hle/kernel/k_scoped_lock.h index 4fb180fc6..89a7ffe49 100755 --- a/src/core/hle/kernel/k_scoped_lock.h +++ b/src/core/hle/kernel/k_scoped_lock.h @@ -7,7 +7,8 @@ #pragma once -#include "common/common_types.h" +#include +#include namespace Kernel { diff --git a/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h b/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h index f6c75f2d9..61dc2858f 100755 --- a/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h +++ b/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h @@ -8,7 +8,6 @@ #pragma once #include "common/common_types.h" -#include "core/hle/kernel/k_handle_table.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/time_manager.h" diff --git a/src/core/hle/kernel/k_server_port.cpp b/src/core/hle/kernel/k_server_port.cpp index c5dc58387..433fc98e1 100755 --- a/src/core/hle/kernel/k_server_port.cpp +++ b/src/core/hle/kernel/k_server_port.cpp @@ -10,7 +10,6 @@ #include "core/hle/kernel/k_server_port.h" #include "core/hle/kernel/k_server_session.h" #include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/svc_results.h" namespace Kernel { diff --git a/src/core/hle/kernel/k_server_port.h b/src/core/hle/kernel/k_server_port.h index 67a36da40..6302d5e61 100755 --- a/src/core/hle/kernel/k_server_port.h +++ b/src/core/hle/kernel/k_server_port.h @@ -7,14 +7,11 @@ #include #include #include -#include #include -#include "common/common_types.h" #include "core/hle/kernel/k_server_session.h" #include "core/hle/kernel/k_synchronization_object.h" -#include "core/hle/result.h" namespace Kernel { diff --git a/src/core/hle/kernel/k_server_session.cpp b/src/core/hle/kernel/k_server_session.cpp index b9f24475c..2bd53ccbd 100755 --- a/src/core/hle/kernel/k_server_session.cpp +++ b/src/core/hle/kernel/k_server_session.cpp @@ -14,7 +14,6 @@ #include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/k_client_port.h" #include "core/hle/kernel/k_handle_table.h" -#include "core/hle/kernel/k_port.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/k_server_port.h" @@ -22,6 +21,7 @@ #include "core/hle/kernel/k_session.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/service_thread.h" #include "core/memory.h" namespace Kernel { diff --git a/src/core/hle/kernel/k_server_session.h b/src/core/hle/kernel/k_server_session.h index d44bc9d4f..5b76bf17c 100755 --- a/src/core/hle/kernel/k_server_session.h +++ b/src/core/hle/kernel/k_server_session.h @@ -7,14 +7,11 @@ #include #include #include -#include #include -#include "common/threadsafe_queue.h" #include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/k_synchronization_object.h" -#include "core/hle/kernel/service_thread.h" #include "core/hle/result.h" namespace Core::Memory { diff --git a/src/core/hle/kernel/k_session.cpp b/src/core/hle/kernel/k_session.cpp index 940878e03..a64b56b9e 100755 --- a/src/core/hle/kernel/k_session.cpp +++ b/src/core/hle/kernel/k_session.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/assert.h" #include "core/hle/kernel/k_client_port.h" #include "core/hle/kernel/k_client_session.h" #include "core/hle/kernel/k_scoped_resource_reservation.h" diff --git a/src/core/hle/kernel/k_shared_memory.h b/src/core/hle/kernel/k_shared_memory.h index e9815f90b..81de36136 100755 --- a/src/core/hle/kernel/k_shared_memory.h +++ b/src/core/hle/kernel/k_shared_memory.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include "common/common_types.h" diff --git a/src/core/hle/kernel/k_shared_memory_info.h b/src/core/hle/kernel/k_shared_memory_info.h index bf97a0184..20bc19f46 100755 --- a/src/core/hle/kernel/k_shared_memory_info.h +++ b/src/core/hle/kernel/k_shared_memory_info.h @@ -4,12 +4,8 @@ #pragma once -#include -#include - #include -#include "common/assert.h" #include "core/hle/kernel/slab_helpers.h" namespace Kernel { diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index 9f1d3156b..db65ce79a 100755 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp @@ -13,8 +13,6 @@ #include "common/common_types.h" #include "common/fiber.h" #include "common/logging/log.h" -#include "common/scope_exit.h" -#include "common/thread_queue_list.h" #include "core/core.h" #include "core/cpu_manager.h" #include "core/hardware_properties.h" @@ -31,11 +29,9 @@ #include "core/hle/kernel/svc_results.h" #include "core/hle/kernel/time_manager.h" #include "core/hle/result.h" -#include "core/memory.h" #ifdef ARCHITECTURE_x86_64 #include "core/arm/dynarmic/arm_dynarmic_32.h" -#include "core/arm/dynarmic/arm_dynarmic_64.h" #endif namespace { diff --git a/src/core/hle/kernel/k_trace.h b/src/core/hle/kernel/k_trace.h index 79391bccb..d3fed1888 100755 --- a/src/core/hle/kernel/k_trace.h +++ b/src/core/hle/kernel/k_trace.h @@ -4,8 +4,6 @@ #pragma once -#include "common/common_funcs.h" - namespace Kernel { using namespace Common::Literals; diff --git a/src/core/hle/kernel/k_transfer_memory.h b/src/core/hle/kernel/k_transfer_memory.h index 31029a5c2..cb7521823 100755 --- a/src/core/hle/kernel/k_transfer_memory.h +++ b/src/core/hle/kernel/k_transfer_memory.h @@ -4,8 +4,6 @@ #pragma once -#include - #include "core/hle/kernel/slab_helpers.h" #include "core/hle/kernel/svc_types.h" #include "core/hle/result.h" diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 4a139c5e7..e42a6d36f 100755 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -39,9 +39,7 @@ #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/physical_core.h" #include "core/hle/kernel/service_thread.h" -#include "core/hle/kernel/svc_results.h" #include "core/hle/kernel/time_manager.h" -#include "core/hle/lock.h" #include "core/hle/result.h" #include "core/hle/service/sm/sm.h" #include "core/memory.h" diff --git a/src/core/hle/kernel/physical_core.h b/src/core/hle/kernel/physical_core.h index 901f7e3b0..16a032e89 100755 --- a/src/core/hle/kernel/physical_core.h +++ b/src/core/hle/kernel/physical_core.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include diff --git a/src/core/hle/kernel/service_thread.cpp b/src/core/hle/kernel/service_thread.cpp index 2ae80beca..6721b6276 100755 --- a/src/core/hle/kernel/service_thread.cpp +++ b/src/core/hle/kernel/service_thread.cpp @@ -9,15 +9,11 @@ #include #include -#include "common/assert.h" #include "common/scope_exit.h" #include "common/thread.h" -#include "core/core.h" #include "core/hle/kernel/k_session.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/service_thread.h" -#include "core/hle/lock.h" -#include "video_core/renderer_base.h" namespace Kernel { diff --git a/src/core/hle/kernel/slab_helpers.h b/src/core/hle/kernel/slab_helpers.h index 0c5995db0..f1c11256e 100755 --- a/src/core/hle/kernel/slab_helpers.h +++ b/src/core/hle/kernel/slab_helpers.h @@ -4,16 +4,8 @@ #pragma once -#include - -#include "common/assert.h" -#include "common/common_funcs.h" -#include "common/common_types.h" -#include "common/intrusive_red_black_tree.h" #include "core/hle/kernel/k_auto_object.h" #include "core/hle/kernel/k_auto_object_container.h" -#include "core/hle/kernel/k_light_lock.h" -#include "core/hle/kernel/k_slab_heap.h" #include "core/hle/kernel/kernel.h" namespace Kernel { diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index f328ce111..fbfe6fc1a 100755 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -13,18 +13,11 @@ #include "common/common_funcs.h" #include "common/fiber.h" #include "common/logging/log.h" -#include "common/microprofile.h" #include "common/scope_exit.h" -#include "common/string_util.h" -#include "core/arm/exclusive_monitor.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" -#include "core/cpu_manager.h" -#include "core/hle/kernel/k_address_arbiter.h" #include "core/hle/kernel/k_client_port.h" #include "core/hle/kernel/k_client_session.h" -#include "core/hle/kernel/k_condition_variable.h" #include "core/hle/kernel/k_event.h" #include "core/hle/kernel/k_handle_table.h" #include "core/hle/kernel/k_memory_block.h" @@ -35,7 +28,6 @@ #include "core/hle/kernel/k_resource_limit.h" #include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/k_scoped_resource_reservation.h" -#include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h" #include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/k_synchronization_object.h" #include "core/hle/kernel/k_thread.h" @@ -47,10 +39,8 @@ #include "core/hle/kernel/svc_results.h" #include "core/hle/kernel/svc_types.h" #include "core/hle/kernel/svc_wrap.h" -#include "core/hle/kernel/time_manager.h" #include "core/hle/lock.h" #include "core/hle/result.h" -#include "core/hle/service/service.h" #include "core/memory.h" #include "core/reporter.h" diff --git a/src/core/hle/kernel/time_manager.cpp b/src/core/hle/kernel/time_manager.cpp index ae9b4be2f..8cd7279a3 100755 --- a/src/core/hle/kernel/time_manager.cpp +++ b/src/core/hle/kernel/time_manager.cpp @@ -5,10 +5,7 @@ #include "common/assert.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" -#include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/time_manager.h" namespace Kernel { diff --git a/src/core/hle/kernel/time_manager.h b/src/core/hle/kernel/time_manager.h index 2d175a9c4..b1fa26e8c 100755 --- a/src/core/hle/kernel/time_manager.h +++ b/src/core/hle/kernel/time_manager.h @@ -6,7 +6,6 @@ #include #include -#include namespace Core { class System; diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index e1d01e5b4..4af2c3a8d 100755 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -26,9 +26,7 @@ #include "core/hle/service/acc/async_context.h" #include "core/hle/service/acc/errors.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/hle/service/glue/arp.h" #include "core/hle/service/glue/glue_manager.h" -#include "core/hle/service/sm/sm.h" #include "core/loader/loader.h" namespace Service::Account { diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 2767e4336..641f51f96 100755 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -17,13 +17,11 @@ #include "core/hle/kernel/k_event.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_transfer_memory.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/acc/profile_manager.h" #include "core/hle/service/am/am.h" #include "core/hle/service/am/applet_ae.h" #include "core/hle/service/am/applet_oe.h" #include "core/hle/service/am/applets/applet_profile_select.h" -#include "core/hle/service/am/applets/applet_software_keyboard.h" #include "core/hle/service/am/applets/applet_web_browser.h" #include "core/hle/service/am/applets/applets.h" #include "core/hle/service/am/idle.h" @@ -37,7 +35,6 @@ #include "core/hle/service/ns/ns.h" #include "core/hle/service/nvflinger/nvflinger.h" #include "core/hle/service/pm/pm.h" -#include "core/hle/service/set/set.h" #include "core/hle/service/sm/sm.h" #include "core/hle/service/vi/vi.h" #include "core/memory.h" diff --git a/src/core/hle/service/am/applets/applet_general_backend.cpp b/src/core/hle/service/am/applets/applet_general_backend.cpp index 0f413f9a0..770a8eef2 100755 --- a/src/core/hle/service/am/applets/applet_general_backend.cpp +++ b/src/core/hle/service/am/applets/applet_general_backend.cpp @@ -2,8 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include - #include "common/assert.h" #include "common/hex_util.h" #include "common/logging/log.h" diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.h b/src/core/hle/service/am/applets/applet_software_keyboard.h index 9aef1bf11..6009c10c7 100755 --- a/src/core/hle/service/am/applets/applet_software_keyboard.h +++ b/src/core/hle/service/am/applets/applet_software_keyboard.h @@ -4,7 +4,6 @@ #pragma once -#include "common/common_funcs.h" #include "common/common_types.h" #include "core/hle/result.h" #include "core/hle/service/am/applets/applet_software_keyboard_types.h" diff --git a/src/core/hle/service/am/applets/applet_web_browser.h b/src/core/hle/service/am/applets/applet_web_browser.h index 4f9e81b79..b3364ee06 100755 --- a/src/core/hle/service/am/applets/applet_web_browser.h +++ b/src/core/hle/service/am/applets/applet_web_browser.h @@ -7,7 +7,6 @@ #include #include -#include "common/common_funcs.h" #include "common/common_types.h" #include "core/file_sys/vfs_types.h" #include "core/hle/result.h" diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 4c54066c6..50264f69e 100755 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp @@ -18,7 +18,6 @@ #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" #include "core/hle/kernel/k_process.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/aoc/aoc_u.h" #include "core/loader/loader.h" @@ -124,9 +123,14 @@ AOC_U::AOC_U(Core::System& system_) {8, &AOC_U::GetAddOnContentListChangedEvent, "GetAddOnContentListChangedEvent"}, {9, nullptr, "GetAddOnContentLostErrorCode"}, {10, &AOC_U::GetAddOnContentListChangedEventWithProcessId, "GetAddOnContentListChangedEventWithProcessId"}, + {11, &AOC_U::NotifyMountAddOnContent, "NotifyMountAddOnContent"}, + {12, &AOC_U::NotifyUnmountAddOnContent, "NotifyUnmountAddOnContent"}, + {13, nullptr, "IsAddOnContentMountedForDebug"}, + {50, &AOC_U::CheckAddOnContentMountStatus, "CheckAddOnContentMountStatus"}, {100, &AOC_U::CreateEcPurchasedEventManager, "CreateEcPurchasedEventManager"}, {101, &AOC_U::CreatePermanentEcPurchasedEventManager, "CreatePermanentEcPurchasedEventManager"}, {110, nullptr, "CreateContentsServiceManager"}, + {200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, }; // clang-format on @@ -272,6 +276,27 @@ void AOC_U::GetAddOnContentListChangedEventWithProcessId(Kernel::HLERequestConte rb.PushCopyObjects(aoc_change_event->GetReadableEvent()); } +void AOC_U::NotifyMountAddOnContent(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_AOC, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void AOC_U::NotifyUnmountAddOnContent(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_AOC, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void AOC_U::CheckAddOnContentMountStatus(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_AOC, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_AOC, "(STUBBED) called"); diff --git a/src/core/hle/service/aoc/aoc_u.h b/src/core/hle/service/aoc/aoc_u.h index 31d645be8..4b5f7c5f2 100755 --- a/src/core/hle/service/aoc/aoc_u.h +++ b/src/core/hle/service/aoc/aoc_u.h @@ -29,6 +29,9 @@ private: void PrepareAddOnContent(Kernel::HLERequestContext& ctx); void GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx); void GetAddOnContentListChangedEventWithProcessId(Kernel::HLERequestContext& ctx); + void NotifyMountAddOnContent(Kernel::HLERequestContext& ctx); + void NotifyUnmountAddOnContent(Kernel::HLERequestContext& ctx); + void CheckAddOnContentMountStatus(Kernel::HLERequestContext& ctx); void CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx); void CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx); diff --git a/src/core/hle/service/apm/apm.cpp b/src/core/hle/service/apm/apm.cpp index f5ebfe8d6..243ea15b8 100755 --- a/src/core/hle/service/apm/apm.cpp +++ b/src/core/hle/service/apm/apm.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include "core/core.h" -#include "core/hle/ipc_helpers.h" #include "core/hle/service/apm/apm.h" #include "core/hle/service/apm/apm_interface.h" diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 81adbfe09..affa7971c 100755 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -14,7 +14,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/audio/audout_u.h" #include "core/hle/service/audio/errors.h" #include "core/hle/service/kernel_helpers.h" diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index cdb2a9521..f45e5cecc 100755 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -2,10 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include -#include #include "audio_core/audio_renderer.h" #include "common/alignment.h" @@ -16,7 +14,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/audio/audren_u.h" #include "core/hle/service/audio/errors.h" diff --git a/src/core/hle/service/bcat/backend/backend.h b/src/core/hle/service/bcat/backend/backend.h index 749e046c7..59c6d4740 100755 --- a/src/core/hle/service/bcat/backend/backend.h +++ b/src/core/hle/service/bcat/backend/backend.h @@ -7,7 +7,6 @@ #include #include #include -#include #include "common/common_types.h" #include "core/file_sys/vfs_types.h" diff --git a/src/core/hle/service/bcat/bcat_module.cpp b/src/core/hle/service/bcat/bcat_module.cpp index 27e9b8df8..36bd2a052 100755 --- a/src/core/hle/service/bcat/bcat_module.cpp +++ b/src/core/hle/service/bcat/bcat_module.cpp @@ -13,7 +13,6 @@ #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_readable_event.h" -#include "core/hle/kernel/k_writable_event.h" #include "core/hle/service/bcat/backend/backend.h" #include "core/hle/service/bcat/bcat.h" #include "core/hle/service/bcat/bcat_module.h" diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index 088a1a18a..0787f43f4 100755 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp @@ -6,7 +6,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/btdrv/btdrv.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index 7aabacc19..d337fd317 100755 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp @@ -8,7 +8,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/btm/btm.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 42e468ce2..6422dec4e 100755 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -13,7 +13,6 @@ #include "core/file_sys/control_metadata.h" #include "core/file_sys/errors.h" #include "core/file_sys/mode.h" -#include "core/file_sys/partition_filesystem.h" #include "core/file_sys/patch_manager.h" #include "core/file_sys/registered_cache.h" #include "core/file_sys/romfs_factory.h" diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp index 70cd63c6b..6c8ea7f0b 100755 --- a/src/core/hle/service/glue/arp.cpp +++ b/src/core/hle/service/glue/arp.cpp @@ -6,7 +6,6 @@ #include "common/logging/log.h" #include "core/core.h" -#include "core/file_sys/control_metadata.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/kernel.h" diff --git a/src/core/hle/service/glue/glue_manager.h b/src/core/hle/service/glue/glue_manager.h index a7f5ce3ee..4bc5297c6 100755 --- a/src/core/hle/service/glue/glue_manager.h +++ b/src/core/hle/service/glue/glue_manager.h @@ -7,7 +7,6 @@ #include #include #include "common/common_types.h" -#include "core/file_sys/control_metadata.h" #include "core/file_sys/romfs_factory.h" #include "core/hle/result.h" diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 7139f8d1a..fcc36bbc1 100755 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -17,7 +17,6 @@ #include "core/hle/kernel/k_event.h" #include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_writable_event.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/hid/controllers/npad.h" #include "core/hle/service/kernel_helpers.h" @@ -94,7 +93,7 @@ bool Controller_NPad::IsNpadIdValid(u32 npad_id) { bool Controller_NPad::IsDeviceHandleValid(const DeviceHandle& device_handle) { return IsNpadIdValid(device_handle.npad_id) && - device_handle.npad_type < Core::HID::NpadType::MaxNpadType && + device_handle.npad_type < Core::HID::NpadStyleIndex::MaxNpadType && device_handle.device_index < DeviceIndex::MaxDeviceIndex; } @@ -135,7 +134,7 @@ void Controller_NPad::ControllerUpdate(Core::HID::ControllerTriggerType type, auto& controller = controller_data[controller_idx]; const auto is_connected = controller.device->IsConnected(); - const auto npad_type = controller.device->GetNpadType(); + const auto npad_type = controller.device->GetNpadStyleIndex(); switch (type) { case Core::HID::ControllerTriggerType::Connected: case Core::HID::ControllerTriggerType::Disconnected: @@ -162,9 +161,9 @@ void Controller_NPad::ControllerUpdate(Core::HID::ControllerTriggerType type, void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) { auto& controller = controller_data[controller_idx]; - const auto controller_type = controller.device->GetNpadType(); + const auto controller_type = controller.device->GetNpadStyleIndex(); auto& shared_memory = controller.shared_memory_entry; - if (controller_type == Core::HID::NpadType::None) { + if (controller_type == Core::HID::NpadStyleIndex::None) { controller.styleset_changed_event->GetWritableEvent().Signal(); return; } @@ -172,10 +171,10 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) { shared_memory.device_type.raw = 0; shared_memory.system_properties.raw = 0; switch (controller_type) { - case Core::HID::NpadType::None: + case Core::HID::NpadStyleIndex::None: UNREACHABLE(); break; - case Core::HID::NpadType::ProController: + case Core::HID::NpadStyleIndex::ProController: shared_memory.style_set.fullkey.Assign(1); shared_memory.device_type.fullkey.Assign(1); shared_memory.system_properties.is_vertical.Assign(1); @@ -184,7 +183,7 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) { shared_memory.assignment_mode = NpadJoyAssignmentMode::Single; shared_memory.applet_footer.type = AppletFooterUiType::SwitchProController; break; - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::Handheld: shared_memory.style_set.handheld.Assign(1); shared_memory.device_type.handheld_left.Assign(1); shared_memory.device_type.handheld_right.Assign(1); @@ -194,7 +193,7 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) { shared_memory.assignment_mode = NpadJoyAssignmentMode::Dual; shared_memory.applet_footer.type = AppletFooterUiType::HandheldJoyConLeftJoyConRight; break; - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: shared_memory.style_set.joycon_dual.Assign(1); shared_memory.device_type.joycon_left.Assign(1); shared_memory.device_type.joycon_right.Assign(1); @@ -204,7 +203,7 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) { shared_memory.assignment_mode = NpadJoyAssignmentMode::Dual; shared_memory.applet_footer.type = AppletFooterUiType::JoyDual; break; - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: shared_memory.style_set.joycon_left.Assign(1); shared_memory.device_type.joycon_left.Assign(1); shared_memory.system_properties.is_horizontal.Assign(1); @@ -212,7 +211,7 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) { shared_memory.assignment_mode = NpadJoyAssignmentMode::Single; shared_memory.applet_footer.type = AppletFooterUiType::JoyLeftHorizontal; break; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: shared_memory.style_set.joycon_right.Assign(1); shared_memory.device_type.joycon_right.Assign(1); shared_memory.system_properties.is_horizontal.Assign(1); @@ -220,18 +219,35 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) { shared_memory.assignment_mode = NpadJoyAssignmentMode::Single; shared_memory.applet_footer.type = AppletFooterUiType::JoyRightHorizontal; break; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: shared_memory.style_set.gamecube.Assign(1); - // The GC Controller behaves like a wired Pro Controller shared_memory.device_type.fullkey.Assign(1); shared_memory.system_properties.is_vertical.Assign(1); shared_memory.system_properties.use_plus.Assign(1); break; - case Core::HID::NpadType::Pokeball: + case Core::HID::NpadStyleIndex::Pokeball: shared_memory.style_set.palma.Assign(1); shared_memory.device_type.palma.Assign(1); shared_memory.assignment_mode = NpadJoyAssignmentMode::Single; break; + case Core::HID::NpadStyleIndex::NES: + shared_memory.style_set.lark.Assign(1); + shared_memory.device_type.fullkey.Assign(1); + break; + case Core::HID::NpadStyleIndex::SNES: + shared_memory.style_set.lucia.Assign(1); + shared_memory.device_type.fullkey.Assign(1); + shared_memory.applet_footer.type = AppletFooterUiType::Lucia; + break; + case Core::HID::NpadStyleIndex::N64: + shared_memory.style_set.lagoon.Assign(1); + shared_memory.device_type.fullkey.Assign(1); + shared_memory.applet_footer.type = AppletFooterUiType::Lagon; + break; + case Core::HID::NpadStyleIndex::SegaGenesis: + shared_memory.style_set.lager.Assign(1); + shared_memory.device_type.fullkey.Assign(1); + break; default: break; } @@ -308,7 +324,7 @@ void Controller_NPad::OnInit() { const auto& device = controller.device; if (device->IsConnected()) { const std::size_t index = Core::HID::NpadIdTypeToIndex(device->GetNpadIdType()); - AddNewControllerAt(device->GetNpadType(), index); + AddNewControllerAt(device->GetNpadStyleIndex(), index); } } } @@ -348,7 +364,7 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) { std::lock_guard lock{mutex}; const auto controller_idx = NPadIdToIndex(npad_id); auto& controller = controller_data[controller_idx]; - const auto controller_type = controller.device->GetNpadType(); + const auto controller_type = controller.device->GetNpadStyleIndex(); if (!controller.device->IsConnected()) { return; } @@ -360,7 +376,7 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) { using btn = Core::HID::NpadButton; pad_entry.npad_buttons.raw = btn::None; - if (controller_type != Core::HID::NpadType::JoyconLeft) { + if (controller_type != Core::HID::NpadStyleIndex::JoyconLeft) { constexpr btn right_button_mask = btn::A | btn::B | btn::X | btn::Y | btn::StickR | btn::R | btn::ZR | btn::Plus | btn::StickRLeft | btn::StickRUp | btn::StickRRight | btn::StickRDown; @@ -368,7 +384,7 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) { pad_entry.r_stick = stick_state.right; } - if (controller_type != Core::HID::NpadType::JoyconRight) { + if (controller_type != Core::HID::NpadStyleIndex::JoyconRight) { constexpr btn left_button_mask = btn::Left | btn::Up | btn::Right | btn::Down | btn::StickL | btn::L | btn::ZL | btn::Minus | btn::StickLLeft | btn::StickLUp | btn::StickLRight | btn::StickLDown; @@ -376,17 +392,17 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) { pad_entry.l_stick = stick_state.left; } - if (controller_type == Core::HID::NpadType::JoyconLeft) { + if (controller_type == Core::HID::NpadStyleIndex::JoyconLeft) { pad_entry.npad_buttons.left_sl.Assign(button_state.left_sl); pad_entry.npad_buttons.left_sr.Assign(button_state.left_sr); } - if (controller_type == Core::HID::NpadType::JoyconRight) { + if (controller_type == Core::HID::NpadStyleIndex::JoyconRight) { pad_entry.npad_buttons.right_sl.Assign(button_state.right_sl); pad_entry.npad_buttons.right_sr.Assign(button_state.right_sr); } - if (controller_type == Core::HID::NpadType::GameCube) { + if (controller_type == Core::HID::NpadStyleIndex::GameCube) { const auto& trigger_state = controller.device->GetTriggers(); trigger_entry.l_analog = trigger_state.left; trigger_entry.r_analog = trigger_state.right; @@ -407,9 +423,10 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* auto& controller = controller_data[i]; auto& npad = controller.shared_memory_entry; - const auto& controller_type = controller.device->GetNpadType(); + const auto& controller_type = controller.device->GetNpadStyleIndex(); - if (controller_type == Core::HID::NpadType::None || !controller.device->IsConnected()) { + if (controller_type == Core::HID::NpadStyleIndex::None || + !controller.device->IsConnected()) { // Refresh shared memory std::memcpy(data + NPAD_OFFSET + (i * sizeof(NpadInternalState)), &controller.shared_memory_entry, sizeof(NpadInternalState)); @@ -427,10 +444,14 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* libnx_state.connection_status.raw = 0; libnx_state.connection_status.is_connected.Assign(1); switch (controller_type) { - case Core::HID::NpadType::None: + case Core::HID::NpadStyleIndex::None: UNREACHABLE(); break; - case Core::HID::NpadType::ProController: + case Core::HID::NpadStyleIndex::ProController: + case Core::HID::NpadStyleIndex::NES: + case Core::HID::NpadStyleIndex::SNES: + case Core::HID::NpadStyleIndex::N64: + case Core::HID::NpadStyleIndex::SegaGenesis: pad_state.connection_status.raw = 0; pad_state.connection_status.is_connected.Assign(1); pad_state.connection_status.is_wired.Assign(1); @@ -440,7 +461,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* npad.fullkey_lifo.ReadCurrentEntry().state.sampling_number + 1; npad.fullkey_lifo.WriteNextEntry(pad_state); break; - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::Handheld: pad_state.connection_status.raw = 0; pad_state.connection_status.is_connected.Assign(1); pad_state.connection_status.is_wired.Assign(1); @@ -458,7 +479,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* npad.handheld_lifo.ReadCurrentEntry().state.sampling_number + 1; npad.handheld_lifo.WriteNextEntry(pad_state); break; - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: pad_state.connection_status.raw = 0; pad_state.connection_status.is_connected.Assign(1); pad_state.connection_status.is_left_connected.Assign(1); @@ -470,7 +491,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* npad.joy_dual_lifo.ReadCurrentEntry().state.sampling_number + 1; npad.joy_dual_lifo.WriteNextEntry(pad_state); break; - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: pad_state.connection_status.raw = 0; pad_state.connection_status.is_connected.Assign(1); pad_state.connection_status.is_left_connected.Assign(1); @@ -480,7 +501,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* npad.joy_left_lifo.ReadCurrentEntry().state.sampling_number + 1; npad.joy_left_lifo.WriteNextEntry(pad_state); break; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: pad_state.connection_status.raw = 0; pad_state.connection_status.is_connected.Assign(1); pad_state.connection_status.is_right_connected.Assign(1); @@ -490,7 +511,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* npad.joy_right_lifo.ReadCurrentEntry().state.sampling_number + 1; npad.joy_right_lifo.WriteNextEntry(pad_state); break; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: pad_state.connection_status.raw = 0; pad_state.connection_status.is_connected.Assign(1); pad_state.connection_status.is_wired.Assign(1); @@ -503,7 +524,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* npad.fullkey_lifo.WriteNextEntry(pad_state); npad.gc_trigger_lifo.WriteNextEntry(trigger_state); break; - case Core::HID::NpadType::Pokeball: + case Core::HID::NpadStyleIndex::Pokeball: pad_state.connection_status.raw = 0; pad_state.connection_status.is_connected.Assign(1); pad_state.sampling_number = @@ -535,9 +556,10 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing for (std::size_t i = 0; i < controller_data.size(); ++i) { auto& controller = controller_data[i]; - const auto& controller_type = controller.device->GetNpadType(); + const auto& controller_type = controller.device->GetNpadStyleIndex(); - if (controller_type == Core::HID::NpadType::None || !controller.device->IsConnected()) { + if (controller_type == Core::HID::NpadStyleIndex::None || + !controller.device->IsConnected()) { continue; } @@ -558,10 +580,10 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing } switch (controller_type) { - case Core::HID::NpadType::None: + case Core::HID::NpadStyleIndex::None: UNREACHABLE(); break; - case Core::HID::NpadType::ProController: + case Core::HID::NpadStyleIndex::ProController: sixaxis_fullkey_state.attribute.raw = 0; if (sixaxis_sensors_enabled) { sixaxis_fullkey_state.attribute.is_connected.Assign(1); @@ -571,7 +593,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing sixaxis_fullkey_state.orientation = motion_state[0].orientation; } break; - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::Handheld: sixaxis_handheld_state.attribute.raw = 0; if (sixaxis_sensors_enabled) { sixaxis_handheld_state.attribute.is_connected.Assign(1); @@ -581,7 +603,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing sixaxis_handheld_state.orientation = motion_state[0].orientation; } break; - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: sixaxis_dual_left_state.attribute.raw = 0; sixaxis_dual_right_state.attribute.raw = 0; if (sixaxis_sensors_enabled) { @@ -601,7 +623,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing sixaxis_dual_right_state.orientation = motion_state[1].orientation; } break; - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: sixaxis_left_lifo_state.attribute.raw = 0; if (sixaxis_sensors_enabled) { sixaxis_left_lifo_state.attribute.is_connected.Assign(1); @@ -611,7 +633,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing sixaxis_left_lifo_state.orientation = motion_state[0].orientation; } break; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: sixaxis_right_lifo_state.attribute.raw = 0; if (sixaxis_sensors_enabled) { sixaxis_right_lifo_state.attribute.is_connected.Assign(1); @@ -780,11 +802,11 @@ void Controller_NPad::VibrateController(const DeviceHandle& vibration_device_han } // Some games try to send mismatched parameters in the device handle, block these. - if ((controller.device->GetNpadType() == Core::HID::NpadType::JoyconLeft && - (vibration_device_handle.npad_type == Core::HID::NpadType::JoyconRight || + if ((controller.device->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconLeft && + (vibration_device_handle.npad_type == Core::HID::NpadStyleIndex::JoyconRight || vibration_device_handle.device_index == DeviceIndex::Right)) || - (controller.device->GetNpadType() == Core::HID::NpadType::JoyconRight && - (vibration_device_handle.npad_type == Core::HID::NpadType::JoyconLeft || + (controller.device->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconRight && + (vibration_device_handle.npad_type == Core::HID::NpadStyleIndex::JoyconLeft || vibration_device_handle.device_index == DeviceIndex::Left))) { return; } @@ -877,11 +899,12 @@ void Controller_NPad::SignalStyleSetChangedEvent(u32 npad_id) const { controller.styleset_changed_event->GetWritableEvent().Signal(); } -void Controller_NPad::AddNewControllerAt(Core::HID::NpadType controller, std::size_t npad_index) { +void Controller_NPad::AddNewControllerAt(Core::HID::NpadStyleIndex controller, + std::size_t npad_index) { UpdateControllerAt(controller, npad_index, true); } -void Controller_NPad::UpdateControllerAt(Core::HID::NpadType type, std::size_t npad_index, +void Controller_NPad::UpdateControllerAt(Core::HID::NpadStyleIndex type, std::size_t npad_index, bool connected) { auto& controller = controller_data[npad_index]; if (!connected) { @@ -889,7 +912,7 @@ void Controller_NPad::UpdateControllerAt(Core::HID::NpadType type, std::size_t n return; } - controller.device->SetNpadType(type); + controller.device->SetNpadStyleIndex(type); InitNewlyAddedController(npad_index); } @@ -972,13 +995,13 @@ void Controller_NPad::MergeSingleJoyAsDualJoy(u32 npad_id_1, u32 npad_id_2) { // If the controllers at both npad indices form a pair of left and right joycons, merge them. // Otherwise, do nothing. - if ((controller_1->GetNpadType() == Core::HID::NpadType::JoyconLeft && - controller_2->GetNpadType() == Core::HID::NpadType::JoyconRight) || - (controller_2->GetNpadType() == Core::HID::NpadType::JoyconLeft && - controller_1->GetNpadType() == Core::HID::NpadType::JoyconRight)) { + if ((controller_1->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconLeft && + controller_2->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconRight) || + (controller_2->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconLeft && + controller_1->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::JoyconRight)) { // Disconnect the joycon at the second id and connect the dual joycon at the first index. DisconnectNpad(npad_id_2); - AddNewControllerAt(Core::HID::NpadType::JoyconDual, npad_index_1); + AddNewControllerAt(Core::HID::NpadStyleIndex::JoyconDual, npad_index_1); } } @@ -1001,8 +1024,8 @@ bool Controller_NPad::SwapNpadAssignment(u32 npad_id_1, u32 npad_id_2) { const auto npad_index_2 = NPadIdToIndex(npad_id_2); const auto& controller_1 = controller_data[npad_index_1].device; const auto& controller_2 = controller_data[npad_index_2].device; - const auto type_index_1 = controller_1->GetNpadType(); - const auto type_index_2 = controller_2->GetNpadType(); + const auto type_index_1 = controller_1->GetNpadStyleIndex(); + const auto type_index_2 = controller_2->GetNpadStyleIndex(); if (!IsControllerSupported(type_index_1) || !IsControllerSupported(type_index_2)) { return false; @@ -1040,9 +1063,9 @@ void Controller_NPad::SetAnalogStickUseCenterClamp(bool use_center_clamp) { void Controller_NPad::ClearAllConnectedControllers() { for (auto& controller : controller_data) { if (controller.device->IsConnected() && - controller.device->GetNpadType() != Core::HID::NpadType::None) { - controller.device->SetNpadType(Core::HID::NpadType::None); + controller.device->GetNpadStyleIndex() != Core::HID::NpadStyleIndex::None) { controller.device->Disconnect(); + controller.device->SetNpadStyleIndex(Core::HID::NpadStyleIndex::None); } } } @@ -1055,7 +1078,7 @@ void Controller_NPad::DisconnectAllConnectedControllers() { void Controller_NPad::ConnectAllDisconnectedControllers() { for (auto& controller : controller_data) { - if (controller.device->GetNpadType() != Core::HID::NpadType::None && + if (controller.device->GetNpadStyleIndex() != Core::HID::NpadStyleIndex::None && !controller.device->IsConnected()) { controller.device->Connect(); } @@ -1064,8 +1087,8 @@ void Controller_NPad::ConnectAllDisconnectedControllers() { void Controller_NPad::ClearAllControllers() { for (auto& controller : controller_data) { - controller.device->SetNpadType(Core::HID::NpadType::None); controller.device->Disconnect(); + controller.device->SetNpadStyleIndex(Core::HID::NpadStyleIndex::None); } } @@ -1073,8 +1096,8 @@ u32 Controller_NPad::GetAndResetPressState() { return press_state.exchange(0); } -bool Controller_NPad::IsControllerSupported(Core::HID::NpadType controller) const { - if (controller == Core::HID::NpadType::Handheld) { +bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller) const { + if (controller == Core::HID::NpadStyleIndex::Handheld) { const bool support_handheld = std::find(supported_npad_id_types.begin(), supported_npad_id_types.end(), NPAD_HANDHELD) != supported_npad_id_types.end(); @@ -1094,18 +1117,26 @@ bool Controller_NPad::IsControllerSupported(Core::HID::NpadType controller) cons [](u32 npad_id) { return npad_id <= MAX_NPAD_ID; })) { Core::HID::NpadStyleTag style = GetSupportedStyleSet(); switch (controller) { - case Core::HID::NpadType::ProController: + case Core::HID::NpadStyleIndex::ProController: return style.fullkey; - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: return style.joycon_dual; - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: return style.joycon_left; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: return style.joycon_right; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: return style.gamecube; - case Core::HID::NpadType::Pokeball: + case Core::HID::NpadStyleIndex::Pokeball: return style.palma; + case Core::HID::NpadStyleIndex::NES: + return style.lark; + case Core::HID::NpadStyleIndex::SNES: + return style.lucia; + case Core::HID::NpadStyleIndex::N64: + return style.lagoon; + case Core::HID::NpadStyleIndex::SegaGenesis: + return style.lager; default: return false; } diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 871d245fd..512fb5afc 100755 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -96,7 +96,7 @@ public: }; struct DeviceHandle { - Core::HID::NpadType npad_type; + Core::HID::NpadStyleIndex npad_type; u8 npad_id; DeviceIndex device_index; INSERT_PADDING_BYTES_NOINIT(1); @@ -160,9 +160,10 @@ public: void SignalStyleSetChangedEvent(u32 npad_id) const; // Adds a new controller at an index. - void AddNewControllerAt(Core::HID::NpadType controller, std::size_t npad_index); + void AddNewControllerAt(Core::HID::NpadStyleIndex controller, std::size_t npad_index); // Adds a new controller at an index with connection status. - void UpdateControllerAt(Core::HID::NpadType controller, std::size_t npad_index, bool connected); + void UpdateControllerAt(Core::HID::NpadStyleIndex controller, std::size_t npad_index, + bool connected); void DisconnectNpad(u32 npad_id); void DisconnectNpadAtIndex(std::size_t index); @@ -496,7 +497,7 @@ private: std::array vibration{}; bool unintended_home_button_input_protection{}; bool is_connected{}; - Core::HID::NpadType npad_type{Core::HID::NpadType::None}; + Core::HID::NpadStyleIndex npad_type{Core::HID::NpadStyleIndex::None}; // Current pad state NPadGenericState npad_pad_state{}; @@ -513,7 +514,7 @@ private: void ControllerUpdate(Core::HID::ControllerTriggerType type, std::size_t controller_idx); void InitNewlyAddedController(std::size_t controller_idx); - bool IsControllerSupported(Core::HID::NpadType controller) const; + bool IsControllerSupported(Core::HID::NpadStyleIndex controller) const; void RequestPadStateUpdate(u32 npad_id); void WriteEmptyEntry(NpadInternalState& npad); diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 0dbbdfe7d..648e69de9 100755 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -8,12 +8,10 @@ #include "common/settings.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/frontend/emu_window.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/k_transfer_memory.h" -#include "core/hle/kernel/k_writable_event.h" #include "core/hle/kernel/kernel.h" #include "core/hle/service/hid/errors.h" #include "core/hle/service/hid/hid.h" @@ -1133,18 +1131,18 @@ void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) { Core::HID::VibrationDeviceInfo vibration_device_info; switch (vibration_device_handle.npad_type) { - case Core::HID::NpadType::ProController: - case Core::HID::NpadType::Handheld: - case Core::HID::NpadType::JoyconDual: - case Core::HID::NpadType::JoyconLeft: - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::ProController: + case Core::HID::NpadStyleIndex::Handheld: + case Core::HID::NpadStyleIndex::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconRight: default: vibration_device_info.type = Core::HID::VibrationDeviceType::LinearResonantActuator; break; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: vibration_device_info.type = Core::HID::VibrationDeviceType::GcErm; break; - case Core::HID::NpadType::Pokeball: + case Core::HID::NpadStyleIndex::Pokeball: vibration_device_info.type = Core::HID::VibrationDeviceType::Unknown; break; } diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp index 4a92c6234..8812b8ecb 100755 --- a/src/core/hle/service/hid/irs.cpp +++ b/src/core/hle/service/hid/irs.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/swap.h" #include "core/core.h" #include "core/core_timing.h" #include "core/hle/ipc_helpers.h" diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 794504314..e40383134 100755 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -2,19 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include #include #include #include "common/logging/log.h" -#include "common/scope_exit.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/lm/lm.h" #include "core/hle/service/service.h" -#include "core/memory.h" namespace Service::LM { enum class LogSeverity : u8 { diff --git a/src/core/hle/service/mii/raw_data.h b/src/core/hle/service/mii/raw_data.h index a0d2b9d3a..bd90c2162 100755 --- a/src/core/hle/service/mii/raw_data.h +++ b/src/core/hle/service/mii/raw_data.h @@ -6,7 +6,6 @@ #include -#include "common/common_types.h" #include "core/hle/service/mii/mii_manager.h" namespace Service::Mii::RawData { diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index 6791f20a5..693ffc71a 100755 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -9,8 +9,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/lock.h" #include "core/hle/service/nfp/nfp.h" #include "core/hle/service/nfp/nfp_user.h" diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index f13dc8b0d..a253dd066 100755 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/settings.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index 30fb060b8..196f274e1 100755 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -7,7 +7,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/nim/nim.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/ns/language.h b/src/core/hle/service/ns/language.h index d84c3f277..2cc8e4806 100755 --- a/src/core/hle/service/ns/language.h +++ b/src/core/hle/service/ns/language.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include "common/common_types.h" namespace Service::Set { @@ -43,4 +42,4 @@ constexpr u32 GetSupportedLanguageFlag(const ApplicationLanguage lang) { const ApplicationLanguagePriorityList* GetApplicationLanguagePriorityList(ApplicationLanguage lang); std::optional ConvertToApplicationLanguage(Set::LanguageCode language_code); std::optional ConvertToLanguageCode(ApplicationLanguage lang); -} // namespace Service::NS \ No newline at end of file +} // namespace Service::NS diff --git a/src/core/hle/service/nvdrv/devices/nvdevice.h b/src/core/hle/service/nvdrv/devices/nvdevice.h index 5b73a5a34..3d874243a 100755 --- a/src/core/hle/service/nvdrv/devices/nvdevice.h +++ b/src/core/hle/service/nvdrv/devices/nvdevice.h @@ -5,11 +5,8 @@ #pragma once #include -#include "common/bit_field.h" #include "common/common_types.h" -#include "common/swap.h" #include "core/hle/service/nvdrv/nvdata.h" -#include "core/hle/service/service.h" namespace Core { class System; diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp index 4ee8c5733..68f1e9060 100755 --- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp +++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp @@ -10,7 +10,6 @@ #include "core/hle/service/nvdrv/devices/nvmap.h" #include "core/perf_stats.h" #include "video_core/gpu.h" -#include "video_core/renderer_base.h" namespace Service::Nvidia::Devices { diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp index 7dc41d875..85170cdb3 100755 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -10,10 +10,8 @@ #include "core/core.h" #include "core/hle/service/nvdrv/devices/nvhost_as_gpu.h" #include "core/hle/service/nvdrv/devices/nvmap.h" -#include "core/memory.h" #include "video_core/memory_manager.h" #include "video_core/rasterizer_interface.h" -#include "video_core/renderer_base.h" namespace Service::Nvidia::Devices { diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index d8b684f4f..05b4e2151 100755 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp @@ -7,7 +7,6 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" #include "core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h" namespace Service::Nvidia::Devices { diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 54ac105d5..0a043e386 100755 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp @@ -10,7 +10,6 @@ #include "core/hle/service/nvdrv/syncpoint_manager.h" #include "core/memory.h" #include "video_core/gpu.h" -#include "video_core/memory_manager.h" namespace Service::Nvidia::Devices { namespace { diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp index 6c1edce33..0d7d4ad03 100755 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp @@ -6,7 +6,6 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/hle/service/nvdrv/devices/nvhost_nvdec.h" -#include "video_core/memory_manager.h" #include "video_core/renderer_base.h" namespace Service::Nvidia::Devices { diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h index ae4199b79..351625c17 100755 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include "common/common_types.h" #include "common/swap.h" diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp index 21d101e8a..eac4dd530 100755 --- a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp @@ -6,7 +6,6 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/hle/service/nvdrv/devices/nvhost_vic.h" -#include "video_core/memory_manager.h" #include "video_core/renderer_base.h" namespace Service::Nvidia::Devices { diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index ff405099a..aa7e47cbf 100755 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -8,7 +8,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_writable_event.h" #include "core/hle/service/nvdrv/devices/nvdevice.h" #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp index d61fb73dc..c16babe14 100755 --- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp +++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp @@ -7,9 +7,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_readable_event.h" -#include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/k_writable_event.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/nvdrv/nvdata.h" #include "core/hle/service/nvdrv/nvdrv.h" #include "core/hle/service/nvdrv/nvdrv_interface.h" diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h index 78de3f354..7b7baeaea 100755 --- a/src/core/hle/service/nvflinger/buffer_queue.h +++ b/src/core/hle/service/nvflinger/buffer_queue.h @@ -8,7 +8,6 @@ #include #include #include -#include #include "common/common_funcs.h" #include "common/math_util.h" diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index 22ff5269c..5d248f671 100755 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp @@ -8,7 +8,6 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/ptm/psm.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 065133166..f54e6fe56 100755 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -2,19 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include "common/assert.h" #include "common/logging/log.h" #include "common/settings.h" -#include "common/string_util.h" #include "core/core.h" #include "core/hle/ipc.h" #include "core/hle/ipc_helpers.h" -#include "core/hle/kernel/k_client_port.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_server_port.h" -#include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" #include "core/hle/service/acc/acc.h" #include "core/hle/service/am/am.h" diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 41abb146c..eaa172595 100755 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -12,8 +12,6 @@ #include "core/hle/kernel/k_port.h" #include "core/hle/kernel/k_scoped_resource_reservation.h" #include "core/hle/kernel/k_server_port.h" -#include "core/hle/kernel/k_server_session.h" -#include "core/hle/kernel/k_session.h" #include "core/hle/result.h" #include "core/hle/service/sm/sm.h" #include "core/hle/service/sm/sm_controller.h" diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h index 068c78588..021eb51b4 100755 --- a/src/core/hle/service/sm/sm.h +++ b/src/core/hle/service/sm/sm.h @@ -6,7 +6,6 @@ #include #include -#include #include #include "common/concepts.h" diff --git a/src/core/hle/service/sm/sm_controller.cpp b/src/core/hle/service/sm/sm_controller.cpp index b5fbc4569..09f9ecee1 100755 --- a/src/core/hle/service/sm/sm_controller.cpp +++ b/src/core/hle/service/sm/sm_controller.cpp @@ -7,10 +7,8 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_client_port.h" -#include "core/hle/kernel/k_client_session.h" #include "core/hle/kernel/k_port.h" #include "core/hle/kernel/k_scoped_resource_reservation.h" -#include "core/hle/kernel/k_server_port.h" #include "core/hle/kernel/k_server_session.h" #include "core/hle/kernel/k_session.h" #include "core/hle/service/sm/sm_controller.h" diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index b9e765f1d..f83272633 100755 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include diff --git a/src/core/hle/service/time/local_system_clock_context_writer.h b/src/core/hle/service/time/local_system_clock_context_writer.h index 6be617392..ac6c7b4b1 100755 --- a/src/core/hle/service/time/local_system_clock_context_writer.h +++ b/src/core/hle/service/time/local_system_clock_context_writer.h @@ -4,7 +4,6 @@ #pragma once -#include "core/hle/service/time/errors.h" #include "core/hle/service/time/system_clock_context_update_callback.h" #include "core/hle/service/time/time_sharedmemory.h" diff --git a/src/core/hle/service/time/standard_steady_clock_core.cpp b/src/core/hle/service/time/standard_steady_clock_core.cpp index 59a272f4a..a1ffdd524 100755 --- a/src/core/hle/service/time/standard_steady_clock_core.cpp +++ b/src/core/hle/service/time/standard_steady_clock_core.cpp @@ -4,7 +4,6 @@ #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" #include "core/hardware_properties.h" #include "core/hle/service/time/standard_steady_clock_core.h" diff --git a/src/core/hle/service/time/tick_based_steady_clock_core.cpp b/src/core/hle/service/time/tick_based_steady_clock_core.cpp index 8baaa2a6a..47d4ab980 100755 --- a/src/core/hle/service/time/tick_based_steady_clock_core.cpp +++ b/src/core/hle/service/time/tick_based_steady_clock_core.cpp @@ -4,7 +4,6 @@ #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" #include "core/hardware_properties.h" #include "core/hle/service/time/tick_based_steady_clock_core.h" diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index d84a111c2..4d8823b5a 100755 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -5,10 +5,8 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" #include "core/hardware_properties.h" #include "core/hle/ipc_helpers.h" -#include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/kernel.h" #include "core/hle/service/time/time.h" #include "core/hle/service/time/time_interface.h" diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp index 9c4c960ef..c1e4e6cce 100755 --- a/src/core/hle/service/time/time_manager.cpp +++ b/src/core/hle/service/time/time_manager.cpp @@ -8,8 +8,10 @@ #include "common/settings.h" #include "common/time_zone.h" #include "core/hle/service/time/ephemeral_network_system_clock_context_writer.h" +#include "core/hle/service/time/ephemeral_network_system_clock_core.h" #include "core/hle/service/time/local_system_clock_context_writer.h" #include "core/hle/service/time/network_system_clock_context_writer.h" +#include "core/hle/service/time/tick_based_steady_clock_core.h" #include "core/hle/service/time/time_manager.h" namespace Service::Time { diff --git a/src/core/hle/service/time/time_manager.h b/src/core/hle/service/time/time_manager.h index 3af868d87..2404067c0 100755 --- a/src/core/hle/service/time/time_manager.h +++ b/src/core/hle/service/time/time_manager.h @@ -5,15 +5,12 @@ #pragma once #include "common/common_types.h" -#include "common/time_zone.h" #include "core/file_sys/vfs_types.h" #include "core/hle/service/time/clock_types.h" -#include "core/hle/service/time/ephemeral_network_system_clock_core.h" #include "core/hle/service/time/standard_local_system_clock_core.h" #include "core/hle/service/time/standard_network_system_clock_core.h" #include "core/hle/service/time/standard_steady_clock_core.h" #include "core/hle/service/time/standard_user_system_clock_core.h" -#include "core/hle/service/time/tick_based_steady_clock_core.h" #include "core/hle/service/time/time_sharedmemory.h" #include "core/hle/service/time/time_zone_content_manager.h" diff --git a/src/core/hle/service/time/time_sharedmemory.cpp b/src/core/hle/service/time/time_sharedmemory.cpp index 176ad0eee..ed9f75ed6 100755 --- a/src/core/hle/service/time/time_sharedmemory.cpp +++ b/src/core/hle/service/time/time_sharedmemory.cpp @@ -4,7 +4,6 @@ #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" #include "core/hardware_properties.h" #include "core/hle/kernel/kernel.h" #include "core/hle/service/time/clock_types.h" diff --git a/src/core/hle/service/time/time_sharedmemory.h b/src/core/hle/service/time/time_sharedmemory.h index d471b5d18..9307ea795 100755 --- a/src/core/hle/service/time/time_sharedmemory.h +++ b/src/core/hle/service/time/time_sharedmemory.h @@ -7,7 +7,6 @@ #include "common/common_types.h" #include "common/uuid.h" #include "core/hle/kernel/k_shared_memory.h" -#include "core/hle/kernel/k_thread.h" #include "core/hle/service/time/clock_types.h" namespace Service::Time { diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index 6da893790..2989cee5e 100755 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp @@ -9,8 +9,6 @@ #include "core/file_sys/content_archive.h" #include "core/file_sys/nca_metadata.h" #include "core/file_sys/registered_cache.h" -#include "core/file_sys/romfs.h" -#include "core/file_sys/system_archive/system_archive.h" #include "core/hle/service/time/time_zone_manager.h" namespace Service::Time::TimeZone { diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index c3f363eeb..75ee3e5e4 100755 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -21,9 +21,7 @@ #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/k_writable_event.h" #include "core/hle/service/nvdrv/nvdata.h" -#include "core/hle/service/nvdrv/nvdrv.h" #include "core/hle/service/nvflinger/buffer_queue.h" #include "core/hle/service/nvflinger/nvflinger.h" #include "core/hle/service/service.h" diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index a19bb220a..1b5aca65d 100755 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp @@ -2,9 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include -#include "common/common_funcs.h" #include "common/logging/log.h" #include "core/core.h" #include "core/file_sys/content_archive.h" @@ -13,7 +11,6 @@ #include "core/file_sys/romfs_factory.h" #include "core/hle/kernel/k_page_table.h" #include "core/hle/kernel/k_process.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/deconstructed_rom_directory.h" #include "core/loader/nso.h" diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 3d9276f15..d0250bdb4 100755 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -4,7 +4,6 @@ #include #include -#include #include "common/common_funcs.h" #include "common/common_types.h" #include "common/logging/log.h" diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h index 890299a20..bff51ec17 100755 --- a/src/core/loader/elf.h +++ b/src/core/loader/elf.h @@ -4,8 +4,6 @@ #pragma once -#include -#include "common/common_types.h" #include "core/loader/loader.h" namespace Core { diff --git a/src/core/loader/nax.cpp b/src/core/loader/nax.cpp index aceb66414..3375dab7c 100755 --- a/src/core/loader/nax.cpp +++ b/src/core/loader/nax.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/logging/log.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/romfs.h" #include "core/file_sys/xts_archive.h" diff --git a/src/core/loader/nca.cpp b/src/core/loader/nca.cpp index aa51b0daa..219bbeaf5 100755 --- a/src/core/loader/nca.cpp +++ b/src/core/loader/nca.cpp @@ -4,7 +4,6 @@ #include -#include "common/logging/log.h" #include "core/core.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/romfs_factory.h" diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h index f2ff080bb..c0db8c740 100755 --- a/src/core/loader/nca.h +++ b/src/core/loader/nca.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" -#include "core/file_sys/vfs.h" #include "core/loader/loader.h" namespace Core { diff --git a/src/core/loader/nsp.cpp b/src/core/loader/nsp.cpp index 8b167ad3c..f7ccc678d 100755 --- a/src/core/loader/nsp.cpp +++ b/src/core/loader/nsp.cpp @@ -6,7 +6,6 @@ #include "common/common_types.h" #include "core/core.h" -#include "core/file_sys/card_image.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/nca_metadata.h" diff --git a/src/core/loader/nsp.h b/src/core/loader/nsp.h index 50406a92e..378e4077a 100755 --- a/src/core/loader/nsp.h +++ b/src/core/loader/nsp.h @@ -6,7 +6,6 @@ #include #include "common/common_types.h" -#include "core/file_sys/vfs.h" #include "core/loader/loader.h" namespace FileSys { diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 269603eef..8c6c1a3fd 100755 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp @@ -11,7 +11,6 @@ #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" #include "core/file_sys/registered_cache.h" -#include "core/file_sys/romfs.h" #include "core/file_sys/submission_package.h" #include "core/hle/kernel/k_process.h" #include "core/hle/service/filesystem/filesystem.h" diff --git a/src/core/loader/xci.h b/src/core/loader/xci.h index 30caaf90e..6e3810e48 100755 --- a/src/core/loader/xci.h +++ b/src/core/loader/xci.h @@ -6,7 +6,6 @@ #include #include "common/common_types.h" -#include "core/file_sys/vfs.h" #include "core/loader/loader.h" namespace FileSys { diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp index 46a7e09b4..863dc0769 100755 --- a/src/core/memory/cheat_engine.cpp +++ b/src/core/memory/cheat_engine.cpp @@ -8,8 +8,6 @@ #include "common/swap.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" -#include "core/hardware_properties.h" #include "core/hle/kernel/k_page_table.h" #include "core/hle/kernel/k_process.h" #include "core/hle/service/hid/controllers/npad.h" diff --git a/src/core/network/network.h b/src/core/network/network.h index fdd3e4655..e85df3ab7 100755 --- a/src/core/network/network.h +++ b/src/core/network/network.h @@ -6,7 +6,6 @@ #include #include -#include #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index c9ded49d0..52c43c857 100755 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp @@ -14,7 +14,6 @@ #include "common/fs/file.h" #include "common/fs/fs.h" #include "common/fs/path_util.h" -#include "common/math_util.h" #include "common/settings.h" #include "core/perf_stats.h" diff --git a/src/core/tools/freezer.cpp b/src/core/tools/freezer.cpp index 2e09faa6d..032c71aff 100755 --- a/src/core/tools/freezer.cpp +++ b/src/core/tools/freezer.cpp @@ -6,8 +6,6 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" -#include "core/hardware_properties.h" #include "core/memory.h" #include "core/tools/freezer.h" diff --git a/src/yuzu/applets/qt_controller.cpp b/src/yuzu/applets/qt_controller.cpp index 9c6377cf0..6a2cdda63 100755 --- a/src/yuzu/applets/qt_controller.cpp +++ b/src/yuzu/applets/qt_controller.cpp @@ -28,31 +28,31 @@ namespace { void UpdateController(Core::HID::EmulatedController* controller, - Core::HID::NpadType controller_type, bool connected) { + Core::HID::NpadStyleIndex controller_type, bool connected) { if (controller->IsConnected()) { controller->Disconnect(); } - controller->SetNpadType(controller_type); + controller->SetNpadStyleIndex(controller_type); if (connected) { controller->Connect(); } } // Returns true if the given controller type is compatible with the given parameters. -bool IsControllerCompatible(Core::HID::NpadType controller_type, +bool IsControllerCompatible(Core::HID::NpadStyleIndex controller_type, Core::Frontend::ControllerParameters parameters) { switch (controller_type) { - case Core::HID::NpadType::ProController: + case Core::HID::NpadStyleIndex::ProController: return parameters.allow_pro_controller; - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: return parameters.allow_dual_joycons; - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: return parameters.allow_left_joycon; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: return parameters.allow_right_joycon; - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::Handheld: return parameters.enable_single_mode && parameters.allow_handheld; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: return parameters.allow_gamecube_controller; default: return false; @@ -183,7 +183,7 @@ QtControllerSelectorDialog::QtControllerSelectorDialog( connect(emulated_controllers[i], qOverload(&QComboBox::currentIndexChanged), [this, i](int index) { UpdateDockedState(GetControllerTypeFromIndex(index, i) == - Core::HID::NpadType::Handheld); + Core::HID::NpadStyleIndex::Handheld); }); } } @@ -243,7 +243,7 @@ void QtControllerSelectorDialog::LoadConfiguration() { player_groupboxes[index]->setChecked(connected); connected_controller_checkboxes[index]->setChecked(connected); emulated_controllers[index]->setCurrentIndex( - GetIndexFromControllerType(controller->GetNpadType(), index)); + GetIndexFromControllerType(controller->GetNpadStyleIndex(), index)); } UpdateDockedState(handheld->IsConnected()); @@ -402,32 +402,33 @@ void QtControllerSelectorDialog::SetEmulatedControllers(std::size_t player_index emulated_controllers[player_index]->clear(); pairs.emplace_back(emulated_controllers[player_index]->count(), - Core::HID::NpadType::ProController); + Core::HID::NpadStyleIndex::ProController); emulated_controllers[player_index]->addItem(tr("Pro Controller")); pairs.emplace_back(emulated_controllers[player_index]->count(), - Core::HID::NpadType::JoyconDual); + Core::HID::NpadStyleIndex::JoyconDual); emulated_controllers[player_index]->addItem(tr("Dual Joycons")); pairs.emplace_back(emulated_controllers[player_index]->count(), - Core::HID::NpadType::JoyconLeft); + Core::HID::NpadStyleIndex::JoyconLeft); emulated_controllers[player_index]->addItem(tr("Left Joycon")); pairs.emplace_back(emulated_controllers[player_index]->count(), - Core::HID::NpadType::JoyconRight); + Core::HID::NpadStyleIndex::JoyconRight); emulated_controllers[player_index]->addItem(tr("Right Joycon")); if (player_index == 0) { pairs.emplace_back(emulated_controllers[player_index]->count(), - Core::HID::NpadType::Handheld); + Core::HID::NpadStyleIndex::Handheld); emulated_controllers[player_index]->addItem(tr("Handheld")); } - pairs.emplace_back(emulated_controllers[player_index]->count(), Core::HID::NpadType::GameCube); + pairs.emplace_back(emulated_controllers[player_index]->count(), + Core::HID::NpadStyleIndex::GameCube); emulated_controllers[player_index]->addItem(tr("GameCube Controller")); } -Core::HID::NpadType QtControllerSelectorDialog::GetControllerTypeFromIndex( +Core::HID::NpadStyleIndex QtControllerSelectorDialog::GetControllerTypeFromIndex( int index, std::size_t player_index) const { const auto& pairs = index_controller_type_pairs[player_index]; @@ -435,13 +436,13 @@ Core::HID::NpadType QtControllerSelectorDialog::GetControllerTypeFromIndex( [index](const auto& pair) { return pair.first == index; }); if (it == pairs.end()) { - return Core::HID::NpadType::ProController; + return Core::HID::NpadStyleIndex::ProController; } return it->second; } -int QtControllerSelectorDialog::GetIndexFromControllerType(Core::HID::NpadType type, +int QtControllerSelectorDialog::GetIndexFromControllerType(Core::HID::NpadStyleIndex type, std::size_t player_index) const { const auto& pairs = index_controller_type_pairs[player_index]; @@ -465,16 +466,16 @@ void QtControllerSelectorDialog::UpdateControllerIcon(std::size_t player_index) const QString stylesheet = [this, player_index] { switch (GetControllerTypeFromIndex(emulated_controllers[player_index]->currentIndex(), player_index)) { - case Core::HID::NpadType::ProController: - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::ProController: + case Core::HID::NpadStyleIndex::GameCube: return QStringLiteral("image: url(:/controller/applet_pro_controller%0); "); - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: return QStringLiteral("image: url(:/controller/applet_dual_joycon%0); "); - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: return QStringLiteral("image: url(:/controller/applet_joycon_left%0); "); - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: return QStringLiteral("image: url(:/controller/applet_joycon_right%0); "); - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::Handheld: return QStringLiteral("image: url(:/controller/applet_handheld%0); "); default: return QString{}; @@ -507,9 +508,9 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index) const auto controller_type = GetControllerTypeFromIndex( emulated_controllers[player_index]->currentIndex(), player_index); const auto player_connected = player_groupboxes[player_index]->isChecked() && - controller_type != Core::HID::NpadType::Handheld; + controller_type != Core::HID::NpadStyleIndex::Handheld; - if (controller->GetNpadType() == controller_type && + if (controller->GetNpadStyleIndex() == controller_type && controller->IsConnected() == player_connected) { // Set vibration devices in the event that the input device has changed. ConfigureVibration::SetVibrationDevices(player_index); @@ -523,10 +524,10 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index) // Handheld if (player_index == 0) { - if (controller_type == Core::HID::NpadType::Handheld) { + if (controller_type == Core::HID::NpadStyleIndex::Handheld) { auto* handheld = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); - UpdateController(handheld, Core::HID::NpadType::Handheld, + UpdateController(handheld, Core::HID::NpadStyleIndex::Handheld, player_groupboxes[player_index]->isChecked()); } } @@ -537,7 +538,7 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index) void QtControllerSelectorDialog::UpdateLEDPattern(std::size_t player_index) { if (!player_groupboxes[player_index]->isChecked() || GetControllerTypeFromIndex(emulated_controllers[player_index]->currentIndex(), - player_index) == Core::HID::NpadType::Handheld) { + player_index) == Core::HID::NpadStyleIndex::Handheld) { led_patterns_boxes[player_index][0]->setChecked(false); led_patterns_boxes[player_index][1]->setChecked(false); led_patterns_boxes[player_index][2]->setChecked(false); @@ -632,7 +633,7 @@ void QtControllerSelectorDialog::DisableUnsupportedPlayers() { for (std::size_t index = max_supported_players; index < NUM_PLAYERS; ++index) { auto* controller = system.HIDCore().GetEmulatedControllerByIndex(index); // Disconnect any unsupported players here and disable or hide them if applicable. - UpdateController(controller, controller->GetNpadType(), false); + UpdateController(controller, controller->GetNpadStyleIndex(), false); // Hide the player widgets when max_supported_controllers is less than or equal to 4. if (max_supported_players <= 4) { player_widgets[index]->hide(); diff --git a/src/yuzu/applets/qt_controller.h b/src/yuzu/applets/qt_controller.h index dd981f479..cc343e5ae 100755 --- a/src/yuzu/applets/qt_controller.h +++ b/src/yuzu/applets/qt_controller.h @@ -32,7 +32,7 @@ class System; } namespace Core::HID { -enum class NpadType : u8; +enum class NpadStyleIndex : u8; } class QtControllerSelectorDialog final : public QDialog { @@ -74,10 +74,10 @@ private: void SetEmulatedControllers(std::size_t player_index); // Gets the Controller Type for a given controller combobox index per player. - Core::HID::NpadType GetControllerTypeFromIndex(int index, std::size_t player_index) const; + Core::HID::NpadStyleIndex GetControllerTypeFromIndex(int index, std::size_t player_index) const; // Gets the controller combobox index for a given Controller Type per player. - int GetIndexFromControllerType(Core::HID::NpadType type, std::size_t player_index) const; + int GetIndexFromControllerType(Core::HID::NpadStyleIndex type, std::size_t player_index) const; // Updates the controller icons per player. void UpdateControllerIcon(std::size_t player_index); @@ -139,7 +139,7 @@ private: std::array emulated_controllers; /// Pairs of emulated controller index and Controller Type enum per player. - std::array>, NUM_PLAYERS> + std::array>, NUM_PLAYERS> index_controller_type_pairs; // Labels representing the number of connected controllers diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp index 22155a7e9..36d27307a 100755 --- a/src/yuzu/applets/qt_software_keyboard.cpp +++ b/src/yuzu/applets/qt_software_keyboard.cpp @@ -801,7 +801,7 @@ void QtSoftwareKeyboardDialog::SetControllerImage() { const auto* handheld = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); const auto* player_1 = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); const auto controller_type = - handheld->IsConnected() ? handheld->GetNpadType() : player_1->GetNpadType(); + handheld->IsConnected() ? handheld->GetNpadStyleIndex() : player_1->GetNpadStyleIndex(); const QString theme = [] { if (QIcon::themeName().contains(QStringLiteral("dark")) || @@ -813,8 +813,8 @@ void QtSoftwareKeyboardDialog::SetControllerImage() { }(); switch (controller_type) { - case Core::HID::NpadType::ProController: - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::ProController: + case Core::HID::NpadStyleIndex::GameCube: ui->icon_controller->setStyleSheet( QStringLiteral("image: url(:/overlay/controller_pro%1.png);").arg(theme)); ui->icon_controller_shift->setStyleSheet( @@ -822,7 +822,7 @@ void QtSoftwareKeyboardDialog::SetControllerImage() { ui->icon_controller_num->setStyleSheet( QStringLiteral("image: url(:/overlay/controller_pro%1.png);").arg(theme)); break; - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: ui->icon_controller->setStyleSheet( QStringLiteral("image: url(:/overlay/controller_dual_joycon%1.png);").arg(theme)); ui->icon_controller_shift->setStyleSheet( @@ -830,7 +830,7 @@ void QtSoftwareKeyboardDialog::SetControllerImage() { ui->icon_controller_num->setStyleSheet( QStringLiteral("image: url(:/overlay/controller_dual_joycon%1.png);").arg(theme)); break; - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: ui->icon_controller->setStyleSheet( QStringLiteral("image: url(:/overlay/controller_single_joycon_left%1.png);") .arg(theme)); @@ -841,7 +841,7 @@ void QtSoftwareKeyboardDialog::SetControllerImage() { QStringLiteral("image: url(:/overlay/controller_single_joycon_left%1.png);") .arg(theme)); break; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: ui->icon_controller->setStyleSheet( QStringLiteral("image: url(:/overlay/controller_single_joycon_right%1.png);") .arg(theme)); @@ -852,7 +852,7 @@ void QtSoftwareKeyboardDialog::SetControllerImage() { QStringLiteral("image: url(:/overlay/controller_single_joycon_right%1.png);") .arg(theme)); break; - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::Handheld: ui->icon_controller->setStyleSheet( QStringLiteral("image: url(:/overlay/controller_handheld%1.png);").arg(theme)); ui->icon_controller_shift->setStyleSheet( diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 8d6289d8e..95a9b8614 100755 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -455,7 +455,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i connect(ui->comboControllerType, qOverload(&QComboBox::currentIndexChanged), [this](int index) { emit HandheldStateChanged(GetControllerTypeFromIndex(index) == - Core::HID::NpadType::Handheld); + Core::HID::NpadStyleIndex::Handheld); }); } @@ -482,7 +482,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i UpdateControllerEnabledButtons(); UpdateControllerButtonNames(); UpdateMotionButtons(); - const Core::HID::NpadType type = + const Core::HID::NpadStyleIndex type = GetControllerTypeFromIndex(ui->comboControllerType->currentIndex()); if (player_index == 0) { @@ -492,10 +492,10 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); bool is_connected = emulated_controller->IsConnected(true); - emulated_controller_p1->SetNpadType(type); - emulated_controller_hanheld->SetNpadType(type); + emulated_controller_p1->SetNpadStyleIndex(type); + emulated_controller_hanheld->SetNpadStyleIndex(type); if (is_connected) { - if (type == Core::HID::NpadType::Handheld) { + if (type == Core::HID::NpadStyleIndex::Handheld) { emulated_controller_p1->Disconnect(); emulated_controller_hanheld->Connect(); emulated_controller = emulated_controller_hanheld; @@ -507,7 +507,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i } ui->controllerFrame->SetController(emulated_controller); } - emulated_controller->SetNpadType(type); + emulated_controller->SetNpadStyleIndex(type); }); connect(ui->comboDevices, qOverload(&QComboBox::activated), this, @@ -607,7 +607,8 @@ void ConfigureInputPlayer::LoadConfiguration() { return; } - const int comboBoxIndex = GetIndexFromControllerType(emulated_controller->GetNpadType(true)); + const int comboBoxIndex = + GetIndexFromControllerType(emulated_controller->GetNpadStyleIndex(true)); ui->comboControllerType->setCurrentIndex(comboBoxIndex); ui->groupConnectedController->setChecked(emulated_controller->IsConnected(true)); } @@ -810,37 +811,37 @@ void ConfigureInputPlayer::SetConnectableControllers() { if (enable_all || npad_style_set.fullkey == 1) { index_controller_type_pairs.emplace_back(ui->comboControllerType->count(), - Core::HID::NpadType::ProController); + Core::HID::NpadStyleIndex::ProController); ui->comboControllerType->addItem(tr("Pro Controller")); } if (enable_all || npad_style_set.joycon_dual == 1) { index_controller_type_pairs.emplace_back(ui->comboControllerType->count(), - Core::HID::NpadType::JoyconDual); + Core::HID::NpadStyleIndex::JoyconDual); ui->comboControllerType->addItem(tr("Dual Joycons")); } if (enable_all || npad_style_set.joycon_left == 1) { index_controller_type_pairs.emplace_back(ui->comboControllerType->count(), - Core::HID::NpadType::JoyconLeft); + Core::HID::NpadStyleIndex::JoyconLeft); ui->comboControllerType->addItem(tr("Left Joycon")); } if (enable_all || npad_style_set.joycon_right == 1) { index_controller_type_pairs.emplace_back(ui->comboControllerType->count(), - Core::HID::NpadType::JoyconRight); + Core::HID::NpadStyleIndex::JoyconRight); ui->comboControllerType->addItem(tr("Right Joycon")); } if (player_index == 0 && (enable_all || npad_style_set.handheld == 1)) { index_controller_type_pairs.emplace_back(ui->comboControllerType->count(), - Core::HID::NpadType::Handheld); + Core::HID::NpadStyleIndex::Handheld); ui->comboControllerType->addItem(tr("Handheld")); } if (enable_all || npad_style_set.gamecube == 1) { index_controller_type_pairs.emplace_back(ui->comboControllerType->count(), - Core::HID::NpadType::GameCube); + Core::HID::NpadStyleIndex::GameCube); ui->comboControllerType->addItem(tr("GameCube Controller")); } }; @@ -853,19 +854,19 @@ void ConfigureInputPlayer::SetConnectableControllers() { add_controllers(false, system.HIDCore().GetSupportedStyleTag()); } -Core::HID::NpadType ConfigureInputPlayer::GetControllerTypeFromIndex(int index) const { +Core::HID::NpadStyleIndex ConfigureInputPlayer::GetControllerTypeFromIndex(int index) const { const auto it = std::find_if(index_controller_type_pairs.begin(), index_controller_type_pairs.end(), [index](const auto& pair) { return pair.first == index; }); if (it == index_controller_type_pairs.end()) { - return Core::HID::NpadType::ProController; + return Core::HID::NpadStyleIndex::ProController; } return it->second; } -int ConfigureInputPlayer::GetIndexFromControllerType(Core::HID::NpadType type) const { +int ConfigureInputPlayer::GetIndexFromControllerType(Core::HID::NpadStyleIndex type) const { const auto it = std::find_if(index_controller_type_pairs.begin(), index_controller_type_pairs.end(), [type](const auto& pair) { return pair.second == type; }); @@ -888,7 +889,7 @@ void ConfigureInputPlayer::UpdateInputDevices() { void ConfigureInputPlayer::UpdateControllerAvailableButtons() { auto layout = GetControllerTypeFromIndex(ui->comboControllerType->currentIndex()); if (debug) { - layout = Core::HID::NpadType::ProController; + layout = Core::HID::NpadStyleIndex::ProController; } // List of all the widgets that will be hidden by any of the following layouts that need @@ -913,15 +914,15 @@ void ConfigureInputPlayer::UpdateControllerAvailableButtons() { std::vector layout_hidden; switch (layout) { - case Core::HID::NpadType::ProController: - case Core::HID::NpadType::JoyconDual: - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::ProController: + case Core::HID::NpadStyleIndex::JoyconDual: + case Core::HID::NpadStyleIndex::Handheld: layout_hidden = { ui->buttonShoulderButtonsSLSR, ui->horizontalSpacerShoulderButtonsWidget2, }; break; - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: layout_hidden = { ui->horizontalSpacerShoulderButtonsWidget2, ui->buttonShoulderButtonsRight, @@ -929,7 +930,7 @@ void ConfigureInputPlayer::UpdateControllerAvailableButtons() { ui->bottomRight, }; break; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: layout_hidden = { ui->horizontalSpacerShoulderButtonsWidget, ui->buttonShoulderButtonsLeft, @@ -937,7 +938,7 @@ void ConfigureInputPlayer::UpdateControllerAvailableButtons() { ui->bottomLeft, }; break; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: layout_hidden = { ui->buttonShoulderButtonsSLSR, ui->horizontalSpacerShoulderButtonsWidget2, @@ -957,7 +958,7 @@ void ConfigureInputPlayer::UpdateControllerAvailableButtons() { void ConfigureInputPlayer::UpdateControllerEnabledButtons() { auto layout = GetControllerTypeFromIndex(ui->comboControllerType->currentIndex()); if (debug) { - layout = Core::HID::NpadType::ProController; + layout = Core::HID::NpadStyleIndex::ProController; } // List of all the widgets that will be disabled by any of the following layouts that need @@ -974,13 +975,13 @@ void ConfigureInputPlayer::UpdateControllerEnabledButtons() { std::vector layout_disable; switch (layout) { - case Core::HID::NpadType::ProController: - case Core::HID::NpadType::JoyconDual: - case Core::HID::NpadType::Handheld: - case Core::HID::NpadType::JoyconLeft: - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::ProController: + case Core::HID::NpadStyleIndex::JoyconDual: + case Core::HID::NpadStyleIndex::Handheld: + case Core::HID::NpadStyleIndex::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconRight: break; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: layout_disable = { ui->buttonHome, ui->buttonLStickPressedGroup, @@ -1007,24 +1008,24 @@ void ConfigureInputPlayer::UpdateMotionButtons() { // Show/hide the "Motion 1/2" groupboxes depending on the currently selected controller. switch (GetControllerTypeFromIndex(ui->comboControllerType->currentIndex())) { - case Core::HID::NpadType::ProController: - case Core::HID::NpadType::JoyconLeft: - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::ProController: + case Core::HID::NpadStyleIndex::JoyconLeft: + case Core::HID::NpadStyleIndex::Handheld: // Show "Motion 1" and hide "Motion 2". ui->buttonMotionLeftGroup->show(); ui->buttonMotionRightGroup->hide(); break; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: // Show "Motion 2" and hide "Motion 1". ui->buttonMotionLeftGroup->hide(); ui->buttonMotionRightGroup->show(); break; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: // Hide both "Motion 1/2". ui->buttonMotionLeftGroup->hide(); ui->buttonMotionRightGroup->hide(); break; - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: default: // Show both "Motion 1/2". ui->buttonMotionLeftGroup->show(); @@ -1036,15 +1037,15 @@ void ConfigureInputPlayer::UpdateMotionButtons() { void ConfigureInputPlayer::UpdateControllerButtonNames() { auto layout = GetControllerTypeFromIndex(ui->comboControllerType->currentIndex()); if (debug) { - layout = Core::HID::NpadType::ProController; + layout = Core::HID::NpadStyleIndex::ProController; } switch (layout) { - case Core::HID::NpadType::ProController: - case Core::HID::NpadType::JoyconDual: - case Core::HID::NpadType::Handheld: - case Core::HID::NpadType::JoyconLeft: - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::ProController: + case Core::HID::NpadStyleIndex::JoyconDual: + case Core::HID::NpadStyleIndex::Handheld: + case Core::HID::NpadStyleIndex::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconRight: ui->buttonMiscButtonsPlusGroup->setTitle(tr("Plus")); ui->buttonShoulderButtonsButtonZLGroup->setTitle(tr("ZL")); ui->buttonShoulderButtonsZRGroup->setTitle(tr("ZR")); @@ -1052,7 +1053,7 @@ void ConfigureInputPlayer::UpdateControllerButtonNames() { ui->LStick->setTitle(tr("Left Stick")); ui->RStick->setTitle(tr("Right Stick")); break; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: ui->buttonMiscButtonsPlusGroup->setTitle(tr("Start / Pause")); ui->buttonShoulderButtonsButtonZLGroup->setTitle(tr("L")); ui->buttonShoulderButtonsZRGroup->setTitle(tr("R")); diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h index 02d6920f1..7bff4b196 100755 --- a/src/yuzu/configuration/configure_input_player.h +++ b/src/yuzu/configuration/configure_input_player.h @@ -51,7 +51,7 @@ class System; namespace Core::HID { class EmulatedController; -enum class NpadType : u8; +enum class NpadStyleIndex : u8; } // namespace Core::HID class ConfigureInputPlayer : public QWidget { @@ -134,10 +134,10 @@ private: void SetConnectableControllers(); /// Gets the Controller Type for a given controller combobox index. - Core::HID::NpadType GetControllerTypeFromIndex(int index) const; + Core::HID::NpadStyleIndex GetControllerTypeFromIndex(int index) const; /// Gets the controller combobox index for a given Controller Type. - int GetIndexFromControllerType(Core::HID::NpadType type) const; + int GetIndexFromControllerType(Core::HID::NpadStyleIndex type) const; /// Update the available input devices. void UpdateInputDevices(); @@ -182,7 +182,7 @@ private: std::unique_ptr poll_timer; /// Stores a pair of "Connected Controllers" combobox index and Controller Type enum. - std::vector> index_controller_type_pairs; + std::vector> index_controller_type_pairs; static constexpr int PLAYER_COUNT = 8; std::array player_connected_checkbox; diff --git a/src/yuzu/configuration/configure_input_player.ui b/src/yuzu/configuration/configure_input_player.ui index 958a89229..756a414b5 100755 --- a/src/yuzu/configuration/configure_input_player.ui +++ b/src/yuzu/configuration/configure_input_player.ui @@ -117,11 +117,8 @@ - - - 0 - 21 - + + 60 @@ -307,7 +304,7 @@ 3 - 0 + 6 3 @@ -883,7 +880,7 @@ 3 - 0 + 6 3 @@ -2186,7 +2183,7 @@ 3 - 0 + 6 3 @@ -2535,7 +2532,7 @@ 3 - 0 + 6 3 diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index 7e71a0f58..af65cf64c 100755 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp @@ -147,7 +147,7 @@ void PlayerControlPreview::ControllerUpdate(Core::HID::ControllerTriggerType typ needs_redraw = true; break; case Core::HID::ControllerTriggerType::Type: - controller_type = controller->GetNpadType(true); + controller_type = controller->GetNpadStyleIndex(true); needs_redraw = true; break; case Core::HID::ControllerTriggerType::Color: @@ -221,22 +221,22 @@ void PlayerControlPreview::paintEvent(QPaintEvent* event) { const QPointF center = rect().center(); switch (controller_type) { - case Core::HID::NpadType::Handheld: + case Core::HID::NpadStyleIndex::Handheld: DrawHandheldController(p, center); break; - case Core::HID::NpadType::JoyconDual: + case Core::HID::NpadStyleIndex::JoyconDual: DrawDualController(p, center); break; - case Core::HID::NpadType::JoyconLeft: + case Core::HID::NpadStyleIndex::JoyconLeft: DrawLeftController(p, center); break; - case Core::HID::NpadType::JoyconRight: + case Core::HID::NpadStyleIndex::JoyconRight: DrawRightController(p, center); break; - case Core::HID::NpadType::GameCube: + case Core::HID::NpadStyleIndex::GameCube: DrawGCController(p, center); break; - case Core::HID::NpadType::ProController: + case Core::HID::NpadStyleIndex::ProController: default: DrawProController(p, center); break; @@ -2394,7 +2394,7 @@ void PlayerControlPreview::DrawGCJoystick(QPainter& p, const QPointF center, void PlayerControlPreview::DrawRawJoystick(QPainter& p, QPointF center_left, QPointF center_right) { using namespace Settings::NativeAnalog; - if (controller_type != Core::HID::NpadType::JoyconLeft) { + if (center_right != QPointF(0, 0)) { DrawJoystickProperties(p, center_right, stick_values[RStick].x.properties); p.setPen(colors.indicator); p.setBrush(colors.indicator); @@ -2404,7 +2404,7 @@ void PlayerControlPreview::DrawRawJoystick(QPainter& p, QPointF center_left, QPo DrawJoystickDot(p, center_right, stick_values[RStick], false); } - if (controller_type != Core::HID::NpadType::JoyconRight) { + if (center_left != QPointF(0, 0)) { DrawJoystickProperties(p, center_left, stick_values[LStick].x.properties); p.setPen(colors.indicator); p.setBrush(colors.indicator); diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h index acc53a9e3..ee217f3c9 100755 --- a/src/yuzu/configuration/configure_input_player_widget.h +++ b/src/yuzu/configuration/configure_input_player_widget.h @@ -203,7 +203,7 @@ private: bool is_controller_set{}; bool is_connected{}; bool needs_redraw{}; - Core::HID::NpadType controller_type; + Core::HID::NpadStyleIndex controller_type; bool mapping_active{}; int blink_counter{}; diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 8697bc0fb..7d6618c02 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -230,6 +230,7 @@ GMainWindow::GMainWindow() ConnectWidgetEvents(); system->HIDCore().ReloadInputDevices(); + controller_dialog->refreshConfiguration(); const auto branch_name = std::string(Common::g_scm_branch); const auto description = std::string(Common::g_scm_desc); @@ -840,8 +841,9 @@ void GMainWindow::InitializeWidgets() { tr("Handheld controller can't be used on docked mode. Pro " "controller will be selected.")); handheld->Disconnect(); - player_1->SetNpadType(Core::HID::NpadType::ProController); + player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); player_1->Connect(); + controller_dialog->refreshConfiguration(); } Settings::values.use_docked_mode.SetValue(!is_docked); @@ -2809,6 +2811,7 @@ void GMainWindow::OnConfigure() { } UpdateStatusButtons(); + controller_dialog->refreshConfiguration(); } void GMainWindow::OnConfigureTas() {