|
楼主 |
发表于 2013-7-26 16:24:31
|
显示全部楼层
本帖最后由 nicksean 于 2013-7-26 21:38 编辑
改成这样试试:- void ShowBMPOneStreamXOR(const BYTE *pFont, BYTE bytes, BYTE pos0, BYTE pos1, BYTE ra0, BYTE ra1)
- {
- BYTE i;
- BYTE dataA, dataB, stuff;
-
- if(pos1 == pos0) //ÆðÖ¹µãÔÚͬһ¸ö¿éÄÚ
- {
- stuff = T6963_ReadData(No_move); //½ö´ËÒ»¿éÊý¾Ý
- dataA = (*pFont >> ra0) ^ stuff; //×ÖÄ£Êý¾ÝÓëÔÊý¾ÝÔËËã
- T6963_WriteData(dataA, Increase);
- }
- else
- {
- if(ra0 == 0)
- {
- for(i = pos0; i < pos1; ++i)
- {
- stuff = T6963_ReadData(No_move);
- T6963_WriteData(stuff ^ *pFont++, Increase);
- }
-
- if(ra1 != 0)
- {
- stuff = T6963_ReadData(No_move);//×îºóÒ»¿éÊý¾Ý
- T6963_WriteData(stuff ^ *pFont, Increase);
- }
- }
- else
- {
- dataB = 0;
- for(i = 0; i < bytes; ++i)
- {
- stuff = T6963_ReadData(No_move);
- dataA = *pFont >> ra0 | dataB; //×ÖÄ£Êý¾ÝÇ°°ë²¿·ÖÓëÉϴεĺó°ë²¿·ÖºÏ²¢
- dataB = (*pFont++) << (8 - ra0); //×ÖÄ£Êý¾Ýºó°ë²¿·Ö(ÕâÀï¼ÙÉèÁË×ÖÄ£¿Õ°×ÇøÌî³ä0)
-
- T6963_WriteData(stuff ^ dataA, Increase);
- }
-
- if(i <= pos1 - pos0 && ra1 != 0) // the last RAM byte
- {
- stuff = T6963_ReadData(No_move); //×îºóÒ»¿éÊý¾Ý
-
- dataA = dataB;
-
- T6963_WriteData(stuff ^ dataA, Increase);
- }
- }
- }
- }
复制代码 |
|