mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-29 11:06:07 +00:00
added timestamp in buttons state
This commit is contained in:
parent
758ef332f2
commit
3602864523
|
@ -38,7 +38,7 @@ int PS4_SYSV_ABI scePadReadState(int32_t handle, ScePadData* pData) {
|
|||
pData->orientation.y = 0;
|
||||
pData->orientation.z = 0;
|
||||
pData->orientation.w = 0;
|
||||
|
||||
pData->timestamp = state.time;
|
||||
pData->connected = true; // isConnected; //TODO fix me proper
|
||||
pData->connectedCount = 1;//connectedCount;
|
||||
pData->deviceUniqueDataLen = 0;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "controller.h"
|
||||
#include <Core/hle/libraries/libkernel/time_management.h>
|
||||
|
||||
namespace Emulator::Host::Controller {
|
||||
GameController::GameController() { m_states_num = 0;
|
||||
|
@ -39,6 +40,7 @@ void GameController::addState(const State& state) {
|
|||
void GameController::checKButton(int id, u32 button, bool isPressed) {
|
||||
std::scoped_lock lock{m_mutex};
|
||||
auto state = getLastState();
|
||||
state.time = Core::Libraries::sceKernelGetProcessTime();
|
||||
if (isPressed) {
|
||||
state.buttonsState |= button;
|
||||
} else {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
namespace Emulator::Host::Controller {
|
||||
struct State {
|
||||
u32 buttonsState =0;
|
||||
u64 time = 0;
|
||||
};
|
||||
|
||||
constexpr u32 MAX_STATES = 64;
|
||||
|
|
Loading…
Reference in a new issue