2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CDOLPHINCONTROLLER
|
|
|
|
#define _CDOLPHINCONTROLLER
|
2022-09-11 18:45:19 +00:00
|
|
|
|
|
|
|
#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;
|
|
|
|
|
2022-09-11 18:45:19 +00:00
|
|
|
public:
|
2022-09-18 06:05:46 +00:00
|
|
|
CDolphinController();
|
2022-10-19 03:35:06 +00:00
|
|
|
~CDolphinController() override;
|
|
|
|
void Poll() override;
|
|
|
|
uint GetDeviceCount() const override;
|
|
|
|
CControllerGamepadData& GetGamepadData(int controller) override;
|
|
|
|
uint GetControllerType(int) const override;
|
|
|
|
void SetMotorState(EIOPort port, EMotorState state) override;
|
2022-09-13 04:52:59 +00:00
|
|
|
|
2022-10-19 03:35:06 +00:00
|
|
|
bool Initialize();
|
2022-09-18 06:05:46 +00:00
|
|
|
float GetAnalogStickMaxValue(EJoyAxis axis) const;
|
2022-09-13 04:52:59 +00:00
|
|
|
|
2022-09-11 18:45:19 +00:00
|
|
|
private:
|
2022-09-13 04:52:59 +00:00
|
|
|
void ReadDevices();
|
|
|
|
void ProcessInputData();
|
|
|
|
void ProcessAxis(int controller, EJoyAxis axis);
|
|
|
|
void ProcessButtons(int controller);
|
2022-10-09 05:37:23 +00:00
|
|
|
void ProcessDigitalButton(int value, CControllerButton& button, ushort mapping);
|
2022-09-13 04:52:59 +00:00
|
|
|
void ProcessAnalogButton(float value, CControllerAxis& axis);
|
2022-09-11 18:45:19 +00:00
|
|
|
PADStatus x4_status[4];
|
|
|
|
CControllerGamepadData x34_gamepadStates[4];
|
|
|
|
EMotorState x194_motorStates[4];
|
2022-09-13 04:52:59 +00:00
|
|
|
uint x1a4_controllerTypes[4];
|
2022-10-09 05:37:23 +00:00
|
|
|
uint x1b4_controllerTypePollTime[4];
|
|
|
|
uint x1c4_;
|
|
|
|
uint x1c8_invalidControllers;
|
|
|
|
uint x1cc_;
|
2022-09-11 18:45:19 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CDOLPHINCONTROLLER
|