You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

  1. /* gc_n64_usb : Gamecube or N64 controller to USB firmware
  2. Copyright (C) 2007-2016 Raphael Assenat <raph@raphnet.net>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include <stdlib.h> // for wchar_t
  15. #include "usbstrings.h"
  16. static wchar_t product_string[PRODUCT_STRING_MAXCHARS]; // = L"GC/N64 to USB v"VERSIONSTR_SHORT;
  17. const wchar_t *g_usb_strings[] = {
  18. [0] = L"raphnet technologies", // 1 : Vendor
  19. [1] = product_string, // 2: Product
  20. [2] = L"123456", // 3 : Serial
  21. };
  22. void usbstrings_changeProductString_P(const char *str)
  23. {
  24. const char *s = str;
  25. wchar_t *d = product_string;
  26. uint8_t c;
  27. int n = 0;
  28. do {
  29. /* Make sure target is always NUL terminated. */
  30. n++;
  31. if (n == PRODUCT_STRING_MAXCHARS) {
  32. *d = 0;
  33. break;
  34. }
  35. c = pgm_read_byte(s);
  36. *d = c;
  37. s++; d++;
  38. } while (c);
  39. }