some pad fixes (fixing metal slug 3 and risk of rain)
This commit is contained in:
parent
7b7d1cb26f
commit
3ef69cae5e
|
@ -2,6 +2,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// Generated By moduleGenerator
|
||||
#include <common/assert.h>
|
||||
#include <common/singleton.h>
|
||||
#include "common/logging/log.h"
|
||||
#include "core/libraries/error_codes.h"
|
||||
|
@ -85,7 +86,6 @@ int PS4_SYSV_ABI scePadGetCapability() {
|
|||
|
||||
int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerInformation* pInfo) {
|
||||
LOG_INFO(Lib_Pad, "called handle = {}", handle);
|
||||
std::memset(pInfo, 0, sizeof(OrbisPadControllerInformation));
|
||||
if (handle < 0) {
|
||||
pInfo->touchPadInfo.pixelDensity = 1;
|
||||
pInfo->touchPadInfo.resolution.x = 1920;
|
||||
|
@ -251,7 +251,9 @@ int PS4_SYSV_ABI scePadOutputReport() {
|
|||
}
|
||||
|
||||
int PS4_SYSV_ABI scePadRead(s32 handle, OrbisPadData* pData, s32 num) {
|
||||
std::memset(pData, 0, sizeof(OrbisPadData));
|
||||
if (handle != 1) {
|
||||
UNREACHABLE_MSG("unknown handle");
|
||||
}
|
||||
int connected_count = 0;
|
||||
bool connected = false;
|
||||
Input::State states[64];
|
||||
|
@ -318,11 +320,12 @@ int PS4_SYSV_ABI scePadReadHistory() {
|
|||
|
||||
int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) {
|
||||
auto* controller = Common::Singleton<Input::GameController>::Instance();
|
||||
|
||||
if (handle != 1) {
|
||||
UNREACHABLE_MSG("unknown handle");
|
||||
}
|
||||
int connectedCount = 0;
|
||||
bool isConnected = false;
|
||||
Input::State state;
|
||||
std::memset(pData, 0, sizeof(OrbisPadData));
|
||||
controller->ReadState(&state, &isConnected, &connectedCount);
|
||||
pData->buttons = state.buttonsState;
|
||||
pData->leftStick.x = state.axes[static_cast<int>(Input::Axis::LeftX)];
|
||||
|
@ -334,7 +337,7 @@ int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) {
|
|||
pData->orientation.x = 0;
|
||||
pData->orientation.y = 0;
|
||||
pData->orientation.z = 0;
|
||||
pData->orientation.w = 0;
|
||||
pData->orientation.w = 1;
|
||||
pData->acceleration.x = 0.0f;
|
||||
pData->acceleration.y = 0.0f;
|
||||
pData->acceleration.z = 0.0f;
|
||||
|
|
Loading…
Reference in New Issue