ASCII & 한글 완성형(KSC5601) 출력 소스
{
int i;
//int x=0, y=0;
//int w, h;
char string[4]={0,};
printf("ascii[95] display\n");
for(i=32; i<127; i++)
{
string[0] = i;
printf("[0x%02x]%s\n", string[0], string);
}
printf("hangul_wan[2350] test\n");
for(i=0xb0a0; i<=0xc8fe; i++)
{
char third=(i>>4)&0x000f;
if(third < 10) continue; //두번째 바이트의 상위 nibble은 A~F의 값을 가진다.
string[0] = i>>8;
string[1] = i&0x00ff;
if(string[1]==0xa0 || string[1]==0xff) continue; //두번째 바이트의 값이 0xa0 이거나 0xff인 경우 한글 코드 존재하지 않음
printf("[%#.04x]%s\n", i, string);
/*
LCD_GetTextSize(string, &w, &h);
if(x >= (LCD_WIDTH_PIXEL-w))
{
x = 0;
y += h;
}
if(y >= (LCD_HEIGHT_PIXEL-h))
{
y = 0;
KBD_GetCh();
LCD_Clear();
}
LCD_GotoXY(x, y);
LCD_PutCh(i);
LCD_Where((unsigned int*)&x, (unsigned int*)&y);
*/
}
}