📄 lcdwin.lst
字号:
C51 COMPILER V8.05a LCDWIN 04/11/2008 14:19:26 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE LCDWIN
OBJECT MODULE PLACED IN LCDWin.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\LCDDriver\LCDWin.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTE
-ND PRINT(.\LCDWin.lst) OBJECT(LCDWin.obj)
line level source
1 /*
2 *********************************************************************************************************
3 * uC/GUI
4 * Universal graphic software for embedded applications
5 *
6 * (c) Copyright 2002, Micrium Inc., Weston, FL
7 * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
8 *
9 * 礐/GUI is protected by international copyright laws. Knowledge of the
10 * source code may not be used to write a similar product. This file may
11 * only be used in accordance with a license and should not be redistributed
12 * in any way. We appreciate your understanding and fairness.
13 *
14 ----------------------------------------------------------------------
15 File : LCDWin.C
16 Purpose : Driver for Simulator under Windows
17 ----------------------------------------------------------------------
18 Version-Date---Author-Explanation
19 ----------------------------------------------------------------------
20 2.00 010402 RS a) LCD_GetDevCaps removed from driver
21 (now LCD.c)
22 1.30c 000529 JE a) Interface changed
23 1.30b 000428 RS a) DIB class eliminated
24 b) Internal cleanups, support for high color
25 1.30a 000417 RS a) Major cleanup in DIB class
26 1.30 000309 RS a) Interface change for emWIn V1.30
27 (LCD_L0_SetLUTEntry, LCD_GetDevCap)
28 1.10a 000121 RS a) RECTHEIGHT, RECTWIDTH modified in order to
29 fix bug which would at some time prevent
30 displaying the first line of the display.
31 1.10.00 000110 RS a) Modifications in order to make it easy to
32 implement driver in any windows program
33 1.04.02 991118 RS a) additional assertion added
34 LCD_MAX_LOG_COLORS
35 1.04.01 991018 RS a) Support for LCD_FIXEDPALETTE added
36 with Anitaliasing enabled
37 1.04.00 991013 JE/RS a) Support for LCD_FIXEDPALETTE added
38 b) Driver now accepts the same LCDConf.h as
39 the embedded system
40 c) Bugfix for ..
41 1.02.02 990831 RS a) Small optimization added for 16-color bitmaps
42 1.02.01 990726 RS a) Transparency support for 16-color bitmpas
43 added
44 1.02.00 990212 RS a) New interface version 1.02 supported
45 1.00 990118 RS First release
46 ----------------------------------------------------------------------
47 Known problems or limitations with current version
48 ----------------------------------------------------------------------
49 ---------------------------END-OF-HEADER------------------------------
50 */
51
52
53 #if defined(WIN32) && !defined(LCD_SIMCONTROLLER)
C51 COMPILER V8.05a LCDWIN 04/11/2008 14:19:26 PAGE 2
#include <windows.h>
#include "gui\Core\LCD.h"
#include "gui\Core\LCD_Private.h" /* include LCDConf.h */
#include "gui\Core\LCDSim.h"
#include "gui\Core\GUI_Private.h"
#include "gui\Core\memory.h"
#if LCD_BITSPERPIXEL <= 8
#define PIXELINDEX U8
#else
#define PIXELINDEX WORD
#endif
#ifdef WIN32
#ifndef ASSERT
#define ASSERT(Val) \
if (!(Val)) \
MessageBox(NULL,"...in file "__FILE__,"Assertion failed...",MB_OK);
#endif
#endif
#ifdef LCD_ASSERT
#undef LCD_ASSERT
#endif
#define LCD_ASSERT(v) ASSERT(v)
#ifndef LCD_DISPLAY_INDEX
#define LCD_DISPLAY_INDEX 0
#endif
/*
*********************************************************
* *
* Macros for internal use *
* *
*********************************************************
*/
#define SETPIXEL(x, y, c) LCDSIM_SetPixelIndex(x, y, c)
#define GETPIXEL(x, y) LCD_GetPixel(x,y)
#define XORPIXEL(x, y) XorPixel(x,y)
#if LCD_DISPLAY_INDEX == 1 /* Second display in a multi-display configuration */
#define LCDSIM_SetPixelIndex LCDSIM_1_SetPixelIndex
#define LCDSIM_SetLUTEntry LCDSIM_1_SetLUTEntry
#endif
/*
*********************************************************
* *
* ID translation table *
* *
*********************************************************
This table contains 0, 1, 2, ... and serves as translation table for DDBs
*/
#define INTS(Base) Base+0,Base+1,Base+2,Base+3,Base+4,Base+5, \
Base+6,Base+7,Base+8,Base+9,Base+10,Base+11, \
C51 COMPILER V8.05a LCDWIN 04/11/2008 14:19:26 PAGE 3
Base+12,Base+13,Base+14,Base+15
static void XorPixel (int x, int y) {
unsigned int Index = LCD_L0_GetPixelIndex(x,y);
LCDSIM_SetPixelIndex(x, y, LCD_NUM_COLORS-1-Index);
}
/*
*********************************************************
* *
* LCD_L0_SetColorIndex *
* LCD_L0_SetBkColorIndex *
* *
*********************************************************
*/
#define COLORINDEX LCD_COLORINDEX
#define BKCOLORINDEX LCD_BKCOLORINDEX
/*
*********************************************************
* *
* LCD_L0_DrawPixel *
* *
*********************************************************
Purpose: This routine is called by emWin. It writes 1 pixel into the
display.
*/
void LCD_L0_DrawPixel(int x, int y) {
if (GUI_Context.DrawMode & LCD_DRAWMODE_XOR) {
XORPIXEL(x, y);
} else {
SETPIXEL(x, y, COLORINDEX);
}
}
/*
*********************************************************
* *
* LCD_DrawLine vertical/horizontal *
* LCD_DrawRect *
* *
*********************************************************
*/
void LCD_L0_DrawHLine (int x0, int y, int x1) {
if (GUI_Context.DrawMode & LCD_DRAWMODE_XOR) {
for (;x0 <= x1; x0++) {
XORPIXEL(x0, y);
}
} else {
// LCDSIM_FillLine(x0,y,x1,COLORINDEX);
for (;x0 <= x1; x0++) {
SETPIXEL(x0, y, COLORINDEX);
}
}
C51 COMPILER V8.05a LCDWIN 04/11/2008 14:19:26 PAGE 4
}
void LCD_L0_DrawVLine (int x, int y0, int y1) {
if (GUI_Context.DrawMode & LCD_DRAWMODE_XOR) {
while (y0 <= y1) {
XORPIXEL(x, y0);
y0++;
}
} else {
while (y0 <= y1) {
SETPIXEL(x, y0, COLORINDEX);
y0++;
}
}
}
void LCD_L0_FillRect(int x0, int y0, int x1, int y1) {
for (; y0 <= y1; y0++) {
LCD_L0_DrawHLine(x0,y0, x1);
}
}
/*
***************************************************************
* *
* Internal bitmap routines *
* *
***************************************************************
*/
/*
*********************************************
* *
* Draw Bitmap 1 BPP *
* *
*********************************************
*/
static void DrawBitLine1BPP(int x, int y, U8 const*p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans) {
LCD_PIXELINDEX Index0 = *(pTrans+0);
LCD_PIXELINDEX Index1 = *(pTrans+1);
x+=Diff;
/*
// Jump to right entry point
*/
switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS|LCD_DRAWMODE_XOR)) {
case 0: /* Write mode */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -