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