2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "vt.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
u32 gCurrentRegion = 0;
|
|
|
|
LocaleCartInfo sCartInfo;
|
|
|
|
|
2021-02-14 00:49:40 +00:00
|
|
|
void Locale_Init(void) {
|
2020-03-17 04:31:30 +00:00
|
|
|
osEPiReadIo(gCartHandle, 0x38, &sCartInfo.mediaFormat);
|
|
|
|
osEPiReadIo(gCartHandle, 0x3C, &sCartInfo.regionInfo);
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (sCartInfo.countryCode) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 'J': // "NTSC-U (North America)"
|
|
|
|
gCurrentRegion = REGION_US;
|
|
|
|
break;
|
|
|
|
case 'E': // "NTSC-J (Japan)"
|
|
|
|
gCurrentRegion = REGION_JP;
|
|
|
|
break;
|
|
|
|
case 'P': // "PAL (Europe)"
|
|
|
|
gCurrentRegion = REGION_EU;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
osSyncPrintf(VT_COL(RED, WHITE));
|
|
|
|
osSyncPrintf("z_locale_init: 日本用かアメリカ用か判別できません\n");
|
2021-11-26 22:37:33 +00:00
|
|
|
LogUtils_HungupThread("../z_locale.c", 118);
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_RST);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
osSyncPrintf("z_locale_init:日本用かアメリカ用か3コンで判断させる\n");
|
|
|
|
}
|
|
|
|
|
2021-02-14 00:49:40 +00:00
|
|
|
void Locale_ResetRegion(void) {
|
2020-03-17 04:31:30 +00:00
|
|
|
gCurrentRegion = REGION_NULL;
|
|
|
|
}
|
|
|
|
|
2021-02-14 00:49:40 +00:00
|
|
|
u32 func_80001F48(void) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (gCurrentRegion == REGION_NATIVE) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-14 17:17:25 +00:00
|
|
|
if (gPadMgr.validCtrlrsMask & 4) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2021-02-14 00:49:40 +00:00
|
|
|
u32 func_80001F8C(void) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (gCurrentRegion == REGION_NATIVE) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-14 17:17:25 +00:00
|
|
|
if (gPadMgr.validCtrlrsMask & 4) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return 1;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function appears to be unused?
|
2021-02-14 00:49:40 +00:00
|
|
|
u32 Locale_IsRegionNative(void) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return gCurrentRegion == REGION_NATIVE;
|
|
|
|
}
|