mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-14 15:46:19 +00:00
full IOKit support for smash adapter
This commit is contained in:
@@ -3,9 +3,27 @@
|
||||
#include <stdio.h>
|
||||
#include <boo.hpp>
|
||||
|
||||
class CDolphinSmashAdapterCallback : public IDolphinSmashAdapterCallback
|
||||
{
|
||||
void controllerConnected(unsigned idx, EDolphinControllerType type)
|
||||
{
|
||||
printf("CONTROLLER %u CONNECTED\n", idx);
|
||||
}
|
||||
void controllerDisconnected(unsigned idx, EDolphinControllerType type)
|
||||
{
|
||||
printf("CONTROLLER %u DISCONNECTED\n", idx);
|
||||
}
|
||||
void controllerUpdate(unsigned idx, EDolphinControllerType type,
|
||||
const SDolphinControllerState& state)
|
||||
{
|
||||
printf("CONTROLLER %u UPDATE %d %d\n", idx, state.m_leftStick[0], state.m_leftStick[1]);
|
||||
}
|
||||
};
|
||||
|
||||
class CTestDeviceFinder : public CDeviceFinder
|
||||
{
|
||||
CDolphinSmashAdapter* smashAdapter = NULL;
|
||||
CDolphinSmashAdapterCallback m_cb;
|
||||
public:
|
||||
CTestDeviceFinder()
|
||||
: CDeviceFinder(DEV_DOL_SMASH_ADAPTER)
|
||||
@@ -13,6 +31,7 @@ public:
|
||||
void deviceConnected(CDeviceToken& tok)
|
||||
{
|
||||
smashAdapter = dynamic_cast<CDolphinSmashAdapter*>(tok.openAndGetDevice());
|
||||
smashAdapter->setCallback(&m_cb);
|
||||
}
|
||||
void deviceDisconnected(CDeviceToken&, CDeviceBase* device)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user