📄 lcd6642x.lst
字号:
Data = Index << (6 - (((i + x0) & 3) << 1));
Buffer |= Data;
break;
case LCD_DRAWMODE_XOR:
Index = *(pTrans + ((*pData & DataMask) >> (6 - ShiftPos))) * 3;
Data = Index << (6 - (((i + x0) & 3) << 1));
Buffer ^= Data;
break;
case LCD_DRAWMODE_TRANS:
Index = *(pTrans + ((*pData & DataMask) >> (6 - ShiftPos)));
if (Index) {
Buffer &= ~BufferMask;
Data = Index << (6 - (((i + x0) & 3) << 1));
Buffer |= Data;
}
break;
}
if (BufferMask == 3) {
BufferMask = 0xC0;
BufferValid = 0;
WRITE_VMEM0(Buffer);
} else {
BufferMask >>= 2;
}
}
if (BufferValid) {
WRITE_VMEM0(Buffer);
}
}
/*
*********************************************************
*
* Draw Bitmap 2 BPP no optimization
*
*********************************************************
*/
#else
static void DrawBitLine2BPP(int x, int y, U8 const *p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans)
-{
PIXELCOLOR pixels;
/*
// Jump to right entry point
*/
pixels = *p;
switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS|LCD_DRAWMODE_XOR)) {
C51 COMPILER V8.05a LCD6642X 04/11/2008 14:19:24 PAGE 21
case 0:
switch (Diff&3) {
case 0:
goto WriteBit0;
case 1:
goto WriteBit1;
case 2:
goto WriteBit2;
default:
goto WriteBit3;
}
case LCD_DRAWMODE_TRANS:
switch (Diff&3) {
case 0:
goto WriteTBit0;
case 1:
goto WriteTBit1;
case 2:
goto WriteTBit2;
default:
goto WriteTBit3;
}
case LCD_DRAWMODE_XOR:
switch (Diff&3) {
case 0:
goto WriteXBit0;
case 1:
goto WriteXBit1;
case 2:
goto WriteXBit2;
default:
goto WriteXBit3;
}
case LCD_DRAWMODE_TRANS|LCD_DRAWMODE_XOR:
switch (Diff&3) {
case 0:
goto WriteTXBit0;
case 1:
goto WriteTXBit1;
case 2:
goto WriteTXBit2;
default:
goto WriteTXBit3;
}
}
/*
Write without transparency
*/
WriteBit0:
SETPIXEL(x+0, y, *(pTrans+(pixels>>6)));
if (!--xsize)
return;
WriteBit1:
SETPIXEL(x+1, y, *(pTrans+(3&(pixels>>4))));
if (!--xsize)
return;
WriteBit2:
SETPIXEL(x+2, y, *(pTrans+(3&(pixels>>2))));
if (!--xsize)
return;
WriteBit3:
SETPIXEL(x+3, y, *(pTrans+(3&(pixels))));
C51 COMPILER V8.05a LCD6642X 04/11/2008 14:19:24 PAGE 22
if (!--xsize)
return;
pixels = *(++p);
x+=4;
goto WriteBit0;
/*
Write with transparency
*/
WriteTBit0:
if (pixels&(3<<6))
SETPIXEL(x+0, y, *(pTrans+(pixels>>6)));
if (!--xsize)
return;
WriteTBit1:
if (pixels&(3<<4))
SETPIXEL(x+1, y, *(pTrans+(3&(pixels>>4))));
if (!--xsize)
return;
WriteTBit2:
if (pixels&(3<<2))
SETPIXEL(x+2, y, *(pTrans+(3&(pixels>>2))));
if (!--xsize)
return;
WriteTBit3:
if (pixels&(3<<0))
SETPIXEL(x+3, y, *(pTrans+(3&(pixels))));
if (!--xsize)
return;
pixels = *(++p);
x+=4;
goto WriteTBit0;
/*
Write without transparency, xor
*/
WriteXBit0:
XORPIXEL_DATA(x+0, y, *(pTrans+(pixels>>6)));
if (!--xsize)
return;
WriteXBit1:
XORPIXEL_DATA(x+1, y, *(pTrans+(3&(pixels>>4))));
if (!--xsize)
return;
WriteXBit2:
XORPIXEL_DATA(x+2, y, *(pTrans+(3&(pixels>>2))));
if (!--xsize)
return;
WriteXBit3:
XORPIXEL_DATA(x+3, y, *(pTrans+(3&(pixels))));
if (!--xsize)
return;
pixels = *(++p);
x+=4;
goto WriteXBit0;
/*
Write with transparency, xor
*/
WriteTXBit0:
if (pixels&(3<<6))
XORPIXEL_DATA(x+0, y, *(pTrans+(pixels>>6)));
if (!--xsize)
return;
WriteTXBit1:
C51 COMPILER V8.05a LCD6642X 04/11/2008 14:19:24 PAGE 23
if (pixels&(3<<4))
XORPIXEL_DATA(x+1, y, *(pTrans+(3&(pixels>>4))));
if (!--xsize)
return;
WriteTXBit2:
if (pixels&(3<<2))
XORPIXEL_DATA(x+2, y, *(pTrans+(3&(pixels>>2))));
if (!--xsize)
return;
WriteTXBit3:
if (pixels&(3<<0))
XORPIXEL_DATA(x+3, y, *(pTrans+(3&(pixels))));
if (!--xsize)
return;
pixels = *(++p);
x+=4;
goto WriteTXBit0;
}
#endif
#endif
/*
*********************************************************
* *
* Draw Bitmap 4 BPP *
* *
*********************************************************
*/
#if (LCD_MAX_LOG_COLORS > 4)
static void DrawBitLine4BPP(int x, int y, U8 const *p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans)
-{
PIXELCOLOR pixels;
/*
// Jump to right entry point
*/
pixels = *p;
if (GUI_Context.DrawMode & LCD_DRAWMODE_TRANS) {
if ((Diff&1) ==0)
goto WriteTBit0;
goto WriteTBit1;
} else {
if ((Diff&1) ==0)
goto WriteBit0;
goto WriteBit1;
}
/*
Write without transparency
*/
WriteBit0:
SETPIXEL(x+0, y, *(pTrans+(pixels>>4)));
if (!--xsize)
return;
WriteBit1:
SETPIXEL(x+1, y, *(pTrans+(pixels&0xf)));
if (!--xsize)
return;
x+=2;
pixels = *(++p);
C51 COMPILER V8.05a LCD6642X 04/11/2008 14:19:24 PAGE 24
goto WriteBit0;
/*
Write with transparency
*/
WriteTBit0:
if (pixels>>4)
SETPIXEL(x+0, y, *(pTrans+(pixels>>4)));
if (!--xsize)
return;
WriteTBit1:
if (pixels&0xf)
SETPIXEL(x+1, y, *(pTrans+(pixels&0xf)));
if (!--xsize)
return;
x+=2;
pixels = *(++p);
goto WriteTBit0;
}
#endif
/*
*********************************************************
* *
* Draw Bitmap 8 BPP (256 colors) *
* *
* Default (no optimization) *
* *
*********************************************************
*/
#if (LCD_MAX_LOG_COLORS > 16)
static void DrawBitLine8BPP(int x, int y, U8 const *p, int xsize, const LCD_PIXELINDEX*pTrans) {
LCD_PIXELINDEX pixel;
if (pTrans) {
if ((GUI_Context.DrawMode & LCD_DRAWMODE_TRANS)==0) {
while (xsize > 0) {
pixel = *p;
SETPIXEL(x+0, y, *(pTrans+pixel));
xsize--; x++; p++;
}
} else { /* Handle transparent bitmap */
while (xsize > 0) {
pixel = *p;
if (pixel)
SETPIXEL(x+0, y, *(pTrans+pixel));
xsize--; x++; p++;
}
}
} else {
if ((GUI_Context.DrawMode & LCD_DRAWMODE_TRANS)==0) {
while (xsize > 0) {
pixel = *p;
SETPIXEL(x+0, y, pixel);
xsize--; x++; p++;
}
} else { /* Handle transparent bitmap */
while (xsize > 0) {
pixel = *p;
if (pixel)
SETPIXEL(x+0, y, pixel);
xsize--; x++; p+
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -