yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

core: hid: Clean up headers

This commit is contained in:
Narr the Reg 2023-12-14 09:31:38 -06:00
parent 64f68e9635
commit d10464de30
20 changed files with 16 additions and 36 deletions

View File

@ -1,13 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/core.h"
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/hid/emulated_console.h" #include "core/hid/emulated_console.h"
#include "core/hid/hid_core.h" #include "core/hid/hid_core.h"
#include "core/hle/service/hid/controllers/console_six_axis.h" #include "core/hle/service/hid/controllers/console_six_axis.h"
#include "core/hle/service/hid/controllers/shared_memory_format.h" #include "core/hle/service/hid/controllers/shared_memory_format.h"
#include "core/memory.h"
namespace Service::HID { namespace Service::HID {

View File

@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <cstring>
#include "common/common_types.h"
#include "common/settings.h" #include "common/settings.h"
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/hid/emulated_controller.h" #include "core/hid/emulated_controller.h"

View File

@ -3,7 +3,6 @@
#pragma once #pragma once
#include "common/common_types.h"
#include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/controller_base.h"
#include "core/hle/service/hid/controllers/types/debug_pad_types.h" #include "core/hle/service/hid/controllers/types/debug_pad_types.h"

View File

@ -1,11 +1,10 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "common/logging/log.h"
#include "common/math_util.h" #include "common/math_util.h"
#include "common/settings.h" #include "common/settings.h"
#include "core/core_timing.h"
#include "core/frontend/emu_window.h" #include "core/frontend/emu_window.h"
#include "core/hid/emulated_console.h"
#include "core/hid/hid_core.h" #include "core/hid/hid_core.h"
#include "core/hle/service/hid/controllers/gesture.h" #include "core/hle/service/hid/controllers/gesture.h"
#include "core/hle/service/hid/controllers/shared_memory_format.h" #include "core/hle/service/hid/controllers/shared_memory_format.h"

View File

@ -6,10 +6,13 @@
#include <array> #include <array>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hid/emulated_console.h"
#include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/controller_base.h"
#include "core/hle/service/hid/controllers/types/touch_types.h" #include "core/hle/service/hid/controllers/types/touch_types.h"
namespace Core::HID {
class EmulatedConsole;
}
namespace Service::HID { namespace Service::HID {
struct GestureSharedMemoryFormat; struct GestureSharedMemoryFormat;

View File

@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <cstring>
#include "common/common_types.h"
#include "common/settings.h" #include "common/settings.h"
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/hid/emulated_devices.h" #include "core/hid/emulated_devices.h"

View File

@ -3,10 +3,8 @@
#pragma once #pragma once
#include "common/common_types.h"
#include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/controller_base.h"
#include "core/hle/service/hid/controllers/types/keyboard_types.h" #include "core/hle/service/hid/controllers/types/keyboard_types.h"
#include "core/hle/service/hid/ring_lifo.h"
namespace Service::HID { namespace Service::HID {
struct KeyboardSharedMemoryFormat; struct KeyboardSharedMemoryFormat;

View File

@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <cstring>
#include "common/common_types.h"
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/frontend/emu_window.h" #include "core/frontend/emu_window.h"
#include "core/hid/emulated_devices.h" #include "core/hid/emulated_devices.h"

View File

@ -3,9 +3,7 @@
#pragma once #pragma once
#include "common/common_types.h"
#include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/controller_base.h"
#include "core/hle/service/hid/ring_lifo.h"
namespace Core::HID { namespace Core::HID {
class EmulatedDevices; class EmulatedDevices;

View File

@ -8,13 +8,10 @@
#include <mutex> #include <mutex>
#include <span> #include <span>
#include "common/bit_field.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hid/hid_types.h" #include "core/hid/hid_types.h"
#include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/controller_base.h"
#include "core/hle/service/hid/controllers/types/npad_types.h" #include "core/hle/service/hid/controllers/types/npad_types.h"
#include "core/hle/service/hid/ring_lifo.h"
namespace Core::HID { namespace Core::HID {
class EmulatedController; class EmulatedController;
@ -192,7 +189,7 @@ private:
std::atomic<u64> press_state{}; std::atomic<u64> press_state{};
std::array<NpadControllerData, NPAD_COUNT> controller_data{}; std::array<NpadControllerData, NpadCount> controller_data{};
KernelHelpers::ServiceContext& service_context; KernelHelpers::ServiceContext& service_context;
std::mutex mutex; std::mutex mutex;
std::vector<Core::HID::NpadIdType> supported_npad_id_types{}; std::vector<Core::HID::NpadIdType> supported_npad_id_types{};

View File

@ -171,7 +171,7 @@ static_assert(sizeof(NpadSharedMemoryEntry) == 0x5000, "NpadSharedMemoryEntry is
// This is nn::hid::detail::NpadSharedMemoryFormat // This is nn::hid::detail::NpadSharedMemoryFormat
struct NpadSharedMemoryFormat { struct NpadSharedMemoryFormat {
std::array<NpadSharedMemoryEntry, NPAD_COUNT> npad_entry; std::array<NpadSharedMemoryEntry, NpadCount> npad_entry;
}; };
static_assert(sizeof(NpadSharedMemoryFormat) == 0x32000, static_assert(sizeof(NpadSharedMemoryFormat) == 0x32000,
"NpadSharedMemoryFormat is an invalid size"); "NpadSharedMemoryFormat is an invalid size");
@ -198,6 +198,7 @@ struct ConsoleSixAxisSensorSharedMemoryFormat {
static_assert(sizeof(ConsoleSixAxisSensorSharedMemoryFormat) == 0x20, static_assert(sizeof(ConsoleSixAxisSensorSharedMemoryFormat) == 0x20,
"ConsoleSixAxisSensorSharedMemoryFormat is an invalid size"); "ConsoleSixAxisSensorSharedMemoryFormat is an invalid size");
// This is nn::hid::detail::SharedMemoryFormat
struct SharedMemoryFormat { struct SharedMemoryFormat {
void Initialize() {} void Initialize() {}

View File

@ -10,6 +10,10 @@
namespace Service::HID { namespace Service::HID {
SharedMemoryHolder::SharedMemoryHolder() {} SharedMemoryHolder::SharedMemoryHolder() {}
SharedMemoryHolder::~SharedMemoryHolder() {
Finalize();
}
Result SharedMemoryHolder::Initialize(Core::System& system) { Result SharedMemoryHolder::Initialize(Core::System& system) {
shared_memory = Kernel::KSharedMemory::Create(system.Kernel()); shared_memory = Kernel::KSharedMemory::Create(system.Kernel());
const Result result = shared_memory->Initialize( const Result result = shared_memory->Initialize(

View File

@ -3,7 +3,6 @@
#pragma once #pragma once
#include "common/common_types.h"
#include "core/hle/result.h" #include "core/hle/result.h"
namespace Core { namespace Core {
@ -21,6 +20,7 @@ struct SharedMemoryFormat;
class SharedMemoryHolder { class SharedMemoryHolder {
public: public:
SharedMemoryHolder(); SharedMemoryHolder();
~SharedMemoryHolder();
Result Initialize(Core::System& system); Result Initialize(Core::System& system);
void Finalize(); void Finalize();

View File

@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <cstring>
#include "common/common_types.h"
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/hle/service/hid/controllers/shared_memory_format.h" #include "core/hle/service/hid/controllers/shared_memory_format.h"
#include "core/hle/service/hid/controllers/stubbed.h" #include "core/hle/service/hid/controllers/stubbed.h"

View File

@ -3,7 +3,6 @@
#pragma once #pragma once
#include "common/common_types.h"
#include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/controller_base.h"
namespace Service::HID { namespace Service::HID {

View File

@ -2,10 +2,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm> #include <algorithm>
#include <cstring>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/settings.h" #include "common/settings.h"
#include "core/core.h"
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/frontend/emu_window.h" #include "core/frontend/emu_window.h"
#include "core/hid/emulated_console.h" #include "core/hid/emulated_console.h"

View File

@ -5,11 +5,9 @@
#include <array> #include <array>
#include "common/common_types.h"
#include "core/hid/hid_types.h" #include "core/hid/hid_types.h"
#include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/controller_base.h"
#include "core/hle/service/hid/controllers/types/touch_types.h" #include "core/hle/service/hid/controllers/types/touch_types.h"
#include "core/hle/service/hid/ring_lifo.h"
namespace Core::HID { namespace Core::HID {
class EmulatedConsole; class EmulatedConsole;

View File

@ -3,10 +3,6 @@
#pragma once #pragma once
#include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/vector_math.h"
#include "core/hid/hid_types.h"
#include "core/hle/service/hid/ring_lifo.h"
namespace Service::HID {} // namespace Service::HID namespace Service::HID {} // namespace Service::HID

View File

@ -3,14 +3,13 @@
#pragma once #pragma once
#include "common/bit_field.h"
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/vector_math.h"
#include "core/hid/hid_types.h" #include "core/hid/hid_types.h"
#include "core/hle/service/hid/ring_lifo.h"
namespace Service::HID { namespace Service::HID {
static constexpr std::size_t NPAD_COUNT = 10; static constexpr std::size_t NpadCount = 10;
// This is nn::hid::NpadJoyHoldType // This is nn::hid::NpadJoyHoldType
enum class NpadJoyHoldType : u64 { enum class NpadJoyHoldType : u64 {

View File

@ -231,6 +231,7 @@ void ResourceManager::UpdateControllers(std::uintptr_t user_data,
std::chrono::nanoseconds ns_late) { std::chrono::nanoseconds ns_late) {
auto& core_timing = system.CoreTiming(); auto& core_timing = system.CoreTiming();
debug_pad->OnUpdate(core_timing); debug_pad->OnUpdate(core_timing);
digitizer->OnUpdate(core_timing);
unique_pad->OnUpdate(core_timing); unique_pad->OnUpdate(core_timing);
gesture->OnUpdate(core_timing); gesture->OnUpdate(core_timing);
touch_screen->OnUpdate(core_timing); touch_screen->OnUpdate(core_timing);