同一メーカータイトルNANDセーブデータへのアクセス確認プログラムのコミット

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2066 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
(no author) 2008-08-01 05:19:04 +00:00
parent 94535539ba
commit 220cad3329
28 changed files with 4700 additions and 0 deletions

View File

@ -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 =====

View File

@ -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 := dispver
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 =====

View File

@ -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_ */

View File

@ -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 <nitro/types.h>
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
*---------------------------------------------------------------------------*/

View File

@ -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 <nitro/types.h>
//メニューに関する定義
#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
*---------------------------------------------------------------------------*/

View File

@ -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 <nitro/types.h>
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
*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,21 @@
セーブデータバージョンチェックソフト
このソフトはセーブデータのインポート・エクスポートを確認するためのソフトです。
以下のことをします。
・アプリバージョンを表示する
・アプリバージョンをパブリックセーブデータ・プライベートセーブデータに保存する
・各セーブデータに保存したバージョン番号およびタイムスタンプを表示する
これを使うことでアプリバージョンが変わった時のセーブデータの挙動を確認することができます。
【使い方】
・ソフトを起動すると以下の表示を行います
  アプリバージョン
  パブリックセーブデータに保存したバージョン番号およびタイムスタンプ
  プライベートセーブデータに保存したバージョン番号およびタイムスタンプ
・矢印↑↓で項目を選択しAボタンを押すと該当するセーブデータを書き換えます
・Xボタンを押すと全セーブデータを書き換えます
【制限事項】
書き換えを実行してもタイムスタンプに2秒以内の時間のずれが発生します
(ファイルシステムは2秒間隔でしか設定しないため)

View File

@ -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 <nitro/fs.h>
#include <nitro/os.h>
#include <twl/nam.h>
#include <twl/na.h>
//#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<appnum; i++ )
{
if( !NAM_IsExecTitle( tmptitle[i] ) )
continue;
if( !NAM_IsVisibleTitle( tmptitle[i] ) )
continue;
ret = NAM_ReadTitleInfo( &info, tmptitle[i] );
if( ret != NAM_OK )
return -3;
if( info.companyCode != OUR_COMPANY_CODE )
continue;
if( (NAM_GetTitleIdLo(tmptitle[i]) == SELF_INITIAL_CODE) )
continue;
g_title[j] = tmptitle[i];
j++;
}
g_title_num = j;
return j;
}
s32 GetOurNandAppNum(void)
{
return g_title_num;
}
BOOL GetOurNandAppVersionString(s32 no, char *verstr, char *inistr)
{
NAMTitleInfo info;
u32 ini;
if( no >= 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

View File

@ -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
};

View File

@ -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 <twl.h>
#else
#include <nitro.h>
#endif
#include <nitro/rtc.h>
#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;
}
}

View File

@ -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 <nitro/std.h>
/*
* 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], " " );
}
}

View File

@ -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 <twl.h>
#else
#include <nitro.h>
#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];
}
}
}

View File

@ -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 = dispver
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 =====

View File

@ -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_ */

View File

@ -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 <nitro/types.h>
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
*---------------------------------------------------------------------------*/

View File

@ -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 <nitro/types.h>
//メニューに関する定義
#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
*---------------------------------------------------------------------------*/

View File

@ -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 <nitro/types.h>
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
*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,23 @@
セーブデータバージョンチェックソフトの相方
このソフトはDisplayVersionの相方です。
以下のことをします。
・アプリバージョンを表示する
・アプリバージョンをパブリックセーブデータ・プライベートセーブデータに保存する
・各セーブデータに保存したバージョン番号およびタイムスタンプを表示する
DisplayVersionとの違いは共有データアクセス機能がないこととイニシャルコードが違うこと
にあります。
【使い方】
・ソフトを起動すると以下の表示を行います
  アプリバージョン
  パブリックセーブデータに保存したバージョン番号およびタイムスタンプ
  プライベートセーブデータに保存したバージョン番号およびタイムスタンプ
・矢印↑↓で項目を選択しAボタンを押すと該当するセーブデータを書き換えます
・Xボタンを押すと全セーブデータを書き換えます
【制限事項】
DisplayVersionと同様の制限事項があります。
書き換えを実行してもタイムスタンプに2秒以内の時間のずれが発生します
(ファイルシステムは2秒間隔でしか設定しないため)

View File

@ -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 <nitro/fs.h>
#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 ðŠJ¢ÄÝé
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

View File

@ -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
};

View File

@ -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 <twl.h>
#else
#include <nitro.h>
#endif
#include <nitro/rtc.h>
#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;
}
}

View File

@ -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 <nitro/std.h>
/*
* 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], " " );
}
}

View File

@ -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 <twl.h>
#else
#include <nitro.h>
#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];
}
}
}

View File

@ -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 =====

View File

@ -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のセーブデータへアクセス可能です。これは正しい動作です。