diff --git a/trunk/CardCup/main.cpp b/trunk/CardCup/main.cpp index e5dd962..eefb523 100644 --- a/trunk/CardCup/main.cpp +++ b/trunk/CardCup/main.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -70,6 +71,8 @@ namespace //nn::applet::SetAppletMode(); nn::applet::Enable(); + nn::cfg::Initialize(); + // デバイスメモリの設定 const int DEVICE_MEMORY_SIZE = 12*1024 * 1024; NN_UTIL_PANIC_IF_FAILED(nn::os::SetDeviceMemorySize(DEVICE_MEMORY_SIZE)); @@ -227,8 +230,33 @@ extern "C" void nnMain() nn::Result result; Initialize(); + nn::ProgramId MMEN_PROGRAM_ID = 0x0004003000008202; + + nn::cfg::CfgRegionCode region = nn::cfg::GetRegion(); + switch(region) + { + case nn::cfg::CFG_REGION_AMERICA: + { + MMEN_PROGRAM_ID = 0x0004003000008f02; + } + break; + + case nn::cfg::CFG_REGION_EUROPE: + case nn::cfg::CFG_REGION_AUSTRALIA: + { + MMEN_PROGRAM_ID = 0x0004003000009802; + } + break; + + case nn::cfg::CFG_REGION_JAPAN: + { + MMEN_PROGRAM_ID = 0x0004003000008202; + } + break; + } + + nn::am::ProgramInfo outInfos; - const nn::ProgramId MMEN_PROGRAM_ID = 0x0004003000008202; result = nn::am::GetProgramInfos(&outInfos, nn::fs::MEDIA_TYPE_NAND, &MMEN_PROGRAM_ID, 1); if (result.IsSuccess()) {