ctr_Repair/trunk/CardSaveData/ToSD/body/source/screen/screen.h

116 lines
2.6 KiB
C++

#ifndef SCREEN_H_
#define SCREEN_H_
#include <string.h>
#include <nn/types.h>
#include "../../../../common/gui/gui.h"
//パネルのID
enum {
EVNT_NONE,
EVNT_YES,
EVNT_NO,
EVNT_QUIT,
EVNT_PUSH_A,
EVNT_PUSH_B,
EVNT_PUSH_R,
EVNT_PUSH_L,
EVNT_PUSH_X,
EVNT_PUSH_Y,
EVNT_PUSH_LEFT_X,
EVNT_PUSH_DOWN_Y,
EVNT_SEL_READ,
EVNT_SEL_WRITE,
EVNT_SEL_END,
EVNT_ERROR,
EVNT_FATAL
};
typedef struct{
char *str;
eColor color;
u8 pad[3];
}tColStr;
#define LST_MAX 30
#define LST_LENGTH 128
class cStrLst {
private:
int pos;
int buttom;
char str[LST_MAX][LST_LENGTH];
public:
cStrLst():pos(0){};
void add(char *p){
if (pos>=LST_MAX)return;
//char *s = &str[pos][0];
int i;
if (pos == buttom)
{
i =0;
while(i < buttom){ strcpy(str[i],str[i+1]);i++;}
}else pos++;
i=0;
while(i < (LST_LENGTH-1)){ //オーバーロード対策
if (p[i]!=0){
str[pos][i] = p[i];
i++;
}else break;
}
str[pos][i] = 0;
//strcpy(str[pos],p);
//for (i =0;i<LST_LENGTH;i++){
// s[i]=p[i];
// if (p[i] ==0) return;
//}
};
void clr(){pos = 0;for (int i =0;i<LST_MAX;i++)str[i][0]=0;};
u16 getpos(){return pos;};
char* line(u16 ln){return &str[ln][0];};
bool setbuttom(int btm)
{
if ((btm<0)||(btm>=LST_MAX))return false;
buttom = btm;
return true;
}
};
//Topメニューでのエラー表示用のフラグ
//bitチェック
#define SDATA_ERRPUT_PCODE 1
#define SDATA_ERRPUT_MEDIA 2
#define SDATA_ERRPUT_VERIFI 4
bool ScrInitialize(uptr heap,u32 size);
void ScrFinalize();
void ScrClr();
int ScrDbgLogGetMax();
void ScrStep();
void scr_TopMenuDbg(bool formatted,bool insertted);
void scr_TopMenu(bool formatted,bool inserted,bool sdins,int err);
void scr_ErrorQuitDbg(tColStr **s);
void scr_SuccessQuitDbg(tColStr **s);
void scr_ConfirmDbg(char *str);
void scr_DgbLog(cStrLst *p);
void scr_BackupYesNo();
void scr_Backup();
void scr_RestoreYesNo();
void scr_Restore();
void scr_InsExitQuit();
void scr_Status(char *s,eColor col);
void scr_ResultQuit(char *s,eColor col);
void scr_CountPerMax(int ct,int max);
void scr_CountPerMax2(int ct,int max,int total);
void scr_PrdCode(char *s);
void scr_PrdCodeEx(char *s);
void scr_DelConf();
void scr_MessOnCount2(char *str);
void scr_Draw();
void scr_GetEvnt();
#endif