ctr_Repair/trunk/CardSaveData/Mover/body/source/screen/screen.cpp

800 lines
22 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <wchar.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <nn.h>
#include <stdio.h>
#include "screen.h"
#include "../../../../common/my_defs.h"
#include "../../ver.h"
Gui gui;
u8 scr_evnt;
//タイトル用ワーク
//サイズオーバ注意
tChar wS_Title[32];
//eColor wC_Title;
enum{
//PANEL_END,
PANEL_ERROR,
PANEL_SUCCESS,
PANEL_TOPMENU,
PANEL_TITLE,
PANEL_QUIT,
PANEL_READ,
PANEL_WRITE,
PANEL_YES,
PANEL_NO,
PANEL_CONFIRM,
PANEL_DELCONF,
PANEL_MENU,
PANEL_BKUP,
PANEL_INSEJECT,
PANEL_DBGLOG
};
enum{
MESSAGE_VERSION,
MESSAGE_PRODUCT,
MESSAGE_PRODUCT2,
MESSAGE_ERROR_TITLE,
MESSAGE_ERROR_INFO,
MESSAGE_ERROR_INFO2,
MESSAGE_ERROR_INFO3,
MESSAGE_SUCCESS_TITLE,
MESSAGE_SUCCESS_INFO,
MESSAGE_SUCCESS_INFO2,
MESSAGE_CONFIRM_TITLE,
MESSAGE_CONFIRM_MSG,
MESSAGE_DELCONF_TITLE,
MESSAGE_DELCONF_MSG,
MESSAGE_DELCONF_MSG2,
MESSAGE_DELCONF_MSG3,
MESSAGE_TITLE,
MESSAGE_MENU_READ,
MESSAGE_MENU_WRITE,
MESSAGE_MENU_OPERATE,
MESSAGE_MENU_CAUTION,
MESSAGE_MENU_ERROR,
MESSAGE_MENU_DEBUG,
MESSAGE_INSEJC_1,
MESSAGE_INSEJC_2,
MESSAGE_INSEJC_3,
MESSAGE_OPERATE,
MESSAGE_RESULT,
MESSAGE_QUIT_OPERATE,
MESSAGE_CONF,
MESSAGE_COUNT,
MESSAGE_COUNT2,
MESSAGE_STATUS
};
enum{
MEMO_DBGLOG
};
//画面消去、コンポーネントをディセーブル
void ScrClr()
{
gui.ButtonMask(0);
gui.DisableAll();
gui.Draw();
}
nn::os::Tick holdTck;
u32 holdVal;
//---------------------------------イベントコールバック
//----------------PADボタン
void pushButton(u32 sts)
{
//NN_LOG("button > %4x\n",button);
u32 trg = sts & 0x0ffff;
u32 hld = sts >> 16;
if( holdVal )//押し続け判定
{
if (hld != holdVal)
{
holdVal = 0;
}else
if (nn::fnd::TimeSpan::FromMilliSeconds(4000) < (nn::os::Tick::GetSystemCurrent()-holdTck))
{
holdVal = 0;
scr_evnt = EVNT_PUSH_LEFT_X;
}
}else if (hld == ( nn::hid::BUTTON_LEFT | nn::hid::BUTTON_X ))
{
holdVal = hld;
holdTck = nn::os::Tick::GetSystemCurrent();
}
else if (trg & nn::hid::BUTTON_B)scr_evnt = EVNT_PUSH_B;
}
//-----------------パネルをタッチ
// ---- Top Menu :READ
void touchRead(u32 pos NN_IS_UNUSED_VAR)
{
scr_evnt = EVNT_SEL_READ;
}
// ---- Top Menu :WRITE
void touchWrite(u32 pos NN_IS_UNUSED_VAR)
{
scr_evnt = EVNT_SEL_WRITE;
}
//---- Top Menu :END
//void touchEnd(u32 pos NN_IS_UNUSED_VAR)
//{
// scr_evnt = EVNT_SEL_END;
//}
//---- YES
void touchYes(u32 pos NN_IS_UNUSED_VAR)
{
scr_evnt = EVNT_YES;
}
//---- NO
void touchNo(u32 pos NN_IS_UNUSED_VAR)
{
scr_evnt = EVNT_NO;
}
void touchQuit(u32 pos NN_IS_UNUSED_VAR)
{
scr_evnt = EVNT_QUIT;
}
#define NULL_PTR 0
#define NULL_STR 0
#define SCREEN_UPPER 0
#define SCREEN_LOWER 1
#define LOC_CONF_X 60
#define LOC_CONF_Y 20
#define LOC_CONF_W (400 - LOC_CONF_X*2)
#define LOC_CONF_H 70
#define LOC_LOG_X 50
#define LOC_LOG_W (400 - LOC_LOG_X*2)
#define LOC_LOG_Y (LOC_CONF_Y + LOC_CONF_H + 10)
#define LOC_LOG_H (240 - LOC_LOG_Y - 10)
#define LOG_MAX 10
// -------------------------------------------------- コンポーネント設計
//表示文字列
enum {//index of message string
I_Backup,
I_Restore,
I_Yes,
I_No,
I_Quit,
I_Space,
I_Execute,
I_HelpBackup,
I_HelpRestore,
I_Touch,
I_Version,
I_QuitB,
I_Inseject,
I_RetTop,
I_InsejectSD,
I_Restart1,
I_Restart2,
I_Del,
I_Del2,
I_Del3,
I_Title,
I_TitleCp,
I_InsertCard,
I_TitleBkup,
I_TitleRestore,
I_CardChk,
I_EndNum
};
tChar* S_StringsJp[I_EndNum] = {
L"読込",
L"書込",
L"はい",
L"いいえ",
L"戻る",
L" ",
L"実行しますか?",
L"[読込] カードから読む",
L"[書込] カードに書く",
L"タッチで実行します",
L"",
L"タッチかBボタンで戻ります",
L"カードの挿抜を検知しました",
L"開始画面に戻ります",
L"SDの挿抜を検知しました",
L"動作中は禁止です",
L"電源OFFからやり直してください",
L" ** 削除 ** ",
L"    注意",
L"読出したデータを削除します",
L"   <カードセーブ移行>",
L"   - コピーモード -",
L"カードを挿入して下さい",
L" -- カードから読込 --",
L" -- カードへ書込 --",
L" 確認してます"
};
tChar* S_Strings[I_EndNum] = {
L"Backup",
L"Restore",
L"YES",
L"NO",
L"Quit",
L" ",
L"Do you execute?",
L"[Backup] read from Card",
L"[Restore] write to Card",
L"Touch below",
L"version",
L"touch [Quit] or push B",
L"CARD insert or pull out is detected",
L"return to top menu",
L"SD insert or pull out is ",
L"prohibited during operation",
L" turn off the power and restart",
L" *** DELETE *** ",
L" caution!",
L"this is delete backup",
L" < CTR Card Savedata Mover >",
L" - Copy mode -",
L"Please Insert Card",
L" --- Backup Card Savedata ---",
L"--- Restore Card Savedata ---",
L"Checking"
};
//文字列ポインタ格納
tChar* pS_Str[I_EndNum];
//Top Menu
const tPanel panel_Read = {(uptr)touchRead,NULL_STR,80+20,30,160,80,PANEL_READ,SCREEN_LOWER};
const tPanel panel_Write = {(uptr)touchWrite,NULL_STR,80+20,130,160,80,PANEL_WRITE,SCREEN_LOWER};
//const tPanel panel_End = {(uptr)touchEnd,"End",80,180,160,30,PANEL_END,SCREEN_LOWER};
//Yes No
const tPanel panel_Yes = {(uptr)touchYes,NULL_STR,40+10,60,80,120,PANEL_YES,SCREEN_LOWER};
const tPanel panel_No = {(uptr)touchNo,NULL_STR,200+30,60,80,120,PANEL_NO,SCREEN_LOWER};
//Quit
const tPanel panel_Quit = {(uptr)touchQuit,NULL_STR,80+20,60,160,120,PANEL_QUIT,SCREEN_LOWER};
//通常時
//タイトル
#define FONT_SIZE_TITLE 12
#define LOC_TITL_X (40-FONT_SIZE_TITLE*2)
#define LOC_TITL_Y 20
#define LOC_TITL_W (400 - LOC_CONF_X*2)
#define LOC_TITL_H 50
#define FONT_SIZE_PRODUCT 10
const tPanel panel_title = {NULL_PTR,NULL_STR,LOC_TITL_X,LOC_TITL_Y,LOC_TITL_W,LOC_TITL_H,PANEL_TITLE,SCREEN_UPPER};
const tMessage mess_title = {NULL_STR,0,0,COLOR_WHITE,FONT_SIZE_TITLE,MESSAGE_TITLE,PANEL_TITLE};
const tMessage mess_product = {NULL_STR,0,LOC_TITL_H - 22,COLOR_WHITE,FONT_SIZE_PRODUCT,MESSAGE_PRODUCT,PANEL_TITLE};
const tMessage mess_product2 = {NULL_STR,0,LOC_TITL_H - 10,COLOR_WHITE,FONT_SIZE_PRODUCT,MESSAGE_PRODUCT2,PANEL_TITLE};
const tMessage mess_version = {NULL_STR,LOC_TITL_W-FONT_SIZE_PRODUCT*6,FONT_SIZE_TITLE+2,COLOR_WHITE,FONT_SIZE_PRODUCT,MESSAGE_VERSION,PANEL_TITLE};
#define LOC_MESS_X 20
#define LOC_MESS_W (400 - LOC_MESS_X*2)
#define LOC_MESS_Y (LOC_TITL_Y + LOC_TITL_H + 10)
#define LOC_MESS_H (240 - LOC_MESS_Y - 10)
//TOPメニュー
#define FONT_SIZE 10
#define STR_LINE(ln) (FONT_SIZE + 2)*ln
const tPanel panel_menu = {NULL_PTR,NULL_STR,LOC_MESS_X,LOC_MESS_Y,LOC_MESS_W,LOC_MESS_H,PANEL_MENU,SCREEN_UPPER};
const tMessage mess_menu_read = {NULL_STR,10,STR_LINE(1),COLOR_WHITE,FONT_SIZE,MESSAGE_MENU_READ,PANEL_MENU};
const tMessage mess_menu_write = {NULL_STR,10,STR_LINE(2),COLOR_WHITE,FONT_SIZE,MESSAGE_MENU_WRITE,PANEL_MENU};
const tMessage mess_menu_operate = {NULL_STR,10,STR_LINE(4),COLOR_GREEN,FONT_SIZE,MESSAGE_MENU_OPERATE,PANEL_MENU};
const tMessage mess_bkuperr = {NULL_STR,10,STR_LINE(6),COLOR_RED,FONT_SIZE,MESSAGE_MENU_ERROR,PANEL_MENU};
const tMessage mess_carderr = {NULL_STR,10,STR_LINE(7),COLOR_YELLO,FONT_SIZE,MESSAGE_MENU_CAUTION,PANEL_MENU};
//Backup
const tPanel panel_bkup = {NULL_PTR,NULL_STR,LOC_MESS_X,LOC_MESS_Y,LOC_MESS_W,LOC_MESS_H,PANEL_BKUP,SCREEN_UPPER};
const tMessage mess_quit_operate = {NULL_STR,10,STR_LINE(4),COLOR_SKY,FONT_SIZE,MESSAGE_QUIT_OPERATE,PANEL_BKUP};
const tMessage mess_conf = {NULL_STR,10,STR_LINE(2),COLOR_WHITE,FONT_SIZE,MESSAGE_CONF,PANEL_BKUP};
const tMessage mess_result = {NULL_STR,10,STR_LINE(2),COLOR_WHITE,FONT_SIZE,MESSAGE_RESULT,PANEL_BKUP};
const tMessage mess_operate = {NULL_STR,10,STR_LINE(4),COLOR_GREEN,FONT_SIZE,MESSAGE_OPERATE,PANEL_BKUP};
const tMessage mess_status = {NULL_STR,10,STR_LINE(7),COLOR_WHITE,FONT_SIZE,MESSAGE_STATUS,PANEL_BKUP};
const tMessage mess_count = {NULL_STR,10,STR_LINE(8),COLOR_WHITE,FONT_SIZE,MESSAGE_COUNT,PANEL_BKUP};
const tMessage mess_count2 = {NULL_STR,10,STR_LINE(9),COLOR_GREEN,FONT_SIZE,MESSAGE_COUNT2,PANEL_BKUP};
//挿抜発生時
const tPanel panel_inseject = {NULL_PTR,NULL_STR,LOC_MESS_X,LOC_MESS_Y,LOC_MESS_W,LOC_MESS_H,PANEL_INSEJECT,SCREEN_UPPER};
const tMessage mess_inseject = {NULL_STR,10,STR_LINE(3),COLOR_RED,10,MESSAGE_INSEJC_1,PANEL_INSEJECT};
const tMessage mess_inseject2 = {NULL_STR,10,STR_LINE(5),COLOR_WHITE,10,MESSAGE_INSEJC_2,PANEL_INSEJECT};
const tMessage mess_inseject3 = {NULL_STR,10,STR_LINE(6),COLOR_WHITE,10,MESSAGE_INSEJC_3,PANEL_INSEJECT};
//削除確認
const tPanel panel_delconf = {NULL_PTR,NULL_STR,LOC_MESS_X,LOC_MESS_Y-36,LOC_MESS_W,LOC_MESS_H,PANEL_DELCONF,SCREEN_UPPER};
const tMessage mess_delconf_Title = {NULL_STR,10,10,COLOR_YELLO,16,MESSAGE_DELCONF_TITLE,PANEL_DELCONF};
const tMessage mess_delconf_Msg = {NULL_STR,10,50,COLOR_YELLO,12,MESSAGE_DELCONF_MSG,PANEL_DELCONF};
const tMessage mess_delconf_Msg2 = {NULL_STR,10,70,COLOR_YELLO,12,MESSAGE_DELCONF_MSG2,PANEL_DELCONF};
const tMessage mess_delconf_Msg3 = {NULL_STR,10,90,COLOR_YELLO,12,MESSAGE_DELCONF_MSG3,PANEL_DELCONF};
nn::os::LightEvent stopEvnt(true);
tChar scr_ver[16];
tChar scr_err[32];
bool ScrInitialize(uptr heap,u32 size,u8 flag)
{
int i;
scr_evnt = EVNT_NONE;
holdVal = 0;
holdTck = nn::fnd::TimeSpan(0);
if (gui.Initialize(heap,size,&stopEvnt)==false)return false;
//日本語 or 英語
if (flag & SCR_FLG_JP)for (i =0;i<I_EndNum;i++)pS_Str[i] = S_StringsJp[i];
else
for (i =0;i<I_EndNum;i++)pS_Str[i] = S_Strings[i];
gui.ButtonCallback((uptr)pushButton);
//コンポーネント登録
gui.PanelSet(&panel_Read);
gui.PanelSet(&panel_Write);
gui.PanelSet(&panel_Yes);
gui.PanelSet(&panel_No);
gui.PanelSet(&panel_Quit);
gui.PanelSet(&panel_delconf);
gui.PanelSet(&panel_title);
gui.PanelSet(&panel_menu);
gui.PanelSet(&panel_bkup);
gui.PanelSet(&panel_inseject);
gui.PanelLineStyle(PANEL_TITLE,COLOR_BLACK);
gui.MessSet(&mess_delconf_Title);
gui.MessSet(&mess_delconf_Msg);
gui.MessSet(&mess_delconf_Msg2);
gui.MessSet(&mess_delconf_Msg3);
gui.MessSet(&mess_title);
gui.MessSet(&mess_version);
gui.MessSet(&mess_product);
gui.MessSet(&mess_product2);
gui.MessSet(&mess_menu_read);
gui.MessSet(&mess_menu_write);
gui.MessSet(&mess_menu_operate);
gui.MessSet(&mess_quit_operate);
gui.MessSet(&mess_conf);
gui.MessSet(&mess_operate);
gui.MessSet(&mess_bkuperr);
gui.MessSet(&mess_carderr);
gui.MessSet(&mess_result);
gui.MessSet(&mess_status);
gui.MessSet(&mess_count);
gui.MessSet(&mess_count2);
gui.MessSet(&mess_inseject);
gui.MessSet(&mess_inseject2);
gui.MessSet(&mess_inseject3);
gui.MessEffective(MESSAGE_ERROR_TITLE);
gui.MessEffective(MESSAGE_ERROR_INFO);
gui.MessEffective(MESSAGE_ERROR_INFO2);
gui.MessEffective(MESSAGE_ERROR_INFO3);
gui.MessEffective(MESSAGE_SUCCESS_TITLE);
gui.MessEffective(MESSAGE_SUCCESS_INFO);
gui.MessEffective(MESSAGE_SUCCESS_INFO2);
gui.MessEffective(MESSAGE_CONFIRM_TITLE);
gui.MessEffective(MESSAGE_CONFIRM_MSG);
gui.MessEffective(MESSAGE_DELCONF_TITLE);
gui.MessEffective(MESSAGE_DELCONF_MSG);
gui.MessEffective(MESSAGE_DELCONF_MSG2);
gui.MessEffective(MESSAGE_DELCONF_MSG3);
gui.MessEffective(MESSAGE_MENU_READ);
gui.MessEffective(MESSAGE_MENU_WRITE);
gui.MessEffective(MESSAGE_MENU_OPERATE);
gui.MessEffective(MESSAGE_INSEJC_1);
gui.MessEffective(MESSAGE_INSEJC_2);
gui.MessEffective(MESSAGE_INSEJC_3);
gui.MessEffective(MESSAGE_TITLE);
gui.MessEffective(MESSAGE_VERSION);
gui.PanelLineStyle(PANEL_DELCONF,COLOR_YELLO);
if (VERSION != 0.0){
swprintf(scr_ver,10,L"ver %.2f",VERSION);
if (flag & SCR_FLG_DBG)wcscat(scr_ver,L" DEBUG");
}else wcscpy(scr_ver,VERSION_TXT_W);
gui.MessStr(MESSAGE_VERSION,scr_ver);
gui.MessStr(MESSAGE_MENU_CAUTION,scr_err);
gui.MessStr(MESSAGE_MENU_ERROR,scr_err);
gui.MessStr(MESSAGE_MENU_READ,pS_Str[I_HelpBackup]);
gui.MessStr(MESSAGE_MENU_WRITE,pS_Str[I_HelpRestore]);
gui.MessStr(MESSAGE_MENU_OPERATE,pS_Str[I_Touch]);
gui.MessStr(MESSAGE_QUIT_OPERATE,pS_Str[I_QuitB]);
gui.MessStr(MESSAGE_CONF,pS_Str[I_Execute]);
gui.MessStr(MESSAGE_OPERATE,pS_Str[I_Touch]);
gui.MessStr(MESSAGE_INSEJC_1,pS_Str[I_Inseject]);
gui.MessStr(MESSAGE_INSEJC_2,pS_Str[I_RetTop]);
gui.MessStr(MESSAGE_INSEJC_3,pS_Str[I_QuitB]);
gui.MessStr(MESSAGE_DELCONF_TITLE,pS_Str[I_Del]);
gui.MessStr(MESSAGE_DELCONF_MSG,pS_Str[I_Del2]);
gui.MessStr(MESSAGE_DELCONF_MSG2,pS_Str[I_Del3]);
gui.MessStr(MESSAGE_DELCONF_MSG3,pS_Str[I_Execute]);
gui.PanelCaption(PANEL_READ,pS_Str[I_Backup]);
gui.PanelCaption(PANEL_WRITE,pS_Str[I_Restore]);
gui.PanelCaption(PANEL_YES,pS_Str[I_Yes]);
gui.PanelCaption(PANEL_NO,pS_Str[I_No]);
gui.PanelCaption(PANEL_QUIT,pS_Str[I_Quit]);
if (flag & SCR_FLG_CP){//コピーモードなら画面に変化
//ボタン枠色変更
gui.PanelLineStyle(PANEL_READ,COLOR_YELLO);
gui.PanelLineStyle(PANEL_WRITE,COLOR_YELLO);
gui.PanelLineStyle(PANEL_YES,COLOR_YELLO);
gui.PanelLineStyle(PANEL_NO,COLOR_YELLO);
gui.PanelLineStyle(PANEL_QUIT,COLOR_YELLO);
//タイトル
//wS_Title = pS_Str[I_TitleCp];
wcscpy(wS_Title,pS_Str[I_TitleCp]);
gui.MessCol(MESSAGE_TITLE,COLOR_YELLO);
}else wcscpy(wS_Title,pS_Str[I_Title]);
//}else wS_Title = pS_Str[I_Title];
//if (flag & SCR_FLG_NOSD)wcscat(wS_Title,L" (no SD)");
//else
if (flag & SCR_FLG_FSD)wcscat(wS_Title,L" (use SD)");
return true;
}
void ScrFinalize()
{
stopEvnt.Signal();
while(stopEvnt.TryWait()){
nn::os::Thread::Yield();
};
gui.Finalize();
}
//YES-NO ボタン
void YesNo()
{
gui.ButtonMask(nn::hid::BUTTON_A | nn::hid::BUTTON_B);
gui.PanelEffective(PANEL_YES);
gui.PanelEffective(PANEL_NO);
gui.Draw();
}
void Quit()
{
gui.ButtonMask(nn::hid::BUTTON_A | nn::hid::BUTTON_B);
gui.PanelEffective(PANEL_QUIT);
gui.Draw();
}
//通常時
//プロダクトコード
//引数:カード、拡張セーブに記録されたもの
tChar scr_pcode[32];
tChar scr_pcode2[32];
void scr_PrdCode(char *s)
{
wcscpy(scr_pcode,L"CARD : ");
if (s[0]==0) wcscat(scr_pcode,L"----");
else mbstowcs(&scr_pcode[7],s,30);
gui.MessStr(MESSAGE_PRODUCT,scr_pcode);
}
void scr_PrdCodeEx(char *s)
{
wcscpy(scr_pcode2,L"BKUP : ");
if (s[0]==0) wcscat(scr_pcode2,L"----");
else mbstowcs(&scr_pcode2[7],s,30);
gui.MessStr(MESSAGE_PRODUCT2,scr_pcode2);
}
//削除の実行確認
void scr_DelConf()
{
scr_evnt = EVNT_NONE;
gui.PanelEffective(PANEL_DELCONF);
YesNo();
}
//エラー表示
inline void set_err(int i)
{
swprintf(scr_err,16,L"ERROR %d",i);
}
inline void set_err(wchar_t* s)
{
wcscpy(scr_err,s);
}
//Top menu
void scr_TopMenu(int mode,int err)
{
gui.MessStr(MESSAGE_TITLE,wS_Title);
gui.MessEffective(MESSAGE_MENU_ERROR,false,false);
gui.MessEffective(MESSAGE_MENU_CAUTION,false,false);
gui.MessEffective(MESSAGE_MENU_OPERATE,false,false);
gui.PanelEffective(PANEL_WRITE,false,false);
gui.PanelEffective(PANEL_READ,false,false);
if (err){
switch (err){//警告、エラー表示
case SCR_ERRPUT_CARD://カードが無いワーニング
set_err(pS_Str[I_InsertCard]);
gui.MessEffective(MESSAGE_MENU_CAUTION);
break;
case SCR_ERRPUT_CARD2://カード確認中
set_err(pS_Str[I_CardChk]);
gui.MessEffective(MESSAGE_MENU_CAUTION);
break;
case SCR_ERRPUT_PCODE://プロダクトコード不一致
set_err(TGT_CARD + ERC_PRODCODE);
gui.MessEffective(MESSAGE_MENU_ERROR);
break;
case SCR_ERRPUT_MEDIA://セーブデータがマウントできない
set_err(TGT_CARD + ERC_MEDIA);
gui.MessEffective(MESSAGE_MENU_ERROR);
break;
default://実行エラー
set_err(TGT_CTR + ERC_EXEC);
gui.MessEffective(MESSAGE_MENU_ERROR);
break;
}
}else{
if (mode == SCR_MENU_READ){
gui.MessEffective(MESSAGE_MENU_OPERATE);
gui.PanelEffective(PANEL_READ);
}else
if (mode == SCR_MENU_WRITE){
gui.MessEffective(MESSAGE_MENU_OPERATE);
gui.PanelEffective(PANEL_WRITE);
}
}
//LEFT+X = Delete 有効
gui.ButtonMask(nn::hid::BUTTON_LEFT | nn::hid::BUTTON_X);
gui.MessEffective(MESSAGE_PRODUCT);
gui.MessEffective(MESSAGE_PRODUCT2);
gui.PanelEffective(PANEL_TITLE);
gui.PanelEffective(PANEL_MENU);
gui.Draw();
}
//デバッグ用、ボタン待ち
void ScrStep()
{
scr_evnt = EVNT_NONE;
gui.ButtonMask(nn::hid::BUTTON_B);
}
void ClearBkupMess()
{
gui.MessEffective(MESSAGE_CONF,false,false);
gui.MessEffective(MESSAGE_RESULT,false,false);
gui.MessEffective(MESSAGE_OPERATE,false,false);
gui.MessEffective(MESSAGE_QUIT_OPERATE,false,false);
gui.MessEffective(MESSAGE_STATUS,false,false);
gui.MessEffective(MESSAGE_COUNT,false,false);
gui.MessEffective(MESSAGE_COUNT2,false,false);
gui.PanelEffective(PANEL_BKUP);
}
//Backup
void scr_Backup()
{
scr_evnt = EVNT_NONE;
gui.PanelLineStyle(PANEL_BKUP,COLOR_SKY);
gui.MessStr(MESSAGE_TITLE,pS_Str[I_TitleBkup]);
gui.PanelEffective(PANEL_TITLE);
ClearBkupMess();
gui.Draw();
}
void scr_BackupYesNo()
{
scr_Backup();
gui.MessEffective(MESSAGE_CONF);
gui.MessEffective(MESSAGE_OPERATE);
YesNo();
}
//restore
void scr_Restore()
{
scr_evnt = EVNT_NONE;
gui.PanelLineStyle(PANEL_BKUP,COLOR_PARPL);
gui.MessStr(MESSAGE_TITLE,pS_Str[I_TitleRestore]);
gui.PanelEffective(PANEL_TITLE);
ClearBkupMess();//backupと同じパネルを使う
gui.Draw();
}
void scr_RestoreYesNo()
{
scr_Restore();
gui.MessEffective(MESSAGE_CONF);
gui.MessEffective(MESSAGE_OPERATE);
YesNo();
}
void scr_Status(tChar *s,eColor col)
{
gui.MessCol(MESSAGE_STATUS,col);
gui.MessStr(MESSAGE_STATUS,s);
gui.MessEffective(MESSAGE_STATUS);
gui.Draw_U();
}
void scr_ResultQuit(tChar *s,eColor col)
{
gui.MessCol(MESSAGE_RESULT,col);
gui.MessStr(MESSAGE_RESULT,s);
gui.MessEffective(MESSAGE_RESULT);
gui.MessEffective(MESSAGE_QUIT_OPERATE);
Quit();
}
void scr_InsEjectQuit()
{
ClearBkupMess();
gui.PanelLineStyle(PANEL_INSEJECT,COLOR_RED);
gui.PanelEffective(PANEL_INSEJECT);
Quit();
}
void scr_InsEjectSD()
{
ClearBkupMess();
gui.MessStr(MESSAGE_INSEJC_1,pS_Str[I_InsejectSD]);
gui.MessStr(MESSAGE_INSEJC_2,pS_Str[I_Restart1]);
gui.MessStr(MESSAGE_INSEJC_3,pS_Str[I_Restart2]);
gui.PanelLineStyle(PANEL_INSEJECT,COLOR_RED);
gui.PanelEffective(PANEL_INSEJECT);
gui.Draw();
}
// カウント/MAX 表示
tChar str_Counter[32];
tChar str_Counter2[32];
void scr_CountPerMax(int ct,int max)
{
swprintf(str_Counter,30,L"%d / %d",ct,max);
gui.MessStr(MESSAGE_COUNT,str_Counter);
gui.MessEffective(MESSAGE_COUNT);
// gui.Draw();
}
//ゲージ
void scr_Gage(int ct,int max)
{
int i,lv;
lv = ct/(max/25);
for (i =0;i<lv;i++)str_Counter2[i] = L'>';
while ( i < 25 )str_Counter2[i++] = L'|';
str_Counter2[i] = 0;
//sprintf(str_Counter2,"%d / %d",ct,max);
gui.MessStr(MESSAGE_COUNT2,str_Counter2);
gui.MessEffective(MESSAGE_COUNT2);
//gui.Draw();
}
//total
void scr_Total(int total)
{
swprintf(str_Counter2,30,L"total size %d",total);
gui.MessStr(MESSAGE_COUNT2,str_Counter2);
gui.MessEffective(MESSAGE_COUNT2);
//gui.Draw();
}
void scr_MessOnCount2(tChar *str)
{
// gui.MessCol(MESSAGE_COUNT2,COLOR_YELLO);
gui.MessStr(MESSAGE_COUNT2,str);
gui.MessEffective(MESSAGE_COUNT2);
gui.Draw();
}
//実行確認
void scr_ConfirmDbg(tChar *str)
{
scr_evnt = EVNT_NONE;
gui.MessStr(MESSAGE_CONFIRM_TITLE,str);
gui.PanelEffective(PANEL_CONFIRM);
YesNo();
}
//エラー表示とQuitボタン
void scr_ErrorQuitDbg(tColStr **s)
{
scr_evnt = EVNT_NONE;
gui.MessStr(MESSAGE_ERROR_TITLE,s[0]->str);
gui.MessCol(MESSAGE_ERROR_TITLE,s[0]->color);
gui.MessStr(MESSAGE_ERROR_INFO,s[1]->str);
gui.MessCol(MESSAGE_ERROR_INFO,s[1]->color);
gui.MessStr(MESSAGE_ERROR_INFO2,s[2]->str);
gui.MessCol(MESSAGE_ERROR_INFO2,s[2]->color);
gui.MessStr(MESSAGE_ERROR_INFO3,s[3]->str);
gui.MessCol(MESSAGE_ERROR_INFO3,s[3]->color);
gui.PanelEffective(PANEL_ERROR);
Quit();
}
//成功表示とQuitボタン
void scr_SuccessQuitDbg(tColStr **s)
{
scr_evnt = EVNT_NONE;
gui.MessStr(MESSAGE_SUCCESS_TITLE,s[0]->str);
gui.MessCol(MESSAGE_SUCCESS_TITLE,s[0]->color);
gui.MessStr(MESSAGE_SUCCESS_INFO,s[1]->str);
gui.MessCol(MESSAGE_SUCCESS_INFO,s[1]->color);
gui.MessStr(MESSAGE_SUCCESS_INFO2,s[2]->str);
gui.MessCol(MESSAGE_SUCCESS_INFO2,s[2]->color);
gui.PanelEffective(PANEL_SUCCESS);
Quit();
}
void scr_Draw()
{
gui.Draw();
}
void scr_Vsnc()
{
gui.WaitVsnc();
}
void scr_GetEvnt()
{
// gui.thUpdate();
}