palma initial impl
This commit is contained in:
parent
3f5d6c115f
commit
c695166391
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/k_shared_memory.h"
|
||||
#include "core/hle/kernel/k_transfer_memory.h"
|
||||
#include "core/hle/service/hid/hid_result.h"
|
||||
#include "core/hle/service/hid/hid_server.h"
|
||||
#include "core/hle/service/hid/hid_types.h"
|
||||
|
@ -175,40 +176,40 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr<ResourceManager> r
|
|||
{406, nullptr, "GetNpadLeftRightInterfaceType"},
|
||||
{407, nullptr, "GetNpadOfHighestBatteryLevel"},
|
||||
{408, nullptr, "GetNpadOfHighestBatteryLevelForJoyRight"},
|
||||
{500, nullptr, "GetPalmaConnectionHandle"},
|
||||
{501, nullptr, "InitializePalma"},
|
||||
{502, nullptr, "AcquirePalmaOperationCompleteEvent"},
|
||||
{503, nullptr, "GetPalmaOperationInfo"},
|
||||
{504, nullptr, "PlayPalmaActivity"},
|
||||
{505, nullptr, "SetPalmaFrModeType"},
|
||||
{506, nullptr, "ReadPalmaStep"},
|
||||
{507, nullptr, "EnablePalmaStep"},
|
||||
{508, nullptr, "ResetPalmaStep"},
|
||||
{509, nullptr, "ReadPalmaApplicationSection"},
|
||||
{510, nullptr, "WritePalmaApplicationSection"},
|
||||
{511, nullptr, "ReadPalmaUniqueCode"},
|
||||
{512, nullptr, "SetPalmaUniqueCodeInvalid"},
|
||||
{513, nullptr, "WritePalmaActivityEntry"},
|
||||
{514, nullptr, "WritePalmaRgbLedPatternEntry"},
|
||||
{515, nullptr, "WritePalmaWaveEntry"},
|
||||
{516, nullptr, "SetPalmaDataBaseIdentificationVersion"},
|
||||
{517, nullptr, "GetPalmaDataBaseIdentificationVersion"},
|
||||
{518, nullptr, "SuspendPalmaFeature"},
|
||||
{519, nullptr, "GetPalmaOperationResult"},
|
||||
{520, nullptr, "ReadPalmaPlayLog"},
|
||||
{521, nullptr, "ResetPalmaPlayLog"},
|
||||
{522, nullptr, "SetIsPalmaAllConnectable"},
|
||||
{523, nullptr, "SetIsPalmaPairedConnectable"},
|
||||
{524, nullptr, "PairPalma"},
|
||||
{525, nullptr, "SetPalmaBoostMode"},
|
||||
{526, nullptr, "CancelWritePalmaWaveEntry"},
|
||||
{527, nullptr, "EnablePalmaBoostMode"},
|
||||
{528, nullptr, "GetPalmaBluetoothAddress"},
|
||||
{529, nullptr, "SetDisallowedPalmaConnection"},
|
||||
{1000, nullptr, "SetNpadCommunicationMode"},
|
||||
{1001, nullptr, "GetNpadCommunicationMode"},
|
||||
{1002, nullptr, "SetTouchScreenConfiguration"},
|
||||
{1003, nullptr, "IsFirmwareUpdateNeededForNotification"},
|
||||
{500, &IHidServer::GetPalmaConnectionHandle, "GetPalmaConnectionHandle"},
|
||||
{501, &IHidServer::InitializePalma, "InitializePalma"},
|
||||
{502, &IHidServer::AcquirePalmaOperationCompleteEvent, "AcquirePalmaOperationCompleteEvent"},
|
||||
{503, &IHidServer::GetPalmaOperationInfo, "GetPalmaOperationInfo"},
|
||||
{504, &IHidServer::PlayPalmaActivity, "PlayPalmaActivity"},
|
||||
{505, &IHidServer::SetPalmaFrModeType, "SetPalmaFrModeType"},
|
||||
{506, &IHidServer::ReadPalmaStep, "ReadPalmaStep"},
|
||||
{507, &IHidServer::EnablePalmaStep, "EnablePalmaStep"},
|
||||
{508, &IHidServer::ResetPalmaStep, "ResetPalmaStep"},
|
||||
{509, &IHidServer::ReadPalmaApplicationSection, "ReadPalmaApplicationSection"},
|
||||
{510, &IHidServer::WritePalmaApplicationSection, "WritePalmaApplicationSection"},
|
||||
{511, &IHidServer::ReadPalmaUniqueCode, "ReadPalmaUniqueCode"},
|
||||
{512, &IHidServer::SetPalmaUniqueCodeInvalid, "SetPalmaUniqueCodeInvalid"},
|
||||
{513, &IHidServer::WritePalmaActivityEntry, "WritePalmaActivityEntry"},
|
||||
{514, &IHidServer::WritePalmaRgbLedPatternEntry, "WritePalmaRgbLedPatternEntry"},
|
||||
{515, &IHidServer::WritePalmaWaveEntry, "WritePalmaWaveEntry"},
|
||||
{516, &IHidServer::SetPalmaDataBaseIdentificationVersion, "SetPalmaDataBaseIdentificationVersion"},
|
||||
{517, &IHidServer::GetPalmaDataBaseIdentificationVersion, "GetPalmaDataBaseIdentificationVersion"},
|
||||
{518, &IHidServer::SuspendPalmaFeature, "SuspendPalmaFeature"},
|
||||
{519, &IHidServer::GetPalmaOperationResult, "GetPalmaOperationResult"},
|
||||
{520, &IHidServer::ReadPalmaPlayLog, "ReadPalmaPlayLog"},
|
||||
{521, &IHidServer::ResetPalmaPlayLog, "ResetPalmaPlayLog"},
|
||||
{522, &IHidServer::SetIsPalmaAllConnectable, "SetIsPalmaAllConnectable"},
|
||||
{523, &IHidServer::SetIsPalmaPairedConnectable, "SetIsPalmaPairedConnectable"},
|
||||
{524, &IHidServer::PairPalma, "PairPalma"},
|
||||
{525, &IHidServer::SetPalmaBoostMode, "SetPalmaBoostMode"},
|
||||
{526, &IHidServer::CancelWritePalmaWaveEntry, "CancelWritePalmaWaveEntry"},
|
||||
{527, &IHidServer::EnablePalmaBoostMode, "EnablePalmaBoostMode"},
|
||||
{528, &IHidServer::GetPalmaBluetoothAddress, "GetPalmaBluetoothAddress"},
|
||||
{529, &IHidServer::SetDisallowedPalmaConnection, "SetDisallowedPalmaConnection"},
|
||||
{1000, &IHidServer::SetNpadCommunicationMode, "SetNpadCommunicationMode"},
|
||||
{1001, &IHidServer::GetNpadCommunicationMode, "GetNpadCommunicationMode"},
|
||||
{1002, &IHidServer::SetTouchScreenConfiguration, "SetTouchScreenConfiguration"},
|
||||
{1003, &IHidServer::IsFirmwareUpdateNeededForNotification, "IsFirmwareUpdateNeededForNotification"},
|
||||
{2000, nullptr, "ActivateDigitizer"},
|
||||
};
|
||||
// clang-format on
|
||||
|
@ -2124,36 +2125,387 @@ void IHidServer::IsUsbFullKeyControllerEnabled(HLERequestContext& ctx) {
|
|||
rb.Push<u8>(is_enabled);
|
||||
}
|
||||
|
||||
void IHidServer::GetPalmaConnectionHandle(HLERequestContext& ctx) {}
|
||||
void IHidServer::InitializePalma(HLERequestContext& ctx) {}
|
||||
void IHidServer::AcquirePalmaOperationCompleteEvent(HLERequestContext& ctx) {}
|
||||
void IHidServer::GetPalmaOperationInfo(HLERequestContext& ctx) {}
|
||||
void IHidServer::PlayPalmaActivity(HLERequestContext& ctx) {}
|
||||
void IHidServer::SetPalmaFrModeType(HLERequestContext& ctx) {}
|
||||
void IHidServer::ReadPalmaStep(HLERequestContext& ctx) {}
|
||||
void IHidServer::EnablePalmaStep(HLERequestContext& ctx) {}
|
||||
void IHidServer::ResetPalmaStep(HLERequestContext& ctx) {}
|
||||
void IHidServer::GetPalmaConnectionHandle(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
NpadIdType npad_id;
|
||||
INSERT_PADDING_WORDS_NOINIT(1);
|
||||
u64 applet_resource_user_id;
|
||||
};
|
||||
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, npad_id={}, applet_resource_user_id={}",
|
||||
parameters.npad_id, parameters.applet_resource_user_id);
|
||||
|
||||
PalmaConnectionHandle handle{};
|
||||
const Result result = GetResourceManager()->GetPalma()->GetPalmaConnectionHandle(
|
||||
handle, parameters.applet_resource_user_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(result);
|
||||
rb.PushRaw(handle);
|
||||
}
|
||||
|
||||
void IHidServer::InitializePalma(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
const auto result = GetResourceManager()->GetPalma()->Initialize(connection_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::AcquirePalmaOperationCompleteEvent(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
Kernel::KReadableEvent* out_event = nullptr;
|
||||
const auto result = GetResourceManager()->GetPalma()->AcquirePalmaOperationCompleteEvent(
|
||||
connection_handle, &out_event);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushCopyObjects(out_event);
|
||||
}
|
||||
|
||||
void IHidServer::GetPalmaOperationInfo(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
PalmaOperationType operation_type{};
|
||||
PalmaOperationData data{};
|
||||
const auto result = GetResourceManager()->GetPalma()->GetPalmaOperationInfo(
|
||||
connection_handle, operation_type, data);
|
||||
|
||||
if (result.IsError()) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
ctx.WriteBuffer(data);
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(result);
|
||||
rb.Push(static_cast<u64>(operation_type));
|
||||
}
|
||||
|
||||
void IHidServer::PlayPalmaActivity(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
const auto palma_activity{rp.Pop<u64>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}, palma_activity={}",
|
||||
connection_handle.npad_id, palma_activity);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetPalma()->PlayPalmaActivity(connection_handle, palma_activity);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::SetPalmaFrModeType(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
const auto fr_mode{rp.PopEnum<PalmaFrModeType>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}, fr_mode={}",
|
||||
connection_handle.npad_id, fr_mode);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetPalma()->SetPalmaFrModeType(connection_handle, fr_mode);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::ReadPalmaStep(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
const auto result = GetResourceManager()->GetPalma()->ReadPalmaStep(connection_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::EnablePalmaStep(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
bool is_enabled;
|
||||
INSERT_PADDING_WORDS_NOINIT(1);
|
||||
PalmaConnectionHandle connection_handle;
|
||||
};
|
||||
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}, is_enabled={}",
|
||||
parameters.connection_handle.npad_id, parameters.is_enabled);
|
||||
|
||||
const auto result = GetResourceManager()->GetPalma()->EnablePalmaStep(
|
||||
parameters.connection_handle, parameters.is_enabled);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::ResetPalmaStep(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
const auto result = GetResourceManager()->GetPalma()->ResetPalmaStep(connection_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::ReadPalmaApplicationSection(HLERequestContext& ctx) {}
|
||||
|
||||
void IHidServer::WritePalmaApplicationSection(HLERequestContext& ctx) {}
|
||||
void IHidServer::ReadPalmaUniqueCode(HLERequestContext& ctx) {}
|
||||
void IHidServer::SetPalmaUniqueCodeInvalid(HLERequestContext& ctx) {}
|
||||
|
||||
void IHidServer::ReadPalmaUniqueCode(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
const auto result = GetResourceManager()->GetPalma()->ReadPalmaUniqueCode(connection_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::SetPalmaUniqueCodeInvalid(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetPalma()->SetPalmaUniqueCodeInvalid(connection_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::WritePalmaActivityEntry(HLERequestContext& ctx) {}
|
||||
void IHidServer::WritePalmaRgbLedPatternEntry(HLERequestContext& ctx) {}
|
||||
void IHidServer::WritePalmaWaveEntry(HLERequestContext& ctx) {}
|
||||
void IHidServer::SetPalmaDataBaseIdentificationVersion(HLERequestContext& ctx) {}
|
||||
void IHidServer::GetPalmaDataBaseIdentificationVersion(HLERequestContext& ctx) {}
|
||||
void IHidServer::SuspendPalmaFeature(HLERequestContext& ctx) {}
|
||||
void IHidServer::GetPalmaOperationResult(HLERequestContext& ctx) {}
|
||||
void IHidServer::ReadPalmaPlayLog(HLERequestContext& ctx) {}
|
||||
void IHidServer::ResetPalmaPlayLog(HLERequestContext& ctx) {}
|
||||
void IHidServer::SetIsPalmaAllConnectable(HLERequestContext& ctx) {}
|
||||
void IHidServer::SetIsPalmaPairedConnectable(HLERequestContext& ctx) {}
|
||||
void IHidServer::PairPalma(HLERequestContext& ctx) {}
|
||||
void IHidServer::SetPalmaBoostMode(HLERequestContext& ctx) {}
|
||||
void IHidServer::CancelWritePalmaWaveEntry(HLERequestContext& ctx) {}
|
||||
void IHidServer::EnablePalmaBoostMode(HLERequestContext& ctx) {}
|
||||
void IHidServer::GetPalmaBluetoothAddress(HLERequestContext& ctx) {}
|
||||
void IHidServer::SetDisallowedPalmaConnection(HLERequestContext& ctx) {}
|
||||
|
||||
void IHidServer::WritePalmaRgbLedPatternEntry(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
const auto unknown{rp.Pop<u64>()};
|
||||
|
||||
[[maybe_unused]] const auto buffer = ctx.ReadBuffer();
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}, unknown={}",
|
||||
connection_handle.npad_id, unknown);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetPalma()->WritePalmaRgbLedPatternEntry(connection_handle, unknown);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::WritePalmaWaveEntry(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
const auto wave_set{rp.PopEnum<PalmaWaveSet>()};
|
||||
const auto unknown{rp.Pop<u64>()};
|
||||
const auto t_mem_size{rp.Pop<u64>()};
|
||||
const auto t_mem_handle{ctx.GetCopyHandle(0)};
|
||||
const auto size{rp.Pop<u64>()};
|
||||
|
||||
ASSERT_MSG(t_mem_size == 0x3000, "t_mem_size is not 0x3000 bytes");
|
||||
|
||||
auto t_mem = system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(
|
||||
t_mem_handle);
|
||||
|
||||
if (t_mem.IsNull()) {
|
||||
LOG_ERROR(Service_HID, "t_mem is a nullptr for handle=0x{:08X}", t_mem_handle);
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultUnknown);
|
||||
return;
|
||||
}
|
||||
|
||||
ASSERT_MSG(t_mem->GetSize() == 0x3000, "t_mem has incorrect size");
|
||||
|
||||
LOG_WARNING(Service_HID,
|
||||
"(STUBBED) called, connection_handle={}, wave_set={}, unknown={}, "
|
||||
"t_mem_handle=0x{:08X}, t_mem_size={}, size={}",
|
||||
connection_handle.npad_id, wave_set, unknown, t_mem_handle, t_mem_size, size);
|
||||
|
||||
const auto result = GetResourceManager()->GetPalma()->WritePalmaWaveEntry(
|
||||
connection_handle, wave_set, t_mem->GetSourceAddress(), t_mem_size);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::SetPalmaDataBaseIdentificationVersion(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
s32 database_id_version;
|
||||
INSERT_PADDING_WORDS_NOINIT(1);
|
||||
PalmaConnectionHandle connection_handle;
|
||||
};
|
||||
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}, database_id_version={}",
|
||||
parameters.connection_handle.npad_id, parameters.database_id_version);
|
||||
|
||||
const auto result = GetResourceManager()->GetPalma()->SetPalmaDataBaseIdentificationVersion(
|
||||
parameters.connection_handle, parameters.database_id_version);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::GetPalmaDataBaseIdentificationVersion(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetPalma()->GetPalmaDataBaseIdentificationVersion(connection_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::SuspendPalmaFeature(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::GetPalmaOperationResult(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
const auto result = applet_resource->GetController<Controller_Palma>(HidController::Palma)
|
||||
.GetPalmaOperationResult(connection_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::ReadPalmaPlayLog(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::ResetPalmaPlayLog(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::SetIsPalmaAllConnectable(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
bool is_palma_all_connectable;
|
||||
INSERT_PADDING_BYTES_NOINIT(7);
|
||||
u64 applet_resource_user_id;
|
||||
};
|
||||
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_WARNING(Service_HID,
|
||||
"(STUBBED) called, is_palma_all_connectable={},applet_resource_user_id={}",
|
||||
parameters.is_palma_all_connectable, parameters.applet_resource_user_id);
|
||||
|
||||
applet_resource->GetController<Controller_Palma>(HidController::Palma)
|
||||
.SetIsPalmaAllConnectable(parameters.is_palma_all_connectable);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::SetIsPalmaPairedConnectable(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::PairPalma(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto connection_handle{rp.PopRaw<PalmaConnectionHandle>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}", connection_handle.npad_id);
|
||||
|
||||
applet_resource->GetController<Controller_Palma>(HidController::Palma)
|
||||
.PairPalma(connection_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::SetPalmaBoostMode(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto palma_boost_mode{rp.Pop<bool>()};
|
||||
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called, palma_boost_mode={}", palma_boost_mode);
|
||||
|
||||
applet_resource->GetController<Controller_Palma>(HidController::Palma)
|
||||
.SetPalmaBoostMode(palma_boost_mode);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::CancelWritePalmaWaveEntry(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::EnablePalmaBoostMode(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::GetPalmaBluetoothAddress(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::SetDisallowedPalmaConnection(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidServer::SetNpadCommunicationMode(HLERequestContext& ctx) {}
|
||||
void IHidServer::GetNpadCommunicationMode(HLERequestContext& ctx) {}
|
||||
void IHidServer::SetTouchScreenConfiguration(HLERequestContext& ctx) {}
|
||||
|
|
|
@ -877,4 +877,74 @@ struct MouseState {
|
|||
};
|
||||
static_assert(sizeof(MouseState) == 0x28, "MouseState is an invalid size");
|
||||
|
||||
|
||||
// This is nn::hid::PalmaOperationType
|
||||
enum class PalmaOperationType {
|
||||
PlayActivity,
|
||||
SetFrModeType,
|
||||
ReadStep,
|
||||
EnableStep,
|
||||
ResetStep,
|
||||
ReadApplicationSection,
|
||||
WriteApplicationSection,
|
||||
ReadUniqueCode,
|
||||
SetUniqueCodeInvalid,
|
||||
WriteActivityEntry,
|
||||
WriteRgbLedPatternEntry,
|
||||
WriteWaveEntry,
|
||||
ReadDataBaseIdentificationVersion,
|
||||
WriteDataBaseIdentificationVersion,
|
||||
SuspendFeature,
|
||||
ReadPlayLog,
|
||||
ResetPlayLog,
|
||||
};
|
||||
|
||||
// This is nn::hid::PalmaWaveSet
|
||||
enum class PalmaWaveSet : u64 {
|
||||
Small,
|
||||
Medium,
|
||||
Large,
|
||||
};
|
||||
|
||||
// This is nn::hid::PalmaFrModeType
|
||||
enum class PalmaFrModeType : u64 {
|
||||
Off,
|
||||
B01,
|
||||
B02,
|
||||
B03,
|
||||
Downloaded,
|
||||
};
|
||||
|
||||
// This is nn::hid::PalmaFeature
|
||||
enum class PalmaFeature : u64 {
|
||||
FrMode,
|
||||
RumbleFeedback,
|
||||
Step,
|
||||
MuteSwitch,
|
||||
};
|
||||
|
||||
using PalmaOperationData = std::array<u8, 0x140>;
|
||||
// This is nn::hid::PalmaOperationInfo
|
||||
struct PalmaOperationInfo {
|
||||
PalmaOperationType operation{};
|
||||
Result result{};
|
||||
PalmaOperationData data{};
|
||||
};
|
||||
static_assert(sizeof(PalmaOperationInfo) == 0x148, "PalmaOperationInfo is an invalid size");
|
||||
|
||||
// This is nn::hid::PalmaActivityEntry
|
||||
struct PalmaActivityEntry {
|
||||
u32 rgb_led_pattern_index;
|
||||
INSERT_PADDING_BYTES(2);
|
||||
PalmaWaveSet wave_set;
|
||||
u32 wave_index;
|
||||
INSERT_PADDING_BYTES(12);
|
||||
};
|
||||
static_assert(sizeof(PalmaActivityEntry) == 0x20, "PalmaActivityEntry is an invalid size");
|
||||
|
||||
struct PalmaConnectionHandle {
|
||||
NpadIdType npad_id;
|
||||
INSERT_PADDING_BYTES(4);
|
||||
};
|
||||
static_assert(sizeof(PalmaConnectionHandle) == 0x8, "PalmaConnectionHandle has incorrect size.");
|
||||
} // namespace Service::HID
|
||||
|
|
|
@ -24,6 +24,7 @@ public:
|
|||
Result Activate();
|
||||
|
||||
Result EnablePalmaBoostMode(const u64 aruid, const bool is_enabled);
|
||||
Result GetPalmaConnectionHandle(PalmaConnectionHandle& out_handle,const u64 aruid) const;
|
||||
|
||||
private:
|
||||
bool is_activated;
|
||||
|
|
Loading…
Reference in New Issue