From 9215521ecba7bfb9e954aac7d663562efe9323fb Mon Sep 17 00:00:00 2001 From: yoshida_teruhisa Date: Mon, 19 Nov 2007 03:55:45 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=AB=E3=83=A9=E3=83=BC=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=E7=94=BB=E9=9D=A2=E3=81=A7=E3=82=A8=E3=83=B3=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=82=20=E8=AA=95=E7=94=9F=E6=97=A5=E9=81=B8?= =?UTF-8?q?=E6=8A=9E=E7=94=BB=E9=9D=A2=E3=82=BF=E3=83=83=E3=83=81=E3=83=91?= =?UTF-8?q?=E3=83=83=E3=83=89=E5=AF=BE=E5=BF=9C=E6=BA=96=E5=82=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@207 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../MachineSettings/ARM9/src/setOwnerInfo.c | 56 +++++++++++++---- .../data/BGData_MachineSettings.c | 60 ++++++++++++++++++- build/systemMenu_RED/misc/src/misc.c | 2 +- 3 files changed, 106 insertions(+), 12 deletions(-) diff --git a/build/systemMenu_RED/MachineSettings/ARM9/src/setOwnerInfo.c b/build/systemMenu_RED/MachineSettings/ARM9/src/setOwnerInfo.c index 04a0227c..8aaff644 100644 --- a/build/systemMenu_RED/MachineSettings/ARM9/src/setOwnerInfo.c +++ b/build/systemMenu_RED/MachineSettings/ARM9/src/setOwnerInfo.c @@ -29,11 +29,13 @@ #define CLIST_KEY_PER_SEGMENT 5 #define CLIST_SEGMENT_INTERVAL 7 +// キャンセルボタン領域 #define CANCEL_BUTTON_TOP_X ( 2 * 8 ) #define CANCEL_BUTTON_TOP_Y ( 21 * 8 ) #define CANCEL_BUTTON_BOTTOM_X ( CANCEL_BUTTON_TOP_X + (8 * 8) ) #define CANCEL_BUTTON_BOTTOM_Y ( CANCEL_BUTTON_TOP_Y + (2 * 8) ) +// OKボタン領域 #define OK_BUTTON_TOP_X ( 26 * 8 ) #define OK_BUTTON_TOP_Y ( 21 * 8 ) #define OK_BUTTON_BOTTOM_X ( OK_BUTTON_TOP_X + (4 * 8) ) @@ -71,6 +73,9 @@ typedef enum NameOrComment // extern data---------------------------------- +extern u32 bg_char_data[16 * 3]; +extern u16 bg_scr_data[32 * 32]; +extern u16 bg_birth_scr_data[32 * 32]; // function's prototype------------------------- static void SetNicknameInit( void ); @@ -249,6 +254,10 @@ void SetOwnerInfoInit( void ) s_pStrSetting[ i ] = s_pStrSettingElemTbl[ i ][ TSD_GetLanguage() ]; } + // BGデータのロード処理 + GX_LoadBG1Char(bg_char_data, 0, sizeof(bg_char_data)); + GX_LoadBG1Scr(bg_scr_data, 0, sizeof(bg_scr_data)); + DrawOwnerInfoMenuScene(); SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 ); @@ -598,17 +607,40 @@ static int SetNicknameMain( void ) return 0; } +// 誕生日編集画面の表示 static void DrawSetBirthdayScene( void ) { NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_NULL ); PutStringUTF16( 0, 0, TXT_COLOR_BLUE, (const u16 *)L"BIRTHDAY" ); PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"ACANCEL" ); PutStringUTF16( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"@OK" ); - PutStringUTF16( 128-36+16, 12*8, TXT_COLOR_BLACK, (const u16 *)L"月   日" ); - PrintfSJIS( 128-36, 12*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month / 10); - PrintfSJIS( 128-28, 12*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month % 10); - PrintfSJIS( 128+12, 12*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day / 10); - PrintfSJIS( 128+20, 12*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day % 10); + PutStringUTF16( 128-36+16, 11*8, TXT_COLOR_BLACK, (const u16 *)L"月   日" ); + PrintfSJIS( 128-36, 11*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month / 10); + PrintfSJIS( 128-28, 11*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month % 10); + PrintfSJIS( 128+12, 11*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day / 10); + PrintfSJIS( 128+20, 11*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day % 10); +} + +// SetBirthdayMainのSelectSomethingByTPで使うSelectSomethingFuncの実装 +static BOOL SelectBirthdayFunc( u16 *csr, TPData *tgt ) +{ + int l; + + // 単純な実装例 + // 有効範囲全部について押されたかどうかの確認 + // 有効範囲の区分が多い時は、タッチパッドの座標から確認範囲を絞るのが望ましい + for(l=0; l<4; l++) + { + int x = 12*8 + (l%2)*6*8; + int y = 8*8 + (l/2)*6*8; + if(WithinRangeTP( x, y, 16, 16, tgt )) + { + *csr = (u16)l; + return TRUE; + } + } + + return FALSE; } // 誕生日編集の初期化 @@ -627,6 +659,10 @@ static void SetBirthdayInit( void ) s_pStrSetting[ i ] = s_pStrSettingElemTbl[ i ][ TSD_GetLanguage() ]; } + // BGデータのロード処理 + GX_LoadBG1Char(bg_char_data, 0, sizeof(bg_char_data)); + GX_LoadBG1Scr(bg_birth_scr_data, 0, sizeof(bg_birth_scr_data)); + DrawSetBirthdayScene(); SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 ); @@ -640,7 +676,7 @@ static void SetBirthdayInit( void ) // 誕生日編集メイン static int SetBirthdayMain( void ) { - SelectSomethingFunc func[2]={SelectCancelFunc, SelectOKFunc}; + SelectSomethingFunc func[3]={SelectBirthdayFunc, SelectCancelFunc, SelectOKFunc}; u8 maxday; BOOL tp_touch = FALSE; @@ -667,9 +703,9 @@ static int SetBirthdayMain( void ) if( s_temp_birthday.day > maxday ) s_temp_birthday.day = 1; // TPチェック - tp_touch = SelectSomethingByTP(&tp_csr, func, 2 ); + tp_touch = SelectSomethingByTP(&tp_csr, func, 3 ); if (tp_touch && (tp_csr != KEY_OK && tp_csr != KEY_CANCEL)){ - //s_birth_csr = tp_csr; + // 月日変更処理 } DrawSetBirthdayScene(); @@ -789,7 +825,7 @@ static int SetUserColorMain( void ) // TPチェック tp_touch = SelectSomethingByTP(&tp_csr, func, 3 ); - if (tp_csr != KEY_OK && tp_csr != KEY_CANCEL){ + if (tp_touch && (tp_csr != KEY_OK && tp_csr != KEY_CANCEL)){ s_color_csr = (u8)tp_csr; } @@ -866,7 +902,7 @@ static int SetCommentMain( void ) } //====================================================== -// ニックネーム入力用キャラテーブル +// ソフトウェアキーボード用キャラテーブル //====================================================== static const u16 char_tbl[CHAR_LIST_MODE_NUM][CHAR_LIST_CHAR_NUM] = { diff --git a/build/systemMenu_RED/data/BGData_MachineSettings.c b/build/systemMenu_RED/data/BGData_MachineSettings.c index a2dcfbe0..6e319009 100644 --- a/build/systemMenu_RED/data/BGData_MachineSettings.c +++ b/build/systemMenu_RED/data/BGData_MachineSettings.c @@ -8,8 +8,66 @@ u32 bg_char_data[16 * 3] = { 0xeeeeeeee, 0xeeeeeeee, 0xeeeeeeee, 0xeeeeeeee, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,// 0003h 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,// 0004h(右上^) + 0xfffffff1, 0xfffffff1, 0xfffff11f, 0xfffff11f, + 0xfff11fff, 0xfff11fff, 0xf11fffff, 0xf11fffff,// 0005h(右下^) + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, }; + +// BGスクリーンデータ1 +u16 bg_birth_scr_data[32 * 32]= +{ + 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,//0 + 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001, + 0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,//1 + 0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//2 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//3 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//4 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//5 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//6 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//7 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1404,0x1004,0x1003,0x1003,//8 + 0x1003,0x1003,0x1404,0x1004,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1405,0x1005,0x1003,0x1003,//9 + 0x1003,0x1003,0x1405,0x1005,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//10 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//11 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//12 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//13 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1c05,0x1805,0x1003,0x1003,//14 + 0x1003,0x1003,0x1c05,0x1805,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1c04,0x1804,0x1003,0x1003,//15 + 0x1003,0x1003,0x1c04,0x1804,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//16 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//17 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//18 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//19 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//20 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//21 + 0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003, + 0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,//22 + 0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802, + 0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,//23 + 0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801, +};// Buffer for screen data(背景の枠) + // BGスクリーンデータ1 u16 bg_scr_data[32 * 32]= { @@ -61,4 +119,4 @@ u16 bg_scr_data[32 * 32]= 0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802, 0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,//23 0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801, -};// Buffer for screen data(背景の枠) \ No newline at end of file +};// Buffer for screen data(誕生日設定のBG) \ No newline at end of file diff --git a/build/systemMenu_RED/misc/src/misc.c b/build/systemMenu_RED/misc/src/misc.c index ea3706d1..adaa70f4 100644 --- a/build/systemMenu_RED/misc/src/misc.c +++ b/build/systemMenu_RED/misc/src/misc.c @@ -523,7 +523,7 @@ void DrawMenu( u16 nowCsr, const MenuParam *pMenu ) } // タッチパネルによる選択を行う関数・汎用版。 -// 主にチャタリングを吸収する程度の性能を持つ。 +// 主にチャタリングを吸収する程度の機能を持つ。 // SelectSomethingFunc型の関数ポインタfuncには、次に示す条件を満たす関数を作り、リストにしてセットして使う。 // 1.要素上でタッチしていればTRUEを返し、そうでなければFALSEを返す。 // 2.第一引数に与えたポインタの指す変数にカーソル位置を入れて返す。