mirror of
https://github.com/Maschell/controller_patcher.git
synced 2024-11-22 03:59:16 +01:00
Attempted to make the GC-Rumble working more reliable
This commit is contained in:
parent
8dee7c3e70
commit
837908290e
@ -491,19 +491,22 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcherHID::getHIDData(u32 hidmask,
|
||||
|
||||
|
||||
void ControllerPatcherHID::HIDGCRumble(u32 handle,my_cb_user *usr){
|
||||
if(usr == NULL) return;
|
||||
s32 rumblechanged = 0;
|
||||
|
||||
for(s32 i = 0;i<HID_MAX_PADS_COUNT;i++){
|
||||
for(s32 i = 0;i<HID_GC_PAD_COUNT;i++){
|
||||
HID_Data * data_ptr = &(gHID_Devices[usr->slotdata.deviceslot].pad_data[i]);
|
||||
if(data_ptr->rumbleActive != usr->rumblestatus[i]){
|
||||
usr->rumblestatus[i] = data_ptr->rumbleActive;
|
||||
usr->buf[i+1] = usr->rumblestatus[i];
|
||||
rumblechanged = 1;
|
||||
}
|
||||
usr->rumblestatus[i] = data_ptr->rumbleActive;
|
||||
usr->buf[i+1] = usr->rumblestatus[i];
|
||||
}
|
||||
if(rumblechanged){
|
||||
usr->rumbleForce[0]--;
|
||||
if(rumblechanged || usr->rumbleForce[0] <= 0){
|
||||
usr->buf[0] = 0x11;
|
||||
HIDWrite(handle, usr->buf, 5, NULL, NULL);
|
||||
usr->rumbleForce[0] = 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user