📄 res_show.lst
字号:
C51 COMPILER V7.50 RES_SHOW 07/17/2008 14:38:50 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE RES_SHOW
OBJECT MODULE PLACED IN ..\output\res_show.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\..\common\res_show.c LARGE OPTIMIZE(9,SIZE) BROWSE INCDIR(..\..\..\bsp\i
-nclude;..\src\include;..\..\include) DEFINE(CONFIG_ASIC) DEBUG OBJECTEXTEND PRINT(.\res_show.lst) OBJECT(..\output\res_s
-how.obj)
line level source
1 #include <string.h>
2 #include "api.h"
*** WARNING C318 IN LINE 2 OF ..\..\common\res_show.c: can't open file 'api.h'
3 #include "lcd.h"
*** ERROR C129 IN LINE 102 OF ..\..\INCLUDE\LCD.H: missing ';' before 'lcd_max_str'
4 #include "key.h"
5 #include "common.h"
*** WARNING C318 IN LINE 5 OF ..\..\INCLUDE\COMMON.H: can't open file 'types.h'
6 #include "res_show.h"
7 #include "prefer.h"
8
9
10 #define IMAGE_OFFSET 268224L
11
12 RES_ENTRY_T res_entry;
13 extern UINT16 pixel_buf[];
14 extern void delay(UINT16 n);
15 INT8U res_buf[50];
16
17 BOOLEAN bResShowPic(INT16U id,INT8U x,INT8U y)
18 {
19 INT16U width,high,length;
20 INT16U count;
21 UINT16 pitch;
22 INT8U buf1[32];
23
24 api_bSectionFileOpen(SYS_IMAGE_FILEID);
25 api_bSectionFileSeek(id * sizeof(RES_ENTRY_T)+IMAGE_OFFSET, SEEK_SET);
26 api_u16SectionFileRead(buf1, sizeof(RES_ENTRY_T));
27 res_entry.u32Offset = (INT32U)buf1[0] | ((INT32U)buf1[1]<<8) | ((INT32U)buf1[2]<<16) | ((INT32U)buf1[3]<<
-24);
28 api_bSectionFileSeek(res_entry.u32Offset+IMAGE_OFFSET, SEEK_SET);
29 api_u16SectionFileRead(buf1,4);
30 width = buf1[0] | (buf1[1]<<8);
31 high = buf1[2] | (buf1[3]<<8);
32
33 lcd_set_disply_mode(0x00,0x22);
34
35 lcd_set_rw_area(x,y,(INT8U)width,(INT8U)high);
36 pitch = (UINT16)width*4;
37
38 length = width * high*2;
39
40 if(length<512)
41 {
42 api_u16SectionFileRead(pixel_buf,length);
43 lcd_put_data((UINT16)pixel_buf,length);
44 }
45 else
46 {
47 count = length/512;
48 while(count--)
49 {
C51 COMPILER V7.50 RES_SHOW 07/17/2008 14:38:50 PAGE 2
50 api_u16SectionFileRead(pixel_buf,512);
51 lcd_put_data((UINT16)pixel_buf,512);
52 }
53 pitch = length%512;
54 api_u16SectionFileRead(pixel_buf,pitch);
55 lcd_put_data((UINT16)pixel_buf,pitch);
56 }
57 return TRUE;
58 }
59
60
61 int ResShowMultiString(INT16U id, INT8U string_id, INT8U x, INT8U y)
62 {
63 INT8U *p,AddBuf;
64 INT8U StrLength,string_idtemp;
65 api_bSectionFileOpen(SYS_IMAGE_FILEID);
66 api_bSectionFileSeek(id * sizeof(RES_ENTRY_T)+IMAGE_OFFSET, SEEK_SET);
67 api_u16SectionFileRead(res_buf, sizeof(RES_ENTRY_T));
68 res_entry.u32Offset = (INT32U)res_buf[0] | ((INT32U)res_buf[1]<<8) | ((INT32U)res_buf[2]<<16) | ((INT
-32U)res_buf[3]<<24);
69 res_entry.u16Length = res_buf[4] | (res_buf[5]<<8);
70 api_bSectionFileSeek(res_entry.u32Offset+IMAGE_OFFSET, SEEK_SET);
71 api_u16SectionFileRead(res_buf,50);
72
73 //定位到 string_id
74 p = res_buf;
75 string_idtemp=string_id;
76
77 while(string_id)
78 {
79
80 AddBuf=1;
81 while(*p!=0)
82 {
83 AddBuf++; //找到第string_id 个0
84 p++;
85 }
86 string_id--;
87 res_entry.u32Offset += AddBuf;
88 api_bSectionFileSeek(res_entry.u32Offset+IMAGE_OFFSET, SEEK_SET);
89 api_u16SectionFileRead(res_buf,50);
90 p = res_buf;
91
92 }
93
94 string_id=string_idtemp;
95
96 StrLength=(INT8U)strlen(p);
97
98 if(x == 255) //居中显示
99 {
100 if(tUserPreference.u8LanguageId==0)
101 lcd_puts((128-(INT8U)strlen(p)*8)/2,y,p,FONTSIZE_HYPER);
102 if(tUserPreference.u8LanguageId>4)
103 lcd_puts((128-(INT8U)strlen(p)*8)/2,y,p,FONTSIZE_8x8);
104 else
105 lcd_puts((128-(INT8U)strlen(p)*8)/2,y,p,FONTSIZE_HYPER);
106 }
107 else
108 {
109 if(tUserPreference.u8LanguageId==0)
110 lcd_puts(x,y,p,FONTSIZE_HYPER);
C51 COMPILER V7.50 RES_SHOW 07/17/2008 14:38:50 PAGE 3
111 else if(tUserPreference.u8LanguageId>4)
112 lcd_puts(x,y,p,FONTSIZE_8x8);
113 else
114 lcd_puts(x,y,p,FONTSIZE_HYPER);
115 }
116
117 return 1;
118 }
119
C51 COMPILATION COMPLETE. 2 WARNING(S), 1 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -