diff --git a/trunk/SkipFirstLaunch/AutoBoot.bsf b/trunk/SkipFirstLaunch/AutoBoot.bsf new file mode 100644 index 0000000..104a94d Binary files /dev/null and b/trunk/SkipFirstLaunch/AutoBoot.bsf differ diff --git a/trunk/SkipFirstLaunch/OMakefile b/trunk/SkipFirstLaunch/OMakefile new file mode 100644 index 0000000..f9f8e94 --- /dev/null +++ b/trunk/SkipFirstLaunch/OMakefile @@ -0,0 +1,42 @@ +#!/usr/bin/env omake +#---------------------------------------------------------------------------- +# Project: CalViewer +# File: OMakefile +# +# Copyright (C)2009 Nintendo Co., Ltd. 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. +# +# $Revision$ +#---------------------------------------------------------------------------- +SUPPORTED_TARGETS = CTR-T*.Process.MPCore.fast +CTR_APPTYPE = CARD + +TARGET_PROGRAM = SkipFirstLaunch + +ROMFS_ROOT = romfiles +CTR_BANNER_SPEC = AutoBoot.bsf + +SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/SampleDemos/common/include) +INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR) \ + ../../common + +SOURCES[] = + main.cpp +# RSF +ROM_SPEC_FILE = $(TARGET_PROGRAM).rsf + +# DESC +#DESCRIPTOR = $(HORIZON_ROOT)/sources/tools/Config/Config.autogen.desc +DESCRIPTOR = $(HORIZON_ROOT)/resources/specfiles/RepairTool.desc + +LIBS += lib_demo libnn_ns + + +include $(ROOT_OMAKE)/modulerules + +build: $(DEFAULT_TARGETS) diff --git a/trunk/SkipFirstLaunch/OMakefile.omc b/trunk/SkipFirstLaunch/OMakefile.omc new file mode 100644 index 0000000..8d1c36a Binary files /dev/null and b/trunk/SkipFirstLaunch/OMakefile.omc differ diff --git a/trunk/SkipFirstLaunch/OMakeroot b/trunk/SkipFirstLaunch/OMakeroot new file mode 100644 index 0000000..7ee1cb5 --- /dev/null +++ b/trunk/SkipFirstLaunch/OMakeroot @@ -0,0 +1,73 @@ +#!/usr/bin/env omake +#---------------------------------------------------------------------------- +# Project: Horizon +# File: OMakeroot +# +# Copyright (C)2009 Nintendo Co., Ltd. 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:$ +#---------------------------------------------------------------------------- + +# ディレクトリレイアウトについての説明 +# +# a) ソースコードがルートディレクトリ直下に配置される場合 +# 例: +# /OMakeroot +# /foo/bar/OMakefile +# +# 結果: +# OMakefile と同じディレクトリ以下に objects や images が生成されます。 +# +# /foo/bar/objects/... +# /foo/bar/images/.. +# +# +# b) ソースコードが sources 以下に配置される場合 +# 例: +# /OMakeroot +# /sources/foo/bar/OMakefile +# +# 結果: +# ルートディレクトリ以下に objects や images が生成されます。 +# +# /objects/foo/bar/... +# /images/foo/bar/... +# +# + +# ルート環境変数の取得 +public.HORIZON_ROOT = +if $(defined-env HORIZON_ROOT) + HORIZON_ROOT = $(absname $(getenv HORIZON_ROOT)) + export + +if $(defined-env CTRSDK_ROOT) + CTRSDK_ROOT = $(absname $(getenv CTRSDK_ROOT)) + if $(and $(defined-env HORIZON_ROOT), $(not $(equal $(HORIZON_ROOT), $(CTRSDK_ROOT)))) + eprintln(HORIZON_ROOT と CTRSDK_ROOT が一致しません。同じパスを設定するか、どちらか一方だけを定義して下さい。) + exit(1) + HORIZON_ROOT = $(CTRSDK_ROOT) + export + +if $(not $(HORIZON_ROOT)) + eprintln($"$$CTRSDK_ROOT が定義されていません") + exit(1) + +include $(HORIZON_ROOT)/build/omake/commondefs + +DefineCommandVars() + +.PHONY: all build clean clobber +.PHONY: run run-scripts run-emumem + +# +# OMakefile の読み込み +# +.SUBDIRS: . + diff --git a/trunk/SkipFirstLaunch/Readme.txt b/trunk/SkipFirstLaunch/Readme.txt new file mode 100644 index 0000000..86c351b --- /dev/null +++ b/trunk/SkipFirstLaunch/Readme.txt @@ -0,0 +1,4 @@ +縲舌ン繝ォ繝臥腸蠅縲 + +繝サSDK +Horizon 2_3 branch r38025 diff --git a/trunk/SkipFirstLaunch/SkipFirstLaunch.rsf b/trunk/SkipFirstLaunch/SkipFirstLaunch.rsf new file mode 100644 index 0000000..cce1e3e --- /dev/null +++ b/trunk/SkipFirstLaunch/SkipFirstLaunch.rsf @@ -0,0 +1,28 @@ +BasicInfo: + Title : SkipFirstLaunch + ProductCode: SkipFirstLaunch + BackupMemoryType: None + +TitleInfo: + Use: Evaluation + Category: Application + UniqueId: 0xf8021 + Version: 0 + +SystemControlInfo: + AppType : Application + StackSize : 0x4000 + Dependency : + - codec + - hid + - gsp + +AccessControlInfo: + Priority : 16 + DisableDebug : true + +Option: + FreeProductCode: true + +CardInfo: + CardDevice: None diff --git a/trunk/SkipFirstLaunch/banner/model.cbmd b/trunk/SkipFirstLaunch/banner/model.cbmd new file mode 100644 index 0000000..f1c7b62 Binary files /dev/null and b/trunk/SkipFirstLaunch/banner/model.cbmd differ diff --git a/trunk/SkipFirstLaunch/banner/sound.cbsd b/trunk/SkipFirstLaunch/banner/sound.cbsd new file mode 100644 index 0000000..f1c7b62 Binary files /dev/null and b/trunk/SkipFirstLaunch/banner/sound.cbsd differ diff --git a/trunk/SkipFirstLaunch/banner/unknown24x24.ctpk b/trunk/SkipFirstLaunch/banner/unknown24x24.ctpk new file mode 100644 index 0000000..794b136 --- /dev/null +++ b/trunk/SkipFirstLaunch/banner/unknown24x24.ctpk @@ -0,0 +1 @@ +スススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススニススススススススススススススススススススススススススススススススススススススニ8ニ8ニ゙銷スス8ニススススス釡゙ニ鍄踟ススススススススススススススススススススススススススススススススススススススススススニススススススススススススススススススススススススススススススススススススススススススyホスyホスススススYホスススススススススススススススススススススススススススススススススス鍄゙yホYホスロ゙ロ゙ススニススロ゙yボスyホ轌ホ釡゙ススススYホ轌ホ銷スススススyホニロ゙鍄躡ホyホスススyホスコヨスススススyホスyホスススススYホスススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススyホ躡ホ銷スススススニスス轌ホ8ニススススニススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススス \ No newline at end of file diff --git a/trunk/SkipFirstLaunch/banner/unknown48x48.ctpk b/trunk/SkipFirstLaunch/banner/unknown48x48.ctpk new file mode 100644 index 0000000..8c7da16 --- /dev/null +++ b/trunk/SkipFirstLaunch/banner/unknown48x48.ctpk @@ -0,0 +1 @@ +スススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススYホススススススススススススススススススススススススススス8ニスス8ニ8ニスススコヨ8ニコヨ釡゙銷スススススススススス8ニ8ニススニススススススススススススススススス鍄逧ヨニ銷スス墮ス逧ヨ銷スススススススススススススススススススススススススススススススススススススススススス8ニススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススロ゙スロ゙ススススス銷ズスススススススススススススススススススススコヨスススススススススス鍄8ニ゙ロ゙スス墮スYホススススス躡ホyホ轌ホニススススススススニススススススススススススロ゙ロ゙釡゙踟スス躡ホ銷スススススロ゙スロ゙銷ススYボ墮釡゙コヨス墮スロ゙ススススス踟ス踟スススススススススススススススススススススロ゙スyホススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススYホス墮銷スロ゙スロ゙銷ススススススススススススススススス8ニススコヨロ゙スススススYホニyホ逧ヨ郤ヨスYホス觝ホススススススススススススススロ゙墮ススススススyホス鍄踟ススニスススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススス踟ス銷ズスYホ鍄銷ススススススススススススススススススススス8ニスススススススススス逧ヨスロ゙ス釡゙墮ススススススススススススススススススス8ニススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススススス \ No newline at end of file diff --git a/trunk/SkipFirstLaunch/main.cpp b/trunk/SkipFirstLaunch/main.cpp new file mode 100644 index 0000000..916d3da --- /dev/null +++ b/trunk/SkipFirstLaunch/main.cpp @@ -0,0 +1,123 @@ +/*---------------------------------------------------------------------------* + Project: Horizon + File: main.cpp + + Copyright 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 +#include + +#include "demo.h" + +#define HANDLE_ERROR(result) \ + if(result.IsFailure()) \ + { \ + DrawError(result); \ + } \ + +namespace +{ +demo::RenderSystemDrawing s_RenderSystem; +} + +extern "C" void nninitSetupDaemons(void) +{ +} + +void DrawError(nn::Result result) +{ + s_RenderSystem.SetClearColor(NN_GX_DISPLAY_BOTH, 1, 0, 0, 1); + s_RenderSystem.SetColor(1, 1, 1); + + for(;;) + { + s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0); + s_RenderSystem.Clear(); + s_RenderSystem.DrawText(0, 0, "Error: %08X", result.GetPrintableBits()); + + s_RenderSystem.SwapBuffers(); + s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY1); + s_RenderSystem.Clear(); + s_RenderSystem.SwapBuffers(); + s_RenderSystem.WaitVsync(NN_GX_DISPLAY_BOTH); + } +} + +extern "C" void nnMain() +{ + nn::Result result; + nn::applet::Enable(); + nn::cfg::CTR::init::Initialize(); + + // RenderSystem 縺ョ貅門y + nn::fnd::ExpHeap appHeap; + appHeap.Initialize(nn::os::GetDeviceMemoryAddress(), nn::os::GetDeviceMemorySize()); + const size_t s_GxHeapSize = 8 * 1024 * 1024; + void* heapForGx = appHeap.Allocate(s_GxHeapSize); + s_RenderSystem.Initialize(reinterpret_cast(heapForGx), s_GxHeapSize); + s_RenderSystem.SetClearColor(NN_GX_DISPLAY_BOTH, 0, 1, 0, 1); + + result = nn::ns::InitializeForShell(); + HANDLE_ERROR(result); + + nn::cfg::detail::FirstLaunchInfoCfgData firstLaunch; + + firstLaunch.mmen = 1; + firstLaunch.internet = 0; + firstLaunch.rsv = 0; + + result = nn::cfg::CTR::init::SetConfig( + GET_CFG_KEY(nn::cfg::CTR::detail::NN_CFG_MENU, nn::cfg::CTR::detail::NN_CFG_MENU_FIRST_LAUNCH), &firstLaunch, + sizeof(firstLaunch)); + HANDLE_ERROR(result); + result = nn::cfg::CTR::init::FlushConfig(); + HANDLE_ERROR(result); + nn::cfg::CTR::init::Finalize(); + + + for(;;) + { + // 髮サ貅舌懊ち繝ウ遏ュ謚シ縺励〒繧キ繧ケ繝繝縺ォ繧キ繝」繝繝医ム繧ヲ繝ウ騾夂衍繧呈兜縺偵k + if( nn::applet::IsExpectedToProcessPowerButton()) + { + result = nn::ns::ShutdownAsync(); + HANDLE_ERROR(result); + } + + // 繧キ繝」繝繝医ム繧ヲ繝ウ縺悟ァ九∪縺」縺溘i繧「繝励Μ繧堤オゆコ縺輔○繧 + if ( nn::applet::IsExpectedToCloseApplication()) + { + NN_LOG("Close Application\n"); + result = nn::ns::FinalizeForShell(); + HANDLE_ERROR(result); + s_RenderSystem.Finalize(); + appHeap.Free(heapForGx); + appHeap.Finalize(); + result = nn::applet::PrepareToCloseApplication(); + HANDLE_ERROR(result); + result = nn::applet::CloseApplication(); + HANDLE_ERROR(result); + } + + s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0); + s_RenderSystem.Clear(); + s_RenderSystem.SwapBuffers(); + s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY1); + s_RenderSystem.Clear(); + s_RenderSystem.SwapBuffers(); + s_RenderSystem.WaitVsync(NN_GX_DISPLAY_BOTH); + } +}