port: fix rumble
This commit is contained in:
parent
a49bfd00a4
commit
554fde7a9d
|
|
@ -262,11 +262,14 @@ void inputRumble(s32 idx, f32 strength, f32 time)
|
|||
return;
|
||||
}
|
||||
if (SDL_GameControllerHasRumble(pads[idx])) {
|
||||
if (strength < 0.f) {
|
||||
if (strength <= 0.f) {
|
||||
strength = 0.f;
|
||||
time = 0.f;
|
||||
} else {
|
||||
strength *= 65535.f;
|
||||
time *= 1000.f;
|
||||
}
|
||||
strength *= 65535.f;
|
||||
SDL_GameControllerRumble(pads[idx], (u16)strength, (u16)strength, (u32)(time * 1000.f));
|
||||
SDL_GameControllerRumble(pads[idx], (u16)strength, (u16)strength, (u32)time);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ void osContGetQuery(OSContStatus *status)
|
|||
if (inputControllerConnected(i)) {
|
||||
status->errnum = 0;
|
||||
status->type = CONT_ABSOLUTE;
|
||||
status->status = 1;
|
||||
status->status = CONT_CARD_ON;
|
||||
} else {
|
||||
status->errnum = CONT_NO_RESPONSE_ERROR;
|
||||
status->type = 0;
|
||||
|
|
@ -287,13 +287,19 @@ s32 osPfsIsPlug(OSMesgQueue *queue, u8 *pattern)
|
|||
{
|
||||
if (pattern) {
|
||||
*pattern = 0;
|
||||
for (s32 i = 0; i < MAXCONTROLLERS; ++i) {
|
||||
if (inputRumbleSupported(i)) {
|
||||
*pattern |= 1 << i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osPfsInitPak(OSMesgQueue *queue, OSPfs *pfs, s32 channel, s32 *arg3)
|
||||
{
|
||||
return PFS_ERR_NOPACK;
|
||||
// if rumble is supported, indicate that we have a rumble pak instead
|
||||
return inputRumbleSupported(channel) ? PFS_ERR_DEVICE : PFS_ERR_NOPACK;
|
||||
}
|
||||
|
||||
s32 osPfsChecker(OSPfs *pfs)
|
||||
|
|
|
|||
Loading…
Reference in New Issue