- //========================================================================
- // 函数: void PutChar(unsigned char x,unsigned char y,char a)
- // 描述: 写入一个标准字符
- // 参数: x X轴坐标 y Y轴坐标
- // a 要显示的字符在字库中的偏移量
- // 返回: 无
- // 备注: ASCII字符可直接输入ASCII码即可
- // 版本:
- // 2006/10/15 First version
- // 2007/01/11 V1.1
- // 2008/06/12 V2.0
- //========================================================================
- void PutChar(DOTBYTE x,DOTBYTE y,char a)
- {
- DOTBYTE i,j; //数据暂存
- FLASH *p_data;
- LCDBYTE Temp;
- BYTE Index = 0;
- if(Font_type==1)
- p_data = Char_TAB + (a-32)*Font_Wrod;
- else
- p_data = Char_TAB + a*Font_Wrod; //要写字符的首地址
- j = 0;
- while((j ++) < Y_Witch)
- {
- if(y > Dis_Y_MAX) break;
- i = 0;
- while(i < X_Witch)
- {
- if((i&0x07)==0)
- {
- // Temp = *(p_data + (Index>>1));
- // if((Index&0x01)==0)Temp = Temp>>8;
- Temp = *(p_data+Index);
- Index++;
- }
- if((Temp & 0x80) > 0) Writ_Dot/*Write_Dot_LCD*/((x+i),y,Char_Color);
- else if(Font_Cover) Writ_Dot/*Write_Dot_LCD*/((x+i),y,Char_BackColor);
- Temp = Temp << 1;
- if((x+i) >= Dis_X_MAX)
- {
- Index += (X_Witch-i)>>3;
- break;
- }
- i++;
- }
- y ++;
- }
- }
|