/*---------------------------------------------------------------------------* Project: Horizon File: main.cpp Copyright 2009-2011 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev$ *---------------------------------------------------------------------------*/ #include #include #include #include #include //========================================================================== // MSET ProgramId取得 //========================================================================== nn::ProgramId GetProgramIdMsetWithRegion_() { bit32 pid = nn::CTR::PROGRAM_ID_UNIQUE_ID_MSET; // JP switch (nn::cfg::GetRegion()) { case nn::cfg::CTR::CFG_REGION_AMERICA: { pid = nn::CTR::PROGRAM_ID_UNIQUE_ID_MSET_US; // US } break; case nn::cfg::CTR::CFG_REGION_EUROPE: case nn::cfg::CTR::CFG_REGION_AUSTRALIA: { pid = nn::CTR::PROGRAM_ID_UNIQUE_ID_MSET_EU; // EU } break; case nn::cfg::CTR::CFG_REGION_CHINA: { pid = nn::CTR::PROGRAM_ID_UNIQUE_ID_MSET_CN; // CN } break; case nn::cfg::CTR::CFG_REGION_KOREA: { pid = nn::CTR::PROGRAM_ID_UNIQUE_ID_MSET_KR; // KR } break; case nn::cfg::CTR::CFG_REGION_TAIWAN: { pid = nn::CTR::PROGRAM_ID_UNIQUE_ID_MSET_TW; // TW } break; } return nn::CTR::MakeProgramId(nn::CTR::PROGRAM_ID_CATEGORY_SYSTEM_APPLICATION, pid, nn::CTR::PROGRAM_ID_VERSION_APP); } extern "C" void nnMain() { nn::Result result; // os の初期化 nn::os::Initialize(); nn::applet::Enable(); nn::cfg::Initialize(); // 規定サイズの配列としてパラメータバッファを確保 u8 jumpParam[NN_APPLET_PARAM_BUF_SIZE]; *reinterpret_cast(jumpParam) = 124; // 本体初期化画面 // MSETにジャンプすることを宣言 nn::applet::PrepareToJumpToOtherApplication(GetProgramIdMsetWithRegion_(), nn::fs::MEDIA_TYPE_NAND); // MSETにジャンプするためのパラメータを渡してジャンプ // この関数からは返ってこない nn::applet::JumpToOtherApplication(jumpParam); }