Fix vWii region & system menu detection errors (#6)

* GetRegionFromTXT: find line feed character rather than carriage return

* add vWii system menus to version list
This commit is contained in:
thepikachugamer 2024-01-30 11:11:26 -05:00 committed by GitHub
parent 8b7e126911
commit 596fa16162
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,21 +46,23 @@ const u16 VersionList[] =
416, 417, 418, // 4.0 416, 417, 418, // 4.0
448, 449, 450, 454, // 4.1 448, 449, 450, 454, // 4.1
480, 481, 482, 486, // 4.2 480, 481, 482, 486, // 4.2
512, 513, 514, 518, // 4.3 512, 513, 514, 518, // 4.3/vWii 1.0.0
544, 545, 546, // vWii 4.0.0
608, 609, 610 // vWii 5.2.0
}; };
u32 VersionListSize = sizeof(VersionList) / sizeof(VersionList[0]); u32 VersionListSize = sizeof(VersionList) / sizeof(VersionList[0]);
const char* VersionLookupTable[7][17] = const char* VersionLookupTable[7][20] =
{ {
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
{ "", "", "1.0", "", "2.0", "", "2.2", "3.0", "3.1", "3.2", "", "3.3", "3.4", "4.0", "4.1", "4.2", "4.3", }, { "", "", "1.0", "", "2.0", "", "2.2", "3.0", "3.1", "3.2", "", "3.3", "3.4", "4.0", "4.1", "4.2", "4.3", "4.3", "", "4.3" },
{ "", "1.0", "", "2.0", "", "", "2.2", "3.0", "3.1", "3.2", "", "3.3", "3.4", "4.0", "4.1", "4.2", "4.3", }, { "", "1.0", "", "2.0", "", "", "2.2", "3.0", "3.1", "3.2", "", "3.3", "3.4", "4.0", "4.1", "4.2", "4.3", "4.3" "", "4.3" },
{ "", "", "1.0", "", "2.0", "2.1", "2.2", "3.0", "3.1", "3.2", "", "3.3", "3.4", "4.0", "4.1", "4.2", "4.3", }, { "", "", "1.0", "", "2.0", "2.1", "2.2", "3.0", "3.1", "3.2", "", "3.3", "3.4", "4.0", "4.1", "4.2", "4.3", "4.3", "", "4.3" },
{ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", }, { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", }, { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", }, { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "", "", "", "", "", "", "", "", "", "", "3.3", "", "3.5", "", "4.1", "4.2", "4.3", }, { "", "", "", "", "", "", "", "", "", "", "3.3", "", "3.5", "", "4.1", "4.2", "4.3", "", "", "" },
}; };
u32 WaitButtons(void); u32 WaitButtons(void);
@ -175,7 +177,7 @@ static bool GetRegionFromTXT(char* region)
if(current) if(current)
{ {
char* start = strchr(current, '='); char* start = strchr(current, '=');
char* end = strchr(current, '\r'); char* end = strchr(current, '\n');
if (start && end) if (start && end)
{ {
@ -255,6 +257,11 @@ const char* GetSysMenuRegionString(const char region)
const char* GetSysMenuVersionString(u16 version) const char* GetSysMenuVersionString(u16 version)
{ {
/*
* ==== ==== === version
* 0000 0010 0110 0000
* = ==== region
*/
return VersionLookupTable[version % 32][version / 32]; return VersionLookupTable[version % 32][version / 32];
}; };