mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Improve button react times
This commit is contained in:
parent
4514937a0b
commit
927c885e87
11
source/hid.c
11
source/hid.c
@ -4,7 +4,16 @@ u32 InputWait() {
|
||||
u32 pad_state_old = HID_STATE;
|
||||
while (true) {
|
||||
u32 pad_state = HID_STATE;
|
||||
if (pad_state ^ pad_state_old)
|
||||
if (!(~pad_state & BUTTON_ANY)) { // no buttons pressed
|
||||
pad_state_old = pad_state;
|
||||
continue;
|
||||
}
|
||||
if (pad_state == pad_state_old)
|
||||
continue;
|
||||
//Make sure the key is pressed
|
||||
u32 t_pressed = 0;
|
||||
for(; (t_pressed < 0x13000) && (pad_state == HID_STATE); t_pressed++);
|
||||
if (t_pressed >= 0x13000)
|
||||
return ~pad_state;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user