prime/include/Kyoto/Input/CDolphinController.hpp

42 lines
1.2 KiB
C++
Raw Normal View History

#ifndef __CDOLPHINCONTROLLER_HPP__
#define __CDOLPHINCONTROLLER_HPP__
#include "Kyoto/Input/IController.hpp"
class CDolphinController : public IController {
2022-09-13 04:52:59 +00:00
static const uint skTypeUnknown;
static const uint skTypeStandard;
static const uint skTypeGBA;
static const uint skTypeWavebird;
public:
CDolphinController();
2022-09-13 04:52:59 +00:00
virtual ~CDolphinController();
void Poll();
uint GetDeviceCount() const;
CControllerGamepadData& GetGamepadData(int controller);
2022-09-13 04:52:59 +00:00
uint GetControllerType(int) const;
void SetMotorState(EIOPort port, EMotorState state);
bool Initialize();
2022-09-13 04:52:59 +00:00
float GetAnalogStickMaxValue(EJoyAxis axis) const;
private:
2022-09-13 04:52:59 +00:00
void ReadDevices();
void ProcessInputData();
void ProcessAxis(int controller, EJoyAxis axis);
void ProcessButtons(int controller);
void ProcessDigitalButton(int value, CControllerButton& button, u16 mapping);
void ProcessAnalogButton(float value, CControllerAxis& axis);
PADStatus x4_status[4];
CControllerGamepadData x34_gamepadStates[4];
EMotorState x194_motorStates[4];
2022-09-13 04:52:59 +00:00
uint x1a4_controllerTypes[4];
u32 x1b4_controllerTypePollTime[4];
u32 x1c4_;
u32 x1c8_invalidControllers;
u32 x1cc_;
};
#endif // __CDOLPHINCONTROLLER_HPP__