diff --git a/common/audio/s9x_sound_driver_sdl3.cpp b/common/audio/s9x_sound_driver_sdl3.cpp index 882973c6..4bb6eff2 100644 --- a/common/audio/s9x_sound_driver_sdl3.cpp +++ b/common/audio/s9x_sound_driver_sdl3.cpp @@ -6,6 +6,7 @@ #include "s9x_sound_driver_sdl3.hpp" #include "SDL3/SDL_audio.h" +#include #include bool S9xSDL3SoundDriver::write_samples(int16_t *data, int samples) @@ -116,4 +117,4 @@ std::pair S9xSDL3SoundDriver::buffer_level() { std::pair level = { buffer.space_empty(), buffer.buffer_size }; return level; -} \ No newline at end of file +} diff --git a/qt/src/ControllerPanel.cpp b/qt/src/ControllerPanel.cpp index fc0c23ec..d6cdc0f6 100644 --- a/qt/src/ControllerPanel.cpp +++ b/qt/src/ControllerPanel.cpp @@ -110,10 +110,10 @@ void ControllerPanel::autoPopulateWithJoystick(int joystick_id, int slot) SDL_GAMEPAD_BUTTON_DPAD_LEFT, SDL_GAMEPAD_BUTTON_DPAD_RIGHT, // B, A and X, Y are inverted on XInput vs SNES - SDL_GAMEPAD_BUTTON_SOUTH, SDL_GAMEPAD_BUTTON_EAST, - SDL_GAMEPAD_BUTTON_WEST, + SDL_GAMEPAD_BUTTON_SOUTH, SDL_GAMEPAD_BUTTON_NORTH, + SDL_GAMEPAD_BUTTON_WEST, SDL_GAMEPAD_BUTTON_LEFT_SHOULDER, SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER, SDL_GAMEPAD_BUTTON_START, @@ -125,7 +125,8 @@ void ControllerPanel::autoPopulateWithJoystick(int joystick_id, int slot) auto get_binding_for_button = [&](SDL_GamepadButton button) -> SDL_GamepadBinding { for (int i = 0; i < num_bindings; i++) - if (bindings[i]->output.button == button) + if (bindings[i]->output_type == SDL_GAMEPAD_BINDTYPE_BUTTON && + bindings[i]->output.button == button) return *bindings[i]; return SDL_GamepadBinding{}; };