mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-14 21:40:03 +00:00
75 lines
1.6 KiB
C
75 lines
1.6 KiB
C
|
#include <ultra64.h>
|
||
|
#include <global.h>
|
||
|
#include <vt.h>
|
||
|
#include <padmgr.h>
|
||
|
|
||
|
u32 gCurrentRegion = 0;
|
||
|
LocaleCartInfo sCartInfo;
|
||
|
|
||
|
//temporary
|
||
|
extern PadMgr gPadMgr;
|
||
|
|
||
|
void Locale_Init()
|
||
|
{
|
||
|
osEPiReadIo(gCartHandle, 0x38, &sCartInfo.mediaFormat);
|
||
|
osEPiReadIo(gCartHandle, 0x3C, &sCartInfo.regionInfo);
|
||
|
|
||
|
switch (sCartInfo.countryCode)
|
||
|
{
|
||
|
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", 0x76);
|
||
|
osSyncPrintf(VT_RST);
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
osSyncPrintf("z_locale_init:日本用かアメリカ用か3コンで判断させる\n");
|
||
|
}
|
||
|
|
||
|
void Locale_ResetRegion()
|
||
|
{
|
||
|
gCurrentRegion = REGION_NULL;
|
||
|
}
|
||
|
|
||
|
u32 func_80001F48()
|
||
|
{
|
||
|
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; //cast required to match
|
||
|
|
||
|
if (gCurrentRegion == REGION_NATIVE)
|
||
|
return 0;
|
||
|
|
||
|
if (padMgr->unk_2A8 & 4)
|
||
|
return 0;
|
||
|
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
u32 func_80001F8C()
|
||
|
{
|
||
|
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; //cast required to match
|
||
|
|
||
|
if (gCurrentRegion == REGION_NATIVE)
|
||
|
return 0;
|
||
|
|
||
|
if (padMgr->unk_2A8 & 4)
|
||
|
return 1;
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
// This function appears to be unused?
|
||
|
u32 Locale_IsRegionNative()
|
||
|
{
|
||
|
return gCurrentRegion == REGION_NATIVE;
|
||
|
}
|