diff options
| author | bunnei <bunneidev@gmail.com> | 2018-02-16 20:55:26 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-16 20:55:26 -0500 | 
| commit | 3388208597d261b7955b013cf7fef67e3d03ddc6 (patch) | |
| tree | 61cd05e46117627a6dd66daae4a367340e7d8572 | |
| parent | 98ffad4303b39dcef7cbd0e7a2b2c3b61fc123a0 (diff) | |
| parent | 6797d4a907f8c2022ef3dba10aac5d2d7667135a (diff) | |
Merge pull request #197 from mailwl/hid
Service/hid: stub some functions
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 51 | ||||
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 43 | 
4 files changed, 98 insertions, 1 deletions
| diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 6d16f71a7..25ba26f18 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -254,4 +254,55 @@ size_t HLERequestContext::GetWriteBufferSize() const {      return is_buffer_b ? BufferDescriptorB()[0].Size() : BufferDescriptorC()[0].Size();  } +std::string HLERequestContext::Description() const { +    if (!command_header) { +        return "No command header available"; +    } +    std::ostringstream s; +    s << "IPC::CommandHeader: Type:" << static_cast<u32>(command_header->type.Value()); +    s << ", X(Pointer):" << command_header->num_buf_x_descriptors; +    if (command_header->num_buf_x_descriptors) { +        s << '['; +        for (u64 i = 0; i < command_header->num_buf_x_descriptors; ++i) { +            s << "0x" << std::hex << BufferDescriptorX()[i].Size(); +            if (i < command_header->num_buf_x_descriptors - 1) +                s << ", "; +        } +        s << ']'; +    } +    s << ", A(Send):" << command_header->num_buf_a_descriptors; +    if (command_header->num_buf_a_descriptors) { +        s << '['; +        for (u64 i = 0; i < command_header->num_buf_a_descriptors; ++i) { +            s << "0x" << std::hex << BufferDescriptorA()[i].Size(); +            if (i < command_header->num_buf_a_descriptors - 1) +                s << ", "; +        } +        s << ']'; +    } +    s << ", B(Receive):" << command_header->num_buf_b_descriptors; +    if (command_header->num_buf_b_descriptors) { +        s << '['; +        for (u64 i = 0; i < command_header->num_buf_b_descriptors; ++i) { +            s << "0x" << std::hex << BufferDescriptorB()[i].Size(); +            if (i < command_header->num_buf_b_descriptors - 1) +                s << ", "; +        } +        s << ']'; +    } +    s << ", C(ReceiveList):" << BufferDescriptorC().size(); +    if (!BufferDescriptorC().empty()) { +        s << '['; +        for (u64 i = 0; i < BufferDescriptorC().size(); ++i) { +            s << "0x" << std::hex << BufferDescriptorC()[i].Size(); +            if (i < BufferDescriptorC().size() - 1) +                s << ", "; +        } +        s << ']'; +    } +    s << ", data_size:" << command_header->data_size.Value(); + +    return s.str(); +} +  } // namespace Kernel diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 81e3489c8..b5631b773 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -202,6 +202,8 @@ public:          return domain_objects.size();      } +    std::string Description() const; +  private:      std::array<u32, IPC::COMMAND_BUFFER_LENGTH> cmd_buf;      SharedPtr<Kernel::ServerSession> server_session; diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 20306c6cf..4efc789ac 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -53,7 +53,8 @@ private:      }      void RequestUpdateAudioRenderer(Kernel::HLERequestContext& ctx) { -        AudioRendererResponseData response_data = {0}; +        LOG_DEBUG(Service_Audio, "%s", ctx.Description().c_str()); +        AudioRendererResponseData response_data{};          response_data.section_0_size =              response_data.state_entries.size() * sizeof(AudioRendererStateEntry); diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 3f1c18505..dacd1862d 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -176,7 +176,10 @@ public:              {0, &Hid::CreateAppletResource, "CreateAppletResource"},              {1, &Hid::ActivateDebugPad, "ActivateDebugPad"},              {11, &Hid::ActivateTouchScreen, "ActivateTouchScreen"}, +            {21, &Hid::ActivateMouse, "ActivateMouse"}, +            {31, &Hid::ActivateKeyboard, "ActivateKeyboard"},              {66, &Hid::StartSixAxisSensor, "StartSixAxisSensor"}, +            {79, &Hid::SetGyroscopeZeroDriftMode, "SetGyroscopeZeroDriftMode"},              {100, &Hid::SetSupportedNpadStyleSet, "SetSupportedNpadStyleSet"},              {102, &Hid::SetSupportedNpadIdType, "SetSupportedNpadIdType"},              {103, &Hid::ActivateNpad, "ActivateNpad"}, @@ -184,9 +187,13 @@ public:               "AcquireNpadStyleSetUpdateEventHandle"},              {120, &Hid::SetNpadJoyHoldType, "SetNpadJoyHoldType"},              {121, &Hid::GetNpadJoyHoldType, "GetNpadJoyHoldType"}, +            {122, &Hid::SetNpadJoyAssignmentModeSingleByDefault, +             "SetNpadJoyAssignmentModeSingleByDefault"},              {124, nullptr, "SetNpadJoyAssignmentModeDual"},              {128, &Hid::SetNpadHandheldActivationMode, "SetNpadHandheldActivationMode"},              {200, &Hid::GetVibrationDeviceInfo, "GetVibrationDeviceInfo"}, +            {201, &Hid::SendVibrationValue, "SendVibrationValue"}, +            {202, &Hid::GetActualVibrationValue, "GetActualVibrationValue"},              {203, &Hid::CreateActiveVibrationDeviceList, "CreateActiveVibrationDeviceList"},              {206, &Hid::SendVibrationValues, "SendVibrationValues"},          }; @@ -224,12 +231,30 @@ private:          LOG_WARNING(Service_HID, "(STUBBED) called");      } +    void ActivateMouse(Kernel::HLERequestContext& ctx) { +        IPC::ResponseBuilder rb{ctx, 2}; +        rb.Push(RESULT_SUCCESS); +        LOG_WARNING(Service_HID, "(STUBBED) called"); +    } + +    void ActivateKeyboard(Kernel::HLERequestContext& ctx) { +        IPC::ResponseBuilder rb{ctx, 2}; +        rb.Push(RESULT_SUCCESS); +        LOG_WARNING(Service_HID, "(STUBBED) called"); +    } +      void StartSixAxisSensor(Kernel::HLERequestContext& ctx) {          IPC::ResponseBuilder rb{ctx, 2};          rb.Push(RESULT_SUCCESS);          LOG_WARNING(Service_HID, "(STUBBED) called");      } +    void SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { +        IPC::ResponseBuilder rb{ctx, 2}; +        rb.Push(RESULT_SUCCESS); +        LOG_WARNING(Service_HID, "(STUBBED) called"); +    } +      void SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) {          IPC::ResponseBuilder rb{ctx, 2};          rb.Push(RESULT_SUCCESS); @@ -268,6 +293,24 @@ private:          LOG_WARNING(Service_HID, "(STUBBED) called");      } +    void SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) { +        IPC::ResponseBuilder rb{ctx, 2}; +        rb.Push(RESULT_SUCCESS); +        LOG_WARNING(Service_HID, "(STUBBED) called"); +    } + +    void SendVibrationValue(Kernel::HLERequestContext& ctx) { +        IPC::ResponseBuilder rb{ctx, 2}; +        rb.Push(RESULT_SUCCESS); +        LOG_WARNING(Service_HID, "(STUBBED) called"); +    } + +    void GetActualVibrationValue(Kernel::HLERequestContext& ctx) { +        IPC::ResponseBuilder rb{ctx, 2}; +        rb.Push(RESULT_SUCCESS); +        LOG_WARNING(Service_HID, "(STUBBED) called"); +    } +      void SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {          IPC::ResponseBuilder rb{ctx, 2};          rb.Push(RESULT_SUCCESS); | 
