diff --git a/rpcs3/Emu/Io/LogitechG27.cpp b/rpcs3/Emu/Io/LogitechG27.cpp index af6e89e350..1612c567d6 100644 --- a/rpcs3/Emu/Io/LogitechG27.cpp +++ b/rpcs3/Emu/Io/LogitechG27.cpp @@ -309,11 +309,11 @@ void usb_device_logitech_g27::sdl_refresh() slot.effect_id = -1; } m_default_spring_effect_id = -1; - m_led_joystick_handle = new_led_joystick_handle; m_haptic_handle = new_haptic_handle; } if (led_joystick_changed) { + SDL_SetJoystickLED(m_led_joystick_handle, 0, 0, 0); m_led_joystick_handle = new_led_joystick_handle; } } @@ -1456,7 +1456,7 @@ void usb_device_logitech_g27::interrupt_transfer(u32 buf_size, u8* buf, u32 endp { new_led_level += (buf[1] & (1 << i)) ? 1 : 0; } - const u8 intensity = new_led_level * 255 / 7; + const u8 intensity = new_led_level * 255 / 8; SDL_SetJoystickLED(m_led_joystick_handle, intensity, intensity, intensity); break; } diff --git a/rpcs3/Emu/Io/LogitechG27.h b/rpcs3/Emu/Io/LogitechG27.h index 4bbdc70dec..5a8406486a 100644 --- a/rpcs3/Emu/Io/LogitechG27.h +++ b/rpcs3/Emu/Io/LogitechG27.h @@ -28,7 +28,10 @@ struct logitech_g27_ffb_slot logitech_g27_ffb_state state = logitech_g27_ffb_state::inactive; u64 last_update = 0; SDL_HapticEffect last_effect {}; - s32 effect_id = -1; + + // TODO switch to SDL_HapticEffectID when it becomes available in a future SDL release + // Match the return of SDL_CreateHapticEffect for now + int effect_id = -1; }; struct sdl_mapping @@ -113,7 +116,9 @@ private: u16 m_wheel_range = 200; std::array m_effect_slots {}; SDL_HapticEffect m_default_spring_effect {}; - s32 m_default_spring_effect_id = -1; + + // TODO switch to SDL_HapticEffectID when it becomes available in a future SDL release + int m_default_spring_effect_id = -1; bool m_enabled = false;