diff --git a/src/Emulator/HLE/Libraries/LibPad/controller.h b/src/Emulator/HLE/Libraries/LibPad/controller.h index 50dabcb2..4158ef3c 100644 --- a/src/Emulator/HLE/Libraries/LibPad/controller.h +++ b/src/Emulator/HLE/Libraries/LibPad/controller.h @@ -4,7 +4,7 @@ namespace Emulator::Host::Controller { struct State { - u32 buttonsState; + u32 buttonsState =0; }; constexpr u32 MAX_STATES = 64; diff --git a/src/Emulator/HLE/Libraries/LibPad/pad.cpp b/src/Emulator/HLE/Libraries/LibPad/pad.cpp index 6da03cf1..26b252f0 100644 --- a/src/Emulator/HLE/Libraries/LibPad/pad.cpp +++ b/src/Emulator/HLE/Libraries/LibPad/pad.cpp @@ -3,10 +3,15 @@ #include #include -#include "Emulator/Util/singleton.h" +#include "Util/Singleton.h" #include "controller.h" +#include +#include 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 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) { - auto* controller = singleton::instance(); + auto* controller = Singleton::Instance(); int connectedCount = 0; bool isConnected = false; Emulator::Host::Controller::State state; controller->readState(&state, &isConnected, &connectedCount); - pData->buttons = state.buttonsState; - pData->leftStick.x = 0; // dummy - pData->leftStick.y = 0; // dummy + pData->leftStick.x = 128; // dummy + pData->leftStick.y = 128; // dummy pData->rightStick.x = 0; // dummy pData->rightStick.y = 0; // dummy pData->analogButtons.r2 = 0;//dummy diff --git a/src/emulator.cpp b/src/emulator.cpp index 1ea83010..95735507 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -1,13 +1,13 @@ #include "emulator.h" #include +#include #include #include #include "Core/PS4/HLE/Graphics/video_out.h" #include "Emulator/HLE/Libraries/LibPad/pad.h" #include "version.h" -#include namespace Emu {