early-access version 3358

This commit is contained in:
pineappleEA
2023-02-02 02:44:36 +01:00
parent ac5af8f1ef
commit eab799b1ab
9 changed files with 238 additions and 4 deletions

View File

@@ -12,6 +12,7 @@
namespace Core::HID {
constexpr s32 HID_JOYSTICK_MAX = 0x7fff;
constexpr s32 HID_TRIGGER_MAX = 0x7fff;
constexpr u32 TURBO_BUTTON_DELAY = 4;
// Use a common UUID for TAS and Virtual Gamepad
constexpr Common::UUID TAS_UUID =
Common::UUID{{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xA5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
@@ -447,6 +448,7 @@ void EmulatedController::ReloadInput() {
},
});
}
turbo_button_state = 0;
}
void EmulatedController::UnloadInput() {
@@ -1659,12 +1661,12 @@ void EmulatedController::DeleteCallback(int key) {
}
void EmulatedController::TurboButtonUpdate() {
turbo_button_state = !turbo_button_state;
turbo_button_state = (turbo_button_state + 1) % (TURBO_BUTTON_DELAY * 2);
}
NpadButton EmulatedController::GetTurboButtonMask() const {
// Apply no mask when disabled
if (!turbo_button_state) {
if (turbo_button_state < TURBO_BUTTON_DELAY) {
return {NpadButton::All};
}

View File

@@ -525,7 +525,7 @@ private:
bool system_buttons_enabled{true};
f32 motion_sensitivity{0.01f};
bool force_update_motion{false};
bool turbo_button_state{false};
u32 turbo_button_state{0};
// Temporary values to avoid doing changes while the controller is in configuring mode
NpadStyleIndex tmp_npad_type{NpadStyleIndex::None};