pad somehow working
This commit is contained in:
parent
da9adf84c0
commit
e1b64617a8
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
namespace Emulator::Host::Controller {
|
namespace Emulator::Host::Controller {
|
||||||
struct State {
|
struct State {
|
||||||
u32 buttonsState;
|
u32 buttonsState =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr u32 MAX_STATES = 64;
|
constexpr u32 MAX_STATES = 64;
|
||||||
|
|
|
@ -3,10 +3,15 @@
|
||||||
#include <Core/PS4/HLE/ErrorCodes.h>
|
#include <Core/PS4/HLE/ErrorCodes.h>
|
||||||
#include <Core/PS4/HLE/Libs.h>
|
#include <Core/PS4/HLE/Libs.h>
|
||||||
|
|
||||||
#include "Emulator/Util/singleton.h"
|
#include "Util/Singleton.h"
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
|
#include <debug.h>
|
||||||
|
#include <Util/log.h>
|
||||||
|
|
||||||
namespace Emulator::HLE::Libraries::LibPad {
|
namespace Emulator::HLE::Libraries::LibPad {
|
||||||
|
|
||||||
|
constexpr bool log_file_pad = true; // disable it to disable logging
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePadInit() { return SCE_OK; }
|
int PS4_SYSV_ABI scePadInit() { return SCE_OK; }
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePadOpen(Emulator::HLE::Libraries::LibUserService::SceUserServiceUserId userId, s32 type, s32 index,
|
int PS4_SYSV_ABI scePadOpen(Emulator::HLE::Libraries::LibUserService::SceUserServiceUserId userId, s32 type, s32 index,
|
||||||
|
@ -15,17 +20,16 @@ int PS4_SYSV_ABI scePadOpen(Emulator::HLE::Libraries::LibUserService::SceUserSer
|
||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI scePadReadState(int32_t handle, ScePadData* pData) {
|
int PS4_SYSV_ABI scePadReadState(int32_t handle, ScePadData* pData) {
|
||||||
auto* controller = singleton<Emulator::Host::Controller::GameController>::instance();
|
auto* controller = Singleton<Emulator::Host::Controller::GameController>::Instance();
|
||||||
|
|
||||||
int connectedCount = 0;
|
int connectedCount = 0;
|
||||||
bool isConnected = false;
|
bool isConnected = false;
|
||||||
Emulator::Host::Controller::State state;
|
Emulator::Host::Controller::State state;
|
||||||
|
|
||||||
controller->readState(&state, &isConnected, &connectedCount);
|
controller->readState(&state, &isConnected, &connectedCount);
|
||||||
|
|
||||||
pData->buttons = state.buttonsState;
|
pData->buttons = state.buttonsState;
|
||||||
pData->leftStick.x = 0; // dummy
|
pData->leftStick.x = 128; // dummy
|
||||||
pData->leftStick.y = 0; // dummy
|
pData->leftStick.y = 128; // dummy
|
||||||
pData->rightStick.x = 0; // dummy
|
pData->rightStick.x = 0; // dummy
|
||||||
pData->rightStick.y = 0; // dummy
|
pData->rightStick.y = 0; // dummy
|
||||||
pData->analogButtons.r2 = 0;//dummy
|
pData->analogButtons.r2 = 0;//dummy
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
|
|
||||||
#include <Core/PS4/HLE/Graphics/graphics_render.h>
|
#include <Core/PS4/HLE/Graphics/graphics_render.h>
|
||||||
|
#include <Emulator/HLE/Libraries/LibPad/controller.h>
|
||||||
#include <Util/Singleton.h>
|
#include <Util/Singleton.h>
|
||||||
#include <vulkan_util.h>
|
#include <vulkan_util.h>
|
||||||
|
|
||||||
#include "Core/PS4/HLE/Graphics/video_out.h"
|
#include "Core/PS4/HLE/Graphics/video_out.h"
|
||||||
#include "Emulator/HLE/Libraries/LibPad/pad.h"
|
#include "Emulator/HLE/Libraries/LibPad/pad.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include <Emulator/HLE/Libraries/LibPad/controller.h>
|
|
||||||
|
|
||||||
namespace Emu {
|
namespace Emu {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue