Fix country detection for in-region titles

This commit is contained in:
Maschell 2022-09-18 11:54:43 +02:00
parent 96dd185bbe
commit 9ab8cbfd49

View File

@ -180,12 +180,28 @@ void bootStuff() {
int ucRes = real_UCReadSysConfig(ucHandle, 1, &sysConfig); int ucRes = real_UCReadSysConfig(ucHandle, 1, &sysConfig);
if (ucRes >= 0) { if (ucRes >= 0) {
DEBUG_FUNCTION_LINE("Force default language to system title for own region"); DEBUG_FUNCTION_LINE("Force default language to system language for own region");
gCurrentLanguage = static_cast<Lanuages>(*(uint32_t *) sysConfig.data); gCurrentLanguage = static_cast<Lanuages>(*(uint32_t *) sysConfig.data);
gDefaultLanguage = static_cast<Lanuages>(*(uint32_t *) sysConfig.data); gDefaultLanguage = static_cast<Lanuages>(*(uint32_t *) sysConfig.data);
} else { } else {
DEBUG_FUNCTION_LINE_ERR("UCReadSysConfig failed"); DEBUG_FUNCTION_LINE_ERR("UCReadSysConfig failed");
} }
memset((void *) &sysConfig, 0, sizeof(sysConfig));
data = 0xFFFFFFFF;
sysConfig.dataType = UC_DATATYPE_UNSIGNED_INT;
sysConfig.dataSize = 4;
sysConfig.data = &data;
strncpy(sysConfig.name, "cafe.cntry_reg", 64);
ucRes = real_UCReadSysConfig(ucHandle, 1, &sysConfig);
if (ucRes >= 0) {
DEBUG_FUNCTION_LINE("Force default country to system country for own region");
gCurrentCountry = (int32_t) * (uint32_t *) sysConfig.data;
gDefaultCountry = (int32_t) * (uint32_t *) sysConfig.data;
} else {
DEBUG_FUNCTION_LINE_ERR("UCReadSysConfig failed");
}
UCClose(ucHandle); UCClose(ucHandle);
} else { } else {
DEBUG_FUNCTION_LINE_ERR("UCOpen failed"); DEBUG_FUNCTION_LINE_ERR("UCOpen failed");