diff options
23 files changed, 87 insertions, 25 deletions
diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cpp index 25cee1f3a..ed0775444 100644 --- a/src/core/crypto/partition_data_manager.cpp +++ b/src/core/crypto/partition_data_manager.cpp | |||
| @@ -516,7 +516,8 @@ void PartitionDataManager::DecryptPackage2(const std::array<Key128, 0x20>& packa | |||
| 516 | out.insert(out.end(), rodata.begin(), rodata.end()); | 516 | out.insert(out.end(), rodata.begin(), rodata.end()); |
| 517 | out.insert(out.end(), data.begin(), data.end()); | 517 | out.insert(out.end(), data.begin(), data.end()); |
| 518 | 518 | ||
| 519 | offset += sizeof(KIPHeader) + out.size(); | 519 | offset += sizeof(KIPHeader) + kip.sections[0].size_compressed + |
| 520 | kip.sections[1].size_compressed + kip.sections[2].size_compressed; | ||
| 520 | 521 | ||
| 521 | if (name == "FS") | 522 | if (name == "FS") |
| 522 | package2_fs[static_cast<size_t>(type)] = std::move(out); | 523 | package2_fs[static_cast<size_t>(type)] = std::move(out); |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 69bfce1c1..4d1f83170 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -638,10 +638,12 @@ IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationF | |||
| 638 | {24, nullptr, "GetLaunchStorageInfoForDebug"}, | 638 | {24, nullptr, "GetLaunchStorageInfoForDebug"}, |
| 639 | {25, nullptr, "ExtendSaveData"}, | 639 | {25, nullptr, "ExtendSaveData"}, |
| 640 | {26, nullptr, "GetSaveDataSize"}, | 640 | {26, nullptr, "GetSaveDataSize"}, |
| 641 | {30, nullptr, "BeginBlockingHomeButtonShortAndLongPressed"}, | 641 | {30, &IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed, |
| 642 | {31, nullptr, "EndBlockingHomeButtonShortAndLongPressed"}, | 642 | "BeginBlockingHomeButtonShortAndLongPressed"}, |
| 643 | {32, nullptr, "BeginBlockingHomeButton"}, | 643 | {31, &IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed, |
| 644 | {33, nullptr, "EndBlockingHomeButton"}, | 644 | "EndBlockingHomeButtonShortAndLongPressed"}, |
| 645 | {32, &IApplicationFunctions::BeginBlockingHomeButton, "BeginBlockingHomeButton"}, | ||
| 646 | {33, &IApplicationFunctions::EndBlockingHomeButton, "EndBlockingHomeButton"}, | ||
| 645 | {40, &IApplicationFunctions::NotifyRunning, "NotifyRunning"}, | 647 | {40, &IApplicationFunctions::NotifyRunning, "NotifyRunning"}, |
| 646 | {50, &IApplicationFunctions::GetPseudoDeviceId, "GetPseudoDeviceId"}, | 648 | {50, &IApplicationFunctions::GetPseudoDeviceId, "GetPseudoDeviceId"}, |
| 647 | {60, nullptr, "SetMediaPlaybackStateForApplication"}, | 649 | {60, nullptr, "SetMediaPlaybackStateForApplication"}, |
| @@ -669,6 +671,32 @@ IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationF | |||
| 669 | 671 | ||
| 670 | IApplicationFunctions::~IApplicationFunctions() = default; | 672 | IApplicationFunctions::~IApplicationFunctions() = default; |
| 671 | 673 | ||
| 674 | void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed( | ||
| 675 | Kernel::HLERequestContext& ctx) { | ||
| 676 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 677 | rb.Push(RESULT_SUCCESS); | ||
| 678 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 679 | } | ||
| 680 | |||
| 681 | void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed( | ||
| 682 | Kernel::HLERequestContext& ctx) { | ||
| 683 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 684 | rb.Push(RESULT_SUCCESS); | ||
| 685 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 686 | } | ||
| 687 | |||
| 688 | void IApplicationFunctions::BeginBlockingHomeButton(Kernel::HLERequestContext& ctx) { | ||
| 689 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 690 | rb.Push(RESULT_SUCCESS); | ||
| 691 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 692 | } | ||
| 693 | |||
| 694 | void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx) { | ||
| 695 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 696 | rb.Push(RESULT_SUCCESS); | ||
| 697 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 698 | } | ||
| 699 | |||
| 672 | void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { | 700 | void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { |
| 673 | constexpr std::array<u8, 0x88> data{{ | 701 | constexpr std::array<u8, 0x88> data{{ |
| 674 | 0xca, 0x97, 0x94, 0xc7, // Magic | 702 | 0xca, 0x97, 0x94, 0xc7, // Magic |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index b39b0d838..095f94851 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -154,6 +154,10 @@ private: | |||
| 154 | void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx); | 154 | void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx); |
| 155 | void NotifyRunning(Kernel::HLERequestContext& ctx); | 155 | void NotifyRunning(Kernel::HLERequestContext& ctx); |
| 156 | void GetPseudoDeviceId(Kernel::HLERequestContext& ctx); | 156 | void GetPseudoDeviceId(Kernel::HLERequestContext& ctx); |
| 157 | void BeginBlockingHomeButtonShortAndLongPressed(Kernel::HLERequestContext& ctx); | ||
| 158 | void EndBlockingHomeButtonShortAndLongPressed(Kernel::HLERequestContext& ctx); | ||
| 159 | void BeginBlockingHomeButton(Kernel::HLERequestContext& ctx); | ||
| 160 | void EndBlockingHomeButton(Kernel::HLERequestContext& ctx); | ||
| 157 | }; | 161 | }; |
| 158 | 162 | ||
| 159 | class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> { | 163 | class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> { |
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 518161bf7..428069df2 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include "core/file_sys/patch_manager.h" | 13 | #include "core/file_sys/patch_manager.h" |
| 14 | #include "core/file_sys/registered_cache.h" | 14 | #include "core/file_sys/registered_cache.h" |
| 15 | #include "core/hle/ipc_helpers.h" | 15 | #include "core/hle/ipc_helpers.h" |
| 16 | #include "core/hle/kernel/event.h" | ||
| 16 | #include "core/hle/kernel/process.h" | 17 | #include "core/hle/kernel/process.h" |
| 17 | #include "core/hle/service/aoc/aoc_u.h" | 18 | #include "core/hle/service/aoc/aoc_u.h" |
| 18 | #include "core/hle/service/filesystem/filesystem.h" | 19 | #include "core/hle/service/filesystem/filesystem.h" |
| @@ -55,9 +56,13 @@ AOC_U::AOC_U() : ServiceFramework("aoc:u"), add_on_content(AccumulateAOCTitleIDs | |||
| 55 | {5, &AOC_U::GetAddOnContentBaseId, "GetAddOnContentBaseId"}, | 56 | {5, &AOC_U::GetAddOnContentBaseId, "GetAddOnContentBaseId"}, |
| 56 | {6, nullptr, "PrepareAddOnContentByApplicationId"}, | 57 | {6, nullptr, "PrepareAddOnContentByApplicationId"}, |
| 57 | {7, &AOC_U::PrepareAddOnContent, "PrepareAddOnContent"}, | 58 | {7, &AOC_U::PrepareAddOnContent, "PrepareAddOnContent"}, |
| 58 | {8, nullptr, "GetAddOnContentListChangedEvent"}, | 59 | {8, &AOC_U::GetAddOnContentListChangedEvent, "GetAddOnContentListChangedEvent"}, |
| 59 | }; | 60 | }; |
| 60 | RegisterHandlers(functions); | 61 | RegisterHandlers(functions); |
| 62 | |||
| 63 | auto& kernel = Core::System::GetInstance().Kernel(); | ||
| 64 | aoc_change_event = Kernel::Event::Create(kernel, Kernel::ResetType::Sticky, | ||
| 65 | "GetAddOnContentListChanged:Event"); | ||
| 61 | } | 66 | } |
| 62 | 67 | ||
| 63 | AOC_U::~AOC_U() = default; | 68 | AOC_U::~AOC_U() = default; |
| @@ -130,6 +135,14 @@ void AOC_U::PrepareAddOnContent(Kernel::HLERequestContext& ctx) { | |||
| 130 | rb.Push(RESULT_SUCCESS); | 135 | rb.Push(RESULT_SUCCESS); |
| 131 | } | 136 | } |
| 132 | 137 | ||
| 138 | void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) { | ||
| 139 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | ||
| 140 | |||
| 141 | IPC::ResponseBuilder rb{ctx, 2, 1}; | ||
| 142 | rb.Push(RESULT_SUCCESS); | ||
| 143 | rb.PushCopyObjects(aoc_change_event); | ||
| 144 | } | ||
| 145 | |||
| 133 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 146 | void InstallInterfaces(SM::ServiceManager& service_manager) { |
| 134 | std::make_shared<AOC_U>()->InstallAsService(service_manager); | 147 | std::make_shared<AOC_U>()->InstallAsService(service_manager); |
| 135 | } | 148 | } |
diff --git a/src/core/hle/service/aoc/aoc_u.h b/src/core/hle/service/aoc/aoc_u.h index b3c7cab7a..68d94fdaa 100644 --- a/src/core/hle/service/aoc/aoc_u.h +++ b/src/core/hle/service/aoc/aoc_u.h | |||
| @@ -18,8 +18,10 @@ private: | |||
| 18 | void ListAddOnContent(Kernel::HLERequestContext& ctx); | 18 | void ListAddOnContent(Kernel::HLERequestContext& ctx); |
| 19 | void GetAddOnContentBaseId(Kernel::HLERequestContext& ctx); | 19 | void GetAddOnContentBaseId(Kernel::HLERequestContext& ctx); |
| 20 | void PrepareAddOnContent(Kernel::HLERequestContext& ctx); | 20 | void PrepareAddOnContent(Kernel::HLERequestContext& ctx); |
| 21 | void GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx); | ||
| 21 | 22 | ||
| 22 | std::vector<u64> add_on_content; | 23 | std::vector<u64> add_on_content; |
| 24 | Kernel::SharedPtr<Kernel::Event> aoc_change_event; | ||
| 23 | }; | 25 | }; |
| 24 | 26 | ||
| 25 | /// Registers all AOC services with the specified service manager. | 27 | /// Registers all AOC services with the specified service manager. |
diff --git a/src/core/hle/service/hid/controllers/controller_base.cpp b/src/core/hle/service/hid/controllers/controller_base.cpp index 1625e9c3d..0993a7815 100644 --- a/src/core/hle/service/hid/controllers/controller_base.cpp +++ b/src/core/hle/service/hid/controllers/controller_base.cpp | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | #include "core/hle/service/hid/controllers/controller_base.h" | 5 | #include "core/hle/service/hid/controllers/controller_base.h" |
| 6 | 6 | ||
| 7 | namespace Service::HID { | 7 | namespace Service::HID { |
| 8 | |||
| 9 | ControllerBase::ControllerBase() = default; | ||
| 8 | ControllerBase::~ControllerBase() = default; | 10 | ControllerBase::~ControllerBase() = default; |
| 9 | 11 | ||
| 10 | void ControllerBase::ActivateController() { | 12 | void ControllerBase::ActivateController() { |
diff --git a/src/core/hle/service/hid/controllers/controller_base.h b/src/core/hle/service/hid/controllers/controller_base.h index fa98e2354..f0e092b1b 100644 --- a/src/core/hle/service/hid/controllers/controller_base.h +++ b/src/core/hle/service/hid/controllers/controller_base.h | |||
| @@ -10,8 +10,8 @@ | |||
| 10 | namespace Service::HID { | 10 | namespace Service::HID { |
| 11 | class ControllerBase { | 11 | class ControllerBase { |
| 12 | public: | 12 | public: |
| 13 | ControllerBase() = default; | 13 | ControllerBase(); |
| 14 | virtual ~ControllerBase() = 0; | 14 | virtual ~ControllerBase(); |
| 15 | 15 | ||
| 16 | // Called when the controller is initialized | 16 | // Called when the controller is initialized |
| 17 | virtual void OnInit() = 0; | 17 | virtual void OnInit() = 0; |
diff --git a/src/core/hle/service/hid/controllers/debug_pad.cpp b/src/core/hle/service/hid/controllers/debug_pad.cpp index 6f8ef6e3f..3d100763f 100644 --- a/src/core/hle/service/hid/controllers/debug_pad.cpp +++ b/src/core/hle/service/hid/controllers/debug_pad.cpp | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/swap.h" | ||
| 8 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 9 | #include "core/hle/service/hid/controllers/debug_pad.h" | 8 | #include "core/hle/service/hid/controllers/debug_pad.h" |
| 10 | 9 | ||
| 11 | namespace Service::HID { | 10 | namespace Service::HID { |
| 12 | 11 | ||
| 13 | Controller_DebugPad::Controller_DebugPad() = default; | 12 | Controller_DebugPad::Controller_DebugPad() = default; |
| 13 | Controller_DebugPad::~Controller_DebugPad() = default; | ||
| 14 | 14 | ||
| 15 | void Controller_DebugPad::OnInit() {} | 15 | void Controller_DebugPad::OnInit() {} |
| 16 | 16 | ||
diff --git a/src/core/hle/service/hid/controllers/debug_pad.h b/src/core/hle/service/hid/controllers/debug_pad.h index e35675fa1..62b4f2682 100644 --- a/src/core/hle/service/hid/controllers/debug_pad.h +++ b/src/core/hle/service/hid/controllers/debug_pad.h | |||
| @@ -14,6 +14,7 @@ namespace Service::HID { | |||
| 14 | class Controller_DebugPad final : public ControllerBase { | 14 | class Controller_DebugPad final : public ControllerBase { |
| 15 | public: | 15 | public: |
| 16 | Controller_DebugPad(); | 16 | Controller_DebugPad(); |
| 17 | ~Controller_DebugPad() override; | ||
| 17 | 18 | ||
| 18 | // Called when the controller is initialized | 19 | // Called when the controller is initialized |
| 19 | void OnInit() override; | 20 | void OnInit() override; |
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index b473b9e2b..898572277 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/swap.h" | ||
| 8 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 9 | #include "core/hle/service/hid/controllers/gesture.h" | 8 | #include "core/hle/service/hid/controllers/gesture.h" |
| 10 | 9 | ||
| @@ -12,6 +11,7 @@ namespace Service::HID { | |||
| 12 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3BA00; | 11 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3BA00; |
| 13 | 12 | ||
| 14 | Controller_Gesture::Controller_Gesture() = default; | 13 | Controller_Gesture::Controller_Gesture() = default; |
| 14 | Controller_Gesture::~Controller_Gesture() = default; | ||
| 15 | 15 | ||
| 16 | void Controller_Gesture::OnInit() {} | 16 | void Controller_Gesture::OnInit() {} |
| 17 | 17 | ||
diff --git a/src/core/hle/service/hid/controllers/gesture.h b/src/core/hle/service/hid/controllers/gesture.h index 0ced50dfd..1056ffbcd 100644 --- a/src/core/hle/service/hid/controllers/gesture.h +++ b/src/core/hle/service/hid/controllers/gesture.h | |||
| @@ -13,6 +13,7 @@ namespace Service::HID { | |||
| 13 | class Controller_Gesture final : public ControllerBase { | 13 | class Controller_Gesture final : public ControllerBase { |
| 14 | public: | 14 | public: |
| 15 | Controller_Gesture(); | 15 | Controller_Gesture(); |
| 16 | ~Controller_Gesture() override; | ||
| 16 | 17 | ||
| 17 | // Called when the controller is initialized | 18 | // Called when the controller is initialized |
| 18 | void OnInit() override; | 19 | void OnInit() override; |
diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp index 089c02ac4..ccfbce9ac 100644 --- a/src/core/hle/service/hid/controllers/keyboard.cpp +++ b/src/core/hle/service/hid/controllers/keyboard.cpp | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/swap.h" | ||
| 8 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 9 | #include "core/hle/service/hid/controllers/keyboard.h" | 8 | #include "core/hle/service/hid/controllers/keyboard.h" |
| 10 | 9 | ||
| @@ -12,6 +11,7 @@ namespace Service::HID { | |||
| 12 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3800; | 11 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3800; |
| 13 | 12 | ||
| 14 | Controller_Keyboard::Controller_Keyboard() = default; | 13 | Controller_Keyboard::Controller_Keyboard() = default; |
| 14 | Controller_Keyboard::~Controller_Keyboard() = default; | ||
| 15 | 15 | ||
| 16 | void Controller_Keyboard::OnInit() {} | 16 | void Controller_Keyboard::OnInit() {} |
| 17 | 17 | ||
diff --git a/src/core/hle/service/hid/controllers/keyboard.h b/src/core/hle/service/hid/controllers/keyboard.h index 778e14f7e..493e68fce 100644 --- a/src/core/hle/service/hid/controllers/keyboard.h +++ b/src/core/hle/service/hid/controllers/keyboard.h | |||
| @@ -14,6 +14,7 @@ namespace Service::HID { | |||
| 14 | class Controller_Keyboard final : public ControllerBase { | 14 | class Controller_Keyboard final : public ControllerBase { |
| 15 | public: | 15 | public: |
| 16 | Controller_Keyboard(); | 16 | Controller_Keyboard(); |
| 17 | ~Controller_Keyboard() override; | ||
| 17 | 18 | ||
| 18 | // Called when the controller is initialized | 19 | // Called when the controller is initialized |
| 19 | void OnInit() override; | 20 | void OnInit() override; |
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp index 78e9b5e9e..4e246a57d 100644 --- a/src/core/hle/service/hid/controllers/mouse.cpp +++ b/src/core/hle/service/hid/controllers/mouse.cpp | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/swap.h" | ||
| 8 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 9 | #include "core/hle/service/hid/controllers/mouse.h" | 8 | #include "core/hle/service/hid/controllers/mouse.h" |
| 10 | 9 | ||
| @@ -12,6 +11,7 @@ namespace Service::HID { | |||
| 12 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3400; | 11 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3400; |
| 13 | 12 | ||
| 14 | Controller_Mouse::Controller_Mouse() = default; | 13 | Controller_Mouse::Controller_Mouse() = default; |
| 14 | Controller_Mouse::~Controller_Mouse() = default; | ||
| 15 | 15 | ||
| 16 | void Controller_Mouse::OnInit() {} | 16 | void Controller_Mouse::OnInit() {} |
| 17 | 17 | ||
diff --git a/src/core/hle/service/hid/controllers/mouse.h b/src/core/hle/service/hid/controllers/mouse.h index 05358a4f5..543b0b71f 100644 --- a/src/core/hle/service/hid/controllers/mouse.h +++ b/src/core/hle/service/hid/controllers/mouse.h | |||
| @@ -13,6 +13,7 @@ namespace Service::HID { | |||
| 13 | class Controller_Mouse final : public ControllerBase { | 13 | class Controller_Mouse final : public ControllerBase { |
| 14 | public: | 14 | public: |
| 15 | Controller_Mouse(); | 15 | Controller_Mouse(); |
| 16 | ~Controller_Mouse() override; | ||
| 16 | 17 | ||
| 17 | // Called when the controller is initialized | 18 | // Called when the controller is initialized |
| 18 | void OnInit() override; | 19 | void OnInit() override; |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index d17e64b2a..b26593b4f 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -2,8 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <algorithm> | 5 | #include <algorithm> |
| 8 | #include <array> | 6 | #include <array> |
| 9 | #include <cstring> | 7 | #include <cstring> |
| @@ -11,7 +9,6 @@ | |||
| 11 | #include "common/bit_field.h" | 9 | #include "common/bit_field.h" |
| 12 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 13 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 14 | #include "common/swap.h" | ||
| 15 | #include "core/core.h" | 12 | #include "core/core.h" |
| 16 | #include "core/core_timing.h" | 13 | #include "core/core_timing.h" |
| 17 | #include "core/frontend/input.h" | 14 | #include "core/frontend/input.h" |
| @@ -20,6 +17,7 @@ | |||
| 20 | #include "core/settings.h" | 17 | #include "core/settings.h" |
| 21 | 18 | ||
| 22 | namespace Service::HID { | 19 | namespace Service::HID { |
| 20 | |||
| 23 | constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28; | 21 | constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28; |
| 24 | constexpr u32 JOYCON_BUTTONS_NEON_RED = 0x1E0A0A; | 22 | constexpr u32 JOYCON_BUTTONS_NEON_RED = 0x1E0A0A; |
| 25 | constexpr u32 JOYCON_BODY_NEON_BLUE = 0x0AB9E6; | 23 | constexpr u32 JOYCON_BODY_NEON_BLUE = 0x0AB9E6; |
| @@ -28,9 +26,18 @@ constexpr s32 HID_JOYSTICK_MAX = 0x7fff; | |||
| 28 | constexpr s32 HID_JOYSTICK_MIN = -0x7fff; | 26 | constexpr s32 HID_JOYSTICK_MIN = -0x7fff; |
| 29 | constexpr std::size_t NPAD_OFFSET = 0x9A00; | 27 | constexpr std::size_t NPAD_OFFSET = 0x9A00; |
| 30 | constexpr u32 BATTERY_FULL = 2; | 28 | constexpr u32 BATTERY_FULL = 2; |
| 31 | enum class JoystickId : std::size_t { Joystick_Left, Joystick_Right }; | 29 | |
| 30 | constexpr std::array<u32, 10> npad_id_list{ | ||
| 31 | 0, 1, 2, 3, 4, 5, 6, 7, 32, 16, | ||
| 32 | }; | ||
| 33 | |||
| 34 | enum class JoystickId : std::size_t { | ||
| 35 | Joystick_Left, | ||
| 36 | Joystick_Right, | ||
| 37 | }; | ||
| 32 | 38 | ||
| 33 | Controller_NPad::Controller_NPad() = default; | 39 | Controller_NPad::Controller_NPad() = default; |
| 40 | Controller_NPad::~Controller_NPad() = default; | ||
| 34 | 41 | ||
| 35 | void Controller_NPad::InitNewlyAddedControler(std::size_t controller_idx) { | 42 | void Controller_NPad::InitNewlyAddedControler(std::size_t controller_idx) { |
| 36 | const auto controller_type = connected_controllers[controller_idx].type; | 43 | const auto controller_type = connected_controllers[controller_idx].type; |
| @@ -315,7 +322,7 @@ void Controller_NPad::SetSupportedNPadIdTypes(u8* data, std::size_t length) { | |||
| 315 | std::memcpy(supported_npad_id_types.data(), data, length); | 322 | std::memcpy(supported_npad_id_types.data(), data, length); |
| 316 | } | 323 | } |
| 317 | 324 | ||
| 318 | const void Controller_NPad::GetSupportedNpadIdTypes(u32* data, std::size_t max_length) { | 325 | void Controller_NPad::GetSupportedNpadIdTypes(u32* data, std::size_t max_length) { |
| 319 | ASSERT(max_length < supported_npad_id_types.size()); | 326 | ASSERT(max_length < supported_npad_id_types.size()); |
| 320 | std::memcpy(data, supported_npad_id_types.data(), supported_npad_id_types.size()); | 327 | std::memcpy(data, supported_npad_id_types.data(), supported_npad_id_types.size()); |
| 321 | } | 328 | } |
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 9d07d258d..7c0f93acf 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h | |||
| @@ -15,6 +15,7 @@ namespace Service::HID { | |||
| 15 | class Controller_NPad final : public ControllerBase { | 15 | class Controller_NPad final : public ControllerBase { |
| 16 | public: | 16 | public: |
| 17 | Controller_NPad(); | 17 | Controller_NPad(); |
| 18 | ~Controller_NPad() override; | ||
| 18 | 19 | ||
| 19 | // Called when the controller is initialized | 20 | // Called when the controller is initialized |
| 20 | void OnInit() override; | 21 | void OnInit() override; |
| @@ -77,7 +78,7 @@ public: | |||
| 77 | position1.Assign(light2); | 78 | position1.Assign(light2); |
| 78 | position1.Assign(light3); | 79 | position1.Assign(light3); |
| 79 | position1.Assign(light4); | 80 | position1.Assign(light4); |
| 80 | }; | 81 | } |
| 81 | union { | 82 | union { |
| 82 | u64 raw{}; | 83 | u64 raw{}; |
| 83 | BitField<0, 1, u64> position1; | 84 | BitField<0, 1, u64> position1; |
| @@ -91,7 +92,7 @@ public: | |||
| 91 | NPadType GetSupportedStyleSet() const; | 92 | NPadType GetSupportedStyleSet() const; |
| 92 | 93 | ||
| 93 | void SetSupportedNPadIdTypes(u8* data, std::size_t length); | 94 | void SetSupportedNPadIdTypes(u8* data, std::size_t length); |
| 94 | const void GetSupportedNpadIdTypes(u32* data, std::size_t max_length); | 95 | void GetSupportedNpadIdTypes(u32* data, std::size_t max_length); |
| 95 | std::size_t GetSupportedNPadIdTypesSize() const; | 96 | std::size_t GetSupportedNPadIdTypesSize() const; |
| 96 | 97 | ||
| 97 | void SetHoldType(NpadHoldType joy_hold_type); | 98 | void SetHoldType(NpadHoldType joy_hold_type); |
| @@ -277,9 +278,7 @@ private: | |||
| 277 | std::vector<u32> supported_npad_id_types{}; | 278 | std::vector<u32> supported_npad_id_types{}; |
| 278 | NpadHoldType hold_type{NpadHoldType::Vertical}; | 279 | NpadHoldType hold_type{NpadHoldType::Vertical}; |
| 279 | Kernel::SharedPtr<Kernel::Event> styleset_changed_event; | 280 | Kernel::SharedPtr<Kernel::Event> styleset_changed_event; |
| 280 | std::size_t dump_idx{}; | ||
| 281 | Vibration last_processed_vibration{}; | 281 | Vibration last_processed_vibration{}; |
| 282 | static constexpr std::array<u32, 10> npad_id_list{0, 1, 2, 3, 4, 5, 6, 7, 32, 16}; | ||
| 283 | std::array<ControllerHolder, 10> connected_controllers{}; | 282 | std::array<ControllerHolder, 10> connected_controllers{}; |
| 284 | bool can_controllers_vibrate{true}; | 283 | bool can_controllers_vibrate{true}; |
| 285 | 284 | ||
diff --git a/src/core/hle/service/hid/controllers/stubbed.cpp b/src/core/hle/service/hid/controllers/stubbed.cpp index 3a13d5991..02fcfadd9 100644 --- a/src/core/hle/service/hid/controllers/stubbed.cpp +++ b/src/core/hle/service/hid/controllers/stubbed.cpp | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/swap.h" | ||
| 8 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 9 | #include "core/hle/service/hid/controllers/stubbed.h" | 8 | #include "core/hle/service/hid/controllers/stubbed.h" |
| 10 | 9 | ||
| 11 | namespace Service::HID { | 10 | namespace Service::HID { |
| 12 | 11 | ||
| 13 | Controller_Stubbed::Controller_Stubbed() = default; | 12 | Controller_Stubbed::Controller_Stubbed() = default; |
| 13 | Controller_Stubbed::~Controller_Stubbed() = default; | ||
| 14 | 14 | ||
| 15 | void Controller_Stubbed::OnInit() {} | 15 | void Controller_Stubbed::OnInit() {} |
| 16 | 16 | ||
diff --git a/src/core/hle/service/hid/controllers/stubbed.h b/src/core/hle/service/hid/controllers/stubbed.h index 9c1b57f83..4a21c643e 100644 --- a/src/core/hle/service/hid/controllers/stubbed.h +++ b/src/core/hle/service/hid/controllers/stubbed.h | |||
| @@ -11,6 +11,7 @@ namespace Service::HID { | |||
| 11 | class Controller_Stubbed final : public ControllerBase { | 11 | class Controller_Stubbed final : public ControllerBase { |
| 12 | public: | 12 | public: |
| 13 | Controller_Stubbed(); | 13 | Controller_Stubbed(); |
| 14 | ~Controller_Stubbed() override; | ||
| 14 | 15 | ||
| 15 | // Called when the controller is initialized | 16 | // Called when the controller is initialized |
| 16 | void OnInit() override; | 17 | void OnInit() override; |
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index e97f84ea1..43efef803 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/swap.h" | ||
| 8 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 9 | #include "core/frontend/emu_window.h" | 8 | #include "core/frontend/emu_window.h" |
| 10 | #include "core/frontend/input.h" | 9 | #include "core/frontend/input.h" |
| @@ -15,6 +14,7 @@ namespace Service::HID { | |||
| 15 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x400; | 14 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x400; |
| 16 | 15 | ||
| 17 | Controller_Touchscreen::Controller_Touchscreen() = default; | 16 | Controller_Touchscreen::Controller_Touchscreen() = default; |
| 17 | Controller_Touchscreen::~Controller_Touchscreen() = default; | ||
| 18 | 18 | ||
| 19 | void Controller_Touchscreen::OnInit() {} | 19 | void Controller_Touchscreen::OnInit() {} |
| 20 | 20 | ||
diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h index 1d97b6c2a..e5db6e6ba 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.h +++ b/src/core/hle/service/hid/controllers/touchscreen.h | |||
| @@ -14,6 +14,7 @@ namespace Service::HID { | |||
| 14 | class Controller_Touchscreen final : public ControllerBase { | 14 | class Controller_Touchscreen final : public ControllerBase { |
| 15 | public: | 15 | public: |
| 16 | Controller_Touchscreen(); | 16 | Controller_Touchscreen(); |
| 17 | ~Controller_Touchscreen() override; | ||
| 17 | 18 | ||
| 18 | // Called when the controller is initialized | 19 | // Called when the controller is initialized |
| 19 | void OnInit() override; | 20 | void OnInit() override; |
diff --git a/src/core/hle/service/hid/controllers/xpad.cpp b/src/core/hle/service/hid/controllers/xpad.cpp index df0b48451..cd397c70b 100644 --- a/src/core/hle/service/hid/controllers/xpad.cpp +++ b/src/core/hle/service/hid/controllers/xpad.cpp | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/swap.h" | ||
| 8 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 9 | #include "core/hle/service/hid/controllers/xpad.h" | 8 | #include "core/hle/service/hid/controllers/xpad.h" |
| 10 | 9 | ||
| @@ -12,6 +11,7 @@ namespace Service::HID { | |||
| 12 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3C00; | 11 | constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3C00; |
| 13 | 12 | ||
| 14 | Controller_XPad::Controller_XPad() = default; | 13 | Controller_XPad::Controller_XPad() = default; |
| 14 | Controller_XPad::~Controller_XPad() = default; | ||
| 15 | 15 | ||
| 16 | void Controller_XPad::OnInit() {} | 16 | void Controller_XPad::OnInit() {} |
| 17 | 17 | ||
diff --git a/src/core/hle/service/hid/controllers/xpad.h b/src/core/hle/service/hid/controllers/xpad.h index e2007183d..ff836989f 100644 --- a/src/core/hle/service/hid/controllers/xpad.h +++ b/src/core/hle/service/hid/controllers/xpad.h | |||
| @@ -7,13 +7,13 @@ | |||
| 7 | #include "common/common_funcs.h" | 7 | #include "common/common_funcs.h" |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "common/swap.h" | 9 | #include "common/swap.h" |
| 10 | #include "core/frontend/input.h" | ||
| 11 | #include "core/hle/service/hid/controllers/controller_base.h" | 10 | #include "core/hle/service/hid/controllers/controller_base.h" |
| 12 | 11 | ||
| 13 | namespace Service::HID { | 12 | namespace Service::HID { |
| 14 | class Controller_XPad final : public ControllerBase { | 13 | class Controller_XPad final : public ControllerBase { |
| 15 | public: | 14 | public: |
| 16 | Controller_XPad(); | 15 | Controller_XPad(); |
| 16 | ~Controller_XPad() override; | ||
| 17 | 17 | ||
| 18 | // Called when the controller is initialized | 18 | // Called when the controller is initialized |
| 19 | void OnInit() override; | 19 | void OnInit() override; |