mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-28 15:39:10 +00:00
Added the CRC of the joystick name to the GUID
This will make it possible to have mappings for different controllers that have the same VID/PID. This happens frequently with some generic controller boards that have been reused in many products. Fixes https://github.com/libsdl-org/SDL/issues/6004
This commit is contained in:
parent
20715fa014
commit
c1e0873940
21 changed files with 179 additions and 117 deletions
|
@ -198,7 +198,7 @@ SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc)
|
|||
/* Byteswap so devices get same GUID on little/big endian platforms. */
|
||||
guid16 = (Uint16 *)hwdata->guid.data;
|
||||
*guid16++ = SDL_SwapLE16(SDL_HARDWARE_BUS_VIRTUAL);
|
||||
*guid16++ = 0;
|
||||
*guid16++ = SDL_SwapLE16(SDL_crc16(0, name, SDL_strlen(name)));
|
||||
*guid16++ = SDL_SwapLE16(hwdata->desc.vendor_id);
|
||||
*guid16++ = 0;
|
||||
*guid16++ = SDL_SwapLE16(hwdata->desc.product_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue