diff --git a/build/debugsoft/AppJumpChecker/Makefile b/build/debugsoft/AppJumpChecker/Makefile new file mode 100644 index 00000000..26612bce --- /dev/null +++ b/build/debugsoft/AppJumpChecker/Makefile @@ -0,0 +1,79 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - debugsoft - ApplicationJump +# 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 + +TWL_NANDAPP = TRUE +TARGET_BIN = appJumpChecker.tad + +INCDIR = ./include $(ROOT)/build/libraries/os/common/include +SRCDIR = ./src + +SRCS = main.c screen.c font.c common.c + +LLIBRARIES += libes$(TWL_LIBSUFFIX).a \ + libboc$(TWL_LIBSUFFIX).a \ + libsfs$(TWL_LIBSUFFIX).a + +#---------------------------------- +# sea を使用 + +LLIBRARIES += libsea$(TWL_LIBSUFFIX).a + +#---------------------------------- +# nam を使用 + +LLIBRARIES += libnam$(TWL_LIBSUFFIX).a + + +ROM_SPEC = appJumpChecker.autogen.rsf +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf + +ROM_SPEC_PARAM = MakerCode=01 \ + GameCode=456A \ + NANDAccess=TRUE \ + Media=NAND \ + Secure=TRUE \ + BannerFile=appjumpchecker.bnr \ + PermitLandingNormalJump=TRUE \ + WramMapping=MAP_TS_SCR + +COMPONENT_NAME = armadillo +MAKEROM_ARM7_BASE = $(TWL_COMPONENTSDIR)/$(COMPONENT_NAME)/$(TWL_BUILDTYPE_ARM7)/$(COMPONENT_NAME) +MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).$(TWL_ELF_EXT) + + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe +MAKETAD_OPTION := -s + +do-build: $(TARGETS) + +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +INSTALL_DIR = ./roms + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/AppJumpChecker/appjumpchecker.bnr b/build/debugsoft/AppJumpChecker/appjumpchecker.bnr new file mode 100644 index 00000000..de53082b Binary files /dev/null and b/build/debugsoft/AppJumpChecker/appjumpchecker.bnr differ diff --git a/build/debugsoft/AppJumpChecker/include/common.h b/build/debugsoft/AppJumpChecker/include/common.h new file mode 100644 index 00000000..a0d79755 --- /dev/null +++ b/build/debugsoft/AppJumpChecker/include/common.h @@ -0,0 +1,67 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest + File: common.h + + 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$ + *---------------------------------------------------------------------------*/ +#ifndef COMMON_H_ +#define COMMON_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#include + +/*---------------------------------------------------------------------------* + 定数定義 + *---------------------------------------------------------------------------*/ + +#define KEY_REPEAT_START 25 // キーリピート開始までのフレーム数 +#define KEY_REPEAT_SPAN 10 // キーリピートの間隔フレーム数 + +/*---------------------------------------------------------------------------* + 構造体 定義 + *---------------------------------------------------------------------------*/ + +// キー入力情報 +typedef struct KeyInfo +{ + u16 cnt; // 未加工入力値 + u16 trg; // 押しトリガ入力 + u16 up; // 離しトリガ入力 + u16 rep; // 押し維持リピート入力 +} KeyInfo; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +void InitCommon(void); + +void ReadKey(KeyInfo* pKey); + +void VBlankIntr(void); + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* COMMON_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/AppJumpChecker/include/font.h b/build/debugsoft/AppJumpChecker/include/font.h new file mode 100644 index 00000000..37699026 --- /dev/null +++ b/build/debugsoft/AppJumpChecker/include/font.h @@ -0,0 +1,41 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: font.h + + Copyright 2007 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$ + *---------------------------------------------------------------------------*/ +#ifndef FONT_H_ +#define FONT_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#include + +extern const u32 d_CharData[8 * 256]; +extern const u32 d_PaletteData[8 * 16]; + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* FONT_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/AppJumpChecker/include/screen.h b/build/debugsoft/AppJumpChecker/include/screen.h new file mode 100644 index 00000000..0d08dffd --- /dev/null +++ b/build/debugsoft/AppJumpChecker/include/screen.h @@ -0,0 +1,49 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: screen.h + + Copyright 2007 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$ + *---------------------------------------------------------------------------*/ +#ifndef SCREEN_H_ +#define SCREEN_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#include + +/*---------------------------------------------------------------------------* + 関数 定義 + *---------------------------------------------------------------------------*/ +void InitScreen(void); +void ClearScreen(void); +void ClearMainScreen(void); +void ClearSubScreen(void); +void PutMainScreen(s32 x, s32 y, u8 palette, char* text, ...); +void PutSubScreen(s32 x, s32 y, u8 palette, char* text, ...); +void UpdateScreen(void); + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* SCREEN_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/AppJumpChecker/src/common.c b/build/debugsoft/AppJumpChecker/src/common.c new file mode 100644 index 00000000..b1883893 --- /dev/null +++ b/build/debugsoft/AppJumpChecker/src/common.c @@ -0,0 +1,153 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest + File: common.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 "common.h" + +static void InitInterrupts(void); +static void InitHeap(void); + +/*---------------------------------------------------------------------------* + 関数定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + Name: InitCommon + + Description: 基本的な初期化関数をここで呼ぶ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void InitCommon(void) +{ + OS_Init(); + OS_InitTick(); + OS_InitAlarm(); + GX_Init(); + GX_DispOff(); + GXS_DispOff(); + + InitHeap(); + InitInterrupts(); +} + +/*---------------------------------------------------------------------------* + Name: ReadKey + + Description: キー入力情報を取得し、入力情報構造体を編集する。 + 押しトリガ、離しトリガ、押し継続リピートトリガ を検出する。 + + Arguments: pKey - 編集するキー入力情報構造体を指定する。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void ReadKey(KeyInfo* pKey) +{ + static u16 repeat_count[12]; + int i; + u16 r; + + r = PAD_Read(); + pKey->trg = 0x0000; + pKey->up = 0x0000; + pKey->rep = 0x0000; + + for (i = 0; i < 12; i++) + { + if (r & (0x0001 << i)) + { + if (!(pKey->cnt & (0x0001 << i))) + { + pKey->trg |= (0x0001 << i); // 押しトリガ + repeat_count[i] = 1; + } + else + { + if (repeat_count[i] > KEY_REPEAT_START) + { + pKey->rep |= (0x0001 << i); // 押し継続リピート + repeat_count[i] = (u16) (KEY_REPEAT_START - KEY_REPEAT_SPAN); + } + else + { + repeat_count[i]++; + } + } + } + else + { + if (pKey->cnt & (0x0001 << i)) + { + pKey->up |= (0x0001 << i); // 離しトリガ + } + } + } + + pKey->cnt = r; // 未加工キー入力 +} + +/*---------------------------------------------------------------------------* + Name: InitInterrupts + + Description: 割り込み設定を初期化する。 + V ブランク割り込みを許可し、割り込みハンドラを設定する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitInterrupts(void) +{ + // V ブランク割り込み設定 + OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)GX_VBlankIntr(TRUE); + + // 割り込み許可 + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); +} + +/*---------------------------------------------------------------------------* + Name: InitHeap + + Description: メインメモリ上のアリーナにてメモリ割当てシステムを初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitHeap(void) +{ + void* tempLo; + OSHeapHandle hh; + + // メインメモリ上のアリーナにヒープをひとつ作成 + tempLo = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1); + OS_SetArenaLo(OS_ARENA_MAIN, tempLo); + hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi()); + if (hh < 0) + { + // ヒープ作成に失敗した場合は異常終了 + OS_Panic("ARM9: Fail to create heap...\n"); + } + (void)OS_SetCurrentHeap(OS_ARENA_MAIN, hh); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/AppJumpChecker/src/font.c b/build/debugsoft/AppJumpChecker/src/font.c new file mode 100644 index 00000000..2111ca07 --- /dev/null +++ b/build/debugsoft/AppJumpChecker/src/font.c @@ -0,0 +1,585 @@ +/*---------------------------------------------------------------------------* + Project: NitroWiFi - WCM - demos - wcm-list + File: font.c + + Copyright 2005,2006 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. + + $Log: font.c,v $ + Revision 1.2 2006/03/10 09:22:43 kitase_hirotake + INDENT SOURCE + + Revision 1.1 2005/07/21 08:21:06 adachi_hiroaki + 新規追加 + + + $NoKeywords: $ + *---------------------------------------------------------------------------*/ +#include "font.h" + +/*---------------------------------------------------------------------------* + Character data + *---------------------------------------------------------------------------*/ +const u32 d_CharData[8 * 256] = +{ + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01010010, 0x01010010, 0x00000110, // 0001h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x01011010, 0x01010010, 0x00010010, // 0002h + 0x00100010, 0x00100010, 0x00100001, 0x00100001, + 0x00000000, 0x01010001, 0x01010001, 0x01111111, // 0003h + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 0004h + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01010000, 0x01010100, 0x00001010, // 0005h + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011000, 0x01011000, 0x01111111, // 0006h + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01010010, 0x01101111, 0x01010010, // 0007h + 0x00010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x01010010, 0x01011111, 0x00000100, // 0008h + 0x00011111, 0x00001000, 0x00000001, 0x00011110, + 0x00000000, 0x01010000, 0x01011000, 0x00000110, // 0009h + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x01010000, 0x01111101, 0x00010001, // 000ah + 0x00010001, 0x00010001, 0x00010001, 0x00001010, + 0x00000000, 0x01010000, 0x01011110, 0x00100000, // 000bh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010100, 0x01011111, 0x00001000, // 000ch + 0x00010000, 0x00000001, 0x00000001, 0x00011110, + 0x00000000, 0x01010001, 0x01010001, 0x00000001, // 000dh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00011000, // 000eh + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x01010010, 0x01111111, 0x00010010, // 000fh + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00001110, 0x01010100, 0x01010010, // 0010h + 0x00111111, 0x00000100, 0x00000100, 0x00011000, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 0011h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x01010100, 0x01011111, 0x00000010, // 0012h + 0x00011110, 0x00100001, 0x00100000, 0x00011110, + 0x00000000, 0x01010000, 0x01011100, 0x00100011, // 0013h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00010000, // 0014h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x01010010, 0x01010010, 0x00001100, // 0015h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010001, 0x01111101, 0x00010001, // 0016h + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01010100, 0x01010011, 0x01110010, // 0017h + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01011110, 0x01011000, 0x00000100, // 0018h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01010000, 0x01011100, 0x00010010, // 0019h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011101, 0x01010001, 0x00111101, // 001ah + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x01110001, 0x01011101, 0x00110001, // 001bh + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01110100, 0x01010011, 0x00110010, // 001ch + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01101110, 0x01011000, 0x00100100, // 001dh + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01110000, 0x01011100, 0x00110010, // 001eh + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x01010001, 0x00111101, // 001fh + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0020h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 0021h + 0x00001000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x01101100, 0x01001000, 0x00100100, // 0022h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100100, 0x01111111, 0x00100100, // 0023h + 0x00100100, 0x01111111, 0x00010010, 0x00010010, + 0x00000000, 0x00001000, 0x01111110, 0x00001001, // 0024h + 0x00111110, 0x01001000, 0x00111111, 0x00001000, + 0x00000000, 0x01000010, 0x00100101, 0x00010010, // 0025h + 0x00001000, 0x00100100, 0x01010010, 0x00100001, + 0x00000000, 0x00001110, 0x00010001, 0x00001001, // 0026h + 0x01000110, 0x00101001, 0x00110001, 0x01001110, + 0x00000000, 0x00011000, 0x00010000, 0x00001000, // 0027h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01110000, 0x00001000, 0x00000100, // 0028h + 0x00000100, 0x00000100, 0x00001000, 0x01110000, + 0x00000000, 0x00000111, 0x00001000, 0x00010000, // 0029h + 0x00010000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x00001000, 0x01001001, 0x00101010, // 002ah + 0x00011100, 0x00101010, 0x01001001, 0x00001000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 002bh + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002ch + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002dh + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002eh + 0x00000000, 0x00000000, 0x00000000, 0x00001100, + 0x00000000, 0x01000000, 0x00100000, 0x00010000, // 002fh + 0x00001000, 0x00000100, 0x00000010, 0x00000001, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0030h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00011100, 0x00010000, 0x00010000, // 0031h + 0x00010000, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0032h + 0x00111110, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0033h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00100000, 0x00110000, 0x00101000, // 0034h + 0x00100100, 0x00100010, 0x01111111, 0x00100000, + 0x00000000, 0x01111111, 0x00000001, 0x00111111, // 0035h + 0x01000000, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x00000001, 0x00111111, // 0036h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00100000, 0x00100000, // 0037h + 0x00010000, 0x00010000, 0x00001000, 0x00001000, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0038h + 0x00111110, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0039h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003ah + 0x00000000, 0x00000000, 0x00001100, 0x00000000, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003bh + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x01100000, 0x00011000, 0x00000110, // 003ch + 0x00000001, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00000000, 0x01111111, 0x00000000, // 003dh + 0x00000000, 0x00000000, 0x01111111, 0x00000000, + 0x00000000, 0x00000011, 0x00001100, 0x00110000, // 003eh + 0x01000000, 0x00110000, 0x00001100, 0x00000011, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 003fh + 0x00110000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x00011100, 0x00100010, 0x01001001, // 0040h + 0x01010101, 0x01010101, 0x01010101, 0x00111010, + 0x00000000, 0x00001000, 0x00010100, 0x00010100, // 0041h + 0x00100010, 0x00111110, 0x01000001, 0x01000001, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0042h + 0x00111111, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0043h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x00011111, 0x00100001, 0x01000001, // 0044h + 0x01000001, 0x01000001, 0x00100001, 0x00011111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0045h + 0x01111111, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0046h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0047h + 0x01111001, 0x01000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0048h + 0x01111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x00001000, 0x00001000, // 0049h + 0x00001000, 0x00001000, 0x00001000, 0x00111110, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 004ah + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01100001, 0x00011001, 0x00000101, // 004bh + 0x00000011, 0x00000101, 0x00011001, 0x01100001, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 004ch + 0x00000001, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01000001, 0x01100011, 0x01010101, // 004dh + 0x01001001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x01000001, 0x01000011, 0x01000101, // 004eh + 0x01001001, 0x01010001, 0x01100001, 0x01000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 004fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0050h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 0051h + 0x01000001, 0x01011001, 0x00100010, 0x01011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0052h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x01000001, 0x00000001, // 0053h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00001000, 0x00001000, // 0054h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0055h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01000001, 0x01000001, 0x00100010, // 0056h + 0x00100010, 0x00010100, 0x00010100, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0057h + 0x01001001, 0x01010101, 0x01100011, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0058h + 0x00001000, 0x00010100, 0x00100010, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0059h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01111111, 0x00100000, 0x00010000, // 005ah + 0x00001000, 0x00000100, 0x00000010, 0x01111111, + 0x00000000, 0x01111100, 0x00000100, 0x00000100, // 005bh + 0x00000100, 0x00000100, 0x00000100, 0x01111100, + 0x00000000, 0x00100010, 0x00010100, 0x00111110, // 005ch + 0x00001000, 0x00111110, 0x00001000, 0x00001000, + 0x00000000, 0x00011111, 0x00010000, 0x00010000, // 005dh + 0x00010000, 0x00010000, 0x00010000, 0x00011111, + 0x00000000, 0x00001000, 0x00010100, 0x00100010, // 005eh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 005fh + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x00010000, 0x00001000, 0x00011000, // 0060h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00011110, 0x00100001, // 0061h + 0x00111110, 0x00100001, 0x00100001, 0x01011110, + 0x00000000, 0x00000001, 0x00000001, 0x00111111, // 0062h + 0x01000001, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00000000, 0x00111100, 0x01000010, // 0063h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000000, 0x01000000, 0x01111110, // 0064h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0065h + 0x01111111, 0x00000001, 0x01000001, 0x00111110, + 0x00000000, 0x00110000, 0x00001000, 0x00001000, // 0066h + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x01111110, 0x01000001, // 0067h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0068h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00001000, 0x00000000, 0x00001000, // 0069h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00100000, 0x00000000, 0x00100000, // 006ah + 0x00100000, 0x00100001, 0x00100001, 0x00011110, + 0x00000000, 0x00000001, 0x00000001, 0x01100001, // 006bh + 0x00011001, 0x00000111, 0x00011001, 0x01100001, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 006ch + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00110111, 0x01001001, // 006dh + 0x01001001, 0x01001001, 0x01001001, 0x01001001, + 0x00000000, 0x00000000, 0x00111111, 0x01000001, // 006eh + 0x01000001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00000000, 0x00011100, 0x00100010, // 006fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00000000, 0x00111101, 0x01000011, // 0070h + 0x01000001, 0x01000011, 0x00111101, 0x00000001, + 0x00000000, 0x00000000, 0x01011110, 0x01100001, // 0071h + 0x01000001, 0x01100001, 0x01011110, 0x01000000, + 0x00000000, 0x00000000, 0x00110001, 0x00001101, // 0072h + 0x00000011, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0073h + 0x00001110, 0x00110000, 0x01000001, 0x00111110, + 0x00000000, 0x00000100, 0x00000100, 0x01111111, // 0074h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0075h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0076h + 0x00100010, 0x00100010, 0x00010100, 0x00001000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0077h + 0x01001001, 0x00101010, 0x00101010, 0x00010100, + 0x00000000, 0x00000000, 0x00100001, 0x00010010, // 0078h + 0x00001100, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0079h + 0x00100010, 0x00011100, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111111, 0x00010000, // 007ah + 0x00001000, 0x00000100, 0x00000010, 0x00111111, + 0x00000000, 0x00001000, 0x00011110, 0x01100100, // 007bh + 0x00011000, 0x00100100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x00011110, 0x00000100, // 007ch + 0x00011110, 0x00110101, 0x00101101, 0x00010010, + 0x00000000, 0x00000000, 0x00000000, 0x00010001, // 007dh + 0x00100001, 0x00100001, 0x00000001, 0x00000010, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007eh + 0x00011110, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007fh + 0x00111110, 0x00010000, 0x00001100, 0x00110010, + 0x00000000, 0x00000000, 0x00000100, 0x00101111, // 0080h + 0x01000100, 0x00011110, 0x00100101, 0x00010110, + 0x00000000, 0x00000000, 0x00001010, 0x00011110, // 0081h + 0x00101011, 0x00100010, 0x00010100, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00011101, // 0082h + 0x00101011, 0x00101001, 0x00011001, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00111000, // 0083h + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00000000, 0x00000000, 0x00011100, // 0084h + 0x00100011, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000110, 0x01001001, 0x00110000, // 0085h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000100, 0x00111111, 0x00000100, // 0086h + 0x00111110, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000000, 0x00100001, 0x01000001, // 0087h + 0x01000001, 0x01000001, 0x00000001, 0x00000010, + 0x00000000, 0x00111100, 0x00000000, 0x00111110, // 0088h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00011100, 0x00000000, 0x00111110, // 0089h + 0x00010000, 0x00001000, 0x00010100, 0x01100010, + 0x00000000, 0x00100100, 0x01011111, 0x00000100, // 008ah + 0x00111110, 0x01000101, 0x01000101, 0x00100010, + 0x00000000, 0x00100010, 0x01001111, 0x01010010, // 008bh + 0x01010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x00000100, 0x00111110, 0x00001000, // 008ch + 0x00111110, 0x00010000, 0x00000010, 0x00111100, + 0x00000000, 0x00100000, 0x00011000, 0x00000110, // 008dh + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x00100000, 0x01111101, 0x00100001, // 008eh + 0x00100001, 0x00100001, 0x00100001, 0x00010010, + 0x00000000, 0x00011110, 0x00100000, 0x00000000, // 008fh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00001000, 0x01111111, 0x00010000, // 0090h + 0x00100000, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0091h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00010000, 0x01111111, 0x00011000, // 0092h + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 0093h + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x00111100, 0x00010000, 0x00001100, // 0094h + 0x01111111, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000100, 0x00011111, 0x00000100, // 0095h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00001000, 0x01111111, 0x00000100, // 0096h + 0x00111100, 0x01000010, 0x01000000, 0x00111100, + 0x00000000, 0x00000000, 0x00011100, 0x00100011, // 0097h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01111111, 0x00010000, 0x00001000, // 0098h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000010, 0x00110010, 0x00001100, // 0099h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00100100, 0x01001111, 0x01000010, // 009ah + 0x00010001, 0x00111100, 0x00010010, 0x00001100, + 0x00000000, 0x00000010, 0x01111010, 0x01000010, // 009bh + 0x00000010, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00100010, 0x00111110, 0x01010010, // 009ch + 0x01001011, 0x01101101, 0x01010101, 0x00110010, + 0x00000000, 0x00110010, 0x01001011, 0x01000110, // 009dh + 0x01000110, 0x01110010, 0x01001011, 0x00110010, + 0x00000000, 0x00011100, 0x00101010, 0x01001001, // 009eh + 0x01001001, 0x01000101, 0x01000101, 0x00110010, + 0x00000000, 0x00100001, 0x01111101, 0x00100001, // 009fh + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00000100, 0x00100011, 0x01100010, // 00a0h + 0x00100001, 0x00100001, 0x00010010, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a1h + 0x00000000, 0x00000100, 0x00001010, 0x00000100, + 0x00000000, 0x01110000, 0x00010000, 0x00010000, // 00a2h + 0x00010000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a3h + 0x00001000, 0x00001000, 0x00001000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a4h + 0x00000000, 0x00000010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00011000, // 00a5h + 0x00011000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x01111111, // 00a6h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00111111, 0x00100000, // 00a7h + 0x00010100, 0x00001100, 0x00000100, 0x00000010, + 0x00000000, 0x00000000, 0x00100000, 0x00100000, // 00a8h + 0x00010000, 0x00001111, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000100, 0x00111111, // 00a9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00aah + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00000000, 0x00010000, 0x00111111, // 00abh + 0x00011000, 0x00010100, 0x00010010, 0x00011001, + 0x00000000, 0x00000000, 0x00000010, 0x00111111, // 00ach + 0x00100010, 0x00010010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00adh + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00aeh + 0x00111110, 0x00100000, 0x00100000, 0x00111110, + 0x00000000, 0x00000000, 0x00100101, 0x00101010, // 00afh + 0x00101010, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00b0h + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x00101000, // 00b1h + 0x00011000, 0x00001000, 0x00001000, 0x00000100, + 0x00000000, 0x01000000, 0x00100000, 0x00011000, // 00b2h + 0x00010111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00001000, 0x01111111, 0x01000001, // 00b3h + 0x01000001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000000, 0x00111110, 0x00001000, // 00b4h + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00100000, 0x01111111, 0x00110000, // 00b5h + 0x00101000, 0x00100100, 0x00100010, 0x00110001, + 0x00000000, 0x00000100, 0x01111111, 0x01000100, // 00b6h + 0x01000100, 0x01000100, 0x01000010, 0x00100001, + 0x00000000, 0x00000100, 0x00111111, 0x00001000, // 00b7h + 0x01111111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x01111100, 0x01000100, 0x01000100, // 00b8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000010, 0x01111110, 0x00100010, // 00b9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00bah + 0x01000000, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 00bbh + 0x00100010, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000011, 0x00000100, 0x01000011, // 00bch + 0x01000100, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x01111111, 0x01000000, 0x00100000, // 00bdh + 0x00010000, 0x00011000, 0x00100100, 0x01000011, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00beh + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x01000001, 0x01000010, 0x01000000, // 00bfh + 0x00100000, 0x00100000, 0x00011000, 0x00000110, + 0x00000000, 0x01111110, 0x01000010, 0x01001110, // 00c0h + 0x01110001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x01100000, 0x00011110, 0x00010000, // 00c1h + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01000101, 0x01001010, 0x01001010, // 00c2h + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00c3h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000010, 0x00000010, 0x00000110, // 00c4h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x00010000, 0x00010000, 0x01111111, // 00c5h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111110, 0x00000000, // 00c6h + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000100, // 00c7h + 0x00101000, 0x00010000, 0x00101000, 0x01000110, + 0x00000000, 0x00001000, 0x01111111, 0x00100000, // 00c8h + 0x00010000, 0x00011100, 0x01101011, 0x00001000, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 00c9h + 0x00100000, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x00010010, 0x00100010, 0x00100010, // 00cah + 0x01000010, 0x01000010, 0x01000001, 0x01000001, + 0x00000000, 0x00000001, 0x00000001, 0x01111111, // 00cbh + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cch + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000100, 0x00001010, // 00cdh + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x01111111, // 00ceh + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cfh + 0x00100010, 0x00010100, 0x00001000, 0x00010000, + 0x00000000, 0x00001110, 0x01110000, 0x00001110, // 00d0h + 0x01110000, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00001000, 0x00001000, 0x00000100, // 00d1h + 0x00000100, 0x00100010, 0x01000010, 0x01111111, + 0x00000000, 0x01000000, 0x01000000, 0x00100100, // 00d2h + 0x00101000, 0x00010000, 0x00101100, 0x01000011, + 0x00000000, 0x01111111, 0x00000100, 0x01111111, // 00d3h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00d4h + 0x00100010, 0x00010100, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00d5h + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00d6h + 0x01111110, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00d7h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00d8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00001010, 0x00001010, 0x00001010, // 00d9h + 0x01001010, 0x01001010, 0x00101010, 0x00011001, + 0x00000000, 0x00000010, 0x00000010, 0x01000010, // 00dah + 0x01000010, 0x00100010, 0x00010010, 0x00001110, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dbh + 0x01000001, 0x01000001, 0x01000001, 0x01111111, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dch + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000011, 0x01000100, 0x01000000, // 00ddh + 0x01000000, 0x00100000, 0x00010000, 0x00001111, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00deh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00dfh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00011110, 0x00001000, 0x00000100, // 00e0h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x00000000, 0x00001100, 0x00010010, // 00e1h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x00100001, 0x01111101, // 00e2h + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00111100, 0x00010000, 0x00111100, // 00e3h + 0x00010000, 0x00011100, 0x00110010, 0x00001100, + 0x00000000, 0x00001110, 0x00101000, 0x00101000, // 00e4h + 0x00111110, 0x01100101, 0x00100101, 0x00010010, + 0x00000000, 0x00000100, 0x00101111, 0x01000100, // 00e5h + 0x00000110, 0x01000101, 0x01000101, 0x00111110, + 0x00000000, 0x00100010, 0x00100010, 0x00111110, // 00e6h + 0x01010010, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000100, 0x00011111, 0x00000010, // 00e7h + 0x00011111, 0x01000010, 0x01000010, 0x00111100, + 0x00000000, 0x00010010, 0x00111110, 0x01010011, // 00e8h + 0x01000010, 0x00100100, 0x00000100, 0x00000100, + 0x00000000, 0x00001000, 0x00111101, 0x01001011, // 00e9h + 0x01001001, 0x01001001, 0x00111000, 0x00000100, + 0x00000000, 0x00001000, 0x00111000, 0x00001000, // 00eah + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00011000, 0x00100000, 0x00000100, // 00ebh + 0x00111010, 0x01000110, 0x01000000, 0x00111000, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00ech + 0x01000110, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00edh + 0x01000011, 0x01001100, 0x01010010, 0x00111100, + 0x00000000, 0x00100010, 0x00110011, 0x00101010, // 00eeh + 0x00100110, 0x00100010, 0x00100011, 0x01000010, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00efh + 0x01000011, 0x01000000, 0x01000010, 0x00111100, + 0x00000000, 0x00000010, 0x00111011, 0x01000110, // 00f0h + 0x01000010, 0x01000011, 0x01000010, 0x00110010, + 0x00000000, 0x00000100, 0x00000100, 0x00000010, // 00f1h + 0x01000110, 0x01000101, 0x01000101, 0x00111001, + 0x00000000, 0x01010100, 0x01111111, 0x00100100, // 00f2h + 0x00100100, 0x00100100, 0x00100010, 0x00010001, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 00f3h + 0x00111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01011110, 0x01100010, 0x00100010, // 00f4h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010010, 0x01111110, 0x00100010, // 00f5h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 00f6h + 0x00100000, 0x00100000, 0x00100000, 0x00111111, + 0x00000000, 0x01010010, 0x01010010, 0x00111111, // 00f7h + 0x00010010, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01010011, 0x01010100, 0x00100011, // 00f8h + 0x00100100, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01010000, 0x01011111, 0x00010000, // 00f9h + 0x00001000, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x01010010, 0x01111111, 0x00100010, // 00fah + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x01010001, 0x01010010, 0x00100000, // 00fbh + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01011110, 0x01010010, 0x00100110, // 00fch + 0x00111001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01011110, 0x00010000, // 00fdh + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x00100101, 0x01001010, 0x00101010, // 00feh + 0x00100000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01011110, 0x01010000, 0x00111111, // 00ffh + 0x00001000, 0x00001000, 0x00001000, 0x00000110 +}; + +/*---------------------------------------------------------------------------* + Palette data + *---------------------------------------------------------------------------*/ +const u32 d_PaletteData[8 * 16] = +{ + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // black + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001f0000, 0x00000000, 0x00000000, 0x00000000, // red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00180000, 0x00000000, 0x00000000, 0x00000000, // dark red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/AppJumpChecker/src/main.c b/build/debugsoft/AppJumpChecker/src/main.c new file mode 100644 index 00000000..7a7e2578 --- /dev/null +++ b/build/debugsoft/AppJumpChecker/src/main.c @@ -0,0 +1,493 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest - Nand-2 + 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 +#include + +#include "application_jump_private.h" +#include "common.h" +#include "screen.h" + +#define DMA_NO_FS 1 +#define TITLE_NUM_CUL 18 +#define TITLE_NUM_PAGE (TITLE_NUM_CUL * 2) + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ +// キー入力 +static KeyInfo gKey; + +// インストールされている NAND アプリの数 +static s32 gNandAppNum; + +// カーソル位置 +static s32 gCurPos = 0; + +static BOOL gIsExistCard = FALSE; + +// エラー表示用バッファ +static char gErrBuf[33]; + +// エラー表示時間計測用 +static OSTick gErrTick = 0; + +typedef struct DataStruct +{ + NAMTitleId id; + BOOL normaljmp_flag; +} DataStruct; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void PrintErrMsg(const char* msg); + +static BOOL GetDataStruct(DataStruct* list); +static void DrawScene(DataStruct* list); + +static void ConvertTitleIdLo(u8* code, u8* titleid_lo); +static void ConvertGameCode(u8* code, u32 game_code); +static void ConvertInitialCode(u8* code, u32 titleid_lo); + +static void* AllocForNAM(u32 size); +static void FreeForNAM(void* ptr); + +/*---------------------------------------------------------------------------*/ + +static void PrintErrMsg(const char* msg) +{ + if ( STD_StrLen(msg) > 32 ) + { + OS_Warning("err msg is too long."); + return; + } + + STD_StrCpy( gErrBuf, msg ); + gErrTick = OS_GetTick(); +} + +void TwlMain(void) +{ + DataStruct dataList[TITLE_NUM_PAGE]; + + InitCommon(); + InitScreen(); + + GX_DispOn(); + GXS_DispOn(); + + FS_Init(DMA_NO_FS); + NAM_Init(AllocForNAM, FreeForNAM); + + ClearScreen(); + + // NAND にインポートされているNAND アプリの数を取得する + if ( (gNandAppNum = NAM_GetNumTitles()) < 0) + { + OS_Panic("NAM_GetNumTitles() failed."); + } + + + + // キー入力情報取得の空呼び出し(IPL での A ボタン押下対策) + ReadKey(&gKey); + + // 情報の取得 + if ( !GetDataStruct(dataList) ) + { + PrintErrMsg("Failed to get dataList."); + } + + while(TRUE) + { + // キー入力情報取得 + ReadKey(&gKey); + + // カーソルの移動 + if (gKey.trg & PAD_KEY_DOWN) + { + gCurPos++; + if ( gCurPos >= ( gNandAppNum < TITLE_NUM_PAGE ? gNandAppNum : TITLE_NUM_PAGE) ) + { + gCurPos = 0; + } + } + if (gKey.trg & PAD_KEY_UP) + { + if ( gCurPos == 0) + { + if ( gNandAppNum < TITLE_NUM_PAGE ) + { + gCurPos = gNandAppNum - 1; + } + else + { + gCurPos = TITLE_NUM_PAGE - 1; + } + } + else + { + gCurPos--; + } + } + + // 列の移動 + if ( (gKey.trg & PAD_KEY_RIGHT || gKey.trg & PAD_KEY_LEFT) && gNandAppNum >= TITLE_NUM_CUL ) + { + if ( gCurPos > TITLE_NUM_CUL ) + { + if ( gCurPos - TITLE_NUM_CUL < gNandAppNum ) + { + gCurPos -= TITLE_NUM_CUL; + } + } + else + { + if ( gCurPos + TITLE_NUM_CUL < gNandAppNum ) + { + gCurPos += TITLE_NUM_CUL; + } + } + } + + // アプリジャンプの実行 + if (gKey.trg & PAD_BUTTON_A) + { + OS_DoApplicationJump(dataList[gCurPos].id, OS_APP_JUMP_NORMAL); + // 成功時はここ以降は実行されない + PrintErrMsg("Failed to App Jump."); + } + // 内部関数を使用したアプリジャンプの実行 + if (gKey.trg & PAD_BUTTON_B) + { + LauncherBootFlags flag; + + flag.bootType = LAUNCHER_BOOTTYPE_NAND; + flag.isValid = TRUE; + flag.isLogoSkip = TRUE; + flag.isInitialShortcutSkip = FALSE; + flag.isAppLoadCompleted = FALSE; + flag.isAppRelocate = FALSE; + flag.rsv = 0; + OS_SetLauncherParamAndResetHardware(dataList[gCurPos].id, &flag); + // 成功時はここ以降は実行されない + PrintErrMsg("Failed to App Jump(force)."); + } + + // カードアプリへのアプリジャンプ試行 + if (gKey.trg & PAD_BUTTON_Y) + { + CARDRomHeader* rh; +// u64 titleId; + rh = (CARDRomHeader*)CARD_GetRomHeader(); + + // TWL アプリの場合 + if ( rh->product_id & 0x03 || rh->product_id & 0x02 ) // 刺さっているカードのロムが TWLアプリ + { + ROM_Header* rh2; + rh2 = (ROM_Header*)HW_TWL_CARD_ROM_HEADER_BUF; + + OS_DoApplicationJump( rh2->s.titleID, OS_APP_JUMP_NORMAL); + } + +// titleId = (0x00030000 << 32) | rh->game_code; + // NITRO カードアプリなら失敗(特殊なものでない限り TitleID が設定されていないため) + + PrintErrMsg("Failed to App Jump."); + } + + // エラー表示判定 + if ( OS_TicksToSeconds(OS_GetTick() - gErrTick) > 3 ) + { + PrintErrMsg(" "); + } + + // 画面描画 + DrawScene(dataList); + + // Vブランク待ち + OS_WaitVBlankIntr(); + + // 画面クリア + ClearScreen(); + } + + // Vブランク待ち 最後に画面を更新してから終了 + OS_WaitVBlankIntr(); + OS_Terminate(); +} + +static BOOL GetDataStruct(DataStruct* list) +{ + // 36個分のタイトルIDリストバッファ + NAMTitleId titleIdList[TITLE_NUM_PAGE]; + s32 i; + FSFile fp; + + if ( NAM_GetTitleList(titleIdList, TITLE_NUM_PAGE) != NAM_OK ) + { + PrintErrMsg("NAM_GetTitleList failed."); + return FALSE; + } + + // データリストの作成(1ページ分) + for ( i=0; i= gNandAppNum ) + { + break; + } + + // TitleID の格納 + list->id = titleIdList[i]; + + // ノーマルジャンプをされるのを許可するかを表すフラグの取得 + // TitleID を見て、タイトル種別がデータタイトルならば + // そもそも ROMヘッダが存在しない、アプリジャンプをする必要もない + if ( !NAM_IsDataTitle(list->id) ) + { + // アプリ本体へのパスを取得 + if ( NAM_GetTitleBootContentPath(pathbuf, list->id) != NAM_OK ) + { + PrintErrMsg("GetContentPath failed."); + return FALSE; + } + + // アプリのファイルオープン + FS_InitFile(&fp); + if ( !FS_OpenFileEx(&fp, pathbuf, FS_FILEMODE_R) ) + { + // 失敗時はエラーコード出力で終了 + PrintErrMsg("FS_OpenFileEx failed."); + return FALSE; + } + + if ( -1 == FS_ReadFile(&fp, &rh, sizeof(ROM_Header_Short) )) + { + PrintErrMsg("FS_ReadFile failed."); + return FALSE; + } + + list->normaljmp_flag = rh.permit_landing_normal_jump; + + FS_CloseFile(&fp); + } + else + { + list->normaljmp_flag = FALSE; + } + } + + PrintErrMsg(" "); + return TRUE; +} + +static void DrawScene(DataStruct* list) +{ + s32 i; + u8 init_code[5], titleid_lo[5]; + + // 上画面 + PutMainScreen( 0, 1, 0xff, " ------ App Jump Checker ------ "); + + PutMainScreen( 0, 3, 0xff, " total app : %d", gNandAppNum); + + PutMainScreen( 0, 5, 0xff, " ------------------------------ "); + + PutMainScreen( 0, 7, 0xff, " A : try App Jump (to NAND)" ); + PutMainScreen( 0, 8, 0xfe, " B : try App Jump (force) " ); + PutMainScreen( 0, 9, 0xff, " Y : try App Jump (to CARD)" ); + PutMainScreen( 0, 11, 0xff, " UP ,DOWN ,LEFT ,RIGHT KEY :" ); + PutMainScreen( 0, 12, 0xff, " move * (cursor) "); + PutMainScreen( 0, 14, 0xff, " ------------------------------ "); + + PutMainScreen( 0, 16, 0xf1, "%s", gErrBuf); + + // 下画面 + PutSubScreen( 0, 0, 0xf4, " NAND ( max 36 )"); + PutSubScreen( 0, 1, 0xff, "--- ID ---------------- ID -------"); + + + // 下画面に1行ずつ、カーソル用スペース、イニシャルコード、ノーマルジャンプ可否フラグを表示 + for ( i=0; i < TITLE_NUM_PAGE; i++, list++) + { + // そもそも NAND アプリの数が 1ページにも満たない場合は途中で終了する + if ( i >= gNandAppNum ) + { + break; + } + + ConvertInitialCode(init_code, NAM_GetTitleIdLo(list->id)); + + if ( list->normaljmp_flag ) + { + PutSubScreen( (i >= TITLE_NUM_CUL ? 18 : 0), 2 + (i >= TITLE_NUM_CUL ? i-18 : i), 0xf2, " %s : o", init_code ); + } + else + { + PutSubScreen( (i >= TITLE_NUM_CUL ? 18 : 0), 2 + (i >= TITLE_NUM_CUL ? i-18 : i), 0xff, " %s : -", init_code ); + } + } + + // カードアプリチェック + PutSubScreen( 0, 2 + TITLE_NUM_CUL + 1, 0xf4, " CARD: Init. Code, TitleID_Lo"); + { + CARDRomHeader* rh; + rh = (CARDRomHeader*)CARD_GetRomHeader(); + + if ( rh->game_code != 0 ) + { + // イニシャルコードの取得 + if ( rh->product_id & 0x03 || rh->product_id & 0x02 ) // 刺さっているカードのロムが TWLアプリ + { + ROM_Header* rh2; + rh2 = (ROM_Header*)HW_TWL_CARD_ROM_HEADER_BUF; + + // ROM ヘッダの拡張領域まで TitleID_Lo を見に行く + // ROM ヘッダ(共通部)のイニシャルコードは基本的に製品版に入れられる +// ConvertTitleIdLo(titleid_lo, rh2->s.titleID_Lo); + MI_CpuCopy8( rh2->s.titleID_Lo, titleid_lo, 4 ); + titleid_lo[4] = 0x00; + MI_CpuCopy8( rh2->s.game_code, init_code, 4 ); + } + else // 刺さっているカードのロムが NTRアプリ + { + // 未マスタリング状態のロムでは、ROM ヘッダ(共通部)のイニシャルコードへ + // 設定が反映されない + + // 特別に設定された NTRアプリなら TitleID_Lo が設定されている可能性があるので読み込んでみる + MI_CpuClear8( titleid_lo, 5 ); + MI_CpuCopy8( ((ROM_Header*)rh)->s.titleID_Lo, titleid_lo, 4 ); + titleid_lo[4] = 0x00; + ConvertGameCode(init_code, rh->game_code); + } + + // ノーマルジャンプを許可しているかどうかを取得 + if ( rh->reserved_A[8] & 0x01 ) + { + PutSubScreen( 0, 2 + TITLE_NUM_CUL + 2, 0xf2, " %s, %s : o", init_code, titleid_lo ); + } + else + { + PutSubScreen( 0, 2 + TITLE_NUM_CUL + 2, 0xff, " %s, %s : -", init_code, titleid_lo ); + } + } + else + { + PutSubScreen( 0, 2 + TITLE_NUM_CUL + 2, 0xfe, " not exist"); + } + + ConvertGameCode(init_code, rh->game_code); + } + + + // カーソル描画 + PutSubScreen( 1 + (gCurPos >= TITLE_NUM_CUL ? 18 : 0), 2 + (gCurPos >= TITLE_NUM_CUL ? gCurPos - 18 : gCurPos), 0xf4, "*"); +} + +static void ConvertTitleIdLo(u8* code, u8* titleid_lo) +{ + u8 tmp[5]; + s32 i; + +// for ( titleid_lo += 3, i=0 ; i<4; i++, code++, titleid_lo--) + for ( i=3; i>=0; i--, titleid_lo++ ) + { + tmp[i] = *titleid_lo; + *code = tmp[i]; + } + +// *code = tmp; + + // NULL 終端 + *code = 0x00; +} + +static void ConvertGameCode(u8* code, u32 game_code) +{ + u8 tmp[5]; + s32 i; + + ConvertInitialCode(tmp, game_code); + + for ( i=3; i>=0; i--, code++) + { + *code = tmp[i]; + } + + // NULL 文字終端 + *code = 0x00; +} + +static void ConvertInitialCode(u8* code, u32 titleid_lo) +{ + s32 i; + + for ( i=0; i<4; i++, code++) + { + *code = (u8)(titleid_lo >> (8 * (3-i))); + } + + // NULL文字終端 + *code = 0x00; +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: Vブランク割込みハンドラ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void VBlankIntr(void) +{ + // テキスト表示を更新 + UpdateScreen(); + + // IRQ チェックフラグ47をセット + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + +static void* AllocForNAM(u32 size) +{ + void* ptr; + ptr = OS_AllocFromMain(size); + + if (ptr == NULL) + { + OS_Panic("alloc failed."); + } + + return ptr; + +} + +static void FreeForNAM(void* ptr) +{ + OS_FreeToMain(ptr); +} + + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/AppJumpChecker/src/screen.c b/build/debugsoft/AppJumpChecker/src/screen.c new file mode 100644 index 00000000..a9fec417 --- /dev/null +++ b/build/debugsoft/AppJumpChecker/src/screen.c @@ -0,0 +1,194 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: screen.c + + Copyright 2007 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 +#include "screen.h" +#include "font.h" + +/*---------------------------------------------------------------------------* + 定数 定義 + *---------------------------------------------------------------------------*/ +#define TEXT_SCREEN_SIZE 2048 + +/*---------------------------------------------------------------------------* + 内部変数 定義 + *---------------------------------------------------------------------------*/ + +// 仮想スクリーン[ 上下画面 ][ BG 枚数 ][ キャラクタ数 ] +static u16 gScreen[2 ][ 1 ][ TEXT_SCREEN_SIZE / sizeof(u16) ] ATTRIBUTE_ALIGN(32); + +/*---------------------------------------------------------------------------* + Name: InitScreen + + Description: 文字表示システムのために、表示設定を初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void InitScreen(void) +{ + // 各 V-RAM 初期化 + GX_SetBankForLCDC(GX_VRAM_LCDC_ALL); + MI_CpuClearFast((void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE); + (void)GX_DisableBankForLCDC(); + + // OAM 初期化 + MI_CpuFillFast((void*)HW_OAM, 0xc0, HW_OAM_SIZE); + MI_CpuFillFast((void*)HW_DB_OAM, 0xc0, HW_DB_OAM_SIZE); + + // パレット初期化 + MI_CpuClearFast((void*)HW_PLTT, HW_PLTT_SIZE); + MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE); + + // 上画面設定 + GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D); + + GX_SetBankForBG(GX_VRAM_BG_128_A); + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0x0000, GX_BG_CHARBASE_0x04000, + GX_BG_EXTPLTT_01); + G2_SetBG0Priority(0); + + GX_SetVisiblePlane(GX_PLANEMASK_BG0); + GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + ((u16*)HW_PLTT)[0] = 0x0000; // black + MI_CpuFillFast(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[0][0], TEXT_SCREEN_SIZE); + GX_LoadBG0Scr(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + + // 下画面設定 + GX_SetBankForSubBG(GX_VRAM_SUB_BG_32_H); + G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0x0000, GX_BG_CHARBASE_0x04000, + GX_BG_EXTPLTT_01); + G2S_SetBG0Priority(0); + GXS_SetGraphicsMode(GX_BGMODE_0); + GXS_SetVisiblePlane(GX_PLANEMASK_BG0); + GXS_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GXS_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + ((u16*)HW_DB_PLTT)[0] = 0x0000; // black + MI_CpuFillFast(gScreen[1][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[1][0], TEXT_SCREEN_SIZE); + GXS_LoadBG0Scr(gScreen[1][0], 0, TEXT_SCREEN_SIZE); +} + +/*---------------------------------------------------------------------------* + Name: ClearScreen + + Description: 画面のテキスト表示をクリアする。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void ClearScreen(void) +{ + MI_CpuClearFast(gScreen[0][0], TEXT_SCREEN_SIZE); + MI_CpuClearFast(gScreen[1][0], TEXT_SCREEN_SIZE); +} +void ClearMainScreen(void) +{ + MI_CpuClearFast(gScreen[0][0], TEXT_SCREEN_SIZE); + +} +void ClearSubScreen(void) +{ + MI_CpuClearFast(gScreen[1][0], TEXT_SCREEN_SIZE); +} +/*---------------------------------------------------------------------------* + Name: PutMainScreen + + Description: メイン画面にテキスト出力する。 + + Arguments: text - 出力する文字列。 + ... - 仮想引数。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void PutMainScreen(s32 x, s32 y, u8 palette, char* text, ...) +{ + va_list vlist; + char temp[33]; + s32 i; + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + for (i = 0; i < 32; i++) + { + if (temp[i] == 0x00) + { + break; + } + + gScreen[0][0][((y * 32) + x + i) % (32 * 32)] = (u16) (palette << 12 | temp[i]); + } +} + +/*---------------------------------------------------------------------------* + Name: PrintSubScreen + + Description: サブ画面にテキスト出力する。 + + Arguments: text - 出力する文字列。 + ... - 仮想引数。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void PutSubScreen(s32 x, s32 y, u8 palette, char* text, ...) +{ + va_list vlist; + char temp[33]; + s32 i; + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + for (i = 0; i < 32; i++) + { + if (temp[i] == 0x00) + { + break; + } + + gScreen[1][0][((y * 32) + x + i) % (32 * 32)] = (u16) (palette << 12 | temp[i]); + } +} + +/*---------------------------------------------------------------------------* + Name: UpdateScreen + + Description: 仮想スクリーンを V-RAM に反映する。 + V ブランク期間中での呼び出しを想定。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void UpdateScreen(void) +{ + // 仮想スクリーンを V-RAM に反映 + DC_StoreRange(gScreen[0][0], TEXT_SCREEN_SIZE); + GX_LoadBG0Scr(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[1][0], TEXT_SCREEN_SIZE); + GXS_LoadBG0Scr(gScreen[1][0], 0, TEXT_SCREEN_SIZE); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/461A/libsyscall.a b/build/debugsoft/ApplicationJump/Card-anotherID/461A/libsyscall.a new file mode 100644 index 00000000..d8c3f61d Binary files /dev/null and b/build/debugsoft/ApplicationJump/Card-anotherID/461A/libsyscall.a differ diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/461A/libsyscall_c.bin b/build/debugsoft/ApplicationJump/Card-anotherID/461A/libsyscall_c.bin new file mode 100644 index 00000000..6ff82c68 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Card-anotherID/461A/libsyscall_c.bin differ diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/461A/rom_header_461a.template.sbin b/build/debugsoft/ApplicationJump/Card-anotherID/461A/rom_header_461a.template.sbin new file mode 100644 index 00000000..a7df6dae Binary files /dev/null and b/build/debugsoft/ApplicationJump/Card-anotherID/461A/rom_header_461a.template.sbin differ diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/Makefile b/build/debugsoft/ApplicationJump/Card-anotherID/Makefile new file mode 100644 index 00000000..547f36bc --- /dev/null +++ b/build/debugsoft/ApplicationJump/Card-anotherID/Makefile @@ -0,0 +1,49 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - appjumpTest - Card +# 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$ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM := TWL + +TARGET_BIN = appjumpTestForCard_AID.srl +INCDIR = ../include +SRCDIR = ./src ../src +SRCS = main.c screen.c font.c common.c + +ROM_SPEC = appjumptest_card.rsf + + + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/ApplicationJumpTest +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + + +do-build: $(TARGETS) + +#---------------------------------------------------------------------------- + +LIBSYSCALL = ./461A/libsyscall.a + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/appjumptest_card.rsf b/build/debugsoft/ApplicationJump/Card-anotherID/appjumptest_card.rsf new file mode 100644 index 00000000..19e70a3d --- /dev/null +++ b/build/debugsoft/ApplicationJump/Card-anotherID/appjumptest_card.rsf @@ -0,0 +1,243 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName "AppJmpTestC" + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./461A/rom_header_461a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile $(TWLSDK_ROOT)/include/twl/specfiles/default.bnr + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingNormalJump TRUE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media GameCard + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 461A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/banner/banner.bnr b/build/debugsoft/ApplicationJump/Card-anotherID/banner/banner.bnr new file mode 100644 index 00000000..0b405167 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Card-anotherID/banner/banner.bnr differ diff --git a/build/debugsoft/ApplicationJump/Card-anotherID/src/main.c b/build/debugsoft/ApplicationJump/Card-anotherID/src/main.c new file mode 100644 index 00000000..7db1eee4 --- /dev/null +++ b/build/debugsoft/ApplicationJump/Card-anotherID/src/main.c @@ -0,0 +1,313 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest - Card + 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 "common.h" +#include "screen.h" + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ +// キー入力 +static KeyInfo gKey; + +// アプリ間パラメータ +static AppParam gAppParam; +// アプリ間パラメータとして文字列をセットするかどうか +static BOOL gIsSetDelArg = TRUE; +// アプリ間パラメータとして引き渡された文字列を格納するバッファ(6つまで) +static char gStrAppParam[6][APPJUMP_STRING_LENGTH + 1] ATTRIBUTE_ALIGN(32); +// アプリ間パラメータとして引き渡された文字列の個数 +static int gArgc; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void AddDeliverArg(OSDeliverArgInfo *argInfo, BOOL isReturn); + +/*---------------------------------------------------------------------------*/ + +void TwlMain(void) +{ + OSDeliverArgInfo argInfo; + + int result; + int argSize =sizeof(u32); + + InitCommon(); + InitScreen(); + + GX_DispOn(); + GXS_DispOn(); + + ClearScreen(); + + // キー入力情報取得の空呼び出し(IPL での A ボタン押下対策) + ReadKey(&gKey); + + OS_InitDeliverArgInfo(&argInfo, sizeof(AppParam)); + OS_DecodeDeliverArg(); + + /* アプリ間パラメータ(バイナリデータの取得) */ + if ( OS_DELIVER_ARG_SUCCESS != (result = OS_GetBinaryFromDeliverArg( &gAppParam, &argSize, sizeof(AppParam))) ) + { + PutMainScreen(1, 16, 0xf1, "ERROR!: READ_ERROR (%d)", result); + + OS_WaitVBlankIntr(); + OS_Terminate(); + } + + /* アプリ間パラメータ(文字列)の取得 */ + if ((gArgc = OS_GetDeliverArgc()) > 0) + { + int i; + + OS_TPrintf("argc = %d\n", gArgc); + + for (i=0; i < gArgc-1 && i < 6; i++) + { + STD_StrLCpy(gStrAppParam[i], (const char*)OS_GetDeliverArgv(i+1), APPJUMP_STRING_LENGTH); + gStrAppParam[i][APPJUMP_STRING_LENGTH] = '\0'; + } + } + + while(TRUE) + { + int i; + + // 自動テスト中に、ユーザのキー入力による終了指示を受け付けるためにウエイトを入れる + if (gAppParam.isAutoJump == 1) + { + OSTick tick = OS_GetTick(); + + PutMainScreen(1, 9, 0xf8, "executing auto app jump..."); + PutMainScreen(1, 11, 0xff, "wait 2 seconds..."); + PutMainScreen(1, 13, 0xff, "START: quit auto app jump"); + do { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_START) + { + break; + } + + OS_WaitVBlankIntr(); + } while (OS_TicksToSeconds(OS_GetTick() - tick) < 2); + } + else + { + // キー入力情報取得 + ReadKey(&gKey); + } + + // 画面クリア + ClearScreen(); + + // メイン画面描画 + PutMainScreen(0, 2, 0xf4, " ****** This APP is CARD ****** "); + PutMainScreen(0, 5, 0xff, " APP JUMP : %u times ", gAppParam.jumpCount); + PutMainScreen(0, 7, 0xff, " DELIVERED PARAM (recent 6 app)"); + + for (i=0; i 0) + { + int i; + + OS_TPrintf("argc = %d\n", gArgc); + + for (i=0; i < gArgc-1 && i < 6; i++) + { + STD_StrLCpy(gStrAppParam[i], (const char*)OS_GetDeliverArgv(i+1), APPJUMP_STRING_LENGTH); + gStrAppParam[i][APPJUMP_STRING_LENGTH] = '\0'; + } + } + + while(TRUE) + { + int i; + + // 自動テスト中に、ユーザのキー入力による終了指示を受け付けるためにウエイトを入れる + if (gAppParam.isAutoJump == 1) + { + OSTick tick = OS_GetTick(); + + PutMainScreen(1, 9, 0xf8, "executing auto app jump..."); + PutMainScreen(1, 11, 0xff, "wait 2 seconds..."); + PutMainScreen(1, 13, 0xff, "START: quit auto app jump"); + do { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_START) + { + break; + } + + OS_WaitVBlankIntr(); + } while (OS_TicksToSeconds(OS_GetTick() - tick) < 2); + } + else + { + // キー入力情報取得 + ReadKey(&gKey); + } + + // 画面クリア + ClearScreen(); + + // メイン画面描画 + PutMainScreen(0, 2, 0xf4, " ****** This APP is CARD ****** "); + PutMainScreen(0, 5, 0xff, " APP JUMP : %u times ", gAppParam.jumpCount); + PutMainScreen(0, 7, 0xff, " DELIVERED PARAM (recent 6 app)"); + + for (i=0; i 0) + { + int i; + + OS_TPrintf("argc = %d\n", gArgc); + + for (i=0; i < gArgc-1 && i < 6; i++) + { + STD_StrLCpy(gStrAppParam[i], (const char*)OS_GetDeliverArgv(i+1), APPJUMP_STRING_LENGTH); + gStrAppParam[i][APPJUMP_STRING_LENGTH] = '\0'; + } + } + + while(TRUE) + { + int i; + + // 自動テスト中に、ユーザのキー入力による終了指示を受け付けるためにウエイトを入れる + if (gAppParam.isAutoJump == 1) + { + OSTick tick = OS_GetTick(); + + PutMainScreen(1, 9, 0xf8, "executing auto app jump..."); + PutMainScreen(1, 11, 0xff, "wait 2 seconds..."); + PutMainScreen(1, 13, 0xff, "START: quit auto app jump"); + do { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_START) + { + break; + } + + OS_WaitVBlankIntr(); + } while (OS_TicksToSeconds(OS_GetTick() - tick) < 2); + } + else + { + // キー入力情報取得 + ReadKey(&gKey); + } + + // 画面クリア + ClearScreen(); + + // メイン画面描画 + PutMainScreen(0, 2, 0xf4, " ****** This APP is CARD ****** "); + PutMainScreen(0, 5, 0xff, " APP JUMP : %u times ", gAppParam.jumpCount); + PutMainScreen(0, 7, 0xff, " DELIVERED PARAM (recent 6 app)"); + + for (i=0; i= JUMPTYPE_NUM ) + { + gJumpTypeForB = JUMPTYPE_RETURN; + } + } + + if (gKey.trg & PAD_BUTTON_START) + { + // 自動テストフラグをスイッチ + gAppParam.isAutoJump ^= 1; + } + + if (gKey.trg & PAD_BUTTON_A) + { + AddDeliverArg(&argInfo, FALSE); + // NAND-1 アプリへジャンプ + if( !OS_DoApplicationJump( NANDAPP1_TITLEID, OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + if (gKey.trg & PAD_BUTTON_Y) + { + AddDeliverArg(&argInfo, FALSE); + + // NAND-2 アプリへジャンプ + if ( !OS_DoApplicationJump( NANDAPP2_TITLEID, OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + if (gKey.trg & PAD_BUTTON_X || gAppParam.isAutoJump == 1) + { + AddDeliverArg(&argInfo, FALSE); + // 自分自身へジャンプ + if( !OS_DoApplicationJump( OS_GetTitleId(), OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + if (gKey.trg & PAD_BUTTON_B) + { + AddDeliverArg(&argInfo, TRUE); + switch (gJumpTypeForB) + { + case JUMPTYPE_RETURN: + if ( !OS_ReturnToPrevApplication() ) + { + OS_TPrintf("Failed to Return Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); + } + break; + case JUMPTYPE_ANOTHER_CARD: + break; + case JUMPTYPE_SYSMENU: + OS_JumpToSystemMenu(); + break; + } + } + + if (gKey.trg & PAD_BUTTON_L || gKey.trg & PAD_BUTTON_R) + { + // アプリ間パラメータとして文字列を引き渡すかどうかのフラグを ON/OFF する + gIsSetDelArg = !gIsSetDelArg; + } + + // Vブランク待ち + OS_WaitVBlankIntr(); + } + + // Vブランク待ち 最後に画面を更新してから終了 + OS_WaitVBlankIntr(); + OS_Terminate(); +} + +/*---------------------------------------------------------------------------* + Name: AddDeliverArg + + Description: アプリジャンプ先へ引き渡すパラメータを追加。 + + Arguments: argInfo : + isReturn : ジャンプ元への復帰ならば TRUE + + Returns: None. + *---------------------------------------------------------------------------*/ +static void AddDeliverArg(OSDeliverArgInfo *argInfo, BOOL isReturn) +{ + int result; + char argument[APPJUMP_STRING_LENGTH + 1]; + gAppParam.jumpCount++; + + OS_InitDeliverArgInfo(argInfo, sizeof(AppParam)); + + // アプリジャンプ回数を +1 してセット + result = OS_SetBinaryToDeliverArg( &(gAppParam), sizeof(AppParam) ); + + if(result != OS_DELIVER_ARG_SUCCESS) + { + OS_Warning("Failed to Set DeliverArgument."); + } + + if (gIsSetDelArg) + { + int i; + + // 文字列をセット + MI_CpuClear8(argument, APPJUMP_STRING_LENGTH + 1); + if (isReturn) + { + STD_TSPrintf(argument, "Returned from CARD"); + } + else + { + STD_TSPrintf(argument, "Jumped from CARD"); + } + OS_SetStringToDeliverArg(argument); + + // 今まで引き渡されたパラメータ文字列を引き継がせる + for (i=0; i <= 4 && i < gArgc; i++) + { + MI_CpuClear8(argument, APPJUMP_STRING_LENGTH + 1); + STD_StrLCpy( argument, gStrAppParam[i], APPJUMP_STRING_LENGTH ); + result = OS_SetStringToDeliverArg(argument); + OS_TPrintf("arg = %s : result = %d\n", argument, result); + } + } + OS_EncodeDeliverArg(); +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: Vブランク割込みハンドラ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void VBlankIntr(void) +{ + // テキスト表示を更新 + UpdateScreen(); + + // IRQ チェックフラグをセット + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/Makefile b/build/debugsoft/ApplicationJump/Makefile new file mode 100644 index 00000000..79900665 --- /dev/null +++ b/build/debugsoft/ApplicationJump/Makefile @@ -0,0 +1,38 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - debugsoft - ApplicationJump +# 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------------------------------------------------- + +SUBDIRS = Card \ + Nand-1 \ + Nand-2 \ + Card-fail \ + Card-anotherID + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/ApplicationJump/Nand-1/431A/libsyscall.a b/build/debugsoft/ApplicationJump/Nand-1/431A/libsyscall.a new file mode 100644 index 00000000..8a14b9aa Binary files /dev/null and b/build/debugsoft/ApplicationJump/Nand-1/431A/libsyscall.a differ diff --git a/build/debugsoft/ApplicationJump/Nand-1/431A/libsyscall_c.bin b/build/debugsoft/ApplicationJump/Nand-1/431A/libsyscall_c.bin new file mode 100644 index 00000000..8b722c18 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Nand-1/431A/libsyscall_c.bin differ diff --git a/build/debugsoft/ApplicationJump/Nand-1/431A/rom_header_431a.template.sbin b/build/debugsoft/ApplicationJump/Nand-1/431A/rom_header_431a.template.sbin new file mode 100644 index 00000000..ab3b2658 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Nand-1/431A/rom_header_431a.template.sbin differ diff --git a/build/debugsoft/ApplicationJump/Nand-1/Makefile b/build/debugsoft/ApplicationJump/Nand-1/Makefile new file mode 100644 index 00000000..70780d21 --- /dev/null +++ b/build/debugsoft/ApplicationJump/Nand-1/Makefile @@ -0,0 +1,47 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - appjumpTest - Nand-1 +# 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$ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM := TWL +TWL_NANDAPP := TRUE + +TARGET_BIN = appjumpTestForNand1.tad +INCDIR = ../include +SRCDIR = ./src ../src +SRCS = main.c screen.c font.c common.c + +ROM_SPEC = main_nand1.rsf + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/ApplicationJumpTest +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + +do-build: $(TARGETS) + +#---------------------------------------------------------------------------- + +LIBSYSCALL = ./431A/libsyscall.a + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/ApplicationJump/Nand-1/banner/banner.bnr b/build/debugsoft/ApplicationJump/Nand-1/banner/banner.bnr new file mode 100644 index 00000000..0e57dc8b Binary files /dev/null and b/build/debugsoft/ApplicationJump/Nand-1/banner/banner.bnr differ diff --git a/build/debugsoft/ApplicationJump/Nand-1/main_nand1.rsf b/build/debugsoft/ApplicationJump/Nand-1/main_nand1.rsf new file mode 100644 index 00000000..cd4a169a --- /dev/null +++ b/build/debugsoft/ApplicationJump/Nand-1/main_nand1.rsf @@ -0,0 +1,243 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName AppJmpTestN1 + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./431A/rom_header_431a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "./banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingNormalJump TRUE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 431A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/ApplicationJump/Nand-1/src/main.c b/build/debugsoft/ApplicationJump/Nand-1/src/main.c new file mode 100644 index 00000000..dcf737de --- /dev/null +++ b/build/debugsoft/ApplicationJump/Nand-1/src/main.c @@ -0,0 +1,362 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest - Nand-1 + 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 "common.h" +#include "screen.h" + +/*---------------------------------------------------------------------------* + 変数定義 + *---------------------------------------------------------------------------*/ +// キー入力 +static KeyInfo gKey; + +// B ボタンジャンプ先の切りかえフラグ +static u8 gJumpTypeForB = JUMPTYPE_RETURN; +// アプリ間パラメータ +static AppParam gAppParam; +// アプリ間パラメータとして文字列をセットするかどうか +static BOOL gIsSetDelArg = TRUE; +// アプリ間パラメータとして引き渡された文字列を格納するバッファ(6つまで) +static char gStrAppParam[6][APPJUMP_STRING_LENGTH + 1] ATTRIBUTE_ALIGN(32); +// アプリ間パラメータとして引き渡された文字列の個数 +static int gArgc; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void AddDeliverArg(OSDeliverArgInfo *argInfo, BOOL isReturn); + +/*---------------------------------------------------------------------------*/ + +void TwlMain(void) +{ + OSDeliverArgInfo argInfo; + + int result; + int argSize =sizeof(u32); + + InitCommon(); + InitScreen(); + + GX_DispOn(); + GXS_DispOn(); + + ClearScreen(); + + // キー入力情報取得の空呼び出し(IPL での A ボタン押下対策) + ReadKey(&gKey); + + OS_InitDeliverArgInfo(&argInfo, sizeof(AppParam)); + OS_DecodeDeliverArg(); + + /* アプリ間パラメータ(バイナリデータの取得) */ + if ( OS_DELIVER_ARG_SUCCESS != (result = OS_GetBinaryFromDeliverArg( &gAppParam, &argSize, sizeof(AppParam))) ) + { + PutMainScreen(1, 16, 0xf1, "ERROR!: READ_ERROR (%d)", result); + + OS_WaitVBlankIntr(); + OS_Terminate(); + } + + /* アプリ間パラメータ(文字列)の取得 */ + if ((gArgc = OS_GetDeliverArgc()) > 0) + { + int i; + + OS_TPrintf("argc = %d\n", gArgc); + + for (i=0; i < gArgc-1 && i < 6; i++) + { + STD_StrLCpy(gStrAppParam[i], (const char*)OS_GetDeliverArgv(i+1), APPJUMP_STRING_LENGTH); + gStrAppParam[i][APPJUMP_STRING_LENGTH] = '\0'; + } + } + + while(TRUE) + { + int i; + + // 自動テスト中に、ユーザのキー入力による終了指示を受け付けるためにウエイトを入れる + if (gAppParam.isAutoJump == 1) + { + OSTick tick = OS_GetTick(); + + PutMainScreen(1, 9, 0xf8, "executing auto app jump..."); + PutMainScreen(1, 11, 0xff, "wait 2 seconds..."); + PutMainScreen(1, 13, 0xff, "START: quit auto app jump"); + do { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_START) + { + break; + } + + OS_WaitVBlankIntr(); + } while (OS_TicksToSeconds(OS_GetTick() - tick) < 2); + } + else + { + // キー入力情報取得 + ReadKey(&gKey); + } + + // 画面クリア + ClearScreen(); + + // メイン画面描画 + PutMainScreen(0, 2, 0xf5, " ***** This APP is NAND-1 ***** "); + PutMainScreen(0, 5, 0xff, " APP JUMP : %u times ", gAppParam.jumpCount); + PutMainScreen(0, 7, 0xff, " DELIVERED PARAM (recent 6 app)"); + + for (i=0; i= JUMPTYPE_NUM ) + { + gJumpTypeForB = JUMPTYPE_RETURN; + } + } + + if (gKey.trg & PAD_BUTTON_START) + { + // 自動テストフラグをスイッチ + gAppParam.isAutoJump ^= 1; + } + + if (gKey.trg & PAD_BUTTON_A) + { + AddDeliverArg(&argInfo, FALSE); + // カードアプリへジャンプ + if( !OS_DoApplicationJump( CARDAPP_TITLEID, OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + + if (gKey.trg & PAD_BUTTON_Y) + { + AddDeliverArg(&argInfo, FALSE); + + // もう一方の NAND アプリへジャンプ + if ( !OS_DoApplicationJump( NANDAPP2_TITLEID, OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + if (gKey.trg & PAD_BUTTON_X || gAppParam.isAutoJump == 1) + { + AddDeliverArg(&argInfo, FALSE); + // 自分自身へジャンプ + if( !OS_DoApplicationJump( OS_GetTitleId(), OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + if (gKey.trg & PAD_BUTTON_B) + { + AddDeliverArg(&argInfo, TRUE); + + switch (gJumpTypeForB) + { + case JUMPTYPE_RETURN: + if ( !OS_ReturnToPrevApplication() ) + { + OS_TPrintf("Failed to Return Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); + } + break; + case JUMPTYPE_ANOTHER_CARD: + if ( !OS_DoApplicationJump(CARDAPP_ANO_TITLEID, OS_APP_JUMP_NORMAL) ) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + case JUMPTYPE_SYSMENU: + OS_JumpToSystemMenu(); + break; + case JUMPTYPE_FAIL_CARD: + if ( !OS_DoApplicationJump(CARDAPP_FAIL_TITLEID, OS_APP_JUMP_NORMAL) ) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + } + + if (gKey.trg & PAD_BUTTON_L || gKey.trg & PAD_BUTTON_R) + { + gIsSetDelArg = !gIsSetDelArg; + } + + // Vブランク待ち + OS_WaitVBlankIntr(); + } + + // Vブランク待ち 最後に画面を更新してから終了 + OS_WaitVBlankIntr(); + OS_Terminate(); +} + +/*---------------------------------------------------------------------------* + Name: AddDeliverArg + + Description: アプリジャンプ先へ引き渡すパラメータを追加。 + + Arguments: argInfo : + isReturn : ジャンプ元への復帰ならば TRUE + + Returns: None. + *---------------------------------------------------------------------------*/ +static void AddDeliverArg(OSDeliverArgInfo *argInfo, BOOL isReturn) +{ + int result; + char argument[APPJUMP_STRING_LENGTH + 1]; + gAppParam.jumpCount++; + + OS_InitDeliverArgInfo(argInfo, sizeof(AppParam)); + + // アプリジャンプ回数を +1 してセット + result = OS_SetBinaryToDeliverArg( &(gAppParam), sizeof(AppParam) ); + + if(result != OS_DELIVER_ARG_SUCCESS) + { + OS_Warning("Failed to Set DeliverArgument."); + } + + if (gIsSetDelArg) + { + int i; + + // 文字列をセット + MI_CpuClear8(argument, APPJUMP_STRING_LENGTH + 1); + if (isReturn) + { + STD_TSPrintf(argument, "Returned from NAND-1"); + } + else + { + STD_TSPrintf(argument, "Jumped from NAND-1"); + } + OS_SetStringToDeliverArg(argument); + + // 今まで引き渡されたパラメータ文字列を引き継がせる + for (i=0; i <= 4 && i < gArgc; i++) + { + MI_CpuClear8(argument, APPJUMP_STRING_LENGTH + 1); + STD_StrLCpy( argument, gStrAppParam[i], APPJUMP_STRING_LENGTH ); + result = OS_SetStringToDeliverArg(argument); + OS_TPrintf("arg = %s : result = %d\n", argument, result); + } + } + OS_EncodeDeliverArg(); +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: Vブランク割込みハンドラ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void VBlankIntr(void) +{ + // テキスト表示を更新 + UpdateScreen(); + + // IRQ チェックフラグをセット + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/Nand-2/432A/libsyscall.a b/build/debugsoft/ApplicationJump/Nand-2/432A/libsyscall.a new file mode 100644 index 00000000..a12fea83 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Nand-2/432A/libsyscall.a differ diff --git a/build/debugsoft/ApplicationJump/Nand-2/432A/libsyscall_c.bin b/build/debugsoft/ApplicationJump/Nand-2/432A/libsyscall_c.bin new file mode 100644 index 00000000..21d02f46 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Nand-2/432A/libsyscall_c.bin differ diff --git a/build/debugsoft/ApplicationJump/Nand-2/432A/rom_header_432a.template.sbin b/build/debugsoft/ApplicationJump/Nand-2/432A/rom_header_432a.template.sbin new file mode 100644 index 00000000..03810f85 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Nand-2/432A/rom_header_432a.template.sbin differ diff --git a/build/debugsoft/ApplicationJump/Nand-2/Makefile b/build/debugsoft/ApplicationJump/Nand-2/Makefile new file mode 100644 index 00000000..f4ea4dde --- /dev/null +++ b/build/debugsoft/ApplicationJump/Nand-2/Makefile @@ -0,0 +1,47 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - appjumpTest - Nand-2 +# 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$ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM := TWL +TWL_NANDAPP := TRUE + +TARGET_BIN = appjumpTestForNand2.tad +INCDIR = ../include +SRCDIR = ./src ../src +SRCS = main.c screen.c font.c common.c + +ROM_SPEC = main_nand2.rsf + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/ApplicationJumpTest +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + +do-build: $(TARGETS) + +#---------------------------------------------------------------------------- + +LIBSYSCALL = ./431A/libsyscall.a + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/ApplicationJump/Nand-2/banner/banner.bnr b/build/debugsoft/ApplicationJump/Nand-2/banner/banner.bnr new file mode 100644 index 00000000..e6190cc3 Binary files /dev/null and b/build/debugsoft/ApplicationJump/Nand-2/banner/banner.bnr differ diff --git a/build/debugsoft/ApplicationJump/Nand-2/main_nand2.rsf b/build/debugsoft/ApplicationJump/Nand-2/main_nand2.rsf new file mode 100644 index 00000000..176c6791 --- /dev/null +++ b/build/debugsoft/ApplicationJump/Nand-2/main_nand2.rsf @@ -0,0 +1,243 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName AppJmpTestN2 + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./432A/rom_header_432a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "./banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingNormalJump TRUE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 432A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/ApplicationJump/Nand-2/src/main.c b/build/debugsoft/ApplicationJump/Nand-2/src/main.c new file mode 100644 index 00000000..58ed785b --- /dev/null +++ b/build/debugsoft/ApplicationJump/Nand-2/src/main.c @@ -0,0 +1,364 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest - Nand-2 + 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 "common.h" +#include "screen.h" + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ + +// キー入力 +static KeyInfo gKey; + + +// B ボタンジャンプ先の切りかえフラグ +static u8 gJumpTypeForB = JUMPTYPE_RETURN; +// アプリ間パラメータ +static AppParam gAppParam; +// アプリ間パラメータとして文字列をセットするかどうか +static BOOL gIsSetDelArg = TRUE; +// アプリ間パラメータとして引き渡された文字列を格納するバッファ(6つまで) +static char gStrAppParam[6][APPJUMP_STRING_LENGTH + 1] ATTRIBUTE_ALIGN(32); +// アプリ間パラメータとして引き渡された文字列の個数 +static int gArgc; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void AddDeliverArg(OSDeliverArgInfo *argInfo, BOOL isReturn); + +/*---------------------------------------------------------------------------*/ + +void TwlMain(void) +{ + OSDeliverArgInfo argInfo; + + int result; + int argSize =sizeof(u32); + + InitCommon(); + InitScreen(); + + GX_DispOn(); + GXS_DispOn(); + + ClearScreen(); + + // キー入力情報取得の空呼び出し(IPL での A ボタン押下対策) + ReadKey(&gKey); + + OS_InitDeliverArgInfo(&argInfo, sizeof(AppParam)); + OS_DecodeDeliverArg(); + + /* アプリ間パラメータ(バイナリデータの取得) */ + if ( OS_DELIVER_ARG_SUCCESS != (result = OS_GetBinaryFromDeliverArg( &gAppParam, &argSize, sizeof(AppParam))) ) + { + PutMainScreen(1, 16, 0xf1, "ERROR!: READ_ERROR (%d)", result); + + OS_WaitVBlankIntr(); + OS_Terminate(); + } + + /* アプリ間パラメータ(文字列)の取得 */ + if ((gArgc = OS_GetDeliverArgc()) > 0) + { + int i; + + OS_TPrintf("argc = %d\n", gArgc); + + for (i=0; i < gArgc-1 && i < 6; i++) + { + STD_StrLCpy(gStrAppParam[i], (const char*)OS_GetDeliverArgv(i+1), APPJUMP_STRING_LENGTH); + gStrAppParam[i][APPJUMP_STRING_LENGTH] = '\0'; + } + } + + while(TRUE) + { + int i; + + // 自動テスト中に、ユーザのキー入力による終了指示を受け付けるためにウエイトを入れる + if (gAppParam.isAutoJump == 1) + { + OSTick tick = OS_GetTick(); + + PutMainScreen(1, 9, 0xf8, "executing auto app jump..."); + PutMainScreen(1, 11, 0xff, "wait 2 seconds..."); + PutMainScreen(1, 13, 0xff, "START: quit auto app jump"); + do { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_START) + { + break; + } + + OS_WaitVBlankIntr(); + } while (OS_TicksToSeconds(OS_GetTick() - tick) < 2); + } + else + { + // キー入力情報取得 + ReadKey(&gKey); + } + + // 画面クリア + ClearScreen(); + + // メイン画面描画 + PutMainScreen(0, 2, 0xf6, " ***** This APP is NAND-2 ***** "); + PutMainScreen(0, 5, 0xff, " APP JUMP : %u times ", gAppParam.jumpCount); + PutMainScreen(0, 7, 0xff, " DELIVERED PARAM (recent 6 app)"); + + for (i=0; i= JUMPTYPE_NUM ) + { + gJumpTypeForB = JUMPTYPE_RETURN; + } + } + + if (gKey.trg & PAD_BUTTON_START) + { + // 自動テストフラグをスイッチ + gAppParam.isAutoJump ^= 1; + } + + if (gKey.trg & PAD_BUTTON_A) + { + AddDeliverArg(&argInfo, FALSE); + // カードアプリへジャンプ + if( !OS_DoApplicationJump( CARDAPP_TITLEID, OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + + if (gKey.trg & PAD_BUTTON_Y) + { + AddDeliverArg(&argInfo, FALSE); + + // もう一方の NAND アプリへジャンプ + if ( !OS_DoApplicationJump( NANDAPP1_TITLEID, OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + if (gKey.trg & PAD_BUTTON_X || gAppParam.isAutoJump == 1) + { + AddDeliverArg(&argInfo, FALSE); + // 自分自身へジャンプ + if( !OS_DoApplicationJump( OS_GetTitleId(), OS_APP_JUMP_NORMAL )) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + if (gKey.trg & PAD_BUTTON_B) + { + AddDeliverArg(&argInfo, TRUE); + switch (gJumpTypeForB) + { + case JUMPTYPE_RETURN: + if ( !OS_ReturnToPrevApplication() ) + { + OS_TPrintf("Failed to Return Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Return Jump."); + } + break; + case JUMPTYPE_ANOTHER_CARD: + if ( !OS_DoApplicationJump(CARDAPP_ANO_TITLEID, OS_APP_JUMP_NORMAL) ) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + case JUMPTYPE_SYSMENU: + OS_JumpToSystemMenu(); + break; + case JUMPTYPE_FAIL_CARD: + if ( !OS_DoApplicationJump(CARDAPP_FAIL_TITLEID, OS_APP_JUMP_NORMAL) ) + { + OS_TPrintf("Failed to Jump.\n"); + PutMainScreen(1, 16, 0xf1, "ERROR!: Failed to Jump."); + } + break; + } + } + + if (gKey.trg & PAD_BUTTON_L || gKey.trg & PAD_BUTTON_R) + { + gIsSetDelArg = !gIsSetDelArg; + } + + // Vブランク待ち + OS_WaitVBlankIntr(); + } + + // Vブランク待ち 最後に画面を更新してから終了 + OS_WaitVBlankIntr(); + OS_Terminate(); +} + +/*---------------------------------------------------------------------------* + Name: AddDeliverArg + + Description: アプリジャンプ先へ引き渡すパラメータを追加。 + + Arguments: argInfo : + isReturn : ジャンプ元への復帰ならば TRUE + + Returns: None. + *---------------------------------------------------------------------------*/ +static void AddDeliverArg(OSDeliverArgInfo *argInfo, BOOL isReturn) +{ + int result; + char argument[APPJUMP_STRING_LENGTH + 1]; + gAppParam.jumpCount++; + + OS_InitDeliverArgInfo(argInfo, sizeof(AppParam)); + + // アプリジャンプ回数を +1 してセット + result = OS_SetBinaryToDeliverArg( &(gAppParam), sizeof(AppParam) ); + + if(result != OS_DELIVER_ARG_SUCCESS) + { + OS_Warning("Failed to Set DeliverArgument."); + } + + if (gIsSetDelArg) + { + int i; + + // 文字列をセット + MI_CpuClear8(argument, APPJUMP_STRING_LENGTH + 1); + if (isReturn) + { + STD_TSPrintf(argument, "Returned from NAND-2"); + } + else + { + STD_TSPrintf(argument, "Jumped from NAND-2"); + } + + OS_SetStringToDeliverArg(argument); + + // 今まで引き渡されたパラメータ文字列を引き継がせる + for (i=0; i <= 4 && i < gArgc; i++) + { + MI_CpuClear8(argument, APPJUMP_STRING_LENGTH + 1); + STD_StrLCpy( argument, gStrAppParam[i], APPJUMP_STRING_LENGTH ); + result = OS_SetStringToDeliverArg(argument); + OS_TPrintf("arg = %s : result = %d\n", argument, result); + } + } + OS_EncodeDeliverArg(); +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: Vブランク割込みハンドラ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void VBlankIntr(void) +{ + // テキスト表示を更新 + UpdateScreen(); + + // IRQ チェックフラグをセット + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/ReadMe.txt b/build/debugsoft/ApplicationJump/ReadMe.txt new file mode 100644 index 00000000..7980ed21 --- /dev/null +++ b/build/debugsoft/ApplicationJump/ReadMe.txt @@ -0,0 +1,77 @@ +appjumpTest + +アプリジャンプ機能をテストするためのアプリセットです。 +======================================================== + +<概要> =============================================== +2種類のNAND アプリと 3種類のカードアプリで構成されます。 +各アプリ間で、アプリジャンプの機能を一通り試すことができます。 +アプリ間でのパラメータの受け渡し、ジャンプ元へのリターンも可能です。 + + +3種類のカードアプリについて + +| ファイル名 | イニシャルコード | 被ノーマルジャンプ | +| appjumpTestForCard.srl | 430A |  許可 | +| appjumpTestForCard_Fail.srl | 460A | 不許可 | +| appjumpTestForCard_AID.srl | 461A |  許可 | +----------------------------------------------------------------------------- + +<使い方> ============================================= +2種類のNAND アプリを TWL にインポートした状態で、カードアプリを起動してください。 + +操作方法は、下画面下部に一覧表示されます。 +ABXY ボタンがそれぞれに対応したターゲットへのアプリジャンプを実行します。 + +L/R ボタンで、アプリ間パラメータ(文字列データ)を次のジャンプ先へ渡すかどうかを +切り替えることができます(デフォルトは ON になっています)。 + +START ボタンを押すと、現在起動中のアプリ自身へのアプリジャンプを自動で繰り返すモードに入ります。 +中断するには、起動後上画面にメッセージが出ている間(約2秒間)に START ボタンを押してください。 + +(2008/08/30 追記) +異常系チェックのために、カードアプリを2種追加しました。 + +・ひとつめ(460A)について + 被ノーマルジャンプを許可していない TWL カードアプリです。 + NAND アプリからこのアプリにジャンプしようとすると、必ずエラーが返るはずです。 + +・ふたつめ(461A)について + 被ノーマルジャンプは許可していますが、最初のカードアプリとは TitleID が別物の TWL カードアプリです。 + 最初に、もう一方のノーマルジャンプを許可しているカードアプリ[430A]をスロットに挿入した状態で + テストを開始します。そこから NAND アプリにジャンプした後、カードを[461A] に差し替えます。 + そして、NAND アプリからカードアプリへノーマルジャンプを実行した際に、ジャンプできるかどうかをチェックします。 + + +<画面の見方> ========================================== +・上画面について + 起動中のアプリが 3種類の内どれかを色と文字で表します。 + (黄:CARD、紫:NAND-1、水色:NAND-2) + + APP JUMP -> 今までのアプリジャンプ実行回数です。 + DELIVERED PARAM -> アプリ間パラメータ渡しをONにしている場合、ジャンプ元へのリターンも含めて +  これまでのジャンプ元の履歴が 6つまで表示されます。 + エラー表示 -> アプリジャンプに失敗した場合、赤字でエラーが表示されます。 +  エラー表示が出た場合、それ以上アプリの実行はできませんので再起動してください。 + +・下画面について + DELIVER ARG: (ON or OFF) -> アプリ間パラメータ渡しを有効にするかどうかのフラグの状態です。 +  L/R ボタンで ON/OFF を切り替えることができます。 + AUTO JUMP TEST: (ON or OFF) -> 自分自身へのアプリジャンプを中断するまで繰り返すテストモードかどうかを示す値です。 + 操作方法一覧 -> 各ボタンの説明を表示しています。アプリによって、ボタンに割り当てられた +  ジャンプ先が異なりますので注意してください。 +  ただし、ジャンプ元へのリターンは Bボタン、自分自身へのジャンプは Xボタン固定です。 + +<その他注意事項> +初回起動時(アプリジャンプを一度も実行していない状態)に、ジャンプ元へのリターンを行うと、 +必ずエラーになります。 + + +======================================================== +なにか問題がありましたら、環境制作部 西本まで。 +nishimoto_takashi@nintendo.co.jp + + +<更新履歴>============================================ +2008/08/30 カードアプリ2種追加について加筆修正 +2008/07/31 新規追加 diff --git a/build/debugsoft/ApplicationJump/include/common.h b/build/debugsoft/ApplicationJump/include/common.h new file mode 100644 index 00000000..d591dc81 --- /dev/null +++ b/build/debugsoft/ApplicationJump/include/common.h @@ -0,0 +1,96 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest + File: common.h + + 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$ + *---------------------------------------------------------------------------*/ +#ifndef COMMON_H_ +#define COMMON_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#include + +/*---------------------------------------------------------------------------* + 定数定義 + *---------------------------------------------------------------------------*/ + +/* TitleID */ +#define CARDAPP_TITLEID (u64)(0x0003000034333041) // 430A +#define CARDAPP_FAIL_TITLEID (u64)(0x0003000034363041) // 460A +#define CARDAPP_ANO_TITLEID (u64)(0x0003000034363141) // 461A + +#define NANDAPP1_TITLEID (u64)(0x0003000434333141) // 431A +#define NANDAPP2_TITLEID (u64)(0x0003000434333241) // 432A + +#define KEY_REPEAT_START 25 // キーリピート開始までのフレーム数 +#define KEY_REPEAT_SPAN 10 // キーリピートの間隔フレーム数 + +/* アプリ間パラメータ関連 */ +#define APPJUMP_STRING_LENGTH 24 // 引数一つ分として受け渡しされる文字列の長さ制限 + +/*---------------------------------------------------------------------------* + 構造体 定義 + *---------------------------------------------------------------------------*/ + +typedef enum JumpTypeForB +{ + JUMPTYPE_RETURN = 0, + JUMPTYPE_ANOTHER_CARD, + JUMPTYPE_SYSMENU, + JUMPTYPE_FAIL_CARD, + + JUMPTYPE_NUM +} JumpTypeForB; + +// キー入力情報 +typedef struct KeyInfo +{ + u16 cnt; // 未加工入力値 + u16 trg; // 押しトリガ入力 + u16 up; // 離しトリガ入力 + u16 rep; // 押し維持リピート入力 +} KeyInfo; + +// アプリ間でバイナリデータとして引き渡す構造体 +typedef struct AppParam +{ + u32 jumpCount; // アプリジャンプの実行回数 + u8 isAutoJump; // 一定間隔で自動的にアプリジャンプを実行するかどうかのフラグ + u8 rsv[3]; // 4バイトアラインメントのため +} AppParam; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +void InitCommon(void); + +void ReadKey(KeyInfo* pKey); + +void VBlankIntr(void); + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* COMMON_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/include/font.h b/build/debugsoft/ApplicationJump/include/font.h new file mode 100644 index 00000000..37699026 --- /dev/null +++ b/build/debugsoft/ApplicationJump/include/font.h @@ -0,0 +1,41 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: font.h + + Copyright 2007 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$ + *---------------------------------------------------------------------------*/ +#ifndef FONT_H_ +#define FONT_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#include + +extern const u32 d_CharData[8 * 256]; +extern const u32 d_PaletteData[8 * 16]; + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* FONT_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/include/screen.h b/build/debugsoft/ApplicationJump/include/screen.h new file mode 100644 index 00000000..0d08dffd --- /dev/null +++ b/build/debugsoft/ApplicationJump/include/screen.h @@ -0,0 +1,49 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: screen.h + + Copyright 2007 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$ + *---------------------------------------------------------------------------*/ +#ifndef SCREEN_H_ +#define SCREEN_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#include + +/*---------------------------------------------------------------------------* + 関数 定義 + *---------------------------------------------------------------------------*/ +void InitScreen(void); +void ClearScreen(void); +void ClearMainScreen(void); +void ClearSubScreen(void); +void PutMainScreen(s32 x, s32 y, u8 palette, char* text, ...); +void PutSubScreen(s32 x, s32 y, u8 palette, char* text, ...); +void UpdateScreen(void); + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* SCREEN_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/src/common.c b/build/debugsoft/ApplicationJump/src/common.c new file mode 100644 index 00000000..b1883893 --- /dev/null +++ b/build/debugsoft/ApplicationJump/src/common.c @@ -0,0 +1,153 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest + File: common.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 "common.h" + +static void InitInterrupts(void); +static void InitHeap(void); + +/*---------------------------------------------------------------------------* + 関数定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + Name: InitCommon + + Description: 基本的な初期化関数をここで呼ぶ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void InitCommon(void) +{ + OS_Init(); + OS_InitTick(); + OS_InitAlarm(); + GX_Init(); + GX_DispOff(); + GXS_DispOff(); + + InitHeap(); + InitInterrupts(); +} + +/*---------------------------------------------------------------------------* + Name: ReadKey + + Description: キー入力情報を取得し、入力情報構造体を編集する。 + 押しトリガ、離しトリガ、押し継続リピートトリガ を検出する。 + + Arguments: pKey - 編集するキー入力情報構造体を指定する。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void ReadKey(KeyInfo* pKey) +{ + static u16 repeat_count[12]; + int i; + u16 r; + + r = PAD_Read(); + pKey->trg = 0x0000; + pKey->up = 0x0000; + pKey->rep = 0x0000; + + for (i = 0; i < 12; i++) + { + if (r & (0x0001 << i)) + { + if (!(pKey->cnt & (0x0001 << i))) + { + pKey->trg |= (0x0001 << i); // 押しトリガ + repeat_count[i] = 1; + } + else + { + if (repeat_count[i] > KEY_REPEAT_START) + { + pKey->rep |= (0x0001 << i); // 押し継続リピート + repeat_count[i] = (u16) (KEY_REPEAT_START - KEY_REPEAT_SPAN); + } + else + { + repeat_count[i]++; + } + } + } + else + { + if (pKey->cnt & (0x0001 << i)) + { + pKey->up |= (0x0001 << i); // 離しトリガ + } + } + } + + pKey->cnt = r; // 未加工キー入力 +} + +/*---------------------------------------------------------------------------* + Name: InitInterrupts + + Description: 割り込み設定を初期化する。 + V ブランク割り込みを許可し、割り込みハンドラを設定する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitInterrupts(void) +{ + // V ブランク割り込み設定 + OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)GX_VBlankIntr(TRUE); + + // 割り込み許可 + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); +} + +/*---------------------------------------------------------------------------* + Name: InitHeap + + Description: メインメモリ上のアリーナにてメモリ割当てシステムを初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitHeap(void) +{ + void* tempLo; + OSHeapHandle hh; + + // メインメモリ上のアリーナにヒープをひとつ作成 + tempLo = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1); + OS_SetArenaLo(OS_ARENA_MAIN, tempLo); + hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi()); + if (hh < 0) + { + // ヒープ作成に失敗した場合は異常終了 + OS_Panic("ARM9: Fail to create heap...\n"); + } + (void)OS_SetCurrentHeap(OS_ARENA_MAIN, hh); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/src/font.c b/build/debugsoft/ApplicationJump/src/font.c new file mode 100644 index 00000000..2111ca07 --- /dev/null +++ b/build/debugsoft/ApplicationJump/src/font.c @@ -0,0 +1,585 @@ +/*---------------------------------------------------------------------------* + Project: NitroWiFi - WCM - demos - wcm-list + File: font.c + + Copyright 2005,2006 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. + + $Log: font.c,v $ + Revision 1.2 2006/03/10 09:22:43 kitase_hirotake + INDENT SOURCE + + Revision 1.1 2005/07/21 08:21:06 adachi_hiroaki + 新規追加 + + + $NoKeywords: $ + *---------------------------------------------------------------------------*/ +#include "font.h" + +/*---------------------------------------------------------------------------* + Character data + *---------------------------------------------------------------------------*/ +const u32 d_CharData[8 * 256] = +{ + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01010010, 0x01010010, 0x00000110, // 0001h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x01011010, 0x01010010, 0x00010010, // 0002h + 0x00100010, 0x00100010, 0x00100001, 0x00100001, + 0x00000000, 0x01010001, 0x01010001, 0x01111111, // 0003h + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 0004h + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01010000, 0x01010100, 0x00001010, // 0005h + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011000, 0x01011000, 0x01111111, // 0006h + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01010010, 0x01101111, 0x01010010, // 0007h + 0x00010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x01010010, 0x01011111, 0x00000100, // 0008h + 0x00011111, 0x00001000, 0x00000001, 0x00011110, + 0x00000000, 0x01010000, 0x01011000, 0x00000110, // 0009h + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x01010000, 0x01111101, 0x00010001, // 000ah + 0x00010001, 0x00010001, 0x00010001, 0x00001010, + 0x00000000, 0x01010000, 0x01011110, 0x00100000, // 000bh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010100, 0x01011111, 0x00001000, // 000ch + 0x00010000, 0x00000001, 0x00000001, 0x00011110, + 0x00000000, 0x01010001, 0x01010001, 0x00000001, // 000dh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00011000, // 000eh + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x01010010, 0x01111111, 0x00010010, // 000fh + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00001110, 0x01010100, 0x01010010, // 0010h + 0x00111111, 0x00000100, 0x00000100, 0x00011000, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 0011h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x01010100, 0x01011111, 0x00000010, // 0012h + 0x00011110, 0x00100001, 0x00100000, 0x00011110, + 0x00000000, 0x01010000, 0x01011100, 0x00100011, // 0013h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00010000, // 0014h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x01010010, 0x01010010, 0x00001100, // 0015h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010001, 0x01111101, 0x00010001, // 0016h + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01010100, 0x01010011, 0x01110010, // 0017h + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01011110, 0x01011000, 0x00000100, // 0018h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01010000, 0x01011100, 0x00010010, // 0019h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011101, 0x01010001, 0x00111101, // 001ah + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x01110001, 0x01011101, 0x00110001, // 001bh + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01110100, 0x01010011, 0x00110010, // 001ch + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01101110, 0x01011000, 0x00100100, // 001dh + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01110000, 0x01011100, 0x00110010, // 001eh + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x01010001, 0x00111101, // 001fh + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0020h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 0021h + 0x00001000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x01101100, 0x01001000, 0x00100100, // 0022h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100100, 0x01111111, 0x00100100, // 0023h + 0x00100100, 0x01111111, 0x00010010, 0x00010010, + 0x00000000, 0x00001000, 0x01111110, 0x00001001, // 0024h + 0x00111110, 0x01001000, 0x00111111, 0x00001000, + 0x00000000, 0x01000010, 0x00100101, 0x00010010, // 0025h + 0x00001000, 0x00100100, 0x01010010, 0x00100001, + 0x00000000, 0x00001110, 0x00010001, 0x00001001, // 0026h + 0x01000110, 0x00101001, 0x00110001, 0x01001110, + 0x00000000, 0x00011000, 0x00010000, 0x00001000, // 0027h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01110000, 0x00001000, 0x00000100, // 0028h + 0x00000100, 0x00000100, 0x00001000, 0x01110000, + 0x00000000, 0x00000111, 0x00001000, 0x00010000, // 0029h + 0x00010000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x00001000, 0x01001001, 0x00101010, // 002ah + 0x00011100, 0x00101010, 0x01001001, 0x00001000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 002bh + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002ch + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002dh + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002eh + 0x00000000, 0x00000000, 0x00000000, 0x00001100, + 0x00000000, 0x01000000, 0x00100000, 0x00010000, // 002fh + 0x00001000, 0x00000100, 0x00000010, 0x00000001, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0030h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00011100, 0x00010000, 0x00010000, // 0031h + 0x00010000, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0032h + 0x00111110, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0033h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00100000, 0x00110000, 0x00101000, // 0034h + 0x00100100, 0x00100010, 0x01111111, 0x00100000, + 0x00000000, 0x01111111, 0x00000001, 0x00111111, // 0035h + 0x01000000, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x00000001, 0x00111111, // 0036h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00100000, 0x00100000, // 0037h + 0x00010000, 0x00010000, 0x00001000, 0x00001000, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0038h + 0x00111110, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0039h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003ah + 0x00000000, 0x00000000, 0x00001100, 0x00000000, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003bh + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x01100000, 0x00011000, 0x00000110, // 003ch + 0x00000001, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00000000, 0x01111111, 0x00000000, // 003dh + 0x00000000, 0x00000000, 0x01111111, 0x00000000, + 0x00000000, 0x00000011, 0x00001100, 0x00110000, // 003eh + 0x01000000, 0x00110000, 0x00001100, 0x00000011, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 003fh + 0x00110000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x00011100, 0x00100010, 0x01001001, // 0040h + 0x01010101, 0x01010101, 0x01010101, 0x00111010, + 0x00000000, 0x00001000, 0x00010100, 0x00010100, // 0041h + 0x00100010, 0x00111110, 0x01000001, 0x01000001, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0042h + 0x00111111, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0043h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x00011111, 0x00100001, 0x01000001, // 0044h + 0x01000001, 0x01000001, 0x00100001, 0x00011111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0045h + 0x01111111, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0046h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0047h + 0x01111001, 0x01000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0048h + 0x01111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x00001000, 0x00001000, // 0049h + 0x00001000, 0x00001000, 0x00001000, 0x00111110, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 004ah + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01100001, 0x00011001, 0x00000101, // 004bh + 0x00000011, 0x00000101, 0x00011001, 0x01100001, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 004ch + 0x00000001, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01000001, 0x01100011, 0x01010101, // 004dh + 0x01001001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x01000001, 0x01000011, 0x01000101, // 004eh + 0x01001001, 0x01010001, 0x01100001, 0x01000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 004fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0050h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 0051h + 0x01000001, 0x01011001, 0x00100010, 0x01011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0052h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x01000001, 0x00000001, // 0053h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00001000, 0x00001000, // 0054h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0055h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01000001, 0x01000001, 0x00100010, // 0056h + 0x00100010, 0x00010100, 0x00010100, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0057h + 0x01001001, 0x01010101, 0x01100011, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0058h + 0x00001000, 0x00010100, 0x00100010, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0059h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01111111, 0x00100000, 0x00010000, // 005ah + 0x00001000, 0x00000100, 0x00000010, 0x01111111, + 0x00000000, 0x01111100, 0x00000100, 0x00000100, // 005bh + 0x00000100, 0x00000100, 0x00000100, 0x01111100, + 0x00000000, 0x00100010, 0x00010100, 0x00111110, // 005ch + 0x00001000, 0x00111110, 0x00001000, 0x00001000, + 0x00000000, 0x00011111, 0x00010000, 0x00010000, // 005dh + 0x00010000, 0x00010000, 0x00010000, 0x00011111, + 0x00000000, 0x00001000, 0x00010100, 0x00100010, // 005eh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 005fh + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x00010000, 0x00001000, 0x00011000, // 0060h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00011110, 0x00100001, // 0061h + 0x00111110, 0x00100001, 0x00100001, 0x01011110, + 0x00000000, 0x00000001, 0x00000001, 0x00111111, // 0062h + 0x01000001, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00000000, 0x00111100, 0x01000010, // 0063h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000000, 0x01000000, 0x01111110, // 0064h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0065h + 0x01111111, 0x00000001, 0x01000001, 0x00111110, + 0x00000000, 0x00110000, 0x00001000, 0x00001000, // 0066h + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x01111110, 0x01000001, // 0067h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0068h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00001000, 0x00000000, 0x00001000, // 0069h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00100000, 0x00000000, 0x00100000, // 006ah + 0x00100000, 0x00100001, 0x00100001, 0x00011110, + 0x00000000, 0x00000001, 0x00000001, 0x01100001, // 006bh + 0x00011001, 0x00000111, 0x00011001, 0x01100001, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 006ch + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00110111, 0x01001001, // 006dh + 0x01001001, 0x01001001, 0x01001001, 0x01001001, + 0x00000000, 0x00000000, 0x00111111, 0x01000001, // 006eh + 0x01000001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00000000, 0x00011100, 0x00100010, // 006fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00000000, 0x00111101, 0x01000011, // 0070h + 0x01000001, 0x01000011, 0x00111101, 0x00000001, + 0x00000000, 0x00000000, 0x01011110, 0x01100001, // 0071h + 0x01000001, 0x01100001, 0x01011110, 0x01000000, + 0x00000000, 0x00000000, 0x00110001, 0x00001101, // 0072h + 0x00000011, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0073h + 0x00001110, 0x00110000, 0x01000001, 0x00111110, + 0x00000000, 0x00000100, 0x00000100, 0x01111111, // 0074h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0075h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0076h + 0x00100010, 0x00100010, 0x00010100, 0x00001000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0077h + 0x01001001, 0x00101010, 0x00101010, 0x00010100, + 0x00000000, 0x00000000, 0x00100001, 0x00010010, // 0078h + 0x00001100, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0079h + 0x00100010, 0x00011100, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111111, 0x00010000, // 007ah + 0x00001000, 0x00000100, 0x00000010, 0x00111111, + 0x00000000, 0x00001000, 0x00011110, 0x01100100, // 007bh + 0x00011000, 0x00100100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x00011110, 0x00000100, // 007ch + 0x00011110, 0x00110101, 0x00101101, 0x00010010, + 0x00000000, 0x00000000, 0x00000000, 0x00010001, // 007dh + 0x00100001, 0x00100001, 0x00000001, 0x00000010, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007eh + 0x00011110, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007fh + 0x00111110, 0x00010000, 0x00001100, 0x00110010, + 0x00000000, 0x00000000, 0x00000100, 0x00101111, // 0080h + 0x01000100, 0x00011110, 0x00100101, 0x00010110, + 0x00000000, 0x00000000, 0x00001010, 0x00011110, // 0081h + 0x00101011, 0x00100010, 0x00010100, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00011101, // 0082h + 0x00101011, 0x00101001, 0x00011001, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00111000, // 0083h + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00000000, 0x00000000, 0x00011100, // 0084h + 0x00100011, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000110, 0x01001001, 0x00110000, // 0085h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000100, 0x00111111, 0x00000100, // 0086h + 0x00111110, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000000, 0x00100001, 0x01000001, // 0087h + 0x01000001, 0x01000001, 0x00000001, 0x00000010, + 0x00000000, 0x00111100, 0x00000000, 0x00111110, // 0088h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00011100, 0x00000000, 0x00111110, // 0089h + 0x00010000, 0x00001000, 0x00010100, 0x01100010, + 0x00000000, 0x00100100, 0x01011111, 0x00000100, // 008ah + 0x00111110, 0x01000101, 0x01000101, 0x00100010, + 0x00000000, 0x00100010, 0x01001111, 0x01010010, // 008bh + 0x01010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x00000100, 0x00111110, 0x00001000, // 008ch + 0x00111110, 0x00010000, 0x00000010, 0x00111100, + 0x00000000, 0x00100000, 0x00011000, 0x00000110, // 008dh + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x00100000, 0x01111101, 0x00100001, // 008eh + 0x00100001, 0x00100001, 0x00100001, 0x00010010, + 0x00000000, 0x00011110, 0x00100000, 0x00000000, // 008fh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00001000, 0x01111111, 0x00010000, // 0090h + 0x00100000, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0091h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00010000, 0x01111111, 0x00011000, // 0092h + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 0093h + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x00111100, 0x00010000, 0x00001100, // 0094h + 0x01111111, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000100, 0x00011111, 0x00000100, // 0095h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00001000, 0x01111111, 0x00000100, // 0096h + 0x00111100, 0x01000010, 0x01000000, 0x00111100, + 0x00000000, 0x00000000, 0x00011100, 0x00100011, // 0097h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01111111, 0x00010000, 0x00001000, // 0098h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000010, 0x00110010, 0x00001100, // 0099h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00100100, 0x01001111, 0x01000010, // 009ah + 0x00010001, 0x00111100, 0x00010010, 0x00001100, + 0x00000000, 0x00000010, 0x01111010, 0x01000010, // 009bh + 0x00000010, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00100010, 0x00111110, 0x01010010, // 009ch + 0x01001011, 0x01101101, 0x01010101, 0x00110010, + 0x00000000, 0x00110010, 0x01001011, 0x01000110, // 009dh + 0x01000110, 0x01110010, 0x01001011, 0x00110010, + 0x00000000, 0x00011100, 0x00101010, 0x01001001, // 009eh + 0x01001001, 0x01000101, 0x01000101, 0x00110010, + 0x00000000, 0x00100001, 0x01111101, 0x00100001, // 009fh + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00000100, 0x00100011, 0x01100010, // 00a0h + 0x00100001, 0x00100001, 0x00010010, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a1h + 0x00000000, 0x00000100, 0x00001010, 0x00000100, + 0x00000000, 0x01110000, 0x00010000, 0x00010000, // 00a2h + 0x00010000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a3h + 0x00001000, 0x00001000, 0x00001000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a4h + 0x00000000, 0x00000010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00011000, // 00a5h + 0x00011000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x01111111, // 00a6h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00111111, 0x00100000, // 00a7h + 0x00010100, 0x00001100, 0x00000100, 0x00000010, + 0x00000000, 0x00000000, 0x00100000, 0x00100000, // 00a8h + 0x00010000, 0x00001111, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000100, 0x00111111, // 00a9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00aah + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00000000, 0x00010000, 0x00111111, // 00abh + 0x00011000, 0x00010100, 0x00010010, 0x00011001, + 0x00000000, 0x00000000, 0x00000010, 0x00111111, // 00ach + 0x00100010, 0x00010010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00adh + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00aeh + 0x00111110, 0x00100000, 0x00100000, 0x00111110, + 0x00000000, 0x00000000, 0x00100101, 0x00101010, // 00afh + 0x00101010, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00b0h + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x00101000, // 00b1h + 0x00011000, 0x00001000, 0x00001000, 0x00000100, + 0x00000000, 0x01000000, 0x00100000, 0x00011000, // 00b2h + 0x00010111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00001000, 0x01111111, 0x01000001, // 00b3h + 0x01000001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000000, 0x00111110, 0x00001000, // 00b4h + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00100000, 0x01111111, 0x00110000, // 00b5h + 0x00101000, 0x00100100, 0x00100010, 0x00110001, + 0x00000000, 0x00000100, 0x01111111, 0x01000100, // 00b6h + 0x01000100, 0x01000100, 0x01000010, 0x00100001, + 0x00000000, 0x00000100, 0x00111111, 0x00001000, // 00b7h + 0x01111111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x01111100, 0x01000100, 0x01000100, // 00b8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000010, 0x01111110, 0x00100010, // 00b9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00bah + 0x01000000, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 00bbh + 0x00100010, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000011, 0x00000100, 0x01000011, // 00bch + 0x01000100, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x01111111, 0x01000000, 0x00100000, // 00bdh + 0x00010000, 0x00011000, 0x00100100, 0x01000011, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00beh + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x01000001, 0x01000010, 0x01000000, // 00bfh + 0x00100000, 0x00100000, 0x00011000, 0x00000110, + 0x00000000, 0x01111110, 0x01000010, 0x01001110, // 00c0h + 0x01110001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x01100000, 0x00011110, 0x00010000, // 00c1h + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01000101, 0x01001010, 0x01001010, // 00c2h + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00c3h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000010, 0x00000010, 0x00000110, // 00c4h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x00010000, 0x00010000, 0x01111111, // 00c5h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111110, 0x00000000, // 00c6h + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000100, // 00c7h + 0x00101000, 0x00010000, 0x00101000, 0x01000110, + 0x00000000, 0x00001000, 0x01111111, 0x00100000, // 00c8h + 0x00010000, 0x00011100, 0x01101011, 0x00001000, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 00c9h + 0x00100000, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x00010010, 0x00100010, 0x00100010, // 00cah + 0x01000010, 0x01000010, 0x01000001, 0x01000001, + 0x00000000, 0x00000001, 0x00000001, 0x01111111, // 00cbh + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cch + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000100, 0x00001010, // 00cdh + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x01111111, // 00ceh + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cfh + 0x00100010, 0x00010100, 0x00001000, 0x00010000, + 0x00000000, 0x00001110, 0x01110000, 0x00001110, // 00d0h + 0x01110000, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00001000, 0x00001000, 0x00000100, // 00d1h + 0x00000100, 0x00100010, 0x01000010, 0x01111111, + 0x00000000, 0x01000000, 0x01000000, 0x00100100, // 00d2h + 0x00101000, 0x00010000, 0x00101100, 0x01000011, + 0x00000000, 0x01111111, 0x00000100, 0x01111111, // 00d3h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00d4h + 0x00100010, 0x00010100, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00d5h + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00d6h + 0x01111110, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00d7h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00d8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00001010, 0x00001010, 0x00001010, // 00d9h + 0x01001010, 0x01001010, 0x00101010, 0x00011001, + 0x00000000, 0x00000010, 0x00000010, 0x01000010, // 00dah + 0x01000010, 0x00100010, 0x00010010, 0x00001110, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dbh + 0x01000001, 0x01000001, 0x01000001, 0x01111111, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dch + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000011, 0x01000100, 0x01000000, // 00ddh + 0x01000000, 0x00100000, 0x00010000, 0x00001111, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00deh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00dfh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00011110, 0x00001000, 0x00000100, // 00e0h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x00000000, 0x00001100, 0x00010010, // 00e1h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x00100001, 0x01111101, // 00e2h + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00111100, 0x00010000, 0x00111100, // 00e3h + 0x00010000, 0x00011100, 0x00110010, 0x00001100, + 0x00000000, 0x00001110, 0x00101000, 0x00101000, // 00e4h + 0x00111110, 0x01100101, 0x00100101, 0x00010010, + 0x00000000, 0x00000100, 0x00101111, 0x01000100, // 00e5h + 0x00000110, 0x01000101, 0x01000101, 0x00111110, + 0x00000000, 0x00100010, 0x00100010, 0x00111110, // 00e6h + 0x01010010, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000100, 0x00011111, 0x00000010, // 00e7h + 0x00011111, 0x01000010, 0x01000010, 0x00111100, + 0x00000000, 0x00010010, 0x00111110, 0x01010011, // 00e8h + 0x01000010, 0x00100100, 0x00000100, 0x00000100, + 0x00000000, 0x00001000, 0x00111101, 0x01001011, // 00e9h + 0x01001001, 0x01001001, 0x00111000, 0x00000100, + 0x00000000, 0x00001000, 0x00111000, 0x00001000, // 00eah + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00011000, 0x00100000, 0x00000100, // 00ebh + 0x00111010, 0x01000110, 0x01000000, 0x00111000, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00ech + 0x01000110, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00edh + 0x01000011, 0x01001100, 0x01010010, 0x00111100, + 0x00000000, 0x00100010, 0x00110011, 0x00101010, // 00eeh + 0x00100110, 0x00100010, 0x00100011, 0x01000010, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00efh + 0x01000011, 0x01000000, 0x01000010, 0x00111100, + 0x00000000, 0x00000010, 0x00111011, 0x01000110, // 00f0h + 0x01000010, 0x01000011, 0x01000010, 0x00110010, + 0x00000000, 0x00000100, 0x00000100, 0x00000010, // 00f1h + 0x01000110, 0x01000101, 0x01000101, 0x00111001, + 0x00000000, 0x01010100, 0x01111111, 0x00100100, // 00f2h + 0x00100100, 0x00100100, 0x00100010, 0x00010001, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 00f3h + 0x00111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01011110, 0x01100010, 0x00100010, // 00f4h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010010, 0x01111110, 0x00100010, // 00f5h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 00f6h + 0x00100000, 0x00100000, 0x00100000, 0x00111111, + 0x00000000, 0x01010010, 0x01010010, 0x00111111, // 00f7h + 0x00010010, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01010011, 0x01010100, 0x00100011, // 00f8h + 0x00100100, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01010000, 0x01011111, 0x00010000, // 00f9h + 0x00001000, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x01010010, 0x01111111, 0x00100010, // 00fah + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x01010001, 0x01010010, 0x00100000, // 00fbh + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01011110, 0x01010010, 0x00100110, // 00fch + 0x00111001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01011110, 0x00010000, // 00fdh + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x00100101, 0x01001010, 0x00101010, // 00feh + 0x00100000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01011110, 0x01010000, 0x00111111, // 00ffh + 0x00001000, 0x00001000, 0x00001000, 0x00000110 +}; + +/*---------------------------------------------------------------------------* + Palette data + *---------------------------------------------------------------------------*/ +const u32 d_PaletteData[8 * 16] = +{ + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // black + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001f0000, 0x00000000, 0x00000000, 0x00000000, // red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00180000, 0x00000000, 0x00000000, 0x00000000, // dark red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/ApplicationJump/src/screen.c b/build/debugsoft/ApplicationJump/src/screen.c new file mode 100644 index 00000000..a9fec417 --- /dev/null +++ b/build/debugsoft/ApplicationJump/src/screen.c @@ -0,0 +1,194 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: screen.c + + Copyright 2007 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 +#include "screen.h" +#include "font.h" + +/*---------------------------------------------------------------------------* + 定数 定義 + *---------------------------------------------------------------------------*/ +#define TEXT_SCREEN_SIZE 2048 + +/*---------------------------------------------------------------------------* + 内部変数 定義 + *---------------------------------------------------------------------------*/ + +// 仮想スクリーン[ 上下画面 ][ BG 枚数 ][ キャラクタ数 ] +static u16 gScreen[2 ][ 1 ][ TEXT_SCREEN_SIZE / sizeof(u16) ] ATTRIBUTE_ALIGN(32); + +/*---------------------------------------------------------------------------* + Name: InitScreen + + Description: 文字表示システムのために、表示設定を初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void InitScreen(void) +{ + // 各 V-RAM 初期化 + GX_SetBankForLCDC(GX_VRAM_LCDC_ALL); + MI_CpuClearFast((void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE); + (void)GX_DisableBankForLCDC(); + + // OAM 初期化 + MI_CpuFillFast((void*)HW_OAM, 0xc0, HW_OAM_SIZE); + MI_CpuFillFast((void*)HW_DB_OAM, 0xc0, HW_DB_OAM_SIZE); + + // パレット初期化 + MI_CpuClearFast((void*)HW_PLTT, HW_PLTT_SIZE); + MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE); + + // 上画面設定 + GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D); + + GX_SetBankForBG(GX_VRAM_BG_128_A); + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0x0000, GX_BG_CHARBASE_0x04000, + GX_BG_EXTPLTT_01); + G2_SetBG0Priority(0); + + GX_SetVisiblePlane(GX_PLANEMASK_BG0); + GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + ((u16*)HW_PLTT)[0] = 0x0000; // black + MI_CpuFillFast(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[0][0], TEXT_SCREEN_SIZE); + GX_LoadBG0Scr(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + + // 下画面設定 + GX_SetBankForSubBG(GX_VRAM_SUB_BG_32_H); + G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0x0000, GX_BG_CHARBASE_0x04000, + GX_BG_EXTPLTT_01); + G2S_SetBG0Priority(0); + GXS_SetGraphicsMode(GX_BGMODE_0); + GXS_SetVisiblePlane(GX_PLANEMASK_BG0); + GXS_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GXS_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + ((u16*)HW_DB_PLTT)[0] = 0x0000; // black + MI_CpuFillFast(gScreen[1][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[1][0], TEXT_SCREEN_SIZE); + GXS_LoadBG0Scr(gScreen[1][0], 0, TEXT_SCREEN_SIZE); +} + +/*---------------------------------------------------------------------------* + Name: ClearScreen + + Description: 画面のテキスト表示をクリアする。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void ClearScreen(void) +{ + MI_CpuClearFast(gScreen[0][0], TEXT_SCREEN_SIZE); + MI_CpuClearFast(gScreen[1][0], TEXT_SCREEN_SIZE); +} +void ClearMainScreen(void) +{ + MI_CpuClearFast(gScreen[0][0], TEXT_SCREEN_SIZE); + +} +void ClearSubScreen(void) +{ + MI_CpuClearFast(gScreen[1][0], TEXT_SCREEN_SIZE); +} +/*---------------------------------------------------------------------------* + Name: PutMainScreen + + Description: メイン画面にテキスト出力する。 + + Arguments: text - 出力する文字列。 + ... - 仮想引数。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void PutMainScreen(s32 x, s32 y, u8 palette, char* text, ...) +{ + va_list vlist; + char temp[33]; + s32 i; + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + for (i = 0; i < 32; i++) + { + if (temp[i] == 0x00) + { + break; + } + + gScreen[0][0][((y * 32) + x + i) % (32 * 32)] = (u16) (palette << 12 | temp[i]); + } +} + +/*---------------------------------------------------------------------------* + Name: PrintSubScreen + + Description: サブ画面にテキスト出力する。 + + Arguments: text - 出力する文字列。 + ... - 仮想引数。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void PutSubScreen(s32 x, s32 y, u8 palette, char* text, ...) +{ + va_list vlist; + char temp[33]; + s32 i; + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + for (i = 0; i < 32; i++) + { + if (temp[i] == 0x00) + { + break; + } + + gScreen[1][0][((y * 32) + x + i) % (32 * 32)] = (u16) (palette << 12 | temp[i]); + } +} + +/*---------------------------------------------------------------------------* + Name: UpdateScreen + + Description: 仮想スクリーンを V-RAM に反映する。 + V ブランク期間中での呼び出しを想定。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void UpdateScreen(void) +{ + // 仮想スクリーンを V-RAM に反映 + DC_StoreRange(gScreen[0][0], TEXT_SCREEN_SIZE); + GX_LoadBG0Scr(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[1][0], TEXT_SCREEN_SIZE); + GXS_LoadBG0Scr(gScreen[1][0], 0, TEXT_SCREEN_SIZE); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/CardRomHeaderChecker/Card/Makefile b/build/debugsoft/CardRomHeaderChecker/Card/Makefile new file mode 100644 index 00000000..15279b58 --- /dev/null +++ b/build/debugsoft/CardRomHeaderChecker/Card/Makefile @@ -0,0 +1,51 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - appjumpTest - Card +# 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$ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM := TWL + +SUBDIRS = ../common/banner \ + $(ROOT)/build/demos/gx/UnitTours/DEMOLib + +TARGET_BIN = CardRomHeaderChecker.srl +#INCDIR = ../common/include +SRCDIR = ../common/src +SRCS = main.c + +ROM_SPEC = ./ROM-TS.rsf + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs +include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib + +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/CardRomHeaderChecker +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + + +do-build: $(TARGETS) + +#---------------------------------------------------------------------------- + +LIBSYSCALL = ../common/0CZA/libsyscall.a + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/CardRomHeaderChecker/Card/ROM-TS.rsf b/build/debugsoft/CardRomHeaderChecker/Card/ROM-TS.rsf new file mode 100644 index 00000000..17cc8900 --- /dev/null +++ b/build/debugsoft/CardRomHeaderChecker/Card/ROM-TS.rsf @@ -0,0 +1,196 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName "CardRH Check" + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + #MakerCode "00" + + # + # REMASTER VERSION: Mastering version + # + #RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ../common/0CZA/rom_header_0cza.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile ../common/banner/banner.bnr + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/CardRomHeaderChecker/Makefile b/build/debugsoft/CardRomHeaderChecker/Makefile new file mode 100644 index 00000000..d5d8dc26 --- /dev/null +++ b/build/debugsoft/CardRomHeaderChecker/Makefile @@ -0,0 +1,35 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - debugsoft - ApplicationJump +# 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------------------------------------------------- + +SUBDIRS = Card \ + Nand + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/CardRomHeaderChecker/Nand/Makefile b/build/debugsoft/CardRomHeaderChecker/Nand/Makefile new file mode 100644 index 00000000..c1d65027 --- /dev/null +++ b/build/debugsoft/CardRomHeaderChecker/Nand/Makefile @@ -0,0 +1,52 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - appjumpTest - Card +# 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$ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM := TWL +TWL_NANDAPP := TRUE + +SUBDIRS = ../common/banner \ + $(ROOT)/build/demos/gx/UnitTours/DEMOLib + +TARGET_BIN = CardRomHeaderChecker.tad +#INCDIR = ../common/include +SRCDIR = ../common/src +SRCS = main.c + +ROM_SPEC = ./ROM-TS_nand.rsf + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs +include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib + +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/CardRomHeaderChecker +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + + +do-build: $(TARGETS) + +#---------------------------------------------------------------------------- + +LIBSYSCALL = ../common/0CZA/libsyscall.a + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/CardRomHeaderChecker/Nand/ROM-TS_nand.rsf b/build/debugsoft/CardRomHeaderChecker/Nand/ROM-TS_nand.rsf new file mode 100644 index 00000000..fc19a2c2 --- /dev/null +++ b/build/debugsoft/CardRomHeaderChecker/Nand/ROM-TS_nand.rsf @@ -0,0 +1,243 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName "CardRH Check" + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + #MakerCode "00" + + # + # REMASTER VERSION: Mastering version + # + #RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ../common/0CZA/rom_header_0cza.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile ../common/banner/banner.bnr + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump FALSE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + #GameCode ABCJ + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/CardRomHeaderChecker/common/0CZA/libsyscall.a b/build/debugsoft/CardRomHeaderChecker/common/0CZA/libsyscall.a new file mode 100644 index 00000000..7377eea2 Binary files /dev/null and b/build/debugsoft/CardRomHeaderChecker/common/0CZA/libsyscall.a differ diff --git a/build/debugsoft/CardRomHeaderChecker/common/0CZA/rom_header_0cza.template.sbin b/build/debugsoft/CardRomHeaderChecker/common/0CZA/rom_header_0cza.template.sbin new file mode 100644 index 00000000..f99ad765 Binary files /dev/null and b/build/debugsoft/CardRomHeaderChecker/common/0CZA/rom_header_0cza.template.sbin differ diff --git a/build/debugsoft/CardRomHeaderChecker/common/banner/Makefile b/build/debugsoft/CardRomHeaderChecker/common/banner/Makefile new file mode 100644 index 00000000..1f8aa1d4 --- /dev/null +++ b/build/debugsoft/CardRomHeaderChecker/common/banner/Makefile @@ -0,0 +1,49 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlIPL +# File: Makefile +# +# Copyright 2007 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 $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs + +ICON_DIR = ./icon + +BANNER_ICON = $(ICON_DIR)/gameIcon.bmp +BANNER_SPEC = banner_v3.bsf + +TARGETS = banner.bnr +INSTALL_DIR = ./ +INSTALL_TARGETS = $(TARGETS) + +BANNER_ICON_NAME = $(basename $(BANNER_ICON)) + +LDIRT_CLEAN = $(TARGETS) \ + $(BANNER_ICON_NAME).nbfs \ + $(BANNER_ICON_NAME).nbfc \ + $(BANNER_ICON_NAME).nbfp \ + $(TARGETS:.bnr=.srl) + +include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- +# build +#---------------------------------------------------------------------------- +do-build: $(TARGETS) + +$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) + $(NTEXCONV) -no -bg -bgb -bgnc $(BANNER_ICON) >/dev/null && \ + $(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS) + +# diff --git a/build/debugsoft/CardRomHeaderChecker/common/banner/banner_v3.bsf b/build/debugsoft/CardRomHeaderChecker/common/banner/banner_v3.bsf new file mode 100644 index 00000000..427fb48c Binary files /dev/null and b/build/debugsoft/CardRomHeaderChecker/common/banner/banner_v3.bsf differ diff --git a/build/debugsoft/CardRomHeaderChecker/common/banner/icon/gameIcon.bmp b/build/debugsoft/CardRomHeaderChecker/common/banner/icon/gameIcon.bmp new file mode 100644 index 00000000..3ea06fe9 Binary files /dev/null and b/build/debugsoft/CardRomHeaderChecker/common/banner/icon/gameIcon.bmp differ diff --git a/build/debugsoft/CardRomHeaderChecker/common/src/main.c b/build/debugsoft/CardRomHeaderChecker/common/src/main.c new file mode 100644 index 00000000..48279f1e --- /dev/null +++ b/build/debugsoft/CardRomHeaderChecker/common/src/main.c @@ -0,0 +1,207 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - template - demos + File: main.c + + Copyright 2003-2005,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 +#include +#include +#include "DEMO.h" + +#define COLOR_WHITE (GX_RGBA(31, 31, 31, 1)) +#define COLOR_CYAN (GX_RGBA(0, 31, 31, 1)) +#define COLOR_RED (GX_RGBA(31, 0, 0, 1)) +#define COLOR_YELLOW (GX_RGBA(31, 31, 0, 1)) + +#define TITLE_COLOR COLOR_YELLOW +#define LABEL_COLOR COLOR_WHITE +#define VALUE_COLOR COLOR_WHITE +#define OK_COLOR COLOR_CYAN +#define NG_COLOR COLOR_RED + +// CRC計算 +#define CRC16_INIT_VALUE 0xffff +#define CALC_CRC16_SIZE 0x15e +static u16 CalcCRC16(u16 start, u8 *data, int size); + +void TwlMain(void) +{ + ROM_Header *prhTWL, *prhNTR; + char str[100]; + u16 row = 0; + u16 shift = 8; + u16 crc; + + OS_Init(); + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); + + DEMOInitCommon(); + DEMOInitVRAM(); + DEMOInitDisplayBitmap(); + DEMOHookConsole(); + + DEMOSetBitmapTextColor(GX_RGBA(31, 31, 0, 1)); + DEMOSetBitmapGroundColor(DEMO_RGB_CLEAR); + DEMOStartDisplay(); + + // カードROMヘッダ: NTR互換用 + prhNTR = (ROM_Header*)HW_CARD_ROM_HEADER; + + DEMOSetBitmapTextColor(COLOR_YELLOW); + DEMODrawText( 8, row, "Card ROM Header" ); + row += 2 * shift; + + DEMOSetBitmapTextColor(LABEL_COLOR); + DEMODrawText( 8, row, "Title Name:" ); + MI_CpuClear8( str, 100 ); + MI_CpuCopy8( prhNTR->s.title_name, str, TITLE_NAME_MAX ); + DEMOSetBitmapTextColor(VALUE_COLOR); + DEMODrawText( 96, row, str ); + row += shift; + + DEMOSetBitmapTextColor(LABEL_COLOR); + DEMODrawText( 8, row, "Game Code:" ); + MI_CpuClear8( str, 100 ); + MI_CpuCopy8( prhNTR->s.game_code, str, GAME_CODE_MAX ); + DEMOSetBitmapTextColor(VALUE_COLOR); + DEMODrawText( 96, row, str ); + row += shift; + + DEMOSetBitmapTextColor(LABEL_COLOR); + DEMODrawText( 8, row, "Header CRC:" ); + DEMOSetBitmapTextColor(VALUE_COLOR); + DEMODrawText( 96, row, "0x%04x", prhNTR->s.header_crc16 ); + row += shift; + + crc = CalcCRC16( CRC16_INIT_VALUE, (u8*)prhNTR, CALC_CRC16_SIZE ); + if( crc == prhNTR->s.header_crc16 ) + { + DEMOSetBitmapTextColor(OK_COLOR); + DEMODrawText( 96, row, "0x%04x OK", crc ); + } + else + { + DEMOSetBitmapTextColor(NG_COLOR); + DEMODrawText( 96, row, "0x%04x NG", crc ); + } + row += 3 * shift; + + // この固定メモリアドレスにTWLカードROMヘッダがある + // これはカードROMヘッダとは異なる + // カードROMヘッダ: NTR互換のための領域でROMヘッダのNTR互換部分だけがある + // TWLカードROMヘッダ: NTR互換部分に加えてROMヘッダのTWLで追加された部分もある + prhTWL = (ROM_Header*)HW_TWL_CARD_ROM_HEADER_BUF; + + DEMOSetBitmapTextColor(COLOR_YELLOW); + DEMODrawText( 8, row, "TWL Card ROM Header" ); + row += 2 * shift; + + DEMOSetBitmapTextColor(LABEL_COLOR); + DEMODrawText( 8, row, "Title Name: " ); + MI_CpuClear8( str, 100 ); + MI_CpuCopy8( prhTWL->s.title_name, str, TITLE_NAME_MAX ); + DEMOSetBitmapTextColor(VALUE_COLOR); + DEMODrawText( 96, row, str ); + row += shift; + + DEMOSetBitmapTextColor(LABEL_COLOR); + DEMODrawText( 8, row, "Game Code: " ); + MI_CpuClear8( str, 100 ); + MI_CpuCopy8( prhTWL->s.game_code, str, GAME_CODE_MAX ); + DEMOSetBitmapTextColor(VALUE_COLOR); + DEMODrawText( 96, row, str ); + row += shift; + + DEMOSetBitmapTextColor(LABEL_COLOR); + DEMODrawText( 8, row, "TitleID_Hi: " ); + prhTWL = (ROM_Header*)HW_TWL_CARD_ROM_HEADER_BUF; + DEMOSetBitmapTextColor(VALUE_COLOR); + DEMODrawText( 96, row, "0x%08x", prhTWL->s.titleID_Hi ); + row += shift; + + DEMOSetBitmapTextColor(LABEL_COLOR); + DEMODrawText( 8, row, "TitleID_Lo: " ); + MI_CpuClear8( str, 100 ); + MI_CpuCopy8( prhTWL->s.titleID_Lo, str, 4 ); + DEMOSetBitmapTextColor(VALUE_COLOR); + DEMODrawText( 96, row, str ); + row += shift; + + DEMOSetBitmapTextColor(LABEL_COLOR); + DEMODrawText( 8, row, "Header CRC:" ); + DEMOSetBitmapTextColor(VALUE_COLOR); + DEMODrawText( 96, row, "0x%04x", prhTWL->s.header_crc16 ); + row += shift; + + crc = CalcCRC16( CRC16_INIT_VALUE, (u8*)prhTWL, CALC_CRC16_SIZE ); + if( crc == prhTWL->s.header_crc16 ) + { + DEMOSetBitmapTextColor(OK_COLOR); + DEMODrawText( 96, row, "0x%04x OK", crc ); + } + else + { + DEMOSetBitmapTextColor(NG_COLOR); + DEMODrawText( 96, row, "0x%04x NG", crc ); + } + row += 2 * shift; + + DEMOSetBitmapTextColor(GX_RGBA(31, 31, 31, 1)); + DEMODrawText( 8, row, "End." ); + + while (1) + { + DEMO_DrawFlip(); + OS_WaitVBlankIntr(); + } +} + + +/*---------------------------------------------------------------------------* + * Math + * + * u16 CalcCRC16( u16 start, u8 *data, int size ) + *---------------------------------------------------------------------------*/ + +static u16 crc16_table[16] = { + 0x0000, 0xCC01, 0xD801, 0x1400, + 0xF001, 0x3C00, 0x2800, 0xE401, + 0xA001, 0x6C00, 0x7800, 0xB401, + 0x5000, 0x9C01, 0x8801, 0x4400 +}; + +static u16 CalcCRC16(u16 start, u8 *data, int size) +{ + u16 r1; + u16 total = start; + + while (size-- > 0) + { + // 下位4bit + r1 = crc16_table[total & 0xf]; + total = (u16)((total >> 4) & 0x0fff); + total = (u16)(total ^ r1 ^ crc16_table[*data & 0xf]); + + // 上位4bit + r1 = crc16_table[total & 0xf]; + total = (u16)((total >> 4) & 0x0fff); + total = (u16)(total ^ r1 ^ crc16_table[(*data >> 4) & 0xf]); + + data++; + } + return total; +} + +/*====== End of main.c ======*/ diff --git a/build/debugsoft/Internet/Makefile b/build/debugsoft/Internet/Makefile new file mode 100644 index 00000000..0e2cb013 --- /dev/null +++ b/build/debugsoft/Internet/Makefile @@ -0,0 +1,35 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL NITRO + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------------------------------------------------- + +SUBDIRS = NCFGCrusher \ + + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/Internet/NCFGCrusher/Makefile b/build/debugsoft/Internet/NCFGCrusher/Makefile new file mode 100644 index 00000000..6ecde606 --- /dev/null +++ b/build/debugsoft/Internet/NCFGCrusher/Makefile @@ -0,0 +1,68 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlWiFi - NCFG - demos - ncfg-1 +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- + +SUBDIRS = $(ROOT)/build/demos/gx/UnitTours/DEMOLib + +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL +TWL_ARCHGEN := LIMITED +TWL_NANDAPP := TRUE +TARGET_NAME = NCFGCrusher +TARGET_BIN = $(TARGET_NAME).srl +#TARGET_BIN = $(TARGET_NAME).tad +SRCS = main.c + + +ROM_SPEC = $(TARGET_NAME).autogen.rsf +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf +ROM_SPEC_PARAM = MakerCode=01 \ + BannerFile=./banner/banner.bnr \ + GameCode=4S03 \ + TitleName=$(TARGET_NAME) \ + AppType=USER \ +# Media=NAND \ + + +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.exe + + +#------------------------- +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/$(TARGET_NAME) +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + + + + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs +include $(TWLWIFI_ROOT)/build/buildtools/commondefs.demos +include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib + + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLWIFI_ROOT)/build/buildtools/modulerules +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/Internet/NCFGCrusher/banner/banner.bnr b/build/debugsoft/Internet/NCFGCrusher/banner/banner.bnr new file mode 100644 index 00000000..60eba830 Binary files /dev/null and b/build/debugsoft/Internet/NCFGCrusher/banner/banner.bnr differ diff --git a/build/debugsoft/Internet/NCFGCrusher/readme.txt b/build/debugsoft/Internet/NCFGCrusher/readme.txt new file mode 100644 index 00000000..f4309edd --- /dev/null +++ b/build/debugsoft/Internet/NCFGCrusher/readme.txt @@ -0,0 +1,33 @@ +NCFGTest + +*概要 +接続設定を破壊するツールです。 + +*操作方法 +上下キーで破壊する接続設定を選択し、Aボタンで決定します。 +下画面に元の接続設定データと、破壊後のデータが表示されます。 + +破壊は、各データの先頭に 0x61 〜 0x67を埋め込む形で実現しています。 + + +---------- +*NCFGの修復仕様まとめ + +接続設定のCRCをチェックし、エラーがある場合はその設定を初期化します。 +(IPアドレスの設定や、接続タイプ等が全てクリアされる状態) + +Nitroのときのように、接続設定1と2を異常にすると、3も道連れになりクリアされるというようなことはありません。 + + +より、詳細な仕様は影舞に記されています。 +http://phoenix.boy.nintendo.co.jp/~twl-wifi/kagemai/html/user.cgi?project=twl-wifi&action=view_report&id=84 +http://phoenix.boy.nintendo.co.jp/~twl-wifi/kagemai/html/user.cgi?project=twl-wifi&action=view_report&id=83 + +一部抜粋 +- CRC エラーの接続先は、個別に消去します。 +- 全領域 CRC エラーだった場合は、初回起動だと見なし、消去のみを行い、 + エラーを返しません。 +- 設定がされていた領域で消去が発生した場合は、エラーを通知します。 +- それ以外の場合は、エラーを返しません。 + (元々設定されていなかった領域で消去が発生した場合も含む) + diff --git a/build/debugsoft/Internet/NCFGCrusher/src/main.c b/build/debugsoft/Internet/NCFGCrusher/src/main.c new file mode 100644 index 00000000..d3104ffb --- /dev/null +++ b/build/debugsoft/Internet/NCFGCrusher/src/main.c @@ -0,0 +1,183 @@ +/*---------------------------------------------------------------------------* + Project: TwlWiFi - NCFG - demos - ncfg-1 + File: main.c + + Copyright 2007 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$ + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + NVRAM 上のネットワーク設定を一定の値で初期化しながら、 + その結果をダンプするサンプルプログラムです。 + *---------------------------------------------------------------------------*/ +#include +#include +#include +#include +#include + +//#include +//#include + +static void MainLoop(void); +//static void VBlankIntr(void); + +static void ReadNCFG(s32 index, u8* out); +static void WriteNCFG(s32 index); +static void InitDEMOSystem(void); + +static u32 UpdateCursor(u32 val, u32 max, u16 key); + +static const char* SLOT_NAME[] = { + "SLOT_1", "SLOT_2", "SLOT_3", "SLOT_EX_1", "SLOT_EX_2", "SLOT_EX_3" +}; +static const u32 SLOT_NUM = sizeof(SLOT_NAME) / sizeof(char*); + +void NitroMain() +{ + OS_Init(); + FX_Init(); + GX_Init(); + +// GX_DispOff(); +// GXS_DispOff(); + + // V ブランク割り込み設定 + OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)GX_VBlankIntr(TRUE); + + // 割り込み許可 + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); + + InitDEMOSystem(); + + (void)PAD_Read(); + + + + OS_TPrintf("UP DOWN - SELECT NCFG SLOT\n"); + OS_TPrintf("A - OVERWRITE NCFG\n"); + + + MainLoop(); + + OS_Terminate(); +} + +static u32 UpdateCursor(u32 val, u32 max, u16 key) +{ + if(key & PAD_KEY_DOWN) + { + val = (val + 1) % max; + } + if(key & PAD_KEY_UP) + { + val = (val + max - 1) % max; + } + return val; +} + +static void MainLoop(void) +{ + u32 index = 0; + s32 slot_index[] = + { + NCFG_SLOT_1, + NCFG_SLOT_2, + NCFG_SLOT_3, + NCFG_SLOT_EX_1, + NCFG_SLOT_EX_2, + NCFG_SLOT_EX_3, + }; + u16 key = 0, old_key = 0, trig = 0; + + while(1) + { + s32 i = 0; + + old_key = key; + key = PAD_Read(); + trig = (u16)(key & (key ^ old_key)); + + index = UpdateCursor(index, SLOT_NUM, trig); + if(trig & PAD_BUTTON_A) + { + WriteNCFG(slot_index[index]); + OS_TPrintf("%s was modified\n", SLOT_NAME[index]); + } + + for(i = 0; i < SLOT_NUM; ++i) + { + + DEMODrawText(0, i * 8, ((index == i) ? "*" : " ")); + DEMODrawText(8, i * 8, "%s\n", SLOT_NAME[i]); + } + DEMO_DrawFlip(); + OS_WaitVBlankIntr(); + } +} + +static void ReadNCFG(s32 index, u8* out) +{ + static u8 buf[512]; + FSFile fp; + s32 result; + + FS_InitFile(&fp); + + result = NCFG_ReadBackupMemory(buf, sizeof(buf), index); + OS_TPrintf("NCFG_ReadBackupMemory(%d): %d\n", index, result); + if ( result >= 0 ) + { + // OS_TPrintfEx("% *.16b", result, buf); + OS_TPrintfEx("% 256.16b", buf); + OS_TPrintf("\n"); + } + + MI_CpuCopy8(buf, out, sizeof(buf)); +} + +static void WriteNCFG(s32 index) +{ + static u8 buf[512]; + s32 result; + + ReadNCFG(index, buf); + MI_CpuCopy("abcdefg", buf, 7); + result = NCFG_WriteBackupMemory(index, buf, sizeof(buf)); + OS_TPrintf("NCFG_WriteBackupMemory(%d): %d\n", index, result); + OS_TPrintfEx("% 256.16b", buf); + OS_TPrintf("\n"); +} + +/*---------------------------------------------------------------------------* + Name: InitDEMOSystem + + Description: コンソールの画面出力用の表示設定を行います。 + + Arguments: なし。 + + Returns: なし。 + *---------------------------------------------------------------------------*/ +static void InitDEMOSystem(void) +{ + // 画面表示の初期化。 + DEMOInitCommon(); + DEMOInitVRAM(); + DEMOInitDisplayBitmap(); + DEMOHookConsole(); + DEMOSetBitmapTextColor(GX_RGBA(31, 31, 31, 1)); + DEMOSetBitmapGroundColor(DEMO_RGB_CLEAR); + DEMOStartDisplay(); +} diff --git a/build/debugsoft/Jpeg/Makefile b/build/debugsoft/Jpeg/Makefile new file mode 100644 index 00000000..3124add1 --- /dev/null +++ b/build/debugsoft/Jpeg/Makefile @@ -0,0 +1,34 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL NITRO + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------------------------------------------------- + +SUBDIRS = SdToPhoto + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/Jpeg/SdToPhoto/Makefile b/build/debugsoft/Jpeg/SdToPhoto/Makefile new file mode 100644 index 00000000..3707d142 --- /dev/null +++ b/build/debugsoft/Jpeg/SdToPhoto/Makefile @@ -0,0 +1,138 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tools - NandFiler +# 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.cpp +TARGET_NAME = sd2photo +TWLNMENU_ROOT ?= . + + +#------------------------- +#-- バナーデータを生成します +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)$(ROM_SPEC_NAME_PART).autogen.rsf +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf +ROM_SPEC_PARAM = MakerCode=01 \ + GameCode=4S01 \ + Secure=TRUE \ + BannerFile=./banner/banner.bnr \ + NANDAccess=TRUE \ + SDCardAccess=TRUE \ + TitleName=$(TARGET_NAME) + +#------------------------- +#-- CARD, NANDによるオプションの指定 + +TWL_NANDAPP = TRUE + +ifeq ($(APP_TYPE),) +APP_TYPE = CARD +endif + +ifeq ($(APP_TYPE),CARD) +MEDIA = GameCard +SUFFIX = .srl +endif + +ifeq ($(APP_TYPE),NAND) +MEDIA = NAND +SUFFIX = .tad +ROM_SPEC_NAME_PART := $(ROM_SPEC_NAME_PART).nand +endif + +ROM_SPEC_PARAM += Media=$(MEDIA) +TARGET_BIN = $(TARGET_NAME)$(SUFFIX) + +#------------------------- +# 対象拡張子のためのインクルードファイルを決定 +ifneq ($(SUFFIX_DEFINE),) +SUFFIX_FILE = $(SUFFIX_DEFINE) +else +SUFFIX_FILE = default_suffix.h +endif + + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#------------------------- +# セキュア用 +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe +MAKETAD_OPTION := -s + + +#------------------------- +# ビルドパラメータ +INCDIR = $(TWLSYSTEM_ROOT)/include \ + ./include + + +#------------------------- +# インストール指定 + +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/$(TARGET_NAME) +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + +#------------------------- +# 対象拡張子のためのインクルードファイルをビルドディレクトリにコピー +.PHONY: suffix + +suffix: + cp $(SUFFIX_FILE) ./include/suffix.h + +#------------------------- +# ビルド +do-build: suffix $(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/build/debugsoft/Jpeg/SdToPhoto/banner/banner.bnr b/build/debugsoft/Jpeg/SdToPhoto/banner/banner.bnr new file mode 100644 index 00000000..c299ae43 Binary files /dev/null and b/build/debugsoft/Jpeg/SdToPhoto/banner/banner.bnr differ diff --git a/build/debugsoft/Jpeg/SdToPhoto/default_suffix.h b/build/debugsoft/Jpeg/SdToPhoto/default_suffix.h new file mode 100644 index 00000000..9e83a577 --- /dev/null +++ b/build/debugsoft/Jpeg/SdToPhoto/default_suffix.h @@ -0,0 +1,9 @@ +namespace{ + const char* SUFFIX[] = + { + ".jpg", + ".jpeg", + ".JPG", + ".JPEG", + }; +} \ No newline at end of file diff --git a/build/debugsoft/Jpeg/SdToPhoto/readme.txt b/build/debugsoft/Jpeg/SdToPhoto/readme.txt new file mode 100644 index 00000000..6bdf0cb0 --- /dev/null +++ b/build/debugsoft/Jpeg/SdToPhoto/readme.txt @@ -0,0 +1,28 @@ +sd2photo + +*概要 +  SDカード内を走査して、指定した拡張子のファイルを探し、 +  "photo:/"以下へコピーするツールです。 + +*拡張子の指定方法 + コピー対象とする拡張子を記述したファイルをビルド時に指定します。 + 具体的な指定はmake時に下記の変数を渡すことで行ってください。 + + SUFFIX_DEFINE=hoge + + 省略すると、default_suffix.h が指定されます。(".jpg", ".jpeg", ".JPG", "JPEG"に対応します。) + +*操作方法 +  SDカードを挿入した状態でデバッガ等で起動してください。 + (SDを指さずに起動すると画面が赤くなり、SDが挿されるまで待ちます) + +  自動的に、ファイルの検索とコピーが始まります。 +   +  検索、コピー中は、画面の色が緑色になっています。 +  (SDを抜いたり電源を切ったりしないほうが無難です。) +  処理が終わったら青色になります。 + +*仕様 +  ・フォルダ構成をそのままコピーします。例えば、SD上で"/test/aa.jpg"があったとすれば、NAND上で"photo:/test/aa.jpg"が作成されます。 +  ・NAND上に同名のファイルが存在する場合、問答無用に上書きされます。 +  ・残り容量が少ない場合、上書きになる場合でもファイルをコピーできないことがあります。 diff --git a/build/debugsoft/Jpeg/SdToPhoto/src/main.cpp b/build/debugsoft/Jpeg/SdToPhoto/src/main.cpp new file mode 100644 index 00000000..0c5502cc --- /dev/null +++ b/build/debugsoft/Jpeg/SdToPhoto/src/main.cpp @@ -0,0 +1,286 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tools - NandFiler + File: main.cpp + + 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 +#include +#include + +#include +#include +#include "suffix.h" + +inline void* operator new(size_t size) { return OS_Alloc(size); } +inline void* operator new[](size_t size) { return OS_Alloc(size); } +inline void operator delete(void* ptr) { OS_Free(ptr); } +inline void operator delete[](void* ptr) { OS_Free(ptr); } + +typedef std::list PathList; + +namespace +{ + void + InitInterrupt(void) + { + OS_EnableIrq(); + OS_EnableInterrupts(); + } + + 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(); +static void InitFileSystem(); + +static void PickupTargetPath(const char* root, const char* suffix, PathList& out); +static void CopyTarget(const char* to, const char* header, PathList& out); +static void CopyFile(const char* src, const char* dest); + +void +TwlStartUp() +{ + OS_Init(); + InitAlloc(); +} + + +/*---------------------------------------------------------------------------* + Name: TwlMain + + Description: メイン関数です。 + + Arguments: なし。 + + Returns: なし。 + *---------------------------------------------------------------------------*/ +void TwlMain(void) +{ + InitInteruptSystem(); + InitFileSystem(); + + GX_DispOn(); + GXS_DispOn(); + + // SDがささってなかったら刺さるまで待つ + { + FSArchiveResource res; + while(!FS_GetArchiveResource("sdmc:/", &res)) + { + *(u16*)HW_PLTT = static_cast(0x001f); + *(u16*)HW_DB_PLTT = static_cast(0x001f); + } + } + + PathList path; + + for(u32 i = 0; i < sizeof(SUFFIX) / sizeof(char*); ++i) + { + PickupTargetPath("sdmc:/", SUFFIX[i], path); + } + CopyTarget("nand2:/photo", "sdmc:", path); + + + *(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); +} + + +/*---------------------------------------------------------------------------* + Name: InitFileSystem + + Description: FS を初期化して rom にアクセスできるようにします。 + この関数を呼び出す前に InitInteruptSystem() が + 呼ばれている必要があります。 + + Arguments: なし。 + + Returns: なし。 + *---------------------------------------------------------------------------*/ +static void InitFileSystem() +{ + // ARM7との通信FIFO割り込み許可 + (void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV); + + // ファイルシステム初期化 + FS_Init( FS_DMA_NOT_USE ); +} + + +static void PickupTargetPath(const char* root, const char* suffix, PathList& out) +{ + FSFile fp; + FSDirectoryEntryInfo fdei; + BOOL result; + + FS_InitFile(&fp); + // ディレクトリのオープン + result = FS_OpenDirectory(&fp, root, NULL); + if(!result) + { + OS_TPrintf("%s: Fail Open\nErrorCode:%d\n", root, FS_GetArchiveResultCode(root)); + return; + } + + while(FS_ReadDirectory(&fp, &fdei)) + { + if(STD_StrCmp(fdei.longname, ".") == 0 || STD_StrCmp(fdei.longname, "..") == 0) + continue; + + OS_TPrintf("%s:\n", fdei.longname); + // ディレクトリなら子を読む + if(fdei.attributes & FS_ATTRIBUTE_IS_DIRECTORY) + { + PickupTargetPath((std::string(root) + fdei.longname + "/").c_str(), suffix, out); + } + else // ファイルならoutに追加 + { + // 拡張子を判定 + if(std::string(fdei.longname).rfind(suffix) + STD_StrLen(suffix) == STD_StrLen(fdei.longname)) + { + out.push_back(std::string(root) + fdei.longname); + } + } + } + + FS_CloseDirectory(&fp); + +} + +static void CopyTarget(const char* to, const char* header, PathList& list) +{ + PathList::iterator itr = list.begin(), end = list.end(); + u16 color = 0; + for(; itr != end; ++itr) + { + std::string dest = std::string(to) + (*itr).substr(static_cast(STD_StrLen(header))); + + CopyFile((*itr).c_str(), dest.c_str()); + color = static_cast((color + 2) & 0x001f); + *(u16*)HW_PLTT = static_cast(color << 5); + *(u16*)HW_DB_PLTT = static_cast(color << 5); + } +} + +static void CopyFile(const char* src, const char* dest) +{ + FSFile sfp, dfp; + BOOL result; + std::string tmp_name = dest; + + tmp_name += "___tmp"; + + OS_TPrintf("Copying %s...", dest); + + // テンポラリファイルにコピー + FS_DeleteFile(tmp_name.c_str()); + result = FS_CreateFileAuto(tmp_name.c_str(), FS_PERMIT_R | FS_PERMIT_W); +// result = FS_CreateFileAuto(dest, FS_PERMIT_R | FS_PERMIT_W); + if(!result) + { + OS_TPrintf("%s:Cant create\n", tmp_name.c_str()); + return; + } + + result = FS_OpenFileEx(&sfp, src, FS_FILEMODE_R); + if(!result) + { + OS_TPrintf("%s:Cant open\n", src); + return; + } + + result = FS_OpenFileEx(&dfp, tmp_name.c_str(), FS_FILEMODE_W); + if(!result) + { + OS_TPrintf("%s:Cant open\n", src); + FS_CloseFile(&sfp); + return; + } + + const u32 BUFSIZE = 4096; + u8 buf[BUFSIZE]; + s32 count = 0; + while((count = FS_ReadFile(&sfp, buf, BUFSIZE)) > 0) + { + s32 write = FS_WriteFile(&dfp, buf, count); + if(write <= 0) + { + OS_TPrintf("Cant Write\n"); + FS_CloseFile(&sfp); + FS_CloseFile(&dfp); + FS_DeleteFile(tmp_name.c_str()); + return; + } + } + + FS_CloseFile(&sfp); + FS_CloseFile(&dfp); + + // テンポラリファイルをリネーム + // すでにファイルが存在するなら削除 + FS_DeleteFileAuto(dest); + FS_RenameFile(tmp_name.c_str(), dest); + + OS_TPrintf("...ok\n"); +} + diff --git a/build/debugsoft/KeyCheck/Dev/armadillo_set0.srl b/build/debugsoft/KeyCheck/Dev/armadillo_set0.srl new file mode 100644 index 00000000..c3b8101e Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/armadillo_set0.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/armadillo_set1.srl b/build/debugsoft/KeyCheck/Dev/armadillo_set1.srl new file mode 100644 index 00000000..41454f33 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/armadillo_set1.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/armadillo_set2.srl b/build/debugsoft/KeyCheck/Dev/armadillo_set2.srl new file mode 100644 index 00000000..1059b85f Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/armadillo_set2.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/armadillo_set3.srl b/build/debugsoft/KeyCheck/Dev/armadillo_set3.srl new file mode 100644 index 00000000..96a7fa05 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/armadillo_set3.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/armadillo_set4.srl b/build/debugsoft/KeyCheck/Dev/armadillo_set4.srl new file mode 100644 index 00000000..7a103aa6 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/armadillo_set4.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/armadillo_set5.srl b/build/debugsoft/KeyCheck/Dev/armadillo_set5.srl new file mode 100644 index 00000000..7f706ebf Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/armadillo_set5.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/armadillo_set6.srl b/build/debugsoft/KeyCheck/Dev/armadillo_set6.srl new file mode 100644 index 00000000..e98c1942 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/armadillo_set6.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/mongoose_set2.srl b/build/debugsoft/KeyCheck/Dev/mongoose_set2.srl new file mode 100644 index 00000000..def6ba70 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/mongoose_set2.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/mongoose_set3.srl b/build/debugsoft/KeyCheck/Dev/mongoose_set3.srl new file mode 100644 index 00000000..5e79f94d Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/mongoose_set3.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/mongoose_set4.srl b/build/debugsoft/KeyCheck/Dev/mongoose_set4.srl new file mode 100644 index 00000000..7b38ed22 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/mongoose_set4.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/mongoose_set5.srl b/build/debugsoft/KeyCheck/Dev/mongoose_set5.srl new file mode 100644 index 00000000..4faf26e0 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/mongoose_set5.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/mongoose_set6.srl b/build/debugsoft/KeyCheck/Dev/mongoose_set6.srl new file mode 100644 index 00000000..bd8a9d41 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/mongoose_set6.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/racoon_set2.srl b/build/debugsoft/KeyCheck/Dev/racoon_set2.srl new file mode 100644 index 00000000..eb42d0d8 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/racoon_set2.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/racoon_set3.srl b/build/debugsoft/KeyCheck/Dev/racoon_set3.srl new file mode 100644 index 00000000..1980084e Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/racoon_set3.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/racoon_set4.srl b/build/debugsoft/KeyCheck/Dev/racoon_set4.srl new file mode 100644 index 00000000..27d56f8d Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/racoon_set4.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/racoon_set5.srl b/build/debugsoft/KeyCheck/Dev/racoon_set5.srl new file mode 100644 index 00000000..a8e2d1b9 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/racoon_set5.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/racoon_set6.srl b/build/debugsoft/KeyCheck/Dev/racoon_set6.srl new file mode 100644 index 00000000..96cdd865 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/racoon_set6.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/tarsier_set2.srl b/build/debugsoft/KeyCheck/Dev/tarsier_set2.srl new file mode 100644 index 00000000..d9e10af8 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/tarsier_set2.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/tarsier_set3.srl b/build/debugsoft/KeyCheck/Dev/tarsier_set3.srl new file mode 100644 index 00000000..e93d4697 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/tarsier_set3.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/tarsier_set4.srl b/build/debugsoft/KeyCheck/Dev/tarsier_set4.srl new file mode 100644 index 00000000..cea13a31 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/tarsier_set4.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/tarsier_set5.srl b/build/debugsoft/KeyCheck/Dev/tarsier_set5.srl new file mode 100644 index 00000000..70d0f78c Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/tarsier_set5.srl differ diff --git a/build/debugsoft/KeyCheck/Dev/tarsier_set6.srl b/build/debugsoft/KeyCheck/Dev/tarsier_set6.srl new file mode 100644 index 00000000..bf9f3126 Binary files /dev/null and b/build/debugsoft/KeyCheck/Dev/tarsier_set6.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/armadillo_set0.srl b/build/debugsoft/KeyCheck/Prod/armadillo_set0.srl new file mode 100644 index 00000000..ede06b83 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/armadillo_set0.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/armadillo_set1.srl b/build/debugsoft/KeyCheck/Prod/armadillo_set1.srl new file mode 100644 index 00000000..98e62e7c Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/armadillo_set1.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/armadillo_set2.srl b/build/debugsoft/KeyCheck/Prod/armadillo_set2.srl new file mode 100644 index 00000000..21fe3d60 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/armadillo_set2.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/armadillo_set3.srl b/build/debugsoft/KeyCheck/Prod/armadillo_set3.srl new file mode 100644 index 00000000..12db7e22 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/armadillo_set3.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/armadillo_set4.srl b/build/debugsoft/KeyCheck/Prod/armadillo_set4.srl new file mode 100644 index 00000000..89b4086a Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/armadillo_set4.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/armadillo_set5.srl b/build/debugsoft/KeyCheck/Prod/armadillo_set5.srl new file mode 100644 index 00000000..979532be Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/armadillo_set5.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/armadillo_set6.srl b/build/debugsoft/KeyCheck/Prod/armadillo_set6.srl new file mode 100644 index 00000000..c939e469 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/armadillo_set6.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/mongoose_set2.srl b/build/debugsoft/KeyCheck/Prod/mongoose_set2.srl new file mode 100644 index 00000000..37218915 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/mongoose_set2.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/mongoose_set3.srl b/build/debugsoft/KeyCheck/Prod/mongoose_set3.srl new file mode 100644 index 00000000..ca289e05 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/mongoose_set3.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/mongoose_set4.srl b/build/debugsoft/KeyCheck/Prod/mongoose_set4.srl new file mode 100644 index 00000000..7fa5f3eb Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/mongoose_set4.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/mongoose_set5.srl b/build/debugsoft/KeyCheck/Prod/mongoose_set5.srl new file mode 100644 index 00000000..90500aa5 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/mongoose_set5.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/mongoose_set6.srl b/build/debugsoft/KeyCheck/Prod/mongoose_set6.srl new file mode 100644 index 00000000..69db2f21 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/mongoose_set6.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/racoon_set2.srl b/build/debugsoft/KeyCheck/Prod/racoon_set2.srl new file mode 100644 index 00000000..8916c5dd Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/racoon_set2.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/racoon_set3.srl b/build/debugsoft/KeyCheck/Prod/racoon_set3.srl new file mode 100644 index 00000000..cd90c658 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/racoon_set3.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/racoon_set4.srl b/build/debugsoft/KeyCheck/Prod/racoon_set4.srl new file mode 100644 index 00000000..073a68a6 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/racoon_set4.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/racoon_set5.srl b/build/debugsoft/KeyCheck/Prod/racoon_set5.srl new file mode 100644 index 00000000..3a37b511 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/racoon_set5.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/racoon_set6.srl b/build/debugsoft/KeyCheck/Prod/racoon_set6.srl new file mode 100644 index 00000000..44c72602 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/racoon_set6.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/tarsier_set2.srl b/build/debugsoft/KeyCheck/Prod/tarsier_set2.srl new file mode 100644 index 00000000..c093fa3a Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/tarsier_set2.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/tarsier_set3.srl b/build/debugsoft/KeyCheck/Prod/tarsier_set3.srl new file mode 100644 index 00000000..6c00ec6e Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/tarsier_set3.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/tarsier_set4.srl b/build/debugsoft/KeyCheck/Prod/tarsier_set4.srl new file mode 100644 index 00000000..e299cade Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/tarsier_set4.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/tarsier_set5.srl b/build/debugsoft/KeyCheck/Prod/tarsier_set5.srl new file mode 100644 index 00000000..3dd460e0 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/tarsier_set5.srl differ diff --git a/build/debugsoft/KeyCheck/Prod/tarsier_set6.srl b/build/debugsoft/KeyCheck/Prod/tarsier_set6.srl new file mode 100644 index 00000000..4f50af01 Binary files /dev/null and b/build/debugsoft/KeyCheck/Prod/tarsier_set6.srl differ diff --git a/build/debugsoft/Makefile b/build/debugsoft/Makefile new file mode 100644 index 00000000..ae8ed58c --- /dev/null +++ b/build/debugsoft/Makefile @@ -0,0 +1,38 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL NITRO + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------------------------------------------------- + +SUBDIRS = Jpeg \ + Wireless \ + Internet \ + ApplicationJump \ + TMPJump \ + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/MakerTitle/Makefile b/build/debugsoft/MakerTitle/Makefile new file mode 100644 index 00000000..c43a41b4 --- /dev/null +++ b/build/debugsoft/MakerTitle/Makefile @@ -0,0 +1,34 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL NITRO + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------------------------------------------------- + +SUBDIRS = SaveData \ + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/Makefile b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/Makefile new file mode 100644 index 00000000..0bb8d479 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/Makefile @@ -0,0 +1,188 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - save_data - DisplayVersion +# File: Makefile +# +# Copyright 2007 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 + +ifndef MODE +#------------------------------------------------------------------------ +# APP_TYPE の指定がないなら全てをビルドする + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +do-build: do-something-build +clean: do-something +clobber: do-something +install: do-something +do-build: MY_GOAL= +clean: MY_GOAL=clean +clobber: MY_GOAL=clobber +install: MY_GOAL=install + +do-something-build: + +$(REMAKE) TWLSDK_PLATFORM=TWL MODE=SEQURE SKIP_SUBDIR=FALSE $(MY_GOAL) + rm `find -name *.lcf` + rm -rf depend + rm -rf obj + +$(REMAKE) TWLSDK_PLATFORM=TWL MODE=USER SKIP_SUBDIR=FALSE $(MY_GOAL) + +do-something: + +$(REMAKE) TWLSDK_PLATFORM=TWL MODE=SEQURE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL MODE=USER SKIP_SUBDIR=FALSE $(MY_GOAL) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +else + + + +SUBDIRS = + + +#---------------------------------------------------------------------------- +TWL_NANDAPP := TRUE +MASTER_NAME := SaveDataTest +APP_NAME = $(MASTER_NAME)_$(MODE) + +SRCS = main.c font.c screen.c menu.c dataver.c + +LLIBRARIES = libnam$(TWL_LIBSUFFIX).a libes$(TWL_LIBSUFFIX).a \ + libsea$(TWL_LIBSUFFIX).a libboc$(TWL_LIBSUFFIX).a \ + libsfs$(TWL_LIBSUFFIX).a + +#------------------------- +#-- セキュアアプリ、ユーザアプリの切り替え + +ifeq ($(MODE),USER) +MACRO_FLAGS += -DUSER_MODE +APP_TYPE := User +SEQURE := FALSE +GAME_CODE := 4S5A +endif + +ifeq ($(MODE),SEQURE) +APP_TYPE := System +SEQURE := TRUE +GAME_CODE := 4S4A +endif + + +TARGET_BIN = $(APP_NAME).tad + + +#------------------------- +#-- NAND アプリではいくつかのパラメータの指定のために固有の RSF ファイルが必要です。 + +ROM_SPEC = dispver.$(MODE).autogen.rsf +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf +ROM_SPEC_PARAM = MakerCode=01 \ + TitleName=VER_CHECKER \ + GameCode=$(GAME_CODE) \ + BannerFile=./banner/banner_$(MODE).bnr \ + PublicSaveDataSize=16K \ + PrivateSaveDataSize=16K \ + WramMapping=MAP_TS_SCR \ + AppType=$(APP_TYPE) \ + Media=NAND \ + Secure=$(SEQURE) \ + + + +#------------------------- +#-- NAMを使うためにsecure componentを使う + +COMPONENT_NAME = armadillo +MAKEROM_ARM7_BASE = $(TWL_COMPONENTSDIR)/$(COMPONENT_NAME)/$(TWL_BUILDTYPE_ARM7)/$(COMPONENT_NAME) +MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).$(TWL_ELF_EXT) + +#------------------------- +# インストール指定 + +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/$(MASTER_NAME) +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + + +#------------------------- +#-- カードアプリと同様に ROM-FS にファイルを持たせます。 + +#MAKEROM_ROMROOT = ./rom_data +#MAKEROM_ROMFILES = *.* + +#------------------------- +#-- バナーデータを生成します +BANNER = ./banner/banner.bnr +BANNERSRC := $(wildcard ./banner/data/Cell/*.nce) +MAKEBANNER = $(TWL_TOOLSDIR)/bin/makebanner.TWL.exe +BANNERCVTR = $(TWL_TOOLSDIR)/bin/bannercvtr.exe + +#------------------------- +# rom 内のファイルは全て自動生成なので clean で削除されるようにします +LDIRT_CLEAN = $(MAKEROM_ROMROOT) + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +ifeq ($(MODE),USER) +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.exe # commondefs を include した後でなければならない +endif + +ifeq ($(MODE),SEQURE) +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe # commondefs を include した後でなければならない +MAKETAD_OPTION := -s # modulerules を include する前でなければならない +endif + +#---------------------------------------------------------------------------- + +#.PHONY: build_time + +do-build: $(TARGETS) + +#------------------------- +#-- SRL を作成する前にバナーが作成されるようにします。 + +$(BINDIR)/$(TARGET_BIN_BASENAME).$(TWL_ELF_EXT): make_dir +#$(BINDIR)/$(TARGET_BIN_BASENAME).$(TWL_ELF_EXT): make_dir $(BANNER) +#build_time + +#------------------------- +#-- rom_data/build_time.txt を作成します。 + +make_dir: + $(INSTALL) -d $(MAKEROM_ROMROOT) +#build_time: +# $(INSTALL) -d $(MAKEROM_ROMROOT) +# echo -n "build at `date \"+%Y/%m/%d %H:%M:%S\"` on \"`hostname`\"" > $(MAKEROM_ROMROOT)/build_time.txt + +#------------------------- +#-- バナー作成用ターゲット + +$(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 + +endif + +#===== End of Makefile ===== diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/banner/banner_SEQURE.bnr b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/banner/banner_SEQURE.bnr new file mode 100644 index 00000000..8c1a6972 Binary files /dev/null and b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/banner/banner_SEQURE.bnr differ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/banner/banner_USER.bnr b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/banner/banner_USER.bnr new file mode 100644 index 00000000..1383869a Binary files /dev/null and b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/banner/banner_USER.bnr differ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/dataver.h b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/dataver.h new file mode 100644 index 00000000..1ee7dfef --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/dataver.h @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: dataver.h + + 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$ + *---------------------------------------------------------------------------*/ + +#ifndef DATAVER_H_ +#define DATAVER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +void GetAppVersionString(char *str); +BOOL GetPublicDataInfoStrings(char *verstr, char *timestr, char *datestr); +BOOL GetPrivateDataInfoStrings(char *verstr, char *timestr, char *datestr); +BOOL SetPublicDataTimeStamp(void); +BOOL SetPrivateDataTimeStamp(void); + +s32 GetOutNandAppInfo(void); +s32 GetOurNandAppNum(void); +BOOL GetOurNandAppVersionString(s32 no, char *verstr, char *inistr); +BOOL GetOurNandAppPublicDataInfoStrings(s32 no, char *verstr, char *timestr, char *datestr); +BOOL GetOurNandAppPrivateDataInfoStrings(s32 no, char *verstr, char *timestr, char *datestr); +BOOL SetOurNandAppPublicDataTimeStamp(s32 no); +BOOL SetOurNandAppPrivateDataTimeStamp(s32 no); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* DATAVER_H_ */ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/font.h b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/font.h new file mode 100644 index 00000000..a323d9e1 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/font.h @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef FONT_H_ +#define FONT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ + +#include + +extern const u32 d_CharData[8 * 256]; +extern const u32 d_PaletteData[8 * 16]; + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* FONT_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/menu.h b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/menu.h new file mode 100644 index 00000000..8c9f7238 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/menu.h @@ -0,0 +1,75 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: menu.h + + 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$ + *---------------------------------------------------------------------------*/ + +#ifndef MENU_H_ +#define MENU_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ + +#include + +//メニューに関する定義 +#define MENU_DEPTH_NUM 2 +#define MENU_ITEM_NUM 11 +#define MENU_ITEM_STRLEN 24 + +//ChangeMenuItemのパラメータ +#define MENU_ITEM_UP 0 +#define MENU_ITEM_DOWN 1 +#define MENU_DEPTH_UP 2 +#define MENU_DEPTH_DOWN 3 + + +typedef struct { + s16 nNext; // -1: これ以上枝はない + //char cItemStr[MENU_ITEM_STRLEN]; + char *cItemStr; +}menu_item_t; + +typedef struct { + s16 nPrev; // -1: 自分が親 + menu_item_t sItem[MENU_ITEM_NUM]; +}menu_sheet_t; + + +void DisplayMenuSet(void); +void InitMenu(void); +void ChangeMenuItem(u16 action); +void ExecMenuItem(void); +void ExecMenuItemB(void); +void ExecMenuItemX(void); +void ExecMenuItemRight(void); +void ExecMenuItemLeft(void); +void ExitMenuCancel(void); +void SetMenuString(u32 depth, u32 ipos, char *str); +void SetCurrentMenuString(char *str); + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* MENU_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/screen.h b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/screen.h new file mode 100644 index 00000000..39b44f73 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/include/screen.h @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: screen.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef SCREEN_H_ +#define SCREEN_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +#include + +extern u16 gScreen[32 * 32]; + +void ClearScreen(void); +void PrintString(s16 x, s16 y, u8 palette, char *text, ...); +void ColorString(s16 x, s16 y, s16 length, u8 palette); + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* SCREEN_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/readme.txt b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/readme.txt new file mode 100644 index 00000000..4076b863 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/readme.txt @@ -0,0 +1,21 @@ +セーブデータバージョンチェックソフト + +このソフトはセーブデータのインポート・エクスポートを確認するためのソフトです。 +以下のことをします。 + ・アプリバージョンを表示する + ・アプリバージョンをパブリックセーブデータ・プライベートセーブデータに保存する + ・各セーブデータに保存したバージョン番号およびタイムスタンプを表示する + +これを使うことでアプリバージョンが変わった時のセーブデータの挙動を確認することができます。 + +【使い方】 +・ソフトを起動すると以下の表示を行います +  アプリバージョン +  パブリックセーブデータに保存したバージョン番号およびタイムスタンプ +  プライベートセーブデータに保存したバージョン番号およびタイムスタンプ +・矢印↑↓で項目を選択しAボタンを押すと該当するセーブデータを書き換えます +・Xボタンを押すと全セーブデータを書き換えます + +【制限事項】 +書き換えを実行してもタイムスタンプに2秒以内の時間のずれが発生します +(ファイルシステムは2秒間隔でしか設定しないため) diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/dataver.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/dataver.c new file mode 100644 index 00000000..0cd30162 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/dataver.c @@ -0,0 +1,601 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: dataver.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 "dataver.h" +#include +#include +#include +#include + +//#define ACCESS_TEST_1 +//#define ACCESS_TEST_2 +//#define ACCESS_TEST_3 +//#define ACCESS_TEST_4 +//#define ACCESS_TEST_5 + +#define PUBDATA_VERSION_PATH "dataPub:/version" +#define PRVDATA_VERSION_PATH "dataPrv:/version" +#define OTHER_PUBDATA_VERSION_PATH "otherPub:/version" +#define OTHER_PRVDATA_VERSION_PATH "otherPrv:/version" +#define VERSION_LEN 3 +#define OUR_COMPANY_CODE 0x3031 // "01" : Nintendo +#define SELF_INITIAL_CODE 0x34564341 //"4VCA" + +static BOOL getDataInfoStrings(char *path, char *verstr, char *timestr, char *datestr); +static BOOL setDataTimeStamp(char *path); +static BOOL setOurNandAppDataTimeStamp(s32 no, BOOL pub); + +FSResult g_fs_result; +static s32 g_title_num; +static NAMTitleId g_title[40]; + +#ifdef USER_MODE +static const char* TARGET_APP = "4VDA"; +#endif + +void GetAppVersionString(char *str) +{ + u8 *pHeader, version; + + pHeader = (u8*)HW_TWL_ROM_HEADER_BUF; + version = *(pHeader + 0x1e); + + str[0] = (char)(version / 100 + 0x30); + str[1] = (char)((version % 100) / 10 + 0x30); + str[2] = (char)(version % 10 + 0x30); + str[3] = '\0'; +} + +BOOL GetPublicDataInfoStrings(char *verstr, char *timestr, char *datestr) +{ + return getDataInfoStrings(PUBDATA_VERSION_PATH, verstr, timestr, datestr); +} + +static BOOL getDataInfoStrings(char *path, char *verstr, char *timestr, char *datestr) +{ + FSFile file; + FSPathInfo info; + FSResult fresult; + + FS_InitFile( &file ); + + if( !FS_GetPathInfo(path, &info) ) + { + fresult = FS_GetArchiveResultCode(path); + return FALSE; + } + + STD_TSPrintf( timestr, "%04d/%02d/%02d", + info.mtime.year, info.mtime.month, info.mtime.day ); + STD_TSPrintf( datestr, "%02d:%02d:%02d", + info.mtime.hour, info.mtime.minute, info.mtime.second ); + + if( FS_OpenFileEx( &file, path, FS_FILEMODE_R ) == FALSE ) + { + return FALSE; + } + + if( FS_ReadFile( &file, verstr, VERSION_LEN ) != VERSION_LEN ) + { + return FALSE; + } + verstr[VERSION_LEN] = '\0'; + + if( FS_CloseFile( &file ) == FALSE ) + { + return FALSE; + } + + return TRUE; +} + +BOOL GetPrivateDataInfoStrings(char *verstr, char *timestr, char *datestr) +{ + return getDataInfoStrings(PRVDATA_VERSION_PATH, verstr, timestr, datestr); +} + +BOOL SetPublicDataTimeStamp() +{ + return setDataTimeStamp(PUBDATA_VERSION_PATH); +} + +static BOOL setDataTimeStamp(char *path) +{ + FSFile file; + //FSPathInfo info; + char verstr[8]; + FSResult fresult; + + GetAppVersionString( verstr ); + + FS_InitFile( &file ); + + if( FS_OpenFileEx( &file, path, FS_FILEMODE_W ) == FALSE ) + { + if( !FS_CreateFile(path, FS_PERMIT_R | FS_PERMIT_W) ) + { + fresult = FS_GetArchiveResultCode(path); + g_fs_result = fresult; + return FALSE; + } + if( FS_OpenFileEx( &file, path, FS_FILEMODE_W ) == FALSE ) + { + return FALSE; + } + } + + if( FS_WriteFile( &file, verstr, VERSION_LEN ) != VERSION_LEN ) + { + return FALSE; + } + + if( FS_CloseFile( &file ) == FALSE ) + { + return FALSE; + } + + return TRUE; +} + +BOOL SetPrivateDataTimeStamp() +{ + return setDataTimeStamp(PRVDATA_VERSION_PATH); +} + +s32 GetOutNandAppInfo(void) +{ + s32 i, j; + s32 appnum, ret; + NAMTitleInfo info; + NAMTitleId tmptitle[40]; + + NAM_Init(OS_AllocFromMain, OS_FreeToMain); + + appnum = NAM_GetNumTitles(); + if( appnum < 0 ) + return -1; + ret = NAM_GetTitleList( tmptitle, 40 ); + if( ret != NAM_OK ) + return -2; + for( i=0, j=0; i= g_title_num ) + return FALSE; + + // 該当NANDアプリのバージョンを得る + if( NAM_ReadTitleInfo( &info, g_title[no] ) != NAM_OK ) + return FALSE; + + // str に返す + //OS_TPrintf("app ver = 0x%x\n", info.version); + verstr[0] = (char)(info.version / 100 + 0x30); + verstr[1] = (char)((info.version % 100) / 10 + 0x30); + verstr[2] = (char)(info.version % 10 + 0x30); + verstr[3] = '\0'; + + ini = NAM_GetTitleIdLo(g_title[no]); + *(u32*)inistr = MI_SwapEndian32(ini); + inistr[4] = '\0'; + + return TRUE; +} + +static BOOL getOtherNandAppDataInfoStrings(s32 no, BOOL pub, char *verstr, char *timestr, char *datestr) +{ + BOOL ret = FALSE; + FSFile file; + FSPathInfo info; + FSResult fresult; + u32 ini; + NATitleArchive arc; + char *path; + const char pubpath[] = OTHER_PUBDATA_VERSION_PATH; + const char prvpath[] = OTHER_PRVDATA_VERSION_PATH; + + ini = MI_SwapEndian32( NAM_GetTitleIdLo(g_title[no]) ); + arc = pub ? NA_TITLE_ARCHIVE_DATAPUB : NA_TITLE_ARCHIVE_DATAPRV; +#ifdef USER_MODE + if( NA_LoadOtherTitleArchive( TARGET_APP, arc ) != FS_RESULT_SUCCESS ) + return FALSE; +#else + if( NA_LoadOtherTitleArchive( (char*)&ini, arc ) != FS_RESULT_SUCCESS ) + return FALSE; +#endif + path = pub ? (char*)pubpath : (char*)prvpath; + + FS_InitFile( &file ); + + if( !FS_GetPathInfo(path, &info) ) + { + fresult = FS_GetArchiveResultCode(path); + goto quit; + } + + STD_TSPrintf( timestr, "%04d/%02d/%02d", + info.mtime.year, info.mtime.month, info.mtime.day ); + STD_TSPrintf( datestr, "%02d:%02d:%02d", + info.mtime.hour, info.mtime.minute, info.mtime.second ); + + if( FS_OpenFileEx( &file, path, FS_FILEMODE_R ) == FALSE ) + { + goto quit; + } + + if( FS_ReadFile( &file, verstr, VERSION_LEN ) != VERSION_LEN ) + { + goto quit; + } + verstr[VERSION_LEN] = '\0'; + + if( FS_CloseFile( &file ) == FALSE ) + { + goto quit; + } + + ret = TRUE; + +quit: + NA_UnloadOtherTitleArchive(); + + return ret; +} + +BOOL GetOurNandAppPublicDataInfoStrings(s32 no, char *verstr, char *timestr, char *datestr) +{ + return getOtherNandAppDataInfoStrings(no, TRUE, verstr, timestr, datestr ); +} + +BOOL GetOurNandAppPrivateDataInfoStrings(s32 no, char *verstr, char *timestr, char *datestr) +{ + return getOtherNandAppDataInfoStrings(no, FALSE, verstr, timestr, datestr ); +} + + +static BOOL setOurNandAppDataTimeStamp(s32 no, BOOL pub) +{ + BOOL ret = FALSE; + FSFile file; + char verstr[8]; + //char inistr[8]; + FSResult fresult; + u32 ini; + NATitleArchive arc; + char *path; + const char pubpath[] = OTHER_PUBDATA_VERSION_PATH; + const char prvpath[] = OTHER_PRVDATA_VERSION_PATH; + + //GetOurNandAppVersionString( no, verstr, inistr ); + GetAppVersionString( verstr ); + ini = MI_SwapEndian32( NAM_GetTitleIdLo(g_title[no]) ); + + arc = pub ? NA_TITLE_ARCHIVE_DATAPUB : NA_TITLE_ARCHIVE_DATAPRV; +#ifdef USER_MODE + if( NA_LoadOtherTitleArchive( TARGET_APP, arc ) != FS_RESULT_SUCCESS ) + goto quit; +#else + if( NA_LoadOtherTitleArchive( (char*)&ini, arc ) != FS_RESULT_SUCCESS ) + goto quit; +#endif + path = pub ? (char*)pubpath : (char*)prvpath; + + FS_InitFile( &file ); + + if( FS_OpenFileEx( &file, path, FS_FILEMODE_W ) == FALSE ) + { + if( !FS_CreateFile(path, FS_PERMIT_R | FS_PERMIT_W) ) + { + fresult = FS_GetArchiveResultCode(path); + g_fs_result = fresult; + goto quit; + } + if( FS_OpenFileEx( &file, path, FS_FILEMODE_W ) == FALSE ) + { + goto quit; + } + } + + if( FS_WriteFile( &file, verstr, VERSION_LEN ) != VERSION_LEN ) + { + return FALSE; + } + + if( FS_CloseFile( &file ) == FALSE ) + { + goto quit; + } + + ret = TRUE; + +quit: + NA_UnloadOtherTitleArchive(); + + return ret; +} +BOOL SetOurNandAppPublicDataTimeStamp(s32 no) +{ + return setOurNandAppDataTimeStamp( no, TRUE ); +} + +BOOL SetOurNandAppPrivateDataTimeStamp(s32 no) +{ + return setOurNandAppDataTimeStamp( no, FALSE ); +} + +#if 0 +/* *INDENT-OFF* */ +static const char * const fs_result_strings[] = +{ + "FS_RESULT_SUCCESS", + "FS_RESULT_FAILURE", + "FS_RESULT_BUSY", + "FS_RESULT_CANCELED", + "FS_RESULT_UNSUPPORTED", + "FS_RESULT_ERROR", + "FS_RESULT_INVALID_PARAMETER", + "FS_RESULT_NO_MORE_RESOUCE", + "FS_RESULT_ALREADY_DONE", + "FS_RESULT_PERMISSION_DENIED", + "FS_RESULT_MEDIA_FATAL", + "FS_RESULT_NO_ENTRY", + "FS_RESULT_MEDIA_NOTHING", + "FS_RESULT_MEDIA_UNKNOWN", + "FS_RESULT_BAD_FORMAT", +}; +static const size_t fs_result_string_max = sizeof(fs_result_strings) / sizeof(*fs_result_strings); +SDK_COMPILER_ASSERT(fs_result_string_max == FS_RESULT_MAX); +/* *INDENT-ON* */ + +static void ReportLastErrorPath(const char *path) +{ + FSResult result = FS_GetArchiveResultCode(path); + + SDK_ASSERT((result >= 0) && (result < fs_result_string_max)); + OS_TPrintf("FS error:\n \"%s\"\n %s\n", + path, fs_result_strings[result]); +} + +static void ReportLastErrorFile(const FSFile *file) +{ + FSArchive *arc = FS_GetAttachedArchive(file); + FSResult result = FS_GetResultCode(file); + + SDK_ASSERT((result >= 0) && (result < fs_result_string_max)); + OS_TPrintf("FS error:\n (archive \"%s:\")\n %s\n", + FS_GetArchiveName(arc), fs_result_strings[result]); +} + +BOOL PubDataAccessTest(void) +{ + BOOL ret; + FSFile file, dir; + FSResult res; + FSArchiveResource resource; + static const char *testdir = "dataPub:/testdir"; + static const char *testfile = "dataPub:/testdir/test.txt"; + +#if defined(ACCESS_TEST_1) + FS_InitFile( &file ); + FS_InitFile( &dir ); + +#if 1 + if( FS_OpenDirectory( &dir, testdir, FS_FILEMODE_R | FS_FILEMODE_W ) ) + { + OS_TPrintf("%s already exists\n", testdir); + FS_CloseDirectory( &dir ); + } + else if( FS_CreateDirectory( testdir, FS_PERMIT_R | FS_PERMIT_W ) == FALSE ) + { + res = FS_GetArchiveResultCode( testdir ); + return FALSE; + } +#endif + +#if 1 + if( FS_CreateFile( testfile, FS_PERMIT_R | FS_PERMIT_W ) == FALSE ) + { + OS_TPrintf("dataPub:/testdir/test.txt already exists\n"); + //return FALSE; + } + + // dataPub:/testdir/test.txt を開いてみる + if( FS_OpenFileEx( &file, testfile, FS_FILEMODE_W ) == FALSE ) + { + return FALSE; + } + if( FS_CloseFile( &file ) == FALSE ) + { + return FALSE; + } +#endif +#elif defined(ACCESS_TEST_2) + if( FS_GetArchiveResource("rom:/", &resource) == FALSE ) + { + res = FS_GetArchiveResultCode( "dataPub:/" ); + return FALSE; + } +#elif defined(ACCESS_TEST_3) + { + FSArchive* FSi_GetArchiveChain(void); + FSArchive *arc; + + for (arc = FSi_GetArchiveChain(); arc ; arc = arc->next) + { + FSPathInfo info[1]; + char path[FS_ENTRY_LONGNAME_MAX]; + + OS_Printf("archive - %s\n", FS_GetArchiveName(arc)); + } + } +#elif defined(ACCESS_TEST_4) + { + static const char *basedir = "dataPub:/test"; + static const char *basedir2 = "dataPub:"; + char tmppath[FS_ENTRY_LONGNAME_MAX]; + FSArchiveResource resource; + static FSResult fresult; + + // at first, initialize FSFile structures. (equal to C++ constructor) + FSFile sfile[1]; + FSFile sdir[1]; + FS_InitFile(sfile); + FS_InitFile(sdir); + + if( !FS_GetArchiveResource(basedir2, &resource) ) + { + fresult = FS_GetArchiveResultCode(basedir2); + return FALSE; + } + + // DIRECTORY CREATION TEST + { + if (FS_OpenDirectory(sdir, basedir, FS_FILEMODE_R | FS_FILEMODE_W)) + { + OS_TPrintf("\"%s\" already exists.\n", basedir); + (void)FS_CloseDirectory(sdir); + } + else if (!FS_CreateDirectory(basedir, FS_PERMIT_R | FS_PERMIT_W)) + { + ReportLastErrorPath(basedir); + OS_TPanic("FS_CreateDirectory(\"%s\") failed.\n", basedir); + } + else + { + int i; + OS_TPrintf("FS_CreateDirectory(\"%s\") succeeded.\n", basedir); + for (i = 1; i <= 3; ++i) + { + (void)STD_TSPrintf(tmppath, "%s/dir%d", basedir, i); + if (!FS_CreateDirectory(tmppath, FS_PERMIT_R | FS_PERMIT_W)) + { + ReportLastErrorPath(tmppath); + OS_TPanic("FS_CreateDirectory(%s) failed.\n", tmppath); + } + else + { + OS_TPrintf("FS_CreateDirectory(%s) succeeded.\n", tmppath); + } + } + } + } + // DIRECTORY DELETION TEST + { + STD_TSPrintf(tmppath, "%s/tmp/", basedir); + if (!FS_CreateDirectory(tmppath, FS_PERMIT_R | FS_PERMIT_W)) + { + ReportLastErrorPath(tmppath); + OS_TPrintf("FS_CreateDirectory(\"%s\") failed.\n", tmppath); + } + if (!FS_DeleteDirectory(tmppath)) + { + ReportLastErrorPath(tmppath); + OS_TPanic("FS_DeleteDirectory(\"%s\") failed.\n", tmppath); + } + } + // DIRECTORY DELETE + if (!FS_DeleteDirectoryAuto(basedir)) + { + ReportLastErrorPath(basedir); + OS_TPanic("FS_DeleteDirectoryAuto(\"%s\") failed.\n", basedir); + } + } +#elif defined(ACCESS_TEST_5) + { + static const char *basedir = "dataPub:/test"; + char tmppath[FS_ENTRY_LONGNAME_MAX]; + + // at first, initialize FSFile structures. (equal to C++ constructor) + FSFile sfile[1]; + FSFile sdir[1]; + FS_InitFile(sfile); + FS_InitFile(sdir); + + // FILE CREATION TEST + { + enum { file_max = 3 }; + static const char *(message[file_max]) = + { + "hello, world!", + "foobar", + "hogehoge", + }; + int i; + for (i = 0; i < file_max; ++i) + { + STD_TSPrintf(tmppath, "%s/arm9%d.txt", basedir, i); + if (!FS_CreateFile(tmppath, FS_PERMIT_R | FS_PERMIT_W)) + { + ReportLastErrorPath(tmppath); + } + else + { + OS_TPrintf("FS_CreateFile(%s) succeeded.\n", tmppath); + if (!FS_OpenFileEx(sfile, tmppath, FS_FILEMODE_W)) + { + ReportLastErrorPath(tmppath); + OS_TPanic("FS_OpenFileEx(%s) failed.\n", tmppath); + } + else + { + if (FS_WriteFile(sfile, message[i], STD_GetStringLength(message[i])) < 0) + { + ReportLastErrorFile(sfile); + OS_TPanic("FS_WritFile() failed.\n"); + } + else + { + OS_TPrintf("FS_WritFile() succeeded.\n"); + } + } + (void)FS_CloseFile(sfile); + } + } + } + } +#endif + + return TRUE; +} +#endif diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/font.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/font.c new file mode 100644 index 00000000..30670436 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/font.c @@ -0,0 +1,574 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.c + + Copyright 2003 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 "font.h" + +//---------------------------------------------------------------- +// Character data +// +const u32 d_CharData[8 * 256] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01010010, 0x01010010, 0x00000110, // 0001h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x01011010, 0x01010010, 0x00010010, // 0002h + 0x00100010, 0x00100010, 0x00100001, 0x00100001, + 0x00000000, 0x01010001, 0x01010001, 0x01111111, // 0003h + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 0004h + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01010000, 0x01010100, 0x00001010, // 0005h + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011000, 0x01011000, 0x01111111, // 0006h + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01010010, 0x01101111, 0x01010010, // 0007h + 0x00010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x01010010, 0x01011111, 0x00000100, // 0008h + 0x00011111, 0x00001000, 0x00000001, 0x00011110, + 0x00000000, 0x01010000, 0x01011000, 0x00000110, // 0009h + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x01010000, 0x01111101, 0x00010001, // 000ah + 0x00010001, 0x00010001, 0x00010001, 0x00001010, + 0x00000000, 0x01010000, 0x01011110, 0x00100000, // 000bh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010100, 0x01011111, 0x00001000, // 000ch + 0x00010000, 0x00000001, 0x00000001, 0x00011110, + 0x00000000, 0x01010001, 0x01010001, 0x00000001, // 000dh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00011000, // 000eh + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x01010010, 0x01111111, 0x00010010, // 000fh + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00001110, 0x01010100, 0x01010010, // 0010h + 0x00111111, 0x00000100, 0x00000100, 0x00011000, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 0011h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x01010100, 0x01011111, 0x00000010, // 0012h + 0x00011110, 0x00100001, 0x00100000, 0x00011110, + 0x00000000, 0x01010000, 0x01011100, 0x00100011, // 0013h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00010000, // 0014h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x01010010, 0x01010010, 0x00001100, // 0015h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010001, 0x01111101, 0x00010001, // 0016h + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01010100, 0x01010011, 0x01110010, // 0017h + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01011110, 0x01011000, 0x00000100, // 0018h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01010000, 0x01011100, 0x00010010, // 0019h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011101, 0x01010001, 0x00111101, // 001ah + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x01110001, 0x01011101, 0x00110001, // 001bh + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01110100, 0x01010011, 0x00110010, // 001ch + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01101110, 0x01011000, 0x00100100, // 001dh + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01110000, 0x01011100, 0x00110010, // 001eh + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x01010001, 0x00111101, // 001fh + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0020h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 0021h + 0x00001000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x01101100, 0x01001000, 0x00100100, // 0022h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100100, 0x01111111, 0x00100100, // 0023h + 0x00100100, 0x01111111, 0x00010010, 0x00010010, + 0x00000000, 0x00001000, 0x01111110, 0x00001001, // 0024h + 0x00111110, 0x01001000, 0x00111111, 0x00001000, + 0x00000000, 0x01000010, 0x00100101, 0x00010010, // 0025h + 0x00001000, 0x00100100, 0x01010010, 0x00100001, + 0x00000000, 0x00001110, 0x00010001, 0x00001001, // 0026h + 0x01000110, 0x00101001, 0x00110001, 0x01001110, + 0x00000000, 0x00011000, 0x00010000, 0x00001000, // 0027h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01110000, 0x00001000, 0x00000100, // 0028h + 0x00000100, 0x00000100, 0x00001000, 0x01110000, + 0x00000000, 0x00000111, 0x00001000, 0x00010000, // 0029h + 0x00010000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x00001000, 0x01001001, 0x00101010, // 002ah + 0x00011100, 0x00101010, 0x01001001, 0x00001000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 002bh + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002ch + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002dh + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002eh + 0x00000000, 0x00000000, 0x00000000, 0x00001100, + 0x00000000, 0x01000000, 0x00100000, 0x00010000, // 002fh + 0x00001000, 0x00000100, 0x00000010, 0x00000001, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0030h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00011100, 0x00010000, 0x00010000, // 0031h + 0x00010000, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0032h + 0x00111110, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0033h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00100000, 0x00110000, 0x00101000, // 0034h + 0x00100100, 0x00100010, 0x01111111, 0x00100000, + 0x00000000, 0x01111111, 0x00000001, 0x00111111, // 0035h + 0x01000000, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x00000001, 0x00111111, // 0036h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00100000, 0x00100000, // 0037h + 0x00010000, 0x00010000, 0x00001000, 0x00001000, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0038h + 0x00111110, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0039h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003ah + 0x00000000, 0x00000000, 0x00001100, 0x00000000, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003bh + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x01100000, 0x00011000, 0x00000110, // 003ch + 0x00000001, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00000000, 0x01111111, 0x00000000, // 003dh + 0x00000000, 0x00000000, 0x01111111, 0x00000000, + 0x00000000, 0x00000011, 0x00001100, 0x00110000, // 003eh + 0x01000000, 0x00110000, 0x00001100, 0x00000011, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 003fh + 0x00110000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x00011100, 0x00100010, 0x01001001, // 0040h + 0x01010101, 0x01010101, 0x01010101, 0x00111010, + 0x00000000, 0x00001000, 0x00010100, 0x00010100, // 0041h + 0x00100010, 0x00111110, 0x01000001, 0x01000001, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0042h + 0x00111111, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0043h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x00011111, 0x00100001, 0x01000001, // 0044h + 0x01000001, 0x01000001, 0x00100001, 0x00011111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0045h + 0x01111111, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0046h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0047h + 0x01111001, 0x01000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0048h + 0x01111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x00001000, 0x00001000, // 0049h + 0x00001000, 0x00001000, 0x00001000, 0x00111110, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 004ah + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01100001, 0x00011001, 0x00000101, // 004bh + 0x00000011, 0x00000101, 0x00011001, 0x01100001, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 004ch + 0x00000001, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01000001, 0x01100011, 0x01010101, // 004dh + 0x01001001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x01000001, 0x01000011, 0x01000101, // 004eh + 0x01001001, 0x01010001, 0x01100001, 0x01000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 004fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0050h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 0051h + 0x01000001, 0x01011001, 0x00100010, 0x01011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0052h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x01000001, 0x00000001, // 0053h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00001000, 0x00001000, // 0054h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0055h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01000001, 0x01000001, 0x00100010, // 0056h + 0x00100010, 0x00010100, 0x00010100, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0057h + 0x01001001, 0x01010101, 0x01100011, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0058h + 0x00001000, 0x00010100, 0x00100010, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0059h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01111111, 0x00100000, 0x00010000, // 005ah + 0x00001000, 0x00000100, 0x00000010, 0x01111111, + 0x00000000, 0x01111100, 0x00000100, 0x00000100, // 005bh + 0x00000100, 0x00000100, 0x00000100, 0x01111100, + 0x00000000, 0x00100010, 0x00010100, 0x00111110, // 005ch + 0x00001000, 0x00111110, 0x00001000, 0x00001000, + 0x00000000, 0x00011111, 0x00010000, 0x00010000, // 005dh + 0x00010000, 0x00010000, 0x00010000, 0x00011111, + 0x00000000, 0x00001000, 0x00010100, 0x00100010, // 005eh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 005fh + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x00010000, 0x00001000, 0x00011000, // 0060h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00011110, 0x00100001, // 0061h + 0x00111110, 0x00100001, 0x00100001, 0x01011110, + 0x00000000, 0x00000001, 0x00000001, 0x00111111, // 0062h + 0x01000001, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00000000, 0x00111100, 0x01000010, // 0063h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000000, 0x01000000, 0x01111110, // 0064h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0065h + 0x01111111, 0x00000001, 0x01000001, 0x00111110, + 0x00000000, 0x00110000, 0x00001000, 0x00001000, // 0066h + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x01111110, 0x01000001, // 0067h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0068h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00001000, 0x00000000, 0x00001000, // 0069h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00100000, 0x00000000, 0x00100000, // 006ah + 0x00100000, 0x00100001, 0x00100001, 0x00011110, + 0x00000000, 0x00000001, 0x00000001, 0x01100001, // 006bh + 0x00011001, 0x00000111, 0x00011001, 0x01100001, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 006ch + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00110111, 0x01001001, // 006dh + 0x01001001, 0x01001001, 0x01001001, 0x01001001, + 0x00000000, 0x00000000, 0x00111111, 0x01000001, // 006eh + 0x01000001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00000000, 0x00011100, 0x00100010, // 006fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00000000, 0x00111101, 0x01000011, // 0070h + 0x01000001, 0x01000011, 0x00111101, 0x00000001, + 0x00000000, 0x00000000, 0x01011110, 0x01100001, // 0071h + 0x01000001, 0x01100001, 0x01011110, 0x01000000, + 0x00000000, 0x00000000, 0x00110001, 0x00001101, // 0072h + 0x00000011, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0073h + 0x00001110, 0x00110000, 0x01000001, 0x00111110, + 0x00000000, 0x00000100, 0x00000100, 0x01111111, // 0074h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0075h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0076h + 0x00100010, 0x00100010, 0x00010100, 0x00001000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0077h + 0x01001001, 0x00101010, 0x00101010, 0x00010100, + 0x00000000, 0x00000000, 0x00100001, 0x00010010, // 0078h + 0x00001100, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0079h + 0x00100010, 0x00011100, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111111, 0x00010000, // 007ah + 0x00001000, 0x00000100, 0x00000010, 0x00111111, + 0x00000000, 0x00001000, 0x00011110, 0x01100100, // 007bh + 0x00011000, 0x00100100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x00011110, 0x00000100, // 007ch + 0x00011110, 0x00110101, 0x00101101, 0x00010010, + 0x00000000, 0x00000000, 0x00000000, 0x00010001, // 007dh + 0x00100001, 0x00100001, 0x00000001, 0x00000010, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007eh + 0x00011110, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007fh + 0x00111110, 0x00010000, 0x00001100, 0x00110010, + 0x00000000, 0x00000000, 0x00000100, 0x00101111, // 0080h + 0x01000100, 0x00011110, 0x00100101, 0x00010110, + 0x00000000, 0x00000000, 0x00001010, 0x00011110, // 0081h + 0x00101011, 0x00100010, 0x00010100, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00011101, // 0082h + 0x00101011, 0x00101001, 0x00011001, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00111000, // 0083h + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00000000, 0x00000000, 0x00011100, // 0084h + 0x00100011, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000110, 0x01001001, 0x00110000, // 0085h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000100, 0x00111111, 0x00000100, // 0086h + 0x00111110, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000000, 0x00100001, 0x01000001, // 0087h + 0x01000001, 0x01000001, 0x00000001, 0x00000010, + 0x00000000, 0x00111100, 0x00000000, 0x00111110, // 0088h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00011100, 0x00000000, 0x00111110, // 0089h + 0x00010000, 0x00001000, 0x00010100, 0x01100010, + 0x00000000, 0x00100100, 0x01011111, 0x00000100, // 008ah + 0x00111110, 0x01000101, 0x01000101, 0x00100010, + 0x00000000, 0x00100010, 0x01001111, 0x01010010, // 008bh + 0x01010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x00000100, 0x00111110, 0x00001000, // 008ch + 0x00111110, 0x00010000, 0x00000010, 0x00111100, + 0x00000000, 0x00100000, 0x00011000, 0x00000110, // 008dh + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x00100000, 0x01111101, 0x00100001, // 008eh + 0x00100001, 0x00100001, 0x00100001, 0x00010010, + 0x00000000, 0x00011110, 0x00100000, 0x00000000, // 008fh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00001000, 0x01111111, 0x00010000, // 0090h + 0x00100000, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0091h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00010000, 0x01111111, 0x00011000, // 0092h + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 0093h + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x00111100, 0x00010000, 0x00001100, // 0094h + 0x01111111, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000100, 0x00011111, 0x00000100, // 0095h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00001000, 0x01111111, 0x00000100, // 0096h + 0x00111100, 0x01000010, 0x01000000, 0x00111100, + 0x00000000, 0x00000000, 0x00011100, 0x00100011, // 0097h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01111111, 0x00010000, 0x00001000, // 0098h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000010, 0x00110010, 0x00001100, // 0099h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00100100, 0x01001111, 0x01000010, // 009ah + 0x00010001, 0x00111100, 0x00010010, 0x00001100, + 0x00000000, 0x00000010, 0x01111010, 0x01000010, // 009bh + 0x00000010, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00100010, 0x00111110, 0x01010010, // 009ch + 0x01001011, 0x01101101, 0x01010101, 0x00110010, + 0x00000000, 0x00110010, 0x01001011, 0x01000110, // 009dh + 0x01000110, 0x01110010, 0x01001011, 0x00110010, + 0x00000000, 0x00011100, 0x00101010, 0x01001001, // 009eh + 0x01001001, 0x01000101, 0x01000101, 0x00110010, + 0x00000000, 0x00100001, 0x01111101, 0x00100001, // 009fh + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00000100, 0x00100011, 0x01100010, // 00a0h + 0x00100001, 0x00100001, 0x00010010, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a1h + 0x00000000, 0x00000100, 0x00001010, 0x00000100, + 0x00000000, 0x01110000, 0x00010000, 0x00010000, // 00a2h + 0x00010000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a3h + 0x00001000, 0x00001000, 0x00001000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a4h + 0x00000000, 0x00000010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00011000, // 00a5h + 0x00011000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x01111111, // 00a6h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00111111, 0x00100000, // 00a7h + 0x00010100, 0x00001100, 0x00000100, 0x00000010, + 0x00000000, 0x00000000, 0x00100000, 0x00100000, // 00a8h + 0x00010000, 0x00001111, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000100, 0x00111111, // 00a9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00aah + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00000000, 0x00010000, 0x00111111, // 00abh + 0x00011000, 0x00010100, 0x00010010, 0x00011001, + 0x00000000, 0x00000000, 0x00000010, 0x00111111, // 00ach + 0x00100010, 0x00010010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00adh + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00aeh + 0x00111110, 0x00100000, 0x00100000, 0x00111110, + 0x00000000, 0x00000000, 0x00100101, 0x00101010, // 00afh + 0x00101010, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00b0h + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x00101000, // 00b1h + 0x00011000, 0x00001000, 0x00001000, 0x00000100, + 0x00000000, 0x01000000, 0x00100000, 0x00011000, // 00b2h + 0x00010111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00001000, 0x01111111, 0x01000001, // 00b3h + 0x01000001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000000, 0x00111110, 0x00001000, // 00b4h + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00100000, 0x01111111, 0x00110000, // 00b5h + 0x00101000, 0x00100100, 0x00100010, 0x00110001, + 0x00000000, 0x00000100, 0x01111111, 0x01000100, // 00b6h + 0x01000100, 0x01000100, 0x01000010, 0x00100001, + 0x00000000, 0x00000100, 0x00111111, 0x00001000, // 00b7h + 0x01111111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x01111100, 0x01000100, 0x01000100, // 00b8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000010, 0x01111110, 0x00100010, // 00b9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00bah + 0x01000000, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 00bbh + 0x00100010, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000011, 0x00000100, 0x01000011, // 00bch + 0x01000100, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x01111111, 0x01000000, 0x00100000, // 00bdh + 0x00010000, 0x00011000, 0x00100100, 0x01000011, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00beh + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x01000001, 0x01000010, 0x01000000, // 00bfh + 0x00100000, 0x00100000, 0x00011000, 0x00000110, + 0x00000000, 0x01111110, 0x01000010, 0x01001110, // 00c0h + 0x01110001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x01100000, 0x00011110, 0x00010000, // 00c1h + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01000101, 0x01001010, 0x01001010, // 00c2h + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00c3h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000010, 0x00000010, 0x00000110, // 00c4h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x00010000, 0x00010000, 0x01111111, // 00c5h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111110, 0x00000000, // 00c6h + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000100, // 00c7h + 0x00101000, 0x00010000, 0x00101000, 0x01000110, + 0x00000000, 0x00001000, 0x01111111, 0x00100000, // 00c8h + 0x00010000, 0x00011100, 0x01101011, 0x00001000, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 00c9h + 0x00100000, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x00010010, 0x00100010, 0x00100010, // 00cah + 0x01000010, 0x01000010, 0x01000001, 0x01000001, + 0x00000000, 0x00000001, 0x00000001, 0x01111111, // 00cbh + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cch + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000100, 0x00001010, // 00cdh + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x01111111, // 00ceh + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cfh + 0x00100010, 0x00010100, 0x00001000, 0x00010000, + 0x00000000, 0x00001110, 0x01110000, 0x00001110, // 00d0h + 0x01110000, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00001000, 0x00001000, 0x00000100, // 00d1h + 0x00000100, 0x00100010, 0x01000010, 0x01111111, + 0x00000000, 0x01000000, 0x01000000, 0x00100100, // 00d2h + 0x00101000, 0x00010000, 0x00101100, 0x01000011, + 0x00000000, 0x01111111, 0x00000100, 0x01111111, // 00d3h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00d4h + 0x00100010, 0x00010100, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00d5h + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00d6h + 0x01111110, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00d7h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00d8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00001010, 0x00001010, 0x00001010, // 00d9h + 0x01001010, 0x01001010, 0x00101010, 0x00011001, + 0x00000000, 0x00000010, 0x00000010, 0x01000010, // 00dah + 0x01000010, 0x00100010, 0x00010010, 0x00001110, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dbh + 0x01000001, 0x01000001, 0x01000001, 0x01111111, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dch + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000011, 0x01000100, 0x01000000, // 00ddh + 0x01000000, 0x00100000, 0x00010000, 0x00001111, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00deh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00dfh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00011110, 0x00001000, 0x00000100, // 00e0h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x00000000, 0x00001100, 0x00010010, // 00e1h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x00100001, 0x01111101, // 00e2h + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00111100, 0x00010000, 0x00111100, // 00e3h + 0x00010000, 0x00011100, 0x00110010, 0x00001100, + 0x00000000, 0x00001110, 0x00101000, 0x00101000, // 00e4h + 0x00111110, 0x01100101, 0x00100101, 0x00010010, + 0x00000000, 0x00000100, 0x00101111, 0x01000100, // 00e5h + 0x00000110, 0x01000101, 0x01000101, 0x00111110, + 0x00000000, 0x00100010, 0x00100010, 0x00111110, // 00e6h + 0x01010010, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000100, 0x00011111, 0x00000010, // 00e7h + 0x00011111, 0x01000010, 0x01000010, 0x00111100, + 0x00000000, 0x00010010, 0x00111110, 0x01010011, // 00e8h + 0x01000010, 0x00100100, 0x00000100, 0x00000100, + 0x00000000, 0x00001000, 0x00111101, 0x01001011, // 00e9h + 0x01001001, 0x01001001, 0x00111000, 0x00000100, + 0x00000000, 0x00001000, 0x00111000, 0x00001000, // 00eah + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00011000, 0x00100000, 0x00000100, // 00ebh + 0x00111010, 0x01000110, 0x01000000, 0x00111000, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00ech + 0x01000110, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00edh + 0x01000011, 0x01001100, 0x01010010, 0x00111100, + 0x00000000, 0x00100010, 0x00110011, 0x00101010, // 00eeh + 0x00100110, 0x00100010, 0x00100011, 0x01000010, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00efh + 0x01000011, 0x01000000, 0x01000010, 0x00111100, + 0x00000000, 0x00000010, 0x00111011, 0x01000110, // 00f0h + 0x01000010, 0x01000011, 0x01000010, 0x00110010, + 0x00000000, 0x00000100, 0x00000100, 0x00000010, // 00f1h + 0x01000110, 0x01000101, 0x01000101, 0x00111001, + 0x00000000, 0x01010100, 0x01111111, 0x00100100, // 00f2h + 0x00100100, 0x00100100, 0x00100010, 0x00010001, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 00f3h + 0x00111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01011110, 0x01100010, 0x00100010, // 00f4h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010010, 0x01111110, 0x00100010, // 00f5h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 00f6h + 0x00100000, 0x00100000, 0x00100000, 0x00111111, + 0x00000000, 0x01010010, 0x01010010, 0x00111111, // 00f7h + 0x00010010, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01010011, 0x01010100, 0x00100011, // 00f8h + 0x00100100, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01010000, 0x01011111, 0x00010000, // 00f9h + 0x00001000, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x01010010, 0x01111111, 0x00100010, // 00fah + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x01010001, 0x01010010, 0x00100000, // 00fbh + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01011110, 0x01010010, 0x00100110, // 00fch + 0x00111001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01011110, 0x00010000, // 00fdh + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x00100101, 0x01001010, 0x00101010, // 00feh + 0x00100000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01011110, 0x01010000, 0x00111111, // 00ffh + 0x00001000, 0x00001000, 0x00001000, 0x00000110 +}; + + +//---------------------------------------------------------------- +// Palette data +// +const u32 d_PaletteData[8 * 16] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // black + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001f0000, 0x00000000, 0x00000000, 0x00000000, // red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00180000, 0x00000000, 0x00000000, 0x00000000, // dark red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/main.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/main.c new file mode 100644 index 00000000..d1fe1362 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/main.c @@ -0,0 +1,255 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: main.c + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +#include +#else +#include +#endif +#include +#include "font.h" +#include "screen.h" +#include "menu.h" + +static void myInit(void); +static void myVBlankIntr(void); +static void InitializeAllocateSystem(void); +static void PrintBootType(void); + +extern BOOL PubDataAccessTest(void); + +/*---------------------------------------------------------------------------* + Name: NitroMain + + Description: main + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +void TwlMain(void) +#else +void NitroMain(void) +#endif +{ + u16 trigger; + u16 preButton = PAD_Read(); + u16 button; + + //---------------- initialize + myInit(); + InitMenu(); + PrintBootType(); + +#if 0 + if( PubDataAccessTest() == FALSE ) + { + OS_Printf("Data access NG\n"); + return; + } +#endif + + //---------------- main loop + while (TRUE) + { + button = PAD_Read(); + trigger = (u16)((button ^ preButton) & button); + preButton = button; + + //---- clear screen buffer + ClearScreen(); + + //---- display menus + DisplayMenuSet(); + + //---- press UP key (toggle menu) + if(trigger & PAD_KEY_UP) + { + ChangeMenuItem(MENU_ITEM_UP); + } + + if(trigger & PAD_KEY_DOWN) + { + ChangeMenuItem(MENU_ITEM_DOWN); + } + if(trigger & PAD_KEY_RIGHT) + { + ExecMenuItemRight(); + } + if(trigger & PAD_KEY_LEFT) + { + ExecMenuItemLeft(); + } + + //---- push A + if (trigger & PAD_BUTTON_A) + { + ExecMenuItem(); + } + //---- push B + if (trigger & PAD_BUTTON_B) + { + ExecMenuItemB(); + } + //---- push X + if (trigger & PAD_BUTTON_X) + { + ExecMenuItemX(); + } + + OS_WaitVBlankIntr(); + } +} + +//---------------------------------------------------------------- +// myInit +// +void myInit(void) +{ + //---- init + OS_Init(); + OS_InitTick(); + OS_InitAlarm(); + RTC_Init(); + FX_Init(); + GX_Init(); + GX_DispOff(); + GXS_DispOff(); + InitializeAllocateSystem(); + + //---- init displaying + GX_SetBankForLCDC(GX_VRAM_LCDC_ALL); + MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE); + (void)GX_DisableBankForLCDC(); + + MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE); + MI_CpuClearFast((void *)HW_PLTT, HW_PLTT_SIZE); + MI_CpuFillFast((void *)HW_DB_OAM, 192, HW_DB_OAM_SIZE); + MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE); + + //---- setting 2D for top screen + GX_SetBankForBG(GX_VRAM_BG_128_A); + + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0xf800, GX_BG_CHARBASE_0x00000, GX_BG_EXTPLTT_01); + G2_SetBG0Priority(0); + G2_BG0Mosaic(FALSE); + GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D); + GX_SetVisiblePlane(GX_PLANEMASK_BG0); + + GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + + + + //---- setting 2D for bottom screen + GX_SetBankForSubBG(GX_VRAM_SUB_BG_128_C); + + G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0xf800, GX_BG_CHARBASE_0x00000, GX_BG_EXTPLTT_01); + G2S_SetBG0Priority(0); + G2S_BG0Mosaic(FALSE); + GXS_SetGraphicsMode(GX_BGMODE_0); + GXS_SetVisiblePlane(GX_PLANEMASK_BG0); + + GXS_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GXS_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + + + //---- screen + MI_CpuFillFast((void *)gScreen, 0, sizeof(gScreen)); + DC_FlushRange(gScreen, sizeof(gScreen)); + /* DMA操作でIOレジスタへアクセスするのでキャッシュの Wait は不要 */ + // DC_WaitWriteBufferEmpty(); + GX_LoadBG0Scr(gScreen, 0, sizeof(gScreen)); + GXS_LoadBG0Scr(gScreen, 0, sizeof(gScreen)); + + //---- init interrupt + OS_SetIrqFunction(OS_IE_V_BLANK, myVBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)GX_VBlankIntr(TRUE); + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); + + //---- FileSystemInit + (void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV); + FS_Init( FS_DMA_NOT_USE ); + + //---- start displaying + GX_DispOn(); + GXS_DispOn(); +} + +//---------------------------------------------------------------- +// myVBlankIntr +// vblank interrupt handler +// +static void myVBlankIntr(void) +{ + //---- upload pseudo screen to VRAM + DC_FlushRange(gScreen, sizeof(gScreen)); + /* DMA操作でIOレジスタへアクセスするのでキャッシュの Wait は不要 */ + // DC_WaitWriteBufferEmpty(); + GX_LoadBG0Scr(gScreen, 0, sizeof(gScreen)); + GXS_LoadBG0Scr(gScreen, 0, sizeof(gScreen)); + + + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + +/*---------------------------------------------------------------------------* + Name: InitializeAllocateSystem + + Description: メインメモリ上のアリーナにてメモリ割当てシステムを初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitializeAllocateSystem(void) +{ + void *tempLo; + OSHeapHandle hh; + + tempLo = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1); + OS_SetArenaLo(OS_ARENA_MAIN, tempLo); + hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi()); + if (hh < 0) + { + OS_Panic("ARM9: Fail to create heap...\n"); + } + hh = OS_SetCurrentHeap(OS_ARENA_MAIN, hh); +} + +static void PrintBootType(void) +{ + const OSBootType btype = OS_GetBootType(); + + switch( btype ) + { + case OS_BOOTTYPE_ROM: OS_TPrintf("OS_GetBootType = OS_BOOTTYPE_ROM\n"); break; + case OS_BOOTTYPE_NAND: OS_TPrintf("OS_GetBootType = OS_BOOTTYPE_NAND\n"); break; + default: + { + OS_Warning("unknown BootType(=%d)", btype); + } + break; + } +} + diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/menu.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/menu.c new file mode 100644 index 00000000..0a990fb6 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/menu.c @@ -0,0 +1,652 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: menu.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 "font.h" +#include "screen.h" +#include "menu.h" +#include "dataver.h" +#include + +/* + * menu.c + * メニュー表示機能 + * + * テストアプリに適した簡単なメニュー表示を行う。メニュー階層は複数段可能。 + * + * なお、この機能を使用するためには、以下のソースが必要 + * font.c, font.h, screen.c, screen.h + * + * 導入手順: + * 1, menu.hの以下の定義値を変更する + * MENU_DEPTH_NUM : メニューの階層数 + * MENU_ITEM_NUM : メニュー項目の最大数 + * MENU_ITEM_STRLEN : メニュー表示文字列の最大長 + * 2, menu.cの以下の定義を変更する + * MENU_TITLE : メニューのタイトル + * 3, 以下の構造体を変更する + * MenuItem : メニュー表示内容および階層間情報 + * 4, 関数 ExecMenuItem() がメニュー項目に応じた処理を定義するハンドラなので、 + * 定義を行う + * 5, Mainから以下の関数を呼ぶ + * InitMenu : メニュー関連の初期化 + * DisplayMenuSet : メニュー機能の表示 + * ChangeMenuItem : メニュー選択項目の変更(この関数はキー操作時に呼び出すようにする) + * ExecMenuItem : メニュー項目に応じた処理の実行(この関数はキー操作時に呼び出すようにする) + * + * + * 不明な点は安田まで。 + */ + +#define MENU_TITLE "APP version viewer" +//#define NEW_MENU_POS // YASUDA +#define DRAW_LINE_AS_CHAR + +static char cItemStr[MENU_ITEM_NUM][MENU_ITEM_STRLEN]; +static char cItemSt2[MENU_ITEM_NUM][MENU_ITEM_STRLEN]; + +static menu_sheet_t MenuItem[MENU_DEPTH_NUM] = +{ + {-1, -1, cItemStr[0], -1, cItemStr[1], -1, cItemStr[2], -1, cItemStr[3], + -1, cItemStr[4], -1, cItemStr[5], -1, cItemStr[6], -1, cItemStr[7], + -1, cItemStr[8], -1, cItemStr[9], 1, cItemStr[10] }, + { 0, -1, cItemSt2[0], -1, cItemSt2[1], -1, cItemSt2[2], -1, cItemSt2[3], + -1, cItemSt2[4], -1, cItemSt2[5], -1, cItemSt2[6], -1, cItemSt2[7], + -1, cItemSt2[8], -1, cItemSt2[9], -1, cItemSt2[10] }, +}; + +static s16 MenuDepth; +static s16 MenuPos; +static u8 isMenuCancel = 0; + +//---- for RTC +static RTCTime myCurrentTime; +static int myResult; + +static void DisplayControlInfo(void); +static void DisplayMenu(void); +static void EnterMenuCancel(void); + +static void setAllItems(void); +static void setAppVerItem(void); +static void setPublicDataItem(void); +static void setPrivateDataItem(void); +static void setOtherDataItem(void); +static void setAllItems_OtherApp(void); +static void setOtherAppVerItem(void); +static void setOtherNandAppPublicDataItem(void); +static void setOtherNandAppPrivateDataItem(void); + +// YASUDA +extern FSResult g_fs_result; + +static s32 g_other_app_num = 0; +static s32 g_current_other_app = 0; + +#ifdef USER_MODE + char* APP_TYPE = "USER"; +#else + char* APP_TYPE = "SEQURE"; +#endif + + +//---------------------------------------------------------------- +// InitMenu +// +void InitMenu(void) +{ + MenuDepth = 0; + MenuPos = 2; + + GetOutNandAppInfo(); + + setAllItems(); +#if defined(DRAW_LINE_AS_CHAR) + STD_CopyString( MenuItem[0].sItem[1].cItemStr, "---------+------------" ); + STD_CopyString( MenuItem[0].sItem[5].cItemStr, "---------+------------" ); + STD_CopyString( MenuItem[0].sItem[9].cItemStr, "---------+------------" ); +#endif +} + +//---------------------------------------------------------------- +// DisplayMenuSet +// +void DisplayMenuSet(void) +{ + if(isMenuCancel > 0) + { + return; + } + + //PrintString(3, 3, 15, "parameter is %d", param); + DisplayMenu(); + + //---- display time + myResult = RTC_GetTime(&myCurrentTime); + if (myResult == 0 /*no error */ ) + { +#if !defined(NEW_MENU_POS) + PrintString(5, 21, 8, "%02d:%02d:%02d", + myCurrentTime.hour, myCurrentTime.minute, myCurrentTime.second); +#else + PrintString(5, 23, 8, "%02d:%02d:%02d", + myCurrentTime.hour, myCurrentTime.minute, myCurrentTime.second); +#endif + } + + //---- display counter + //PrintString(18, 20, 4, "%08X", OS_GetVBlankCount()); + + //---- display control infomation + DisplayControlInfo(); +} + +//---------------------------------------------------------------- +// DisplayControlInfo +// +static void DisplayControlInfo(void) +{ + if(MenuDepth == 0) + { + //---- display key description + PrintString(3, 2, 15, MENU_TITLE); + + if( MenuPos != 10 ) + { +#if !defined(NEW_MENU_POS) + PrintString(5, 17, 15, "[A] set current data"); + PrintString(5, 18, 15, "[X] set both data"); +#else + PrintString(5, 19, 15, "[A] set current data"); + PrintString(5, 20, 15, "[X] set both data"); +#endif + } + else + { +#if !defined(NEW_MENU_POS) + PrintString(5, 17, 15, "[A] show other app data"); + PrintString(5, 18, 15, "[X] set both data"); +#else + PrintString(5, 19, 15, "[A] show other app data"); + PrintString(5, 20, 15, "[X] set both data"); +#endif + } + } + else + { + //---- display key description + PrintString(3, 2, 15, "OTHER APP info"); + +#if !defined(NEW_MENU_POS) + PrintString(5, 17, 15, "[A/X] set data"); + PrintString(5, 18, 15, "[B] return main"); + PrintString(5, 19, 15, "[<-/->] switch apps"); +#else + PrintString(5, 19, 15, "[A/X] set data"); + PrintString(5, 20, 15, "[B] set both data"); + PrintString(5, 21, 15, "[<-/->] switch apps"); +#endif + } +} + +//---------------------------------------------------------------- +// DisplayMenu +// +static void DisplayMenu(void) +{ + u16 pos; + char *str; + + PrintString(0, 0, 14, APP_TYPE); + + + for(pos = 0; pos < MENU_ITEM_NUM; pos++) + { + str = MenuItem[MenuDepth].sItem[pos].cItemStr; + //---- display key description + if( str[0] != '\0' ) + { +#if !defined(DRAW_LINE_AS_CHAR) + PrintString(3, (s16)(5 + pos), 15, str); +#else + if( MenuDepth == 0 ) + { + if( (pos != 1) && (pos != 5) && (pos != 9) ) + { + PrintString(3, (s16)(5 + pos), 15, str); + } + else + { + PrintString(3, (s16)(5 + pos), 6, str); + } + } + else + { + if( (pos != 2) && (pos != 6) ) + { + PrintString(3, (s16)(5 + pos), 15, str); + } + else + { + PrintString(3, (s16)(5 + pos), 5, str); + } + } +#endif + } + + PrintString(1, (s16)(5 + MenuPos), 8, "#"); + } +} + + +//---------------------------------------------------------------- +// ChangeMenuItem +// +void ChangeMenuItem(u16 action) +{ + switch(action) + { + case MENU_ITEM_UP: + ColorString((s16)(1 + MenuPos), 5, 1, 0); + MenuPos--; + if(MenuPos < 0) + { + MenuPos = 0; + } + //動作のチューニング + if( MenuDepth == 0 ) + { + if( (MenuPos>=0) && (MenuPos<6) ){ + MenuPos = 2; + }else if( (MenuPos>=6) && (MenuPos<10) ){ + MenuPos = 6; + }else if( (MenuPos>=10) && (MenuPos<11) ){ + MenuPos = 10; + } + } + else + { + if( (MenuPos>=0) && (MenuPos<7) ){ + MenuPos = 3; + }else if( (MenuPos>=7) && (MenuPos<11) ){ + MenuPos = 7; + } + } + break; + case MENU_ITEM_DOWN: + ColorString((s16)(1 + MenuPos), 5, 1, 0); + MenuPos++; + if(MenuPos >= MENU_ITEM_NUM) + { + MenuPos--; + } + if(MenuItem[MenuDepth].sItem[MenuPos].cItemStr[0] == '\0') + { + MenuPos--; + } + //動作のチューニング + if( MenuDepth == 0 ) + { + if( (MenuPos>0) && (MenuPos<=2) ){ + MenuPos = 2; + }else if( (MenuPos>2) && (MenuPos<=6) ){ + MenuPos = 6; + }else if( (MenuPos>6) && (MenuPos<=10) ){ + MenuPos = 10; + } + } + else + { + if( (MenuPos>0) && (MenuPos<=3) ){ + MenuPos = 3; + }else if( (MenuPos>3) && (MenuPos<=10) ){ + MenuPos = 7; + } + } + break; + case MENU_DEPTH_UP: + MenuDepth = MenuItem[MenuDepth].nPrev; + MenuPos = 0; + if(MenuDepth < 0) + { + MenuDepth = 0; + } + break; + case MENU_DEPTH_DOWN: + { + s16 pos; + pos = MenuItem[MenuDepth].sItem[MenuPos].nNext; + if(pos >= 0) + { + MenuDepth = pos; + MenuPos = 0; + } + } + break; + } +} + + +//---------------------------------------------------------------- +// ExecMenuItem +// +void ExecMenuItem(void) +{ + switch(MenuDepth) + { + case 0: + switch(MenuPos) + { + case 0: + break; + case 2: + // Public data タイムスタンプ変更 + SetPublicDataTimeStamp(); + setPublicDataItem(); + break; + case 6: + // Private data タイムスタンプ変更 + SetPrivateDataTimeStamp(); + setPrivateDataItem(); + setOtherDataItem(); + break; + case 10: + // 他アプリデータ表示へ + ChangeMenuItem(MENU_DEPTH_DOWN); + MenuPos = 3; + setAllItems_OtherApp(); + break; + default: + break; + } + break; + case 1: + switch(MenuPos) + { + case 3: + // 該当アプリのPublic data タイムスタンプ変更 + SetOurNandAppPublicDataTimeStamp(g_current_other_app); + setOtherNandAppPublicDataItem(); + break; + case 7: + // 該当アプリのPrivate data タイムスタンプ変更 + SetOurNandAppPrivateDataTimeStamp(g_current_other_app); + setOtherNandAppPrivateDataItem(); + break; + default: + break; + } + break; + default: + break; + } +} + +//---------------------------------------------------------------- +// ExecMenuItemB +// +void ExecMenuItemB(void) +{ + switch(MenuDepth) + { + case 1: + // メインメニューに戻る + ChangeMenuItem(MENU_DEPTH_UP); + MenuPos = 2; + break; + default: + break; + } +} + +//---------------------------------------------------------------- +// ExecMenuItemX +// +void ExecMenuItemX(void) +{ + switch(MenuDepth) + { + case 0: + switch(MenuPos) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + // 両 data タイムスタンプ変更 + SetPublicDataTimeStamp(); + SetPrivateDataTimeStamp(); + setAllItems(); + break; + default: + break; + } + break; + case 1: + // 両 data タイムスタンプ変更 + SetOurNandAppPublicDataTimeStamp(g_current_other_app); + SetOurNandAppPrivateDataTimeStamp(g_current_other_app); + setAllItems_OtherApp(); + break; + default: + break; + } +} + + +//---------------------------------------------------------------- +// ExecMenuItemRight +// +void ExecMenuItemRight(void) +{ + switch(MenuDepth) + { + case 1: + // アプリ番号を変更 + if( g_other_app_num > 0 ) + { + if(++g_current_other_app >= g_other_app_num ) + { + g_current_other_app = 0; + } + // 表示書き換え + setAllItems_OtherApp(); + } + break; + default: + break; + } +} + +//---------------------------------------------------------------- +// ExecMenuItemLeft +// +void ExecMenuItemLeft(void) +{ + switch(MenuDepth) + { + case 1: + // アプリ番号を変更 + if( g_other_app_num > 0 ) + { + if(--g_current_other_app < 0) + { + g_current_other_app = g_other_app_num - 1; + } + // 表示書き換え + setAllItems_OtherApp(); + } + break; + default: + break; + } +} + +//---------------------------------------------------------------- +// EnterMenuCancel +// +static void EnterMenuCancel(void) +{ + isMenuCancel = 1; + ClearScreen(); +} + +//---------------------------------------------------------------- +// ExitMenuCancel +// +void ExitMenuCancel(void) +{ + if(isMenuCancel > 0){ + isMenuCancel = 0; + } +} + +void SetMenuString(u32 depth, u32 ipos, char *str) +{ + STD_CopyString( MenuItem[depth].sItem[ipos].cItemStr, str ); +} + +void SetCurrentMenuString(char *str) +{ + SetMenuString( MenuDepth, MenuPos, str ); +} + +static void setAllItems(void) +{ + setAppVerItem(); + setPublicDataItem(); + setPrivateDataItem(); + setOtherDataItem(); +} + +static void setAppVerItem(void) +{ + char ver[8]; + + GetAppVersionString(ver); + STD_TSPrintf( cItemStr[0], "APP ver : %s", ver ); +} + +static void setPublicDataItem(void) +{ + char ver[8], time1[16], time2[16]; + + if( GetPublicDataInfoStrings( ver, time1, time2 ) == TRUE ) + { + STD_TSPrintf( cItemStr[2], "PUB ver : %s", ver ); + STD_TSPrintf( cItemStr[3], " date : %s", time1 ); + STD_TSPrintf( cItemStr[4], " : %s", time2 ); + } + else + { + STD_TSPrintf( cItemStr[2], "PUB : NONE", ver ); + STD_TSPrintf( cItemStr[3], " " ); + STD_TSPrintf( cItemStr[4], " " ); + } +} + +static void setPrivateDataItem(void) +{ + char ver[8], time1[16], time2[16]; + + if( GetPrivateDataInfoStrings( ver, time1, time2 ) == TRUE ) + { + STD_TSPrintf( cItemStr[6], "PRV ver : %s", ver ); + STD_TSPrintf( cItemStr[7], " date : %s", time1 ); + STD_TSPrintf( cItemStr[8], " : %s", time2 ); + } + else + { + STD_TSPrintf( cItemStr[6], "PRV : NONE" ); + STD_TSPrintf( cItemStr[7], " " ); + STD_TSPrintf( cItemStr[8], " " ); + } +} + +static void setOtherDataItem(void) +{ + g_other_app_num = GetOurNandAppNum(); + STD_TSPrintf( cItemStr[10], "OTHER : %d apps", g_other_app_num ); +} + +static void setAllItems_OtherApp(void) +{ + setOtherAppVerItem(); + setOtherNandAppPublicDataItem(); + setOtherNandAppPrivateDataItem(); + +#if defined(DRAW_LINE_AS_CHAR) + STD_CopyString( MenuItem[1].sItem[2].cItemStr, "---------+-------------" ); + STD_CopyString( MenuItem[1].sItem[6].cItemStr, "---------+-------------" ); +#endif +} + +static void setOtherAppVerItem(void) +{ + char ver[8], ini[8]; + + if( g_other_app_num == 0 ) + { + STD_TSPrintf( cItemSt2[0], "OTHER APP : none" ); + } + else + { + GetOurNandAppVersionString( g_current_other_app, ver, ini ); + + STD_TSPrintf( cItemSt2[0], "No. : %02d/%02d (%s)", + g_current_other_app + 1, g_other_app_num, ini ); + STD_TSPrintf( cItemSt2[1], "APP ver : %s", ver ); + } +} + + +static void setOtherNandAppPublicDataItem(void) +{ + char ver[8], time1[16], time2[16]; + + if( GetOurNandAppPublicDataInfoStrings( g_current_other_app, ver, time1, time2 ) == TRUE ) + { + STD_TSPrintf( cItemSt2[3], "PUB ver : %s", ver ); + STD_TSPrintf( cItemSt2[4], " date : %s", time1 ); + STD_TSPrintf( cItemSt2[5], " : %s", time2 ); + } + else + { + STD_TSPrintf( cItemSt2[3], "PUB : NONE", ver ); + STD_TSPrintf( cItemSt2[4], " " ); + STD_TSPrintf( cItemSt2[5], " " ); + } +} + +static void setOtherNandAppPrivateDataItem(void) +{ + char ver[8], time1[16], time2[16]; + + if( GetOurNandAppPrivateDataInfoStrings( g_current_other_app, ver, time1, time2 ) == TRUE ) + { + STD_TSPrintf( cItemSt2[7], "PRV ver : %s", ver ); + STD_TSPrintf( cItemSt2[8], " date : %s", time1 ); + STD_TSPrintf( cItemSt2[9], " : %s", time2 ); + } + else + { + STD_TSPrintf( cItemSt2[7], "PRV : NONE" ); + STD_TSPrintf( cItemSt2[8], " " ); + STD_TSPrintf( cItemSt2[9], " " ); + } +} diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/screen.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/screen.c new file mode 100644 index 00000000..58b6c424 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion/src/screen.c @@ -0,0 +1,115 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.c + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +#include +#else +#include +#endif +#include "screen.h" + +u16 gScreen[32 * 32]; + +// ** these code are refer to rtc sample. thanks. +/*---------------------------------------------------------------------------* + Name: ClearScreen + + Description: clear screen buffer + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void ClearScreen(void) +{ + MI_CpuClearFast((void *)gScreen, sizeof(gScreen)); +} + +/*---------------------------------------------------------------------------* + Name: PrintString + + Description: enter string into screen buffer + string must be within 32 chars + + Arguments: x : x + y : y + palette : color (0-15) + text : string. end mark is NULL + + Returns: None. + *---------------------------------------------------------------------------*/ +void PrintString(s16 x, s16 y, u8 palette, char *text, ...) +{ + va_list vlist; + char temp[32 + 2], *tempPtr; + s32 i; + u16 *p, *pLimit; + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + *(u16 *)(&temp[32]) = 0; + p = &gScreen[((y * 32) + x) % (32 * 32)]; + pLimit = &gScreen[32 * 32]; + tempPtr = &temp[0]; + + for (i = 0; *tempPtr; i++, tempPtr++) + { + *p = (u16)((palette << 12) | *tempPtr); + if (++p >= pLimit) + { + p = &gScreen[0]; + } + } +} + +/*---------------------------------------------------------------------------* + Name: ColorString + + Description: change string color which is put in screen buffer + + Arguments: x : x + y : y + length : number of characters to change color + palette : color (0-15) + + Returns: None. + *---------------------------------------------------------------------------*/ +void ColorString(s16 x, s16 y, s16 length, u8 palette) +{ + s32 i; + u16 *p, *pLimit; + + if (length < 0) + return; + + p = &gScreen[((y * 32) + x) % (32 * 32)]; + pLimit = &gScreen[32 * 32]; + + for (i = 0; i < length; i++) + { + u16 temp = *p; + temp &= 0x0fff; + temp |= (palette << 12); + *p = temp; + + if (++p >= pLimit) + { + p = &gScreen[0]; + } + } +} diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/Makefile b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/Makefile new file mode 100644 index 00000000..19d62810 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/Makefile @@ -0,0 +1,106 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - save_data - DisplayVersion +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- + +SUBDIRS = + + +#---------------------------------------------------------------------------- +TARGET_PLATFORM := TWL +TWL_ARCHGEN := LIMITED +TWL_NANDAPP := TRUE + +SRCS = main.c font.c screen.c menu.c dataver.c +MASTER_NAME = SaveDataTest +APP_NAME = $(MASTER_NAME)_TARGET +TARGET_BIN = $(APP_NAME).tad + +#------------------------- +#-- NAND アプリではいくつかのパラメータの指定のために固有の RSF ファイルが必要です。 + +ROM_SPEC = test.autogen.rsf +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_nand.rsf +ROM_SPEC_PARAM = MakerCode=01 \ + TitleName=VER_CHECKER \ + GameCode=4VDA \ + BannerFile=./banner/banner_TARGET.bnr \ + PublicSaveDataSize=16K \ + PrivateSaveDataSize=16K + + +#------------------------- +#-- カードアプリと同様に ROM-FS にファイルを持たせます。 + +#MAKEROM_ROMROOT = ./rom_data +#MAKEROM_ROMFILES = *.* + +#------------------------- +# インストール指定 + +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/$(MASTER_NAME) +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + + +#------------------------- +#-- バナーデータを生成します +BANNER = ./banner/banner.bnr +BANNERSRC := $(wildcard ./banner/data/Cell/*.nce) +MAKEBANNER = $(TWL_TOOLSDIR)/bin/makebanner.TWL.exe +BANNERCVTR = $(TWL_TOOLSDIR)/bin/bannercvtr.exe + +#------------------------- +# rom 内のファイルは全て自動生成なので clean で削除されるようにします +LDIRT_CLEAN = $(MAKEROM_ROMROOT) + +include $(TWLSDK_ROOT)/build/buildtools/commondefs +#include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib + +#---------------------------------------------------------------------------- + +#.PHONY: build_time + +do-build: $(TARGETS) + + +$(BINDIR)/$(TARGET_BIN_BASENAME).$(TWL_ELF_EXT): make_dir +#build_time + +#------------------------- +#-- rom_data/build_time.txt を作成します。 + +make_dir: + $(INSTALL) -d $(MAKEROM_ROMROOT) +#build_time: +# $(INSTALL) -d $(MAKEROM_ROMROOT) +# echo -n "build at `date \"+%Y/%m/%d %H:%M:%S\"` on \"`hostname`\"" > $(MAKEROM_ROMROOT)/build_time.txt + +#------------------------- +#-- バナー作成用ターゲット + +$(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/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/banner/banner_TARGET.bnr b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/banner/banner_TARGET.bnr new file mode 100644 index 00000000..878bdab7 Binary files /dev/null and b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/banner/banner_TARGET.bnr differ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/dataver.h b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/dataver.h new file mode 100644 index 00000000..c8756072 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/dataver.h @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: dataver.h + + 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$ + *---------------------------------------------------------------------------*/ + +#ifndef DATAVER_H_ +#define DATAVER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +void GetAppVersionString(char *str); +BOOL GetPublicDataInfoStrings(char *verstr, char *timestr, char *datestr); +BOOL GetPrivateDataInfoStrings(char *verstr, char *timestr, char *datestr); +BOOL SetPublicDataTimeStamp(void); +BOOL SetPrivateDataTimeStamp(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* DATAVER_H_ */ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/font.h b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/font.h new file mode 100644 index 00000000..a323d9e1 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/font.h @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef FONT_H_ +#define FONT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ + +#include + +extern const u32 d_CharData[8 * 256]; +extern const u32 d_PaletteData[8 * 16]; + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* FONT_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/menu.h b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/menu.h new file mode 100644 index 00000000..c8a58ef2 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/menu.h @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: menu.h + + 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$ + *---------------------------------------------------------------------------*/ + +#ifndef MENU_H_ +#define MENU_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ + +#include + +//メニューに関する定義 +#define MENU_DEPTH_NUM 1 +#define MENU_ITEM_NUM 9 +#define MENU_ITEM_STRLEN 24 + +//ChangeMenuItemのパラメータ +#define MENU_ITEM_UP 0 +#define MENU_ITEM_DOWN 1 +#define MENU_DEPTH_UP 2 +#define MENU_DEPTH_DOWN 3 + + +typedef struct { + s16 nNext; // -1: これ以上枝はない + //char cItemStr[MENU_ITEM_STRLEN]; + char *cItemStr; +}menu_item_t; + +typedef struct { + s16 nPrev; // -1: 自分が親 + menu_item_t sItem[MENU_ITEM_NUM]; +}menu_sheet_t; + + +void DisplayMenuSet(void); +void InitMenu(void); +void ChangeMenuItem(u16 action); +void ExecMenuItem(void); +void ExecMenuItemX(void); +void ExitMenuCancel(void); +void SetMenuString(u32 depth, u32 ipos, char *str); +void SetCurrentMenuString(char *str); + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* MENU_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/screen.h b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/screen.h new file mode 100644 index 00000000..39b44f73 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/include/screen.h @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: screen.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef SCREEN_H_ +#define SCREEN_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +#include + +extern u16 gScreen[32 * 32]; + +void ClearScreen(void); +void PrintString(s16 x, s16 y, u8 palette, char *text, ...); +void ColorString(s16 x, s16 y, s16 length, u8 palette); + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* SCREEN_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/readme.txt b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/readme.txt new file mode 100644 index 00000000..ef1ef7d5 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/readme.txt @@ -0,0 +1,23 @@ +セーブデータバージョンチェックソフトの相方 + +このソフトはDisplayVersionの相方です。 +以下のことをします。 + ・アプリバージョンを表示する + ・アプリバージョンをパブリックセーブデータ・プライベートセーブデータに保存する + ・各セーブデータに保存したバージョン番号およびタイムスタンプを表示する + +DisplayVersionとの違いは共有データアクセス機能がないこととイニシャルコードが違うこと +にあります。 + +【使い方】 +・ソフトを起動すると以下の表示を行います +  アプリバージョン +  パブリックセーブデータに保存したバージョン番号およびタイムスタンプ +  プライベートセーブデータに保存したバージョン番号およびタイムスタンプ +・矢印↑↓で項目を選択しAボタンを押すと該当するセーブデータを書き換えます +・Xボタンを押すと全セーブデータを書き換えます + +【制限事項】 +DisplayVersionと同様の制限事項があります。 +書き換えを実行してもタイムスタンプに2秒以内の時間のずれが発生します +(ファイルシステムは2秒間隔でしか設定しないため) diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/dataver.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/dataver.c new file mode 100644 index 00000000..65f53ae5 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/dataver.c @@ -0,0 +1,379 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: dataver.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 "dataver.h" +#include + +#define ACCESS_TEST_1 +//#define ACCESS_TEST_2 +//#define ACCESS_TEST_3 +//#define ACCESS_TEST_4 +//#define ACCESS_TEST_5 + +#define PUBDATA_VERSION_PATH "dataPub:/version" +#define PRVDATA_VERSION_PATH "dataPrv:/version" +#define VERSION_LEN 3 + +static BOOL getDataInfoStrings(char *path, char *verstr, char *timestr, char *datestr); +static BOOL setDataTimeStamp(char *path); + +FSResult g_fs_result; + +void GetAppVersionString(char *str) +{ + u8 *pHeader, version; + + pHeader = (u8*)HW_TWL_ROM_HEADER_BUF; + version = *(pHeader + 0x1e); + + str[0] = (char)(version / 100 + 0x30); + str[1] = (char)((version % 100) / 10 + 0x30); + str[2] = (char)(version % 10 + 0x30); + str[3] = '\0'; +} + +BOOL GetPublicDataInfoStrings(char *verstr, char *timestr, char *datestr) +{ + return getDataInfoStrings(PUBDATA_VERSION_PATH, verstr, timestr, datestr); +} + +static BOOL getDataInfoStrings(char *path, char *verstr, char *timestr, char *datestr) +{ + FSFile file; + FSPathInfo info; + FSResult fresult; + + FS_InitFile( &file ); + + if( !FS_GetPathInfo(path, &info) ) + { + fresult = FS_GetArchiveResultCode(path); + return FALSE; + } + + STD_TSPrintf( timestr, "%04d/%02d/%02d", + info.mtime.year, info.mtime.month, info.mtime.day ); + STD_TSPrintf( datestr, "%02d:%02d:%02d", + info.mtime.hour, info.mtime.minute, info.mtime.second ); + + if( FS_OpenFileEx( &file, path, FS_FILEMODE_R ) == FALSE ) + { + return FALSE; + } + + if( FS_ReadFile( &file, verstr, VERSION_LEN ) != VERSION_LEN ) + { + return FALSE; + } + verstr[VERSION_LEN] = '\0'; + + if( FS_CloseFile( &file ) == FALSE ) + { + return FALSE; + } + + return TRUE; +} + +BOOL GetPrivateDataInfoStrings(char *verstr, char *timestr, char *datestr) +{ + return getDataInfoStrings(PRVDATA_VERSION_PATH, verstr, timestr, datestr); +} + +BOOL SetPublicDataTimeStamp() +{ + return setDataTimeStamp(PUBDATA_VERSION_PATH); +} + +static BOOL setDataTimeStamp(char *path) +{ + FSFile file; + //FSPathInfo info; + char verstr[8]; + FSResult fresult; + + GetAppVersionString( verstr ); + + FS_InitFile( &file ); + + if( FS_OpenFileEx( &file, path, FS_FILEMODE_W ) == FALSE ) + { + if( !FS_CreateFile(path, FS_PERMIT_R | FS_PERMIT_W) ) + { + fresult = FS_GetArchiveResultCode(path); + g_fs_result = fresult; + return FALSE; + } + if( FS_OpenFileEx( &file, path, FS_FILEMODE_W ) == FALSE ) + { + return FALSE; + } + } + + if( FS_WriteFile( &file, verstr, VERSION_LEN ) != VERSION_LEN ) + { + return FALSE; + } + + if( FS_CloseFile( &file ) == FALSE ) + { + return FALSE; + } + + return TRUE; +} + +BOOL SetPrivateDataTimeStamp() +{ + return setDataTimeStamp(PRVDATA_VERSION_PATH); +} + + +#if 0 +/* *INDENT-OFF* */ +static const char * const fs_result_strings[] = +{ + "FS_RESULT_SUCCESS", + "FS_RESULT_FAILURE", + "FS_RESULT_BUSY", + "FS_RESULT_CANCELED", + "FS_RESULT_UNSUPPORTED", + "FS_RESULT_ERROR", + "FS_RESULT_INVALID_PARAMETER", + "FS_RESULT_NO_MORE_RESOUCE", + "FS_RESULT_ALREADY_DONE", + "FS_RESULT_PERMISSION_DENIED", + "FS_RESULT_MEDIA_FATAL", + "FS_RESULT_NO_ENTRY", + "FS_RESULT_MEDIA_NOTHING", + "FS_RESULT_MEDIA_UNKNOWN", + "FS_RESULT_BAD_FORMAT", +}; +static const size_t fs_result_string_max = sizeof(fs_result_strings) / sizeof(*fs_result_strings); +SDK_COMPILER_ASSERT(fs_result_string_max == FS_RESULT_MAX); +/* *INDENT-ON* */ + +static void ReportLastErrorPath(const char *path) +{ + FSResult result = FS_GetArchiveResultCode(path); + + SDK_ASSERT((result >= 0) && (result < fs_result_string_max)); + OS_TPrintf("FS error:\n \"%s\"\n %s\n", + path, fs_result_strings[result]); +} + +static void ReportLastErrorFile(const FSFile *file) +{ + FSArchive *arc = FS_GetAttachedArchive(file); + FSResult result = FS_GetResultCode(file); + + SDK_ASSERT((result >= 0) && (result < fs_result_string_max)); + OS_TPrintf("FS error:\n (archive \"%s:\")\n %s\n", + FS_GetArchiveName(arc), fs_result_strings[result]); +} + +BOOL PubDataAccessTest(void) +{ + BOOL ret; + FSFile file, dir; + FSResult res; + FSArchiveResource resource; + static const char *testdir = "dataPub:/testdir"; + static const char *testfile = "dataPub:/testdir/test.txt"; + +#if defined(ACCESS_TEST_1) + FS_InitFile( &file ); + FS_InitFile( &dir ); + +#if 1 + if( FS_OpenDirectory( &dir, testdir, FS_FILEMODE_R | FS_FILEMODE_W ) ) + { + OS_TPrintf("%s already exists\n", testdir); + FS_CloseDirectory( &dir ); + } + else if( FS_CreateDirectory( testdir, FS_PERMIT_R | FS_PERMIT_W ) == FALSE ) + { + res = FS_GetArchiveResultCode( testdir ); + return FALSE; + } +#endif + +#if 1 + if( FS_CreateFile( testfile, FS_PERMIT_R | FS_PERMIT_W ) == FALSE ) + { + OS_TPrintf("dataPub:/testdir/test.txt already exists\n"); + //return FALSE; + } + + // dataPub:/testdir/test.txt を開いてみる + if( FS_OpenFileEx( &file, testfile, FS_FILEMODE_W ) == FALSE ) + { + return FALSE; + } + if( FS_CloseFile( &file ) == FALSE ) + { + return FALSE; + } +#endif +#elif defined(ACCESS_TEST_2) + if( FS_GetArchiveResource("rom:/", &resource) == FALSE ) + { + res = FS_GetArchiveResultCode( "dataPub:/" ); + return FALSE; + } +#elif defined(ACCESS_TEST_3) + { + FSArchive* FSi_GetArchiveChain(void); + FSArchive *arc; + + for (arc = FSi_GetArchiveChain(); arc ; arc = arc->next) + { + FSPathInfo info[1]; + char path[FS_ENTRY_LONGNAME_MAX]; + + OS_Printf("archive - %s\n", FS_GetArchiveName(arc)); + } + } +#elif defined(ACCESS_TEST_4) + { + static const char *basedir = "dataPub:/test"; + static const char *basedir2 = "dataPub:"; + char tmppath[FS_ENTRY_LONGNAME_MAX]; + FSArchiveResource resource; + static FSResult fresult; + + // at first, initialize FSFile structures. (equal to C++ constructor) + FSFile sfile[1]; + FSFile sdir[1]; + FS_InitFile(sfile); + FS_InitFile(sdir); + + if( !FS_GetArchiveResource(basedir2, &resource) ) + { + fresult = FS_GetArchiveResultCode(basedir2); + return FALSE; + } + + // DIRECTORY CREATION TEST + { + if (FS_OpenDirectory(sdir, basedir, FS_FILEMODE_R | FS_FILEMODE_W)) + { + OS_TPrintf("\"%s\" already exists.\n", basedir); + (void)FS_CloseDirectory(sdir); + } + else if (!FS_CreateDirectory(basedir, FS_PERMIT_R | FS_PERMIT_W)) + { + ReportLastErrorPath(basedir); + OS_TPanic("FS_CreateDirectory(\"%s\") failed.\n", basedir); + } + else + { + int i; + OS_TPrintf("FS_CreateDirectory(\"%s\") succeeded.\n", basedir); + for (i = 1; i <= 3; ++i) + { + (void)STD_TSPrintf(tmppath, "%s/dir%d", basedir, i); + if (!FS_CreateDirectory(tmppath, FS_PERMIT_R | FS_PERMIT_W)) + { + ReportLastErrorPath(tmppath); + OS_TPanic("FS_CreateDirectory(%s) failed.\n", tmppath); + } + else + { + OS_TPrintf("FS_CreateDirectory(%s) succeeded.\n", tmppath); + } + } + } + } + // DIRECTORY DELETION TEST + { + STD_TSPrintf(tmppath, "%s/tmp/", basedir); + if (!FS_CreateDirectory(tmppath, FS_PERMIT_R | FS_PERMIT_W)) + { + ReportLastErrorPath(tmppath); + OS_TPrintf("FS_CreateDirectory(\"%s\") failed.\n", tmppath); + } + if (!FS_DeleteDirectory(tmppath)) + { + ReportLastErrorPath(tmppath); + OS_TPanic("FS_DeleteDirectory(\"%s\") failed.\n", tmppath); + } + } + // DIRECTORY DELETE + if (!FS_DeleteDirectoryAuto(basedir)) + { + ReportLastErrorPath(basedir); + OS_TPanic("FS_DeleteDirectoryAuto(\"%s\") failed.\n", basedir); + } + } +#elif defined(ACCESS_TEST_5) + { + static const char *basedir = "dataPub:/test"; + char tmppath[FS_ENTRY_LONGNAME_MAX]; + + // at first, initialize FSFile structures. (equal to C++ constructor) + FSFile sfile[1]; + FSFile sdir[1]; + FS_InitFile(sfile); + FS_InitFile(sdir); + + // FILE CREATION TEST + { + enum { file_max = 3 }; + static const char *(message[file_max]) = + { + "hello, world!", + "foobar", + "hogehoge", + }; + int i; + for (i = 0; i < file_max; ++i) + { + STD_TSPrintf(tmppath, "%s/arm9%d.txt", basedir, i); + if (!FS_CreateFile(tmppath, FS_PERMIT_R | FS_PERMIT_W)) + { + ReportLastErrorPath(tmppath); + } + else + { + OS_TPrintf("FS_CreateFile(%s) succeeded.\n", tmppath); + if (!FS_OpenFileEx(sfile, tmppath, FS_FILEMODE_W)) + { + ReportLastErrorPath(tmppath); + OS_TPanic("FS_OpenFileEx(%s) failed.\n", tmppath); + } + else + { + if (FS_WriteFile(sfile, message[i], STD_GetStringLength(message[i])) < 0) + { + ReportLastErrorFile(sfile); + OS_TPanic("FS_WritFile() failed.\n"); + } + else + { + OS_TPrintf("FS_WritFile() succeeded.\n"); + } + } + (void)FS_CloseFile(sfile); + } + } + } + } +#endif + + return TRUE; +} +#endif diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/font.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/font.c new file mode 100644 index 00000000..30670436 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/font.c @@ -0,0 +1,574 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.c + + Copyright 2003 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 "font.h" + +//---------------------------------------------------------------- +// Character data +// +const u32 d_CharData[8 * 256] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01010010, 0x01010010, 0x00000110, // 0001h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x01011010, 0x01010010, 0x00010010, // 0002h + 0x00100010, 0x00100010, 0x00100001, 0x00100001, + 0x00000000, 0x01010001, 0x01010001, 0x01111111, // 0003h + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 0004h + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01010000, 0x01010100, 0x00001010, // 0005h + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011000, 0x01011000, 0x01111111, // 0006h + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01010010, 0x01101111, 0x01010010, // 0007h + 0x00010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x01010010, 0x01011111, 0x00000100, // 0008h + 0x00011111, 0x00001000, 0x00000001, 0x00011110, + 0x00000000, 0x01010000, 0x01011000, 0x00000110, // 0009h + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x01010000, 0x01111101, 0x00010001, // 000ah + 0x00010001, 0x00010001, 0x00010001, 0x00001010, + 0x00000000, 0x01010000, 0x01011110, 0x00100000, // 000bh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010100, 0x01011111, 0x00001000, // 000ch + 0x00010000, 0x00000001, 0x00000001, 0x00011110, + 0x00000000, 0x01010001, 0x01010001, 0x00000001, // 000dh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00011000, // 000eh + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x01010010, 0x01111111, 0x00010010, // 000fh + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00001110, 0x01010100, 0x01010010, // 0010h + 0x00111111, 0x00000100, 0x00000100, 0x00011000, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 0011h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x01010100, 0x01011111, 0x00000010, // 0012h + 0x00011110, 0x00100001, 0x00100000, 0x00011110, + 0x00000000, 0x01010000, 0x01011100, 0x00100011, // 0013h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00010000, // 0014h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x01010010, 0x01010010, 0x00001100, // 0015h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010001, 0x01111101, 0x00010001, // 0016h + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01010100, 0x01010011, 0x01110010, // 0017h + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01011110, 0x01011000, 0x00000100, // 0018h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01010000, 0x01011100, 0x00010010, // 0019h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011101, 0x01010001, 0x00111101, // 001ah + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x01110001, 0x01011101, 0x00110001, // 001bh + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01110100, 0x01010011, 0x00110010, // 001ch + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01101110, 0x01011000, 0x00100100, // 001dh + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01110000, 0x01011100, 0x00110010, // 001eh + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x01010001, 0x00111101, // 001fh + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0020h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 0021h + 0x00001000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x01101100, 0x01001000, 0x00100100, // 0022h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100100, 0x01111111, 0x00100100, // 0023h + 0x00100100, 0x01111111, 0x00010010, 0x00010010, + 0x00000000, 0x00001000, 0x01111110, 0x00001001, // 0024h + 0x00111110, 0x01001000, 0x00111111, 0x00001000, + 0x00000000, 0x01000010, 0x00100101, 0x00010010, // 0025h + 0x00001000, 0x00100100, 0x01010010, 0x00100001, + 0x00000000, 0x00001110, 0x00010001, 0x00001001, // 0026h + 0x01000110, 0x00101001, 0x00110001, 0x01001110, + 0x00000000, 0x00011000, 0x00010000, 0x00001000, // 0027h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01110000, 0x00001000, 0x00000100, // 0028h + 0x00000100, 0x00000100, 0x00001000, 0x01110000, + 0x00000000, 0x00000111, 0x00001000, 0x00010000, // 0029h + 0x00010000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x00001000, 0x01001001, 0x00101010, // 002ah + 0x00011100, 0x00101010, 0x01001001, 0x00001000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 002bh + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002ch + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002dh + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002eh + 0x00000000, 0x00000000, 0x00000000, 0x00001100, + 0x00000000, 0x01000000, 0x00100000, 0x00010000, // 002fh + 0x00001000, 0x00000100, 0x00000010, 0x00000001, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0030h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00011100, 0x00010000, 0x00010000, // 0031h + 0x00010000, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0032h + 0x00111110, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0033h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00100000, 0x00110000, 0x00101000, // 0034h + 0x00100100, 0x00100010, 0x01111111, 0x00100000, + 0x00000000, 0x01111111, 0x00000001, 0x00111111, // 0035h + 0x01000000, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x00000001, 0x00111111, // 0036h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00100000, 0x00100000, // 0037h + 0x00010000, 0x00010000, 0x00001000, 0x00001000, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0038h + 0x00111110, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0039h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003ah + 0x00000000, 0x00000000, 0x00001100, 0x00000000, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003bh + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x01100000, 0x00011000, 0x00000110, // 003ch + 0x00000001, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00000000, 0x01111111, 0x00000000, // 003dh + 0x00000000, 0x00000000, 0x01111111, 0x00000000, + 0x00000000, 0x00000011, 0x00001100, 0x00110000, // 003eh + 0x01000000, 0x00110000, 0x00001100, 0x00000011, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 003fh + 0x00110000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x00011100, 0x00100010, 0x01001001, // 0040h + 0x01010101, 0x01010101, 0x01010101, 0x00111010, + 0x00000000, 0x00001000, 0x00010100, 0x00010100, // 0041h + 0x00100010, 0x00111110, 0x01000001, 0x01000001, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0042h + 0x00111111, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0043h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x00011111, 0x00100001, 0x01000001, // 0044h + 0x01000001, 0x01000001, 0x00100001, 0x00011111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0045h + 0x01111111, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0046h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0047h + 0x01111001, 0x01000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0048h + 0x01111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x00001000, 0x00001000, // 0049h + 0x00001000, 0x00001000, 0x00001000, 0x00111110, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 004ah + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01100001, 0x00011001, 0x00000101, // 004bh + 0x00000011, 0x00000101, 0x00011001, 0x01100001, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 004ch + 0x00000001, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01000001, 0x01100011, 0x01010101, // 004dh + 0x01001001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x01000001, 0x01000011, 0x01000101, // 004eh + 0x01001001, 0x01010001, 0x01100001, 0x01000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 004fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0050h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 0051h + 0x01000001, 0x01011001, 0x00100010, 0x01011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0052h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x01000001, 0x00000001, // 0053h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00001000, 0x00001000, // 0054h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0055h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01000001, 0x01000001, 0x00100010, // 0056h + 0x00100010, 0x00010100, 0x00010100, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0057h + 0x01001001, 0x01010101, 0x01100011, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0058h + 0x00001000, 0x00010100, 0x00100010, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0059h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01111111, 0x00100000, 0x00010000, // 005ah + 0x00001000, 0x00000100, 0x00000010, 0x01111111, + 0x00000000, 0x01111100, 0x00000100, 0x00000100, // 005bh + 0x00000100, 0x00000100, 0x00000100, 0x01111100, + 0x00000000, 0x00100010, 0x00010100, 0x00111110, // 005ch + 0x00001000, 0x00111110, 0x00001000, 0x00001000, + 0x00000000, 0x00011111, 0x00010000, 0x00010000, // 005dh + 0x00010000, 0x00010000, 0x00010000, 0x00011111, + 0x00000000, 0x00001000, 0x00010100, 0x00100010, // 005eh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 005fh + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x00010000, 0x00001000, 0x00011000, // 0060h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00011110, 0x00100001, // 0061h + 0x00111110, 0x00100001, 0x00100001, 0x01011110, + 0x00000000, 0x00000001, 0x00000001, 0x00111111, // 0062h + 0x01000001, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00000000, 0x00111100, 0x01000010, // 0063h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000000, 0x01000000, 0x01111110, // 0064h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0065h + 0x01111111, 0x00000001, 0x01000001, 0x00111110, + 0x00000000, 0x00110000, 0x00001000, 0x00001000, // 0066h + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x01111110, 0x01000001, // 0067h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0068h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00001000, 0x00000000, 0x00001000, // 0069h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00100000, 0x00000000, 0x00100000, // 006ah + 0x00100000, 0x00100001, 0x00100001, 0x00011110, + 0x00000000, 0x00000001, 0x00000001, 0x01100001, // 006bh + 0x00011001, 0x00000111, 0x00011001, 0x01100001, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 006ch + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00110111, 0x01001001, // 006dh + 0x01001001, 0x01001001, 0x01001001, 0x01001001, + 0x00000000, 0x00000000, 0x00111111, 0x01000001, // 006eh + 0x01000001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00000000, 0x00011100, 0x00100010, // 006fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00000000, 0x00111101, 0x01000011, // 0070h + 0x01000001, 0x01000011, 0x00111101, 0x00000001, + 0x00000000, 0x00000000, 0x01011110, 0x01100001, // 0071h + 0x01000001, 0x01100001, 0x01011110, 0x01000000, + 0x00000000, 0x00000000, 0x00110001, 0x00001101, // 0072h + 0x00000011, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0073h + 0x00001110, 0x00110000, 0x01000001, 0x00111110, + 0x00000000, 0x00000100, 0x00000100, 0x01111111, // 0074h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0075h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0076h + 0x00100010, 0x00100010, 0x00010100, 0x00001000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0077h + 0x01001001, 0x00101010, 0x00101010, 0x00010100, + 0x00000000, 0x00000000, 0x00100001, 0x00010010, // 0078h + 0x00001100, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0079h + 0x00100010, 0x00011100, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111111, 0x00010000, // 007ah + 0x00001000, 0x00000100, 0x00000010, 0x00111111, + 0x00000000, 0x00001000, 0x00011110, 0x01100100, // 007bh + 0x00011000, 0x00100100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x00011110, 0x00000100, // 007ch + 0x00011110, 0x00110101, 0x00101101, 0x00010010, + 0x00000000, 0x00000000, 0x00000000, 0x00010001, // 007dh + 0x00100001, 0x00100001, 0x00000001, 0x00000010, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007eh + 0x00011110, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007fh + 0x00111110, 0x00010000, 0x00001100, 0x00110010, + 0x00000000, 0x00000000, 0x00000100, 0x00101111, // 0080h + 0x01000100, 0x00011110, 0x00100101, 0x00010110, + 0x00000000, 0x00000000, 0x00001010, 0x00011110, // 0081h + 0x00101011, 0x00100010, 0x00010100, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00011101, // 0082h + 0x00101011, 0x00101001, 0x00011001, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00111000, // 0083h + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00000000, 0x00000000, 0x00011100, // 0084h + 0x00100011, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000110, 0x01001001, 0x00110000, // 0085h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000100, 0x00111111, 0x00000100, // 0086h + 0x00111110, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000000, 0x00100001, 0x01000001, // 0087h + 0x01000001, 0x01000001, 0x00000001, 0x00000010, + 0x00000000, 0x00111100, 0x00000000, 0x00111110, // 0088h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00011100, 0x00000000, 0x00111110, // 0089h + 0x00010000, 0x00001000, 0x00010100, 0x01100010, + 0x00000000, 0x00100100, 0x01011111, 0x00000100, // 008ah + 0x00111110, 0x01000101, 0x01000101, 0x00100010, + 0x00000000, 0x00100010, 0x01001111, 0x01010010, // 008bh + 0x01010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x00000100, 0x00111110, 0x00001000, // 008ch + 0x00111110, 0x00010000, 0x00000010, 0x00111100, + 0x00000000, 0x00100000, 0x00011000, 0x00000110, // 008dh + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x00100000, 0x01111101, 0x00100001, // 008eh + 0x00100001, 0x00100001, 0x00100001, 0x00010010, + 0x00000000, 0x00011110, 0x00100000, 0x00000000, // 008fh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00001000, 0x01111111, 0x00010000, // 0090h + 0x00100000, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0091h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00010000, 0x01111111, 0x00011000, // 0092h + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 0093h + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x00111100, 0x00010000, 0x00001100, // 0094h + 0x01111111, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000100, 0x00011111, 0x00000100, // 0095h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00001000, 0x01111111, 0x00000100, // 0096h + 0x00111100, 0x01000010, 0x01000000, 0x00111100, + 0x00000000, 0x00000000, 0x00011100, 0x00100011, // 0097h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01111111, 0x00010000, 0x00001000, // 0098h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000010, 0x00110010, 0x00001100, // 0099h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00100100, 0x01001111, 0x01000010, // 009ah + 0x00010001, 0x00111100, 0x00010010, 0x00001100, + 0x00000000, 0x00000010, 0x01111010, 0x01000010, // 009bh + 0x00000010, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00100010, 0x00111110, 0x01010010, // 009ch + 0x01001011, 0x01101101, 0x01010101, 0x00110010, + 0x00000000, 0x00110010, 0x01001011, 0x01000110, // 009dh + 0x01000110, 0x01110010, 0x01001011, 0x00110010, + 0x00000000, 0x00011100, 0x00101010, 0x01001001, // 009eh + 0x01001001, 0x01000101, 0x01000101, 0x00110010, + 0x00000000, 0x00100001, 0x01111101, 0x00100001, // 009fh + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00000100, 0x00100011, 0x01100010, // 00a0h + 0x00100001, 0x00100001, 0x00010010, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a1h + 0x00000000, 0x00000100, 0x00001010, 0x00000100, + 0x00000000, 0x01110000, 0x00010000, 0x00010000, // 00a2h + 0x00010000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a3h + 0x00001000, 0x00001000, 0x00001000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a4h + 0x00000000, 0x00000010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00011000, // 00a5h + 0x00011000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x01111111, // 00a6h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00111111, 0x00100000, // 00a7h + 0x00010100, 0x00001100, 0x00000100, 0x00000010, + 0x00000000, 0x00000000, 0x00100000, 0x00100000, // 00a8h + 0x00010000, 0x00001111, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000100, 0x00111111, // 00a9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00aah + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00000000, 0x00010000, 0x00111111, // 00abh + 0x00011000, 0x00010100, 0x00010010, 0x00011001, + 0x00000000, 0x00000000, 0x00000010, 0x00111111, // 00ach + 0x00100010, 0x00010010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00adh + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00aeh + 0x00111110, 0x00100000, 0x00100000, 0x00111110, + 0x00000000, 0x00000000, 0x00100101, 0x00101010, // 00afh + 0x00101010, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00b0h + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x00101000, // 00b1h + 0x00011000, 0x00001000, 0x00001000, 0x00000100, + 0x00000000, 0x01000000, 0x00100000, 0x00011000, // 00b2h + 0x00010111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00001000, 0x01111111, 0x01000001, // 00b3h + 0x01000001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000000, 0x00111110, 0x00001000, // 00b4h + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00100000, 0x01111111, 0x00110000, // 00b5h + 0x00101000, 0x00100100, 0x00100010, 0x00110001, + 0x00000000, 0x00000100, 0x01111111, 0x01000100, // 00b6h + 0x01000100, 0x01000100, 0x01000010, 0x00100001, + 0x00000000, 0x00000100, 0x00111111, 0x00001000, // 00b7h + 0x01111111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x01111100, 0x01000100, 0x01000100, // 00b8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000010, 0x01111110, 0x00100010, // 00b9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00bah + 0x01000000, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 00bbh + 0x00100010, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000011, 0x00000100, 0x01000011, // 00bch + 0x01000100, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x01111111, 0x01000000, 0x00100000, // 00bdh + 0x00010000, 0x00011000, 0x00100100, 0x01000011, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00beh + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x01000001, 0x01000010, 0x01000000, // 00bfh + 0x00100000, 0x00100000, 0x00011000, 0x00000110, + 0x00000000, 0x01111110, 0x01000010, 0x01001110, // 00c0h + 0x01110001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x01100000, 0x00011110, 0x00010000, // 00c1h + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01000101, 0x01001010, 0x01001010, // 00c2h + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00c3h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000010, 0x00000010, 0x00000110, // 00c4h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x00010000, 0x00010000, 0x01111111, // 00c5h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111110, 0x00000000, // 00c6h + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000100, // 00c7h + 0x00101000, 0x00010000, 0x00101000, 0x01000110, + 0x00000000, 0x00001000, 0x01111111, 0x00100000, // 00c8h + 0x00010000, 0x00011100, 0x01101011, 0x00001000, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 00c9h + 0x00100000, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x00010010, 0x00100010, 0x00100010, // 00cah + 0x01000010, 0x01000010, 0x01000001, 0x01000001, + 0x00000000, 0x00000001, 0x00000001, 0x01111111, // 00cbh + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cch + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000100, 0x00001010, // 00cdh + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x01111111, // 00ceh + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cfh + 0x00100010, 0x00010100, 0x00001000, 0x00010000, + 0x00000000, 0x00001110, 0x01110000, 0x00001110, // 00d0h + 0x01110000, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00001000, 0x00001000, 0x00000100, // 00d1h + 0x00000100, 0x00100010, 0x01000010, 0x01111111, + 0x00000000, 0x01000000, 0x01000000, 0x00100100, // 00d2h + 0x00101000, 0x00010000, 0x00101100, 0x01000011, + 0x00000000, 0x01111111, 0x00000100, 0x01111111, // 00d3h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00d4h + 0x00100010, 0x00010100, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00d5h + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00d6h + 0x01111110, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00d7h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00d8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00001010, 0x00001010, 0x00001010, // 00d9h + 0x01001010, 0x01001010, 0x00101010, 0x00011001, + 0x00000000, 0x00000010, 0x00000010, 0x01000010, // 00dah + 0x01000010, 0x00100010, 0x00010010, 0x00001110, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dbh + 0x01000001, 0x01000001, 0x01000001, 0x01111111, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dch + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000011, 0x01000100, 0x01000000, // 00ddh + 0x01000000, 0x00100000, 0x00010000, 0x00001111, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00deh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00dfh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00011110, 0x00001000, 0x00000100, // 00e0h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x00000000, 0x00001100, 0x00010010, // 00e1h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x00100001, 0x01111101, // 00e2h + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00111100, 0x00010000, 0x00111100, // 00e3h + 0x00010000, 0x00011100, 0x00110010, 0x00001100, + 0x00000000, 0x00001110, 0x00101000, 0x00101000, // 00e4h + 0x00111110, 0x01100101, 0x00100101, 0x00010010, + 0x00000000, 0x00000100, 0x00101111, 0x01000100, // 00e5h + 0x00000110, 0x01000101, 0x01000101, 0x00111110, + 0x00000000, 0x00100010, 0x00100010, 0x00111110, // 00e6h + 0x01010010, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000100, 0x00011111, 0x00000010, // 00e7h + 0x00011111, 0x01000010, 0x01000010, 0x00111100, + 0x00000000, 0x00010010, 0x00111110, 0x01010011, // 00e8h + 0x01000010, 0x00100100, 0x00000100, 0x00000100, + 0x00000000, 0x00001000, 0x00111101, 0x01001011, // 00e9h + 0x01001001, 0x01001001, 0x00111000, 0x00000100, + 0x00000000, 0x00001000, 0x00111000, 0x00001000, // 00eah + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00011000, 0x00100000, 0x00000100, // 00ebh + 0x00111010, 0x01000110, 0x01000000, 0x00111000, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00ech + 0x01000110, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00edh + 0x01000011, 0x01001100, 0x01010010, 0x00111100, + 0x00000000, 0x00100010, 0x00110011, 0x00101010, // 00eeh + 0x00100110, 0x00100010, 0x00100011, 0x01000010, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00efh + 0x01000011, 0x01000000, 0x01000010, 0x00111100, + 0x00000000, 0x00000010, 0x00111011, 0x01000110, // 00f0h + 0x01000010, 0x01000011, 0x01000010, 0x00110010, + 0x00000000, 0x00000100, 0x00000100, 0x00000010, // 00f1h + 0x01000110, 0x01000101, 0x01000101, 0x00111001, + 0x00000000, 0x01010100, 0x01111111, 0x00100100, // 00f2h + 0x00100100, 0x00100100, 0x00100010, 0x00010001, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 00f3h + 0x00111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01011110, 0x01100010, 0x00100010, // 00f4h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010010, 0x01111110, 0x00100010, // 00f5h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 00f6h + 0x00100000, 0x00100000, 0x00100000, 0x00111111, + 0x00000000, 0x01010010, 0x01010010, 0x00111111, // 00f7h + 0x00010010, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01010011, 0x01010100, 0x00100011, // 00f8h + 0x00100100, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01010000, 0x01011111, 0x00010000, // 00f9h + 0x00001000, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x01010010, 0x01111111, 0x00100010, // 00fah + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x01010001, 0x01010010, 0x00100000, // 00fbh + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01011110, 0x01010010, 0x00100110, // 00fch + 0x00111001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01011110, 0x00010000, // 00fdh + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x00100101, 0x01001010, 0x00101010, // 00feh + 0x00100000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01011110, 0x01010000, 0x00111111, // 00ffh + 0x00001000, 0x00001000, 0x00001000, 0x00000110 +}; + + +//---------------------------------------------------------------- +// Palette data +// +const u32 d_PaletteData[8 * 16] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // black + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001f0000, 0x00000000, 0x00000000, 0x00000000, // red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00180000, 0x00000000, 0x00000000, 0x00000000, // dark red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/main.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/main.c new file mode 100644 index 00000000..ab15bdee --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/main.c @@ -0,0 +1,216 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: main.c + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +#include +#else +#include +#endif +#include +#include "font.h" +#include "screen.h" +#include "menu.h" + +static void myInit(void); +static void myVBlankIntr(void); +static void PrintBootType(void); + +extern BOOL PubDataAccessTest(void); + +/*---------------------------------------------------------------------------* + Name: NitroMain + + Description: main + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +void TwlMain(void) +#else +void NitroMain(void) +#endif +{ + u16 trigger; + u16 preButton = PAD_Read(); + u16 button; + + //---------------- initialize + myInit(); + InitMenu(); + PrintBootType(); + +#if 0 + if( PubDataAccessTest() == FALSE ) + { + OS_Printf("Data access NG\n"); + return; + } +#endif + + //---------------- main loop + while (TRUE) + { + button = PAD_Read(); + trigger = (u16)((button ^ preButton) & button); + preButton = button; + + //---- clear screen buffer + ClearScreen(); + + //---- display menus + DisplayMenuSet(); + + //---- press UP key (toggle menu) + if(trigger & PAD_KEY_UP) + { + ChangeMenuItem(MENU_ITEM_UP); + } + + if(trigger & PAD_KEY_DOWN) + { + ChangeMenuItem(MENU_ITEM_DOWN); + } + + //---- push A + if (trigger & PAD_BUTTON_A) + { + ExecMenuItem(); + } + //---- push X + if (trigger & PAD_BUTTON_X) + { + ExecMenuItemX(); + } + + OS_WaitVBlankIntr(); + } +} + +//---------------------------------------------------------------- +// myInit +// +void myInit(void) +{ + //---- init + OS_Init(); + OS_InitTick(); + OS_InitAlarm(); + RTC_Init(); + FX_Init(); + GX_Init(); + GX_DispOff(); + GXS_DispOff(); + + //---- init displaying + GX_SetBankForLCDC(GX_VRAM_LCDC_ALL); + MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE); + (void)GX_DisableBankForLCDC(); + + MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE); + MI_CpuClearFast((void *)HW_PLTT, HW_PLTT_SIZE); + MI_CpuFillFast((void *)HW_DB_OAM, 192, HW_DB_OAM_SIZE); + MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE); + + //---- setting 2D for top screen + GX_SetBankForBG(GX_VRAM_BG_128_A); + + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0xf800, GX_BG_CHARBASE_0x00000, GX_BG_EXTPLTT_01); + G2_SetBG0Priority(0); + G2_BG0Mosaic(FALSE); + GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D); + GX_SetVisiblePlane(GX_PLANEMASK_BG0); + + GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + + + + //---- setting 2D for bottom screen + GX_SetBankForSubBG(GX_VRAM_SUB_BG_128_C); + + G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0xf800, GX_BG_CHARBASE_0x00000, GX_BG_EXTPLTT_01); + G2S_SetBG0Priority(0); + G2S_BG0Mosaic(FALSE); + GXS_SetGraphicsMode(GX_BGMODE_0); + GXS_SetVisiblePlane(GX_PLANEMASK_BG0); + + GXS_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GXS_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + + + //---- screen + MI_CpuFillFast((void *)gScreen, 0, sizeof(gScreen)); + DC_FlushRange(gScreen, sizeof(gScreen)); + /* DMA操作でIOレジスタへアクセスするのでキャッシュの Wait は不要 */ + // DC_WaitWriteBufferEmpty(); + GX_LoadBG0Scr(gScreen, 0, sizeof(gScreen)); + GXS_LoadBG0Scr(gScreen, 0, sizeof(gScreen)); + + //---- init interrupt + OS_SetIrqFunction(OS_IE_V_BLANK, myVBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)GX_VBlankIntr(TRUE); + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); + + //---- FileSystemInit + (void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV); + FS_Init( FS_DMA_NOT_USE ); + + //---- start displaying + GX_DispOn(); + GXS_DispOn(); +} + +//---------------------------------------------------------------- +// myVBlankIntr +// vblank interrupt handler +// +static void myVBlankIntr(void) +{ + //---- upload pseudo screen to VRAM + DC_FlushRange(gScreen, sizeof(gScreen)); + /* DMA操作でIOレジスタへアクセスするのでキャッシュの Wait は不要 */ + // DC_WaitWriteBufferEmpty(); + GX_LoadBG0Scr(gScreen, 0, sizeof(gScreen)); + GXS_LoadBG0Scr(gScreen, 0, sizeof(gScreen)); + + + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + +static void PrintBootType(void) +{ + const OSBootType btype = OS_GetBootType(); + + switch( btype ) + { + case OS_BOOTTYPE_ROM: OS_TPrintf("OS_GetBootType = OS_BOOTTYPE_ROM\n"); break; + case OS_BOOTTYPE_NAND: OS_TPrintf("OS_GetBootType = OS_BOOTTYPE_NAND\n"); break; + default: + { + OS_Warning("unknown BootType(=%d)", btype); + } + break; + } +} + diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/menu.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/menu.c new file mode 100644 index 00000000..a81ad802 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/menu.c @@ -0,0 +1,392 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: menu.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 "font.h" +#include "screen.h" +#include "menu.h" +#include "dataver.h" +#include + +/* + * menu.c + * メニュー表示機能 + * + * テストアプリに適した簡単なメニュー表示を行う。メニュー階層は複数段可能。 + * + * なお、この機能を使用するためには、以下のソースが必要 + * font.c, font.h, screen.c, screen.h + * + * 導入手順: + * 1, menu.hの以下の定義値を変更する + * MENU_DEPTH_NUM : メニューの階層数 + * MENU_ITEM_NUM : メニュー項目の最大数 + * MENU_ITEM_STRLEN : メニュー表示文字列の最大長 + * 2, menu.cの以下の定義を変更する + * MENU_TITLE : メニューのタイトル + * 3, 以下の構造体を変更する + * MenuItem : メニュー表示内容および階層間情報 + * 4, 関数 ExecMenuItem() がメニュー項目に応じた処理を定義するハンドラなので、 + * 定義を行う + * 5, Mainから以下の関数を呼ぶ + * InitMenu : メニュー関連の初期化 + * DisplayMenuSet : メニュー機能の表示 + * ChangeMenuItem : メニュー選択項目の変更(この関数はキー操作時に呼び出すようにする) + * ExecMenuItem : メニュー項目に応じた処理の実行(この関数はキー操作時に呼び出すようにする) + * + * + * 不明な点は安田まで。 + */ + +#define MENU_TITLE "APP version viewer" +//#define NEW_MENU_POS // YASUDA +#define DRAW_LINE_AS_CHAR + +static char cItemStr[9][MENU_ITEM_STRLEN]; + +static menu_sheet_t MenuItem[MENU_DEPTH_NUM] = +{ + {-1, 1, cItemStr[0], 2, cItemStr[1], 3, cItemStr[2], 4, cItemStr[3], + 5, cItemStr[4], 6, cItemStr[5], 7, cItemStr[6], 8, cItemStr[7], + -1, cItemStr[8] } +}; + +static s16 MenuDepth; +static s16 MenuPos; +static u8 isMenuCancel; + +//---- for RTC +static RTCTime myCurrentTime; +static int myResult; + +static void DisplayMenu(void); +static void EnterMenuCancel(void); + +static void setAllItems(void); +static void setAppVerItem(void); +static void setPublicDataItem(void); +static void setPrivateDataItem(void); + +// YASUDA +extern FSResult g_fs_result; + +//---------------------------------------------------------------- +// InitMenu +// +void InitMenu(void) +{ + MenuDepth = 0; + MenuPos = 2; + + setAllItems(); +#if defined(DRAW_LINE_AS_CHAR) + STD_CopyString( MenuItem[0].sItem[1].cItemStr, "---------+------------" ); + STD_CopyString( MenuItem[0].sItem[5].cItemStr, "---------+------------" ); +#endif +} + +//---------------------------------------------------------------- +// DisplayMenuSet +// +void DisplayMenuSet(void) +{ + if(isMenuCancel > 0) + { + return; + } + + //---- display key description + PrintString(3, 2, 15, MENU_TITLE); + //PrintString(3, 3, 15, "parameter is %d", param); + DisplayMenu(); + + //---- display time + myResult = RTC_GetTime(&myCurrentTime); + if (myResult == 0 /*no error */ ) + { +#if !defined(NEW_MENU_POS) + PrintString(5, 21, 8, "%02d:%02d:%02d", + myCurrentTime.hour, myCurrentTime.minute, myCurrentTime.second); +#else + PrintString(5, 23, 8, "%02d:%02d:%02d", + myCurrentTime.hour, myCurrentTime.minute, myCurrentTime.second); +#endif + } + + //---- display counter + //PrintString(18, 20, 4, "%08X", OS_GetVBlankCount()); + + //---- display control infomation +#if !defined(NEW_MENU_POS) + PrintString(5, 17, 15, "[A] set current data"); + PrintString(5, 18, 15, "[X] set both data"); + PrintString(5, 19, 15, "[up/down] switch item"); +#else + PrintString(5, 19, 15, "[A] set current data"); + PrintString(5, 20, 15, "[X] set both data"); + PrintString(5, 21, 15, "[up/down] switch item"); +#endif +} + +//---------------------------------------------------------------- +// DisplayMenu +// +static void DisplayMenu(void) +{ + u16 pos; + char *str; + + for(pos = 0; pos < MENU_ITEM_NUM; pos++) + { + str = MenuItem[MenuDepth].sItem[pos].cItemStr; + //---- display key description + if( str[0] != '\0' ) + { +#if !defined(DRAW_LINE_AS_CHAR) + PrintString(3, (s16)(5 + pos), 15, str); +#else + if( (pos != 1) && (pos != 5) ) + { + PrintString(3, (s16)(5 + pos), 15, str); + } + else + { + PrintString(3, (s16)(5 + pos), 6, str); + } +#endif + } + + PrintString(1, (s16)(5 + MenuPos), 8, "#"); + } +} + + +//---------------------------------------------------------------- +// ChangeMenuItem +// +void ChangeMenuItem(u16 action) +{ + switch(action) + { + case MENU_ITEM_UP: + ColorString((s16)(1 + MenuPos), 5, 1, 0); + MenuPos--; + if(MenuPos < 0) + { + MenuPos = 0; + } + //動作のチューニング + if( (MenuPos>=0) && (MenuPos<6) ) + { + MenuPos = 2; + } + if( (MenuPos>=6) && (MenuPos<9) ) + { + MenuPos = 6; + } + break; + case MENU_ITEM_DOWN: + ColorString((s16)(1 + MenuPos), 5, 1, 0); + MenuPos++; + if(MenuPos >= MENU_ITEM_NUM) + { + MenuPos--; + } + if(MenuItem[MenuDepth].sItem[MenuPos].cItemStr[0] == '\0') + { + MenuPos--; + } + //動作のチューニング + if( (MenuPos>0) && (MenuPos<=2) ) + { + MenuPos = 2; + } + if( (MenuPos>2) && (MenuPos<=9) ) + { + MenuPos = 6; + } + break; + case MENU_DEPTH_UP: + MenuDepth = MenuItem[MenuDepth].nPrev; + MenuPos = 0; + if(MenuDepth < 0) + { + MenuDepth = 0; + } + break; + case MENU_DEPTH_DOWN: + { + s16 pos; + pos = MenuItem[MenuDepth].sItem[MenuPos].nNext; + if(pos >= 0) + { + MenuDepth = pos; + MenuPos = 0; + } + } + break; + } +} + + +//---------------------------------------------------------------- +// ExecMenuItem +// +void ExecMenuItem(void) +{ + switch(MenuDepth) + { + case 0: + switch(MenuPos) + { + case 0: + break; + case 1: + case 2: + case 3: + // Public data タイムスタンプ変更 + SetPublicDataTimeStamp(); +#if 0 // YASUDA + STD_TSPrintf( cItemStr[1], "PUB err : %d", g_fs_result ); +#else + setPublicDataItem(); +#endif + break; + case 4: + case 5: + case 6: + // Private data タイムスタンプ変更 + SetPrivateDataTimeStamp(); + setPrivateDataItem(); + break; + default: + break; + } + break; + default: + break; + } +} + +//---------------------------------------------------------------- +// ExecMenuItemX +// +void ExecMenuItemX(void) +{ + switch(MenuDepth) + { + case 0: + switch(MenuPos) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + // 両 data タイムスタンプ変更 + SetPublicDataTimeStamp(); + SetPrivateDataTimeStamp(); + setAllItems(); + break; + default: + break; + } + break; + default: + break; + } +} + +//---------------------------------------------------------------- +// EnterMenuCancel +// +static void EnterMenuCancel(void) +{ + isMenuCancel = 1; + ClearScreen(); +} + +//---------------------------------------------------------------- +// ExitMenuCancel +// +void ExitMenuCancel(void) +{ + if(isMenuCancel > 0){ + isMenuCancel = 0; + } +} + +void SetMenuString(u32 depth, u32 ipos, char *str) +{ + STD_CopyString( MenuItem[depth].sItem[ipos].cItemStr, str ); +} + +void SetCurrentMenuString(char *str) +{ + SetMenuString( MenuDepth, MenuPos, str ); +} + +static void setAllItems(void) +{ + setAppVerItem(); + setPublicDataItem(); + setPrivateDataItem(); +} + +static void setAppVerItem(void) +{ + char ver[8]; + + GetAppVersionString(ver); + STD_TSPrintf( cItemStr[0], "APP ver : %s", ver ); +} + +static void setPublicDataItem(void) +{ + char ver[8], time1[16], time2[16]; + + if( GetPublicDataInfoStrings( ver, time1, time2 ) == TRUE ) + { + STD_TSPrintf( cItemStr[2], "PUB ver : %s", ver ); + STD_TSPrintf( cItemStr[3], " date : %s", time1 ); + STD_TSPrintf( cItemStr[4], " : %s", time2 ); + } + else + { + STD_TSPrintf( cItemStr[2], "PUB : NONE", ver ); + STD_TSPrintf( cItemStr[3], " " ); + STD_TSPrintf( cItemStr[4], " " ); + } +} + +static void setPrivateDataItem(void) +{ + char ver[8], time1[16], time2[16]; + + if( GetPrivateDataInfoStrings( ver, time1, time2 ) == TRUE ) + { + STD_TSPrintf( cItemStr[6], "PRV ver : %s", ver ); + STD_TSPrintf( cItemStr[7], " date : %s", time1 ); + STD_TSPrintf( cItemStr[8], " : %s", time2 ); + } + else + { + STD_TSPrintf( cItemStr[6], "PRV : NONE" ); + STD_TSPrintf( cItemStr[7], " " ); + STD_TSPrintf( cItemStr[8], " " ); + } +} diff --git a/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/screen.c b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/screen.c new file mode 100644 index 00000000..58b6c424 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/DisplayVersion_target/src/screen.c @@ -0,0 +1,115 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.c + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +#include +#else +#include +#endif +#include "screen.h" + +u16 gScreen[32 * 32]; + +// ** these code are refer to rtc sample. thanks. +/*---------------------------------------------------------------------------* + Name: ClearScreen + + Description: clear screen buffer + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void ClearScreen(void) +{ + MI_CpuClearFast((void *)gScreen, sizeof(gScreen)); +} + +/*---------------------------------------------------------------------------* + Name: PrintString + + Description: enter string into screen buffer + string must be within 32 chars + + Arguments: x : x + y : y + palette : color (0-15) + text : string. end mark is NULL + + Returns: None. + *---------------------------------------------------------------------------*/ +void PrintString(s16 x, s16 y, u8 palette, char *text, ...) +{ + va_list vlist; + char temp[32 + 2], *tempPtr; + s32 i; + u16 *p, *pLimit; + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + *(u16 *)(&temp[32]) = 0; + p = &gScreen[((y * 32) + x) % (32 * 32)]; + pLimit = &gScreen[32 * 32]; + tempPtr = &temp[0]; + + for (i = 0; *tempPtr; i++, tempPtr++) + { + *p = (u16)((palette << 12) | *tempPtr); + if (++p >= pLimit) + { + p = &gScreen[0]; + } + } +} + +/*---------------------------------------------------------------------------* + Name: ColorString + + Description: change string color which is put in screen buffer + + Arguments: x : x + y : y + length : number of characters to change color + palette : color (0-15) + + Returns: None. + *---------------------------------------------------------------------------*/ +void ColorString(s16 x, s16 y, s16 length, u8 palette) +{ + s32 i; + u16 *p, *pLimit; + + if (length < 0) + return; + + p = &gScreen[((y * 32) + x) % (32 * 32)]; + pLimit = &gScreen[32 * 32]; + + for (i = 0; i < length; i++) + { + u16 temp = *p; + temp &= 0x0fff; + temp |= (palette << 12); + *p = temp; + + if (++p >= pLimit) + { + p = &gScreen[0]; + } + } +} diff --git a/build/debugsoft/MakerTitle/SaveData/Makefile b/build/debugsoft/MakerTitle/SaveData/Makefile new file mode 100644 index 00000000..ec164d0e --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/Makefile @@ -0,0 +1,28 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - save_data +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- + +SUBDIRS = DisplayVersion_target \ + DisplayVersion \ + + + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/MakerTitle/SaveData/readme.txt b/build/debugsoft/MakerTitle/SaveData/readme.txt new file mode 100644 index 00000000..5290e288 --- /dev/null +++ b/build/debugsoft/MakerTitle/SaveData/readme.txt @@ -0,0 +1,30 @@ +同一メーカータイトルのセーブデータ検証アプリ + +【概要】 + +同一メーカータイトルアプリのセーブデータへのアクセスを検証するアプリケーションセットです。 + + +【アプリケーションリスト】 +コンパイルすると、/debugsoft/dispver以下に以下のファイルが生成されます。 + +・dispver_TARGET.tad [4VDA] +  … セーブデータをアクセスされるアプリ(ダミーアプリ) + +・dispver_SEQURE.tad [4S4A] +  … 同一メーカータイトルへのアクセスを行うセキュアアプリ +・dispver_USER.tad  [4S5A] +  … 同一メーカータイトルへのアクセスを行うユーザアプリ + + +【実行手順】 +Nmenu等を使って、3つのファイル全てをNANDにインポートします。 +その後、SEQURE, USERを起動すると、TARGETのアプリにアクセスできることが確認できます。 +アプリ自身の仕様については、/DisplayVersion 以下のreadme.txtを参照して下さい。 + + +【制限事項】 +・USERアプリについては、OTHERや APP Verなどの項目が正常には表示されません。 +・USERアプリについて、OTHER が 0 appsいなっていても、そこでAボタンを押すと、4VDAのセーブデータへアクセス可能です。これは正しい動作です。 + + diff --git a/build/debugsoft/MakerTitle/TitleList/Makefile b/build/debugsoft/MakerTitle/TitleList/Makefile new file mode 100644 index 00000000..1acd6ed2 --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/Makefile @@ -0,0 +1,294 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - save_data - DisplayVersion +# File: Makefile +# +# Copyright 2007 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 + + + +ifeq ($(ROM_NAME),) + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +do-build: do-something-build +clean: do-something +clobber: do-something +install: do-something +do-build: MY_GOAL= +clean: MY_GOAL=clean +clobber: MY_GOAL=clobber +install: MY_GOAL=install + +do-something-build: + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=A SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=B SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=C SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=D SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=E SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=F SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=G SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=H SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=I SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=J SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=A USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=B USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=C USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=D USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=E USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=F USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=G USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=H USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=I USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=J USE_SPECIAL=TRUE SKIP_SUBDIR=FALSE $(MY_GOAL) + + +do-something: + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=A SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=B SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=C SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=D SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=E SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=F SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=G SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=H SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=I SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) TWLSDK_PLATFORM=TWL ROM_NAME=J SKIP_SUBDIR=FALSE $(MY_GOAL) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + + +else + +SUBDIRS = +MACRO_FLAGS := + +#---------------------------------------------------------------------------- +TWL_NANDAPP := TRUE +MASTER_NAME := TitleList +APP_NAME = $(MASTER_NAME)_$(ROM_NAME) + +SRCS = main.c font.c screen.c appmain.c + +LLIBRARIES = libnam$(TWL_LIBSUFFIX).a libes$(TWL_LIBSUFFIX).a \ + libsea$(TWL_LIBSUFFIX).a libboc$(TWL_LIBSUFFIX).a \ + libsfs$(TWL_LIBSUFFIX).a + + +#------------------------- +#-- API タイプの指定 +ifeq ($(USE_SPECIAL),) +API_TYPE = NORMAL +else +API_TYPE = SPECIAL +MACRO_FLAGS += -DUSE_SPECIAL +endif + + +#------------------------- +#-- ROM A 〜 Jまでのパラメータ設定 + +# デフォルトのロムパラメータ +PUB_SAVE := 16K +PRV_SAVE := 16K +MAKER_CODE := 01 +SEQURE := FALSE +APP_TYPE := User + +ifeq ($(ROM_NAME),A) +APP_TYPE := System +SEQURE := TRUE +endif + +ifeq ($(ROM_NAME),B) +APP_TYPE := System +endif + +ifeq ($(ROM_NAME),C) +endif + +ifeq ($(ROM_NAME),D) +PRV_SAVE := 0K +endif + +ifeq ($(ROM_NAME),E) +PUB_SAVE := 0K +endif + +ifeq ($(ROM_NAME),F) +PRV_SAVE := 0K +PUB_SAVE := 0K +endif + +ifeq ($(ROM_NAME),G) +MAKER_CODE := 02 +endif + +ifeq ($(ROM_NAME),H) +MAKER_CODE := 02 +PRV_SAVE := 0K +endif + +ifeq ($(ROM_NAME),I) +MAKER_CODE := 02 +PUB_SAVE := 0K +endif + +ifeq ($(ROM_NAME),J) +MAKER_CODE := 02 +PRV_SAVE := 0K +PUB_SAVE := 0K +endif + + + +ENABLE_PUB := TRUE +ENABLE_PRV := TRUE + +ifeq ($(ENABLE_PUB),0K) +ENABLE_PUB := FALSE +endif + +ifeq ($(ENABLE_PRV),0K) +ENABLE_PRV := FALSE +endif + + +GAME_CODE = 4K$(ROM_NAME)A +TARGET_BIN = $(APP_NAME).tad + + + +#------------------------- +#-- NAND アプリではいくつかのパラメータの指定のために固有の RSF ファイルが必要です。 + +ROM_SPEC = $(MASTER_NAME).$(ROM_NAME).autogen.rsf +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf +ROM_SPEC_PARAM = MakerCode=$(MAKER_CODE) \ + TitleName=TITLE_LIST_$(ROM_NAME) \ + GameCode=$(GAME_CODE) \ + BannerFile=./banner/banner_$(ROM_NAME).bnr \ + PublicSaveDataSize=$(PUB_SAVE) \ + PrivateSaveDataSize=$(PRV_SAVE) \ + WramMapping=MAP_TS_SCR \ + AppType=$(APP_TYPE) \ + Media=NAND \ + Secure=$(SEQURE) \ + + + +#------------------------- +#-- NAMを使うためにsecure componentを使う + +COMPONENT_NAME = armadillo +MAKEROM_ARM7_BASE = $(TWL_COMPONENTSDIR)/$(COMPONENT_NAME)/$(TWL_BUILDTYPE_ARM7)/$(COMPONENT_NAME) +MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).$(TWL_ELF_EXT) + +#------------------------- +# インストール指定 + +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/$(MASTER_NAME)/$(API_TYPE) +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + +#------------------------- +#-- カードアプリと同様に ROM-FS にファイルを持たせます。 + +#MAKEROM_ROMROOT = ./rom_data +#MAKEROM_ROMFILES = *.* + +#------------------------- +#-- バナーデータを生成します +BANNER = ./banner/banner_$(ROM_NAME).bnr +BANNERSRC := ./banner/data/Cell/Cell_$(ROM_NAME).nce +#BANNERSRC := $(wildcard ./banner/data/Cell/*.nce) +MAKEBANNER = $(TWL_TOOLSDIR)/bin/makebanner.TWL.exe +BANNERCVTR = $(TWL_TOOLSDIR)/bin/bannercvtr.exe + +#------------------------- +# rom 内のファイルは全て自動生成なので clean で削除されるようにします +LDIRT_CLEAN = $(MAKEROM_ROMROOT) + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +ifeq ($(SEQURE),TRUE) +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe # commondefs を include した後でなければならない +MAKETAD_OPTION := -s # modulerules を include する前でなければならない +else +ifeq ($(APP_TYPE),System) +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.sys.exe # commondefs を include した後でなければならない +MAKETAD_OPTION := -s # modulerules を include する前でなければならない +else +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.exe # commondefs を include した後でなければならない +endif +endif +#---------------------------------------------------------------------------- + +#MACRO_FLAGS += -DMYCODE=\"$(GAME_CODE)\" +#MACRO_FLAGS += -DMYNAME=\"$(ROM_NAME)\" +#MACRO_FLAGS += -DENABLEPUB=$(ENABLE_PUB) +#MACRO_FLAGS += -DENABLEPRV=$(ENABLE_PRV) + + +do-build: rmlcf mycode $(TARGETS) +#do-build: rmlcf $(TARGETS) + +.PHONY: mycode rmlcf + +mycode: + echo -e "#ifndef MYCODE_\n#define MYCODE_\n#define MYCODE \"$(GAME_CODE)\"\n#define MYNAME \"$(ROM_NAME)\"\n#define ENABLEPUB $(ENABLE_PUB)\n#define ENABLEPRV $(ENABLE_PRV)\n\n#endif" > ./include/mycode.h + +#mycode: +# echo -e "#ifndef MYCODE_\n#define MYCODE_\n#define MYCODE \"$(GAME_CODE)\"\n#define MYNAME \"$(ROM_NAME)\"\n#define ENABLEPUB $(ENABLE_PUB)\n#define ENABLEPRV $(ENABLE_PRV)\n\n#endif" > ./include/mycode.h + + +rmlcf: + rm -rf $(BINDIR)/*.lcf + +#------------------------- +#-- SRL を作成する前にバナーが作成されるようにします。 + +$(BINDIR)/$(TARGET_BIN_BASENAME).$(TWL_ELF_EXT): make_dir +#$(BINDIR)/$(TARGET_BIN_BASENAME).$(TWL_ELF_EXT): $(BANNER) make_dir + +#------------------------- +#-- rom_data/build_time.txt を作成します。 + +make_dir: + $(INSTALL) -d $(MAKEROM_ROMROOT) +#build_time: +# $(INSTALL) -d $(MAKEROM_ROMROOT) +# echo -n "build at `date \"+%Y/%m/%d %H:%M:%S\"` on \"`hostname`\"" > $(MAKEROM_ROMROOT)/build_time.txt + +#------------------------- +#-- バナー作成用ターゲット + +$(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 + +endif + +#===== End of Makefile ===== diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_A.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_A.bnr new file mode 100644 index 00000000..1af566da Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_A.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_A.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_A.bsf new file mode 100644 index 00000000..9fe5011a Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_A.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_B.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_B.bnr new file mode 100644 index 00000000..5cec127e Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_B.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_B.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_B.bsf new file mode 100644 index 00000000..f8ea7018 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_B.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_C.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_C.bnr new file mode 100644 index 00000000..a5326216 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_C.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_C.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_C.bsf new file mode 100644 index 00000000..59013f90 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_C.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_D.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_D.bnr new file mode 100644 index 00000000..bcc3a8a9 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_D.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_D.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_D.bsf new file mode 100644 index 00000000..1c3d9973 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_D.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_E.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_E.bnr new file mode 100644 index 00000000..683b9c0e Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_E.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_E.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_E.bsf new file mode 100644 index 00000000..5ed0366b Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_E.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_F.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_F.bnr new file mode 100644 index 00000000..c220052d Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_F.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_F.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_F.bsf new file mode 100644 index 00000000..a0ee3ccd Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_F.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_G.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_G.bnr new file mode 100644 index 00000000..cf8a7efb Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_G.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_G.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_G.bsf new file mode 100644 index 00000000..86916741 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_G.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_H.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_H.bnr new file mode 100644 index 00000000..5bb665bd Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_H.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_H.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_H.bsf new file mode 100644 index 00000000..6c4f8dff Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_H.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_I.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_I.bnr new file mode 100644 index 00000000..961b5c7c Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_I.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_I.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_I.bsf new file mode 100644 index 00000000..699b804e Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_I.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_J.bnr b/build/debugsoft/MakerTitle/TitleList/banner/banner_J.bnr new file mode 100644 index 00000000..c02e0461 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_J.bnr differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/banner_J.bsf b/build/debugsoft/MakerTitle/TitleList/banner/banner_J.bsf new file mode 100644 index 00000000..14475cce Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/banner_J.bsf differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_A.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_A.nce new file mode 100644 index 00000000..34aa5f8f Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_A.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_B.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_B.nce new file mode 100644 index 00000000..4a31775b Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_B.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_C.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_C.nce new file mode 100644 index 00000000..5327b480 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_C.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_D.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_D.nce new file mode 100644 index 00000000..a44c31bf Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_D.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_E.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_E.nce new file mode 100644 index 00000000..a89d8f72 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_E.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_F.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_F.nce new file mode 100644 index 00000000..b1c01841 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_F.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_G.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_G.nce new file mode 100644 index 00000000..1a426982 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_G.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_H.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_H.nce new file mode 100644 index 00000000..4fbd9ea5 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_H.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_I.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_I.nce new file mode 100644 index 00000000..68899287 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_I.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_J.nce b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_J.nce new file mode 100644 index 00000000..bff60169 Binary files /dev/null and b/build/debugsoft/MakerTitle/TitleList/banner/data/Cell/Cell_J.nce differ diff --git a/build/debugsoft/MakerTitle/TitleList/include/appmain.h b/build/debugsoft/MakerTitle/TitleList/include/appmain.h new file mode 100644 index 00000000..5aa7f062 --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/include/appmain.h @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK_IPL - debugsoft - MakerTitle - TitleList + File: appmain.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef APPMAIN_H_ +#define APPMAIN_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +#include + +void DrawScreen(void); +void DoWritingTest(void); +void DoReadingTest(void); +void DeleteSaveDatas(void); +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* SCREEN_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/TitleList/include/font.h b/build/debugsoft/MakerTitle/TitleList/include/font.h new file mode 100644 index 00000000..a323d9e1 --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/include/font.h @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef FONT_H_ +#define FONT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ + +#include + +extern const u32 d_CharData[8 * 256]; +extern const u32 d_PaletteData[8 * 16]; + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* FONT_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/TitleList/include/screen.h b/build/debugsoft/MakerTitle/TitleList/include/screen.h new file mode 100644 index 00000000..0387a9ae --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/include/screen.h @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: screen.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef SCREEN_H_ +#define SCREEN_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +#include + +extern u16 gScreen[2][32 * 32]; + +void ClearScreen(void); +void ClearSubScreen(void); +void PrintString(s16 x, s16 y, u8 palette, char *text, ...); +void ColorString(s16 x, s16 y, s16 length, u8 palette); + +/*===========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* SCREEN_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/MakerTitle/TitleList/include/title.h b/build/debugsoft/MakerTitle/TitleList/include/title.h new file mode 100644 index 00000000..74d93621 --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/include/title.h @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK_IPL - debugsoft - MakerTitle - TitleList + File: title.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +// セーブデータチェック対象ロム +static char* GAMECODE_LIST[] = { + "4KAA", + "4KBA", + "4KCA", + "4KDA", + "4KEA", + "4KFA", + "4KGA", + "4KHA", + "4KIA", + "4KJA", +}; + +static const u32 TITLE_COUNT = sizeof(GAMECODE_LIST) / sizeof(char*); + +static u64 TITLE_ID_HIGH[] = { + 0x00030015ull, + 0x00030005ull, + 0x00030004ull, + 0x00030004ull, + 0x00030004ull, + 0x00030004ull, + 0x00030004ull, + 0x00030004ull, + 0x00030004ull, + 0x00030004ull, +}; + +// PublicとPrivateの有無 +static BOOL DATA_EXIST[TITLE_COUNT][2] = { + {TRUE, TRUE}, // A + {TRUE, TRUE}, // B + {TRUE, TRUE}, // C + {TRUE, FALSE}, // D + {FALSE, TRUE}, // E + {FALSE, FALSE}, // F + {TRUE, TRUE}, // G + {TRUE, FALSE}, // H + {FALSE, TRUE}, // I + {FALSE, FALSE}, // J + +}; + diff --git a/build/debugsoft/MakerTitle/TitleList/src/appmain.c b/build/debugsoft/MakerTitle/TitleList/src/appmain.c new file mode 100644 index 00000000..85bf2d27 --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/src/appmain.c @@ -0,0 +1,312 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK_IPL - debugsoft - MakerTitle - TitleList + File: appmain.c + + Copyright 2003 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 "appmain.h" +#include "screen.h" +#include "mycode.h" +#include "title.h" +#include +#include +#include +#include + +BOOL TestWriting(const char* code, BOOL out_results[2]); +BOOL WriteFile(const char* arc_name, const char* file_name); +BOOL ReadFile(const char* arc_name, const char* file_name, char* out, int len); +void PrintResult(int x, int y, char* text); + +static FSFATFSArchiveWork archiveWork ATTRIBUTE_ALIGN(32); + +const char* ARC_NAME[2] = { + "otherPub:/", + "otherPrv:/", +}; + + +const char* SAV_NAME[2] = { + "dataPub:/", + "dataPrv:/", +}; + +const char* FILE_NAME = "save.dat"; + +BOOL TestWriting(const char* code, BOOL out_results[2]) +{ + s32 i = 0; + +#ifndef USE_SPECIAL + const NATitleArchive arc[2] = { + NA_TITLE_ARCHIVE_DATAPUB, + NA_TITLE_ARCHIVE_DATAPRV, + }; +#else + const char* arc[2] = { + "otherPub", + "otherPrv", + }; + u32 lo = 0; + OSTitleId TitleID; + lo = MI_LoadBE32(code); + TitleID = (TITLE_ID_HIGH[code[2] - 'A'] << 32) | lo; + +#endif + + + for(i = 0; i < 2; ++i) + { +#ifndef USE_SPECIAL + FSResult res = NA_LoadOtherTitleArchive(code, arc[i]); +#else + FSResult res = FSi_MountSpecialArchive(TitleID, arc[i], &archiveWork); + OS_TPrintf("%llu \n", TitleID); + OS_TPrintf("%lu lu\n", TitleID >> 32, TitleID); +#endif + out_results[i] = (res != FS_RESULT_SUCCESS) ? FALSE : TRUE; + if(res != FS_RESULT_SUCCESS) + { + OS_TPrintf("Mount Failed:%s\n", code); + OS_TPrintf("ErrorCode:%d\n", res); + continue; + } + + WriteFile(ARC_NAME[i], FILE_NAME); + +#ifndef USE_SPECIAL + NA_UnloadOtherTitleArchive(); +#else + FSi_MountSpecialArchive(TitleID, NULL, &archiveWork); +#endif + } + + return out_results[0] | out_results[1]; +} + +BOOL WriteFile(const char* arc_name, const char* file_name) +{ + FSFile fp; + char buf[256]; + s32 len = 0; + + STD_TSPrintf(buf, "%s%s", arc_name, file_name); + + FS_InitFile(&fp); + FS_CreateFile(buf, FS_PERMIT_W | FS_PERMIT_R); + + if(!FS_OpenFileEx(&fp, buf, FS_FILEMODE_RW)) + { + OS_TPrintf("Open Fail:%s\n", buf); + return FALSE; + } + + FS_SeekFileToEnd(&fp); + len = STD_TSPrintf(buf, "Written by [%s]\n", MYNAME); + FS_WriteFile(&fp, buf, len); + FS_CloseFile(&fp); + + return TRUE; +} + +void DrawScreen(void) +{ + PrintString(0, 0, 15, "GameCode:%s", MYCODE); + PrintString(0, 2, 15, "A - Writing test to other apps"); + PrintString(0, 3, 15, "B - Show my save data"); + if(STD_StrCmp("4KAA", MYCODE) == 0) + { + PrintString(0, 4, 15, "X - Clear save datas"); + } +} + +void DoWritingTest(void) +{ + BOOL results[TITLE_COUNT][2]; + s16 i = 0; + char* result_char[3] = {"O", "X", "-"}; + + MI_CpuClear8(results, sizeof(results)); + + ClearSubScreen(); + PrintString(0, 24, 15, "APP : PUB PRV WRITE"); + PrintString(0, 25, 15, "---------------------"); + for(i = 0; i < TITLE_COUNT; ++i) + { + char buf[256]; + char format[] = "ROM %c: %s %s %s"; + // 自分自身はチェックしない +// OS_TPrintf("%s %s\n", GAMECODE_LIST[i], MYCODE); + if(STD_StrCmp(GAMECODE_LIST[i], MYCODE) == 0){ + STD_TSPrintf(buf, format, 'A' + i, "-", "-", "-"); + } + else + { + s32 result_code[3] = {0, 0, 0}; + TestWriting(GAMECODE_LIST[i], results[i]); + result_code[0] = (!DATA_EXIST[i][0]) ? 2 : (results[i][0] ? 0 : 1); + result_code[1] = (!DATA_EXIST[i][1]) ? 2 : (results[i][1] ? 0 : 1); + result_code[2] = (result_code[0] == 2 && result_code[1] == 2) ? 2 : (result_code[0] != 1 && result_code[1] != 1) ? 0 : 1; + STD_TSPrintf(buf, format, 'A' + i, + result_char[result_code[0]], + result_char[result_code[1]], + result_char[result_code[2]] + ); + } + OS_TPrintf("%s\n", buf); + PrintString(0, (s16)(26 + i), 15, buf); + } +} + +void DoReadingTest(void) +{ + char read_buf[2048]; + + ClearSubScreen(); + + { + s32 i = 0; + BOOL result[2] = {FALSE, FALSE}; + + PrintString(0, 24, 15, "Public"); + PrintString(16, 24, 15, "Private"); + for(i = 0; i < 2; ++i) + { + MI_CpuClear8(read_buf, sizeof(read_buf)); + result[i] = ReadFile(SAV_NAME[i], FILE_NAME, read_buf, sizeof(read_buf)); +/* if(!result[i]) + { + continue; + }*/ + OS_TPrintf("%s%s\n", SAV_NAME[i], FILE_NAME); + OS_TPrintf("%s\n", read_buf); + OS_TPrintfEx("% 256.16b\n", read_buf); + + PrintResult(i * 16, 25, read_buf); + } + } +} + +BOOL ReadFile(const char* arc_name, const char* file_name, char* out, int len) +{ + FSFile fp; + char buf[256]; + + STD_TSPrintf(buf, "%s%s", arc_name, file_name); + + FS_InitFile(&fp); + + if(!FS_OpenFileEx(&fp, buf, FS_FILEMODE_R)) + { + FSResult res; + + res = FS_GetArchiveResultCode(buf); + OS_TPrintf("Code:%d\n", res); + OS_TPrintf("Open Fail:%s\n", buf); + if(res == FS_RESULT_ERROR) + { + STD_TSPrintf(out, "None.\n"); + } + else if(res == FS_RESULT_NO_ENTRY) + { + STD_TSPrintf(out, "File not found.\n"); + } + else + { + STD_TSPrintf(out,"Error:%d\n%s Open Failed\n", res, buf); + } + return FALSE; + } + + FS_ReadFile(&fp, out, len); + FS_CloseFile(&fp); + + return TRUE; +} + +void PrintResult(int x, int y, char* text) +{ + int len = 0, i = 0; + char *p = text, *next = NULL; + char buf[2048]; + while(*p != '\0') + { + next = STD_StrChr(p, '\n'); + STD_CopyLStringZeroFill(buf, p, next - p + 1); + OS_TPrintf("str:%s\n", buf); + PrintString((short)x, (short)y, 15, buf); + y++; + p = next + 1; + } +} + +void DeleteSaveDatas(void) +{ + int i = 0, j = 0, k = 0; +#ifndef USE_SPECIAL + const NATitleArchive arc[2] = { + NA_TITLE_ARCHIVE_DATAPUB, + NA_TITLE_ARCHIVE_DATAPRV, + }; +#else + const char* arc[2] = { + "otherPub", + "otherPrv", + }; + u32 lo = 0; + OSTitleId TitleID; +#endif + + + ClearSubScreen(); + for(i = 0; i < TITLE_COUNT; ++i) + { + for(j = 0; j < 2; ++j) + { + char path[256]; + FSResult res; +#ifndef USE_SPECIAL + res = NA_LoadOtherTitleArchive(GAMECODE_LIST[i], arc[j]); +#else + lo = MI_LoadBE32(GAMECODE_LIST[i]); + TitleID = (TITLE_ID_HIGH[i] << 32) | lo; + res = FSi_MountSpecialArchive(TitleID, arc[j], &archiveWork); +#endif + if(res != FS_RESULT_SUCCESS) + { + OS_TPrintf("Mount Failed:%s\n", GAMECODE_LIST[i]); + OS_TPrintf("ErrorCode:%d\n", res); + continue; + } + + STD_TSPrintf(path, "%s%s", ARC_NAME[j], FILE_NAME); + if(!FS_DeleteFile(path)) + { + OS_TPrintf("Delete Fail:%s\n", path); + } + else + { + OS_TPrintf("Deleted:%s %s\n", GAMECODE_LIST[i], path); + PrintString(0,(short) (24 + k++), 15, "Deleted:%s %s", GAMECODE_LIST[i], path); + } + FS_CreateFile(path, FS_PERMIT_W | FS_PERMIT_R); + +#ifndef USE_SPECIAL + NA_UnloadOtherTitleArchive(); +#else + FSi_MountSpecialArchive(TitleID, NULL, &archiveWork); +#endif + } + } +} diff --git a/build/debugsoft/MakerTitle/TitleList/src/font.c b/build/debugsoft/MakerTitle/TitleList/src/font.c new file mode 100644 index 00000000..30670436 --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/src/font.c @@ -0,0 +1,574 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.c + + Copyright 2003 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 "font.h" + +//---------------------------------------------------------------- +// Character data +// +const u32 d_CharData[8 * 256] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01010010, 0x01010010, 0x00000110, // 0001h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x01011010, 0x01010010, 0x00010010, // 0002h + 0x00100010, 0x00100010, 0x00100001, 0x00100001, + 0x00000000, 0x01010001, 0x01010001, 0x01111111, // 0003h + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 0004h + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01010000, 0x01010100, 0x00001010, // 0005h + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011000, 0x01011000, 0x01111111, // 0006h + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01010010, 0x01101111, 0x01010010, // 0007h + 0x00010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x01010010, 0x01011111, 0x00000100, // 0008h + 0x00011111, 0x00001000, 0x00000001, 0x00011110, + 0x00000000, 0x01010000, 0x01011000, 0x00000110, // 0009h + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x01010000, 0x01111101, 0x00010001, // 000ah + 0x00010001, 0x00010001, 0x00010001, 0x00001010, + 0x00000000, 0x01010000, 0x01011110, 0x00100000, // 000bh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010100, 0x01011111, 0x00001000, // 000ch + 0x00010000, 0x00000001, 0x00000001, 0x00011110, + 0x00000000, 0x01010001, 0x01010001, 0x00000001, // 000dh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00011000, // 000eh + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x01010010, 0x01111111, 0x00010010, // 000fh + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00001110, 0x01010100, 0x01010010, // 0010h + 0x00111111, 0x00000100, 0x00000100, 0x00011000, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 0011h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x01010100, 0x01011111, 0x00000010, // 0012h + 0x00011110, 0x00100001, 0x00100000, 0x00011110, + 0x00000000, 0x01010000, 0x01011100, 0x00100011, // 0013h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00010000, // 0014h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x01010010, 0x01010010, 0x00001100, // 0015h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010001, 0x01111101, 0x00010001, // 0016h + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01010100, 0x01010011, 0x01110010, // 0017h + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01011110, 0x01011000, 0x00000100, // 0018h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01010000, 0x01011100, 0x00010010, // 0019h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011101, 0x01010001, 0x00111101, // 001ah + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x01110001, 0x01011101, 0x00110001, // 001bh + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01110100, 0x01010011, 0x00110010, // 001ch + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01101110, 0x01011000, 0x00100100, // 001dh + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01110000, 0x01011100, 0x00110010, // 001eh + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x01010001, 0x00111101, // 001fh + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0020h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 0021h + 0x00001000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x01101100, 0x01001000, 0x00100100, // 0022h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100100, 0x01111111, 0x00100100, // 0023h + 0x00100100, 0x01111111, 0x00010010, 0x00010010, + 0x00000000, 0x00001000, 0x01111110, 0x00001001, // 0024h + 0x00111110, 0x01001000, 0x00111111, 0x00001000, + 0x00000000, 0x01000010, 0x00100101, 0x00010010, // 0025h + 0x00001000, 0x00100100, 0x01010010, 0x00100001, + 0x00000000, 0x00001110, 0x00010001, 0x00001001, // 0026h + 0x01000110, 0x00101001, 0x00110001, 0x01001110, + 0x00000000, 0x00011000, 0x00010000, 0x00001000, // 0027h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01110000, 0x00001000, 0x00000100, // 0028h + 0x00000100, 0x00000100, 0x00001000, 0x01110000, + 0x00000000, 0x00000111, 0x00001000, 0x00010000, // 0029h + 0x00010000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x00001000, 0x01001001, 0x00101010, // 002ah + 0x00011100, 0x00101010, 0x01001001, 0x00001000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 002bh + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002ch + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002dh + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002eh + 0x00000000, 0x00000000, 0x00000000, 0x00001100, + 0x00000000, 0x01000000, 0x00100000, 0x00010000, // 002fh + 0x00001000, 0x00000100, 0x00000010, 0x00000001, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0030h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00011100, 0x00010000, 0x00010000, // 0031h + 0x00010000, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0032h + 0x00111110, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0033h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00100000, 0x00110000, 0x00101000, // 0034h + 0x00100100, 0x00100010, 0x01111111, 0x00100000, + 0x00000000, 0x01111111, 0x00000001, 0x00111111, // 0035h + 0x01000000, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x00000001, 0x00111111, // 0036h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00100000, 0x00100000, // 0037h + 0x00010000, 0x00010000, 0x00001000, 0x00001000, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0038h + 0x00111110, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0039h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003ah + 0x00000000, 0x00000000, 0x00001100, 0x00000000, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003bh + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x01100000, 0x00011000, 0x00000110, // 003ch + 0x00000001, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00000000, 0x01111111, 0x00000000, // 003dh + 0x00000000, 0x00000000, 0x01111111, 0x00000000, + 0x00000000, 0x00000011, 0x00001100, 0x00110000, // 003eh + 0x01000000, 0x00110000, 0x00001100, 0x00000011, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 003fh + 0x00110000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x00011100, 0x00100010, 0x01001001, // 0040h + 0x01010101, 0x01010101, 0x01010101, 0x00111010, + 0x00000000, 0x00001000, 0x00010100, 0x00010100, // 0041h + 0x00100010, 0x00111110, 0x01000001, 0x01000001, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0042h + 0x00111111, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0043h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x00011111, 0x00100001, 0x01000001, // 0044h + 0x01000001, 0x01000001, 0x00100001, 0x00011111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0045h + 0x01111111, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0046h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0047h + 0x01111001, 0x01000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0048h + 0x01111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x00001000, 0x00001000, // 0049h + 0x00001000, 0x00001000, 0x00001000, 0x00111110, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 004ah + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01100001, 0x00011001, 0x00000101, // 004bh + 0x00000011, 0x00000101, 0x00011001, 0x01100001, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 004ch + 0x00000001, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01000001, 0x01100011, 0x01010101, // 004dh + 0x01001001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x01000001, 0x01000011, 0x01000101, // 004eh + 0x01001001, 0x01010001, 0x01100001, 0x01000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 004fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0050h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 0051h + 0x01000001, 0x01011001, 0x00100010, 0x01011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0052h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x01000001, 0x00000001, // 0053h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00001000, 0x00001000, // 0054h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0055h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01000001, 0x01000001, 0x00100010, // 0056h + 0x00100010, 0x00010100, 0x00010100, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0057h + 0x01001001, 0x01010101, 0x01100011, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0058h + 0x00001000, 0x00010100, 0x00100010, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0059h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01111111, 0x00100000, 0x00010000, // 005ah + 0x00001000, 0x00000100, 0x00000010, 0x01111111, + 0x00000000, 0x01111100, 0x00000100, 0x00000100, // 005bh + 0x00000100, 0x00000100, 0x00000100, 0x01111100, + 0x00000000, 0x00100010, 0x00010100, 0x00111110, // 005ch + 0x00001000, 0x00111110, 0x00001000, 0x00001000, + 0x00000000, 0x00011111, 0x00010000, 0x00010000, // 005dh + 0x00010000, 0x00010000, 0x00010000, 0x00011111, + 0x00000000, 0x00001000, 0x00010100, 0x00100010, // 005eh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 005fh + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x00010000, 0x00001000, 0x00011000, // 0060h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00011110, 0x00100001, // 0061h + 0x00111110, 0x00100001, 0x00100001, 0x01011110, + 0x00000000, 0x00000001, 0x00000001, 0x00111111, // 0062h + 0x01000001, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00000000, 0x00111100, 0x01000010, // 0063h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000000, 0x01000000, 0x01111110, // 0064h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0065h + 0x01111111, 0x00000001, 0x01000001, 0x00111110, + 0x00000000, 0x00110000, 0x00001000, 0x00001000, // 0066h + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x01111110, 0x01000001, // 0067h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0068h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00001000, 0x00000000, 0x00001000, // 0069h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00100000, 0x00000000, 0x00100000, // 006ah + 0x00100000, 0x00100001, 0x00100001, 0x00011110, + 0x00000000, 0x00000001, 0x00000001, 0x01100001, // 006bh + 0x00011001, 0x00000111, 0x00011001, 0x01100001, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 006ch + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00110111, 0x01001001, // 006dh + 0x01001001, 0x01001001, 0x01001001, 0x01001001, + 0x00000000, 0x00000000, 0x00111111, 0x01000001, // 006eh + 0x01000001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00000000, 0x00011100, 0x00100010, // 006fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00000000, 0x00111101, 0x01000011, // 0070h + 0x01000001, 0x01000011, 0x00111101, 0x00000001, + 0x00000000, 0x00000000, 0x01011110, 0x01100001, // 0071h + 0x01000001, 0x01100001, 0x01011110, 0x01000000, + 0x00000000, 0x00000000, 0x00110001, 0x00001101, // 0072h + 0x00000011, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0073h + 0x00001110, 0x00110000, 0x01000001, 0x00111110, + 0x00000000, 0x00000100, 0x00000100, 0x01111111, // 0074h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0075h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0076h + 0x00100010, 0x00100010, 0x00010100, 0x00001000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0077h + 0x01001001, 0x00101010, 0x00101010, 0x00010100, + 0x00000000, 0x00000000, 0x00100001, 0x00010010, // 0078h + 0x00001100, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0079h + 0x00100010, 0x00011100, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111111, 0x00010000, // 007ah + 0x00001000, 0x00000100, 0x00000010, 0x00111111, + 0x00000000, 0x00001000, 0x00011110, 0x01100100, // 007bh + 0x00011000, 0x00100100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x00011110, 0x00000100, // 007ch + 0x00011110, 0x00110101, 0x00101101, 0x00010010, + 0x00000000, 0x00000000, 0x00000000, 0x00010001, // 007dh + 0x00100001, 0x00100001, 0x00000001, 0x00000010, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007eh + 0x00011110, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007fh + 0x00111110, 0x00010000, 0x00001100, 0x00110010, + 0x00000000, 0x00000000, 0x00000100, 0x00101111, // 0080h + 0x01000100, 0x00011110, 0x00100101, 0x00010110, + 0x00000000, 0x00000000, 0x00001010, 0x00011110, // 0081h + 0x00101011, 0x00100010, 0x00010100, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00011101, // 0082h + 0x00101011, 0x00101001, 0x00011001, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00111000, // 0083h + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00000000, 0x00000000, 0x00011100, // 0084h + 0x00100011, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000110, 0x01001001, 0x00110000, // 0085h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000100, 0x00111111, 0x00000100, // 0086h + 0x00111110, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000000, 0x00100001, 0x01000001, // 0087h + 0x01000001, 0x01000001, 0x00000001, 0x00000010, + 0x00000000, 0x00111100, 0x00000000, 0x00111110, // 0088h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00011100, 0x00000000, 0x00111110, // 0089h + 0x00010000, 0x00001000, 0x00010100, 0x01100010, + 0x00000000, 0x00100100, 0x01011111, 0x00000100, // 008ah + 0x00111110, 0x01000101, 0x01000101, 0x00100010, + 0x00000000, 0x00100010, 0x01001111, 0x01010010, // 008bh + 0x01010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x00000100, 0x00111110, 0x00001000, // 008ch + 0x00111110, 0x00010000, 0x00000010, 0x00111100, + 0x00000000, 0x00100000, 0x00011000, 0x00000110, // 008dh + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x00100000, 0x01111101, 0x00100001, // 008eh + 0x00100001, 0x00100001, 0x00100001, 0x00010010, + 0x00000000, 0x00011110, 0x00100000, 0x00000000, // 008fh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00001000, 0x01111111, 0x00010000, // 0090h + 0x00100000, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0091h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00010000, 0x01111111, 0x00011000, // 0092h + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 0093h + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x00111100, 0x00010000, 0x00001100, // 0094h + 0x01111111, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000100, 0x00011111, 0x00000100, // 0095h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00001000, 0x01111111, 0x00000100, // 0096h + 0x00111100, 0x01000010, 0x01000000, 0x00111100, + 0x00000000, 0x00000000, 0x00011100, 0x00100011, // 0097h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01111111, 0x00010000, 0x00001000, // 0098h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000010, 0x00110010, 0x00001100, // 0099h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00100100, 0x01001111, 0x01000010, // 009ah + 0x00010001, 0x00111100, 0x00010010, 0x00001100, + 0x00000000, 0x00000010, 0x01111010, 0x01000010, // 009bh + 0x00000010, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00100010, 0x00111110, 0x01010010, // 009ch + 0x01001011, 0x01101101, 0x01010101, 0x00110010, + 0x00000000, 0x00110010, 0x01001011, 0x01000110, // 009dh + 0x01000110, 0x01110010, 0x01001011, 0x00110010, + 0x00000000, 0x00011100, 0x00101010, 0x01001001, // 009eh + 0x01001001, 0x01000101, 0x01000101, 0x00110010, + 0x00000000, 0x00100001, 0x01111101, 0x00100001, // 009fh + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00000100, 0x00100011, 0x01100010, // 00a0h + 0x00100001, 0x00100001, 0x00010010, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a1h + 0x00000000, 0x00000100, 0x00001010, 0x00000100, + 0x00000000, 0x01110000, 0x00010000, 0x00010000, // 00a2h + 0x00010000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a3h + 0x00001000, 0x00001000, 0x00001000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a4h + 0x00000000, 0x00000010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00011000, // 00a5h + 0x00011000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x01111111, // 00a6h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00111111, 0x00100000, // 00a7h + 0x00010100, 0x00001100, 0x00000100, 0x00000010, + 0x00000000, 0x00000000, 0x00100000, 0x00100000, // 00a8h + 0x00010000, 0x00001111, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000100, 0x00111111, // 00a9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00aah + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00000000, 0x00010000, 0x00111111, // 00abh + 0x00011000, 0x00010100, 0x00010010, 0x00011001, + 0x00000000, 0x00000000, 0x00000010, 0x00111111, // 00ach + 0x00100010, 0x00010010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00adh + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00aeh + 0x00111110, 0x00100000, 0x00100000, 0x00111110, + 0x00000000, 0x00000000, 0x00100101, 0x00101010, // 00afh + 0x00101010, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00b0h + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x00101000, // 00b1h + 0x00011000, 0x00001000, 0x00001000, 0x00000100, + 0x00000000, 0x01000000, 0x00100000, 0x00011000, // 00b2h + 0x00010111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00001000, 0x01111111, 0x01000001, // 00b3h + 0x01000001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000000, 0x00111110, 0x00001000, // 00b4h + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00100000, 0x01111111, 0x00110000, // 00b5h + 0x00101000, 0x00100100, 0x00100010, 0x00110001, + 0x00000000, 0x00000100, 0x01111111, 0x01000100, // 00b6h + 0x01000100, 0x01000100, 0x01000010, 0x00100001, + 0x00000000, 0x00000100, 0x00111111, 0x00001000, // 00b7h + 0x01111111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x01111100, 0x01000100, 0x01000100, // 00b8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000010, 0x01111110, 0x00100010, // 00b9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00bah + 0x01000000, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 00bbh + 0x00100010, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000011, 0x00000100, 0x01000011, // 00bch + 0x01000100, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x01111111, 0x01000000, 0x00100000, // 00bdh + 0x00010000, 0x00011000, 0x00100100, 0x01000011, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00beh + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x01000001, 0x01000010, 0x01000000, // 00bfh + 0x00100000, 0x00100000, 0x00011000, 0x00000110, + 0x00000000, 0x01111110, 0x01000010, 0x01001110, // 00c0h + 0x01110001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x01100000, 0x00011110, 0x00010000, // 00c1h + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01000101, 0x01001010, 0x01001010, // 00c2h + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00c3h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000010, 0x00000010, 0x00000110, // 00c4h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x00010000, 0x00010000, 0x01111111, // 00c5h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111110, 0x00000000, // 00c6h + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000100, // 00c7h + 0x00101000, 0x00010000, 0x00101000, 0x01000110, + 0x00000000, 0x00001000, 0x01111111, 0x00100000, // 00c8h + 0x00010000, 0x00011100, 0x01101011, 0x00001000, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 00c9h + 0x00100000, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x00010010, 0x00100010, 0x00100010, // 00cah + 0x01000010, 0x01000010, 0x01000001, 0x01000001, + 0x00000000, 0x00000001, 0x00000001, 0x01111111, // 00cbh + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cch + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000100, 0x00001010, // 00cdh + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x01111111, // 00ceh + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cfh + 0x00100010, 0x00010100, 0x00001000, 0x00010000, + 0x00000000, 0x00001110, 0x01110000, 0x00001110, // 00d0h + 0x01110000, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00001000, 0x00001000, 0x00000100, // 00d1h + 0x00000100, 0x00100010, 0x01000010, 0x01111111, + 0x00000000, 0x01000000, 0x01000000, 0x00100100, // 00d2h + 0x00101000, 0x00010000, 0x00101100, 0x01000011, + 0x00000000, 0x01111111, 0x00000100, 0x01111111, // 00d3h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00d4h + 0x00100010, 0x00010100, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00d5h + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00d6h + 0x01111110, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00d7h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00d8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00001010, 0x00001010, 0x00001010, // 00d9h + 0x01001010, 0x01001010, 0x00101010, 0x00011001, + 0x00000000, 0x00000010, 0x00000010, 0x01000010, // 00dah + 0x01000010, 0x00100010, 0x00010010, 0x00001110, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dbh + 0x01000001, 0x01000001, 0x01000001, 0x01111111, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dch + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000011, 0x01000100, 0x01000000, // 00ddh + 0x01000000, 0x00100000, 0x00010000, 0x00001111, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00deh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00dfh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00011110, 0x00001000, 0x00000100, // 00e0h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x00000000, 0x00001100, 0x00010010, // 00e1h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x00100001, 0x01111101, // 00e2h + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00111100, 0x00010000, 0x00111100, // 00e3h + 0x00010000, 0x00011100, 0x00110010, 0x00001100, + 0x00000000, 0x00001110, 0x00101000, 0x00101000, // 00e4h + 0x00111110, 0x01100101, 0x00100101, 0x00010010, + 0x00000000, 0x00000100, 0x00101111, 0x01000100, // 00e5h + 0x00000110, 0x01000101, 0x01000101, 0x00111110, + 0x00000000, 0x00100010, 0x00100010, 0x00111110, // 00e6h + 0x01010010, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000100, 0x00011111, 0x00000010, // 00e7h + 0x00011111, 0x01000010, 0x01000010, 0x00111100, + 0x00000000, 0x00010010, 0x00111110, 0x01010011, // 00e8h + 0x01000010, 0x00100100, 0x00000100, 0x00000100, + 0x00000000, 0x00001000, 0x00111101, 0x01001011, // 00e9h + 0x01001001, 0x01001001, 0x00111000, 0x00000100, + 0x00000000, 0x00001000, 0x00111000, 0x00001000, // 00eah + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00011000, 0x00100000, 0x00000100, // 00ebh + 0x00111010, 0x01000110, 0x01000000, 0x00111000, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00ech + 0x01000110, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00edh + 0x01000011, 0x01001100, 0x01010010, 0x00111100, + 0x00000000, 0x00100010, 0x00110011, 0x00101010, // 00eeh + 0x00100110, 0x00100010, 0x00100011, 0x01000010, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00efh + 0x01000011, 0x01000000, 0x01000010, 0x00111100, + 0x00000000, 0x00000010, 0x00111011, 0x01000110, // 00f0h + 0x01000010, 0x01000011, 0x01000010, 0x00110010, + 0x00000000, 0x00000100, 0x00000100, 0x00000010, // 00f1h + 0x01000110, 0x01000101, 0x01000101, 0x00111001, + 0x00000000, 0x01010100, 0x01111111, 0x00100100, // 00f2h + 0x00100100, 0x00100100, 0x00100010, 0x00010001, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 00f3h + 0x00111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01011110, 0x01100010, 0x00100010, // 00f4h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010010, 0x01111110, 0x00100010, // 00f5h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 00f6h + 0x00100000, 0x00100000, 0x00100000, 0x00111111, + 0x00000000, 0x01010010, 0x01010010, 0x00111111, // 00f7h + 0x00010010, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01010011, 0x01010100, 0x00100011, // 00f8h + 0x00100100, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01010000, 0x01011111, 0x00010000, // 00f9h + 0x00001000, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x01010010, 0x01111111, 0x00100010, // 00fah + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x01010001, 0x01010010, 0x00100000, // 00fbh + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01011110, 0x01010010, 0x00100110, // 00fch + 0x00111001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01011110, 0x00010000, // 00fdh + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x00100101, 0x01001010, 0x00101010, // 00feh + 0x00100000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01011110, 0x01010000, 0x00111111, // 00ffh + 0x00001000, 0x00001000, 0x00001000, 0x00000110 +}; + + +//---------------------------------------------------------------- +// Palette data +// +const u32 d_PaletteData[8 * 16] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // black + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001f0000, 0x00000000, 0x00000000, 0x00000000, // red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00180000, 0x00000000, 0x00000000, 0x00000000, // dark red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; diff --git a/build/debugsoft/MakerTitle/TitleList/src/main.c b/build/debugsoft/MakerTitle/TitleList/src/main.c new file mode 100644 index 00000000..0ce708a2 --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/src/main.c @@ -0,0 +1,267 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - yasuda - MenuTest + File: main.c + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +#include +#else +#include +#endif +#include +#include +#include "font.h" +#include "screen.h" +#include "appmain.h" +#include "mycode.h" // Makeで自動生成されるはずのファイル. + +static void myInit(void); +static void myVBlankIntr(void); +static void InitializeAllocateSystem(void); +static void PrintBootType(void); + +extern BOOL PubDataAccessTest(void); + +/*---------------------------------------------------------------------------* + Name: NitroMain + + Description: main + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +void TwlMain(void) +#else +void NitroMain(void) +#endif +{ + u16 trigger; + u16 preButton = PAD_Read(); + u16 button; + + //---------------- initialize + myInit(); + PrintBootType(); + + ClearSubScreen(); + + //---------------- main loop + while (TRUE) + { + button = PAD_Read(); + trigger = (u16)((button ^ preButton) & button); + preButton = button; + + //---- clear screen buffer + ClearScreen(); + + if(trigger & PAD_BUTTON_A) + { + DoWritingTest(); + } + if(trigger & PAD_BUTTON_B) + { + DoReadingTest(); + } + + if((trigger & PAD_BUTTON_X) && STD_StrCmp("4KAA", MYCODE) == 0) + { + DeleteSaveDatas(); + } + + + //---- display menus + // DisplayMenuSet(); + + //---- press UP key (toggle menu) +/* if(trigger & PAD_KEY_UP) + { + ChangeMenuItem(MENU_ITEM_UP); + } + + if(trigger & PAD_KEY_DOWN) + { + ChangeMenuItem(MENU_ITEM_DOWN); + } + if(trigger & PAD_KEY_RIGHT) + { + ExecMenuItemRight(); + } + if(trigger & PAD_KEY_LEFT) + { + ExecMenuItemLeft(); + } + + //---- push A + if (trigger & PAD_BUTTON_A) + { + ExecMenuItem(); + } + //---- push B + if (trigger & PAD_BUTTON_B) + { + ExecMenuItemB(); + } + //---- push X + if (trigger & PAD_BUTTON_X) + { + ExecMenuItemX(); + }*/ + + DrawScreen(); + + OS_WaitVBlankIntr(); + } +} + +//---------------------------------------------------------------- +// myInit +// +void myInit(void) +{ + //---- init + OS_Init(); + OS_InitTick(); + OS_InitAlarm(); + RTC_Init(); + FX_Init(); + GX_Init(); + GX_DispOff(); + GXS_DispOff(); + InitializeAllocateSystem(); + + //---- init displaying + GX_SetBankForLCDC(GX_VRAM_LCDC_ALL); + MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE); + (void)GX_DisableBankForLCDC(); + + MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE); + MI_CpuClearFast((void *)HW_PLTT, HW_PLTT_SIZE); + MI_CpuFillFast((void *)HW_DB_OAM, 192, HW_DB_OAM_SIZE); + MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE); + + //---- setting 2D for top screen + GX_SetBankForBG(GX_VRAM_BG_128_A); + + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0xf800, GX_BG_CHARBASE_0x00000, GX_BG_EXTPLTT_01); + G2_SetBG0Priority(0); + G2_BG0Mosaic(FALSE); + GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D); + GX_SetVisiblePlane(GX_PLANEMASK_BG0); + + GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + + + + //---- setting 2D for bottom screen + GX_SetBankForSubBG(GX_VRAM_SUB_BG_128_C); + + G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0xf800, GX_BG_CHARBASE_0x00000, GX_BG_EXTPLTT_01); + G2S_SetBG0Priority(0); + G2S_BG0Mosaic(FALSE); + GXS_SetGraphicsMode(GX_BGMODE_0); + GXS_SetVisiblePlane(GX_PLANEMASK_BG0); + + GXS_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GXS_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + + + //---- screen + MI_CpuFillFast((void *)gScreen, 0, sizeof(gScreen)); + DC_FlushRange(gScreen, sizeof(gScreen)); + /* DMA操作でIOレジスタへアクセスするのでキャッシュの Wait は不要 */ + // DC_WaitWriteBufferEmpty(); + GX_LoadBG0Scr(&gScreen[0], 0, sizeof(gScreen) / 2); + GXS_LoadBG0Scr(&gScreen[1], 0, sizeof(gScreen) / 2); + + //---- init interrupt + OS_SetIrqFunction(OS_IE_V_BLANK, myVBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)GX_VBlankIntr(TRUE); + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); + + //---- FileSystemInit + (void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV); + FS_Init( FS_DMA_NOT_USE ); + + //---- start displaying + GX_DispOn(); + GXS_DispOn(); +} + +//---------------------------------------------------------------- +// myVBlankIntr +// vblank interrupt handler +// +static void myVBlankIntr(void) +{ + //---- upload pseudo screen to VRAM + DC_FlushRange(gScreen, sizeof(gScreen)); + /* DMA操作でIOレジスタへアクセスするのでキャッシュの Wait は不要 */ + // DC_WaitWriteBufferEmpty(); + GX_LoadBG0Scr(&gScreen[0], 0, sizeof(gScreen) / 2); + GXS_LoadBG0Scr(&gScreen[1], 0, sizeof(gScreen) / 2); + + + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + +/*---------------------------------------------------------------------------* + Name: InitializeAllocateSystem + + Description: メインメモリ上のアリーナにてメモリ割当てシステムを初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitializeAllocateSystem(void) +{ + void *tempLo; + OSHeapHandle hh; + + tempLo = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1); + OS_SetArenaLo(OS_ARENA_MAIN, tempLo); + hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi()); + if (hh < 0) + { + OS_Panic("ARM9: Fail to create heap...\n"); + } + hh = OS_SetCurrentHeap(OS_ARENA_MAIN, hh); +} + +static void PrintBootType(void) +{ + const OSBootType btype = OS_GetBootType(); + + switch( btype ) + { + case OS_BOOTTYPE_ROM: OS_TPrintf("OS_GetBootType = OS_BOOTTYPE_ROM\n"); break; + case OS_BOOTTYPE_NAND: OS_TPrintf("OS_GetBootType = OS_BOOTTYPE_NAND\n"); break; + default: + { + OS_Warning("unknown BootType(=%d)", btype); + } + break; + } +} + diff --git a/build/debugsoft/MakerTitle/TitleList/src/screen.c b/build/debugsoft/MakerTitle/TitleList/src/screen.c new file mode 100644 index 00000000..562bfe5a --- /dev/null +++ b/build/debugsoft/MakerTitle/TitleList/src/screen.c @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos - os - reset-1 + File: font.c + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ +#ifdef SDK_TWL +#include +#else +#include +#endif +#include "screen.h" + +u16 gScreen[2][32 * 32]; + +// ** these code are refer to rtc sample. thanks. +/*---------------------------------------------------------------------------* + Name: ClearScreen + + Description: clear screen buffer + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void ClearScreen(void) +{ + MI_CpuClearFast((void *)gScreen[0], sizeof(gScreen) / 2); +} + +void ClearSubScreen(void) +{ + MI_CpuClearFast((void *)gScreen[1], sizeof(gScreen) / 2); +} + +/*---------------------------------------------------------------------------* + Name: PrintString + + Description: enter string into screen buffer + string must be within 32 chars + + Arguments: x : x + y : y + palette : color (0-15) + text : string. end mark is NULL + + Returns: None. + *---------------------------------------------------------------------------*/ +void PrintString(s16 x, s16 y, u8 palette, char *text, ...) +{ + va_list vlist; + char temp[32 + 2], *tempPtr; + s32 i; + u16 *p, *pLimit; + u32 index = (u32)(y / 24); + y = (s16)(y % 24); + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + *(u16 *)(&temp[32]) = 0; + + p = &gScreen[index][((y * 32) + x) % (32 * 32)]; + pLimit = &gScreen[index][32 * 32]; + + tempPtr = &temp[0]; + + for (i = 0; *tempPtr; i++, tempPtr++) + { + *p = (u16)((palette << 12) | *tempPtr); + if (++p >= pLimit) + { + p = &gScreen[index][0]; + } + } +} + +/*---------------------------------------------------------------------------* + Name: ColorString + + Description: change string color which is put in screen buffer + + Arguments: x : x + y : y + length : number of characters to change color + palette : color (0-15) + + Returns: None. + *---------------------------------------------------------------------------*/ +void ColorString(s16 x, s16 y, s16 length, u8 palette) +{ + s32 i; + u16 *p, *pLimit; + u32 index = (u32)(y / 24); + y = (s16)(y % 24); + if (length < 0) + return; + p = &gScreen[index][((y * 32) + x) % (32 * 32)]; + pLimit = &gScreen[index][32 * 32]; + + for (i = 0; i < length; i++) + { + u16 temp = *p; + temp &= 0x0fff; + temp |= (palette << 12); + *p = temp; + + if (++p >= pLimit) + { + p = &gScreen[index][0]; + } + } +} diff --git a/build/debugsoft/NotLaunch/Makefile b/build/debugsoft/NotLaunch/Makefile new file mode 100644 index 00000000..721be5e0 --- /dev/null +++ b/build/debugsoft/NotLaunch/Makefile @@ -0,0 +1,124 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - NotLaunch +# 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 TWL_ARCHGEN = LIMITED + +ifeq ($(APP_TYPE),) + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +do-build: do-something +clean: do-something +clobber: do-something +install: do-something +do-build: MY_GOAL=default +clean: MY_GOAL=clean +clobber: MY_GOAL=clobber +install: MY_GOAL=install + +do-something: + +$(REMAKE) -B APP_TYPE=SYSTEM CARD_REGION=ALL $(MY_GOAL) + +$(REMAKE) -B APP_TYPE=SYSTEM CARD_REGION=Japan $(MY_GOAL) + +$(REMAKE) -B APP_TYPE=SYSTEM CARD_REGION=America $(MY_GOAL) + +$(REMAKE) -B APP_TYPE=SYSTEM CARD_REGION=Europe $(MY_GOAL) + +$(REMAKE) -B APP_TYPE=SYSTEM CARD_REGION=Australia $(MY_GOAL) +# +$(REMAKE) -B APP_TYPE=USER CARD_REGION=ALL $(MY_GOAL) +# +$(REMAKE) -B APP_TYPE=USER CARD_REGION=Japan $(MY_GOAL) +# +$(REMAKE) -B APP_TYPE=USER CARD_REGION=America $(MY_GOAL) +# +$(REMAKE) -B APP_TYPE=USER CARD_REGION=Europe $(MY_GOAL) +# +$(REMAKE) -B APP_TYPE=USER CARD_REGION=Australia $(MY_GOAL) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +else + +TWL_NANDAPP = TRUE +TARGET_BIN = NotLaunch_$(APP_TYPE)_$(CARD_REGION).tad + +SRCDIR = ./src + +SRCS = main.c + +ROM_SPEC = NotLaunch.autogen.rsf + +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf + +#---------------------------------------------------------------------------- +# decide gamecode (region) + +ifeq ($(CARD_REGION),ALL) +GAME_CODE_R = A +endif + +ifeq ($(CARD_REGION),Japan) +GAME_CODE_R = J +endif + +ifeq ($(CARD_REGION),America) +GAME_CODE_R = E +endif + +ifeq ($(CARD_REGION),Europe) +GAME_CODE_R = P +endif + +ifeq ($(CARD_REGION),Australia) +GAME_CODE_R = U +endif + +ifeq ($(CARD_REGION),China) +GAME_CODE_R = C +endif + +ifeq ($(CARD_REGION),Korea) +GAME_CODE_R = K +endif +#---------------------------------------------------------------------------- + +ROM_SPEC_PARAM = MakerCode=01 \ + GameCode=457$(GAME_CODE_R) \ + Media=NAND \ + Launch=FALSE \ + CardRegion=$(CARD_REGION) + +ifeq ($(APP_TYPE),USER) +ROM_SPEC_PARAM += AppType=User +endif + +endif # ifeq ($(APP_TYPE),) + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +ifeq ($(APP_TYPE),SYSTEM) +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.sys.exe +MAKETAD_OPTION := -s +endif + +do-build: $(TARGETS) + +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +INSTALL_DIR = ./roms + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/NotLaunch/src/main.c b/build/debugsoft/NotLaunch/src/main.c new file mode 100644 index 00000000..7e2a06d7 --- /dev/null +++ b/build/debugsoft/NotLaunch/src/main.c @@ -0,0 +1,41 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - NotLaunch + 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 + + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------*/ + +void TwlMain(void) +{ + OS_Init(); + + + + OS_Terminate(); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/TMPJump/433A/libsyscall.a b/build/debugsoft/TMPJump/433A/libsyscall.a new file mode 100644 index 00000000..4f5ea2d2 Binary files /dev/null and b/build/debugsoft/TMPJump/433A/libsyscall.a differ diff --git a/build/debugsoft/TMPJump/433A/libsyscall_c.bin b/build/debugsoft/TMPJump/433A/libsyscall_c.bin new file mode 100644 index 00000000..37f0da7e Binary files /dev/null and b/build/debugsoft/TMPJump/433A/libsyscall_c.bin differ diff --git a/build/debugsoft/TMPJump/433A/rom_header_433a.template.sbin b/build/debugsoft/TMPJump/433A/rom_header_433a.template.sbin new file mode 100644 index 00000000..79e274b0 Binary files /dev/null and b/build/debugsoft/TMPJump/433A/rom_header_433a.template.sbin differ diff --git a/build/debugsoft/TMPJump/434A/libsyscall.a b/build/debugsoft/TMPJump/434A/libsyscall.a new file mode 100644 index 00000000..ea73def6 Binary files /dev/null and b/build/debugsoft/TMPJump/434A/libsyscall.a differ diff --git a/build/debugsoft/TMPJump/434A/libsyscall_c.bin b/build/debugsoft/TMPJump/434A/libsyscall_c.bin new file mode 100644 index 00000000..4d28a4c2 Binary files /dev/null and b/build/debugsoft/TMPJump/434A/libsyscall_c.bin differ diff --git a/build/debugsoft/TMPJump/434A/rom_header_434a.template.sbin b/build/debugsoft/TMPJump/434A/rom_header_434a.template.sbin new file mode 100644 index 00000000..546927d8 Binary files /dev/null and b/build/debugsoft/TMPJump/434A/rom_header_434a.template.sbin differ diff --git a/build/debugsoft/TMPJump/435A/libsyscall.a b/build/debugsoft/TMPJump/435A/libsyscall.a new file mode 100644 index 00000000..5c0bc8de Binary files /dev/null and b/build/debugsoft/TMPJump/435A/libsyscall.a differ diff --git a/build/debugsoft/TMPJump/435A/libsyscall_c.bin b/build/debugsoft/TMPJump/435A/libsyscall_c.bin new file mode 100644 index 00000000..d96b6dfb Binary files /dev/null and b/build/debugsoft/TMPJump/435A/libsyscall_c.bin differ diff --git a/build/debugsoft/TMPJump/435A/rom_header_435a.template.sbin b/build/debugsoft/TMPJump/435A/rom_header_435a.template.sbin new file mode 100644 index 00000000..7c855e67 Binary files /dev/null and b/build/debugsoft/TMPJump/435A/rom_header_435a.template.sbin differ diff --git a/build/debugsoft/TMPJump/436A/libsyscall.a b/build/debugsoft/TMPJump/436A/libsyscall.a new file mode 100644 index 00000000..c82a882e Binary files /dev/null and b/build/debugsoft/TMPJump/436A/libsyscall.a differ diff --git a/build/debugsoft/TMPJump/436A/libsyscall_c.bin b/build/debugsoft/TMPJump/436A/libsyscall_c.bin new file mode 100644 index 00000000..c319bafc Binary files /dev/null and b/build/debugsoft/TMPJump/436A/libsyscall_c.bin differ diff --git a/build/debugsoft/TMPJump/436A/rom_header_436a.template.sbin b/build/debugsoft/TMPJump/436A/rom_header_436a.template.sbin new file mode 100644 index 00000000..dadbde58 Binary files /dev/null and b/build/debugsoft/TMPJump/436A/rom_header_436a.template.sbin differ diff --git a/build/debugsoft/TMPJump/437A/libsyscall.a b/build/debugsoft/TMPJump/437A/libsyscall.a new file mode 100644 index 00000000..ddd9ba9c Binary files /dev/null and b/build/debugsoft/TMPJump/437A/libsyscall.a differ diff --git a/build/debugsoft/TMPJump/437A/libsyscall_c.bin b/build/debugsoft/TMPJump/437A/libsyscall_c.bin new file mode 100644 index 00000000..e4247e1d Binary files /dev/null and b/build/debugsoft/TMPJump/437A/libsyscall_c.bin differ diff --git a/build/debugsoft/TMPJump/437A/rom_header_437a.template.sbin b/build/debugsoft/TMPJump/437A/rom_header_437a.template.sbin new file mode 100644 index 00000000..79c1b408 Binary files /dev/null and b/build/debugsoft/TMPJump/437A/rom_header_437a.template.sbin differ diff --git a/build/debugsoft/TMPJump/458A/libsyscall.a b/build/debugsoft/TMPJump/458A/libsyscall.a new file mode 100644 index 00000000..f1e865af Binary files /dev/null and b/build/debugsoft/TMPJump/458A/libsyscall.a differ diff --git a/build/debugsoft/TMPJump/458A/libsyscall_c.bin b/build/debugsoft/TMPJump/458A/libsyscall_c.bin new file mode 100644 index 00000000..d6321e44 Binary files /dev/null and b/build/debugsoft/TMPJump/458A/libsyscall_c.bin differ diff --git a/build/debugsoft/TMPJump/458A/rom_header_458a.template.sbin b/build/debugsoft/TMPJump/458A/rom_header_458a.template.sbin new file mode 100644 index 00000000..98335c71 Binary files /dev/null and b/build/debugsoft/TMPJump/458A/rom_header_458a.template.sbin differ diff --git a/build/debugsoft/TMPJump/459A/libsyscall.a b/build/debugsoft/TMPJump/459A/libsyscall.a new file mode 100644 index 00000000..d768c1ce Binary files /dev/null and b/build/debugsoft/TMPJump/459A/libsyscall.a differ diff --git a/build/debugsoft/TMPJump/459A/libsyscall_c.bin b/build/debugsoft/TMPJump/459A/libsyscall_c.bin new file mode 100644 index 00000000..a416f3c0 Binary files /dev/null and b/build/debugsoft/TMPJump/459A/libsyscall_c.bin differ diff --git a/build/debugsoft/TMPJump/459A/rom_header_459a.template.sbin b/build/debugsoft/TMPJump/459A/rom_header_459a.template.sbin new file mode 100644 index 00000000..2ee7454a Binary files /dev/null and b/build/debugsoft/TMPJump/459A/rom_header_459a.template.sbin differ diff --git a/build/debugsoft/TMPJump/AppforFailedTmpJump/Makefile b/build/debugsoft/TMPJump/AppforFailedTmpJump/Makefile new file mode 100644 index 00000000..14ceddc9 --- /dev/null +++ b/build/debugsoft/TMPJump/AppforFailedTmpJump/Makefile @@ -0,0 +1,68 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - tmpjumpTest - AppforFailedTmpJump +# 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_CODEGEN = ARM +TWL_ARCHGEN = LIMITED + +TWL_NANDAPP = TRUE + +TARGET_BIN = Test_$(TARGET_PLATFORM)fail.srl + +INCDIR = ../include +SRCDIR = ../src +SRCS = common.c font.c screen.c main_f.c + +ifeq ($(ROMTYPE),MASTER) +MAKEROM_ROMROOT = ../mas_data +else +MAKEROM_ROMROOT = ../data +endif + +MAKEROM_ROMFILES = dummy.srl + + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +ifeq ($(TARGET_PLATFORM),TWL) +ROM_SPEC = main_459a.rsf +LIBSYSCALL = ../459A/libsyscall.a + +endif + +ifeq ($(TARGET_PLATFORM),NITRO) +ROM_SPEC = main_458a.rsf +LIBSYSCALL = ../458A/libsyscall.a + +endif + +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) + +ifeq ($(ROMTYPE),MASTER) +INSTALL_DIR = ../mas_data +else +INSTALL_DIR = ../data +endif +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/TMPJump/AppforFailedTmpJump/main_458a.rsf b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_458a.rsf new file mode 100644 index 00000000..11d12a58 --- /dev/null +++ b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_458a.rsf @@ -0,0 +1,103 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# Nitro ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).nef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7:r).sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7:r)_defs.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7:r)_table.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7:r).nef" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TJmpTest_NF + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G] + # + #RomSize 128M + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ../458A/rom_header_458a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "../banner/banner.bnr" + + # + # Permit TmpJump: for TWL "ApplicationJump" function + # + PermitTmpJump FALSE + + ### + ### + ### + #### END +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} diff --git a/build/debugsoft/TMPJump/AppforFailedTmpJump/main_459a.rsf b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_459a.rsf new file mode 100644 index 00000000..ce9917c4 --- /dev/null +++ b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_459a.rsf @@ -0,0 +1,248 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TmpJmpTest_L + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ../459A/rom_header_459a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "../banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump FALSE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # NANDAccess: NAND access control [TRUE/FALSE] + # + NANDAccess TRUE + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 459A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/TMPJump/AppforFailedTmpJump/main_f.c b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_f.c new file mode 100644 index 00000000..65673d8f --- /dev/null +++ b/build/debugsoft/TMPJump/AppforFailedTmpJump/main_f.c @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - tmpjumpTest - AppforTmpJump + 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$ + *---------------------------------------------------------------------------*/ + +#ifdef SDK_TWL +#include +#else +#include +#endif + +#include "common.h" +#include "screen.h" + +#define DMA_NO_FS 1 + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ +// キー入力 +static KeyInfo gKey; + +static const char gRomPath[32] = "rom:/dummy.srl"; +static u64 gTargetId = 0x0003000434333441; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void DrawMainScene(void); +void VBlankIntr(void); + +#ifdef SDK_TWL +void TwlMain(void) +#else +void NitroMain(void) +#endif +{ + InitCommon(); + InitScreen(); + + FS_Init(DMA_NO_FS); + + GX_DispOn(); + GXS_DispOn(); + + ClearScreen(); + + // 一度空読み + ReadKey(&gKey); + + while(TRUE) + { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_A) + { +#ifdef SDK_TWL + BOOL success = TRUE; + FSFile src, dest; + void *buf; + s32 len = 0; + + // srl を NAND 上の OS_TMP_APP_PATH へコピー + FS_DeleteFile(OS_TMP_APP_PATH); + FS_CreateFile(OS_TMP_APP_PATH, FS_PERMIT_R | FS_PERMIT_W); + FS_InitFile( &src ); + FS_InitFile( &dest ); + if ( !FS_OpenFileEx( &src, gRomPath, FS_FILEMODE_R ) ) success = FALSE; + len = (s32)FS_GetFileLength( &src ); + + buf = OS_AllocFromMain((u32)len); + if (buf == NULL) + { + success = FALSE; + break; + } + + if ( -1 == FS_ReadFile( &src, buf, len ) ) + { + success = FALSE; + break; + } + + if ( !FS_CloseFile( &src ) ) success = FALSE; + + if ( !FS_OpenFileEx( &dest, OS_TMP_APP_PATH, FS_FILEMODE_W ) ) success = FALSE; + if ( -1 == FS_WriteFile( &dest, buf, len ) ) success = FALSE; + if ( !FS_CloseFile( &dest ) ) success = FALSE; + + if ( !success ) break; + + // TMP ジャンプを試みる + if ( !OS_DoApplicationJump( gTargetId, OS_APP_JUMP_TMP) ) + { + PutSubScreen(1, 10, 0xf1, "ERROR!: Failed to TMP jump"); + } + break; +#endif + } + + if (gKey.trg & PAD_BUTTON_B) + { +#ifdef SDK_TWL + // メインアプリへ戻る + if ( !OS_ReturnToPrevApplication() ) + { + PutSubScreen(1, 10, 0xf1, "ERROR!: Failed to return jump"); + } + break; +#endif + } + + DrawMainScene(); + + OS_WaitVBlankIntr(); + } + + OS_WaitVBlankIntr(); + OS_Terminate(); +} + +static void DrawMainScene(void) +{ + PutMainScreen(1, 1, 0xf2, "Application on tmp dir"); +#ifdef SDK_TWL + PutMainScreen(1, 18, 0xff, "A : try TMP jump"); + PutMainScreen(1, 20, 0xff, "B : Return to Main App"); +#else + PutMainScreen(1, 20, 0xf8, "Can not return to Main (OK)"); +#endif +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: Vブランク割込みハンドラ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void VBlankIntr(void) +{ + // テキスト表示を更新 + UpdateScreen(); + + // IRQ チェックフラグをセット + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + diff --git a/build/debugsoft/TMPJump/AppforTmpJump/Makefile b/build/debugsoft/TMPJump/AppforTmpJump/Makefile new file mode 100644 index 00000000..f6fc5c92 --- /dev/null +++ b/build/debugsoft/TMPJump/AppforTmpJump/Makefile @@ -0,0 +1,79 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - tmpjumpTest - AppforTmpJump +# 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_CODEGEN = ARM +TWL_ARCHGEN = ALL + +TWL_NANDAPP = TRUE + +TARGET_BIN = TestApp$(TEST_ARCH).srl + +INCDIR = ../include +SRCDIR = ./ ../src +SRCS = common.c font.c screen.c main_2.c + +ifeq ($(ROMTYPE),MASTER) +MAKEROM_ROMROOT = ../mas_data +else +MAKEROM_ROMROOT = ../data +endif +MAKEROM_ROMFILES = dummy.srl + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +ifeq ($(TARGET_PLATFORM),TWL) +TEST_ARCH = _$(TWL_ARCHGEN) + +ifeq ($(TWL_ARCHGEN),HYBRID) + +ROM_SPEC = main_434a.rsf +LIBSYSCALL = ../434A/libsyscall.a + +else + +ROM_SPEC = main_435a.rsf +LIBSYSCALL = ../435A/libsyscall.a + +endif +# TARGET_PLATFORM = NITRO +endif + +ifeq ($(TARGET_PLATFORM),NITRO) + +TEST_ARCH = +ROM_SPEC = main_433a.rsf +LIBSYSCALL = ../433A/libsyscall.a + +endif + +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) + +ifeq ($(ROMTYPE),MASTER) +INSTALL_DIR = ../mas_data +else +INSTALL_DIR = ../data +endif +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/TMPJump/AppforTmpJump/main_2.c b/build/debugsoft/TMPJump/AppforTmpJump/main_2.c new file mode 100644 index 00000000..65673d8f --- /dev/null +++ b/build/debugsoft/TMPJump/AppforTmpJump/main_2.c @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - tmpjumpTest - AppforTmpJump + 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$ + *---------------------------------------------------------------------------*/ + +#ifdef SDK_TWL +#include +#else +#include +#endif + +#include "common.h" +#include "screen.h" + +#define DMA_NO_FS 1 + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ +// キー入力 +static KeyInfo gKey; + +static const char gRomPath[32] = "rom:/dummy.srl"; +static u64 gTargetId = 0x0003000434333441; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void DrawMainScene(void); +void VBlankIntr(void); + +#ifdef SDK_TWL +void TwlMain(void) +#else +void NitroMain(void) +#endif +{ + InitCommon(); + InitScreen(); + + FS_Init(DMA_NO_FS); + + GX_DispOn(); + GXS_DispOn(); + + ClearScreen(); + + // 一度空読み + ReadKey(&gKey); + + while(TRUE) + { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_A) + { +#ifdef SDK_TWL + BOOL success = TRUE; + FSFile src, dest; + void *buf; + s32 len = 0; + + // srl を NAND 上の OS_TMP_APP_PATH へコピー + FS_DeleteFile(OS_TMP_APP_PATH); + FS_CreateFile(OS_TMP_APP_PATH, FS_PERMIT_R | FS_PERMIT_W); + FS_InitFile( &src ); + FS_InitFile( &dest ); + if ( !FS_OpenFileEx( &src, gRomPath, FS_FILEMODE_R ) ) success = FALSE; + len = (s32)FS_GetFileLength( &src ); + + buf = OS_AllocFromMain((u32)len); + if (buf == NULL) + { + success = FALSE; + break; + } + + if ( -1 == FS_ReadFile( &src, buf, len ) ) + { + success = FALSE; + break; + } + + if ( !FS_CloseFile( &src ) ) success = FALSE; + + if ( !FS_OpenFileEx( &dest, OS_TMP_APP_PATH, FS_FILEMODE_W ) ) success = FALSE; + if ( -1 == FS_WriteFile( &dest, buf, len ) ) success = FALSE; + if ( !FS_CloseFile( &dest ) ) success = FALSE; + + if ( !success ) break; + + // TMP ジャンプを試みる + if ( !OS_DoApplicationJump( gTargetId, OS_APP_JUMP_TMP) ) + { + PutSubScreen(1, 10, 0xf1, "ERROR!: Failed to TMP jump"); + } + break; +#endif + } + + if (gKey.trg & PAD_BUTTON_B) + { +#ifdef SDK_TWL + // メインアプリへ戻る + if ( !OS_ReturnToPrevApplication() ) + { + PutSubScreen(1, 10, 0xf1, "ERROR!: Failed to return jump"); + } + break; +#endif + } + + DrawMainScene(); + + OS_WaitVBlankIntr(); + } + + OS_WaitVBlankIntr(); + OS_Terminate(); +} + +static void DrawMainScene(void) +{ + PutMainScreen(1, 1, 0xf2, "Application on tmp dir"); +#ifdef SDK_TWL + PutMainScreen(1, 18, 0xff, "A : try TMP jump"); + PutMainScreen(1, 20, 0xff, "B : Return to Main App"); +#else + PutMainScreen(1, 20, 0xf8, "Can not return to Main (OK)"); +#endif +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: Vブランク割込みハンドラ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void VBlankIntr(void) +{ + // テキスト表示を更新 + UpdateScreen(); + + // IRQ チェックフラグをセット + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + diff --git a/build/debugsoft/TMPJump/AppforTmpJump/main_433a.rsf b/build/debugsoft/TMPJump/AppforTmpJump/main_433a.rsf new file mode 100644 index 00000000..2219b56a --- /dev/null +++ b/build/debugsoft/TMPJump/AppforTmpJump/main_433a.rsf @@ -0,0 +1,103 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - tmpjumpTest - AppforTmpJump +# File: main_433a.rsf +# +# 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$ +#---------------------------------------------------------------------------- +# +# Nitro ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).nef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7:r).sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7:r)_defs.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7:r)_table.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7:r).nef" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TmpJmpTest_N + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G] + # + #RomSize 128M + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ../433A/rom_header_433a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "../banner/banner.bnr" + + # + # Permit TmpJump: for TWL "ApplicationJump" function + # + PermitTmpJump TRUE + + ### + ### + ### + #### END +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} diff --git a/build/debugsoft/TMPJump/AppforTmpJump/main_434a.rsf b/build/debugsoft/TMPJump/AppforTmpJump/main_434a.rsf new file mode 100644 index 00000000..70118126 --- /dev/null +++ b/build/debugsoft/TMPJump/AppforTmpJump/main_434a.rsf @@ -0,0 +1,248 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TmpJmpTest_L + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ../434A/rom_header_434a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "../banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump FALSE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingTmpJump TRUE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # NANDAccess: NAND access control [TRUE/FALSE] + # + NANDAccess TRUE + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 434A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/TMPJump/AppforTmpJump/main_435a.rsf b/build/debugsoft/TMPJump/AppforTmpJump/main_435a.rsf new file mode 100644 index 00000000..bc264e1e --- /dev/null +++ b/build/debugsoft/TMPJump/AppforTmpJump/main_435a.rsf @@ -0,0 +1,248 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TmpJmpTest_L + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ../435A/rom_header_435a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "../banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump FALSE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingTmpJump TRUE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # NANDAccess: NAND access control [TRUE/FALSE] + # + NANDAccess TRUE + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 435A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/TMPJump/Makefile b/build/debugsoft/TMPJump/Makefile new file mode 100644 index 00000000..9d4a7ed4 --- /dev/null +++ b/build/debugsoft/TMPJump/Makefile @@ -0,0 +1,92 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests - tmpjumpTest +# 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$ +#---------------------------------------------------------------------------- + +SUBDIRS = + +#---------------------------------------------------------------------------- + +override TARGET_PLATFORM = TWL + +# GameCard, NAND の両方を作成する + +ifndef APP_TYPE + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +do-build: do-something +clean: do-something +clobber: do-something +install: do-something +do-build: MY_GOAL=default +clean: MY_GOAL=clean +clobber: MY_GOAL=clobber +install: MY_GOAL=install + +do-something: + +$(REMAKE) APP_TYPE=CARD SKIP_SUBDIR=FALSE $(MY_GOAL) + +$(REMAKE) APP_TYPE=NAND SKIP_SUBDIR=FALSE $(MY_GOAL) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +else # ifndef APP_TYPE + +TWL_NANDAPP = TRUE +TARGET_NAME = tmpjumpTest$(ROMTYPE) + +ifeq ($(APP_TYPE),NAND) +TARGET_BIN = $(TARGET_NAME).tad +ROM_SPEC = main_437a.rsf + +else +TARGET_BIN = $(TARGET_NAME).srl +ROM_SPEC = main_436a.rsf +endif + +endif # ifndef APP_TYPE + +INCDIR = ./include +SRCDIR = ./src + +SRCS = main.c common.c screen.c font.c + +ifeq ($(ROMTYPE),MASTER) +MAKEROM_ROMROOT = ./mas_data +else +MAKEROM_ROMROOT = ./data +endif + +MAKEROM_ROMFILES = TestApp.srl \ + TestApp_HYBRID.srl \ + TestApp_LIMITED.srl \ + Test_NITROfail.srl \ + Test_TWLfail.srl + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/TMPJumpTest +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/TMPJump/ReadMe.txt b/build/debugsoft/TMPJump/ReadMe.txt new file mode 100644 index 00000000..b233c4d1 --- /dev/null +++ b/build/debugsoft/TMPJump/ReadMe.txt @@ -0,0 +1,55 @@ +tmpjumpTest + +アプリジャンプ機能(TMPジャンプ)をテストするためのアプリセットです。 +======================================================== + +<概要> =============================================== +このテストでは、以下の 7つのアプリを使用します。 + +--------------------------------------------------------- +address | GameCode | Media | +--------------------------------+-----------+-----------+ +data/TestApp.srl | 433A | GameCard | +data/TestApp_HYBRID.srl | 434A | GameCard | +data/TestApp_LIMITED.srl | 435A | GameCard | tmp 格納用 ROM +data/TestApp_NTR_fail.srl | 458A | GameCard | +data/TestApp_TWL_fail.srl | 459A | GameCard | +--------------------------------------------------------- +bin/.../tmpjumpTest.srl | 436A | GameCard | 起動用 ROM +bin/.../tmpjumpTest.nand.tad | 437A | NAND | +--------------------------------------------------------- + +上の 5つのアプリは、下 2つのアプリに埋め込まれています。 + +<使い方> ============================================= + +まず、「フラッシュカードに書き込んだ 436A」または「インポートした 437A」を起動します。 + +436A, 437A では、選択したアプリを NAND の /tmp 以下へコピーし、TMPジャンプを実行します。 +TMP ジャンプ先のアプリからは、NITRO モードでビルドされている 433A を除く全てのアプリは +ジャンプ元のアプリへ戻ってくることができます。 + + + +(08/08/28 追加)アプリ2点追加、機能追加2点 +TMP ジャンプ先となるアプリとして、458A、459A の 2つを追加しました。 +これら 2つのアプリは「TMP ジャンプ不許可」のアプリなので、TMP ジャンプを実行すると +「必ず失敗」する仕様になっています。 + +TMP ジャンプ先のアプリから、さらに TMP ジャンプが実行できるようにしました。 +仕様では、「必ず失敗」するようになっています。 + +起動用 ROM で、リターンジャンプが可能になりました。 +一度 TMP ジャンプで飛んだあと、リターンジャンプによって起動用 ROM に戻り、 +再度リターンジャンプを実行すると、戻り先が設定されていないために +「必ず失敗」するはずです。 + + +======================================================== +なにか問題がありましたら、環境制作部 西本まで。 +nishimoto_takashi@nintendo.co.jp + +<更新履歴>============================================ +2008/08/28 仕様追加に伴う加筆修正 +2008/08/12 新規追加 + diff --git a/build/debugsoft/TMPJump/banner/banner.bnr b/build/debugsoft/TMPJump/banner/banner.bnr new file mode 100644 index 00000000..e234d8cd Binary files /dev/null and b/build/debugsoft/TMPJump/banner/banner.bnr differ diff --git a/build/debugsoft/TMPJump/data/TestApp.srl b/build/debugsoft/TMPJump/data/TestApp.srl new file mode 100644 index 00000000..d0ce9eb8 Binary files /dev/null and b/build/debugsoft/TMPJump/data/TestApp.srl differ diff --git a/build/debugsoft/TMPJump/data/TestApp_HYBRID.srl b/build/debugsoft/TMPJump/data/TestApp_HYBRID.srl new file mode 100644 index 00000000..f9001dab Binary files /dev/null and b/build/debugsoft/TMPJump/data/TestApp_HYBRID.srl differ diff --git a/build/debugsoft/TMPJump/data/TestApp_LIMITED.srl b/build/debugsoft/TMPJump/data/TestApp_LIMITED.srl new file mode 100644 index 00000000..dcbaa000 Binary files /dev/null and b/build/debugsoft/TMPJump/data/TestApp_LIMITED.srl differ diff --git a/build/debugsoft/TMPJump/data/Test_NITROfail.srl b/build/debugsoft/TMPJump/data/Test_NITROfail.srl new file mode 100644 index 00000000..0574274f Binary files /dev/null and b/build/debugsoft/TMPJump/data/Test_NITROfail.srl differ diff --git a/build/debugsoft/TMPJump/data/Test_TWLfail.srl b/build/debugsoft/TMPJump/data/Test_TWLfail.srl new file mode 100644 index 00000000..17f45a43 Binary files /dev/null and b/build/debugsoft/TMPJump/data/Test_TWLfail.srl differ diff --git a/build/debugsoft/TMPJump/data/dummy.srl b/build/debugsoft/TMPJump/data/dummy.srl new file mode 100644 index 00000000..54a62709 Binary files /dev/null and b/build/debugsoft/TMPJump/data/dummy.srl differ diff --git a/build/debugsoft/TMPJump/include/common.h b/build/debugsoft/TMPJump/include/common.h new file mode 100644 index 00000000..f06d1e6e --- /dev/null +++ b/build/debugsoft/TMPJump/include/common.h @@ -0,0 +1,81 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest + File: common.h + + 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$ + *---------------------------------------------------------------------------*/ +#ifndef COMMON_H_ +#define COMMON_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#ifdef SDK_TWL +#include +#else +#include +#endif + +/*---------------------------------------------------------------------------* + 定数定義 + *---------------------------------------------------------------------------*/ +#define KEY_REPEAT_START 25 // キーリピート開始までのフレーム数 +#define KEY_REPEAT_SPAN 10 // キーリピートの間隔フレーム数 + +/* アプリ間パラメータ関連 */ +#define APPJUMP_STRING_LENGTH 24 // 引数一つ分として受け渡しされる文字列の長さ制限 + +/*---------------------------------------------------------------------------* + 構造体 定義 + *---------------------------------------------------------------------------*/ + +// キー入力情報 +typedef struct KeyInfo +{ + u16 cnt; // 未加工入力値 + u16 trg; // 押しトリガ入力 + u16 up; // 離しトリガ入力 + u16 rep; // 押し維持リピート入力 +} KeyInfo; + +// アプリ間でバイナリデータとして引き渡す構造体 +typedef struct AppParam +{ + u32 jumpCount; // アプリジャンプの実行回数 + u8 isAutoJump; // 一定間隔で自動的にアプリジャンプを実行するかどうかのフラグ + u8 rsv[3]; // 4バイトアラインメントのため +} AppParam; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +void InitCommon(void); + +void ReadKey(KeyInfo* pKey); + +void VBlankIntr(void); + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* COMMON_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/TMPJump/include/font.h b/build/debugsoft/TMPJump/include/font.h new file mode 100644 index 00000000..37699026 --- /dev/null +++ b/build/debugsoft/TMPJump/include/font.h @@ -0,0 +1,41 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: font.h + + Copyright 2007 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$ + *---------------------------------------------------------------------------*/ +#ifndef FONT_H_ +#define FONT_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#include + +extern const u32 d_CharData[8 * 256]; +extern const u32 d_PaletteData[8 * 16]; + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* FONT_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/TMPJump/include/screen.h b/build/debugsoft/TMPJump/include/screen.h new file mode 100644 index 00000000..0d08dffd --- /dev/null +++ b/build/debugsoft/TMPJump/include/screen.h @@ -0,0 +1,49 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: screen.h + + Copyright 2007 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$ + *---------------------------------------------------------------------------*/ +#ifndef SCREEN_H_ +#define SCREEN_H_ + +#ifdef __cplusplus + +extern "C" { +#endif + +/*===========================================================================*/ +#include + +/*---------------------------------------------------------------------------* + 関数 定義 + *---------------------------------------------------------------------------*/ +void InitScreen(void); +void ClearScreen(void); +void ClearMainScreen(void); +void ClearSubScreen(void); +void PutMainScreen(s32 x, s32 y, u8 palette, char* text, ...); +void PutSubScreen(s32 x, s32 y, u8 palette, char* text, ...); +void UpdateScreen(void); + +/*===========================================================================*/ +#ifdef __cplusplus + +} /* extern "C" */ +#endif + +#endif /* SCREEN_H_ */ + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/TMPJump/main_436a.rsf b/build/debugsoft/TMPJump/main_436a.rsf new file mode 100644 index 00000000..5990b122 --- /dev/null +++ b/build/debugsoft/TMPJump/main_436a.rsf @@ -0,0 +1,248 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TmpJmpTest + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./436A/rom_header_436a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "./banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump TRUE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump TRUE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # NANDAccess: NAND access control [TRUE/FALSE] + # + NANDAccess TRUE + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media GameCard + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 436A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/TMPJump/main_437a.rsf b/build/debugsoft/TMPJump/main_437a.rsf new file mode 100644 index 00000000..c5a20aae --- /dev/null +++ b/build/debugsoft/TMPJump/main_437a.rsf @@ -0,0 +1,243 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, 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$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName TmpJmpTest + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./437A/rom_header_437a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "./banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump TRUE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump TRUE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 437A + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + #GameCardOn FALSE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + #GameCardNitroMode FALSE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/debugsoft/TMPJump/mas_data/TestApp.srl b/build/debugsoft/TMPJump/mas_data/TestApp.srl new file mode 100644 index 00000000..228b0b3a Binary files /dev/null and b/build/debugsoft/TMPJump/mas_data/TestApp.srl differ diff --git a/build/debugsoft/TMPJump/mas_data/TestApp_HYBRID.srl b/build/debugsoft/TMPJump/mas_data/TestApp_HYBRID.srl new file mode 100644 index 00000000..f9001dab Binary files /dev/null and b/build/debugsoft/TMPJump/mas_data/TestApp_HYBRID.srl differ diff --git a/build/debugsoft/TMPJump/mas_data/TestApp_LIMITED.srl b/build/debugsoft/TMPJump/mas_data/TestApp_LIMITED.srl new file mode 100644 index 00000000..dcbaa000 Binary files /dev/null and b/build/debugsoft/TMPJump/mas_data/TestApp_LIMITED.srl differ diff --git a/build/debugsoft/TMPJump/mas_data/Test_NITROfail.srl b/build/debugsoft/TMPJump/mas_data/Test_NITROfail.srl new file mode 100644 index 00000000..d4e163ea Binary files /dev/null and b/build/debugsoft/TMPJump/mas_data/Test_NITROfail.srl differ diff --git a/build/debugsoft/TMPJump/mas_data/Test_TWLfail.srl b/build/debugsoft/TMPJump/mas_data/Test_TWLfail.srl new file mode 100644 index 00000000..17f45a43 Binary files /dev/null and b/build/debugsoft/TMPJump/mas_data/Test_TWLfail.srl differ diff --git a/build/debugsoft/TMPJump/mas_data/dummy.srl b/build/debugsoft/TMPJump/mas_data/dummy.srl new file mode 100644 index 00000000..8d5cce72 Binary files /dev/null and b/build/debugsoft/TMPJump/mas_data/dummy.srl differ diff --git a/build/debugsoft/TMPJump/src/common.c b/build/debugsoft/TMPJump/src/common.c new file mode 100644 index 00000000..b1883893 --- /dev/null +++ b/build/debugsoft/TMPJump/src/common.c @@ -0,0 +1,153 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - tests - appjumpTest + File: common.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 "common.h" + +static void InitInterrupts(void); +static void InitHeap(void); + +/*---------------------------------------------------------------------------* + 関数定義 + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------* + Name: InitCommon + + Description: 基本的な初期化関数をここで呼ぶ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void InitCommon(void) +{ + OS_Init(); + OS_InitTick(); + OS_InitAlarm(); + GX_Init(); + GX_DispOff(); + GXS_DispOff(); + + InitHeap(); + InitInterrupts(); +} + +/*---------------------------------------------------------------------------* + Name: ReadKey + + Description: キー入力情報を取得し、入力情報構造体を編集する。 + 押しトリガ、離しトリガ、押し継続リピートトリガ を検出する。 + + Arguments: pKey - 編集するキー入力情報構造体を指定する。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void ReadKey(KeyInfo* pKey) +{ + static u16 repeat_count[12]; + int i; + u16 r; + + r = PAD_Read(); + pKey->trg = 0x0000; + pKey->up = 0x0000; + pKey->rep = 0x0000; + + for (i = 0; i < 12; i++) + { + if (r & (0x0001 << i)) + { + if (!(pKey->cnt & (0x0001 << i))) + { + pKey->trg |= (0x0001 << i); // 押しトリガ + repeat_count[i] = 1; + } + else + { + if (repeat_count[i] > KEY_REPEAT_START) + { + pKey->rep |= (0x0001 << i); // 押し継続リピート + repeat_count[i] = (u16) (KEY_REPEAT_START - KEY_REPEAT_SPAN); + } + else + { + repeat_count[i]++; + } + } + } + else + { + if (pKey->cnt & (0x0001 << i)) + { + pKey->up |= (0x0001 << i); // 離しトリガ + } + } + } + + pKey->cnt = r; // 未加工キー入力 +} + +/*---------------------------------------------------------------------------* + Name: InitInterrupts + + Description: 割り込み設定を初期化する。 + V ブランク割り込みを許可し、割り込みハンドラを設定する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitInterrupts(void) +{ + // V ブランク割り込み設定 + OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)GX_VBlankIntr(TRUE); + + // 割り込み許可 + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); +} + +/*---------------------------------------------------------------------------* + Name: InitHeap + + Description: メインメモリ上のアリーナにてメモリ割当てシステムを初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitHeap(void) +{ + void* tempLo; + OSHeapHandle hh; + + // メインメモリ上のアリーナにヒープをひとつ作成 + tempLo = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1); + OS_SetArenaLo(OS_ARENA_MAIN, tempLo); + hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi()); + if (hh < 0) + { + // ヒープ作成に失敗した場合は異常終了 + OS_Panic("ARM9: Fail to create heap...\n"); + } + (void)OS_SetCurrentHeap(OS_ARENA_MAIN, hh); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/TMPJump/src/font.c b/build/debugsoft/TMPJump/src/font.c new file mode 100644 index 00000000..2111ca07 --- /dev/null +++ b/build/debugsoft/TMPJump/src/font.c @@ -0,0 +1,585 @@ +/*---------------------------------------------------------------------------* + Project: NitroWiFi - WCM - demos - wcm-list + File: font.c + + Copyright 2005,2006 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. + + $Log: font.c,v $ + Revision 1.2 2006/03/10 09:22:43 kitase_hirotake + INDENT SOURCE + + Revision 1.1 2005/07/21 08:21:06 adachi_hiroaki + 新規追加 + + + $NoKeywords: $ + *---------------------------------------------------------------------------*/ +#include "font.h" + +/*---------------------------------------------------------------------------* + Character data + *---------------------------------------------------------------------------*/ +const u32 d_CharData[8 * 256] = +{ + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01010010, 0x01010010, 0x00000110, // 0001h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x01011010, 0x01010010, 0x00010010, // 0002h + 0x00100010, 0x00100010, 0x00100001, 0x00100001, + 0x00000000, 0x01010001, 0x01010001, 0x01111111, // 0003h + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 0004h + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01010000, 0x01010100, 0x00001010, // 0005h + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011000, 0x01011000, 0x01111111, // 0006h + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01010010, 0x01101111, 0x01010010, // 0007h + 0x00010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x01010010, 0x01011111, 0x00000100, // 0008h + 0x00011111, 0x00001000, 0x00000001, 0x00011110, + 0x00000000, 0x01010000, 0x01011000, 0x00000110, // 0009h + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x01010000, 0x01111101, 0x00010001, // 000ah + 0x00010001, 0x00010001, 0x00010001, 0x00001010, + 0x00000000, 0x01010000, 0x01011110, 0x00100000, // 000bh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010100, 0x01011111, 0x00001000, // 000ch + 0x00010000, 0x00000001, 0x00000001, 0x00011110, + 0x00000000, 0x01010001, 0x01010001, 0x00000001, // 000dh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00011000, // 000eh + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x01010010, 0x01111111, 0x00010010, // 000fh + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00001110, 0x01010100, 0x01010010, // 0010h + 0x00111111, 0x00000100, 0x00000100, 0x00011000, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 0011h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x01010100, 0x01011111, 0x00000010, // 0012h + 0x00011110, 0x00100001, 0x00100000, 0x00011110, + 0x00000000, 0x01010000, 0x01011100, 0x00100011, // 0013h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01010000, 0x01111111, 0x00010000, // 0014h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x01010010, 0x01010010, 0x00001100, // 0015h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x01010001, 0x01111101, 0x00010001, // 0016h + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01010100, 0x01010011, 0x01110010, // 0017h + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01011110, 0x01011000, 0x00000100, // 0018h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01010000, 0x01011100, 0x00010010, // 0019h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01011101, 0x01010001, 0x00111101, // 001ah + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x01110001, 0x01011101, 0x00110001, // 001bh + 0x00010001, 0x00111001, 0x01010101, 0x00011001, + 0x00000000, 0x01110100, 0x01010011, 0x00110010, // 001ch + 0x00010001, 0x00010001, 0x00001010, 0x00000100, + 0x00000000, 0x01101110, 0x01011000, 0x00100100, // 001dh + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x01110000, 0x01011100, 0x00110010, // 001eh + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x01010001, 0x00111101, // 001fh + 0x00010001, 0x00011001, 0x00110101, 0x00001001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0020h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 0021h + 0x00001000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x01101100, 0x01001000, 0x00100100, // 0022h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100100, 0x01111111, 0x00100100, // 0023h + 0x00100100, 0x01111111, 0x00010010, 0x00010010, + 0x00000000, 0x00001000, 0x01111110, 0x00001001, // 0024h + 0x00111110, 0x01001000, 0x00111111, 0x00001000, + 0x00000000, 0x01000010, 0x00100101, 0x00010010, // 0025h + 0x00001000, 0x00100100, 0x01010010, 0x00100001, + 0x00000000, 0x00001110, 0x00010001, 0x00001001, // 0026h + 0x01000110, 0x00101001, 0x00110001, 0x01001110, + 0x00000000, 0x00011000, 0x00010000, 0x00001000, // 0027h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01110000, 0x00001000, 0x00000100, // 0028h + 0x00000100, 0x00000100, 0x00001000, 0x01110000, + 0x00000000, 0x00000111, 0x00001000, 0x00010000, // 0029h + 0x00010000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x00001000, 0x01001001, 0x00101010, // 002ah + 0x00011100, 0x00101010, 0x01001001, 0x00001000, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 002bh + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002ch + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002dh + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002eh + 0x00000000, 0x00000000, 0x00000000, 0x00001100, + 0x00000000, 0x01000000, 0x00100000, 0x00010000, // 002fh + 0x00001000, 0x00000100, 0x00000010, 0x00000001, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0030h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00011100, 0x00010000, 0x00010000, // 0031h + 0x00010000, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0032h + 0x00111110, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0033h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00100000, 0x00110000, 0x00101000, // 0034h + 0x00100100, 0x00100010, 0x01111111, 0x00100000, + 0x00000000, 0x01111111, 0x00000001, 0x00111111, // 0035h + 0x01000000, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x00000001, 0x00111111, // 0036h + 0x01000001, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00100000, 0x00100000, // 0037h + 0x00010000, 0x00010000, 0x00001000, 0x00001000, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0038h + 0x00111110, 0x01000001, 0x01000001, 0x00111110, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0039h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003ah + 0x00000000, 0x00000000, 0x00001100, 0x00000000, + 0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003bh + 0x00000000, 0x00001100, 0x00001000, 0x00000100, + 0x00000000, 0x01100000, 0x00011000, 0x00000110, // 003ch + 0x00000001, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00000000, 0x01111111, 0x00000000, // 003dh + 0x00000000, 0x00000000, 0x01111111, 0x00000000, + 0x00000000, 0x00000011, 0x00001100, 0x00110000, // 003eh + 0x01000000, 0x00110000, 0x00001100, 0x00000011, + 0x00000000, 0x00111110, 0x01000001, 0x01000001, // 003fh + 0x00110000, 0x00001000, 0x00000000, 0x00001000, + 0x00000000, 0x00011100, 0x00100010, 0x01001001, // 0040h + 0x01010101, 0x01010101, 0x01010101, 0x00111010, + 0x00000000, 0x00001000, 0x00010100, 0x00010100, // 0041h + 0x00100010, 0x00111110, 0x01000001, 0x01000001, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0042h + 0x00111111, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0043h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x00011111, 0x00100001, 0x01000001, // 0044h + 0x01000001, 0x01000001, 0x00100001, 0x00011111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0045h + 0x01111111, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0046h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0047h + 0x01111001, 0x01000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0048h + 0x01111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x00001000, 0x00001000, // 0049h + 0x00001000, 0x00001000, 0x00001000, 0x00111110, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 004ah + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01100001, 0x00011001, 0x00000101, // 004bh + 0x00000011, 0x00000101, 0x00011001, 0x01100001, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 004ch + 0x00000001, 0x00000001, 0x00000001, 0x01111111, + 0x00000000, 0x01000001, 0x01100011, 0x01010101, // 004dh + 0x01001001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x01000001, 0x01000011, 0x01000101, // 004eh + 0x01001001, 0x01010001, 0x01100001, 0x01000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 004fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0050h + 0x00111111, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00011100, 0x00100010, 0x01000001, // 0051h + 0x01000001, 0x01011001, 0x00100010, 0x01011100, + 0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0052h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00111110, 0x01000001, 0x00000001, // 0053h + 0x00111110, 0x01000000, 0x01000001, 0x00111110, + 0x00000000, 0x01111111, 0x00001000, 0x00001000, // 0054h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0055h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x01000001, 0x01000001, 0x00100010, // 0056h + 0x00100010, 0x00010100, 0x00010100, 0x00001000, + 0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0057h + 0x01001001, 0x01010101, 0x01100011, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0058h + 0x00001000, 0x00010100, 0x00100010, 0x01000001, + 0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0059h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01111111, 0x00100000, 0x00010000, // 005ah + 0x00001000, 0x00000100, 0x00000010, 0x01111111, + 0x00000000, 0x01111100, 0x00000100, 0x00000100, // 005bh + 0x00000100, 0x00000100, 0x00000100, 0x01111100, + 0x00000000, 0x00100010, 0x00010100, 0x00111110, // 005ch + 0x00001000, 0x00111110, 0x00001000, 0x00001000, + 0x00000000, 0x00011111, 0x00010000, 0x00010000, // 005dh + 0x00010000, 0x00010000, 0x00010000, 0x00011111, + 0x00000000, 0x00001000, 0x00010100, 0x00100010, // 005eh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 005fh + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x00010000, 0x00001000, 0x00011000, // 0060h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00011110, 0x00100001, // 0061h + 0x00111110, 0x00100001, 0x00100001, 0x01011110, + 0x00000000, 0x00000001, 0x00000001, 0x00111111, // 0062h + 0x01000001, 0x01000001, 0x01000001, 0x00111111, + 0x00000000, 0x00000000, 0x00111100, 0x01000010, // 0063h + 0x00000001, 0x00000001, 0x01000010, 0x00111100, + 0x00000000, 0x01000000, 0x01000000, 0x01111110, // 0064h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0065h + 0x01111111, 0x00000001, 0x01000001, 0x00111110, + 0x00000000, 0x00110000, 0x00001000, 0x00001000, // 0066h + 0x01111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x01111110, 0x01000001, // 0067h + 0x01000001, 0x01111110, 0x01000000, 0x00111110, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0068h + 0x00111111, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00001000, 0x00000000, 0x00001000, // 0069h + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00100000, 0x00000000, 0x00100000, // 006ah + 0x00100000, 0x00100001, 0x00100001, 0x00011110, + 0x00000000, 0x00000001, 0x00000001, 0x01100001, // 006bh + 0x00011001, 0x00000111, 0x00011001, 0x01100001, + 0x00000000, 0x00001000, 0x00001000, 0x00001000, // 006ch + 0x00001000, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00110111, 0x01001001, // 006dh + 0x01001001, 0x01001001, 0x01001001, 0x01001001, + 0x00000000, 0x00000000, 0x00111111, 0x01000001, // 006eh + 0x01000001, 0x01000001, 0x01000001, 0x01000001, + 0x00000000, 0x00000000, 0x00011100, 0x00100010, // 006fh + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00000000, 0x00111101, 0x01000011, // 0070h + 0x01000001, 0x01000011, 0x00111101, 0x00000001, + 0x00000000, 0x00000000, 0x01011110, 0x01100001, // 0071h + 0x01000001, 0x01100001, 0x01011110, 0x01000000, + 0x00000000, 0x00000000, 0x00110001, 0x00001101, // 0072h + 0x00000011, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0073h + 0x00001110, 0x00110000, 0x01000001, 0x00111110, + 0x00000000, 0x00000100, 0x00000100, 0x01111111, // 0074h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0075h + 0x01000001, 0x01000001, 0x01000001, 0x01111110, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0076h + 0x00100010, 0x00100010, 0x00010100, 0x00001000, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0077h + 0x01001001, 0x00101010, 0x00101010, 0x00010100, + 0x00000000, 0x00000000, 0x00100001, 0x00010010, // 0078h + 0x00001100, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0079h + 0x00100010, 0x00011100, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111111, 0x00010000, // 007ah + 0x00001000, 0x00000100, 0x00000010, 0x00111111, + 0x00000000, 0x00001000, 0x00011110, 0x01100100, // 007bh + 0x00011000, 0x00100100, 0x00000100, 0x01111000, + 0x00000000, 0x00000000, 0x00011110, 0x00000100, // 007ch + 0x00011110, 0x00110101, 0x00101101, 0x00010010, + 0x00000000, 0x00000000, 0x00000000, 0x00010001, // 007dh + 0x00100001, 0x00100001, 0x00000001, 0x00000010, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007eh + 0x00011110, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007fh + 0x00111110, 0x00010000, 0x00001100, 0x00110010, + 0x00000000, 0x00000000, 0x00000100, 0x00101111, // 0080h + 0x01000100, 0x00011110, 0x00100101, 0x00010110, + 0x00000000, 0x00000000, 0x00001010, 0x00011110, // 0081h + 0x00101011, 0x00100010, 0x00010100, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00011101, // 0082h + 0x00101011, 0x00101001, 0x00011001, 0x00000100, + 0x00000000, 0x00000000, 0x00001000, 0x00111000, // 0083h + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00000000, 0x00000000, 0x00011100, // 0084h + 0x00100011, 0x00100000, 0x00100000, 0x00011100, + 0x00000000, 0x00000110, 0x01001001, 0x00110000, // 0085h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000100, 0x00111111, 0x00000100, // 0086h + 0x00111110, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000000, 0x00100001, 0x01000001, // 0087h + 0x01000001, 0x01000001, 0x00000001, 0x00000010, + 0x00000000, 0x00111100, 0x00000000, 0x00111110, // 0088h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00011100, 0x00000000, 0x00111110, // 0089h + 0x00010000, 0x00001000, 0x00010100, 0x01100010, + 0x00000000, 0x00100100, 0x01011111, 0x00000100, // 008ah + 0x00111110, 0x01000101, 0x01000101, 0x00100010, + 0x00000000, 0x00100010, 0x01001111, 0x01010010, // 008bh + 0x01010010, 0x00010010, 0x00010010, 0x00001001, + 0x00000000, 0x00000100, 0x00111110, 0x00001000, // 008ch + 0x00111110, 0x00010000, 0x00000010, 0x00111100, + 0x00000000, 0x00100000, 0x00011000, 0x00000110, // 008dh + 0x00000001, 0x00000110, 0x00011000, 0x00100000, + 0x00000000, 0x00100000, 0x01111101, 0x00100001, // 008eh + 0x00100001, 0x00100001, 0x00100001, 0x00010010, + 0x00000000, 0x00011110, 0x00100000, 0x00000000, // 008fh + 0x00000000, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00001000, 0x01111111, 0x00010000, // 0090h + 0x00100000, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0091h + 0x01000001, 0x01000001, 0x00100010, 0x00011100, + 0x00000000, 0x00010000, 0x01111111, 0x00011000, // 0092h + 0x00010100, 0x00010100, 0x00011000, 0x00001100, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 0093h + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x00111100, 0x00010000, 0x00001100, // 0094h + 0x01111111, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000100, 0x00011111, 0x00000100, // 0095h + 0x01110100, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00001000, 0x01111111, 0x00000100, // 0096h + 0x00111100, 0x01000010, 0x01000000, 0x00111100, + 0x00000000, 0x00000000, 0x00011100, 0x00100011, // 0097h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01111111, 0x00010000, 0x00001000, // 0098h + 0x00001000, 0x00001000, 0x00001000, 0x00110000, + 0x00000000, 0x00000010, 0x00110010, 0x00001100, // 0099h + 0x00000010, 0x00000001, 0x00000001, 0x00111110, + 0x00000000, 0x00100100, 0x01001111, 0x01000010, // 009ah + 0x00010001, 0x00111100, 0x00010010, 0x00001100, + 0x00000000, 0x00000010, 0x01111010, 0x01000010, // 009bh + 0x00000010, 0x00000010, 0x00001010, 0x01110010, + 0x00000000, 0x00100010, 0x00111110, 0x01010010, // 009ch + 0x01001011, 0x01101101, 0x01010101, 0x00110010, + 0x00000000, 0x00110010, 0x01001011, 0x01000110, // 009dh + 0x01000110, 0x01110010, 0x01001011, 0x00110010, + 0x00000000, 0x00011100, 0x00101010, 0x01001001, // 009eh + 0x01001001, 0x01000101, 0x01000101, 0x00110010, + 0x00000000, 0x00100001, 0x01111101, 0x00100001, // 009fh + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00000100, 0x00100011, 0x01100010, // 00a0h + 0x00100001, 0x00100001, 0x00010010, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a1h + 0x00000000, 0x00000100, 0x00001010, 0x00000100, + 0x00000000, 0x01110000, 0x00010000, 0x00010000, // 00a2h + 0x00010000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a3h + 0x00001000, 0x00001000, 0x00001000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a4h + 0x00000000, 0x00000010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00011000, // 00a5h + 0x00011000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x01111111, // 00a6h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x00000000, 0x00111111, 0x00100000, // 00a7h + 0x00010100, 0x00001100, 0x00000100, 0x00000010, + 0x00000000, 0x00000000, 0x00100000, 0x00100000, // 00a8h + 0x00010000, 0x00001111, 0x00001000, 0x00001000, + 0x00000000, 0x00000000, 0x00000100, 0x00111111, // 00a9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00aah + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00000000, 0x00010000, 0x00111111, // 00abh + 0x00011000, 0x00010100, 0x00010010, 0x00011001, + 0x00000000, 0x00000000, 0x00000010, 0x00111111, // 00ach + 0x00100010, 0x00010010, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00adh + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00aeh + 0x00111110, 0x00100000, 0x00100000, 0x00111110, + 0x00000000, 0x00000000, 0x00100101, 0x00101010, // 00afh + 0x00101010, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00b0h + 0x01111111, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01111111, 0x01000000, 0x00101000, // 00b1h + 0x00011000, 0x00001000, 0x00001000, 0x00000100, + 0x00000000, 0x01000000, 0x00100000, 0x00011000, // 00b2h + 0x00010111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x00001000, 0x01111111, 0x01000001, // 00b3h + 0x01000001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000000, 0x00111110, 0x00001000, // 00b4h + 0x00001000, 0x00001000, 0x00001000, 0x01111111, + 0x00000000, 0x00100000, 0x01111111, 0x00110000, // 00b5h + 0x00101000, 0x00100100, 0x00100010, 0x00110001, + 0x00000000, 0x00000100, 0x01111111, 0x01000100, // 00b6h + 0x01000100, 0x01000100, 0x01000010, 0x00100001, + 0x00000000, 0x00000100, 0x00111111, 0x00001000, // 00b7h + 0x01111111, 0x00010000, 0x00010000, 0x00010000, + 0x00000000, 0x01111100, 0x01000100, 0x01000100, // 00b8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00000010, 0x01111110, 0x00100010, // 00b9h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00bah + 0x01000000, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00100010, 0x01111111, 0x00100010, // 00bbh + 0x00100010, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x00000011, 0x00000100, 0x01000011, // 00bch + 0x01000100, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x01111111, 0x01000000, 0x00100000, // 00bdh + 0x00010000, 0x00011000, 0x00100100, 0x01000011, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00beh + 0x00100010, 0x00000010, 0x00000010, 0x01111100, + 0x00000000, 0x01000001, 0x01000010, 0x01000000, // 00bfh + 0x00100000, 0x00100000, 0x00011000, 0x00000110, + 0x00000000, 0x01111110, 0x01000010, 0x01001110, // 00c0h + 0x01110001, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x01100000, 0x00011110, 0x00010000, // 00c1h + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01000101, 0x01001010, 0x01001010, // 00c2h + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00c3h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000010, 0x00000010, 0x00000110, // 00c4h + 0x00011010, 0x01100010, 0x00000010, 0x00000010, + 0x00000000, 0x00010000, 0x00010000, 0x01111111, // 00c5h + 0x00010000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x00000000, 0x00111110, 0x00000000, // 00c6h + 0x00000000, 0x00000000, 0x00000000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000100, // 00c7h + 0x00101000, 0x00010000, 0x00101000, 0x01000110, + 0x00000000, 0x00001000, 0x01111111, 0x00100000, // 00c8h + 0x00010000, 0x00011100, 0x01101011, 0x00001000, + 0x00000000, 0x01000000, 0x01000000, 0x01000000, // 00c9h + 0x00100000, 0x00100000, 0x00011000, 0x00000111, + 0x00000000, 0x00010010, 0x00100010, 0x00100010, // 00cah + 0x01000010, 0x01000010, 0x01000001, 0x01000001, + 0x00000000, 0x00000001, 0x00000001, 0x01111111, // 00cbh + 0x00000001, 0x00000001, 0x00000001, 0x01111110, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cch + 0x01000000, 0x00100000, 0x00010000, 0x00001110, + 0x00000000, 0x00000000, 0x00000100, 0x00001010, // 00cdh + 0x00010001, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x00001000, 0x00001000, 0x01111111, // 00ceh + 0x00001000, 0x00101010, 0x01001010, 0x01001001, + 0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cfh + 0x00100010, 0x00010100, 0x00001000, 0x00010000, + 0x00000000, 0x00001110, 0x01110000, 0x00001110, // 00d0h + 0x01110000, 0x00000110, 0x00011000, 0x01100000, + 0x00000000, 0x00001000, 0x00001000, 0x00000100, // 00d1h + 0x00000100, 0x00100010, 0x01000010, 0x01111111, + 0x00000000, 0x01000000, 0x01000000, 0x00100100, // 00d2h + 0x00101000, 0x00010000, 0x00101100, 0x01000011, + 0x00000000, 0x01111111, 0x00000100, 0x01111111, // 00d3h + 0x00000100, 0x00000100, 0x00000100, 0x01111000, + 0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00d4h + 0x00100010, 0x00010100, 0x00000100, 0x00000100, + 0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00d5h + 0x00100000, 0x00100000, 0x00100000, 0x01111111, + 0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00d6h + 0x01111110, 0x01000000, 0x01000000, 0x01111110, + 0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00d7h + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00d8h + 0x01000010, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00001010, 0x00001010, 0x00001010, // 00d9h + 0x01001010, 0x01001010, 0x00101010, 0x00011001, + 0x00000000, 0x00000010, 0x00000010, 0x01000010, // 00dah + 0x01000010, 0x00100010, 0x00010010, 0x00001110, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dbh + 0x01000001, 0x01000001, 0x01000001, 0x01111111, + 0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dch + 0x01000000, 0x01000000, 0x00100000, 0x00011100, + 0x00000000, 0x01000011, 0x01000100, 0x01000000, // 00ddh + 0x01000000, 0x00100000, 0x00010000, 0x00001111, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00deh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00dfh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00011110, 0x00001000, 0x00000100, // 00e0h + 0x00101001, 0x01010001, 0x01010001, 0x00001100, + 0x00000000, 0x00000000, 0x00001100, 0x00010010, // 00e1h + 0x00010010, 0x00100001, 0x01000000, 0x00000000, + 0x00000000, 0x01111101, 0x00100001, 0x01111101, // 00e2h + 0x00100001, 0x00111001, 0x01100101, 0x00011001, + 0x00000000, 0x00111100, 0x00010000, 0x00111100, // 00e3h + 0x00010000, 0x00011100, 0x00110010, 0x00001100, + 0x00000000, 0x00001110, 0x00101000, 0x00101000, // 00e4h + 0x00111110, 0x01100101, 0x00100101, 0x00010010, + 0x00000000, 0x00000100, 0x00101111, 0x01000100, // 00e5h + 0x00000110, 0x01000101, 0x01000101, 0x00111110, + 0x00000000, 0x00100010, 0x00100010, 0x00111110, // 00e6h + 0x01010010, 0x01010101, 0x01001101, 0x00100110, + 0x00000000, 0x00000100, 0x00011111, 0x00000010, // 00e7h + 0x00011111, 0x01000010, 0x01000010, 0x00111100, + 0x00000000, 0x00010010, 0x00111110, 0x01010011, // 00e8h + 0x01000010, 0x00100100, 0x00000100, 0x00000100, + 0x00000000, 0x00001000, 0x00111101, 0x01001011, // 00e9h + 0x01001001, 0x01001001, 0x00111000, 0x00000100, + 0x00000000, 0x00001000, 0x00111000, 0x00001000, // 00eah + 0x00001000, 0x00011110, 0x00101001, 0x00000110, + 0x00000000, 0x00011000, 0x00100000, 0x00000100, // 00ebh + 0x00111010, 0x01000110, 0x01000000, 0x00111000, + 0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00ech + 0x01000110, 0x01000000, 0x00100000, 0x00011000, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00edh + 0x01000011, 0x01001100, 0x01010010, 0x00111100, + 0x00000000, 0x00100010, 0x00110011, 0x00101010, // 00eeh + 0x00100110, 0x00100010, 0x00100011, 0x01000010, + 0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00efh + 0x01000011, 0x01000000, 0x01000010, 0x00111100, + 0x00000000, 0x00000010, 0x00111011, 0x01000110, // 00f0h + 0x01000010, 0x01000011, 0x01000010, 0x00110010, + 0x00000000, 0x00000100, 0x00000100, 0x00000010, // 00f1h + 0x01000110, 0x01000101, 0x01000101, 0x00111001, + 0x00000000, 0x01010100, 0x01111111, 0x00100100, // 00f2h + 0x00100100, 0x00100100, 0x00100010, 0x00010001, + 0x00000000, 0x01010100, 0x01011111, 0x00000100, // 00f3h + 0x00111111, 0x00001000, 0x00001000, 0x00001000, + 0x00000000, 0x01011110, 0x01100010, 0x00100010, // 00f4h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010010, 0x01111110, 0x00100010, // 00f5h + 0x00100001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01111111, 0x00100000, // 00f6h + 0x00100000, 0x00100000, 0x00100000, 0x00111111, + 0x00000000, 0x01010010, 0x01010010, 0x00111111, // 00f7h + 0x00010010, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x01010011, 0x01010100, 0x00100011, // 00f8h + 0x00100100, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01010000, 0x01011111, 0x00010000, // 00f9h + 0x00001000, 0x00001100, 0x00010010, 0x00100001, + 0x00000000, 0x01010010, 0x01111111, 0x00100010, // 00fah + 0x00010010, 0x00000010, 0x00000010, 0x00111100, + 0x00000000, 0x01010001, 0x01010010, 0x00100000, // 00fbh + 0x00100000, 0x00010000, 0x00001000, 0x00000110, + 0x00000000, 0x01011110, 0x01010010, 0x00100110, // 00fch + 0x00111001, 0x00100000, 0x00010000, 0x00001100, + 0x00000000, 0x01010000, 0x01011110, 0x00010000, // 00fdh + 0x01111111, 0x00010000, 0x00010000, 0x00001100, + 0x00000000, 0x00100101, 0x01001010, 0x00101010, // 00feh + 0x00100000, 0x00010000, 0x00001000, 0x00000111, + 0x00000000, 0x01011110, 0x01010000, 0x00111111, // 00ffh + 0x00001000, 0x00001000, 0x00001000, 0x00000110 +}; + +/*---------------------------------------------------------------------------* + Palette data + *---------------------------------------------------------------------------*/ +const u32 d_PaletteData[8 * 16] = +{ + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // black + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001f0000, 0x00000000, 0x00000000, 0x00000000, // red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00180000, 0x00000000, 0x00000000, 0x00000000, // dark red + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/TMPJump/src/main.c b/build/debugsoft/TMPJump/src/main.c new file mode 100644 index 00000000..177d9543 --- /dev/null +++ b/build/debugsoft/TMPJump/src/main.c @@ -0,0 +1,194 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - tmpjumpTest + 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 +#include "common.h" +#include "screen.h" + +/*---------------------------------------------------------------------------* + 定数 定義 + *---------------------------------------------------------------------------*/ +#define DMA_NO_FS 1 +#define APP_NUM 5 // TMP ジャンプ先ロム数 + +/*---------------------------------------------------------------------------* + 変数 定義 + *---------------------------------------------------------------------------*/ +// キー入力 +static KeyInfo gKey; + +// tmp へコピーする srl +static u8 gSrlNumber = 0; + +// 各 srl の TitleID +static u64 gRomTitleIDList[APP_NUM] = +{ + 0x0003000434333341, // NTR GameCode 433A + 0x0003000434333441, // TWL-HYB GameCode 434A + 0x0003000434333541, // TWL-LTD GameCode 435A + 0x0003000434353841, // NTR (don't permit TMP jump) GameCode 458A + 0x0003000434353941 // TWL (don't permit TMP jump) GameCode 459A +}; + +// 各 srl の場所 +static const char gRomPath[APP_NUM][32] = +{ + "rom:/TestApp.srl", "rom:/TestApp_HYBRID.srl", "rom:/TestApp_LIMITED.srl", + "rom:/Test_NITROfail.srl", "rom:/Test_TWLfail.srl" +}; + +/*---------------------------------------------------------------------------* + Prototype + *---------------------------------------------------------------------------*/ +static void DrawMainScene(void); +void VBlankIntr(void); + +void TwlMain(void) +{ + InitCommon(); + InitScreen(); + + FS_Init(DMA_NO_FS); + + GX_DispOn(); + GXS_DispOn(); + + ClearScreen(); + + // 一度空読み + ReadKey(&gKey); + + while(TRUE) + { + ReadKey(&gKey); + + if (gKey.trg & PAD_BUTTON_A) + { + BOOL success = TRUE; + FSFile src, dest; + void *buf; + s32 len = 0; + + PutSubScreen(1, 8, 0xff, "now writing tmp app..."); + OS_WaitVBlankIntr(); + + // srl を NAND 上の OS_TMP_APP_PATH へコピー + FS_DeleteFile(OS_TMP_APP_PATH); + FS_CreateFile(OS_TMP_APP_PATH, FS_PERMIT_R | FS_PERMIT_W); + FS_InitFile( &src ); + FS_InitFile( &dest ); + if ( !FS_OpenFileEx( &src, gRomPath[gSrlNumber], FS_FILEMODE_R ) ) success = FALSE; + len = (s32)FS_GetFileLength( &src ); + + buf = OS_AllocFromMain((u32)len); + if (buf == NULL) + { + success = FALSE; + break; + } + + if ( -1 == FS_ReadFile( &src, buf, len ) ) + { + success = FALSE; + break; + } + + if ( !FS_CloseFile( &src ) ) success = FALSE; + + if ( !FS_OpenFileEx( &dest, OS_TMP_APP_PATH, FS_FILEMODE_W ) ) success = FALSE; + if ( -1 == FS_WriteFile( &dest, buf, len ) ) success = FALSE; + if ( !FS_CloseFile( &dest ) ) success = FALSE; + + if ( !success ) break; + + // アプリジャンプ + OS_DoApplicationJump( gRomTitleIDList[gSrlNumber], OS_APP_JUMP_TMP ); + // 失敗時にはエラーを下画面に出力して終了 + PutSubScreen(1, 10, 0xf1, "ERROR: TMP Jump failed!"); + break; + } + + if (gKey.trg & PAD_BUTTON_B) + { + // リターンジャンプを試みる + if(!OS_ReturnToPrevApplication()) + { + // 失敗時にはメッセージを表示 + PutSubScreen(1, 10, 0xf1, "ERROR: Return Jump failed!"); + break; + } + } + + // 方向キー上下で、OS_TMP_APP_PATH へコピーする srl を選択 + if (gKey.trg & PAD_KEY_DOWN) + { + gSrlNumber++; + if (gSrlNumber > APP_NUM - 1) + gSrlNumber = 0; + } + else if (gKey.trg & PAD_KEY_UP) + { + if (gSrlNumber == 0) + gSrlNumber = APP_NUM -1; + else + gSrlNumber--; + } + + ClearScreen(); + DrawMainScene(); + + OS_WaitVBlankIntr(); + } + + OS_WaitVBlankIntr(); + OS_Terminate(); +} + + +static void DrawMainScene(void) +{ + PutMainScreen(1, 1, 0xf2, "Application (Main)"); + PutMainScreen(2, 4, 0xff, "B BUTTON: try return jump"); + + PutMainScreen(3, 12, 0xff, "Tmp jump to NITRO rom"); + PutMainScreen(3, 14, 0xff, "Tmp jump to TWL-HYB rom"); + PutMainScreen(3, 16, 0xff, "Tmp jump to TWL-LTD rom"); + + PutMainScreen(3, 18, 0xfe, "Tmp jump to NITRO x rom"); + PutMainScreen(3, 20, 0xfe, "Tmp jump to TWL x rom"); + + // 選択中を示すカーソル描画 + PutMainScreen(1, gSrlNumber * 2 + 12, 0xf4, "*"); +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: Vブランク割込みハンドラ。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void VBlankIntr(void) +{ + // テキスト表示を更新 + UpdateScreen(); + + // IRQ チェックフラグをセット + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} diff --git a/build/debugsoft/TMPJump/src/screen.c b/build/debugsoft/TMPJump/src/screen.c new file mode 100644 index 00000000..a9fec417 --- /dev/null +++ b/build/debugsoft/TMPJump/src/screen.c @@ -0,0 +1,194 @@ + /*---------------------------------------------------------------------------* + Project: TwlSDK - WCM - demos - wcm-list-2 + File: screen.c + + Copyright 2007 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 +#include "screen.h" +#include "font.h" + +/*---------------------------------------------------------------------------* + 定数 定義 + *---------------------------------------------------------------------------*/ +#define TEXT_SCREEN_SIZE 2048 + +/*---------------------------------------------------------------------------* + 内部変数 定義 + *---------------------------------------------------------------------------*/ + +// 仮想スクリーン[ 上下画面 ][ BG 枚数 ][ キャラクタ数 ] +static u16 gScreen[2 ][ 1 ][ TEXT_SCREEN_SIZE / sizeof(u16) ] ATTRIBUTE_ALIGN(32); + +/*---------------------------------------------------------------------------* + Name: InitScreen + + Description: 文字表示システムのために、表示設定を初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void InitScreen(void) +{ + // 各 V-RAM 初期化 + GX_SetBankForLCDC(GX_VRAM_LCDC_ALL); + MI_CpuClearFast((void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE); + (void)GX_DisableBankForLCDC(); + + // OAM 初期化 + MI_CpuFillFast((void*)HW_OAM, 0xc0, HW_OAM_SIZE); + MI_CpuFillFast((void*)HW_DB_OAM, 0xc0, HW_DB_OAM_SIZE); + + // パレット初期化 + MI_CpuClearFast((void*)HW_PLTT, HW_PLTT_SIZE); + MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE); + + // 上画面設定 + GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D); + + GX_SetBankForBG(GX_VRAM_BG_128_A); + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0x0000, GX_BG_CHARBASE_0x04000, + GX_BG_EXTPLTT_01); + G2_SetBG0Priority(0); + + GX_SetVisiblePlane(GX_PLANEMASK_BG0); + GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + ((u16*)HW_PLTT)[0] = 0x0000; // black + MI_CpuFillFast(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[0][0], TEXT_SCREEN_SIZE); + GX_LoadBG0Scr(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + + // 下画面設定 + GX_SetBankForSubBG(GX_VRAM_SUB_BG_32_H); + G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0x0000, GX_BG_CHARBASE_0x04000, + GX_BG_EXTPLTT_01); + G2S_SetBG0Priority(0); + GXS_SetGraphicsMode(GX_BGMODE_0); + GXS_SetVisiblePlane(GX_PLANEMASK_BG0); + GXS_LoadBG0Char(d_CharData, 0, sizeof(d_CharData)); + GXS_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData)); + ((u16*)HW_DB_PLTT)[0] = 0x0000; // black + MI_CpuFillFast(gScreen[1][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[1][0], TEXT_SCREEN_SIZE); + GXS_LoadBG0Scr(gScreen[1][0], 0, TEXT_SCREEN_SIZE); +} + +/*---------------------------------------------------------------------------* + Name: ClearScreen + + Description: 画面のテキスト表示をクリアする。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void ClearScreen(void) +{ + MI_CpuClearFast(gScreen[0][0], TEXT_SCREEN_SIZE); + MI_CpuClearFast(gScreen[1][0], TEXT_SCREEN_SIZE); +} +void ClearMainScreen(void) +{ + MI_CpuClearFast(gScreen[0][0], TEXT_SCREEN_SIZE); + +} +void ClearSubScreen(void) +{ + MI_CpuClearFast(gScreen[1][0], TEXT_SCREEN_SIZE); +} +/*---------------------------------------------------------------------------* + Name: PutMainScreen + + Description: メイン画面にテキスト出力する。 + + Arguments: text - 出力する文字列。 + ... - 仮想引数。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void PutMainScreen(s32 x, s32 y, u8 palette, char* text, ...) +{ + va_list vlist; + char temp[33]; + s32 i; + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + for (i = 0; i < 32; i++) + { + if (temp[i] == 0x00) + { + break; + } + + gScreen[0][0][((y * 32) + x + i) % (32 * 32)] = (u16) (palette << 12 | temp[i]); + } +} + +/*---------------------------------------------------------------------------* + Name: PrintSubScreen + + Description: サブ画面にテキスト出力する。 + + Arguments: text - 出力する文字列。 + ... - 仮想引数。 + + Returns: None. + *---------------------------------------------------------------------------*/ +void PutSubScreen(s32 x, s32 y, u8 palette, char* text, ...) +{ + va_list vlist; + char temp[33]; + s32 i; + + va_start(vlist, text); + (void)vsnprintf(temp, 33, text, vlist); + va_end(vlist); + + for (i = 0; i < 32; i++) + { + if (temp[i] == 0x00) + { + break; + } + + gScreen[1][0][((y * 32) + x + i) % (32 * 32)] = (u16) (palette << 12 | temp[i]); + } +} + +/*---------------------------------------------------------------------------* + Name: UpdateScreen + + Description: 仮想スクリーンを V-RAM に反映する。 + V ブランク期間中での呼び出しを想定。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void UpdateScreen(void) +{ + // 仮想スクリーンを V-RAM に反映 + DC_StoreRange(gScreen[0][0], TEXT_SCREEN_SIZE); + GX_LoadBG0Scr(gScreen[0][0], 0, TEXT_SCREEN_SIZE); + DC_StoreRange(gScreen[1][0], TEXT_SCREEN_SIZE); + GXS_LoadBG0Scr(gScreen[1][0], 0, TEXT_SCREEN_SIZE); +} + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/debugsoft/Wireless/Makefile b/build/debugsoft/Wireless/Makefile new file mode 100644 index 00000000..e54149f6 --- /dev/null +++ b/build/debugsoft/Wireless/Makefile @@ -0,0 +1,34 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tests +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL NITRO + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------------------------------------------------- + +SUBDIRS = WifiIcon + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== + + diff --git a/build/debugsoft/Wireless/WifiIcon/Makefile b/build/debugsoft/Wireless/WifiIcon/Makefile new file mode 100644 index 00000000..abf9410a --- /dev/null +++ b/build/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 + +#------------------------- +# インストール指定 +ifneq ($(TWL_IPL_RED_ROOT),) +INSTALL_DIR = $(TWL_IPL_RED_ROOT)/debugsoft/$(TARGET_NAME) +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/build/debugsoft/Wireless/WifiIcon/banner/banner.bnr b/build/debugsoft/Wireless/WifiIcon/banner/banner.bnr new file mode 100644 index 00000000..2a5447a2 Binary files /dev/null and b/build/debugsoft/Wireless/WifiIcon/banner/banner.bnr differ diff --git a/build/debugsoft/Wireless/WifiIcon/readme.txt b/build/debugsoft/Wireless/WifiIcon/readme.txt new file mode 100644 index 00000000..4f4ce4e8 --- /dev/null +++ b/build/debugsoft/Wireless/WifiIcon/readme.txt @@ -0,0 +1,6 @@ +WiFiIcon + +*概要 +  WiFiアイコン確認用のアプリ。 +  WiFiアイコンのフラグをオンにしてビルドされます。 +  アプリ自身の機能はありません。 diff --git a/build/debugsoft/Wireless/WifiIcon/src/main.c b/build/debugsoft/Wireless/WifiIcon/src/main.c new file mode 100644 index 00000000..5d509820 --- /dev/null +++ b/build/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); +} diff --git a/build/debugsoft/treenand2sd/Makefile b/build/debugsoft/treenand2sd/Makefile new file mode 100644 index 00000000..93d53d6b --- /dev/null +++ b/build/debugsoft/treenand2sd/Makefile @@ -0,0 +1,71 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - tools - treenand +# File: Makefile +# +# Copyright 2007 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$ +#---------------------------------------------------------------------------- + +SUBDIR_FLAGS = TWL_ARCHGEN=$(TWL_ARCHGEN) +SUBDIRS = $(SDLOG_DIR) + +TARGET_PLATFORM := TWL + +TWL_PROC := ARM9 +TWL_ARCHGEN := LIMITED +TARGET_BIN = treenand2sd.srl + +SRCS = main.cpp text.c MyStrings.c fontdata.c + +SDLOG_DIR = $(ROOT)/build/tests/sdlog/sdlog +LINCLUDES += $(SDLOG_DIR)/include +LLIBRARY_DIRS = $(SDLOG_DIR)/lib/$(TWL_BUILDTYPE) +LLIBRARIES += libsdlog$(NITRO_LIBSUFFIX).a\ + +ROM_SPEC = demo.autogen.rsf +ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf +ROM_SPEC_PARAM = MakerCode=01 \ + GameCode=4NTA \ + NANDAccess=TRUE \ + SDCardAccess=TRUE \ + Secure=TRUE \ + CardRegion=ALL \ + + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------- +# セキュアアプリ指定 + +MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe + +#---------------------------------------------------------------------------- + + +#---------------------------------------------------------------------------- +#追加するCCオプション +#---------------------------------------------------------------------------- +CCFLAGS += -w nounwanted + +ifeq ($(TWL_BUILD_TYPE),RELEASE) +INSTALL_DIR = $(ROOT)/bin/ARM9-TS/Release +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN) +endif + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/debugsoft/treenand2sd/include/MyStrings.h b/build/debugsoft/treenand2sd/include/MyStrings.h new file mode 100644 index 00000000..aa698cea --- /dev/null +++ b/build/debugsoft/treenand2sd/include/MyStrings.h @@ -0,0 +1,84 @@ +/************************************************************************* + +簡単な文字列表示する関数群 + + ************************************************************************/ +#include + +#include "basicdef.h" +#include "text.h" + +/************************************************************************ + 二重定義や宣言/参照を同じヘッダで使用するためのプリプロセッサ + ************************************************************************/ + +/* 多重インクルードの回避 */ +#ifndef MYSTRINGS_H_INCLUDED +#define MYSTRINGS_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************ + +☆使用する構造体 + + ************************************************************************/ + + +/* 画面出力するために使用するコンソール */ +typedef struct { + COORDINATE_TYPE Cursor; /* 現在のカーソル位置 */ + int Palette; /* 現在使用するパレット */ + + int ScrollStart; /* スクロール開始・終了位置 */ + int ScrollEnd; + + TEXT_VRAM_TYPE *Text; /* 書き込み先 */ + +} CONSOLE_TYPE; + + +/************************************************************************ + +☆参照宣言 + ************************************************************************/ + +extern CONSOLE_TYPE StdConsole; +extern CONSOLE_TYPE *Console; + + + +/************************************************************************ +☆パブリックと同等に使用するマクロ + ************************************************************************/ +#define wPuts( str__ ) wcPuts( &StdConsole, str__ ) +#define _Puts( str__ ) _cPuts( &StdConsole, str__ ) +#define wPutchar( character__ ) wcPutchar( &StdConsole, character__ ) +#define wPutcharNC( character__ ) wcPutcharNC( &StdConsole, character__ ) +#define wGotoxy( x__, y__ ) wcGotoxy( &StdConsole, x__, y__ ) +#define wSetPalette( Palette__ ) wcSetPalette( &StdConsole, Palette__ ); + + +/************************************************************************ +☆パブリック関数の宣言 + ************************************************************************/ +extern int wcPuts ( CONSOLE_TYPE *Console, const char *str ); +extern void _cPuts ( CONSOLE_TYPE *Console, const char *str ); +extern void wcGotoxy ( CONSOLE_TYPE *Console, int x, int y ); +extern void wcSetPalette( CONSOLE_TYPE *Console, int Palette ); +extern int wcPutchar ( CONSOLE_TYPE *Console, int Character ); +extern int wcPutcharNC ( CONSOLE_TYPE *Console, int Character ); +extern void wcPrintf ( CONSOLE_TYPE *Console, const char *fmt , ... ); +extern void wPrintf ( const char *fmt , ... ); +extern void swPrintf ( const char *fmt , ... ); +extern int wCountLine ( const char *Str ); + +#ifdef __cplusplus +} +#endif + +/* 多重インクルードの回避 */ +#endif + diff --git a/build/debugsoft/treenand2sd/include/basicdef.h b/build/debugsoft/treenand2sd/include/basicdef.h new file mode 100644 index 00000000..6670ec12 --- /dev/null +++ b/build/debugsoft/treenand2sd/include/basicdef.h @@ -0,0 +1,123 @@ +/************************************************************************** + + 基本定義ヘッダファイル + + 多くのソースファイルで使用する基本的な情報を記述しています。 + + + *************************************************************************/ + + +/* 多重インクルードの回避 */ +#ifndef __BASICDEF_H__ +#define __BASICDEF_H__ + +/************************************************************************** + 標準でインクルードするヘッダファイル + *************************************************************************/ +#include +#include // NULLを使用するため + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************** + #define系プリプロセッサ命令 記述領域 + *************************************************************************/ + +//V周期 +#define VERTICAL_CYCLE 16743 //単位μS + + +//画面関係の定義 +#define SCREEN_WIDTH 32 /* コンソールで使用するテキストRAMの列数 */ +#define SCREEN_HEIGHT 24 /* コンソールで使用するテキストRAMの行数 */ + +#define VIRTUAL_SCREEN_WIDTH 32 /* 仮想画面のサイズ */ +#define VIRTUAL_SCREEN_HEIGHT 32 + +#define CHARACTER_SIDE_LENGTH 8 /* キャラクタの一辺の長さ */ + +#define SCREEN_WIDTH_DOT 256 +#define SCREEN_HEIGHT_DOT 192 + +/************************************************************************** + 汎用マクロ定義 + *************************************************************************/ + +//配列の要素数を求める 'Code Complete 上 第二版 P379 から引用 +#define ARRAY_LENGTH(x) (sizeof(x)/sizeof(x[0])) + +/************************************************************************** + 型定義 + *************************************************************************/ + + +#if 0 +/* ブール型の設定 */ +#undef FALSE +#undef TRUE +typedef enum { FALSE=0, TRUE=1 } BOOL; +#endif + +/* 整数型座標構造体 */ +typedef struct { /* 座標を指定する構造体 */ + int x; /* X座標 */ + int y; /* Y座標 */ +} COORDINATE_TYPE; + +/* 各色の成分 */ +typedef enum { + RAW_COLOR_BLACK = 0x0000, + RAW_COLOR_RED = 0x001f, + RAW_COLOR_GREEN = 0x03e0, + RAW_COLOR_YELLOW = 0x03ff, + RAW_COLOR_BLUE = 0x7c00, + RAW_COLOR_MAGENTA = 0x7c1f, + RAW_COLOR_CYAN = 0x7fe0, + RAW_COLOR_WHITE = 0x7fff, + + RAW_COLOR_GRAY1 = 0x1004, + RAW_COLOR_GRAY2 = 0x2108, + RAW_COLOR_GRAY3 = 0x318c, + RAW_COLOR_GRAY4 = 0x4210, + RAW_COLOR_GRAY5 = 0x5294, + RAW_COLOR_GRAY6 = 0x6318 + +} RAW_COLOR; + +/* パレット設定 */ +typedef enum { + COLOR_TRANSLUCENT = 0, + COLOR_RED = 1, + COLOR_GREEN = 2, + COLOR_YELLOW = 3, + COLOR_BLUE = 4, + COLOR_MAGENTA = 5, + COLOR_CYAN = 6, + COLOR_WHITE = 7, + COLOR_BLACK = 8, + COLOR_GRAY1 = 9, + COLOR_GRAY2 =10, + COLOR_GRAY3 =11, + COLOR_GRAY4 =12, + COLOR_GRAY5 =13, + COLOR_GRAY6 =14 + + +} COLOR_TYPE; + +#define COLOR_GRAY COLOR_GRAY5 + +#ifdef __cplusplus +} +#endif + +/* 多重インクルードの回避 */ +#endif + + + + + diff --git a/build/debugsoft/treenand2sd/include/fontdata.h b/build/debugsoft/treenand2sd/include/fontdata.h new file mode 100644 index 00000000..33fcb71b --- /dev/null +++ b/build/debugsoft/treenand2sd/include/fontdata.h @@ -0,0 +1,27 @@ +/******************************************************************** + + 標準データの定義 + + + ********************************************************************/ +#ifndef _DATA_H +#define _DATA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "basicdef.h" +/************************************************************************ + +☆外部公開変数 + + ***********************************************************************/ +extern const u16 PlttData_Sample[16][16]; +extern const u32 CharData_Sample[8*0x100]; + +#ifdef __cplusplus +} +#endif + +#endif /* _DATA_H */ diff --git a/build/debugsoft/treenand2sd/include/text.h b/build/debugsoft/treenand2sd/include/text.h new file mode 100644 index 00000000..e8fa13b7 --- /dev/null +++ b/build/debugsoft/treenand2sd/include/text.h @@ -0,0 +1,70 @@ +/************************************************************************ + + テキストVRAMエミュレーション + + ************************************************************************/ +#include "basicdef.h" + +/************************************************************************ + 二重定義や宣言/参照を同じヘッダで使用するためのプリプロセッサ + ************************************************************************/ + +/* 多重インクルードの回避 */ +#ifndef TEXT_H_INCLUDED +#define TEXT_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************ +☆パブリック関数の宣言 + ************************************************************************/ +extern void wInitTextVram( void ); +extern void wSuspendTextVram( void ); +extern void wResumeTextVram( void ); + +extern void swSuspendTextVram( void ); +extern void swResumeTextVram( void ); + +extern void wRemoveTextVram( void ); + +/************************************************************************ +☆テキストVRAMで使用する定数値 + ************************************************************************/ + +#define CLEAR_CHARACTER ' ' /* 画面クリア時に使用するキャラクタ */ + +/************************************************************************ +☆テキストVRAMで使用する構造体 + ************************************************************************/ + + +/* + * テキストVRAM本体です。 + * Map :表示文字をアスキーコードで入力します + * + * 現在、他の属性はなし。 + */ + + +typedef struct { /* テキストVRAM操作用*/ + u16 Map[VIRTUAL_SCREEN_HEIGHT][VIRTUAL_SCREEN_WIDTH]; +} TEXT_VRAM_TYPE; + +/************************************************************************ +☆テキストVRAMの参照宣言 + ************************************************************************/ + +/* テキストVRAM本体 */ +extern TEXT_VRAM_TYPE wText; +extern TEXT_VRAM_TYPE swText; + +#ifdef __cplusplus +} +#endif + + + +/* 多重インクルードの回避 */ +#endif diff --git a/build/debugsoft/treenand2sd/src/MyStrings.c b/build/debugsoft/treenand2sd/src/MyStrings.c new file mode 100644 index 00000000..52398988 --- /dev/null +++ b/build/debugsoft/treenand2sd/src/MyStrings.c @@ -0,0 +1,313 @@ +/************************************************************************ + +タイトル: + 文字、文字列表示ルーチン集 + + ************************************************************************/ +#include +#include "basicdef.h" +#include "MyStrings.h" + +/************************************************************************ +☆動作モード + ************************************************************************/ +#define USE_SDK_PRINTF //SDKのPrintf関係を使用するときに定義 + +/************************************************************************ + +☆実体宣言 + ************************************************************************/ + +//標準のコンソール +CONSOLE_TYPE StdConsole = { { 0, 0}, + COLOR_BLACK, + 0, SCREEN_HEIGHT-2, + &wText + }; + +CONSOLE_TYPE *Console = &StdConsole; + +/************************************************************************ +☆プロトタイプ宣言 + ************************************************************************/ +static void ScrollDown( CONSOLE_TYPE *Console ); + +/************************************************************************ +************************************************************************* +************************************************************************* + + + + + +☆文字出力関係のユーティリティ + + + + + +************************************************************************* +************************************************************************* +*************************************************************************/ + +/************************************************************************ + + 一文字表示 + +概要: + 引数の文字コードをテキストVRAM上に表示させる + ( putchar とコンパチかな?) + +引数: + Console 表示コンソール + Character 文字コード + +戻り値: + 文字コード(putcharとなるべく仕様をあわせるため) + + ***********************************************************************/ +extern int wcPutchar( CONSOLE_TYPE *Console, int Character ){ + int i; + u16 *Pointer; + switch( Character ){ + + case '\n': /* 改行コードの処理 */ + Console->Cursor.y++; + Console->Cursor.x = 0; + break; + + case '\t': /* タブコードの処理(4タブ) */ + Console->Cursor.x +=4 - ( (StdConsole.Cursor.x) % 4 ); + break; + + case '\f': /* 改ページコードの処理 */ + Pointer = &(Console->Text->Map[0][0] ); + for( i=0 ; iText->Map[ Console->Cursor.y ][ Console->Cursor.x++ ] + = (u16)( (Console->Palette << 12 ) | Character ); + } + + /* 行あふれの処理 */ + if( Console->Cursor.x > SCREEN_WIDTH-1 ){ + Console->Cursor.x = 0; + Console->Cursor.y++; + } + + /* 列あふれの処理 */ + if( Console->Cursor.y > Console->ScrollEnd ){ + --Console->Cursor.y; + ScrollDown( Console ); + + } + return Character; +} + +/************************************************************************ + + 一文字表示(制御コード処理なし) + +概要: + 引数の文字コードをテキストVRAM上に表示させる + wcPutcharの制御コード判定なしバージョン + +引数: + Console 表示コンソール + Character 文字コード + +戻り値: + 文字コード(putcharとなるべく仕様をあわせるため) + + ***********************************************************************/ +extern int wcPutcharNC( CONSOLE_TYPE *Console, int Character ){ + + /* 文字の表示 */ + Console->Text->Map[ Console->Cursor.y ][ Console->Cursor.x++ ] + = (u16)( (Console->Palette << 12) | Character ); + /* 行あふれの処理 */ + if( Console->Cursor.x > SCREEN_WIDTH-1 ){ + Console->Cursor.x = 0; + Console->Cursor.y++; + } + + /* 列あふれの処理 */ + if( Console->Cursor.y > Console->ScrollEnd ){ + --Console->Cursor.y; + ScrollDown( Console ); + + } + return Character; +} + +/************************************************************************ + + 文字列表示(改行なし版) + +概要: + 引数の文字列を表示させる(最後に改行コードが入らないので注意) + +引数: + Console 表示コンソール + String 表示文字列 + +※ 0x80-0xffの文字コードに対応するため、(u8 *)へのキャストをしています。 + + ***********************************************************************/ +extern void _cPuts( CONSOLE_TYPE *Console, const char *String ){ + int CurrentCharacter; + while( CurrentCharacter = *(u8 *)String++ ) wcPutchar( Console, CurrentCharacter ); +} + +/************************************************************************ + + 文字列表示 + +概要: + 引数の文字列を画面に表示させる(最後に改行コードが入ります) + +引数: + Console 表示コンソール + String 表示文字列 + +戻り値: + 常に0 putsとのコンパチビリティを保つため + + ***********************************************************************/ +extern int wcPuts( CONSOLE_TYPE *Console, const char *String ){ + _cPuts( Console, String ); /* 文字列の表示 */ + _cPuts( Console, "\n" ); /* 改行 */ + return 0; +} + +/************************************************************************ + + テキスト画面を下にスクロールさせる + +引数: + Console 該当コンソール + + ***********************************************************************/ +static void ScrollDown( CONSOLE_TYPE *Console ){ + int i; + + for( i=Console->ScrollStart+1 ; i<=Console->ScrollEnd ; i++ ){ + /* 一列上にコピーする */ + memcpy( Console->Text->Map[i-1], Console->Text->Map[i], SCREEN_WIDTH* sizeof(u16) ); + } + + /* 最終行のクリア */ + for( i=0 ; iText->Map[ Console->ScrollEnd ][i] = CLEAR_CHARACTER; + } + +} + +/************************************************************************ + + カーソル位置の設定 + +引数: + Console 該当コンソール + x X座標 + y Y座標 + + ************************************************************************/ +extern void wcGotoxy( CONSOLE_TYPE *Console, int x, int y ){ + /* とりあえず座標のコピー */ + Console->Cursor.x = x; + Console->Cursor.y = y; + + /* 範囲制限をするこれをしないとオーバーランを起こす */ + if( Console->Cursor.x < 0 ) Console->Cursor.x = 0; + if( Console->Cursor.x > SCREEN_WIDTH-1 ) Console->Cursor.x = SCREEN_WIDTH-1; + if( Console->Cursor.y < 0 ) Console->Cursor.y = 0; + if( Console->Cursor.y > SCREEN_HEIGHT-1 ) Console->Cursor.y = SCREEN_HEIGHT-1; + +} +/************************************************************************ + + パレットの設定 + +引数: + Console 該当コンソール + Palette 設定パレット + + ************************************************************************/ +extern void wcSetPalette( CONSOLE_TYPE *Console, int Palette ){ + + Console->Palette = Palette; + +} + +/************************************************************************ + +☆Printf + +※NitroSDKのOS_Printfを参考にしています。 + + + Printfもどき + +※標準のコンソールに表示されます。 + +引数: + fmt: フォーマット付き文字列 + ...: パラメータ + + + ************************************************************************/ +extern void wPrintf( const char *fmt , ... ){ + + char common_buffer[0x100]; + + va_list vlist; + + //引数取得 + va_start( vlist, fmt ); + + //vprintf相当部分 +#ifdef USE_SDK_PRINTF + OS_VSNPrintf( common_buffer, sizeof(common_buffer), fmt, vlist ); +#else + vsnprintf( common_buffer, sizeof(common_buffer), fmt, vlist ); +#endif + _Puts( common_buffer ); + + //引数後処理 + va_end( vlist ); + +} + + +/************************************************************************ + + 文字列の行数のカウントする + +引数: + Str 文字列 + +戻り値: + 行数 + ************************************************************************/ +extern int wCountLine( const char *Str ){ + + int Line; + + if( *Str=='\0' ) return 0; //空文字列の判定 + + Line=1; + while( *Str!='\0' ){ + if( *Str=='\n' ) Line++; + Str++; + } + + return Line; +} + + + diff --git a/build/debugsoft/treenand2sd/src/fontdata.c b/build/debugsoft/treenand2sd/src/fontdata.c new file mode 100644 index 00000000..ce0da841 --- /dev/null +++ b/build/debugsoft/treenand2sd/src/fontdata.c @@ -0,0 +1,594 @@ +/******************************************************************** + +タイトル: + 標準データの定義 + + + ********************************************************************/ +#include "basicdef.h" +#include "fontdata.h" + +/************************************************************************ + +☆プライベート宣言 + + ***********************************************************************/ + +/************************************************************************ + +☆データ定義 + + ***********************************************************************/ + +/************************************************************************ + + パレットデータ + +概要: + + 0は背景用パレットデータ + 1〜8はテキストVRAM用パレットデータ + 15はキャンパス用パレットデータ + 14はBG用パレットデータ + + ***********************************************************************/ +const u16 PlttData_Sample[16][16] = { + + { RAW_COLOR_WHITE, RAW_COLOR_BLACK }, // 背景用パレット + { RAW_COLOR_WHITE, RAW_COLOR_RED, }, // Palette 1 + { RAW_COLOR_WHITE, RAW_COLOR_GREEN }, // Palette 2 + { RAW_COLOR_WHITE, RAW_COLOR_YELLOW }, // Palette 3 + { RAW_COLOR_WHITE, RAW_COLOR_BLUE }, // Palette 4 + { RAW_COLOR_WHITE, RAW_COLOR_MAGENTA }, // Palette 5 + { RAW_COLOR_WHITE, RAW_COLOR_CYAN }, // Palette 6 + { RAW_COLOR_WHITE, RAW_COLOR_WHITE }, // Palette 7 + { RAW_COLOR_WHITE, RAW_COLOR_BLACK }, // Palette 8 + + { RAW_COLOR_WHITE}, // Palette 9 + { RAW_COLOR_WHITE}, // Palette 10 + { RAW_COLOR_WHITE}, // Palette 11 + { RAW_COLOR_WHITE}, // Palette 12 + { RAW_COLOR_WHITE}, // Palette 13 + { RAW_COLOR_WHITE}, // Palette 14 壁紙用 + + { RAW_COLOR_WHITE, RAW_COLOR_RED, // Palette 15 + RAW_COLOR_GREEN, RAW_COLOR_YELLOW, + RAW_COLOR_BLUE, RAW_COLOR_MAGENTA, + RAW_COLOR_CYAN, RAW_COLOR_WHITE, + RAW_COLOR_BLACK, RAW_COLOR_GRAY1, + RAW_COLOR_GRAY2, RAW_COLOR_GRAY3, + RAW_COLOR_GRAY4, RAW_COLOR_GRAY5, + RAW_COLOR_GRAY6, RAW_COLOR_WHITE, + }, // キャンパス用パレット +}; + + + +/************************************************************************ + + キャラクタデータ + + ***********************************************************************/ +const u32 CharData_Sample[8*0x100] = { + 0x00000000,0x00000000,0x00000000,0x00000000, //0000 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x11111111,0x11111111,0x11111111,0x11111111, //0001 + 0x11111111,0x11111111,0x11111111,0x11111111, + 0x00000000,0x00000000,0x00000000,0x00000000, //0002 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0003 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0004 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0005 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0006 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0007 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0008 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0009 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //000A + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //000B + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //000C + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //000D + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //000E + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //000F + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0010 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0011 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0012 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0013 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0014 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0015 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0016 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0017 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0018 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0019 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //001A + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //001B + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //001C + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //001D + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //001E + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //001F + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0020 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00011000,0x00011000,0x00011000,0x00011000, //0021 ! + 0x00000000,0x00011000,0x00011000,0x00000000, + 0x00011011,0x00011011,0x00010010,0x00000000, //0022 " + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00010100,0x00111110,0x00010100, //0023 # + 0x00010100,0x00111110,0x00010100,0x00000000, + 0x00001000,0x00111110,0x00001011,0x00111110, //0024 $ + 0x01101000,0x00111110,0x00001000,0x00000000, + 0x01100111,0x00110101,0x00011111,0x00001100, //0025 % + 0x01110110,0x01010011,0x01110001,0x00000000, + 0x00011100,0x00110110,0x00011100,0x00001110, //0026 & + 0x00011011,0x01110011,0x00111110,0x00000000, + 0x00000011,0x00000011,0x00000010,0x00000000, //0027 ' + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00011100,0x00000110,0x00000011,0x00000011, //0028 ( + 0x00000011,0x00000110,0x00011100,0x00000000, + 0x00011100,0x00110000,0x01100000,0x01100000, //0029 ) + 0x01100000,0x00110000,0x00011100,0x00000000, + 0x00000000,0x00000000,0x00001000,0x00101010, //002A * + 0x00011100,0x00101010,0x00001000,0x00000000, + 0x00000000,0x00000000,0x00001000,0x00001000, //002B + + 0x00111110,0x00001000,0x00001000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //002C , + 0x00000000,0x00000011,0x00000011,0x00000010, + 0x00000000,0x00000000,0x00000000,0x00000000, //002D - + 0x00111110,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //002E . + 0x00000000,0x00000011,0x00000011,0x00000000, + 0x01100000,0x00110000,0x00011000,0x00001100, //002F / + 0x00000110,0x00000011,0x00000001,0x00000000, + 0x00011100,0x00110010,0x01100011,0x01100011, //0030 0 + 0x01100011,0x00100110,0x00011100,0x00000000, + 0x00011000,0x00011100,0x00011110,0x00011000, //0031 1 + 0x00011000,0x00011000,0x00011000,0x00000000, + 0x00111110,0x01100011,0x01100011,0x00111000, //0032 2 + 0x00001110,0x00000011,0x01111111,0x00000000, + 0x01111110,0x00110000,0x00011000,0x00111100, //0033 3 + 0x01100000,0x01100011,0x00111110,0x00000000, + 0x00110000,0x00111000,0x00111100,0x00110110, //0034 4 + 0x00110011,0x01111111,0x00110000,0x00000000, + 0x00111111,0x00000011,0x00000011,0x00111111, //0035 5 + 0x01100000,0x01100011,0x00111110,0x00000000, + 0x00111100,0x00000110,0x00000011,0x00111111, //0036 6 + 0x01100011,0x01100011,0x00111110,0x00000000, + 0x01111111,0x01110000,0x00111000,0x00011100, //0037 7 + 0x00001100,0x00001100,0x00001100,0x00000000, + 0x00111110,0x01100011,0x01100011,0x00111110, //0038 8 + 0x01100011,0x01100011,0x00111110,0x00000000, + 0x00111110,0x01100011,0x01100011,0x01111110, //0039 9 + 0x01100000,0x00110000,0x00011110,0x00000000, + 0x00000000,0x00011000,0x00011000,0x00000000, //003A : + 0x00000000,0x00011000,0x00011000,0x00000000, + 0x00000000,0x00011000,0x00011000,0x00000000, //003B ; + 0x00000000,0x00011000,0x00011000,0x00010000, + 0x01100000,0x00111000,0x00001110,0x00000011, //003C < + 0x00001110,0x00111000,0x01100000,0x00000000, + 0x00000000,0x00000000,0x00111110,0x00000000, //003D = + 0x00000000,0x00111110,0x00000000,0x00000000, + 0x00000011,0x00001110,0x00111000,0x01100000, //003E > + 0x00111000,0x00001110,0x00000011,0x00000000, + 0x01111110,0x11000011,0x11000011,0x01111000, //003F ? + 0x00011000,0x00000000,0x00011000,0x00000000, + 0x00111110,0x01100011,0x01011001,0x01010101, //0040 @ + 0x01011101,0x01110011,0x00011110,0x00000000, + 0x00111110,0x01100011,0x01100011,0x01111111, //0041 A + 0x01100011,0x01100011,0x01100011,0x00000000, + 0x00111111,0x01100011,0x01100011,0x00111111, //0042 B + 0x01100011,0x01100011,0x00111111,0x00000000, + 0x00111110,0x01100011,0x01100011,0x00000011, //0043 C + 0x01100011,0x01100011,0x00111110,0x00000000, + 0x00111111,0x01100011,0x01100011,0x01100011, //0044 D + 0x01100011,0x01100011,0x00111111,0x00000000, + 0x01111111,0x00000011,0x00000011,0x00111111, //0045 E + 0x00000011,0x00000011,0x01111111,0x00000000, + 0x01111111,0x00000011,0x00000011,0x00111111, //0046 F + 0x00000011,0x00000011,0x00000011,0x00000000, + 0x00111110,0x01100011,0x00000011,0x01111011, //0047 G + 0x01100011,0x01100011,0x00111110,0x00000000, + 0x01100011,0x01100011,0x01100011,0x01111111, //0048 H + 0x01100011,0x01100011,0x01100011,0x00000000, + 0x00011000,0x00011000,0x00011000,0x00011000, //0049 I + 0x00011000,0x00011000,0x00011000,0x00000000, + 0x01100000,0x01100000,0x01100000,0x01100000, //004A J + 0x01100000,0x01100011,0x00111110,0x00000000, + 0x01100011,0x01110011,0x00111011,0x00011111, //004B K + 0x00111011,0x01110011,0x01100011,0x00000000, + 0x00000011,0x00000011,0x00000011,0x00000011, //004C L + 0x00000011,0x00000011,0x01111111,0x00000000, + 0x01100011,0x01100011,0x01110111,0x01110111, //004D M + 0x01111111,0x01101011,0x01101011,0x00000000, + 0x01100011,0x01100111,0x01101111,0x01111111, //004E N + 0x01111011,0x01110011,0x01100011,0x00000000, + 0x00111110,0x01100011,0x01100011,0x01100011, //004F O + 0x01100011,0x01100011,0x00111110,0x00000000, + 0x00111111,0x01100011,0x01100011,0x00111111, //0050 P + 0x00000011,0x00000011,0x00000011,0x00000000, + 0x00111110,0x01100011,0x01100011,0x01100011, //0051 Q + 0x01100011,0x00111110,0x01110000,0x00000000, + 0x00111111,0x01100011,0x01100011,0x00111111, //0052 R + 0x01100011,0x01100011,0x01100011,0x00000000, + 0x00111110,0x01100011,0x00000011,0x00111110, //0053 S + 0x01100000,0x01100011,0x00111110,0x00000000, + 0x11111111,0x00011000,0x00011000,0x00011000, //0054 T + 0x00011000,0x00011000,0x00011000,0x00000000, + 0x01100011,0x01100011,0x01100011,0x01100011, //0055 U + 0x01100011,0x01100011,0x00111110,0x00000000, + 0x01100011,0x01100011,0x00110110,0x00110110, //0056 V + 0x00011100,0x00011100,0x00001000,0x00000000, + 0x11011011,0x11011011,0x11011011,0x11011011, //0057 W + 0x11011011,0x01111110,0x01100110,0x00000000, + 0x01000001,0x01100011,0x00110110,0x00011100, //0058 X + 0x00011100,0x00110110,0x01100011,0x00000000, + 0x11000011,0x11000011,0x11100111,0x01111110, //0059 Y + 0x00011000,0x00011000,0x00011000,0x00000000, + 0x01111111,0x00110000,0x00011000,0x00001100, //005A Z + 0x00000110,0x00000011,0x01111111,0x00000000, + 0x00001111,0x00000011,0x00000011,0x00000011, //005B [ + 0x00000011,0x00000011,0x00001111,0x00000000, + 0x01100110,0x01100110,0x11111111,0x00011000, //005C \' + 0x11111111,0x00011000,0x00011000,0x00000000, + 0x01111000,0x01100000,0x01100000,0x01100000, //005D ] + 0x01100000,0x01100000,0x01111000,0x00000000, + 0x00011100,0x00110110,0x00100010,0x00000000, //005E ^ + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //005F _ + 0x00000000,0x00000000,0x01111111,0x00000000, + + 0x00000000,0x00000000,0x00000000,0x00000000, //0060 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x01111000,0x01100100, //0061 a + 0x01100110,0x01110110,0x01101110,0x00000000, + 0x00000110,0x00000110,0x00111110,0x01100110, //0062 b + 0x01100110,0x01100110,0x00111110,0x00000000, + 0x00000000,0x00000000,0x00111100,0x01100110, //0063 c + 0x00000110,0x01100110,0x00111100,0x00000000, + 0x01100000,0x01100000,0x01111100,0x01100110, //0064 d + 0x01100110,0x01100110,0x01111100,0x00000000, + 0x00000000,0x00000000,0x00111100,0x01100110, //0065 e + 0x01111110,0x00000110,0x00111100,0x00000000, + 0x01110000,0x00011000,0x01111110,0x00011000, //0066 f + 0x00011000,0x00011000,0x00011000,0x00000000, + 0x00000000,0x00000000,0x00111100,0x01100110, //0067 g + 0x01100110,0x01111100,0x01100000,0x00111110, + 0x00000110,0x00000110,0x00000110,0x00111110, //0068 h + 0x01100110,0x01100110,0x01100110,0x00000000, + 0x00011000,0x00011000,0x00000000,0x00011000, //0069 i + 0x00011000,0x00011000,0x00011000,0x00000000, + 0x00110000,0x00110000,0x00000000,0x00110000, //006A j + 0x00110000,0x00110000,0x00110011,0x00011110, + 0x00000011,0x01100011,0x00110011,0x00011111, //006B k + 0x00011111,0x00110011,0x01100011,0x00000000, + 0x00011000,0x00011000,0x00011000,0x00011000, //006C l + 0x00011000,0x00011000,0x00011000,0x00000000, + 0x00000000,0x00000000,0x01111111,0x11011011, //006D m + 0x11011011,0x11011011,0x11011011,0x00000000, + 0x00000000,0x00000000,0x00111110,0x01100110, //006E n + 0x01100110,0x01100110,0x01100110,0x00000000, + 0x00000000,0x00000000,0x00111100,0x01100110, //006F o + 0x01100110,0x01100110,0x00111100,0x00000000, + 0x00000000,0x00000000,0x00111110,0x01100110, //0070 p + 0x01100110,0x00111110,0x00000110,0x00000110, + 0x00000000,0x00000000,0x01111100,0x01100110, //0071 q + 0x01100110,0x01111100,0x01100000,0x01100000, + 0x00000000,0x00000000,0x00101100,0x00011100, //0072 r + 0x00001100,0x00001100,0x00001100,0x00000000, + 0x00000000,0x00000000,0x00111100,0x00000110, //0073 s + 0x00111100,0x01100000,0x00111100,0x00000000, + 0x00000000,0x00011000,0x00111100,0x00011000, //0074 t + 0x00011000,0x00011000,0x00110000,0x00000000, + 0x00000000,0x00000000,0x01100110,0x01100110, //0075 u + 0x01100110,0x01100110,0x01111100,0x00000000, + 0x00000000,0x00000000,0x01100110,0x01100110, //0076 v + 0x01100110,0x00111100,0x00011000,0x00000000, + 0x00000000,0x00000000,0x11011011,0x11011011, //0077 w + 0x11011011,0x11011011,0x01111110,0x00000000, + 0x00000000,0x00000000,0x01100110,0x00111100, //0078 x + 0x00011000,0x00111100,0x01100110,0x00000000, + 0x00000000,0x00000000,0x01100110,0x01100110, //0079 y + 0x01100110,0x01111100,0x01100000,0x00111110, + 0x00000000,0x00000000,0x01111110,0x00110000, //007A z + 0x00011000,0x00001100,0x01111110,0x00000000, + 0x00011100,0x00000110,0x00000110,0x00000111, //007B { + 0x00000110,0x00000110,0x00011100,0x00000000, + 0x00001000,0x00001000,0x00001000,0x00001000, //007C | + 0x00001000,0x00001000,0x00001000,0x00000000, + 0x00011100,0x00110000,0x00110000,0x01110000, //007D } + 0x00110000,0x00110000,0x00011100,0x00000000, + 0x01101100,0x00111110,0x00011011,0x00000000, //007E ~ + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //007F + 0x00000000,0x00000000,0x00000000,0x00000000, + + 0x00000000,0x00000000,0x00000000,0x00000000, //0080 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0081 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0082 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0083 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0084 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0085 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0086 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0087 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0088 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0089 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //008A + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //008B + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //008C + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //008D + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //008E + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //008F + 0x00000000,0x00000000,0x00000000,0x00000000, + + 0x00000000,0x00000000,0x00000000,0x00000000, //0090 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0091 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0092 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0093 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0094 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0095 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0096 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0097 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0098 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //0099 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //009A + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //009B + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //009C + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //009D + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //009E + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //009F + 0x00000000,0x00000000,0x00000000,0x00000000, + + 0x00000000,0x00000000,0x00000000,0x00000000, //00A0 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00A1 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00A2 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00A3 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00A4 + 0x00000000,0x00000000,0x00000000,0x00000000, + + 0x00000000,0x00000000,0x00000000,0x00001100, //00A5 ・ + 0x00001100,0x00000000,0x00000000,0x00000000, + 0x01111110,0x01000000,0x01111110,0x01000000, //00A6 ヲ + 0x01100000,0x00110000,0x00011100,0x00000000, + 0x00000000,0x00000000,0x00111110,0x00101000, //00A7 ァ + 0x00011000,0x00001000,0x00000100,0x00000000, + 0x00000000,0x00000000,0x00100000,0x00011000, //00A8 ィ + 0x00001110,0x00001000,0x00001000,0x00000000, + 0x00000000,0x00000000,0x00001000,0x00111110, //00A9 ゥ + 0x00100010,0x00110000,0x00011100,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00011100, //00AA ェ + 0x00001000,0x00001000,0x00111110,0x00000000, + 0x00000000,0x00000000,0x00010000,0x00111110, //00AB ォ + 0x00011000,0x00010100,0x00010010,0x00000000, + 0x00000000,0x00000000,0x00000100,0x00111110, //00AC ャ + 0x00100100,0x00010100,0x00000100,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00011100, //00AD ュ + 0x00010000,0x00010000,0x01111110,0x00000000, + 0x00000000,0x00000000,0x00111100,0x00100000, //00AE ョ + 0x00111100,0x00100000,0x00111100,0x00000000, + 0x00000000,0x00000000,0x00001010,0x00101010, //00AF ッ + 0x00100000,0x00110000,0x00011100,0x00000000, + 0x00000000,0x00000000,0x00000000,0x01111110, //00B0 ー + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x01111111,0x01000000,0x01100100,0x00111100, //00B1 ア + 0x00000100,0x00000110,0x00000011,0x00000000, + 0x01100000,0x00110000,0x00011100,0x00010111, //00B2 イ + 0x00010000,0x00010000,0x00010000,0x00000000, + 0x00001000,0x01111111,0x01000001,0x01000001, //00B3 ウ + 0x01100000,0x00110000,0x00011110,0x00000000, + 0x00000000,0x00111110,0x00001000,0x00001000, //00B4 エ + 0x00001000,0x00001000,0x01111111,0x00000000, + 0x00100000,0x01111111,0x00101000,0x00101100, //00B5 オ + 0x00100110,0x00100011,0x00110000,0x00000000, + 0x00000100,0x01111111,0x01000100,0x01000100, //00B6 カ + 0x01000100,0x01100110,0x00110011,0x00000000, + 0x00000100,0x01111111,0x00001000,0x00001000, //00B7 キ + 0x01111111,0x00010000,0x00010000,0x00000000, + 0x01111110,0x01000010,0x01000011,0x01000000, //00B8 ク + 0x01100000,0x00110000,0x00011110,0x00000000, + 0x00000010,0x01111110,0x00010010,0x00010001, //00B9 ケ + 0x00010000,0x00011000,0x00001110,0x00000000, + 0x01111111,0x01000000,0x01000000,0x01000000, //00BA コ + 0x01000000,0x01000000,0x01111111,0x00000000, + 0x00100010,0x01111111,0x00100010,0x00100010, //00BB サ + 0x00100000,0x00110000,0x00011110,0x00000000, + 0x00000011,0x01000000,0x01000011,0x01000000, //00BC シ + 0x01000000,0x01100000,0x00111111,0x00000000, + 0x00111111,0x00100000,0x00100000,0x00010000, //00BD ス + 0x00001000,0x00010100,0x01100011,0x00000000, + 0x00000010,0x01111111,0x01000010,0x01100010, //00BE セ + 0x00100010,0x00000110,0x01111100,0x00000000, + 0x01000001,0x01000011,0x01000010,0x01100000, //00BF ソ + 0x00110000,0x00011000,0x00001100,0x00000000, + 0x01111110,0x01000010,0x01000011,0x01111000, //00C0 タ + 0x01000000,0x01100000,0x00111110,0x00000000, + 0x00110000,0x00011110,0x00010000,0x01111111, //00C1 チ + 0x00010000,0x00011000,0x00001110,0x00000000, + 0x01000101,0x01000101,0x01000101,0x01000000, //00C2 ツ + 0x01100000,0x00110000,0x00011110,0x00000000, + 0x00111110,0x00000000,0x01111111,0x00001000, //00C3 テ + 0x00001000,0x00001100,0x00000110,0x00000000, + 0x00000010,0x00000010,0x00000010,0x00011110, //00C4 ト + 0x00100010,0x00000010,0x00000010,0x00000000, + 0x00001000,0x00001000,0x01111111,0x00001000, //00C5 ナ + 0x00001000,0x00001100,0x00000111,0x00000000, + 0x00111110,0x00000000,0x00000000,0x00000000, //00C6 ニ + 0x00000000,0x00000000,0x01111111,0x00000000, + 0x00111111,0x00100000,0x00110000,0x00011010, //00C7 ヌ + 0x00001100,0x00010110,0x00100011,0x00000000, + 0x00001000,0x01111111,0x01100000,0x00110000, //00C8 ネ + 0x00011100,0x01101010,0x01001001,0x00000000, + 0x00100000,0x00100000,0x00100000,0x00100000, //00C9 ノ + 0x00110000,0x00011000,0x00001110,0x00000000, + 0x00011000,0x00110000,0x01100001,0x01000001, //00CA ハ + 0x01000001,0x01000001,0x01000001,0x00000000, + 0x00000001,0x00000001,0x00111111,0x00000001, //00CB ヒ + 0x00000001,0x00000011,0x00111110,0x00000000, + 0x01111111,0x01000000,0x01000000,0x01000000, //00CC フ + 0x01100000,0x00110000,0x00011110,0x00000000, + 0x00000000,0x00000000,0x00001110,0x00011001, //00CD ヘ + 0x00110001,0x01100000,0x01000000,0x00000000, + 0x00001000,0x01111111,0x00001000,0x00001000, //00CE ホ + 0x01001001,0x01001001,0x01001001,0x00000000, + 0x01111111,0x01000000,0x01000000,0x01100011, //00CF マ + 0x00111110,0x00001100,0x00011000,0x00000000, + 0x00011111,0x01110000,0x00000110,0x00011100, //00D0 ミ + 0x00110000,0x00000111,0x01111100,0x00000000, + 0x00001100,0x00000110,0x00000010,0x01000011, //00D1 ム + 0x01000001,0x01000001,0x01111111,0x00000000, + 0x01000000,0x01100010,0x00110100,0x00011000, //00D2 メ + 0x00001100,0x00010110,0x00100011,0x00000000, + 0x01111111,0x00000100,0x01111111,0x00000100, //00D3 モ + 0x00000100,0x00001100,0x01111000,0x00000000, + 0x00000100,0x01111111,0x01000100,0x01100100, //00D4 ヤ + 0x00110100,0x00000100,0x00000100,0x00000000, + 0x00011110,0x00010000,0x00010000,0x00010000, //00D5 ユ + 0x00010000,0x00010000,0x01111111,0x00000000, + 0x01111110,0x01000000,0x01000000,0x01111110, //00D6 ヨ + 0x01000000,0x01000000,0x01111110,0x00000000, + 0x01111111,0x00000000,0x01111111,0x01000000, //00D7 ラ + 0x01000000,0x01100000,0x00111110,0x00000000, + 0x01000010,0x01000010,0x01000010,0x01000010, //00D8 リ + 0x01000000,0x01100000,0x00111100,0x00000000, + 0x00001010,0x00001010,0x00001010,0x00001010, //00D9 ル + 0x01001010,0x01101010,0x00111011,0x00000000, + 0x00000001,0x00000001,0x01000001,0x01100001, //00DA レ + 0x00110001,0x00011001,0x00001111,0x00000000, + 0x01111111,0x01000001,0x01000001,0x01000001, //00DB ロ + 0x01000001,0x01000001,0x01111111,0x00000000, + 0x01111111,0x01000001,0x01000001,0x01000000, //00DC ワ + 0x01100000,0x00110000,0x00011110,0x00000000, + 0x00000111,0x01000000,0x01000000,0x01000000, //00DD ン + 0x01100000,0x00110000,0x00011111,0x00000000, + 0x00001001,0x00010010,0x00000000,0x00000000, //00DE ゙ + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00001110,0x00001010,0x00001110,0x00000000, //00DF ゚ + 0x00000000,0x00000000,0x00000000,0x00000000, + + 0x00000000,0x00000000,0x00000000,0x11100000, //00E0 メニューの左上 + 0x11110000,0x00111000,0x00011000,0x00011000, + 0x00000000,0x00000000,0x00000000,0x00000111, //00E1 メニューの右上 + 0x00001111,0x00011100,0x00011000,0x00011000, + 0x00011000,0x00011000,0x00111000,0x11110000, //00E2 メニューの左下 + 0x11100000,0x00000000,0x00000000,0x00000000, + 0x00011000,0x00011000,0x00011100,0x00001111, //00E3 メニューの右下 + 0x00000111,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x11111111, //00E4 メニューの縦線 + 0x11111111,0x00000000,0x00000000,0x00000000, + 0x00011000,0x00011000,0x00011000,0x00011000, //00E5 メニューの横線 + 0x00011000,0x00011000,0x00011000,0x00011000, + 0x11111111,0x11111111,0x11111111,0x11111111, //00E6 ■ + 0x11111111,0x11111111,0x11111111,0x11111111, + 0x10101010,0x10101010,0x10101010,0x10101010, //00E7 縦ストライプ + 0x10101010,0x10101010,0x10101010,0x10101010, + 0x11111111,0x00000000,0x11111111,0x00000000, //00E8 横ストライプ + 0x11111111,0x00000000,0x11111111,0x00000000, + 0x00000000,0x11111110,0x11111110,0x11111110, //00E9 LCD検査のΓ + 0x11111110,0x11111110,0x11111110,0x11111110, + 0x11111000,0x11111111,0x11111111,0x11111111, //00EA LCD検査の ̄ + 0x11111111,0x11111111,0x11111111,0x11111111, + 0x11111110,0x11111110,0x11111110,0x11111111, //00EB LCD検査のΙ + 0x11111111,0x11111111,0x11111111,0x11111111, + + 0x00000000,0x00000000,0x00000000,0x00000000, //00EC TPマーカの左上 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000001,0x00000001,0x00000001, //00ED TPマーカの右上 + 0x00000001,0x00000001,0x00000000,0x00000000, + 0x00111111,0x00000000,0x00000000,0x00000000, //00EE TPマーカの左下 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x11111001,0x00000000,0x00000000,0x00000001, //00EF TPマーカの右下 + 0x00000001,0x00000001,0x00000001,0x00000001, + 0x00000000,0x00000000,0x00000000,0x00000000, //00F0 TP精度マーカの左上 + 0x11110000,0x11110000,0x00110000,0x00110000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00F1 TP精度マーカの右上 + 0x00011111,0x00011111,0x00011000,0x00011001, + 0x10110000,0x00110000,0x00110000,0x11110000, //00F2 TP精度マーカの左下 + 0x11110000,0x00000000,0x00000000,0x00000000, + 0x00011011,0x00011001,0x00011000,0x00011111, //00F3 TP精度マーカの右下 + 0x00011111,0x00000000,0x00000000,0x00000000, + 0x00000000,0x11111110,0x10000010,0x10000010, //00F4 □ + 0x10000010,0x10000010,0x10000010,0x11111110, + 0x00000000,0x11111110,0x11111110,0x11111110, //00F5 ■ + 0x11111110,0x11111110,0x11111110,0x11111110, + 0x00000000,0x00000000,0x00000000,0x00000000, //00F6 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00F7 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00F8 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00F9 + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00FA + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00FB + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00FC + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00FD + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00FE + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, //00FF + 0x00000000,0x00000000,0x00000000,0x00000000, +}; + + diff --git a/build/debugsoft/treenand2sd/src/main.cpp b/build/debugsoft/treenand2sd/src/main.cpp new file mode 100644 index 00000000..6f4ad204 --- /dev/null +++ b/build/debugsoft/treenand2sd/src/main.cpp @@ -0,0 +1,365 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tools - treenand + File: main.c + + Copyright 2007 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 +#include +#include +#include +#include +#include +#include + +#include +#include "text.h" +#include "MyStrings.h" + +inline void* operator new(size_t size) { return OS_Alloc(size); } +inline void* operator new[](size_t size) { return OS_Alloc(size); } +inline void operator delete(void* ptr) { OS_Free(ptr); } +inline void operator delete[](void* ptr) { OS_Free(ptr); } + +namespace +{ + void + InitInterrupt(void) + { + OS_EnableIrq(); + OS_EnableInterrupts(); + } + + 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); + } + + void + MyInit(void) + { + OS_Init(); + FX_Init(); + + GX_Init(); + + (void)OS_EnableIrqMask( OS_IE_V_BLANK ); + (void)OS_EnableIrq(); + + FS_Init(MI_DMA_MAX_NUM); + + GX_DispOff(); + GXS_DispOff(); + + (void)GX_VBlankIntr(TRUE); // to generate VBlank interrupt request + //--------------------------------------------------------------------------- + // All VRAM banks to LCDC + //--------------------------------------------------------------------------- + GX_SetBankForLCDC(GX_VRAM_LCDC_ALL); + + //--------------------------------------------------------------------------- + // Clear all LCDC space + //--------------------------------------------------------------------------- + MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE); + + //--------------------------------------------------------------------------- + // Disable the banks on LCDC + //--------------------------------------------------------------------------- + (void)GX_DisableBankForLCDC(); + + MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE); // clear OAM + MI_CpuClearFast((void *)HW_PLTT, HW_PLTT_SIZE); // clear the standard palette + + MI_CpuFillFast((void*)HW_DB_OAM, 192, HW_DB_OAM_SIZE); // clear OAM + MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE); // clear the standard palette + + GX_DispOn(); + GXS_DispOn(); + + *(vu16 *) REG_IME_ADDR = 1; // IME セット + + wInitTextVram(); + + //SDの存在チェック + { + FSPathInfo info; + + if(FS_GetPathInfo( "sdmc:/", &info ) ) + { + if( (info.attributes&FS_ATTRIBUTE_IS_PROTECTED)==FS_ATTRIBUTE_IS_PROTECTED ) + { + wSetPalette(COLOR_RED); + wPrintf("\n\n SD CARD IS PROTECTED!!"); + OS_Terminate(); + } + else + { + return; + } + } + else + { + wSetPalette(COLOR_RED); + wPrintf("\n\n SD CARD NOTHING!!"); + OS_Terminate(); + } + } + + } +} + +namespace +{ + class DirEntry; + typedef std::vector EntryList; + class DirEntry + { + private: + FSDirectoryEntryInfo m_dei; + std::string m_path; + EntryList* m_pEntryList; + + public: + DirEntry(std::string parent, const FSDirectoryEntryInfo& dei) + : m_path(parent + "/" + dei.longname) + , m_dei(dei) + , m_pEntryList(NULL) + {} + ~DirEntry(){ delete m_pEntryList; } + bool operator <(const DirEntry& rhs) const + { + return this->m_path < rhs.m_path; + } + + std::string GetPath() const { return m_path; } + std::string GetName() const { return m_dei.longname; } + std::string GetShortName() const { return m_dei.shortname; } + u32 GetSize() const { return m_dei.filesize; } + + bool IsDirectory() const { return (m_dei.attributes & FS_ATTRIBUTE_IS_DIRECTORY) != 0; } + bool IsReadOnly() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_READONLY) != 0; } + bool IsHidden() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_HIDDEN) != 0; } + bool IsSystem() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_SYSTEM) != 0; } + bool IsVolume() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_VOLUME) != 0; } + bool IsArchive() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_ARCHIVE) != 0; } + + void SetEntryList(EntryList* pEntryList) + { + delete m_pEntryList; + m_pEntryList = pEntryList; + } + const EntryList& GetEntryList() const + { + return *m_pEntryList; + } + std::string GetDateTimeString() const + { + std::ostringstream oss; + + oss << std::setw(4) << std::setfill('0') << m_dei.mtime.year << "/"; + oss << std::setw(2) << std::setfill('0') << m_dei.mtime.month << "/"; + oss << std::setw(2) << std::setfill('0') << m_dei.mtime.day << " "; + oss << std::setw(2) << std::setfill('0') << m_dei.mtime.hour << ":"; + oss << std::setw(2) << std::setfill('0') << m_dei.mtime.minute << ":"; + oss << std::setw(2) << std::setfill('0') << m_dei.mtime.second; + + return oss.str(); + } + }; + + typedef std::vector EntryList; + + void + GetDirEntry(EntryList* pList, std::string path) + { + BOOL bSuccess; + FSFile dir; + FSDirectoryEntryInfo dei; + + pList->clear(); + + FS_InitFile(&dir); + bSuccess = FS_OpenDirectory(&dir, path.c_str(), FS_FILEMODE_R); + if( bSuccess ) + { + while( FS_ReadDirectory(&dir, &dei) ) + { + std::string name = dei.longname; + + if( (name == ".") || (name == "..") ) + { + continue; + } + + pList->push_back( DirEntry(path, dei) ); + } + + FS_CloseDirectory(&dir); + } + + std::sort(pList->begin(), pList->end()); + } + + void + GetDirEntryRecursive(EntryList* pList, std::string path) + { + EntryList::iterator i; + + GetDirEntry(pList, path); + + for( i = pList->begin(); i != pList->end(); ++i ) + { + if( i->IsDirectory() ) + { + EntryList* pSubEntryList = new EntryList; + GetDirEntryRecursive(pSubEntryList, i->GetPath()); + i->SetEntryList(pSubEntryList); + } + } + } + + void + DrawEntries(std::string prevPart, std::string prevPart2, const EntryList& elist) + { + EntryList::const_iterator i; + + for( i = elist.begin(); i != elist.end(); ++i ) + { + std::ostringstream oss, oss2; + const bool isLast = (i + 1 == elist.end()); + + oss << prevPart; + oss2<< prevPart2; + oss << (isLast ? "└": "├" ); + oss2<< "+"; + oss << " " << i->GetName(); + oss2<< " " << i->GetName(); + if( i->IsDirectory() ) + { + oss << "/"; + oss2<< "/"; + + }else + { + char str[0x100]=""; + char size[20]=""; + int offset,j; + + offset = 60-STD_StrLen(oss.str().c_str()); + for(j=0;jGetSize()); + STD_StrCat(str,size); + + oss << " " << str; + oss2<< " " << size; + } + oss << std::endl; + oss2<< std::endl; + + OS_PutString(oss.str().c_str()); + SDLOG_Printf(oss.str().c_str()); + wPrintf(oss2.str().c_str()); + OS_Sleep(100); + + if( i->IsDirectory() ) + { + DrawEntries(prevPart + (isLast ? " ": "| "), (prevPart2 + " "), i->GetEntryList()); + } + } + } + + void + TreeNand(const char* root) + { + EntryList elist; + GetDirEntryRecursive(&elist, root); + + OS_TPrintf("%s\n", root); + DrawEntries("","", elist); + } +} + + +void +TwlStartUp() +{ + OS_Init(); + InitAlloc(); +} + +// 文字表示 +static void PutString( char *format, ... ) +{ + u16 *dest = (u16*)G2_GetBG1ScrPtr(); + char temp[32+1]; + int i; + va_list va; + + va_start(va, format); + (void)OS_VSNPrintf(temp, sizeof(temp), format, va); + va_end(va); + + for (i = 0; i < 32 && temp[i]; i++) + { + dest[i] = (u16)((u8)temp[i] | (1 << 12)); + } +} + +#define BUFFER_SIZE 0x900 +#define PARTITION_SIZE 0x300 +char logBuffer[ (BUFFER_SIZE + 1) ]; +void +TwlMain(void) +{ + + MyInit(); + + if( !SDLOG_Init("sdmc:/treenand2sd/", logBuffer, BUFFER_SIZE, PARTITION_SIZE, SDLOG_WRITE_TYPE_CONTINUANCE) ) + { + OS_Panic("Error"); + } + + OS_TPrintf("treenand start.\n"); + OS_TPrintf("---------------------------------------------------------------\n"); + wPrintf("\fnand:\n"); + wPrintf("-------------------------------\n"); + TreeNand("nand:"); + + wPrintf("\n\nnand2:\n"); + wPrintf("-------------------------------\n"); + TreeNand("nand2:"); + OS_TPrintf("---------------------------------------------------------------\n"); + OS_TPrintf("treenand completed.\n"); + + SDLOG_Flush(); + SDLOG_Finish(); + OS_Printf("Program is finished!\n"); + + wSetPalette(COLOR_BLUE); + wPrintf("\n !Program is finished!\n"); + + OS_Terminate(); +} + diff --git a/build/debugsoft/treenand2sd/src/text.c b/build/debugsoft/treenand2sd/src/text.c new file mode 100644 index 00000000..0e8ba5b6 --- /dev/null +++ b/build/debugsoft/treenand2sd/src/text.c @@ -0,0 +1,113 @@ +/******************************************************************** + +タイトル: + テキストVRAMエミュレーション + +********************************************************************/ +#include "fontdata.h" +#include "text.h" + +/************************************************************************ + +☆グローバル変数宣言 + + ************************************************************************/ +/* テキストVRAM本体 */ +TEXT_VRAM_TYPE wText; + +/************************************************************************ + +☆プロトタイプ宣言 + + ************************************************************************/ +static void UpdateTextVram( void ); +static void Init( void ); + + + +/************************************************************************ + +☆システム関数群 + + ************************************************************************/ + +/************************************************************************ + + 初期化 + +概要: + キャラ・パレットの転送 + BG0コントロール + + ***********************************************************************/ +static void Init( void ){ + + GX_SetBankForBG(GX_VRAM_BG_128_A); + GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D); + GX_SetVisiblePlane(GX_PLANEMASK_BG0); + G2_SetBG0Priority(0); + G2_BlendNone(); // no 2D alpha blending or brightness change + G2_BG0Mosaic(FALSE); + GX_SetVisibleWnd(GX_WNDMASK_NONE); // ウインドウ無し + G2_SetBG0Offset(0, 0); //オフセット0 + GX_SetBGScrOffset(GX_BGSCROFFSET_0x00000); + + //表示リソースの再ロード + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, // 256pix x 256pix text + GX_BG_COLORMODE_16, // use 256 colors mode + GX_BG_SCRBASE_0x0000, // screen base offset + 0x0000 is the address for BG #0 screen + GX_BG_CHARBASE_0x04000, // character base offset + 0x04000 is the address for BG #0 characters + GX_BG_EXTPLTT_01 // use BGExtPltt slot #0 if BGExtPltt is enabled + ); + GX_LoadBG0Char(CharData_Sample, 0, sizeof(CharData_Sample)); + GX_LoadBGPltt(PlttData_Sample, 0, sizeof(PlttData_Sample)); + +} + +/************************************************************************ + + テキストVRAMサービス初期化 + +注意事項: + プログラム開始時に一度だけコールしてください。 + + ***********************************************************************/ +extern void wInitTextVram( void ){ + + static BOOL Initialized = FALSE; + + if( !Initialized ){ + + /* 初期設定をおこなう */ + Init(); + + // Vブランク割り込み設定 + OS_InitIrqTable(); + OS_SetIrqFunction(OS_IE_V_BLANK, UpdateTextVram); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)OS_EnableIrq(); + (void)GX_VBlankIntr(TRUE); + (void)OS_EnableInterrupts(); + + Initialized = TRUE; + } +} + +/************************************************************************ + + テキストVRAMの更新ルーチン + +注意事項: + 割込みのコールバックルーチンです。 + + 画面を自動的に更新するために定期的に呼び出してください。 + (上記のInitTextVramを使用する場合は不要) + + ***********************************************************************/ +static void UpdateTextVram( void ){ + + MI_CpuCopy16( wText.Map, G2_GetBG0ScrPtr(), sizeof(wText.Map) ); + DC_StoreRange( G2_GetBG0ScrPtr(), sizeof(wText.Map) ); + +} +