?? lcd159a.lst
字號(hào):
if (pixels&(3<<0))
SETPIXEL(x+3, y, *(pTrans+(3&(pixels))));
if (!--xsize)
return;
pixels = *(++p);
x+=4;
goto WriteTBit0;
}
#endif
#endif
/*
*****************************************
*
* Draw Bitmap 4 BPP
* optimized
*
C51 COMPILER V8.05a LCD159A 04/11/2008 14:19:23 PAGE 20
*****************************************
*/
#if (LCD_MAX_LOG_COLORS > 4)
#if (LCD_OPTIMIZE) \
&& (!LCD_MIRROR_X) \
&& (!LCD_MIRROR_Y) \
&& (!LCD_SWAP_XY)
static void DrawBitLine4BPP(int x, int y, U8 const*p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans) {
LCD_PIXELINDEX 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:
WRITEDATA_DIRECT(*(pTrans+(pixels>>4)));
if (!--xsize)
return;
WriteBit1:
WRITEDATA_DIRECT(*(pTrans+(pixels&0xf)));
if (!--xsize)
return;
x+=2;
pixels = *(++p);
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;
}
#else
/*
*****************************************
*
C51 COMPILER V8.05a LCD159A 04/11/2008 14:19:23 PAGE 21
* Draw Bitmap 4 BPP
* no optimizations
*
*****************************************
*/
static void DrawBitLine4BPP(int x, int y, U8 const*p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans) {
LCD_PIXELINDEX 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);
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
#endif
/*
*****************************************
*
* Draw Bitmap 8 BPP
* optimized
C51 COMPILER V8.05a LCD159A 04/11/2008 14:19:23 PAGE 22
*
*****************************************
*/
#if (LCD_MAX_LOG_COLORS > 16)
#if (LCD_OPTIMIZE) \
&& (!LCD_MIRROR_X) \
&& (!LCD_MIRROR_Y) \
&& (!LCD_SWAP_XY)
static void DrawBitLine8BPP(int x, int y, U8 const*p, int xsize, const LCD_PIXELINDEX*pTrans) {
LCD_PIXELINDEX pixel;
if ((GUI_Context.DrawMode & LCD_DRAWMODE_TRANS)==0) {
if (pTrans) {
for (;xsize > 0; xsize--,x++,p++) {
pixel = *p;
WRITEDATA_DIRECT(*(pTrans+pixel));
}
} else {
for (;xsize > 0; xsize--,x++,p++) {
WRITEDATA_DIRECT(*p);
}
}
} else { /* Handle transparent bitmap */
if (pTrans) {
for (; xsize > 0; xsize--, x++, p++) {
pixel = *p;
if (pixel) {
SETPIXEL(x+0, y, *(pTrans+pixel));
}
}
} else {
for (; xsize > 0; xsize--, x++, p++) {
pixel = *p;
if (pixel) {
SETPIXEL(x+0, y, pixel);
}
}
}
}
}
#else
/*
*****************************************
*
* Draw Bitmap 8 BPP
* no optimizations
*
*****************************************
*/
static void DrawBitLine8BPP(int x, int y, U8 const*p, int xsize, const LCD_PIXELINDEX*pTrans) {
LCD_PIXELINDEX pixel;
if ((GUI_Context.DrawMode & LCD_DRAWMODE_TRANS)==0) {
if (pTrans) {
for (;xsize > 0; xsize--,x++,p++) {
pixel = *p;
SETPIXEL(x, y, *(pTrans+pixel));
}
C51 COMPILER V8.05a LCD159A 04/11/2008 14:19:23 PAGE 23
} else {
for (;xsize > 0; xsize--,x++,p++) {
SETPIXEL(x, y, *p);
}
}
} else { /* Handle transparent bitmap */
if (pTrans) {
for (; xsize > 0; xsize--, x++, p++) {
pixel = *p;
if (pixel) {
SETPIXEL(x+0, y, *(pTrans+pixel));
}
}
} else {
for (; xsize > 0; xsize--, x++, p++) {
pixel = *p;
if (pixel) {
SETPIXEL(x+0, y, pixel);
}
}
}
}
}
#endif
#endif
/*
*********************************************************
*
* Universal draw Bitmap routine
*
*********************************************************
*/
void LCD_L0_DrawBitmap (int x0, int y0,
int xsize, int ysize,
int BitsPerPixel,
int BytesPerLine,
const U8* pData, int Diff,
const LCD_PIXELINDEX* pTrans)
{
int i;
#if (LCD_OPTIMIZE) \
&& (!LCD_MIRROR_X) \
&& (!LCD_MIRROR_Y) \
&& (!LCD_SWAP_XY)
SET_RECT(x0 + Diff, y0, x0 + Diff + xsize - 1, y0 + ysize - 1);
#endif
/*
Use DrawBitLineXBPP
*/
for (i=0; i<ysize; i++) {
switch (BitsPerPixel) {
case 1:
DrawBitLine1BPP(x0, i + y0, pData, Diff, xsize, pTrans);
break;
#if (LCD_MAX_LOG_COLORS > 2)
case 2:
DrawBitLine2BPP(x0, i + y0, pData, Diff, xsize, pTrans);
break;
C51 COMPILER V8.05a LCD159A 04/11/2008 14:19:23 PAGE 24
#endif
#if (LCD_MAX_LOG_COLORS > 4)
case 4:
DrawBitLine4BPP(x0, i + y0, pData, Diff, xsize, pTrans);
break;
#endif
#if (LCD_MAX_LOG_COLORS > 16)
case 8:
DrawBitLine8BPP(x0, i + y0, pData, xsize, pTrans);
break;
#endif
}
pData += BytesPerLine;
}
}
/********************************************************
*
* LCD_L0_SetOrg
*
*********************************************************
Purpose: Sets the original position of the virtual display.
Has no function at this point with the PC-driver.
*/
int OrgX, OrgY;
void LCD_L0_SetOrg(int x, int y) {
OrgX = x;
OrgY = y;
}
/*
*****************************************
*
* LCD_On, LCD_Off
*
*****************************************
Sets the original position of the virtual display.
Has no function at this point with the PC-driver.
*/
void LCD_Off (void) {
#ifdef LCD_OFF
LCD_OFF();
#endif
}
void LCD_On (void) {
#ifdef LCD_ON
LCD_ON();
#endif
}
/*
*****************************************
*
* LCD_L0_Init
*
*****************************************
C51 COMPILER V8.05a LCD159A 04/11/2008 14:19:23 PAGE 25
*/
int LCD_L0_Init(void) {
int i;
GUI_DEBUG_LOG("\nLCD_Init()");
LCD_INIT_CONTROLLER();
/* set cursor to illegal value */
CurrentX = CurrentY = 0xfff;
/* clear LCD */
GOTOXY(0, 0, RAM_WRITE);
for (i = 0; i < LCD_XSIZE_PHYS * LCD_YSIZE_PHYS; i++) {
LCD_WRITEDATA0(0);
}
GOTOXY(0, 0, RAM_WRITE);
/* clear VRam */
#if LCD_CACHE
memset(VRam, 0, sizeof(VRam));
#endif
LCD_Off();
return 0;
}
/*
*****************************************
*
* LCD_L0_SetLUTEntry
*
*****************************************
This function is only a dummy
*/
void LCD_L0_SetLUTEntry(U8 Pos, LCD_COLOR Color) {
Pos = Pos;
Color = Color;
}
#else
1520
1521 void LCD159A(void) { } /* avoid empty object files */
1522
1523 #endif /* (LCD_CONTROLLER == 0x159A) */
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -