mirror of
https://github.com/encounter/aurora.git
synced 2025-12-16 00:17:15 +00:00
Split SI into it's own SDK library
This commit is contained in:
@@ -264,22 +264,6 @@ void PADControlAllMotors(const uint32_t* commands) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t SIProbe(int32_t chan) {
|
||||
auto* const controller = aurora::input::get_controller_for_player(chan);
|
||||
if (controller == nullptr) {
|
||||
return SI_ERROR_NO_RESPONSE;
|
||||
}
|
||||
|
||||
if (controller->m_isGameCube) {
|
||||
auto level = SDL_GetJoystickPowerInfo(SDL_GetGamepadJoystick(controller->m_controller), nullptr);
|
||||
if (level == SDL_POWERSTATE_UNKNOWN) {
|
||||
return SI_GC_WAVEBIRD;
|
||||
}
|
||||
}
|
||||
|
||||
return SI_GC_CONTROLLER;
|
||||
}
|
||||
|
||||
struct PADCLampRegion {
|
||||
uint8_t minTrigger;
|
||||
uint8_t maxTrigger;
|
||||
|
||||
20
lib/dolphin/si/si.cpp
Normal file
20
lib/dolphin/si/si.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <dolphin/si.h>
|
||||
#include "../../input.hpp"
|
||||
|
||||
#include <SDL3/SDL_power.h>
|
||||
|
||||
uint32_t SIProbe(int32_t chan) {
|
||||
auto* const controller = aurora::input::get_controller_for_player(chan);
|
||||
if (controller == nullptr) {
|
||||
return SI_ERROR_NO_RESPONSE;
|
||||
}
|
||||
|
||||
if (controller->m_isGameCube) {
|
||||
auto level = SDL_GetJoystickPowerInfo(SDL_GetGamepadJoystick(controller->m_controller), nullptr);
|
||||
if (level == SDL_POWERSTATE_UNKNOWN) {
|
||||
return SI_GC_WAVEBIRD;
|
||||
}
|
||||
}
|
||||
|
||||
return SI_GC_CONTROLLER;
|
||||
}
|
||||
Reference in New Issue
Block a user