SDL/input: Log GUID
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.6, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.6, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.6, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run

This commit is contained in:
Megamouse 2025-05-13 19:39:15 +02:00
parent fa744121fc
commit bc18b3592c
2 changed files with 13 additions and 2 deletions

View File

@ -11,6 +11,15 @@
LOG_CHANNEL(sdl_log, "SDL");
template <>
void fmt_class_string<SDL_GUID>::format(std::string& out, u64 arg)
{
const SDL_GUID& guid = get_object(arg);
char str[sizeof(SDL_GUID) * 2 + 1] {};
SDL_GUIDToString(guid, str, sizeof(str));
fmt::append(out, "%s", str);
}
sdl_pad_handler::sdl_pad_handler() : PadHandlerBase(pad_handler::sdl)
{
button_list =
@ -258,6 +267,7 @@ SDLDevice::sdl_info sdl_pad_handler::get_sdl_info(SDL_JoystickID id)
info.type = SDL_GetGamepadType(info.gamepad);
info.real_type = SDL_GetRealGamepadType(info.gamepad);
info.guid = SDL_GetGamepadGUIDForID(id);
info.vid = SDL_GetGamepadVendor(info.gamepad);
info.pid = SDL_GetGamepadProduct(info.gamepad);
info.product_version = SDL_GetGamepadProductVersion(info.gamepad);
@ -291,8 +301,8 @@ SDLDevice::sdl_info sdl_pad_handler::get_sdl_info(SDL_JoystickID id)
}
}
sdl_log.notice("Found game pad %d: type=%d, real_type=%d, name='%s', path='%s', serial='%s', vid=0x%x, pid=0x%x, product_version=0x%x, firmware_version=0x%x, has_led=%d, has_player_led=%d, has_mono_led=%d, has_rumble=%d, has_rumble_triggers=%d, has_accel=%d, has_gyro=%d",
id, static_cast<int>(info.type), static_cast<int>(info.real_type), info.name, info.path, info.serial, info.vid, info.pid, info.product_version, info.firmware_version, info.has_led, info.has_player_led, info.has_mono_led, info.has_rumble, info.has_rumble_triggers, info.has_accel, info.has_gyro);
sdl_log.error("Found game pad %d: type=%d, real_type=%d, name='%s', guid='%s', path='%s', serial='%s', vid=0x%x, pid=0x%x, product_version=0x%x, firmware_version=0x%x, has_led=%d, has_player_led=%d, has_mono_led=%d, has_rumble=%d, has_rumble_triggers=%d, has_accel=%d, has_gyro=%d",
id, static_cast<int>(info.type), static_cast<int>(info.real_type), info.name, info.guid, info.path, info.serial, info.vid, info.pid, info.product_version, info.firmware_version, info.has_led, info.has_player_led, info.has_mono_led, info.has_rumble, info.has_rumble_triggers, info.has_accel, info.has_gyro);
if (info.has_accel)
{

View File

@ -36,6 +36,7 @@ public:
SDL_Gamepad* gamepad = nullptr;
SDL_GamepadType type = SDL_GamepadType::SDL_GAMEPAD_TYPE_UNKNOWN;
SDL_GamepadType real_type = SDL_GamepadType::SDL_GAMEPAD_TYPE_UNKNOWN;
SDL_GUID guid {};
int power_level = 0;
int last_power_level = 0;