ppsspp/Windows/XinputDevice.h
LunaMoo e999444b23 Implement PPSSPP specific cheats:
0xA0 vibration cheat(Xinput)
Syntax is: 0xA0NNLLLL 0x00MMRRRR
where NN/MM is time vibration lasts LLLL/RRRR is the vibration power

0xA1 read value for the vibration(Xinput) from game memory
Syntax is: 0xA1000000 0xNNNNNNNN
where NNNNNNNN is the address that stores following values at offset:
0xNNNNNNNN + 0x0 Left Vibration power,
0xNNNNNNNN + 0x2 Right Vibration Power
0xNNNNNNNN + 0x4 Left Vibration time
0xNNNNNNNN + 0x6 Right Vibration time

Left some room for other PPSSPP specific cheats(0xA2-0xAF)
2020-04-16 23:00:29 +02:00

23 lines
571 B
C++

#pragma once
#include "InputDevice.h"
#include "Xinput.h"
#include "Core/HLE/sceCtrl.h"
class XinputDevice final : public InputDevice {
public:
XinputDevice();
~XinputDevice();
virtual int UpdateState() override;
private:
void UpdatePad(int pad, const XINPUT_STATE &state, XINPUT_VIBRATION &vibration);
void ApplyButtons(int pad, const XINPUT_STATE &state);
void ApplyVibration(int pad, XINPUT_VIBRATION &vibration);
int check_delay[4]{};
XINPUT_STATE prevState[4]{};
XINPUT_VIBRATION prevVibration[4]{};
int prevVibrationTime = 0;
u32 prevButtons[4]{};
};