diff --git a/debugSoft/Wireless/WifiIcon/Makefile b/debugSoft/Wireless/WifiIcon/Makefile new file mode 100644 index 00000000..a747fc0e --- /dev/null +++ b/debugSoft/Wireless/WifiIcon/Makefile @@ -0,0 +1,101 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tools - WiFiIcon +# File: Makefile +# +# Copyright 2008 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. +# +# $Date:: $ +# $Rev$ +# $Author$ +#---------------------------------------------------------------------------- + +override TARGET_PLATFORM = TWL +override TARGET_CODEGEN = ARM +override TWL_ARCHGEN = LIMITED + + +#---------------------------------------------------------------------------- +TARGET_PLATFORM := TWL +TWL_ARCHGEN := LIMITED +SRCS = main.c +TARGET_NAME := WiFiIcon +TARGET_BIN := main.tad +TWLNMENU_ROOT ?= . + +TWL_NANDAPP = TRUE + +#------------------------- +#-- バナーデータを生成します +BANNER = ./banner/banner.bnr +BANNERSRC := $(wildcard ./banner/data/Cell/*.nce) +MAKEBANNER = $(TWL_TOOLSDIR)/bin/makebanner.TWL.exe +BANNERCVTR = $(TWL_TOOLSDIR)/bin/bannercvtr.exe + + +#------------------------- +#-- NAND アプリではいくつかのパラメータの指定のために固有の RSF ファイルが必要です。 + +ROM_SPEC = $(TARGET_NAME).autogen.rsf +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf +ROM_SPEC_PARAM = MakerCode=01 \ + GameCode=4S02 \ + BannerFile=./banner/banner.bnr \ + TitleName=$(TARGET_NAME) \ + Media=NAND \ + WiFiConnectionIcon=TRUE \ + Secure=TRUE +# DSWirelessIcon=TRUE \ + + + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#------------------------- +# セキュア用 +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe +MAKETAD_OPTION := -s + + +#------------------------- +# ビルドパラメータ +INCDIR = $(TWLSYSTEM_ROOT)/include \ + ./include + +#------------------------- +# インストール指定 +#ifeq ($(TWL_BUILD_TYPE),FINALROM) +#INSTALL_DIR = $(TWL_INSTALL_ROOT)/bin/ARM9-TS/Rom +#INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +#endif + + +#------------------------- +# ビルド +do-build: $(TARGETS) + +#------------------------- +#-- SRL を作成する前にバナーが作成されるようにします。 + +#ifdef MAKE_BANNER +#$(BINDIR)/$(TARGET_NAME)$(ROM_SPEC_NAME_PART).srl: $(BANNER) +#endif + +#------------------------- +#-- バナー作成用ターゲット + +$(BANNER): $(BANNER:.bnr=.bin) $(BANNER:.bnr=.bsf) + $(MAKEBANNER) -A $(BANNER:.bnr=.bin) $(BANNER:.bnr=.bsf) $@ + +$(BANNER:.bnr=.bin): $(BANNERSRC) + $(BANNERCVTR) -o $@ $< + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/debugSoft/Wireless/WifiIcon/banner/banner.bnr b/debugSoft/Wireless/WifiIcon/banner/banner.bnr new file mode 100644 index 00000000..2a5447a2 Binary files /dev/null and b/debugSoft/Wireless/WifiIcon/banner/banner.bnr differ diff --git a/debugSoft/Wireless/WifiIcon/readme.txt b/debugSoft/Wireless/WifiIcon/readme.txt new file mode 100644 index 00000000..4f4ce4e8 --- /dev/null +++ b/debugSoft/Wireless/WifiIcon/readme.txt @@ -0,0 +1,6 @@ +WiFiIcon + +*概要 +  WiFiアイコン確認用のアプリ。 +  WiFiアイコンのフラグをオンにしてビルドされます。 +  アプリ自身の機能はありません。 diff --git a/debugSoft/Wireless/WifiIcon/src/main.c b/debugSoft/Wireless/WifiIcon/src/main.c new file mode 100644 index 00000000..5d509820 --- /dev/null +++ b/debugSoft/Wireless/WifiIcon/src/main.c @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tools - WiFiIcon + File: main.c + + Copyright 2008 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. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ +#include + +static void InitInterrupt(void) +{ + OS_EnableIrq(); + OS_EnableInterrupts(); +} + +static void InitAlloc(void) +{ + OSHeapHandle hHeap; + void* lo = OS_GetMainArenaLo(); + void* hi = OS_GetMainArenaHi(); + + lo = OS_InitAlloc(OS_ARENA_MAIN, lo, hi, 1); + OS_SetArenaLo(OS_ARENA_MAIN, lo); + + hHeap = OS_CreateHeap(OS_ARENA_MAIN, lo, hi); + SDK_ASSERT( hHeap >= 0 ); + + OS_SetCurrentHeap(OS_ARENA_MAIN, hHeap); +} + +static void InitInteruptSystem(); + + +void +TwlStartUp() +{ + OS_Init(); + InitAlloc(); +} + + +/*---------------------------------------------------------------------------* + Name: TwlMain + + Description: メイン関数です。 + + Arguments: なし。 + + Returns: なし。 + *---------------------------------------------------------------------------*/ +void TwlMain(void) +{ + InitInteruptSystem(); + + GX_DispOn(); + GXS_DispOn(); + + *(u16*)HW_PLTT = 0x001f << 10; + *(u16*)HW_DB_PLTT = 0x001f << 10; + // ランチャーに戻れるように、 終了しない + for (;;) + { + // フレーム更新。 + { + OS_WaitVBlankIntr(); + } + } + + OS_Terminate(); +} + + +/*---------------------------------------------------------------------------* + Name: InitInteruptSystem + + Description: 割り込みを初期化します。 + + Arguments: なし。 + + Returns: なし。 + *---------------------------------------------------------------------------*/ +static void InitInteruptSystem() +{ + // 個別割り込みフラグを全て不許可に + (void)OS_SetIrqMask(0); + + // マスター割り込みフラグを許可に + (void)OS_EnableIrq(); + + // IRQ 割り込みを許可します + (void)OS_EnableInterrupts(); + + (void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV); +}