#include <stdio.h>
char vstr_bur[64];
void DB_Prt(char idx, char* char_ptr, ... ){
va_list args;
int i;
static char tempstr[20][64]={""};
static char index=0;
char prt_idx=0;
//const int left=800-6*64-20;
const int left=800-6*64-20;
va_start(args, char_ptr);
vsprintf(vstr_bur, char_ptr, args);
va_end(args);
printf("%s",vstr_bur);
if(idx != 0)
index = idx;
GUI_SetTextMode(GUI_TM_NORMAL);
GUI_SetFont(&GUI_Font6x8);
GUI_SetColor(GUI_WHITE);
GUI_SetBkColor(GUI_TRANSPARENT);
if(index >=20) index=0;
strncpy(tempstr[index], vstr_bur, sizeof(tempstr[0])-1);
#if 1
GUI_DispStringAtCEOL(tempstr[index],left+10,10+index*10);
#elif 0
for(i=(index +1 )%20;i<20;i++,prt_idx++){
if(i == index )
GUI_DispStringAt("*",left,10+prt_idx*10);
else
GUI_DispStringAt(" ",left,10+prt_idx*10);
GUI_DispStringAtCEOL(tempstr[prt_idx],left+10,10+prt_idx*10);
}
if(index!=19){
for(i=0;i<=index;i++,prt_idx++){
if(i == index )
GUI_DispStringAt("*",left,10+prt_idx*10);
else
GUI_DispStringAt(" ",left,10+prt_idx*10);
GUI_DispStringAtCEOL(tempstr[prt_idx],left+10,10+prt_idx*10);
}
}
#else
for(i=0;i<20;i++){
if(i == index )
GUI_DispStringAtCEOL("*",left,10+i*10);
else
GUI_DispStringAtCEOL(" ",left,10+i*10);
GUI_DispStringAtCEOL(tempstr[i],left+10,10+i*10);
}
#endif
index++;
GUI_SetTextMode(GUI_TM_TRANS); //透明文本
}
//#define printf(...) DB_Prt(0,__VA_ARGS__)
#不定參數 C 語言
#GUI 除錯字串
沒有留言:
張貼留言
手機選擇帳號後,按下發布 要再點選一次發布哦