⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphic.src

📁 how to use display powertip PG 320x240
💻 SRC
📖 第 1 页 / 共 2 页
字号:
; TASKING C166/ST10 C compiler v8.0r1 Build 651 SN 00096962
; options: -e -Ic:\program files\tasking\c166 v8.0\include -xmidfp
;          -DCPUTYPE=0x167 -Bhoeufmknladij -OB -zautobitastruct-4 -zautobita-0
;          -T256 -FSC -A1 -zvolatile_union -O0 -g -s -Mm
$DEBUG
$NOLOCALS
$EXTEND
$NOMOD166
$STDNAMES(reg262.def)
$EXTMAC
$SEGMENTED
$CASE
$MODEL(MEDIUM)
	NAME	GRAPHIC_C
	ASSUME	DPP3:SYSTEM
	?SYMB	'graphic.c',32,80,16
	?SYMB	'',1,82,0
	?SYMB	'80166',0,84,0
	?SYMB	'',0,81,0
	?SYMB	'void',00H,45,1
	?SYMB	'char',080000H,45,2
	?SYMB	'unsigned char',080000H,45,3
	?SYMB	'short',0100000H,45,4
	?SYMB	'unsigned short',0100000H,45,5
	?SYMB	'long',0200000H,45,6
	?SYMB	'unsigned long',0200000H,45,7
	?SYMB	'float',0200000H,45,10
	?SYMB	'double',0400000H,45,11
	?SYMB	'int',0100000H,45,16
	?SYMB	'unsigned int',0100000H,45,18
	?SYMB	'bit',010000H,7,256
	?SYMB	'graphic.c',0,29,1
	?SYMB	'',0,86,1
; graphic.c    1	//*****************************************************************************
; graphic.c    2	//  Project Name:   Graphic library for draw on graphic LCD
; graphic.c    3	//	Description:    Graphic library for draw on graphic LCD
; graphic.c    4	//	Filename:		graphic.c	
; graphic.c    5	//	Processor:      
; graphic.c    6	// 	Revision:       1.0
; graphic.c    7	//	Date:           20.04.2004
; graphic.c    8	//	Compiler:       C compiler IAR
; graphic.c    9	//	Author:         Radek Pulpan
; graphic.c   10	//	Company:
; graphic.c   11	// 	Email:          pulpan@centrum.cz
; graphic.c   12	//*****************************************************************************
; graphic.c   13	#include "common.h"
	?SYMB	'common.h',0,29,2
	?SYMB	'',0,86,2
	?SYMB	'types.h',0,29,3
	?SYMB	'',0,86,3
	?SYMB	'',0,86,2
	?SYMB	'appcfg.h',0,29,3
	?SYMB	'',0,86,3
	?SYMB	'',0,86,2
	?SYMB	'c:\program files\tasking\c166 v8.0\include\reg276.h',0,29,3
	?SYMB	'',0,86,3
	?SYMB	'',0,86,2
	?SYMB	'',0,86,1
; graphic.c   14	#include "graphic.h"
	?SYMB	'graphic.h',0,29,2
	?SYMB	'',0,86,2
	?SYMB	'T$1',0,40,257
	?SYMB	'x',0,23,5
	?SYMB	'y',16,23,5
	?SYMB	'',32,18,0
	?SYMB	'coordinate',257,13,258
	?SYMB	'',0,86,1
; graphic.c   15	#include "LCD_pg320240.h"
	?SYMB	'LCD_pg320240.h',0,29,2
	?SYMB	'',0,86,2
	?SYMB	'ports.h',0,29,3
	?SYMB	'',0,86,3
	?SYMB	'',0,86,2
	?SYMB	'',0,86,1
; graphic.c   16	
; graphic.c   17	
; graphic.c   18	void linex(coordinate a, unsigned short l, unsigned char Color)
; graphic.c   19	{
GRAPHIC_1_PR	SECTION	CODE WORD PUBLIC 'CPROGRAM'
	?LINE	19
	PUBLIC	_linex
	?SYMB	'linex',_linex,37,1
	?SYMB	'',19,8,34
_linex	PROC	NEAR
	?SYMB	'',00H,95,0
	SUB	R0,#04h
	?SYMB	'',$,96,4
; Locals:
;     Address = offset 0
;     Color = offset 10
;     i = offset 2
;     a = offset 4
;     l = offset 8
; 
; Statics:
; 
; CSEs:
; 
	?LINE	19
	?SYMB	'a',4,99,258
	?SYMB	'0',$,101,4
	?SYMB	'l',5,99,5
	?SYMB	'4',$,101,5
	?SYMB	'Color',2,99,3
	?SYMB	'6',$,101,2
; graphic.c   20		unsigned int i, Address;
	?LINE	20
	?SYMB	'i',3,98,18
	?SYMB	'-2',$,101,3
	?SYMB	'Address',1,98,18
	?SYMB	'-4',$,101,1
; graphic.c   21		a.x = a.x / 2;	
	?LINE	21
	MOV	R12,[R0+#04H]
	SHR	R12,#01h
	MOV	[R0+#04H],R12
; graphic.c   22		Address = a.x + (a.y * 160);
	?LINE	22
	MOV	R12,[R0+#04H]
	MOV	R13,[R0+#06H]
	MOV	R14,R13
	SHL	R14,#02h
	ADD	R14,R13
	SHL	R14,#05h
	ADD	R12,R14
	MOV	[R0],R12
; graphic.c   23		Color = (Color & 0x0F)|(Color << 4);
	?LINE	23
	MOVB	RL1,[R0+#0AH]
	ANDB	RL1,#0Fh
	MOVB	RL2,[R0+#0AH]
	MOVBZ	R2,RL2
	SHL	R2,#04h
	ORB	RL1,RL2
	MOVB	[R0+#0AH],RL1
; graphic.c   24		for (i=0; i<l; i+=2)
	?LINE	24
	MOV	R12,#00h
	MOV	[R0+#02H],R12
	JMPR	cc_UC,_6
_3:
; graphic.c   25		{
; graphic.c   26			if (Address < 8) lcd_write((Address + 0x95F8),Color);
	?LINE	26
	MOV	R12,[R0]
	CMP	R12,#08h
	JMPR	cc_UGE,_4
	MOV	R12,[R0]
	ADD	R12,#095F8h
	MOVB	RL1,[R0+#0AH]
	MOVBZ	R13,RL1
	CALLA	cc_UC,_lcd_write
	JMPR	cc_UC,_5
_4:
; graphic.c   27			else lcd_write(Address - 8,Color);
	?LINE	27
	MOV	R12,[R0]
	SUB	R12,#08h
	MOVB	RL1,[R0+#0AH]
	MOVBZ	R13,RL1
	CALLA	cc_UC,_lcd_write
_5:
; graphic.c   28			Address++;
	?LINE	28
	MOV	R12,[R0]
	ADD	R12,#01h
	MOV	[R0],R12
	?LINE	24
	MOV	R12,[R0+#02H]
	ADD	R12,#02h
	MOV	[R0+#02H],R12
_6:
	MOV	R12,[R0+#02H]
	MOV	R13,[R0+#08H]
	CMP	R12,R13
	JMPR	cc_ULT,_3
; graphic.c   29		}
; graphic.c   30	}
	?LINE	30
	?SYMB	'',$,102,1
	?SYMB	'',$,102,3
	?SYMB	'',$,102,2
	?SYMB	'',$,102,5
	?SYMB	'',$,102,4
	ADD	R0,#04h
	?SYMB	'',$,96,0
	RET
_linex	ENDP
	?SYMB	'',$,17,30
; graphic.c   31	//*****************************************************************************
; graphic.c   32	void liney(coordinate a, unsigned short l, unsigned char c)
; graphic.c   33	{
	?LINE	33
	PUBLIC	_liney
	?SYMB	'liney',_liney,37,1
	?SYMB	'',33,8,34
_liney	PROC	NEAR
	?SYMB	'',00H,95,0
	SUB	R0,#06h
	?SYMB	'',$,96,6
; Locals:
;     Color = offset 0
;     Address = offset 2
;     i = offset 4
;     a = offset 6
;     c = offset 12
;     l = offset 10
; 
; Statics:
; 
; CSEs:
; 
	?LINE	33
	?SYMB	'a',4,99,258
	?SYMB	'0',$,101,4
	?SYMB	'l',6,99,5
	?SYMB	'4',$,101,6
	?SYMB	'c',5,99,3
	?SYMB	'6',$,101,5
; graphic.c   34		unsigned int i, Address;
	?LINE	34
	?SYMB	'i',3,98,18
	?SYMB	'-2',$,101,3
	?SYMB	'Address',2,98,18
	?SYMB	'-4',$,101,2
; graphic.c   35		unsigned char Color = 0;
	?LINE	35
	?SYMB	'Color',1,98,3
	?SYMB	'-6',$,101,1
	MOVB	RL1,#00h
	MOVB	[R0],RL1
; graphic.c   36		a.x = a.x / 2;
	?LINE	36
	MOV	R12,[R0+#06H]
	SHR	R12,#01h
	MOV	[R0+#06H],R12
; graphic.c   37		Address = a.x + (a.y * 160);
	?LINE	37
	MOV	R12,[R0+#06H]
	MOV	R13,[R0+#08H]
	MOV	R14,R13
	SHL	R14,#02h
	ADD	R14,R13
	SHL	R14,#05h
	ADD	R12,R14
	MOV	[R0+#02H],R12
; graphic.c   38		for (i=0; i<l;i++)
	?LINE	38
	MOV	R12,#00h
	MOV	[R0+#04H],R12
	JMPR	cc_UC,_10
_7:
; graphic.c   39		{		 
; graphic.c   40			if (Address < 8) 
	?LINE	40
	MOV	R12,[R0+#02H]
	CMP	R12,#08h
	JMPR	cc_UGE,_8
; graphic.c   41			{
; graphic.c   42				Color = lcd_read_reg((Address + 0x95F8),0);
	?LINE	42
	MOV	R12,[R0+#02H]
	ADD	R12,#095F8h
	MOV	R13,#00h
	CALLA	cc_UC,_lcd_read_reg
	MOVB	[R0],RL4
; graphic.c   43				Color &= 0xF0;
	?LINE	43
	MOVB	RL1,[R0]
	ANDB	RL1,#0F0h
	MOVB	[R0],RL1
; graphic.c   44				Color |= c;
	?LINE	44
	MOVB	RL1,[R0]
	MOVB	RL2,[R0+#0CH]
	ORB	RL1,RL2
	MOVB	[R0],RL1
; graphic.c   45				lcd_write((Address + 0x95F8),Color);
	?LINE	45
	MOV	R12,[R0+#02H]
	ADD	R12,#095F8h
	MOVB	RL1,[R0]
	MOVBZ	R13,RL1
	CALLA	cc_UC,_lcd_write
; graphic.c   46			}
	?LINE	46
	JMPR	cc_UC,_9
_8:
; graphic.c   47			else
; graphic.c   48			{
; graphic.c   49				Color = lcd_read_reg((Address - 8),0);
	?LINE	49
	MOV	R12,[R0+#02H]
	SUB	R12,#08h
	MOV	R13,#00h
	CALLA	cc_UC,_lcd_read_reg
	MOVB	[R0],RL4
; graphic.c   50				Color &= 0xF0;
	?LINE	50
	MOVB	RL1,[R0]
	ANDB	RL1,#0F0h
	MOVB	[R0],RL1
; graphic.c   51				Color |= c;
	?LINE	51
	MOVB	RL1,[R0]
	MOVB	RL2,[R0+#0CH]
	ORB	RL1,RL2
	MOVB	[R0],RL1
; graphic.c   52				lcd_write(Address - 8,Color);
	?LINE	52
	MOV	R12,[R0+#02H]
	SUB	R12,#08h
	MOVB	RL1,[R0]
	MOVBZ	R13,RL1
	CALLA	cc_UC,_lcd_write
; graphic.c   53			}						  
	?LINE	53
_9:
; graphic.c   54			Address += OFFSET;
	?LINE	54
	MOV	R12,[R0+#02H]
	ADD	R12,#0A0h
	MOV	[R0+#02H],R12
	?LINE	38
	MOV	R12,[R0+#04H]
	ADD	R12,#01h
	MOV	[R0+#04H],R12
_10:
	MOV	R12,[R0+#04H]
	MOV	R13,[R0+#0AH]
	CMP	R12,R13
	JMPR	cc_ULT,_7
; graphic.c   55		}	
; graphic.c   56	}
	?LINE	56
	?SYMB	'',$,102,1
	?SYMB	'',$,102,2
	?SYMB	'',$,102,3
	?SYMB	'',$,102,5
	?SYMB	'',$,102,6
	?SYMB	'',$,102,4
	ADD	R0,#06h
	?SYMB	'',$,96,0
	RET
_liney	ENDP
	?SYMB	'',$,17,56
; graphic.c   57	
; graphic.c   58	//*****************************************************************************
; graphic.c   59	void shadow_boxs(void)
; graphic.c   60	{
	?LINE	60
	PUBLIC	_shadow_boxs
	?SYMB	'shadow_boxs',_shadow_boxs,37,1
	?SYMB	'',60,8,34
_shadow_boxs	PROC	NEAR
	?SYMB	'',00H,95,0
	SUB	R0,#06h
	?SYMB	'',$,96,6
; Locals:
;     j = offset 0
;     i = offset 1
;     Dot = offset 2
; 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -