・日付・時刻設定に対応。

・不要なファイルを削除。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@90 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yosiokat 2007-10-31 12:26:37 +00:00
parent ec9864e9bc
commit 2f08e217c3
18 changed files with 346 additions and 3788 deletions

View File

@ -22,15 +22,15 @@
// define data------------------------------------------
// キャンセルボタンLCD領域
#define CANCEL_BUTTON_LT_X ( 12 * 8 )
#define CANCEL_BUTTON_LT_Y ( 21 * 8 )
#define CANCEL_BUTTON_RB_X ( (CANCEL_BUTTON_LT_X + 8) * 8 )
#define CANCEL_BUTTON_RB_Y ( (CANCEL_BUTTON_LT_Y + 2) * 8 )
#define CANCEL_BUTTON_TOP_X ( 12 * 8 )
#define CANCEL_BUTTON_TOP_Y ( 21 * 8 )
#define CANCEL_BUTTON_BOTTOM_X ( CANCEL_BUTTON_TOP_X + 5 * 8 )
#define CANCEL_BUTTON_BOTTOM_Y ( CANCEL_BUTTON_TOP_Y + 2 * 8 )
// OKボタンLCD領域
#define OK_BUTTON_LT_X ( 22 * 8 )
#define OK_BUTTON_LT_Y ( 21 * 8 )
#define OK_BUTTON_RB_X ( (OK_BUTTON_LT_X + 8) * 8 )
#define OK_BUTTON_RB_Y ( (OK_BUTTON_LT_Y + 2) * 8 )
#define OK_BUTTON_TOP_X ( 22 * 8 )
#define OK_BUTTON_TOP_Y ( 21 * 8 )
#define OK_BUTTON_BOTTOM_X ( OK_BUTTON_TOP_X + 2 * 8 )
#define OK_BUTTON_BOTTOM_Y ( OK_BUTTON_TOP_Y + 2 * 8 )
#define SETTING_MENU_ELEMENT_NUM 4 // メインメニューの項目数
@ -153,7 +153,6 @@ int MachineSettingMain( void )
{
BOOL tp_select;
GetAndDrawRtcData();
ReadTP();
//--------------------------------------
@ -218,18 +217,18 @@ int MachineSettingMain( void )
// OK / CANCELボタンの描画
void DrawOKCancelButton(void)
{
(void)PutStringUTF16( CANCEL_BUTTON_LT_X, CANCEL_BUTTON_LT_Y, TXT_COLOR_CYAN, (const u16 *)L" CANCEL ");
(void)PutStringUTF16( OK_BUTTON_LT_X, OK_BUTTON_LT_Y, TXT_COLOR_CYAN, (const u16 *)L" OK ");
(void)PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_COLOR_CYAN, (const u16 *)L"CANCEL");
(void)PutStringUTF16( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y, TXT_COLOR_CYAN, (const u16 *)L"OK");
}
// OK or CANCELボタン押下チェック
void CheckOKCancelButton(BOOL *tp_ok, BOOL *tp_cancel)
{
*tp_cancel = InRangeTp( CANCEL_BUTTON_LT_X, CANCEL_BUTTON_LT_Y,
CANCEL_BUTTON_RB_X, CANCEL_BUTTON_RB_Y, &tpd.disp );
*tp_ok = InRangeTp( OK_BUTTON_LT_X, OK_BUTTON_LT_Y,
OK_BUTTON_RB_X, OK_BUTTON_RB_Y, &tpd.disp );
*tp_cancel = WithinRangeTP( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y,
CANCEL_BUTTON_BOTTOM_X, CANCEL_BUTTON_BOTTOM_Y, &tpd.disp );
*tp_ok = WithinRangeTP( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y,
OK_BUTTON_BOTTOM_X, OK_BUTTON_BOTTOM_Y, &tpd.disp );
}

View File

@ -393,11 +393,11 @@ int TP_CalibrationMain( void )
SetPoint16x16( tpd.disp.x, tpd.disp.y );
// [OK] [CANCEL] [RETRY]ボタン押下チェック
tp_ok = InRangeTp( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y,
tp_ok = WithinRangeTP( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y,
OK_BUTTON_BOTTOM_X, OK_BUTTON_BOTTOM_Y, &tpd.disp );
tp_cancel = InRangeTp( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y,
tp_cancel = WithinRangeTP( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y,
CANCEL_BUTTON_BOTTOM_X, CANCEL_BUTTON_BOTTOM_Y, &tpd.disp );
tp_retry = InRangeTp( RETRY_BUTTON_TOP_X, RETRY_BUTTON_TOP_Y,
tp_retry = WithinRangeTP( RETRY_BUTTON_TOP_X, RETRY_BUTTON_TOP_Y,
RETRY_BUTTON_BOTTOM_X, RETRY_BUTTON_BOTTOM_Y, &tpd.disp );
if( tpd.raw.validity==TP_VALIDITY_VALID ) {

View File

@ -31,6 +31,9 @@ static void INTR_VBlank( void );
// global variable-------------------------------------------------------------
NNSFndAllocator g_allocator;
int (*g_pNowProcess)( void );
RTCDrawProperty g_rtcDraw = {
TRUE, RTC_DATE_TOP_X, RTC_DATE_TOP_Y, RTC_TIME_TOP_X, RTC_TIME_TOP_Y
};
// static variable-------------------------------------------------------------
@ -70,8 +73,8 @@ void TwlMain(void)
SYSM_CaribrateTP();
InitBG();
GetAndDrawRTCData( &g_rtcDraw, TRUE );
MachineSettingInit();
InitGetAndDrawRtcData( RTC_DATE_TOP_X, RTC_DATE_TOP_Y, RTC_TIME_TOP_X, RTC_TIME_TOP_Y );
// メインループ----------------------------
while ( 1 ) {
OS_WaitIrq( 1, OS_IE_V_BLANK ); // Vブランク割り込み待ち
@ -80,7 +83,7 @@ void TwlMain(void)
(void)g_pNowProcess();
GetAndDrawRtcData();
GetAndDrawRTCData( &g_rtcDraw, FALSE );
}
}

View File

@ -74,6 +74,8 @@ typedef struct RtcDrawPos{
}RtcDrawPos;
// function's prototype-------------------------------------------------------
static BOOL WaitDetachTP( void );
static void StartDetachTP( void );
static void InitScreen( void );
static void InitCanvas( void );
static void GetAndDrawRtcDataCore( BOOL forceGetFlag );
@ -285,6 +287,24 @@ void PutStringUTF16Sub( int x, int y, int color, const u16 *strUTF16 )
}
// 書式付きで作成した文字列を表示した場合の幅を取得する
int GetPrintfWidth( const NNSG2dTextCanvas *pCanvas, const char *fmt, ... )
{
int srcLen;
int dstLen = sizeof(s_strBufferUTF16);
va_list vlist;
va_start(vlist, fmt);
srcLen = STD_TVSNPrintf( s_strBuffer, sizeof(s_strBuffer), fmt, vlist);
va_end(vlist);
s_strBuffer[ srcLen ] = 0;
(void)STD_ConvertStringSjisToUnicode( s_strBufferUTF16, &dstLen, s_strBuffer, &srcLen, NULL );
s_strBufferUTF16[ dstLen ] = 0;
return NNS_G2dTextCanvasGetTextWidth( pCanvas, s_strBufferUTF16 );
}
// SJISでPrintf形式で文字表示内部でUTF16に変換)
void PrintfSJIS( int x, int y, int color, const char *fmt, ... )
{
@ -367,7 +387,7 @@ void ReadTP(void)
// TPデタッチを待つ
BOOL WaitDetachTP( void )
static BOOL WaitDetachTP( void )
{
// s_detach_countが始動していたら、カウント判定。
if(s_detach_count > 0) {
@ -383,7 +403,7 @@ BOOL WaitDetachTP( void )
// TPデタッチ待ちの開始
void StartDetachTP( void )
static void StartDetachTP( void )
{
s_detach_count = TP_CSR_DETACH_COUNT;
}
@ -451,7 +471,7 @@ BOOL SelectMenuByTP( u16 *nowCsr, const MenuParam *pMenu )
OS_TPrintf( "MENU[ %d ] : top_x = %02d top_y = %02d bot_x = %02d bot_y = %02d : ",
i, top_x, top_y, bottom_x, bottom_y );
if( InRangeTp( top_x, top_y, bottom_x, bottom_y, target ) ) {
if( WithinRangeTP( top_x, top_y, bottom_x, bottom_y, target ) ) {
OS_TPrintf( "InRange\n" );
if( tpd.disp.validity == TP_VALIDITY_VALID ) { // カーソルをその要素に移動
if( csr_old == i ) {
@ -482,7 +502,7 @@ BOOL SelectMenuByTP( u16 *nowCsr, const MenuParam *pMenu )
// 現在のタッチパネル座標が指定領域内にあるかどうかを返す。
BOOL InRangeTp( int top_x, int top_y, int bottom_x, int bottom_y, TPData *tgt )
BOOL WithinRangeTP( int top_x, int top_y, int bottom_x, int bottom_y, TPData *tgt )
{
if( ( tgt->x >= top_x ) &&
( tgt->x <= bottom_x ) &&
@ -497,79 +517,6 @@ BOOL InRangeTp( int top_x, int top_y, int bottom_x, int bottom_y, TPData *tgt )
}
//===============================================
// RTCアクセスルーチン
//===============================================
// RTCデータ取得表示の初期化
void InitGetAndDrawRtcData( int drawDatePos_x, int drawDatePos_y, int drawTimePos_x, int drawTimePos_y)
{
s_vcount = 0;
s_rtcPos.date_x = drawDatePos_x;
s_rtcPos.date_y = drawDatePos_y;
s_rtcPos.time_x = drawTimePos_x;
s_rtcPos.time_y = drawTimePos_y;
(void)RTC_GetDateTime( &s_rtcDate, &s_rtcTime);
GetAndDrawRtcDataCore( TRUE );
}
void GetAndDrawRtcData( void )
{
GetAndDrawRtcDataCore( FALSE );
}
// RTC情報の取得表示
static void GetAndDrawRtcDataCore( BOOL forceGetFlag )
{
u32 year;
RTCDate date_old;
RTCTime time_old;
// RTC情報の取得
if( forceGetFlag || ( s_vcount++ == 60 ) ) {
s_vcount = 0;
MI_CpuCopy16( &s_rtcDate, &date_old, sizeof(RTCDate) );
MI_CpuCopy16( &s_rtcTime, &time_old, sizeof(RTCTime) );
(void)RTC_GetDateTime( &s_rtcDate, &s_rtcTime );
// 前RTC情報の消去
{
year = s_rtcDate.year + 2000;
PrintfSJISSub( s_rtcPos.date_x, s_rtcPos.date_y, TXT_COLOR_WHITE, "%d/%02d/%02d[%3s]",
year,
date_old.month,
date_old.day,
g_strWeek[ date_old.week ]
);
PrintfSJISSub( s_rtcPos.time_x, s_rtcPos.time_y, TXT_COLOR_WHITE, "%02d:%02d:%02d",
time_old.hour,
time_old.minute,
time_old.second
);
}
// RTC情報の表示
{
year = s_rtcDate.year + 2000;
PrintfSJISSub( s_rtcPos.date_x, s_rtcPos.date_y, TXT_COLOR_BLACK, "%d/%02d/%02d[%3s]",
year,
s_rtcDate.month,
s_rtcDate.day,
g_strWeek[ s_rtcDate.week ]
);
PrintfSJISSub( s_rtcPos.time_x, s_rtcPos.time_y, TXT_COLOR_BLACK, "%02d:%02d:%02d",
s_rtcTime.hour,
s_rtcTime.minute,
s_rtcTime.second
);
}
}
}
// バナーアイコンOBJのロード
void SetBannerIconOBJ( GXOamAttr *pDstOAM, BannerFileV1 *bannerp )
{
@ -588,3 +535,68 @@ void SetBannerIconOBJ( GXOamAttr *pDstOAM, BannerFileV1 *bannerp )
15, // palette
0); // affine
}
//===============================================
// RTCアクセスルーチン
//===============================================
// RTCデータの取得
BOOL GetRTCData( RTCDrawProperty *pRTCDraw, BOOL forceGetFlag )
{
if( forceGetFlag || ( pRTCDraw->vcount++ == 59 ) ) {
pRTCDraw->vcount = 0;
MI_CpuCopy16( &pRTCDraw->date, &pRTCDraw->date_old, sizeof(RTCDate) );
MI_CpuCopy16( &pRTCDraw->time, &pRTCDraw->time_old, sizeof(RTCTime) );
(void)RTC_GetDateTime( &pRTCDraw->date, &pRTCDraw->time );
return TRUE;
}
return FALSE;
}
// RTCデータの表示
void DrawRTCData( RTCDrawProperty *pRTCDraw )
{
void (*pPrintFunc)( int x, int y, int color, const char *fmt, ... ) =
( pRTCDraw->isTopLCD ) ? PrintfSJISSub : PrintfSJIS;
// 前RTC情報の消去
{
u32 year = pRTCDraw->date_old.year + 2000;
pPrintFunc( pRTCDraw->date_x, pRTCDraw->date_y, TXT_COLOR_WHITE, "%04d/%02d/%02d[%3s]",
year,
pRTCDraw->date_old.month,
pRTCDraw->date_old.day,
g_strWeek[ pRTCDraw->date_old.week ]
);
pPrintFunc( pRTCDraw->time_x, pRTCDraw->time_y, TXT_COLOR_WHITE, "%02d:%02d:%02d",
pRTCDraw->time_old.hour,
pRTCDraw->time_old.minute,
pRTCDraw->time_old.second
);
}
// RTC情報の表示
{
u32 year = pRTCDraw->date.year + 2000;
pPrintFunc( pRTCDraw->date_x, pRTCDraw->date_y, TXT_COLOR_BLACK, "%d/%02d/%02d[%3s]",
year,
pRTCDraw->date.month,
pRTCDraw->date.day,
g_strWeek[ pRTCDraw->date.week ]
);
pPrintFunc( pRTCDraw->time_x, pRTCDraw->time_y, TXT_COLOR_BLACK, "%02d:%02d:%02d",
pRTCDraw->time.hour,
pRTCDraw->time.minute,
pRTCDraw->time.second
);
}
}
// RTCデータの取得&表示
void GetAndDrawRTCData( RTCDrawProperty *pRTCDraw, BOOL forceGetFlag )
{
if( GetRTCData( pRTCDraw, forceGetFlag ) ) {
DrawRTCData( pRTCDraw );
}
}

View File

@ -119,10 +119,25 @@ typedef struct MenuParam {
}MenuParam;
// RTCƒf<C692>[ƒ^•\ަˆÊ<75><C692>[ƒN
typedef struct RTCDrawProperty {
BOOL isTopLCD;
int date_x;
int date_y;
int time_x;
int time_y;
int vcount;
RTCDate date;
RTCTime time;
RTCDate date_old;
RTCTime time_old;
}RTCDrawProperty;
// global variables--------------------------------------------------
extern TpWork tpd; // タッチパネルデータ
extern KeyWork pad; // キーパッド入力データ
extern const u8 *const g_strWeek[ 7 ]; // 曜日文字列
extern RTCDrawProperty g_rtcDraw;
extern NNSFndAllocator g_allocator; // メモリアロケータ
extern NNSG2dFont gFont; // フォント
@ -131,20 +146,20 @@ extern NNSG2dTextCanvas gTextCanvas; // TextCanvas
// function-------------------------------------------------------------
void InitBG( void );
int GetPrintfWidth( const NNSG2dTextCanvas *pCanvas, const char *fmt, ... );
void PutStringUTF16 ( int x, int y, int color, const u16 *strUTF16 );
void PutStringUTF16Sub( int x, int y, int color, const u16 *strUTF16 );
void PrintfSJIS ( int x, int y, int color, const char *fmt, ... );
void PrintfSJISSub( int x, int y, int color, const char *fmt, ... );
void ReadKeyPad( void );
void ReadTP( void );
BOOL WaitDetachTP( void );
void StartDetachTP( void );
void DrawMenu( u16 nowCsr, const MenuParam *pMenu );
BOOL SelectMenuByTP( u16 *nowCsr, const MenuParam *pMenu );
BOOL InRangeTp( int top_x, int top_y, int bottom_x, int bottom_y, TPData *tgt );
void InitGetAndDrawRtcData( int drawDatePos_x, int drawDatePos_y, int drawTimePos_x, int drawTimePos_y );
void GetAndDrawRtcData( void );
BOOL WithinRangeTP( int top_x, int top_y, int bottom_x, int bottom_y, TPData *tgt );
void SetBannerIconOBJ( GXOamAttr *pDstOAM, BannerFileV1 *bannerp );
BOOL GetRTCData( RTCDrawProperty *pRTCDraw, BOOL forceGetFlag );
void DrawRTCData( RTCDrawProperty *pRTCDraw );
void GetAndDrawRTCData( RTCDrawProperty *pRTCDraw, BOOL forceGetFlag );
#ifdef __cplusplus
}

View File

@ -1,131 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: AgbLcdSel.c
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <sysmenu.h>
#include "misc.h"
#include "DS_Setting.h"
// define data------------------------------------------
#define CANCEL_BUTTON_LT_X 2
#define CANCEL_BUTTON_LT_Y 21
#define CANCEL_BUTTON_RB_X (CANCEL_BUTTON_LT_X+8)
#define CANCEL_BUTTON_RB_Y (CANCEL_BUTTON_LT_Y+2)
// extern data------------------------------------------
// function's prototype declaration---------------------
void SEQ_AgbLcdSelect_init(void);
int SEQ_AgbLcdSelect(void);
// global variable -------------------------------------
// static variable -------------------------------------
static u16 agbLcd = 0;
// const data -----------------------------------------
static const u8 *const str_lcd[] ATTRIBUTE_ALIGN(2) = {
(const u8 *)"TOP LCD",
(const u8 *)"BOTTOM LCD",
};
static const MenuComponent agbLcdSel = {
2,
10,
8,
0,
4,
8,
WHITE,
HIGHLIGHT_Y,
(const u8 **)&str_lcd,
};
//======================================================
// function's description
//======================================================
// AGBモード設定の初期化
void SEQ_AgbLcdSelect_init(void)
{
GXS_SetVisiblePlane(GX_PLANEMASK_NONE);
MI_CpuClearFast(bgBakS,sizeof(bgBakS));
ClearAllStringSJIS();
(void)DrawStringSJIS( 1, 0, YELLOW, (const u8 *)"AGB-MODE LCD SELECT");
(void)DrawStringSJIS( CANCEL_BUTTON_LT_X, CANCEL_BUTTON_LT_Y,HIGHLIGHT_C, (const u8 *)" CANCEL ");
if(GetSYSMWork()->ncd_invalid) {
agbLcd = 0;
}else {
agbLcd = GetNCDWork()->option.agbLcd;
if(agbLcd > 1) agbLcd = 1;
}
DrawMenu((u16)agbLcd, &agbLcdSel);
SVC_CpuClear(0x0000, &tpd, sizeof(TpWork), 16);
GXS_SetVisiblePlane(GX_PLANEMASK_OBJ | GX_PLANEMASK_BG1);
}
// AGBモード設定
int SEQ_AgbLcdSelect(void)
{
BOOL tp_select;
BOOL tp_cancel = FALSE;
ReadTP(); // タッチパネル入力の取得
//--------------------------------------
// キー入力処理
//--------------------------------------
if(pad.trg & (PAD_KEY_DOWN | PAD_KEY_UP)){ // カーソルの移動
agbLcd ^= 0x01;
}
tp_select = SelectMenuByTp((u16 *)&agbLcd, &agbLcdSel);
DrawMenu((u16)agbLcd, &agbLcdSel);
// [CANCEL]ボタン押下チェック
if(tpd.disp.touch) {
tp_cancel = InRangeTp(CANCEL_BUTTON_LT_X*8, CANCEL_BUTTON_LT_Y*8,
CANCEL_BUTTON_RB_X*8, CANCEL_BUTTON_RB_Y*8, &tpd.disp);
}
if((pad.trg & PAD_BUTTON_A) || (tp_select)) { // メニュー項目への分岐
GetSYSMWork()->ncd_invalid = 0;
GetNCDWork()->option.agbLcd = agbLcd;
// ::::::::::::::::::::::::::::::::::::::::::::::
// NVRAMへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
(void)NVRAMm_WriteNitroConfigData(GetNCDWork());
SEQ_MainMenu_init();
return 0;
}else if((pad.trg & PAD_BUTTON_B) || (tp_cancel)) {
SEQ_MainMenu_init();
return 0;
}
ReadTP();
return 0;
}

View File

@ -1,131 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: autoBoot.c
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <sysmenu.h>
#include "misc.h"
#include "DS_Setting.h"
// define data------------------------------------------
#define CANCEL_BUTTON_LT_X 2
#define CANCEL_BUTTON_LT_Y 21
#define CANCEL_BUTTON_RB_X (CANCEL_BUTTON_LT_X+8)
#define CANCEL_BUTTON_RB_Y (CANCEL_BUTTON_LT_Y+2)
// extern data------------------------------------------
// function's prototype declaration---------------------
void SEQ_AutoBootSelect_init(void);
int SEQ_AutoBootSelect(void);
// global variable -------------------------------------
// static variable -------------------------------------
static u16 autoBootFlag = 0;
// const data -----------------------------------------
static const u8 *const str_lcd[] ATTRIBUTE_ALIGN(2) = {
(const u8 *)" OFF ",
(const u8 *)" ON ",
};
static const MenuComponent autoBootSel = {
2,
12,
8,
0,
4,
8,
WHITE,
HIGHLIGHT_Y,
(const u8 **)&str_lcd,
};
//======================================================
// function's description
//======================================================
// AGBモード設定の初期化
void SEQ_AutoBootSelect_init(void)
{
GXS_SetVisiblePlane(GX_PLANEMASK_NONE);
MI_CpuClearFast(bgBakS,sizeof(bgBakS));
ClearAllStringSJIS();
(void)DrawStringSJIS( 1, 0, YELLOW, (const u8 *)"AUTO BOOT SELECT");
(void)DrawStringSJIS( CANCEL_BUTTON_LT_X, CANCEL_BUTTON_LT_Y,HIGHLIGHT_C, (const u8 *)" CANCEL ");
if(GetSYSMWork()->ncd_invalid) {
autoBootFlag = 0;
}else {
autoBootFlag = GetNCDWork()->option.autoBootFlag;
if(autoBootFlag > 1) autoBootFlag = 1;
}
DrawMenu((u16)autoBootFlag, &autoBootSel);
SVC_CpuClear(0x0000, &tpd, sizeof(TpWork), 16);
GXS_SetVisiblePlane(GX_PLANEMASK_OBJ | GX_PLANEMASK_BG1);
}
// AGBモード設定
int SEQ_AutoBootSelect(void)
{
BOOL tp_select;
BOOL tp_cancel = FALSE;
ReadTP(); // タッチパネル入力の取得
//--------------------------------------
// キー入力処理
//--------------------------------------
if(pad.trg & (PAD_KEY_DOWN | PAD_KEY_UP)){ // カーソルの移動
autoBootFlag ^= 0x01;
}
tp_select = SelectMenuByTp((u16 *)&autoBootFlag, &autoBootSel);
DrawMenu((u16)autoBootFlag, &autoBootSel);
// [CANCEL]ボタン押下チェック
if(tpd.disp.touch) {
tp_cancel = InRangeTp(CANCEL_BUTTON_LT_X*8, CANCEL_BUTTON_LT_Y*8,
CANCEL_BUTTON_RB_X*8, CANCEL_BUTTON_RB_Y*8, &tpd.disp);
}
if((pad.trg & PAD_BUTTON_A) || (tp_select)) { // メニュー項目への分岐
GetSYSMWork()->ncd_invalid = 0;
GetNCDWork()->option.autoBootFlag = autoBootFlag;
// ::::::::::::::::::::::::::::::::::::::::::::::
// NVRAMへの書き込み
// ::::::::::::::::::::::::::::::::::::::::::::::
(void)NVRAMm_WriteNitroConfigData(GetNCDWork());
SEQ_MainMenu_init();
return 0;
}else if((pad.trg & PAD_BUTTON_B) || (tp_cancel)) {
SEQ_MainMenu_init();
return 0;
}
ReadTP();
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,93 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: font.h
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef __FONT_H_
#define __FONT_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <twl.h>
// define data----------------------------------
#define STR_ENTRY_MAX_NUM 256 // 登録可能な文字列データの最大個数
#define SJIS_CHAR_VRAM_OFFSET 0x4000 // SJIS文字列キャラクタ用VRAMのオフセット値
#define SJIS_CHAR_VRAM_SIZE (0x8000 + 0x20) //             のサイズ0x20はヒープのヘッダ
#define VRAM_M_ARENA_LO (HW_BG_VRAM + SJIS_CHAR_VRAM_OFFSET - 0x20)
#define VRAM_M_ARENA_HI (VRAM_M_ARENA_LO + SJIS_CHAR_VRAM_SIZE)
#define VRAM_S_ARENA_LO (HW_DB_BG_VRAM + SJIS_CHAR_VRAM_OFFSET - 0x20)
#define VRAM_S_ARENA_HI (VRAM_S_ARENA_LO + SJIS_CHAR_VRAM_SIZE)
// VRAMアリーナのLo & Hi
// SJISコード判定用の値
#define SJIS_HIGHER_CODE1_MIN 0x81
#define SJIS_HIGHER_CODE1_MAX 0x9f
#define SJIS_HIGHER_CODE2_MIN 0xe0
#define SJIS_HIGHER_CODE2_MAX 0xea
// 関数のエラーリターン値
#define DSJIS_ERR_ENTRY_GET_FAILED 0x8000
#define DSJIS_ERR_ENTRY_ALLOC_FAILED 0x8001
#define DSJIS_ERR_CHAR_ALLOC_FAILED 0x8002
#define DSJIS_ERR_STR_MEMORY_OVER 0x8003
#define DSJIS_ERR_STR_LENGTH_TOO_LONG 0x8004
// SetTargetScreenSJISの引数target
typedef enum TargetScreen {
TOP_SCREEN =0,
BOTTOM_SCREEN
}TargetScreen;
// フォント種類データSelectFontで指定
typedef enum FontType{ // 全角  半角
FONT12, // 12x12 & 12x 7dot
FONT_TYPE_MAX
}FontType;
// function's prototype declaration-------------
void InitFont( TargetScreen target );
void SetFont( FontType font );
void SetTargetScreenSJIS( TargetScreen target );
u16 ChangeColorSJIS( u16 handle, u16 new_color );
// 以下の表示関数は、データアドレスからデータハンドルを算出するので、ハンドルを引数で与えなくて良いが、同一アドレスのデータを複数場所に配置することができない。
u16 DrawStringSJIS ( int x, int y, u16 color, const void *str );
u16 DrawHexSJIS ( int x, int y, u16 color, const void *hexp, u16 figure );
u16 DrawDecimalSJIS( int x, int y, u16 color, const void *hexp, u16 figure, u16 size );
// Ex系は、引数にindexを設けることで、上記関数で制限されている同一アドレスデータの複数場所配置に対応している。
u16 DrawStringSJISEx ( int x, int y, u16 color, const void *strp, u32 index );
u16 DrawHexSJISEx ( int x, int y, u16 color, const void *hexp, u16 figure, u32 index );
u16 DrawDecimalSJISEx( int x, int y, u16 color, const void *hexp, u16 figure, u16 size, u32 index );
// 表示文字列クリア関数
void ClearStringSJIS( void *datap );
void ClearStringSJISEx( void *datap, u32 handleIndex );
void ClearStringSJIS_handle( u16 handle );
void ClearAllStringSJIS( void );
#ifdef __cplusplus
}
#endif
#endif // __FONT_H_

View File

@ -1,384 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: myFunc.c
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include "misc.h"
// define data----------------------------------
// function's prototype-------------------------
// extern data----------------------------------
//extern u16 bgBakS[32*24]; // BG バックアップ
//extern GXOamAttr oamBakS[128]; // OAM バックアップ
// const data-----------------------------------
//const u16 csr_charList1[] ={0x008c, 0x008c, 0x008c, 0x008c};
//const u8 str_time_period[]={" . ."};
// global variable------------------------------
int (*g_pNowProcess)(void);
//MyTime myTime;
//KeyWork pad;
// static variable------------------------------
static u16 key_rapid[4];
//static u16 csr_animeCount, csr_animeCharNum;
//static u16 csr_pos_x, csr_pos_y, csr_add_y;
//static u16 blinkCount;
// ============================================================================
// function's description
// ============================================================================
// BgBakオフセット値算出
__inline static u16 *calcBgOffset(u16 pos_x,u16 pos_y)
{
return bgBakS+pos_x+(pos_y<<5);
}
// メインメモリからでも大丈夫な形式での1byteのデータ読み出し。
__inline static u16 ReadByteHWBus(const void *srcp)
{
if( (u32)srcp & 0x00000001 ) return (u16)(*(u16 *)( (u32)srcp ^ 0x00000001 ) >> 8 );
else return (u16)(*(u16 *)( srcp ) & 0x00ff );
}
// 初期化
void mf_init(void)
{
mf_KEYPAD_initRapid();
// mf_BLINK_initCounter();
}
/*
// キー入力読み出し
void mf_KEYPAD_read(void)
{
u16 ReadData= PAD_Read();
pad.trg = (u16)(ReadData & (ReadData ^ pad.cont)); // トリガ 入力
pad.cont= ReadData; // ベタ 入力
}
*/
// キー連射入力処理 初期化(十字キーのみ)
void mf_KEYPAD_initRapid(void)
{
u16 *krp=key_rapid;
*krp++=0;
*krp++=0;
*krp++=0;
*krp++=0;
}
// キー連射入力(十字キーのみ)
void mf_KEYPAD_rapid(void)
{
u16 mask,i;
for(i=0;i<4;i++){
mask=(u16)(0x0001<<(i+4));
if(pad.cont & mask){
key_rapid[i]++;
if(key_rapid[i]==30) {
pad.trg|=mask;
key_rapid[i]=20;
}
}else{
key_rapid[i]=0;
}
}
}
// Xframeウェイト
void mf_waitXframe(u16 frame)
{
BOOL prelIRQ=OS_EnableIrq();
while(frame--) OS_WaitIrq(1, OS_IE_V_BLANK);
(void)OS_RestoreIrq(prelIRQ);
}
// 矩形BGクリア
void mf_clearRect(u16 pos_x,u16 pos_y,u8 height,u8 width)
{
u16 i,j;
u16 *dstp=calcBgOffset(pos_x,pos_y);
for(i=0;i<height;i++) {
for(j=0;j<width;j++) *dstp++=0x0020;
dstp+=0x20-width;
}
}
/*
// 10進データ表示
void mf_drawDecimal(u16 pos_x,u16 pos_y,u16 color,const void *valuep,u8 drawLength,u8 size)
{
u16 count,charCode;
u16 *dstp;
u32 mask,divisor,target;
mask=0xff;
while(--size>0) mask=(mask<<8)|0xff;
target=(*(u32 *)valuep)&mask;
count=10;
divisor=1000000000;
dstp=calcBgOffset(pos_x,pos_y);
while(count) {
CP_SetDiv32_32(target, divisor);
if (count<=drawLength) {
charCode=(u16)(CP_GetDivResult32()+0x0030);
*dstp++ =(u16)(charCode | color);
}
target=(u32)CP_GetDivRemainder32();
CP_SetDiv32_32(divisor, 10);
divisor=(u32)CP_GetDivResult32();
count--;
}
}
// 16進データ表示
void mf_drawHex(u16 pos_x,u16 pos_y,u16 color,const void *valuep,u8 drawLength)
{
u16 count,charCode;
u16 *dstp=calcBgOffset(pos_x,pos_y)+drawLength-1;
for(count=0;count<drawLength;count++){
charCode=ReadByteHWBus(valuep);
if (count & 0x01){
charCode=(u16)((charCode>>4) & 0x000f);
((u8 *)valuep)++;
}else{
charCode=(u16)( charCode & 0x000f);
}
if (charCode<0x000a) charCode+=0x0030;
else charCode+=0x0041-0x000a;
*dstp--=(u16)(charCode | color);
}
}
// 1byte文字列データ表示0x000xffまでの1文字が1byteで良い文字列を描画する
void mf_drawString(u16 pos_x,u16 pos_y, u16 color, const u8 *strp)
{
u16 data16;
u16 *dstp=calcBgOffset(pos_x,pos_y);
while(1) {
data16=ReadByteHWBus(strp++);
if(data16==0) break;
*dstp++=(u16)(color | data16);
}
}
// 2byte文字列データ表示0x0100以降の1文字に2byte必要な文字列を描画する
void mf_drawString2(u16 pos_x,u16 pos_y, u16 color, const u16 *strp)
{
u16 *dstp=calcBgOffset(pos_x,pos_y);
while(*strp) *dstp++ = (u16)(*strp++ | color);
}
// 矩形フレーム描画
void mf_drawRectFrame(u16 pos_x,u16 pos_y,u16 color,u8 height,u8 width)
{
u16 i,j,code;
u16 *dstp;
for(i=0;i<height;i++) {
dstp=calcBgOffset(pos_x,pos_y);
dstp+=(i<<5);
if(i==0){
code=0x0132;
}else if(i==height-1){
code=0x0136;
}else{
code=0x0135;
}
*dstp++=(u16)(color | code);
if((i==0)||(i==height-1)){
for(j=1;j<width-1;j++) *dstp++=(u16)(color | 0x0133);
}else{
dstp+=width-2;
}
*dstp++=(u16)(color | code | 0x0400); // BG_SC_H_FLIP
}
}
// カーソル初期化
void mf_CSR_init(u16 pos_x,u16 pos_y,u16 add_y)
{
csr_pos_x=pos_x;
csr_pos_y=pos_y;
csr_add_y=add_y;
}
// カーソル移動&アニメーション
void mf_CSR_moveAndAnime(int nowNum)
{
u16 *oamp=(u16 *)&oamBakS[0];
// move
oamp[0]=(u16)(csr_pos_y + nowNum*csr_add_y);
oamp[1]=csr_pos_x;
// anime
mf_CSR_anime(csr_charList1);
}
// カーソルアニメーション
void mf_CSR_anime(const u16 *csr_charListp)
{
u16 *oamp=(u16 *)&oamBakS[0];
// anime
if((++csr_animeCount & 0x0f)==0) {
csr_animeCharNum=(u16)((csr_animeCharNum+1) & 0x03);
}
oamp[2]=(u16)(RED | csr_charListp[csr_animeCharNum]);
}
// メッセージ点滅カウンター 初期化
void mf_BLINK_initCounter(void)
{
blinkCount=0;
mf_clearRect(0,20,1,0x0020);
}
// 文字列点滅表示
void mf_BLINK_drawString(u16 pos_x, u16 pos_y, u16 color, const u8 *strp)
{
u16 len=0;
blinkCount++;
if((blinkCount & 0x60)==0x60) {
while(*strp++) len++;
mf_clearRect(pos_x,pos_y,1,(u8)len);
}else {
mf_drawString(pos_x,pos_y,color,strp);
}
}
// 時間表示
void mf_TIME_init(void)
{
BOOL prelIRQ=OS_EnableIrq();
myTime.frame=0;
myTime.hour=0;
myTime.minute=0;
myTime.second=0;
myTime.enable=0;
(void)OS_RestoreIrq(prelIRQ);
}
void mf_TIME_start(int init_flag)
{
if(init_flag) mf_TIME_init();
myTime.enable=1;
}
void mf_TIME_stop(void)
{
myTime.enable=2;
}
void mf_TIME_count(void)
{
if(myTime.enable!=1) return;
myTime.frame++;
if(myTime.frame==60) {
myTime.frame=0;
myTime.second++;
if(myTime.second==60) {
myTime.second=0;
myTime.minute++;
if(myTime.minute==60) {
myTime.minute=0;
myTime.hour++;
}
}
}
}
void mf_TIME_draw(u16 pos_x, u16 pos_y, u16 color)
{
u8 keta;
if(myTime.enable==0) {
return;
}else if(myTime.enable==2){
color=RED;
}
mf_drawString(pos_x,pos_y,color,str_time_period);
if(myTime.hour<10){
keta=1;
}else if(myTime.hour<100){
keta=2;
}else if(myTime.hour<1000){
keta=3;
}else{
keta=4;
}
mf_drawUInt((u16)(pos_x+4-keta), pos_y, color, &myTime.hour,keta,2);
mf_drawUInt((u16)(pos_x+5), pos_y, color, &myTime.minute,2,1);
mf_drawUInt((u16)(pos_x+8), pos_y, color, &myTime.second,2,1);
}
// 文字列コピー
void mf_strcpy(const u8 *str1p,u8 *str2p)
{
while(*str1p) *str2p++=*str1p++;
*str2p=0x00;
}
// 文字列比較
u8 mf_strcmp(const u8 *str1p,const u8 *str2p)
{
while(*str1p) {
if(*str1p++!=*str2p++) return 1;
}
return 0;
}
*/

View File

@ -1,103 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: misc.h
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef __MISC_H__
#define __MISC_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <twl.h>
#include "misc.h"
// define data ---------------------------------
// パレットカラー
#define WHITE (0<<12)
#define RED (1<<12)
#define GREEN (2<<12)
#define BLUE (3<<12)
#define YELLOW (4<<12)
#define CYAN (5<<12)
#define PURPLE (6<<12)
#define LIGHTGREEN (7<<12)
#define HIGHLIGHT_Y (8<<12)
#define HIGHLIGHT_C (9<<12)
#define HIGHLIGHT_W (10<<12)
#define HIGHLIGHT_B (11<<12)
// 時間計測構造体
typedef struct {
int enable;
int frame;
int second;
int minute;
int hour;
}MyTime;
// キーデータ・ワークエリア構造体
//typedef struct {
// u16 trg; // トリガ入力
// u16 cont; // ベタ 入力
//}KeyWork;
// global variable------------------------------
extern MyTime myTime;
//extern KeyWork pad;
extern int (*g_pNowProcess)(void);
// const data-----------------------------------
extern const u16 myPlttData[12][16]; // パレットデータ
extern const u16 myChar[0x2800*8/16]; // キャラクターデータ
// function-------------------------------------
extern void mf_init(void);
extern void mf_KEYPAD_read(void);
extern void mf_KEYPAD_initRapid(void);
extern void mf_KEYPAD_rapid(void);
extern void mf_waitXframe(u16 frame);
extern void mf_clearRect(u16 pos_x,u16 pos_y,u8 height,u8 width);
/*
extern void mf_drawUInt(u16 pos_x,u16 pos_y,u16 color,const void *valuep,u8 drawLength,u8 size);
extern void mf_drawHex(u16 pos_x,u16 pos_y,u16 color,const void *valuep,u8 drawLength);
extern void mf_drawString(u16 pos_x,u16 pos_y,u16 color,const u8 *strp);
extern void mf_drawString2(u16 pos_x,u16 pos_y,u16 color,const u16 *strp);
extern void mf_drawRectFrame(u16 pos_x,u16 pos_y,u16 color,u8 height,u8 width);
extern void mf_CSR_init(u16 pos_x,u16 pos_y,u16 add_y);
extern void mf_CSR_moveAndAnime(int nowNum);
extern void mf_CSR_anime(const u16 *csr_charListp);
extern void mf_BLINK_initCounter(void);
extern void mf_BLINK_drawString(u16 pos_x,u16 pos_y,u16 color,const u8 *strp);
extern void mf_TIME_init(void);
extern void mf_TIME_start(int init_flag);
extern void mf_TIME_stop(void);
extern void mf_TIME_count(void);
extern void mf_TIME_draw(u16 pos_x,u16 pos_y,u16 color);
extern void mf_strcpy(const u8 *str1p,u8 *str2p);
extern u8 mf_strcmp(const u8 *str1p,const u8 *str2p);
*/
#ifdef __cplusplus
}
#endif
#endif // __MISC_H__

View File

@ -1,684 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: myChar.c
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include "misc.h"
#include "myFontequ.h"
// パレットデータ--------------------------------------------------------------
#define RGB555(r,g,b) (b<<10|g<<5|r)
// 背景黒ベース
const u16 myPlttData[12][16] = {
{RGB555(31,31,31), RGB555( 0, 0, 0), RGB555(15,15,15), RGB555(31,31,31),}, // White
{RGB555(31,31,31), RGB555(31, 0, 0), RGB555(31,31,31), RGB555(31,31,31),}, // Red
{RGB555(31,31,31), RGB555( 0, 19, 0), RGB555(31,31,31), RGB555(31,31,31),}, // Green
{RGB555(31,31,31), RGB555( 0, 11, 31), RGB555(31,31,31), RGB555(31,31,31),}, // Blue
{RGB555(31,31,31), RGB555(31, 31, 0), RGB555(31,31,31), RGB555(31,31,31),}, // Yellow
{RGB555(31,31,31), RGB555( 0, 31, 31), RGB555(31,31,31), RGB555(31,31,31),}, // Cyan
{RGB555(31,31,31), RGB555(31, 0, 31), RGB555(31,31,31), RGB555(31,31,31),}, // Purple
{RGB555(31,31,31), RGB555( 0, 31, 0), RGB555(31,31,31), RGB555(31,31,31),}, // Light Green
{RGB555(31,31,31), RGB555(31,31,31), RGB555(31, 31, 0), RGB555(31, 31, 0),}, // HighLight Yellow
{RGB555(31,31,31), RGB555(31,31,31), RGB555( 0, 31, 31), RGB555( 0, 31, 31),}, // HighLight CYAN
{RGB555(31,31,31), RGB555(31,31,31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // HighLight WHITE
{RGB555(31,31,31), RGB555(31,31,31), RGB555( 0, 11, 31), RGB555( 0, 11, 31),}, // HighLight BLUE
};
// キャラクタデータ------------------------------------------------------------
/*
const u16 myChar[0x2800*8/16]={
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //0
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //2
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //3
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //4
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //5
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //6
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //7
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //8
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //b
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //c
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //d
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //e
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //f
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //10
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //11
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //12
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //13
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //14
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //15
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //16
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //17
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //18
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //19
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1a
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1b
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1c
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1d
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1e
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1f
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //20
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x1333,0x3321, //21
0x1333,0x3321,0x2333,0x3332,0x1333,0x3321,0x2333,0x3332,
0x2113,0x3211,0x2113,0x3211,0x2123,0x3212,0x3213,0x3321, //22
0x3323,0x3332,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x2133,0x3321,0x1113,0x3211,0x2123,0x3321, //23
0x2133,0x3321,0x1113,0x3211,0x2123,0x3321,0x3233,0x3332,
0x3333,0x3333,0x1333,0x3332,0x1133,0x3211,0x1213,0x3322, //24
0x1123,0x3311,0x1233,0x2112,0x1113,0x3211,0x1223,0x3322,
0x3333,0x3333,0x2133,0x2133,0x1213,0x3212,0x2123,0x3321, //25
0x1233,0x3212,0x2133,0x2121,0x3213,0x3212,0x3323,0x3323,
0x3333,0x3333,0x1133,0x3331,0x2113,0x3212,0x1123,0x3321, //26
0x2113,0x2111,0x3213,0x3213,0x1123,0x2121,0x2233,0x3232,
0x1133,0x3332,0x1133,0x3332,0x1233,0x3332,0x2133,0x3333, //27
0x3233,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3213,0x3333,0x3321,0x1333,0x3332, //28
0x1333,0x3332,0x1333,0x3332,0x2333,0x3331,0x3333,0x3312,
0x3333,0x3333,0x3133,0x3333,0x1233,0x3333,0x2333,0x3321, //29
0x3333,0x3321,0x3333,0x3321,0x1333,0x3332,0x2133,0x3333,
0x3333,0x3333,0x1333,0x3332,0x1213,0x3212,0x1133,0x3321, //2a
0x1233,0x3332,0x1133,0x3321,0x1213,0x3212,0x1323,0x3222,
0x3333,0x3333,0x3333,0x3333,0x1333,0x3332,0x1333,0x3332, //2b
0x1113,0x3211,0x1223,0x3222,0x1333,0x3332,0x2333,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //2c
0x1133,0x3332,0x1133,0x3332,0x1233,0x3332,0x2133,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //2d
0x1113,0x3211,0x2223,0x3222,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //2e
0x3333,0x3333,0x3333,0x3333,0x2133,0x3333,0x2233,0x3333,
0x3333,0x3333,0x3333,0x2133,0x3333,0x3213,0x3333,0x3321, //2f
0x1333,0x3332,0x2133,0x3333,0x3213,0x3333,0x3323,0x3333,
0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //30
0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x1333,0x3321,0x1133,0x3321,0x1233,0x3321, //31
0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3333,0x1113,0x3211,0x2223,0x2112,0x1133,0x3211, //32
0x2113,0x3322,0x2113,0x3333,0x1113,0x2111,0x2223,0x3222,
0x3333,0x3333,0x1113,0x3211,0x2223,0x2112,0x1133,0x3211, //33
0x2233,0x2112,0x3333,0x2113,0x1113,0x3211,0x2223,0x3322,
0x3333,0x3333,0x3333,0x3211,0x1333,0x3211,0x2133,0x3211, //34
0x3213,0x3211,0x1113,0x2111,0x2223,0x3211,0x3333,0x3322,
0x3333,0x3333,0x1113,0x3211,0x2213,0x3322,0x1113,0x3211, //35
0x2223,0x2112,0x3333,0x2113,0x1113,0x3211,0x2223,0x3322,
0x3333,0x3333,0x1133,0x3211,0x2113,0x3322,0x1113,0x3211, //36
0x2113,0x2112,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x1113,0x2111,0x2223,0x2122,0x3333,0x3213, //37
0x3333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3332,
0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x1123,0x3211, //38
0x2113,0x2112,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //39
0x1123,0x2111,0x2233,0x2112,0x1133,0x3211,0x2233,0x3322,
0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, //3a
0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, //3b
0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x2333,0x3321,
0x3333,0x3333,0x3333,0x3321,0x1333,0x3332,0x2133,0x3333, //3c
0x2133,0x3333,0x1233,0x3333,0x2333,0x3321,0x3333,0x3322,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1133,0x3211, //3d
0x2233,0x3222,0x1133,0x3211,0x2233,0x3222,0x3333,0x3333,
0x3333,0x3333,0x1333,0x3333,0x2333,0x3331,0x3333,0x3212, //3e
0x3333,0x3213,0x3333,0x3321,0x1333,0x3332,0x2333,0x3333,
0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //3f
0x3223,0x3211,0x1333,0x3321,0x2333,0x3332,0x1333,0x3321,
0x3333,0x3333,0x1133,0x3321,0x2213,0x3212,0x1213,0x2121, //40
0x2113,0x2121,0x2113,0x2121,0x1213,0x3211,0x1123,0x2121,
0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //41
0x1113,0x2111,0x2113,0x2112,0x2113,0x2113,0x2223,0x2223,
0x3333,0x3333,0x1113,0x3211,0x2113,0x2112,0x1113,0x3211, //42
0x2113,0x2112,0x2113,0x2113,0x1113,0x3211,0x2223,0x3322,
0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2223, //43
0x2113,0x3333,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x1113,0x3211,0x2113,0x2112,0x2113,0x2113, //44
0x2113,0x2113,0x2113,0x2113,0x1113,0x3211,0x2223,0x3322,
0x3333,0x3333,0x1113,0x2111,0x2113,0x2222,0x1113,0x3211, //45
0x2113,0x3222,0x2113,0x3333,0x1113,0x2111,0x2223,0x2222,
0x3333,0x3333,0x1113,0x2111,0x2113,0x2222,0x1113,0x3211, //46
0x2113,0x3222,0x2113,0x3333,0x2113,0x3333,0x2223,0x3333,
0x3333,0x3333,0x1133,0x3211,0x2113,0x3322,0x2113,0x2111, //47
0x2113,0x2112,0x2113,0x2113,0x1123,0x2111,0x2233,0x3222,
0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x1113,0x2111, //48
0x2113,0x2112,0x2113,0x2113,0x2113,0x2113,0x2223,0x2223,
0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x1333,0x3321, //49
0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3333,0x3333,0x2113,0x3333,0x2113,0x3333,0x2113, //4a
0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x2113,0x2113,0x2113,0x3211,0x1113,0x3322, //4b
0x1113,0x3331,0x2113,0x3311,0x2113,0x2112,0x2223,0x2223,
0x3333,0x3333,0x2113,0x3333,0x2113,0x3333,0x2113,0x3333, //4c
0x2113,0x3333,0x2113,0x3333,0x1113,0x2111,0x2223,0x2222,
0x3333,0x3333,0x2133,0x2133,0x1113,0x1112,0x1113,0x1112, //4d
0x1113,0x1111,0x2113,0x1121,0x2113,0x1121,0x3223,0x2232,
0x3333,0x3333,0x2113,0x2113,0x1113,0x2112,0x1113,0x2112, //4e
0x2113,0x2111,0x2113,0x2111,0x2113,0x2112,0x2223,0x2223,
0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //4f
0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x1113,0x3211,0x2113,0x2112,0x1113,0x3211, //50
0x2113,0x3322,0x2113,0x3333,0x2113,0x3333,0x2223,0x3333,
0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //51
0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x2111,
0x3333,0x3333,0x1113,0x3211,0x2113,0x2112,0x1113,0x3211, //52
0x2113,0x2112,0x2113,0x2113,0x2113,0x2113,0x2223,0x2223,
0x3333,0x3333,0x1133,0x2111,0x2113,0x3222,0x1123,0x3331, //53
0x1233,0x3311,0x2333,0x2112,0x1113,0x3211,0x2223,0x3322,
0x3333,0x3333,0x1113,0x2111,0x1223,0x3221,0x1333,0x3321, //54
0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x2113,0x2113, //55
0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x2113,0x2113, //56
0x2113,0x2113,0x2123,0x3213,0x1233,0x3321,0x2333,0x3332,
0x3333,0x3333,0x2113,0x1121,0x2113,0x1121,0x2113,0x1121, //57
0x1113,0x1111,0x1123,0x2112,0x2133,0x2133,0x3233,0x3233,
0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x1123,0x3211, //58
0x1233,0x3211,0x2113,0x2112,0x2113,0x2113,0x3223,0x3223,
0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x2133,0x3213, //59
0x1133,0x3211,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3333,0x1113,0x2111,0x2223,0x2112,0x1333,0x3221, //5a
0x1133,0x3332,0x2113,0x3333,0x1113,0x2111,0x2223,0x2222,
0x3333,0x3333,0x1333,0x3321,0x1333,0x3322,0x1333,0x3332, //5b
0x1333,0x3332,0x1333,0x3332,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3333,0x3313,0x3333,0x3123,0x3333,0x1233,0x3333, //5c
0x2333,0x3331,0x3333,0x3312,0x3333,0x3123,0x3333,0x3233,
0x3333,0x3333,0x1333,0x3321,0x2333,0x3321,0x3333,0x3321, //5d
0x3333,0x3321,0x3333,0x3321,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3333,0x1333,0x3332,0x2133,0x3321,0x3233,0x3322, //5e
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //5f
0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x2222,
0x1333,0x3321,0x1333,0x3321,0x1333,0x3332,0x2333,0x3321, //60
0x3333,0x3332,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2213,0x2112, //61
0x1123,0x2111,0x2113,0x2112,0x1123,0x2111,0x2233,0x2222,
0x2113,0x3333,0x2113,0x3333,0x1113,0x3211,0x2113,0x2112, //62
0x2113,0x2113,0x2113,0x2113,0x1113,0x3211,0x2223,0x3322,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2113,0x2122, //63
0x2113,0x3233,0x2113,0x2133,0x1123,0x3211,0x2233,0x3322,
0x3333,0x2113,0x3333,0x2113,0x1133,0x2111,0x2113,0x2112, //64
0x2113,0x2113,0x2113,0x2113,0x1123,0x2111,0x2233,0x2222,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2113,0x2112, //65
0x1113,0x2111,0x2113,0x3222,0x1123,0x2111,0x2233,0x3222,
0x1333,0x3211,0x1133,0x3322,0x1113,0x3321,0x1123,0x3332, //66
0x1133,0x3332,0x1133,0x3332,0x1133,0x3332,0x2233,0x3333,
0x3333,0x3333,0x3333,0x3333,0x1133,0x2111,0x2113,0x2112, //67
0x2113,0x2113,0x1123,0x2111,0x2213,0x2112,0x1133,0x3211,
0x2113,0x3333,0x2113,0x3333,0x1113,0x3311,0x2113,0x2112, //68
0x2113,0x2113,0x2113,0x2113,0x2113,0x2113,0x2223,0x2223,
0x1333,0x3321,0x2333,0x3332,0x1333,0x3321,0x1333,0x3321, //69
0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3211,0x3333,0x3322,0x3333,0x3211,0x3333,0x3211, //6a
0x3333,0x3211,0x3333,0x3211,0x3213,0x3211,0x1123,0x3321,
0x2113,0x3333,0x2113,0x3213,0x2113,0x3211,0x1113,0x3321, //6b
0x1113,0x3321,0x2113,0x3311,0x2113,0x2112,0x2223,0x3223,
0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x1333,0x3321, //6c
0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322,
0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x1211,0x1121, //6d
0x1211,0x1121,0x1211,0x1121,0x1211,0x1121,0x2322,0x2232,
0x3333,0x3333,0x3333,0x3333,0x1113,0x3211,0x2113,0x2112, //6e
0x2113,0x2113,0x2113,0x2113,0x2113,0x2113,0x2223,0x2223,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2113,0x2112, //6f
0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x3333,0x3333,0x1113,0x3211,0x2113,0x2112, //70
0x2113,0x2113,0x1113,0x3211,0x2113,0x3322,0x2113,0x3333,
0x3333,0x3333,0x3333,0x3333,0x1133,0x2111,0x2113,0x2112, //71
0x2113,0x2113,0x1123,0x2111,0x2233,0x2112,0x3333,0x2113,
0x3333,0x3333,0x3333,0x3333,0x1133,0x2112,0x1133,0x2111, //72
0x1133,0x3222,0x1133,0x3332,0x1133,0x3332,0x2233,0x3332,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x1113,0x3322, //73
0x1133,0x3211,0x2233,0x2111,0x1133,0x3211,0x2233,0x3322,
0x1133,0x3332,0x1113,0x3321,0x1123,0x3332,0x1133,0x3332, //74
0x1133,0x3332,0x1133,0x3332,0x1233,0x3321,0x2333,0x3332,
0x3333,0x3333,0x3333,0x3333,0x2113,0x2113,0x2113,0x2113, //75
0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322,
0x3333,0x3333,0x3333,0x3333,0x2113,0x2113,0x2113,0x2113, //76
0x2113,0x2113,0x2113,0x3213,0x1113,0x3321,0x2223,0x3332,
0x3333,0x3333,0x3333,0x3333,0x1211,0x1121,0x1211,0x1121, //77
0x1211,0x1121,0x1211,0x1121,0x1111,0x2111,0x2222,0x3222,
0x3333,0x3333,0x3333,0x3333,0x2113,0x2113,0x2113,0x2113, //78
0x1123,0x3211,0x2113,0x2112,0x2113,0x2113,0x3223,0x3223,
0x3333,0x3333,0x3333,0x3333,0x2113,0x2113,0x2113,0x2113, //79
0x2113,0x2113,0x1123,0x2111,0x2233,0x2112,0x1133,0x3211,
0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x3211, //7a
0x1333,0x3321,0x1133,0x3332,0x1113,0x2111,0x2223,0x2222,
0x3333,0x3333,0x3333,0x3321,0x1333,0x3332,0x1333,0x3332, //7b
0x2133,0x3333,0x1333,0x3332,0x1333,0x3332,0x3333,0x3321,
0x3333,0x3333,0x1333,0x3332,0x1333,0x3332,0x1333,0x3332, //7c
0x1333,0x3332,0x1333,0x3332,0x1333,0x3332,0x2333,0x3332,
0x3333,0x3333,0x1333,0x3332,0x3333,0x3321,0x3333,0x3321, //7d
0x3333,0x3213,0x3333,0x3321,0x3333,0x3321,0x1333,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3113,0x3333, //7e
0x1221,0x2133,0x2332,0x3211,0x3333,0x3322,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //7f
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x2211,0x2222,0x2211,0x2222,0x2211,0x2222,0x2211,0x2222, //80
0x2211,0x2222,0x2211,0x2222,0x2211,0x2222,0x2211,0x2222,
0x1111,0x2222,0x1111,0x2222,0x1111,0x2222,0x1111,0x2222, //81
0x1111,0x2222,0x1111,0x2222,0x1111,0x2222,0x1111,0x2222,
0x1111,0x2211,0x1111,0x2211,0x1111,0x2211,0x1111,0x2211, //82
0x1111,0x2211,0x1111,0x2211,0x1111,0x2211,0x1111,0x2211,
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111, //83
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,
0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222, //84
0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,
0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331, //85
0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,
0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331, //86
0x1111,0x1111,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //87
0x1111,0x1111,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x3333,0x2213, //88
0x3333,0x1213,0x3333,0x1213,0x3333,0x1213,0x3333,0x1213,
0x3333,0x3333,0x3333,0x3333,0x1111,0x1111,0x2222,0x2222, //89
0x1111,0x1111,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x1111,0x1111,0x2222,0x2222, //8a
0x1111,0x1111,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,
0x3333,0x1213,0x3333,0x1213,0x3333,0x1213,0x3333,0x1213, //8b
0x3333,0x1213,0x3333,0x1213,0x3333,0x1213,0x3333,0x1213,
0x3133,0x3333,0x1133,0x3333,0x1133,0x3331,0x1133,0x3311, //8c
0x1133,0x3321,0x1133,0x3332,0x2133,0x3333,0x3233,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x3332, //8d
0x2123,0x3213,0x1133,0x3321,0x1213,0x3212,0x2113,0x3321,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //8e
0x3333,0x3321,0x3213,0x3213,0x3213,0x3213,0x2133,0x3323,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1333,0x3332, //8f
0x1133,0x3332,0x2213,0x3321,0x3323,0x3321,0x1133,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x2133,0x3333, //90
0x1113,0x3321,0x1223,0x3332,0x2133,0x3333,0x1213,0x3321,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x3312, //91
0x2123,0x3323,0x1113,0x3321,0x2113,0x3213,0x2113,0x3321,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3213,0x3321, //92
0x1123,0x3211,0x2113,0x3212,0x1223,0x3322,0x1333,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1333,0x3332, //93
0x1213,0x3321,0x1113,0x3212,0x1213,0x3211,0x1323,0x3322,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1333,0x3332, //94
0x1333,0x3321,0x1133,0x3332,0x1213,0x3321,0x1123,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //95
0x1333,0x3321,0x2113,0x3212,0x3223,0x3213,0x1333,0x3321,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //96
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //97
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //98
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //99
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9a
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9b
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9c
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9d
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9e
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9f
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a0
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a1
0x3333,0x3333,0x1133,0x3321,0x2133,0x3321,0x1133,0x3321,
0x3333,0x3333,0x1333,0x3211,0x1333,0x3322,0x1333,0x3332, //a2
0x1333,0x3332,0x2333,0x3332,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3321, //a3
0x3333,0x3321,0x3333,0x3321,0x1133,0x3321,0x2233,0x3322,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a4
0x3333,0x3333,0x3333,0x3333,0x2133,0x3333,0x1333,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a5
0x1333,0x3332,0x2333,0x3332,0x3333,0x3333,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x2122, //a6
0x1113,0x2111,0x2223,0x2122,0x3333,0x3213,0x1113,0x3321,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x3321, //a7
0x2223,0x3321,0x2133,0x3321,0x2133,0x3332,0x3213,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3321, //a8
0x1133,0x3332,0x2111,0x3333,0x2122,0x3333,0x2133,0x3333,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1333,0x3332, //a9
0x1113,0x3211,0x2213,0x3212,0x3323,0x3321,0x1133,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //aa
0x1133,0x3321,0x1233,0x3332,0x1333,0x3332,0x1113,0x3211,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3321, //ab
0x1113,0x3211,0x2223,0x3321,0x1333,0x3321,0x2113,0x3321,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1213,0x3211, //ac
0x2111,0x3212,0x2122,0x3323,0x1333,0x3332,0x1333,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //ad
0x1113,0x3321,0x2223,0x3321,0x3333,0x3321,0x1113,0x3211,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1133,0x3211, //ae
0x2233,0x3212,0x1133,0x3211,0x2233,0x3212,0x1133,0x3211,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //af
0x1213,0x3212,0x2323,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //b0
0x3333,0x3333,0x1113,0x3211,0x2223,0x3322,0x3333,0x3333,
0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2222,0x3212, //b1
0x2133,0x3213,0x2133,0x3321,0x2133,0x3332,0x3211,0x3333,
0x3333,0x3333,0x3333,0x2133,0x3333,0x3213,0x1333,0x3321, //b2
0x2113,0x3321,0x3223,0x3321,0x3333,0x3321,0x3333,0x3321,
0x3333,0x3333,0x1333,0x3332,0x1113,0x2111,0x2213,0x2122, //b3
0x3323,0x2133,0x3333,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3333,0x3333,0x3333,0x1113,0x3211,0x1223,0x3322, //b4
0x1333,0x3332,0x1333,0x3332,0x1333,0x3332,0x1111,0x2111,
0x3333,0x3333,0x3333,0x3213,0x1113,0x2111,0x2223,0x3212, //b5
0x3333,0x3211,0x1333,0x3212,0x1333,0x3212,0x2113,0x3213,
0x3333,0x3333,0x1333,0x3332,0x1113,0x2111,0x1223,0x2122, //b6
0x1333,0x2132,0x2133,0x2133,0x2133,0x2133,0x3213,0x3213,
0x3333,0x3333,0x1333,0x3332,0x1113,0x2111,0x2223,0x3221, //b7
0x3333,0x3321,0x1113,0x1111,0x2223,0x2212,0x3333,0x3213,
0x3333,0x3333,0x1133,0x2111,0x2133,0x2122,0x3213,0x2133, //b8
0x3323,0x3213,0x3333,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3333,0x3213,0x3333,0x1113,0x2111,0x2213,0x3212, //b9
0x3321,0x3213,0x3332,0x3321,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x2122, //ba
0x3333,0x2133,0x3333,0x2133,0x3333,0x2133,0x1113,0x2111,
0x3333,0x3333,0x3213,0x3213,0x1111,0x2111,0x2212,0x3212, //bb
0x3213,0x3213,0x3323,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3333,0x3333,0x3333,0x2113,0x2133,0x3223,0x2133, //bc
0x2113,0x2133,0x3223,0x2133,0x3333,0x3213,0x1113,0x3321,
0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x3212, //bd
0x3333,0x3321,0x3333,0x3321,0x1333,0x3212,0x2113,0x2133,
0x3333,0x3333,0x2133,0x3333,0x1133,0x2111,0x2111,0x2122, //be
0x2122,0x3213,0x2133,0x3323,0x2133,0x3333,0x1133,0x2111,
0x3333,0x3333,0x3333,0x3333,0x3213,0x2133,0x3213,0x2133, //bf
0x2123,0x3213,0x3233,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3333,0x1133,0x2111,0x2133,0x2122,0x2133,0x2133, //c0
0x1213,0x2111,0x2323,0x2122,0x3333,0x3213,0x1133,0x3321,
0x3333,0x3333,0x3333,0x3213,0x1113,0x3321,0x2223,0x3321, //c1
0x1111,0x2111,0x2222,0x3221,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3333,0x3333,0x3333,0x1213,0x2132,0x1213,0x2132, //c2
0x2323,0x2133,0x3333,0x2133,0x3333,0x3213,0x1113,0x3321,
0x3333,0x3333,0x1113,0x3211,0x2223,0x3322,0x1111,0x2111, //c3
0x2222,0x3221,0x3333,0x3321,0x1333,0x3332,0x2113,0x3333,
0x3333,0x3333,0x2133,0x3333,0x2133,0x3333,0x2133,0x3333, //c4
0x1133,0x3332,0x2133,0x3211,0x2133,0x3322,0x2133,0x3333,
0x3333,0x3333,0x3333,0x3321,0x1111,0x2111,0x2222,0x3221, //c5
0x3333,0x3321,0x3333,0x3321,0x1333,0x3332,0x2113,0x3333,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2233,0x3322, //c6
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,
0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2222,0x3212, //c7
0x3133,0x3321,0x1233,0x3332,0x2133,0x3321,0x3211,0x3213,
0x3333,0x3333,0x1333,0x3332,0x1111,0x2111,0x2222,0x3212, //c8
0x3333,0x3321,0x1133,0x3212,0x1211,0x2132,0x1322,0x3232,
0x3333,0x3333,0x3333,0x3213,0x3333,0x3213,0x3333,0x3213, //c9
0x3333,0x3321,0x3333,0x3321,0x1333,0x3332,0x2113,0x3333,
0x3333,0x3333,0x1333,0x3332,0x3333,0x3321,0x3213,0x3213, //ca
0x3213,0x3213,0x3321,0x2133,0x3321,0x2133,0x3321,0x2133,
0x3333,0x3333,0x3213,0x2133,0x3213,0x3211,0x1113,0x3322, //cb
0x2213,0x3333,0x3213,0x3333,0x3213,0x3333,0x1133,0x2111,
0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2222,0x2122, //cc
0x3333,0x3213,0x3333,0x3213,0x3333,0x3321,0x1113,0x3332,
0x3333,0x3333,0x3333,0x3333,0x2133,0x3333,0x1213,0x3332, //cd
0x3321,0x3321,0x3332,0x3213,0x3333,0x2133,0x3333,0x3233,
0x3333,0x3333,0x1333,0x3332,0x1111,0x2111,0x1222,0x3222, //ce
0x1213,0x3212,0x1213,0x2132,0x1321,0x2132,0x1321,0x2132,
0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2222,0x2122, //cf
0x3213,0x3213,0x2133,0x3321,0x1333,0x3332,0x3333,0x3321,
0x3333,0x3333,0x3113,0x3333,0x1223,0x3311,0x2333,0x2122, //d0
0x1133,0x3231,0x2233,0x3212,0x1113,0x3322,0x2223,0x2111,
0x3333,0x3333,0x1333,0x3332,0x2133,0x3333,0x3213,0x3333, //d1
0x3213,0x3213,0x3321,0x2133,0x3321,0x2133,0x1111,0x2111,
0x3333,0x3333,0x3333,0x3213,0x3213,0x3213,0x2133,0x3321, //d2
0x1333,0x3332,0x1333,0x3332,0x2133,0x3321,0x3211,0x3213,
0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2122,0x3222, //d3
0x1111,0x2111,0x2122,0x3222,0x2133,0x3333,0x1133,0x2111,
0x3333,0x3333,0x2133,0x3333,0x1133,0x2111,0x2111,0x2122, //d4
0x2122,0x3213,0x2133,0x3323,0x1333,0x3332,0x1333,0x3332,
0x3333,0x3333,0x3333,0x3333,0x1113,0x3321,0x2223,0x3321, //d5
0x3333,0x3321,0x3333,0x3321,0x3333,0x3321,0x1111,0x2111,
0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x2122, //d6
0x1113,0x2111,0x2223,0x2122,0x3333,0x2133,0x1113,0x2111,
0x3333,0x3333,0x1113,0x3211,0x2223,0x3322,0x1111,0x2111, //d7
0x2222,0x2122,0x3333,0x2133,0x3333,0x3213,0x1113,0x3321,
0x3333,0x3333,0x3213,0x3213,0x3213,0x3213,0x3213,0x3213, //d8
0x3213,0x3213,0x3323,0x3213,0x3333,0x3321,0x1113,0x3332,
0x3333,0x3333,0x1333,0x3332,0x1213,0x3332,0x1213,0x3332, //d9
0x1213,0x2132,0x1213,0x2132,0x1213,0x3212,0x1321,0x3321,
0x3333,0x3333,0x3213,0x3333,0x3213,0x3333,0x3213,0x3333, //da
0x3213,0x3213,0x3213,0x3213,0x3213,0x3321,0x1113,0x3332,
0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2213,0x2122, //db
0x3213,0x2133,0x3213,0x2133,0x3213,0x2133,0x1113,0x2111,
0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2213,0x2122, //dc
0x3323,0x2133,0x3333,0x2133,0x3333,0x3213,0x1133,0x3321,
0x3333,0x3333,0x3333,0x3333,0x1113,0x2132,0x2223,0x2133, //dd
0x3333,0x2133,0x3333,0x2133,0x3333,0x3213,0x1113,0x3321,
0x3333,0x1313,0x1333,0x2322,0x1113,0x2111,0x1223,0x2122, //de
0x1333,0x2132,0x2133,0x2133,0x2133,0x2133,0x3213,0x3213,
0x3333,0x1313,0x1333,0x2322,0x1113,0x2111,0x2223,0x3221, //df
0x3333,0x3321,0x1113,0x1111,0x2223,0x2212,0x3333,0x3213,
0x3333,0x1213,0x3333,0x2323,0x1133,0x2111,0x2133,0x2122, //e0
0x3213,0x3213,0x3323,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x1313,0x3213,0x2323,0x1113,0x2111,0x2213,0x3212, //e1
0x3321,0x3213,0x3332,0x3321,0x3333,0x3321,0x1133,0x3332,
0x3333,0x1313,0x3333,0x2323,0x1113,0x2111,0x2223,0x2122, //e2
0x3333,0x2133,0x3333,0x2133,0x3333,0x2133,0x1113,0x2111,
0x3333,0x1313,0x3333,0x2323,0x3213,0x3213,0x1111,0x2111, //e3
0x2212,0x3212,0x3213,0x3213,0x3323,0x3321,0x1133,0x3332,
0x3333,0x1313,0x3333,0x2323,0x2113,0x2133,0x3223,0x2133, //e4
0x2113,0x2133,0x3223,0x2133,0x3333,0x3213,0x1113,0x3321,
0x3333,0x1313,0x3333,0x2323,0x1113,0x2111,0x2223,0x3212, //e5
0x3333,0x3321,0x3333,0x3321,0x1333,0x3212,0x2113,0x2133,
0x3333,0x1313,0x2133,0x2323,0x1133,0x2111,0x2111,0x2122, //e6
0x2122,0x3213,0x2133,0x3323,0x2133,0x3333,0x1133,0x2111,
0x3333,0x1313,0x3333,0x2323,0x3213,0x2133,0x3213,0x2133, //e7
0x2123,0x3213,0x3233,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x1313,0x3333,0x2323,0x1133,0x2111,0x2133,0x2122, //e8
0x1213,0x2111,0x2323,0x2122,0x3333,0x3213,0x1133,0x3321,
0x3333,0x1313,0x3333,0x2323,0x1113,0x3211,0x2223,0x3321, //e9
0x1111,0x2111,0x2222,0x3221,0x3333,0x3321,0x1133,0x3332,
0x3333,0x1313,0x3333,0x2323,0x1213,0x2132,0x1213,0x2132, //ea
0x2323,0x2133,0x3333,0x2133,0x3333,0x3213,0x1113,0x3321,
0x3333,0x1313,0x3333,0x2323,0x1113,0x3211,0x2223,0x3322, //eb
0x1111,0x2111,0x2222,0x3221,0x3333,0x3321,0x1113,0x3332,
0x3333,0x3333,0x2133,0x1313,0x2133,0x2323,0x2133,0x3333, //ec
0x1133,0x3333,0x2133,0x3211,0x2133,0x3322,0x2133,0x3333,
0x3333,0x1313,0x1333,0x2323,0x3333,0x3331,0x3213,0x3213, //ed
0x3213,0x3213,0x3321,0x2133,0x3321,0x2133,0x3321,0x2133,
0x3333,0x1313,0x3213,0x2323,0x3213,0x2111,0x1113,0x3222, //ee
0x2213,0x3333,0x3213,0x3333,0x3213,0x3333,0x1123,0x2111,
0x3333,0x1313,0x3333,0x2323,0x1111,0x2111,0x2222,0x2122, //ef
0x3333,0x3213,0x3333,0x3213,0x3333,0x3321,0x1113,0x3332,
0x3333,0x3333,0x3333,0x1313,0x2133,0x2323,0x1213,0x3332, //f0
0x3321,0x3321,0x3332,0x3213,0x3333,0x2133,0x3333,0x3233,
0x3333,0x1313,0x1333,0x2323,0x1111,0x2111,0x1222,0x3222, //f1
0x1213,0x3212,0x1213,0x2132,0x1321,0x2132,0x1321,0x2132,
0x3333,0x1313,0x1333,0x2322,0x1113,0x2111,0x2213,0x2122, //f2
0x3323,0x2133,0x3333,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3133,0x1333,0x1212,0x3333,0x2121,0x3213,0x3213, //f3
0x3213,0x3213,0x3321,0x2133,0x3321,0x2133,0x3321,0x2133,
0x3333,0x3133,0x3213,0x1213,0x3213,0x2111,0x1113,0x3222, //f4
0x2213,0x3333,0x3213,0x3333,0x3213,0x3333,0x1133,0x2111,
0x3333,0x3133,0x3333,0x1213,0x1111,0x2111,0x2222,0x2122, //f5
0x3333,0x3213,0x3333,0x3213,0x3333,0x3321,0x1113,0x3332,
0x3333,0x3133,0x3333,0x1213,0x2133,0x2123,0x1213,0x3232, //f6
0x3321,0x3321,0x3332,0x3213,0x3333,0x2133,0x3333,0x3233,
0x3333,0x3133,0x1333,0x1212,0x1111,0x2111,0x1222,0x3222, //f7
0x1213,0x3212,0x1213,0x2132,0x1321,0x2132,0x1321,0x2132,
0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2123,0x3322, //f8
0x1113,0x2113,0x1223,0x3221,0x2133,0x3332,0x1133,0x2111,
0x3333,0x3333,0x1333,0x3332,0x1113,0x3321,0x2123,0x2132, //f9
0x1113,0x3211,0x2121,0x2121,0x1321,0x2132,0x2113,0x3213,
0x3333,0x3333,0x3213,0x3333,0x3213,0x3213,0x3213,0x2133, //fa
0x3213,0x2133,0x3213,0x2133,0x1213,0x3232,0x2133,0x3333,
0x3333,0x3333,0x1133,0x3321,0x2233,0x3332,0x1333,0x3211, //fb
0x2113,0x2122,0x3223,0x2133,0x3333,0x3213,0x1133,0x3321,
0x3333,0x3333,0x1133,0x3321,0x2233,0x3332,0x1113,0x3211, //fc
0x2223,0x3321,0x1333,0x3332,0x2133,0x3321,0x3213,0x2113,
0x3333,0x3333,0x2133,0x2133,0x1133,0x2121,0x2113,0x3232, //fd
0x1123,0x3211,0x2113,0x2122,0x2121,0x2133,0x2113,0x3213,
0x3333,0x3333,0x3333,0x3321,0x2133,0x3213,0x1111,0x2132, //fe
0x2122,0x2121,0x3213,0x3321,0x3321,0x3321,0x1132,0x3332,
0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2223,0x3321, //ff
0x1133,0x2111,0x2233,0x3212,0x3313,0x3323,0x1133,0x3211,
0x3333,0x3333,0x3333,0x3213,0x3333,0x3321,0x1333,0x3332, //100
0x2133,0x3333,0x1333,0x3332,0x3333,0x3321,0x3333,0x3213,
0x3333,0x3333,0x3333,0x3213,0x1213,0x2111,0x2213,0x3212, //101
0x3213,0x3213,0x3213,0x3213,0x2133,0x3213,0x3233,0x3321,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2233,0x2122, //102
0x3333,0x3213,0x3333,0x3323,0x3213,0x3333,0x1133,0x2111,
0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2223,0x3321, //103
0x3333,0x3212,0x3333,0x3213,0x3213,0x3333,0x1123,0x3211,
0x3333,0x3333,0x3333,0x3333,0x3213,0x3333,0x3213,0x3333, //104
0x3213,0x3333,0x3213,0x3333,0x3213,0x3213,0x1123,0x3321,
0x3333,0x3333,0x3333,0x3321,0x1113,0x2111,0x2223,0x3221, //105
0x1133,0x3321,0x2133,0x3321,0x1333,0x3321,0x1113,0x3332,
0x3333,0x3333,0x3333,0x3333,0x3213,0x3321,0x1113,0x2111, //106
0x3211,0x3321,0x3212,0x3321,0x3213,0x2133,0x1133,0x3211,
0x3333,0x3333,0x2133,0x2133,0x2133,0x2133,0x3233,0x3213, //107
0x1113,0x2111,0x1223,0x3222,0x2133,0x3333,0x1333,0x2111,
0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2123,0x3322, //108
0x3213,0x2111,0x3213,0x3222,0x1213,0x3332,0x3321,0x2111,
0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2123,0x3322, //109
0x1213,0x3311,0x2113,0x2122,0x3223,0x2133,0x1333,0x3211,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2211,0x2122, //10a
0x3322,0x2133,0x3333,0x2133,0x3333,0x3213,0x1133,0x3321,
0x3333,0x3333,0x3333,0x2113,0x1133,0x3211,0x2211,0x3321, //10b
0x1322,0x3332,0x1333,0x3332,0x3333,0x3321,0x3333,0x2113,
0x3333,0x3333,0x3213,0x3333,0x3213,0x2133,0x2133,0x3211, //10c
0x1133,0x3322,0x2213,0x3333,0x3213,0x3333,0x1133,0x2111,
0x3333,0x3333,0x2133,0x3333,0x1111,0x2112,0x2212,0x3223, //10d
0x3213,0x3213,0x1321,0x3211,0x2132,0x2112,0x1333,0x3221,
0x3333,0x3333,0x3333,0x3333,0x1213,0x2111,0x2213,0x3222, //10e
0x3213,0x3333,0x3213,0x3333,0x3213,0x3321,0x2133,0x2113,
0x3333,0x3333,0x3333,0x3321,0x3213,0x3321,0x1213,0x3211, //10f
0x2113,0x2121,0x1121,0x2112,0x2121,0x2121,0x3213,0x3211,
0x3333,0x3333,0x3333,0x3333,0x3213,0x3211,0x1211,0x2122, //110
0x2112,0x2133,0x3213,0x2111,0x3211,0x2121,0x3212,0x3211,
0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2113,0x2122, //111
0x2121,0x2133,0x2121,0x2133,0x2121,0x2133,0x3213,0x3213,
0x3333,0x3333,0x3333,0x3213,0x1121,0x2111,0x2221,0x3212, //112
0x3321,0x3213,0x1321,0x3211,0x2121,0x2112,0x1332,0x3221,
0x3333,0x3333,0x2133,0x3333,0x2111,0x3213,0x3212,0x2113, //113
0x3321,0x3213,0x3321,0x3213,0x3321,0x3321,0x1113,0x3332,
0x3333,0x3333,0x1133,0x3333,0x2233,0x3321,0x3333,0x3332, //114
0x1213,0x3332,0x3321,0x2121,0x3321,0x2121,0x1132,0x3232,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1133,0x3332, //115
0x2213,0x3321,0x3321,0x3213,0x3332,0x2133,0x3333,0x2233,
0x3333,0x3333,0x1321,0x2111,0x2321,0x3212,0x1321,0x2111, //116
0x2321,0x3212,0x1321,0x3211,0x2121,0x2112,0x1213,0x3221,
0x3333,0x3333,0x1113,0x3211,0x2223,0x3321,0x1113,0x3211, //117
0x2223,0x3321,0x1113,0x3321,0x2221,0x3211,0x1113,0x3322,
0x3333,0x3333,0x1113,0x3321,0x1223,0x3332,0x2133,0x3213, //118
0x1113,0x3211,0x2121,0x2112,0x3211,0x3213,0x3322,0x3321,
0x3333,0x3333,0x2133,0x3333,0x1111,0x3212,0x2122,0x2133, //119
0x2113,0x3333,0x2121,0x2133,0x3213,0x2133,0x1133,0x3211,
0x3333,0x3333,0x3333,0x3321,0x1213,0x3211,0x2113,0x2121, //11a
0x1211,0x2132,0x1121,0x2132,0x2121,0x2133,0x3213,0x3213,
0x3333,0x3333,0x1333,0x3332,0x1113,0x3321,0x2123,0x3332, //11b
0x1113,0x3321,0x2123,0x2132,0x2133,0x2133,0x1333,0x3211,
0x3333,0x3333,0x3333,0x3321,0x1213,0x3211,0x2113,0x2121, //11c
0x3211,0x2132,0x2122,0x3213,0x2133,0x3323,0x1333,0x3332,
0x3333,0x3333,0x1333,0x3332,0x1321,0x3211,0x1121,0x2122, //11d
0x1211,0x2132,0x1321,0x2132,0x1332,0x3212,0x2133,0x3323,
0x3333,0x3333,0x1333,0x3332,0x1333,0x3211,0x1333,0x3322, //11e
0x1333,0x3332,0x1113,0x3321,0x1221,0x3212,0x2113,0x3323,
0x3333,0x3333,0x1133,0x3321,0x2233,0x3332,0x2133,0x3211, //11f
0x1213,0x2122,0x2113,0x2133,0x3223,0x2133,0x1333,0x3211,
0x3333,0x3333,0x2133,0x3333,0x3213,0x3213,0x3213,0x3213, //120
0x2113,0x3213,0x3223,0x3213,0x3333,0x3321,0x1133,0x3332,
0x3333,0x3333,0x1113,0x3211,0x2223,0x3321,0x1333,0x3211, //121
0x2113,0x2122,0x1221,0x2121,0x2132,0x2121,0x1333,0x3211,
0x3333,0x3333,0x3333,0x3211,0x1213,0x3212,0x1211,0x3212, //122
0x2112,0x3213,0x3213,0x3213,0x3211,0x3213,0x3212,0x2133,
0x3333,0x3333,0x1333,0x3211,0x2113,0x3321,0x1223,0x3332, //123
0x1133,0x3211,0x2211,0x2122,0x3322,0x2133,0x1333,0x3211,
0x3333,0x3333,0x3333,0x3333,0x3213,0x3311,0x1211,0x2122, //124
0x2112,0x2133,0x3213,0x2133,0x3211,0x2133,0x3212,0x3211,
0x3333,0x3333,0x3333,0x3333,0x1333,0x3332,0x1333,0x3332, //125
0x2133,0x3333,0x1133,0x3332,0x1213,0x2132,0x3321,0x3211,
0x3333,0x1313,0x3333,0x2323,0x2133,0x3213,0x1111,0x2132, //126
0x2122,0x2121,0x3213,0x3221,0x3321,0x3321,0x1132,0x3332,
0x3333,0x1313,0x1333,0x2322,0x1113,0x3211,0x2223,0x3321, //127
0x1133,0x2111,0x2233,0x3212,0x3313,0x3323,0x1123,0x3211,
0x3333,0x1313,0x3333,0x2323,0x3333,0x3321,0x1333,0x3332, //128
0x2133,0x3333,0x1233,0x3333,0x2333,0x3331,0x3333,0x3312,
0x3333,0x1313,0x3333,0x2323,0x1213,0x2111,0x3213,0x3213, //129
0x3213,0x3213,0x3213,0x3213,0x2123,0x3213,0x3233,0x3321,
0x3333,0x1313,0x3333,0x2323,0x1133,0x3211,0x2233,0x2122, //12a
0x3333,0x3213,0x3333,0x3323,0x3213,0x3333,0x1123,0x3111,
0x3333,0x1313,0x1333,0x2322,0x1113,0x3211,0x2223,0x3321, //12b
0x3333,0x3212,0x3333,0x3213,0x3213,0x3323,0x1123,0x3211,
0x3333,0x3333,0x3333,0x3131,0x3213,0x3232,0x3213,0x3333, //12c
0x3213,0x3333,0x3213,0x3333,0x3213,0x3213,0x1133,0x3321,
0x3333,0x1313,0x3333,0x2321,0x1113,0x2111,0x2223,0x3321, //12d
0x1133,0x3321,0x2133,0x3321,0x1333,0x3321,0x1113,0x3332,
0x3333,0x1313,0x3333,0x2323,0x3213,0x3321,0x1113,0x2111, //12e
0x2211,0x3221,0x3212,0x3321,0x3213,0x2132,0x1133,0x3211,
0x3333,0x1313,0x2133,0x2323,0x2133,0x2133,0x3233,0x3213, //12f
0x1113,0x3111,0x1223,0x3222,0x2133,0x3333,0x1233,0x2111,
0x3333,0x1313,0x1333,0x2322,0x1113,0x3211,0x2123,0x3322, //130
0x3213,0x2111,0x3213,0x3222,0x1213,0x3332,0x2321,0x2111,
0x3333,0x1313,0x1333,0x2322,0x1113,0x3211,0x2123,0x3322, //131
0x1213,0x3211,0x2113,0x2122,0x3223,0x2133,0x1333,0x3211,
0x3333,0x1313,0x3333,0x2323,0x1133,0x3211,0x2211,0x2122, //132
0x3322,0x2133,0x3333,0x2133,0x3333,0x3213,0x1133,0x3321,
0x3333,0x1313,0x3333,0x2323,0x1133,0x2111,0x2211,0x3221, //133
0x1322,0x3332,0x1333,0x3332,0x3333,0x3321,0x3333,0x2113,
0x3333,0x1313,0x3213,0x2323,0x3213,0x2133,0x2133,0x3211, //134
0x1133,0x3322,0x2213,0x3333,0x3213,0x3333,0x1133,0x2111,
0x3333,0x1313,0x3333,0x2323,0x1121,0x2111,0x2221,0x3212, //135
0x3321,0x3213,0x1321,0x3211,0x2121,0x2112,0x1332,0x3221,
0x3333,0x1313,0x2133,0x2323,0x2111,0x3213,0x3212,0x2113, //136
0x3321,0x3213,0x3321,0x3213,0x3321,0x3321,0x1113,0x3332,
0x3333,0x1313,0x1133,0x2323,0x2233,0x3321,0x3333,0x3332, //137
0x1213,0x3332,0x2321,0x2121,0x3321,0x2121,0x1132,0x3232,
0x3333,0x3333,0x3333,0x3131,0x3333,0x3232,0x1133,0x3332, //138
0x2213,0x3321,0x3321,0x3213,0x3332,0x2133,0x3333,0x3233,
0x3333,0x1313,0x1321,0x2321,0x2321,0x3212,0x1321,0x2111, //139
0x2321,0x3212,0x1321,0x3211,0x2121,0x2112,0x1213,0x3221,
0x3333,0x3133,0x3333,0x1213,0x1121,0x2111,0x2221,0x3212, //13a
0x3321,0x3213,0x1321,0x3211,0x2121,0x2112,0x1332,0x3221,
0x3333,0x3133,0x2133,0x1213,0x2111,0x2123,0x3213,0x1113, //13b
0x3321,0x2213,0x3321,0x3213,0x3321,0x3321,0x1113,0x3332,
0x3333,0x3133,0x1133,0x1213,0x2233,0x2121,0x3333,0x3232, //13c
0x1213,0x3332,0x3321,0x2121,0x3321,0x2121,0x1132,0x3232,
0x3333,0x3313,0x3333,0x2121,0x3333,0x3212,0x1133,0x3322, //13d
0x2213,0x3321,0x3321,0x3213,0x3332,0x2133,0x3333,0x3233,
0x3333,0x3133,0x1321,0x1211,0x2321,0x2112,0x1321,0x2111, //13e
0x2321,0x3212,0x1321,0x3211,0x2121,0x2112,0x1213,0x3221,
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //13f
0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,
};
*/

View File

@ -1,335 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: myFontequ.h
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef __MY_FONT_H__
#define __MY_FONT_H__
// 文字コードの定義
#define EOM_ 0x00 // 終了コード
// オーナー情報編集用ボタン----------------------
#define CODE_BUTTON_TOP_ 0x200
#define VAR_BUTTON1_ CODE_BUTTON_TOP_
#define VAR_BUTTON2_ (CODE_BUTTON_TOP_ + 1)
#define DEL_BUTTON_ (CODE_BUTTON_TOP_ + 2)
#define CANCEL_BUTTON_ (CODE_BUTTON_TOP_ + 3)
#define OK_BUTTON_ (CODE_BUTTON_TOP_ + 4)
#define CODE_BUTTON_BOTTOM_ (CODE_BUTTON_TOP_ + 5)
/*
// ひらがな----------------------------------------
#define a_ 0x0f9 // "あ"
#define i_ 0x0fa // "い"
#define u_ 0x0fb // "う"
#define e_ 0x0fc // "え"
#define o_ 0x0fd // "お"
#define ka_ 0x0fe // "か"
#define ki_ 0x0ff // "き"
#define ku_ 0x100 // "く"
#define ke_ 0x101 // "け"
#define ko_ 0x102 // "こ"
#define sa_ 0x103 // "さ"
#define si_ 0x104 // "し"
#define su_ 0x105 // "す"
#define se_ 0x106 // "せ"
#define so_ 0x107 // "そ"
#define ta_ 0x108 // "た"
#define ti_ 0x109 // "ち"
#define tu_ 0x10a // "つ"
#define te_ 0x10b // "て"
#define to_ 0x10c // "と"
#define na_ 0x10d // "な"
#define ni_ 0x10e // "に"
#define nu_ 0x10f // "ぬ"
#define ne_ 0x110 // "ね"
#define no_ 0x111 // "の"
#define ha_ 0x112 // "は"
#define hi_ 0x113 // "ひ"
#define hu_ 0x114 // "ふ"
#define he_ 0x115 // "へ"
#define ho_ 0x116 // "ほ"
#define ma_ 0x117 // "ま"
#define mi_ 0x118 // "み"
#define mu_ 0x119 // "む"
#define me_ 0x11a // "め"
#define mo_ 0x11b // "も"
#define ya_ 0x11c // "や"
#define yu_ 0x11d // "ゆ"
#define yo_ 0x11e // "よ"
#define ra_ 0x11f // "ら"
#define ri_ 0x120 // "り"
#define ru_ 0x121 // "る"
#define re_ 0x122 // "れ"
#define ro_ 0x123 // "ろ"
#define wa_ 0x124 // "わ"
#define wo_ 0x0f8 // "を"
#define n_ 0x125 // "ん"
#define ga_ 0x126 // "が"
#define gi_ 0x127 // "ぎ"
#define gu_ 0x128 // "ぐ"
#define ge_ 0x129 // "げ"
#define go_ 0x12a // "ご"
#define za_ 0x12b // "ざ"
#define zi_ 0x12c // "じ"
#define zu_ 0x12d // "ず"
#define ze_ 0x12e // "ぜ"
#define zo_ 0x12f // "ぞ"
#define da_ 0x130 // "だ"
#define di_ 0x131 // "ぢ"
#define du_ 0x132 // "づ"
#define de_ 0x133 // "で"
#define do_ 0x134 // "ど"
#define ba_ 0x135 // "ば"
#define bi_ 0x136 // "び"
#define bu_ 0x137 // "ぶ"
#define be_ 0x138 // "べ"
#define bo_ 0x139 // "ぼ"
#define pa_ 0x13a // "ぱ"
#define pi_ 0x13b // "ぴ"
#define pu_ 0x13c // "ぷ"
#define pe_ 0x13d // "ぺ"
#define po_ 0x13e // "ぽ"
#define aa_ 0x08d // "ぁ"
#define ii_ 0x08e // "ぃ"
#define uu_ 0x08f // "ぅ"
#define ee_ 0x090 // "ぇ"
#define oo_ 0x091 // "ぉ"
#define yya_ 0x092 // "ゃ"
#define yyu_ 0x093 // "ゅ"
#define yyo_ 0x094 // "ょ"
#define ttu_ 0x095 // "っ"
// カタカナ----------------------------------------
#define A_ 0x0b1 // "ア"
#define I_ 0x0b2 // "イ"
#define U_ 0x0b3 // "ウ"
#define E_ 0x0b4 // "エ"
#define O_ 0x0b5 // "オ"
#define KA_ 0x0b6 // "カ"
#define KI_ 0x0b7 // "キ"
#define KU_ 0x0b8 // "ク"
#define KE_ 0x0b9 // "ケ"
#define KO_ 0x0ba // "コ"
#define SA_ 0x0bb // "サ"
#define SI_ 0x0bc // "シ"
#define SU_ 0x0bd // "ス"
#define SE_ 0x0be // "セ"
#define SO_ 0x0bf // "ソ"
#define TA_ 0x0c0 // "タ"
#define TI_ 0x0c1 // "チ"
#define TU_ 0x0c2 // "ツ"
#define TE_ 0x0c3 // "テ"
#define TO_ 0x0c4 // "ト"
#define NA_ 0x0c5 // "ナ"
#define NI_ 0x0c6 // "ニ"
#define NU_ 0x0c7 // "ヌ"
#define NE_ 0x0c8 // "ネ"
#define NO_ 0x0c9 // ""
#define HA_ 0x0ca // "ハ"
#define HI_ 0x0cb // "ヒ"
#define HU_ 0x0cc // "フ"
#define HE_ 0x0cd // "ヘ"
#define HO_ 0x0ce // "ホ"
#define MA_ 0x0cf // "マ"
#define MI_ 0x0d0 // "ミ"
#define MU_ 0x0d1 // "ム"
#define ME_ 0x0d2 // "メ"
#define MO_ 0x0d3 // "モ"
#define YA_ 0x0d4 // "ヤ"
#define YU_ 0x0d5 // "ユ"
#define YO_ 0x0d6 // "ヨ"
#define RA_ 0x0d7 // "ラ"
#define RI_ 0x0d8 // "リ"
#define RU_ 0x0d9 // "ル"
#define RE_ 0x0da // "レ"
#define RO_ 0x0db // "ロ"
#define WA_ 0x0dc // "ワ"
#define WO_ 0x0a6 // "ヲ"
#define N_ 0x0dd // "ン"
#define GA_ 0x0de // "ガ"
#define GI_ 0x0df // "ギ"
#define GU_ 0x0e0 // "グ"
#define GE_ 0x0e1 // "ゲ"
#define GO_ 0x0e2 // "ゴ"
#define ZA_ 0x0e3 // "ザ"
#define ZI_ 0x0e4 // "ジ"
#define ZU_ 0x0e5 // "ズ"
#define ZE_ 0x0e6 // "ゼ"
#define ZO_ 0x0e7 // "ゾ"
#define DA_ 0x0e8 // "ダ"
#define DI_ 0x0e9 // "ヂ"
#define DU_ 0x0ea // "ヅ"
#define DE_ 0x0eb // "デ"
#define DO_ 0x0ec // "ド"
#define BA_ 0x0ed // "バ"
#define BI_ 0x0ee // "ビ"
#define BU_ 0x0ef // "ブ"
#define BE_ 0x0f0 // "ベ"
#define BO_ 0x0f1 // "ボ"
#define VU_ 0x0f2 // "ヴ"
#define PA_ 0x0f3 // "パ"
#define PI_ 0x0f4 // "ピ"
#define PU_ 0x0f5 // "プ"
#define PE_ 0x0f6 // "ペ"
#define PO_ 0x0f7 // "ポ"
#define AA_ 0x0a7 // "ァ"
#define II_ 0x0a8 // "ィ"
#define UU_ 0x0a9 // "ゥ"
#define EE_ 0x0aa // "ェ"
#define OO_ 0x0ab // "ォ"
#define YYA_ 0x0ac // "ャ"
#define YYU_ 0x0ad // "ュ"
#define YYO_ 0x0ae // "ョ"
#define TTU_ 0x0af // "ッ"
// アルファベット大文字----------------------------
#define A__ 0x041 // ""
#define B__ 0x042 // ""
#define C__ 0x043 // ""
#define D__ 0x044 // ""
#define E__ 0x045 // ""
#define F__ 0x046 // ""
#define G__ 0x047 // ""
#define H__ 0x048 // ""
#define I__ 0x049 // ""
#define J__ 0x04a // ""
#define K__ 0x04b // ""
#define L__ 0x04c // ""
#define M__ 0x04d // ""
#define N__ 0x04e // ""
#define O__ 0x04f // ""
#define P__ 0x050 // ""
#define Q__ 0x051 // ""
#define R__ 0x052 // ""
#define S__ 0x053 // ""
#define T__ 0x054 // ""
#define U__ 0x055 // ""
#define V__ 0x056 // ""
#define W__ 0x057 // ""
#define X__ 0x058 // ""
#define Y__ 0x059 // ""
#define Z__ 0x05a // ""
// アルファベット小文字----------------------------
#define a__ 0x061 // ""
#define b__ 0x062 // ""
#define c__ 0x063 // ""
#define d__ 0x064 // ""
#define e__ 0x065 // ""
#define f__ 0x066 // ""
#define g__ 0x067 // ""
#define h__ 0x068 // ""
#define i__ 0x069 // ""
#define j__ 0x06a // ""
#define k__ 0x06b // ""
#define l__ 0x06c // ""
#define m__ 0x06d // ""
#define n__ 0x06e // ""
#define o__ 0x06f // ""
#define p__ 0x070 // ""
#define q__ 0x071 // ""
#define r__ 0x072 // ""
#define s__ 0x073 // ""
#define t__ 0x074 // ""
#define u__ 0x075 // ""
#define v__ 0x076 // ""
#define w__ 0x077 // ""
#define x__ 0x078 // ""
#define y__ 0x079 // ""
#define z__ 0x07a // ""
// 数字--------------------------------------------
#define n0_ 0x030 // ""
#define n1_ 0x031 // ""
#define n2_ 0x032 // ""
#define n3_ 0x033 // ""
#define n4_ 0x034 // ""
#define n5_ 0x035 // ""
#define n6_ 0x036 // ""
#define n7_ 0x037 // ""
#define n8_ 0x038 // ""
#define n9_ 0x039 // ""
// 記号--------------------------------------------
#define spc_ 0x020 // " "
#define bicri_ 0x021 // ""
#define cyoncyon_ 0x022 // "”"
#define sharp_ 0x023 // ""
#define dollar_ 0x024 // ""
#define percent_ 0x025 // ""
#define and_ 0x026 // ""
#define cyon_ 0x027 // ""
#define kakko_ 0x028 // ""
#define kakkot_ 0x029 // ""
#define kome_ 0x02a // ""
#define tasu_ 0x02b // ""
#define comma_ 0x02c // ""
#define hiku_ 0x02d // ""
#define period_ 0x02e // ""
#define sura_ 0x02f // ""
#define colon_ 0x03a // ""
#define semicolon_ 0x03b // ""
#define dainari_ 0x03c // ""
#define equal_ 0x03d // ""
#define syounari_ 0x03e // ""
#define hate_ 0x03f // ""
#define atomark_ 0x040 // ""
#define dkakko_ 0x05b // ""
#define bsura_ 0x05c // ""
#define dkakkot_ 0x05d // ""
#define yama_ 0x05e // ""
#define uscore_ 0x05f // "_"
#define bcyon_ 0x060 // ""
#define ckakko_ 0x07b // ""
#define mataha_ 0x07c // ""
#define ckakkot_ 0x07d // ""
#define kara_ 0x07e // ""
#define kten_ 0x0a1 // "。"
#define k_kakko_ 0x0a2 // "「"
#define k_kakkot_ 0x0a3 // "」"
#define tten_ 0x0a4 // "、"
#define nakat_ 0x0a5 // "・"
#define bou_ 0x0b0 // "ー"
#define yazi_ 0x08c // "▼"
*/
#endif /* __MY_FONT_H_ */

View File

@ -1,567 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: unicode.c
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <sysmenu.h>
#include "unicode.h"
#include "font.h"
// define data------------------------------------------
#define TBL8140_ELEM_NUM 0xbd // 8140tblの要素数
#define TBL849f_ELEM_NUM 0x20 // 849ftblの要素数
typedef struct SjisUtf16Pare {
u16 sjis;
u16 unicode;
}SjisUtf16Pare;
// extern data------------------------------------------
// function's prototype declaration---------------------
static u16 SearchUnicodeTable(u16 unicode, SjisUtf16Pare *tblp, int elem_num);
// global variable -------------------------------------
// static variable -------------------------------------
// const data -----------------------------------------
static const SjisUtf16Pare tblSJIS_UTF16_8140[ TBL8140_ELEM_NUM ];
static const SjisUtf16Pare tblSJIS_UTF16_849f[ TBL849f_ELEM_NUM ];
//======================================================
// SJIS-BEからUTF16-LEへの変換
//======================================================
void ExSJIS_BEtoUTF16_LE(u8 *sjisp, u16 *unip, u16 length)
{
u16 code;
while( (*sjisp) && (length-- > 0) ) {
if( ((*sjisp >= SJIS_HIGHER_CODE1_MIN) && (*sjisp <= SJIS_HIGHER_CODE1_MAX))
||((*sjisp >= SJIS_HIGHER_CODE2_MIN) && (*sjisp <= SJIS_HIGHER_CODE2_MAX)) ) { // SJISか
code = (u16)( (u16)*sjisp++ << 8 );
code |= (u16)*sjisp++;
}else { // ASCII
code = (u16)*sjisp++;
}
if(code == 0x005c)
{
*unip = 0x00a5; // \
}else if(code == 0x007e)
{
*unip = 0x203e; // ~
}else if( (code == 0x000d) || (code == 0x000a) ) {
*unip = code; // 改行コード
}else if( (code >= 0x0020) && (code < 0x007e) ) // ' ' }
{
*unip = code;
}else if( (code >= 0x00a1) && (code <= 0x00df) ) // 。
{
*unip = (u16)( (code - 0x00a1) + 0xff61 );
}else if( (code >= 0x8140) && (code <= 0x81fc) ) // ' '
{
// バラバラなので、テーブル引き
*unip = tblSJIS_UTF16_8140[ code - 0x8140 ].unicode;
}else if( (code >= 0x824f) && (code <= 0x8258) ) //
{
*unip = (u16)( (code - 0x824f) + 0xff10 );
}else if( (code >= 0x8260) && (code <= 0x8279) ) //
{
*unip = (u16)( (code - 0x8260) + 0xff21 );
}else if( (code >= 0x8281) && (code <= 0x829a) ) //
{
*unip = (u16)( (code - 0x8281) + 0xff41 );
}else if( (code >= 0x829f) && (code <= 0x82f1) ) // ぁ
{
*unip = (u16)( (code - 0x829f) + 0x3041 );
}else if( (code >= 0x8340) && (code <= 0x8396) ) // ァ ヶ ※0x837fは抜け
{
*unip = (u16)( (code - 0x8340) + 0x30a1 );
if( code == 0x837f ) {
*unip = 0x3000;
}else if( code > 0x837f ) {
(*unip)--;
}
}else if( (code >= 0x839f) && (code <= 0x83b6) ) // Α Ω
{
*unip = (u16)( (code - 0x839f) + 0x0391 );
if(code >= 0x83b0) (*unip)++;
}else if( (code >= 0x83bf) && (code <= 0x83d6) ) // α ω
{
*unip = (u16)( (code - 0x83bf) + 0x03b1 );
if (code >= 0x83d0) (*unip)++;
}else if( (code >= 0x8440) && (code <= 0x8460) ) // А Я
{
*unip = (u16)( (code - 0x8440) + 0x0410 );
if( code == 0x8446 ) {
*unip = 0x0401;
}else if( code > 0x8446 ){
(*unip)--;
}
}else if( (code >= 0x8470) && (code <= 0x8491) ) // а я ※0x847fは抜け
{
*unip = (u16)( (code - 0x8470) + 0x0430 );
if( code == 0x8476 ) {
*unip = 0x0451;
}else if( code == 0x847f ) {
*unip = 0x3000;
}else if( code > 0x8476 ){
(*unip)--;
if( code > 0x847f ){
(*unip)--;
}
}
}else if( (code >= 0x849f) && (code <= 0x84be) ) // ─
{
// バラバラなので、テーブル引き
*unip = tblSJIS_UTF16_849f[ code - 0x849f ].unicode;
}else {
*unip = 0x3000;
}
unip++;
}
}
//======================================================
// UTF16-LEからSJIS-BEへの変換
//======================================================
void ExUTF16_LEtoSJIS_BE(u8 *sjisp, u16 *unip, u16 length)
{
u16 code, sjis_le;
while( (*unip) && (length-- > 0) ) {
code = *unip++;
sjis_le = 0;
if(code == 0x00a5)
{
sjis_le = 0x005c; // \
}else if(code == 0x005c)
{
sjis_le = 0x815f; //
}else if(code == 0x203e)
{
sjis_le = 0x007e; // ~
}else if( (code == 0x000d) || (code == 0x000a) ) {
sjis_le = code; // 改行コード
}else if( (code >= 0x0020) && (code < 0x007e) ) // ' ' }
{
sjis_le = code;
}else if( (code >= 0x00a2) && (code <= 0x00f7) )
{ // Unicode = 0x00a2 - 0x00f7 は、 SJIS = 0x814c - 0x81f7に配置
sjis_le = SearchUnicodeTable(code, (SjisUtf16Pare *)&tblSJIS_UTF16_8140[0xc], 0x81f7 - 0x814c);
}else if( (code >= 0xff61) && (code <= 0xff9f) ) // 。
{
sjis_le = (u16)( (code - 0xff61) + 0x00a1 );
}else if(code == 0x4edd) {
sjis_le = 0x8157;
}else if( (code >= 0xff01) && (code <= 0xffe5) )
{
if( (code >= 0xff10) && (code <= 0xff19) ) //
{
sjis_le = (u16)( (code - 0xff10) + 0x824f );
}else if( (code >= 0xff21) && (code <= 0xff3a) ) //
{
sjis_le = (u16)( (code - 0xff21) + 0x8260 );
}else if( (code >= 0xff41) && (code <= 0xff5a) ) //
{
sjis_le = (u16)( (code - 0xff41) + 0x8281 );
}else { // Unicode = 0xff01 - 0xffe5 は、 SJIS = 0x8143 - 0x8197に配置
sjis_le = SearchUnicodeTable(code, (SjisUtf16Pare *)&tblSJIS_UTF16_8140[3], 0x8197 - 0x8143);
}
}else if( (code >= 0x3000) && (code <= 0x30fe) )
{
if( (code >= 0x3041) && (code <= 0x3093) ) // ぁ
{
sjis_le = (u16)( (code - 0x3041) + 0x829f );
}else if( (code >= 0x30a1) && (code <= 0x30f6) ) // ァ ヶ ※0x837fは抜け
{
sjis_le = (u16)( (code - 0x30a1) + 0x8340 );
if( code >= 0x30e0 ) {
(sjis_le)++;
}
}else { // Unicode = 0x3000 - 0x30fe は、 SJIS = 0x8140 - 0x81acに配置
sjis_le = SearchUnicodeTable(code, (SjisUtf16Pare *)&tblSJIS_UTF16_8140[0], 0x81ac - 0x8140);
}
}else if( (code >= 0x0391) && (code <= 0x03a9) ) // Α Ω
{
sjis_le = (u16)( (code - 0x0391) + 0x839f );
if(code >= 0x03a3) (sjis_le)--;
}else if( (code >= 0x03b1) && (code <= 0x03c9) ) // α ω
{
sjis_le = (u16)( (code - 0x03b1) + 0x83bf );
if (code >= 0x03c3) (sjis_le)--;
}else if( code == 0x0401 )
{
sjis_le = 0x8446;
}else if( (code >= 0x0410) && (code <= 0x042f) ) // А Я
{
sjis_le = (u16)( (code - 0x0410) + 0x8440 );
if( code >= 0x0416 ){
(sjis_le)++;
}
}else if( (code >= 0x0430) && (code <= 0x044f) ) // а я ※0x847fは抜け
{
sjis_le = (u16)( (code - 0x0430) + 0x8470 );
if( code >= 0x0436 ){
(sjis_le)++;
if( code >= 0x043e ){
(sjis_le)++;
}
}
}else if( code == 0x0451 )
{
sjis_le = 0x8476;
}else if( (code >= 0x2500) && (code <= 0x254b) ) // ─
{
sjis_le = SearchUnicodeTable(code, (SjisUtf16Pare *)&tblSJIS_UTF16_849f, TBL849f_ELEM_NUM);
}else if( ( (code >= 0x2010) && (code <= 0x2312) ) || ( (code >= 0x25a0) && (code <= 0x266f) ) )
{ // 上記コードは、 SJIS = 0x815c - 0x81fcに配置
sjis_le = SearchUnicodeTable(code, (SjisUtf16Pare *)&tblSJIS_UTF16_8140[0x815c - 0x8140], 0x81fc - 0x815c);
}else
{
sjis_le = 0x8140;
}
// 変換したSJISコードをバッファに格納
if( sjis_le & 0xff00) { // ASCIIコードでなければ、ビッグエンディアン形式で格納。
*sjisp++ = (u8)(sjis_le >> 8);
}
*sjisp++ = (u8)(sjis_le);
}
}
// Unicode -> SJISへのテーブル引き
static u16 SearchUnicodeTable(u16 unicode, SjisUtf16Pare *tblp, int elem_num)
{
elem_num++;
while(elem_num--) {
if(tblp->unicode == unicode) {
return tblp->sjis;
}
tblp++;
}
return 0x8140;
}
//======================================================
// SJIS-BE <-> UTF16-LE変換のチェック
//======================================================
void CheckSJIS_BEtoUTF16_LE(void)
{
u16 sjis, sjis_be, rev_sjis, sjis_le;
u16 unicode;
// ASCIIコードのチェック
for ( sjis = 0; sjis < 0x00ff; sjis++ ) {
unicode = 0;
rev_sjis = 0;
ExSJIS_BEtoUTF16_LE( (u8 *)&sjis, &unicode, 1);
ExUTF16_LEtoSJIS_BE( (u8 *)&rev_sjis, &unicode, 1);
sjis_le = (u16)( (rev_sjis >> 8) | (rev_sjis << 8) );
OS_Printf("0x%x\t-> 0x%x\t-> 0x%x\n", sjis, unicode, sjis_le);
}
// SJISコードのチェック
for ( sjis = 0x8140; sjis < 0x84ff; sjis++ ) {
unicode = 0;
rev_sjis = 0;
sjis_be = (u16)( (sjis >> 8) | (sjis << 8) );
ExSJIS_BEtoUTF16_LE( (u8 *)&sjis_be, &unicode, 1);
ExUTF16_LEtoSJIS_BE( (u8 *)&rev_sjis, &unicode, 1);
sjis_le = (u16)( (rev_sjis >> 8) | (rev_sjis << 8) );
OS_Printf("0x%x\t-> 0x%x\t-> 0x%x\n", sjis, unicode, sjis_le);
}
}
//======================================================
// SJISコード->Unicodeテーブル
//======================================================
// 0x8140
static const SjisUtf16Pare tblSJIS_UTF16_8140[ TBL8140_ELEM_NUM ] = {
{ 0x8140, 0x3000 }, //  
{ 0x8141, 0x3001 }, // 、
{ 0x8142, 0x3002 }, // 。
{ 0x8143, 0xFF0C }, //
{ 0x8144, 0xFF0E }, //
{ 0x8145, 0x30FB }, // ・
{ 0x8146, 0xFF1A }, //
{ 0x8147, 0xFF1B }, //
{ 0x8148, 0xFF1F }, //
{ 0x8149, 0xFF01 }, //
{ 0x814A, 0x309B }, // ゛
{ 0x814B, 0x309C }, // ゜
{ 0x814C, 0x00B4 }, // ´
{ 0x814D, 0xFF40 }, //
{ 0x814E, 0x00A8 }, // ¨
{ 0x814F, 0xFF3E }, //
{ 0x8150, 0xFFE3 }, //  ̄
{ 0x8151, 0xFF3F }, // _
{ 0x8152, 0x30FD }, // ヽ
{ 0x8153, 0x30FE }, // ヾ
{ 0x8154, 0x309D }, // ゝ
{ 0x8155, 0x309E }, // ゞ
{ 0x8156, 0x3003 }, // 〃
{ 0x8157, 0x4EDD }, // 仝
{ 0x8158, 0x3005 }, // 々
{ 0x8159, 0x3006 }, // 〆
{ 0x815A, 0x3007 }, //
{ 0x815B, 0x30FC }, // ー
{ 0x815C, 0x2015 }, // ―
{ 0x815D, 0x2010 }, //
{ 0x815E, 0xFF0F }, //
{ 0x815F, 0x005C }, //
{ 0x8160, 0x301C }, //
{ 0x8161, 0x2016 }, // ∥
{ 0x8162, 0xFF5C }, //
{ 0x8163, 0x2026 }, // …
{ 0x8164, 0x2025 }, // ‥
{ 0x8165, 0x2018 }, //
{ 0x8166, 0x2019 }, //
{ 0x8167, 0x201C }, // “
{ 0x8168, 0x201D }, // ”
{ 0x8169, 0xFF08 }, //
{ 0x816A, 0xFF09 }, //
{ 0x816B, 0x3014 }, //
{ 0x816C, 0x3015 }, //
{ 0x816D, 0xFF3B }, //
{ 0x816E, 0xFF3D }, //
{ 0x816F, 0xFF5B }, //
{ 0x8170, 0xFF5D }, //
{ 0x8171, 0x3008 }, // 〈
{ 0x8172, 0x3009 }, // 〉
{ 0x8173, 0x300A }, // 《
{ 0x8174, 0x300B }, // 》
{ 0x8175, 0x300C }, // 「
{ 0x8176, 0x300D }, // 」
{ 0x8177, 0x300E }, // 『
{ 0x8178, 0x300F }, // 』
{ 0x8179, 0x3010 }, // 【
{ 0x817A, 0x3011 }, // 】
{ 0x817B, 0xFF0B }, //
{ 0x817C, 0x2212 }, //
{ 0x817D, 0x00B1 }, // ±
{ 0x817E, 0x00D7 }, // ×
{ 0x817F, 0x3000 }, //
{ 0x8180, 0x00F7 }, // ÷
{ 0x8181, 0xFF1D }, //
{ 0x8182, 0x2260 }, // ≠
{ 0x8183, 0xFF1C }, //
{ 0x8184, 0xFF1E }, //
{ 0x8185, 0x2266 }, // ≦
{ 0x8186, 0x2267 }, // ≧
{ 0x8187, 0x221E }, // ∞
{ 0x8188, 0x2234 }, // ∴
{ 0x8189, 0x2642 }, // ♂
{ 0x818A, 0x2640 }, // ♀
{ 0x818B, 0x00B0 }, // °
{ 0x818C, 0x2032 }, //
{ 0x818D, 0x2033 }, // ″
{ 0x818E, 0x2103 }, // ℃
{ 0x818F, 0xFFE5 }, // ¥
{ 0x8190, 0xFF04 }, //
{ 0x8191, 0x00A2 }, // ¢
{ 0x8192, 0x00A3 }, // £
{ 0x8193, 0xFF05 }, //
{ 0x8194, 0xFF03 }, //
{ 0x8195, 0xFF06 }, //
{ 0x8196, 0xFF0A }, //
{ 0x8197, 0xFF20 }, //
{ 0x8198, 0x00A7 }, // §
{ 0x8199, 0x2606 }, // ☆
{ 0x819A, 0x2605 }, // ★
{ 0x819B, 0x25CB }, // ○
{ 0x819C, 0x25CF }, // ●
{ 0x819D, 0x25CE }, // ◎
{ 0x819E, 0x25C7 }, // ◇
{ 0x819F, 0x25C6 }, // ◆
{ 0x81A0, 0x25A1 }, // □
{ 0x81A1, 0x25A0 }, // ■
{ 0x81A2, 0x25B3 }, // △
{ 0x81A3, 0x25B2 }, // ▲
{ 0x81A4, 0x25BD }, // ▽
{ 0x81A5, 0x25BC }, // ▼
{ 0x81A6, 0x203B }, // ※
{ 0x81A7, 0x3012 }, // 〒
{ 0x81A8, 0x2192 }, // →
{ 0x81A9, 0x2190 }, // ←
{ 0x81AA, 0x2191 }, // ↑
{ 0x81AB, 0x2193 }, // ↓
{ 0x81AC, 0x3013 }, // 〓
{ 0x81AD, 0x3000 }, //
{ 0x81AE, 0x3000 }, //
{ 0x81AF, 0x3000 }, //
{ 0x81B0, 0x3000 }, //
{ 0x81B1, 0x3000 }, //
{ 0x81B2, 0x3000 }, //
{ 0x81B3, 0x3000 }, //
{ 0x81B4, 0x3000 }, //
{ 0x81B5, 0x3000 }, //
{ 0x81B6, 0x3000 }, //
{ 0x81B7, 0x3000 }, //
{ 0x81B8, 0x2208 }, // ∈
{ 0x81B9, 0x220B }, // ∋
{ 0x81BA, 0x2286 }, // ⊆
{ 0x81BB, 0x2287 }, // ⊇
{ 0x81BC, 0x2282 }, // ⊂
{ 0x81BD, 0x2283 }, // ⊃
{ 0x81BE, 0x222A }, //
{ 0x81BF, 0x2229 }, // ∩
{ 0x81C0, 0x3000 }, //
{ 0x81C1, 0x3000 }, //
{ 0x81C2, 0x3000 }, //
{ 0x81C3, 0x3000 }, //
{ 0x81C4, 0x3000 }, //
{ 0x81C5, 0x3000 }, //
{ 0x81C6, 0x3000 }, //
{ 0x81C7, 0x3000 }, //
{ 0x81C8, 0x2227 }, // ∧
{ 0x81C9, 0x2228 }, //
{ 0x81CA, 0x00AC }, // ¬
{ 0x81CB, 0x21D2 }, // ⇒
{ 0x81CC, 0x21D4 }, // ⇔
{ 0x81CD, 0x2200 }, // ∀
{ 0x81CE, 0x2203 }, // ∃
{ 0x81CF, 0x3000 }, //
{ 0x81D0, 0x3000 }, //
{ 0x81D1, 0x3000 }, //
{ 0x81D2, 0x3000 }, //
{ 0x81D3, 0x3000 }, //
{ 0x81D4, 0x3000 }, //
{ 0x81D5, 0x3000 }, //
{ 0x81D6, 0x3000 }, //
{ 0x81D7, 0x3000 }, //
{ 0x81D8, 0x3000 }, //
{ 0x81D9, 0x3000 }, //
{ 0x81DA, 0x2220 }, // ∠
{ 0x81DB, 0x22A5 }, // ⊥
{ 0x81DC, 0x2312 }, // ⌒
{ 0x81DD, 0x2202 }, // ∂
{ 0x81DE, 0x2207 }, // ∇
{ 0x81DF, 0x2261 }, // ≡
{ 0x81E0, 0x2252 }, // ≒
{ 0x81E1, 0x226A }, // ≪
{ 0x81E2, 0x226B }, // ≫
{ 0x81E3, 0x221A }, // √
{ 0x81E4, 0x223D }, // ∽
{ 0x81E5, 0x221D }, // ∝
{ 0x81E6, 0x2235 }, // ∵
{ 0x81E7, 0x222B }, // ∫
{ 0x81E8, 0x222C }, // ∬
{ 0x81E9, 0x3000 }, //
{ 0x81EA, 0x3000 }, //
{ 0x81EB, 0x3000 }, //
{ 0x81EC, 0x3000 }, //
{ 0x81EE, 0x3000 }, //
{ 0x81EE, 0x3000 }, //
{ 0x81EF, 0x3000 }, //
{ 0x81F0, 0x212B }, // Å
{ 0x81F1, 0x2030 }, // ‰
{ 0x81F2, 0x266F }, // ♯
{ 0x81F3, 0x266D }, // ♭
{ 0x81F4, 0x266A }, // ♪
{ 0x81F5, 0x2020 }, // †
{ 0x81F6, 0x2021 }, // ‡
{ 0x81F7, 0x00B6 }, // ¶
{ 0x81F8, 0x3000 }, //
{ 0x81F9, 0x3000 }, //
{ 0x81FA, 0x3000 }, //
{ 0x81FB, 0x3000 }, //
{ 0x81FC, 0x25EF }, // ◯
};
// 0x849f
// Unicodeでは、0x2500-0x254bの間
static const SjisUtf16Pare tblSJIS_UTF16_849f[ TBL849f_ELEM_NUM ] = {
{ 0x849F, 0x2500 }, // ─
{ 0x84A0, 0x2502 }, // │
{ 0x84A1, 0x250C }, // ┌
{ 0x84A2, 0x2510 }, // ┐
{ 0x84A3, 0x2518 }, // ┘
{ 0x84A4, 0x2514 }, // └
{ 0x84A5, 0x251C }, // ├
{ 0x84A6, 0x252C }, // ┬
{ 0x84A7, 0x2524 }, // ┤
{ 0x84A8, 0x2534 }, // ┴
{ 0x84A9, 0x253C }, // ┼
{ 0x84AA, 0x2501 }, // ━
{ 0x84AB, 0x2503 }, // ┃
{ 0x84AC, 0x250F }, // ┏
{ 0x84AD, 0x2513 }, // ┓
{ 0x84AE, 0x251B }, // ┛
{ 0x84AF, 0x2517 }, // ┗
{ 0x84B0, 0x2523 }, // ┣
{ 0x84B1, 0x2533 }, // ┳
{ 0x84B2, 0x252B }, // ┫
{ 0x84B3, 0x253B }, // ┻
{ 0x84B4, 0x254B }, // ╋
{ 0x84B5, 0x2520 }, // ┠
{ 0x84B6, 0x252F }, // ┯
{ 0x84B7, 0x2528 }, // ┨
{ 0x84B8, 0x2537 }, // ┷
{ 0x84B9, 0x253F }, // ┿
{ 0x84BA, 0x251D }, // ┝
{ 0x84BB, 0x2530 }, // ┰
{ 0x84BC, 0x2525 }, // ┥
{ 0x84BD, 0x2538 }, // ┸
{ 0x84BE, 0x2542 }, // ╂
};

View File

@ -1,40 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: unicode.h
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef __UNICODE_H_
#define __UNICODE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <twl.h>
// define data----------------------------------
// function's prototype declaration-------------
void ExSJIS_BEtoUTF16_LE(u8 *sjisp, u16 *unip, u16 length);
void ExUTF16_LEtoSJIS_BE(u8 *sjisp, u16 *unip, u16 length);
void CheckSJIS_BEtoUTF16_LE(void);
#ifdef __cplusplus
}
#endif
#endif // __UNICODE_H_

View File

@ -123,7 +123,7 @@ int SelectLanguageMain( void )
// [CANCEL]ボタン押下チェック
if( tpd.disp.touch ) {
tp_cancel = InRangeTp( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y,
tp_cancel = WithinRangeTP( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y,
CANCEL_BUTTON_BOTTOM_X, CANCEL_BUTTON_BOTTOM_Y, &tpd.disp );
}

View File

@ -256,7 +256,7 @@ int SEQ_OwnerInfo(void)
ReadTP(); // タッチパネル入力の取得
if(tpd.disp.touch) { // [RETURN]ボタン押下チェック
tp_return = InRangeTp(RETURN_BUTTON_LT_X*8, RETURN_BUTTON_LT_Y*8-4,
tp_return = WithinRangeTP(RETURN_BUTTON_LT_X*8, RETURN_BUTTON_LT_Y*8-4,
RETURN_BUTTON_RB_X*8, RETURN_BUTTON_RB_Y*8-4, &tpd.disp);
}
@ -368,7 +368,7 @@ static int SEQ_InputBirthday(void)
x_base = (ownerInfoSel.pos_x + 13) * 8;
y_base = (ownerInfoSel.pos_y + OWNER_INFO_CSR_NEXT_Y_NUM * 1) * 8 + 6;
// 入力項目移動のチェック
if( InRangeTp( x_base, (y_base - 6), (x_base + 80), (y_base + 6), &tpd.disp) ) {
if( WithinRangeTP( x_base, (y_base - 6), (x_base + 80), (y_base + 6), &tpd.disp) ) {
if(tpd.disp.x < x_base + 2 * 8) {
new_seq = SEQ_MONTH_SET;
}else if((tpd.disp.x >= x_base + 3 * 8) && (tpd.disp.x < x_base + 5 * 8)) {
@ -380,7 +380,7 @@ static int SEQ_InputBirthday(void)
ow->seq = new_seq - 1;
}else {
// 入力値の増減
if(InRangeTp( ow->inp.pos_x * 8, (y_base - 30), (ow->inp.pos_x + ow->inp.keta_max) * 8, (y_base + 30), &tpd.disp)) {
if(WithinRangeTP( ow->inp.pos_x * 8, (y_base - 30), (ow->inp.pos_x + ow->inp.keta_max) * 8, (y_base + 30), &tpd.disp)) {
ow->inp.y_offset = tpd.disp.y - y_base;
abs_y_offset = (ow->inp.y_offset >= 0) ? ow->inp.y_offset : -ow->inp.y_offset;
if(abs_y_offset <= 6) {
@ -538,7 +538,7 @@ static int SEQ_InputFavoriteColor(void)
x_base = FCOLOR_LT_X * 8;
y_base = FCOLOR_LT_Y * 8 + 6;
// 入力値の増減
if(InRangeTp( ow->inp.pos_x * 8, (y_base - 30), (ow->inp.pos_x + ow->inp.keta_max) * 8, (y_base + 30), &tpd.disp)) {
if(WithinRangeTP( ow->inp.pos_x * 8, (y_base - 30), (ow->inp.pos_x + ow->inp.keta_max) * 8, (y_base + 30), &tpd.disp)) {
ow->inp.y_offset = tpd.disp.y - y_base;
abs_y_offset = (ow->inp.y_offset >= 0) ? ow->inp.y_offset : -ow->inp.y_offset;
if(abs_y_offset <= 6) {
@ -864,7 +864,7 @@ static BOOL MoveCharCursorTp(CsrPos *csrp)
ow->detach_count = 0;
if(tpd.disp.touch) {
if(InRangeTp(CLIST_LT_X*8, CLIST_LT_Y*8-4, CLIST_RB_X*8-1, CLIST_RB_Y*8-4, &tpd.disp)) {
if(WithinRangeTP(CLIST_LT_X*8, CLIST_LT_Y*8-4, CLIST_RB_X*8-1, CLIST_RB_Y*8-4, &tpd.disp)) {
// 少しマージンあり。
temp.x = (u16)((tpd.disp.x - CLIST_LT_X * 8) / 8);
temp.y = (u16)((tpd.disp.y - (CLIST_LT_Y * 8)) / 16);

View File

@ -26,18 +26,20 @@
// RETURNボタンLCD領域
#define RETURN_BUTTON_TOP_X ( 2 * 8 )
#define RETURN_BUTTON_TOP_Y ( 21 * 8 )
#define RETURN_BUTTON_BOTTOM_X ( (RETURN_BUTTON_TOP_X + 8) * 8 )
#define RETURN_BUTTON_BOTTOM_Y ( (RETURN_BUTTON_TOP_Y + 2) * 8 )
#define RETURN_BUTTON_BOTTOM_X ( RETURN_BUTTON_TOP_X + 6 * 8 )
#define RETURN_BUTTON_BOTTOM_Y ( RETURN_BUTTON_TOP_Y + 2 * 8 )
// 日付データLCD領域
#define DATE_TOP_X ( 5 * 8 )
#define DATE_TOP_Y ( 10 * 8 )
// 時刻データLCD領域
#define TIME_TOP_X ( (DATE_TOP_X + 14) * 8 )
#define TIME_TOP_Y ( DATE_TOP_Y * 8 )
#define YEAR_TOP_X ( 5 * 8 )
#define MONTH_TOP_X ( YEAR_TOP_X + 5 * 8 )
#define DAY_TOP_X ( MONTH_TOP_X + 3 * 8 )
// RTC設定メニュー要素
#define RTC_MENU_ELEM_NUM 1
// 時刻データLCD領域
#define TIME_TOP_Y ( DATE_TOP_Y )
#define HOUR_TOP_X ( DAY_TOP_X + 5 * 8 )
#define MINUTE_TOP_X ( HOUR_TOP_X + 3 * 8 )
#define SECOND_TOP_X ( MINUTE_TOP_X + 3 * 8 )
// 文字入力タッチパネル用カウンタ
#define S_UPDOWN_COUNT_MAX 16
@ -49,9 +51,11 @@
// 日付時刻入力シーケンス用ワーク
typedef struct DateTimeParam {
int seq; // シーケンス番号
int *tgtp; // 入力対象の変数へのポインタ
int *pTgt; // 入力対象の変数へのポインタ
RTCDate Date;
RTCTime Time;
RTCDate Date_old;
RTCTime Time_old;
}DateTimeParam;
@ -63,26 +67,36 @@ typedef struct SetRtcWork {
InputNumParam inp; // 数値入力インターフェース用ワーク
}SetRtcWork;
typedef struct DateTimeWidth {
int year;
int month;
int day;
int hour;
int minute;
int second;
}DateTimeWidth;
// extern data------------------------------------------
// function's prototype declaration---------------------
RTCWeek CalcWeekFromDate( u32 year, u32 month, u32 day );
void InputDecimal(int *tgtp, InputNumParam *inpp);
void InputDecimal(int *pTgt, InputNumParam *inpp);
static void InputRtcDateTimeInit( int start );
static int InputRtcDateTimeMain( void );
static void TransmitRtcData(DateTimeParam *dtpp, RtcDateTime *rtcp);
static void SelectString( int *tgtp, const u8 **const strpp, InputNumParam *inpp);
static void SelectString( int *pTgt, const u8 **const pStrp, InputNumParam *inpp);
static void BcdToHex(int *bcdp);
static void HexToBcd(int *hexp);
static BOOL CheckLeapYear( u32 year );
static void DrawDateTime( RTCDate *pDate, RTCTime *pTime, int color );
// global variable -------------------------------------
// static variable -------------------------------------
SetRtcWork *s_pRTCWork; // RTC設定用ワーク
static SetRtcWork *s_pWork; // RTC設定用ワーク
// const data -----------------------------------------
//======================================================
@ -97,8 +111,6 @@ void SetRTCInit( void )
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_WHITE );
PutStringUTF16( 0, 0, TXT_COLOR_BLUE, (const u16 *)L"DATE & TIME SET" );
PrintfSJIS( DATE_TOP_X + 3 * 8, DATE_TOP_Y, TXT_COLOR_BLACK, "/ / [ ] : :");
PutStringUTF16( RETURN_BUTTON_TOP_X, RETURN_BUTTON_TOP_Y, TXT_COLOR_CYAN, (const u16 *)L" RETURN " );
if( g_initialSet ) {
@ -109,14 +121,25 @@ void SetRTCInit( void )
}
}
s_pRTCWork = NNS_FndAllocFromAllocator( &g_allocator, sizeof(SetRtcWork) ); // RTC設定用ワークの確保
if( s_pRTCWork == NULL ) {
s_pWork = NNS_FndAllocFromAllocator( &g_allocator, sizeof(SetRtcWork) ); // RTC設定用ワークの確保
if( s_pWork == NULL ) {
OS_Panic( "ARM9- Fail to allocate memory...\n" );
}
SVC_CpuClear( 0x0000, s_pRTCWork, sizeof(SetRtcWork), 16 );
SVC_CpuClear( 0x0000, s_pWork, sizeof(SetRtcWork), 16 );
SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 );
RTC_GetDateTime( &s_pWork->dtp.Date, &s_pWork->dtp.Time );
s_pWork->dtp.Date.year += 2000;
PrintfSJIS ( YEAR_TOP_X, DATE_TOP_Y, TXT_COLOR_BLACK, "%04d", s_pWork->dtp.Date.year );
PrintfSJIS ( MONTH_TOP_X, DATE_TOP_Y, TXT_COLOR_BLACK, "%02d", s_pWork->dtp.Date.month );
PrintfSJIS ( DAY_TOP_X, DATE_TOP_Y, TXT_COLOR_BLACK, "%02d", s_pWork->dtp.Date.day );
PrintfSJIS ( HOUR_TOP_X, TIME_TOP_Y, TXT_COLOR_BLACK, "%02d", s_pWork->dtp.Time.hour );
PrintfSJIS ( MINUTE_TOP_X, TIME_TOP_Y, TXT_COLOR_BLACK, "%02d", s_pWork->dtp.Time.minute );
DrawDateTime( &s_pWork->dtp.Date, &s_pWork->dtp.Time, TXT_COLOR_BLACK );
GX_SetVisiblePlane ( GX_PLANEMASK_BG0 );
GXS_SetVisiblePlane( GX_PLANEMASK_BG0 );
GX_DispOn();
@ -124,6 +147,20 @@ void SetRTCInit( void )
}
// 指定した日付・時刻の表示
static void DrawDateTime( RTCDate *pDate, RTCTime *pTime, int color )
{
PrintfSJIS( YEAR_TOP_X, DATE_TOP_Y, color, "%04d", pDate->year );
PrintfSJIS( MONTH_TOP_X, DATE_TOP_Y, color, "%02d", pDate->month );
PrintfSJIS( DAY_TOP_X, DATE_TOP_Y, color, "%02d", pDate->day );
PrintfSJIS( HOUR_TOP_X, TIME_TOP_Y, color, "%02d", pTime->hour );
PrintfSJIS( MINUTE_TOP_X, TIME_TOP_Y, color, "%02d", pTime->minute );
PutStringUTF16( YEAR_TOP_X + 4 * 8, DATE_TOP_Y, color, L"/" );
PutStringUTF16( MONTH_TOP_X + 2 * 8, DATE_TOP_Y, color, L"/" );
PutStringUTF16( HOUR_TOP_X + 2 * 8, TIME_TOP_Y, color, L":" );
}
// RTC設定シーケンス
int SetRTCMain( void )
{
@ -133,11 +170,11 @@ int SetRTCMain( void )
ReadTP(); // TP入力の取得
if(tpd.disp.touch) {
tp_set = InRangeTp( DATE_TOP_X, DATE_TOP_Y, // [RTC設定]領域押下チェック
( TIME_TOP_X + 8 * 8 ), (TIME_TOP_Y + 2 * 8 ), &tpd.disp );
// [RETURN]ボタン押下チェック
tp_return = InRangeTp( RETURN_BUTTON_TOP_X, RETURN_BUTTON_TOP_Y,
RETURN_BUTTON_BOTTOM_X, RETURN_BUTTON_BOTTOM_Y, &tpd.disp );
tp_set = WithinRangeTP( YEAR_TOP_X, DATE_TOP_Y, // [RTC設定]領域押下チェック
SECOND_TOP_X, DATE_TOP_Y + 16, &tpd.disp );
// [RETURN]ボタン押下チェック
tp_return = WithinRangeTP( RETURN_BUTTON_TOP_X, RETURN_BUTTON_TOP_Y,
RETURN_BUTTON_BOTTOM_X, RETURN_BUTTON_BOTTOM_Y, &tpd.disp );
}
if( g_initialSet && !GetNCDWork()->option.input_rtc ) {
tp_set = TRUE;
@ -145,30 +182,16 @@ int SetRTCMain( void )
//--------------------------------------
// キー入力処理
//--------------------------------------
if( pad.trg & PAD_KEY_DOWN ) { // カーソルの移動
if( ++s_pRTCWork->csr == RTC_MENU_ELEM_NUM) {
s_pRTCWork->csr = 0;
}
}
if( pad.trg & PAD_KEY_UP ) {
if( --s_pRTCWork->csr < 0 ) {
s_pRTCWork->csr = RTC_MENU_ELEM_NUM - 1;
}
}
if( ( pad.trg & PAD_BUTTON_A ) || tp_set ) { // RTC設定開始
if( s_pRTCWork->csr == 0 ) {
InputRtcDateTimeInit( 1 );
g_pNowProcess = InputRtcDateTimeMain;
}
InputRtcDateTimeInit( 1 );
g_pNowProcess = InputRtcDateTimeMain;
}else if( ( pad.trg & PAD_BUTTON_B ) || tp_return ) { // メニューに戻る
NNS_FndFreeToAllocator( &g_allocator, s_pRTCWork ); // RTC設定用ワークの解放
s_pRTCWork = NULL;
NNS_FndFreeToAllocator( &g_allocator, s_pWork ); // RTC設定用ワークの解放
s_pWork = NULL;
MachineSettingInit();
}
#ifdef __SYSM_DEBUG
if( pad.trg & PAD_BUTTON_START ) {
else if( pad.trg & PAD_BUTTON_START ) {
ClearRTC();
OS_Printf( "RTC offset in NVRAM is ZERO clear!\n" );
}
@ -186,10 +209,10 @@ int SetRTCMain( void )
static void InputRtcDateTimeInit( int start )
{
NNS_G2dCharCanvasClearArea( &gCanvas, TXT_COLOR_WHITE,
RETURN_BUTTON_TOP_X, RETURN_BUTTON_TOP_Y, 28 * 8, 2 * 8 );
RETURN_BUTTON_TOP_X, RETURN_BUTTON_TOP_Y, 256 - RETURN_BUTTON_TOP_X, 2 * 8 );
if( start ) {
DrawOKCancelButton();
s_pRTCWork->dtp.seq = 0;
s_pWork->dtp.seq = 0;
}else {
PutStringUTF16( RETURN_BUTTON_TOP_X, RETURN_BUTTON_TOP_Y, TXT_COLOR_CYAN, (const u16 *)L"RETURN" );
}
@ -202,7 +225,7 @@ static int InputRtcDateTimeMain( void )
{
BOOL tp_ok = FALSE;
BOOL tp_cancel = FALSE;
int new_seq, x_base, y_base, abs_y_offset;
int new_seq, y_base, abs_y_offset;
enum { // 日付時刻入力シーケンス番号
SEQ_INIT=0,
@ -211,128 +234,114 @@ static int InputRtcDateTimeMain( void )
SEQ_DAY_INIT, SEQ_DAY_SET,
SEQ_HOUR_INIT, SEQ_HOUR_SET,
SEQ_MINUTE_INIT, SEQ_MINUTE_SET,
SEQ_SECOND_INIT, SEQ_SECOND_SET,
SEQ_END,
SEQ_RETURN=64
SEQ_CANCEL=64
};
ReadTP(); // タッチパネル入力の取得
CheckOKCancelButton( &tp_ok, &tp_cancel ); // [OK],[CANCEL]ボタン押下チェック
s_pRTCWork->inp.y_offset = 0;
s_pWork->inp.y_offset = 0;
if( tpd.disp.touch ) { // [CANCEL]ボタン押下チェック
if( ( s_pRTCWork->dtp.seq & 0x01 ) && ( s_pRTCWork->dtp.seq < SEQ_END ) ) { // SEQ_**_SETの時のみ有効
new_seq = s_pRTCWork->dtp.seq;
x_base = DATE_TOP_X;
if( ( s_pWork->dtp.seq & 0x01 ) && ( s_pWork->dtp.seq < SEQ_END ) ) { // SEQ_**_SETの時のみ有効
new_seq = s_pWork->dtp.seq;
y_base = DATE_TOP_Y + 6;
// 入力項目移動のチェック
if( InRangeTp( x_base, (y_base - 6), (x_base + 22 * 8), (y_base + 6), &tpd.disp ) ) {
if( tpd.disp.x < x_base + 28 ) {
if( WithinRangeTP( YEAR_TOP_X, DATE_TOP_Y, SECOND_TOP_X, DATE_TOP_Y + 12, &tpd.disp ) ) {
if( tpd.disp.x < YEAR_TOP_X + 32 ) {
new_seq = SEQ_YEAR_SET;
}else if( ( tpd.disp.x >= x_base + 4 * 8 ) && ( tpd.disp.x < x_base + 6 * 8 ) ) {
}else if( ( tpd.disp.x >= MONTH_TOP_X ) && ( tpd.disp.x < MONTH_TOP_X + 16 ) ) {
new_seq = SEQ_MONTH_SET;
}else if( ( tpd.disp.x >= x_base + 7 * 8 ) && ( tpd.disp.x < x_base + 9 * 8 ) ) {
}else if( ( tpd.disp.x >= DAY_TOP_X ) && ( tpd.disp.x < DAY_TOP_X + 16 ) ) {
new_seq = SEQ_DAY_SET;
}else if( ( tpd.disp.x >= x_base + 14 * 8 ) && ( tpd.disp.x < x_base + 16 * 8 ) ) {
}else if( ( tpd.disp.x >= HOUR_TOP_X ) && ( tpd.disp.x < HOUR_TOP_X + 16 ) ) {
new_seq = SEQ_HOUR_SET;
}else if( ( tpd.disp.x >= x_base + 17 * 8 ) && ( tpd.disp.x < x_base + 19 * 8 ) ) {
}else if( ( tpd.disp.x >= MINUTE_TOP_X ) && ( tpd.disp.x < MINUTE_TOP_X + 16 ) ) {
new_seq = SEQ_MINUTE_SET;
}else if( tpd.disp.x >= x_base + 20 * 8 ) {
new_seq = SEQ_SECOND_SET;
}
}
if( s_pRTCWork->dtp.seq != new_seq ) {
s_pRTCWork->dtp.seq = new_seq - 1;
}else {
if( s_pWork->dtp.seq != new_seq ) {
s_pWork->dtp.seq = new_seq - 1;
}else if( WithinRangeTP( s_pWork->inp.pos_x, y_base - 40,
s_pWork->inp.pos_x + s_pWork->inp.keta_max * 8, y_base + 60, &tpd.disp ) ) {
// 入力値の増減
if( InRangeTp( s_pRTCWork->inp.pos_x, (y_base - 30),
s_pRTCWork->inp.pos_x + s_pRTCWork->inp.keta_max * 8, y_base + 30, &tpd.disp ) ) {
s_pRTCWork->inp.y_offset = tpd.disp.y - y_base;
abs_y_offset = ( s_pRTCWork->inp.y_offset >= 0 ) ? s_pRTCWork->inp.y_offset : -s_pRTCWork->inp.y_offset;
if( abs_y_offset <= 6 ) {
s_pRTCWork->inp.y_offset = 0;
}else if( abs_y_offset <= 14 ){
s_pRTCWork->inp.y_offset >>= 2;
}else if( abs_y_offset <= 22 ){
s_pRTCWork->inp.y_offset >>= 1;
}
s_pWork->inp.y_offset = tpd.disp.y - y_base;
abs_y_offset = ( s_pWork->inp.y_offset >= 0 ) ? s_pWork->inp.y_offset : -s_pWork->inp.y_offset;
if( abs_y_offset <= 6 ) {
s_pWork->inp.y_offset = 0;
}else if( abs_y_offset <= 20 ){
s_pWork->inp.y_offset >>= 2;
}else if( abs_y_offset <= 40 ){
s_pWork->inp.y_offset >>= 1;
}
}
}
}
// タッチパネル or キー入力によって、カーソル位置が動いた時に、元の位置のカーソルを消す。
if( ( s_pRTCWork->dtp.seq > 0 ) && ( ( s_pRTCWork->dtp.seq & 0x01 ) == 0 ) ) { // SEQ_INITの時は実行しない
PrintfSJIS( s_pRTCWork->inp.pos_x, s_pRTCWork->inp.pos_y, TXT_COLOR_BLACK,
"%02d", *s_pRTCWork->dtp.tgtp );
if( ( s_pWork->dtp.seq > 0 ) && ( ( s_pWork->dtp.seq & 0x01 ) == 0 ) ) { // SEQ_INITの時は実行しない
PrintfSJIS( s_pWork->inp.pos_x, s_pWork->inp.pos_y, TXT_COLOR_BLACK, "%02d", *s_pWork->dtp.pTgt );
}
// 各シーケンスの処理
switch(s_pRTCWork->dtp.seq){
switch(s_pWork->dtp.seq){
case SEQ_INIT:
s_pRTCWork->dtp.Date = GetSYSMWork()->rtc[0].Date;
s_pRTCWork->dtp.Time = GetSYSMWork()->rtc[0].Time;
s_pRTCWork->dtp.Date.year += 2000; // yearをする。
s_pRTCWork->dtp.seq = SEQ_YEAR_INIT;
MI_CpuCopy32( &s_pWork->dtp.Date, &s_pWork->dtp.Date_old, sizeof(RTCDate) );
MI_CpuCopy32( &s_pWork->dtp.Time, &s_pWork->dtp.Time_old, sizeof(RTCTime) );
s_pWork->dtp.seq = SEQ_YEAR_INIT;
// ※SEQ_INITは直通でSEQ_YEAR_INITへ
case SEQ_YEAR_INIT:
s_pRTCWork->inp.pos_x = DATE_TOP_X;
s_pRTCWork->inp.pos_y = DATE_TOP_Y;
s_pRTCWork->inp.keta_max = 4;
s_pRTCWork->inp.value_max = 2099;
s_pRTCWork->inp.value_min = 2000;
// s_pRTCWork->inp.value_min = 2004;
// if(s_pRTCWork->dtp.Date.year < 2004) {
// s_pRTCWork->dtp.Date.year = 2004;
s_pWork->inp.pos_x = YEAR_TOP_X;
s_pWork->inp.pos_y = DATE_TOP_Y;
s_pWork->inp.keta_max = 4;
s_pWork->inp.value_max = 2099;
s_pWork->inp.value_min = 2000;
// s_pWork->inp.value_min = 2004;
// if(s_pWork->dtp.Date.year < 2004) {
// s_pWork->dtp.Date.year = 2004;
// }
s_pRTCWork->dtp.tgtp = (int *)&s_pRTCWork->dtp.Date.year;
s_pWork->dtp.pTgt = (int *)&s_pWork->dtp.Date.year;
break;
case SEQ_MONTH_INIT:
s_pRTCWork->inp.pos_x = DATE_TOP_X + 4 * 8;
s_pRTCWork->inp.keta_max = 2;
s_pRTCWork->inp.value_max = 12;
s_pRTCWork->inp.value_min = 1;
s_pRTCWork->dtp.tgtp = (int *)&s_pRTCWork->dtp.Date.month;
s_pWork->inp.pos_x = MONTH_TOP_X;
s_pWork->inp.keta_max = 2;
s_pWork->inp.value_max = 12;
s_pWork->inp.value_min = 1;
s_pWork->dtp.pTgt = (int *)&s_pWork->dtp.Date.month;
break;
case SEQ_DAY_INIT:
s_pRTCWork->inp.pos_x = DATE_TOP_X + 7 * 8;
s_pRTCWork->inp.keta_max = 2;
s_pRTCWork->inp.value_max = (int)SYSM_GetDayNum( s_pRTCWork->dtp.Date.year, s_pRTCWork->dtp.Date.month );
s_pWork->inp.pos_x = DAY_TOP_X;
s_pWork->inp.keta_max = 2;
s_pWork->inp.value_max = (int)SYSM_GetDayNum( s_pWork->dtp.Date.year, s_pWork->dtp.Date.month );
// 年・月をもとにその月の日数を算出する。
s_pRTCWork->inp.value_min = 1;
if(s_pRTCWork->dtp.Date.day > s_pRTCWork->inp.value_max) {
s_pRTCWork->dtp.Date.day = (u32)s_pRTCWork->inp.value_max;
s_pWork->inp.value_min = 1;
if(s_pWork->dtp.Date.day > s_pWork->inp.value_max) {
s_pWork->dtp.Date.day = (u32)s_pWork->inp.value_max;
}
s_pRTCWork->dtp.tgtp = (int *)&s_pRTCWork->dtp.Date.day;
s_pWork->dtp.pTgt = (int *)&s_pWork->dtp.Date.day;
break;
case SEQ_HOUR_INIT:
s_pRTCWork->inp.pos_x = TIME_TOP_X;
s_pRTCWork->inp.keta_max = 2;
s_pRTCWork->inp.value_max = 23;
s_pRTCWork->inp.value_min = 0;
s_pRTCWork->dtp.tgtp = (int *)&s_pRTCWork->dtp.Time.hour;
s_pWork->inp.pos_x = HOUR_TOP_X;
s_pWork->inp.keta_max = 2;
s_pWork->inp.value_max = 23;
s_pWork->inp.value_min = 0;
s_pWork->dtp.pTgt = (int *)&s_pWork->dtp.Time.hour;
break;
case SEQ_MINUTE_INIT:
s_pRTCWork->inp.pos_x = TIME_TOP_X + 3 * 8;
s_pRTCWork->inp.keta_max = 2;
s_pRTCWork->inp.value_max = 59;
s_pRTCWork->inp.value_min = 0;
s_pRTCWork->dtp.tgtp = (int *)&s_pRTCWork->dtp.Time.minute;
break;
case SEQ_SECOND_INIT:
s_pRTCWork->inp.pos_x = TIME_TOP_X + 6 * 8;
s_pRTCWork->inp.keta_max = 2;
s_pRTCWork->inp.value_max = 59;
s_pRTCWork->inp.value_min = 0;
s_pRTCWork->dtp.tgtp = (int *)&s_pRTCWork->dtp.Time.second;
s_pWork->inp.pos_x = MINUTE_TOP_X;
s_pWork->inp.keta_max = 2;
s_pWork->inp.value_max = 59;
s_pWork->inp.value_min = 0;
s_pWork->dtp.pTgt = (int *)&s_pWork->dtp.Time.minute;
break;
case SEQ_YEAR_SET:
@ -340,36 +349,37 @@ static int InputRtcDateTimeMain( void )
case SEQ_DAY_SET:
case SEQ_HOUR_SET:
case SEQ_MINUTE_SET:
case SEQ_SECOND_SET:
InputDecimal( s_pRTCWork->dtp.tgtp, &s_pRTCWork->inp );
InputDecimal( s_pWork->dtp.pTgt, &s_pWork->inp );
// 年月日入力ならば、曜日を算出して表示。
if( ( s_pRTCWork->dtp.seq == SEQ_YEAR_SET ) ||
( s_pRTCWork->dtp.seq == SEQ_MONTH_SET ) ||
( s_pRTCWork->dtp.seq == SEQ_DAY_SET ) ) {
s_pRTCWork->dtp.Date.week = CalcWeekFromDate( s_pRTCWork->dtp.Date.year, s_pRTCWork->dtp.Date.month, s_pRTCWork->dtp.Date.day );
PrintfSJIS( DATE_TOP_X + 10 * 8, DATE_TOP_Y, TXT_COLOR_BLACK, "%s", g_strWeek[ s_pRTCWork->dtp.Date.week ] );
// 年月日入力ならば、曜日を再計算
if( ( s_pWork->dtp.seq == SEQ_YEAR_SET ) ||
( s_pWork->dtp.seq == SEQ_MONTH_SET ) ||
( s_pWork->dtp.seq == SEQ_DAY_SET ) ) {
s_pWork->dtp.Date.week = CalcWeekFromDate( s_pWork->dtp.Date.year, s_pWork->dtp.Date.month, s_pWork->dtp.Date.day );
}
// 年・月入力ならば、日数を算出して、現在の入力日が日数を超えていたら修正する。
if( ( s_pRTCWork->dtp.seq == SEQ_YEAR_SET ) ||
( s_pRTCWork->dtp.seq == SEQ_MONTH_SET ) ) {
u32 dayNum = SYSM_GetDayNum( s_pRTCWork->dtp.Date.year, s_pRTCWork->dtp.Date.month );
if( dayNum < s_pRTCWork->dtp.Date.day ) {
s_pRTCWork->dtp.Date.day = dayNum;
PrintfSJIS( DATE_TOP_X + 7 * 8, DATE_TOP_Y, TXT_COLOR_BLACK, "%02d", s_pRTCWork->dtp.Date.day );
if( ( s_pWork->dtp.seq == SEQ_YEAR_SET ) ||
( s_pWork->dtp.seq == SEQ_MONTH_SET ) ) {
u32 dayNum = SYSM_GetDayNum( s_pWork->dtp.Date.year, s_pWork->dtp.Date.month );
if( dayNum < s_pWork->dtp.Date.day ) {
PrintfSJIS( DAY_TOP_X, DATE_TOP_Y, TXT_COLOR_WHITE, "%02d", s_pWork->dtp.Date.day );
PrintfSJIS( DAY_TOP_X, DATE_TOP_Y, TXT_COLOR_BLACK, "%02d", dayNum );
s_pWork->dtp.Date.day = dayNum;
}
}
break;
case SEQ_END:
s_pRTCWork->dtp.Date.year -= 2000; // yearをする。
s_pRTCWork->dtp.Time.second = 0;
s_pWork->dtp.Time.second = 0;
{
RTCDate date; // +-2000を処理するのが面倒なので、別バッファにコピーして処理
MI_CpuCopy32( &s_pWork->dtp.Date, &date, sizeof(RTCDate) );
date.year -= 2000;
(void)RTC_SetDateTime( &date, &s_pWork->dtp.Time );
NCD_SetRtcOffset( SYSM_CalcRtcOffsetAndSetDateTime( &date, &s_pWork->dtp.Time ) );
}
NCD_SetRtcOffset( SYSM_CalcRtcOffsetAndSetDateTime( &s_pRTCWork->dtp.Date, &s_pRTCWork->dtp.Time ) );
GetSYSMWork()->rtc[0].Date = s_pRTCWork->dtp.Date;
GetSYSMWork()->rtc[0].Time = s_pRTCWork->dtp.Time;
GetSYSMWork()->ncd_invalid = 0;
GetNCDWork()->option.input_rtc = 1; // RTC入力フラグを立てる。
// ::::::::::::::::::::::::::::::::::::::::::::::
@ -377,34 +387,44 @@ static int InputRtcDateTimeMain( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
(void)NVRAMm_WriteNitroConfigData( GetNCDWork() );
// SEQ_ENDの時はこのままリターンする。
// 上画面の表示更新
GetAndDrawRTCData( &g_rtcDraw, TRUE );
case SEQ_RETURN:
g_pNowProcess = SetRTCMain;
InputRtcDateTimeInit( 0 ); // 日付入力画面のクリア
return 0;
case SEQ_CANCEL:
// 日付・時刻表示を元の値に戻して表示更新
DrawDateTime( &s_pWork->dtp.Date, &s_pWork->dtp.Time, TXT_COLOR_WHITE );
DrawDateTime( &s_pWork->dtp.Date_old, &s_pWork->dtp.Time_old, TXT_COLOR_BLACK );
MI_CpuCopy32( &s_pWork->dtp.Date_old, &s_pWork->dtp.Date, sizeof(RTCDate) );
MI_CpuCopy32( &s_pWork->dtp.Time_old, &s_pWork->dtp.Time, sizeof(RTCTime) );
g_pNowProcess = SetRTCMain;
InputRtcDateTimeInit( 0 ); // 日付入力画面のクリア
return 0;
}
if( s_pRTCWork->dtp.seq & 0x01 ) { // SEQ_**_SETの時のみ有効
if( s_pWork->dtp.seq & 0x01 ) { // SEQ_**_SETの時のみ有効
if( ( pad.trg & PAD_BUTTON_A ) || tp_ok ) {
s_pRTCWork->dtp.seq = SEQ_END; // Aボタンで決定
s_pWork->dtp.seq = SEQ_END; // Aボタンで決定
}else if( ( pad.trg & PAD_BUTTON_B ) || tp_cancel ) { // Bボタンでキャンセル
s_pRTCWork->dtp.seq = SEQ_RETURN;
s_pWork->dtp.seq = SEQ_CANCEL;
}else if( pad.trg & PAD_KEY_LEFT ) {
if( s_pRTCWork->dtp.seq == SEQ_YEAR_SET ) {
s_pRTCWork->dtp.seq = SEQ_SECOND_INIT;
if( s_pWork->dtp.seq == SEQ_YEAR_SET ) {
s_pWork->dtp.seq = SEQ_MINUTE_INIT;
}else {
s_pRTCWork->dtp.seq -= 3;
s_pWork->dtp.seq -= 3;
}
}else if( pad.trg & PAD_KEY_RIGHT ) {
if( s_pRTCWork->dtp.seq == SEQ_SECOND_SET ) {
s_pRTCWork->dtp.seq = SEQ_YEAR_INIT;
if( s_pWork->dtp.seq == SEQ_MINUTE_SET ) {
s_pWork->dtp.seq = SEQ_YEAR_INIT;
}else {
s_pRTCWork->dtp.seq++;
s_pWork->dtp.seq++;
}
}
}else { // SEQ_**_INITの時のみ有効
s_pRTCWork->dtp.seq++;
s_pWork->dtp.seq++;
}
return 0;
}
@ -442,51 +462,58 @@ RTCWeek CalcWeekFromDate( u32 year, u32 month, u32 day )
/*
// 文字列によるパラメータ選択
static void SelectString(int *tgtp, const u8 **const srtpp, InputNumParam *inpp)
static void SelectString(int *pTgt, const u8 **const ppStr, InputNumParam *pInp )
{
BOOL value_up = FALSE;
BOOL value_down = FALSE;
const u8 *pStr_old = *pTgt;
if(inpp->y_offset == 0) {
inpp->up_count = S_UPDOWN_COUNT_MAX;
if( pInp->y_offset == 0 ) {
pInp->up_count = S_UPDOWN_COUNT_MAX;
}else {
inpp->up_count ++;
if(inpp->up_count > S_UPDOWN_COUNT_MAX) {
inpp->up_count = 0;
if(inpp->y_offset < 0) value_up = TRUE;
else value_down = TRUE;
pInp->up_count ++;
if( pInp->up_count > S_UPDOWN_COUNT_MAX ) {
pInp->up_count = 0;
if( pInp->y_offset < 0 ) value_up = TRUE;
else value_down = TRUE;
}
}
if((pad.trg & PAD_KEY_DOWN) || (value_down)) { // 表示文字列切り替え
if(++*tgtp>inpp->value_max) *tgtp = 0;
}else if((pad.trg & PAD_KEY_UP) || (value_up)) {
if(--*tgtp & 0x8000) *tgtp = inpp->value_max;
if( ( pad.trg & PAD_KEY_DOWN ) || value_down ) { // 表示文字列切り替え
if( ++ *pTgt > pInp->value_max ) {
*pTgt = 0;
}
}else if( ( pad.trg & PAD_KEY_UP ) || value_up ) {
if( -- *pTgt & 0x8000 ) {
*pTgt = pInp->value_max;
}
}
(void)DrawStringSJIS( inpp->pos_x, inpp->pos_y, HIGHLIGHT_Y, srtpp[*tgtp]); // 現在選択している文字列を表示
PutStringUTF16( pInp->pos_x, pInp->pos_y, TXT_COLOR_WHITE, pStr_old ); // 旧文字列を消去
PutStringUTF16( pInp->pos_x, pInp->pos_y, TXT_COLOR_BLACK, ppStr[ *pTgt ] ); // 現在選択している文字列を表示
}
*/
// 10進数数値入力
void InputDecimal( int *tgtp, InputNumParam *inpp )
void InputDecimal( int *pTgt, InputNumParam *pInp )
{
BOOL value_up = FALSE;
BOOL value_down = FALSE;
int old = *pTgt;
if( inpp->y_offset == 0 ) {
inpp->up_count = D_UP_COUNT_MAX;
inpp->down_count = D_DOWN_COUNT_MAX;
}else if( inpp->y_offset < 0 ) {
inpp->down_count += inpp->y_offset;
if( inpp->down_count < D_DOWN_COUNT_MAX ) {
inpp->down_count = 0;
if( pInp->y_offset == 0 ) {
pInp->up_count = D_UP_COUNT_MAX;
pInp->down_count = D_DOWN_COUNT_MAX;
}else if( pInp->y_offset < 0 ) {
pInp->down_count += pInp->y_offset;
if( pInp->down_count < D_DOWN_COUNT_MAX ) {
pInp->down_count = 0;
value_down = TRUE;
}
}else { // y_offset > 0
inpp->up_count += inpp->y_offset;
if( inpp->up_count > D_UP_COUNT_MAX ) {
inpp->up_count = 0;
pInp->up_count += pInp->y_offset;
if( pInp->up_count > D_UP_COUNT_MAX ) {
pInp->up_count = 0;
value_up = TRUE;
}
}
@ -495,18 +522,19 @@ void InputDecimal( int *tgtp, InputNumParam *inpp )
if( value_down ||
( pad.trg & PAD_KEY_UP ) ||
( ( pad.cont & PAD_KEY_UP ) && ( pad.cont & PAD_BUTTON_R ) ) ) {
if( --*tgtp < inpp->value_min ) {
*tgtp = inpp->value_max;
if( --*pTgt < pInp->value_min ) {
*pTgt = pInp->value_max;
}
}else if( value_up ||
( pad.trg & PAD_KEY_DOWN ) ||
( ( pad.cont & PAD_KEY_DOWN ) && ( pad.cont & PAD_BUTTON_R ) ) ) {
if( ++*tgtp > inpp->value_max ) {
*tgtp = inpp->value_min;
if( ++*pTgt > pInp->value_max ) {
*pTgt = pInp->value_min;
}
}
PrintfSJIS( inpp->pos_x, inpp->pos_y, TXT_COLOR_GREEN, "%02d", *tgtp );
PrintfSJIS( pInp->pos_x, pInp->pos_y, TXT_COLOR_WHITE, "%02d", old );
PrintfSJIS( pInp->pos_x, pInp->pos_y, TXT_COLOR_GREEN, "%02d", *pTgt );
// 対象値をハイライト表示
}
@ -527,4 +555,3 @@ void ClearRTC( void )
// ::::::::::::::::::::::::::::::::::::::::::::::
(void)NVRAMm_WriteNitroConfigData( GetNCDWork() );
}