1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 13:30:47 +00:00
oot/src/boot/z_locale.c

64 lines
1.4 KiB
C
Raw Normal View History

#include "global.h"
#include "vt.h"
2020-03-17 04:31:30 +00:00
u32 gCurrentRegion = 0;
LocaleCartInfo sCartInfo;
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");
LogUtils_HungupThread("../z_locale.c", 118);
2020-03-17 04:31:30 +00:00
osSyncPrintf(VT_RST);
break;
}
osSyncPrintf("z_locale_init:日本用かアメリカ用か3コンで判断させる\n");
}
void Locale_ResetRegion(void) {
2020-03-17 04:31:30 +00:00
gCurrentRegion = REGION_NULL;
}
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
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;
}
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
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?
u32 Locale_IsRegionNative(void) {
2020-03-17 04:31:30 +00:00
return gCurrentRegion == REGION_NATIVE;
}