xinput_descriptors.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * SPDX-License-Identifier: MIT
  3. * SPDX-FileCopyrightText: Copyright (c) 2021 Jason Skuby (mytechtoybox.com)
  4. *
  5. * Configuration body adapted from GP2040-CE's XInputDescriptors.h.
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a
  8. * copy of this software and associated documentation files (the "Software"),
  9. * to deal in the Software without restriction, including without limitation
  10. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11. * and/or sell copies of the Software, and to permit persons to whom the
  12. * Software is furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in
  15. * all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  20. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. * DEALINGS IN THE SOFTWARE.
  24. */
  25. #pragma once
  26. #include <stdint.h>
  27. static const uint8_t XINPUT_CONFIG_BODY[] = {
  28. 9, 4, 0, 0, 2, 0xFF, 0x5D, 0x01, 0, 17, 0x21,
  29. 0, 1, 1, 0x25, 0x81, 0x14, 0, 0, 0, 0, 0x13,
  30. 0x02, 0x08, 0, 0, 7, 5, 0x81, 3, 0x20, 0, 1,
  31. 7, 5, 0x02, 3, 0x20, 0, 8,
  32. 9, 4, 1, 0, 4, 0xFF, 0x5D, 0x03, 0, 27, 0x21,
  33. 0, 1, 1, 1, 0x83, 0x40, 1, 0x04, 0x20, 0x16, 0x85,
  34. 0, 0, 0, 0, 0, 0, 0x16, 0x06, 0, 0, 0,
  35. 0, 0, 0, 7, 5, 0x83, 3, 0x20, 0, 2, 7,
  36. 5, 0x04, 3, 0x20, 0, 4, 7, 5, 0x85, 3, 0x20,
  37. 0, 0x40, 7, 5, 0x06, 3, 0x20, 0, 0x10,
  38. 9, 4, 2, 0, 1, 0xFF, 0x5D, 0x02, 0, 9, 0x21,
  39. 0, 1, 1, 0x22, 0x86, 3, 0, 7, 5, 0x86, 3,
  40. 0x20, 0, 0x10,
  41. 9, 4, 3, 0, 0, 0xFF, 0xFD, 0x13, 4, 6, 0x41,
  42. 0, 1, 1, 3,
  43. };
  44. static_assert(sizeof XINPUT_CONFIG_BODY == 144,
  45. "Xbox 360 configuration body must be 144 bytes");
  46. static const uint16_t XINPUT_SECURITY_STRING_OFFSET = 137;
  47. static const char XINPUT_SECURITY_STRING[] =
  48. "Xbox Security Method 3, Version 1.00, \xc2\xa9 2005 Microsoft "
  49. "Corporation. All rights reserved.";