📄 ui_licensinf.lst
字号:
##############################################################################
# #
# IAR Z80/64180 C-Compiler V4.04B/WIN #
# Front End V4.20N 25/Dec/106 17:01:17 #
# Global Optimizer V1.05D #
# #
# Target option = Z80 #
# Memory model = banked #
# Source file = d:\case_i_d90f\ap\ap_music\ui_licensinf.c #
# List file = d:\case_i_d90f\ap\ap_music\list\ui_licensinf.lst #
# Object file = d:\case_i_d90f\ap\ap_music\obj\ui_licensinf.r01 #
# ASM file = d:\case_i_d90f\ap\ap_music\list\ui_licensinf.s01 #
# Command line = -v0 -mb -OD:\case_i_d90f\ap\ap_music\Obj\ -e -K -w #
# -gA -z9 -RCODE -r0 -DNAPDEBUG #
# -LD:\case_i_d90f\ap\ap_music\List\ -q -t8 #
# -AD:\case_i_d90f\ap\ap_music\List\ #
# -ND:\case_i_d90f\ap\ap_music\List\ -X #
# -Id:\sdk_i_90f\inc\ -Id:\case_i_d90f\inc\ #
# d:\case_i_d90f\AP\AP_MUSIC\ui_LicensInf.c #
# #
# (c) Copyright IAR Systems 1996 #
##############################################################################
\ 0000 NAME ui_licensinf(17)
\ 0000 RSEG COM_CTRL(0)
\ 0000 EXTERN ClearScreen
\ 0000 PUBLIC DisplayDate
\ 0000 PUBLIC NextItem
\ 0000 PUBLIC PrevItem
\ 0000 EXTERN PutS
\ 0000 EXTERN ResShowMultiString
\ 0000 EXTERN SetTextPos
\ 0000 EXTERN UpdateScreen
\ 0000 EXTERN ap_get_message
\ 0000 EXTERN ap_handle_hotkey
\ 0000 EXTERN ap_sleep
\ 0000 PUBLIC delstartzero
\ 0000 PUBLIC displaycase
\ 0000 EXTERN itoa_2
\ 0000 EXTERN itoa_4
\ 0000 EXTERN musicpSendCommand
\ 0000 EXTERN ui_auto_update
\ 0000 PUBLIC ui_licensinf
\ 0000 EXTERN ?CLZ80B_4_04_L00
\ 0000 EXTERN ?C_S_SWITCH_L06
\ 0000 EXTERN ?C_V_SWITCH_L06
\ 0000 EXTERN ?BANK_CALL_DIRECT_L08
\ 0000 EXTERN ?BANK_LEAVE_DIRECT_L08
\ 0000 EXTERN ?BANK_FAST_LEAVE_L08
\ 0000 EXTERN ?ENT_AUTO_DIRECT_L09
\ 0000 RSEG COM_CTRL
\ 0000 ui_licensinf:
1 /*
2 *******************************************************************************
3 * ACTOS AP
4 * ap common lib, file/folder delete control file
5 *
6 * (c) Copyright, Actions Co,Ld.
7 * All Right Reserved
8 *
9 * $Id: ui_LicensInf.c,v 1.1.1.1 2006/05/22 03:24:01 selina Exp $
10 *******************************************************************************
11 */
12 #include "ap_music.h"
13
14 //如下定义了结构中的开关位
15 #define on_AllItem_def 0x80
16 #define on_PLAYCNT_def 0x20
17 #define on_BEGINDAT_def 0x10
18 #define on_EXPDATE_def 0x08
19 #define on_REMAINTM_def 0x04
20 #define on_REMAINST_def 0x02
21 #define on_DEALCLKBCK_def 0x01
22
23 #define DisplayItem0_def 0
24 #define DisplayItem1_def 1
25 #define DisplayItem2_def 2
26 #define DisplayItem3_def 3
27 #define DisplayItem4_def 4
28 #define DisplayItem5_def 5
29 #define DisplayItem6_def 6
30
31 #define RemainPlayCntDisp_def DisplayItem0_def
32 #define OriginalPlayCntDisp_def DisplayItem1_def
33 #define BeginDateTimeDisp_def DisplayItem2_def
34 #define ExpDateTimeDisp_def DisplayItem3_def
35 #define RemainTimeDisp_def DisplayItem4_def
36 #define RemainStoreTimeDisp_def DisplayItem5_def
37 #define DealOnClkBckDisp_def DisplayItem6_def
38 #define lincensinf_maxitem_def DisplayItem6_def
39 typedef struct
40 {
41 date_t date;
42 time_t time;
43 }DateTime_t;
44
45 bool displaycase(licensinf_t *infbuf, char cnt, char subcnt, int lan_id);
46 char NextItem(licensinf_t *infbuf, char cnt, int lan_id);
47 char PrevItem(licensinf_t *infbuf, char cnt, int lan_id);
48 void DisplayDate(int ID, DateTime_t *pDate,char discnt, BYTE string_id);
49 void delstartzero(char* buf);
50
51 #pragma codeseg(COM_CTRL)
52 /*
53 //===================================================================
54 接口: int ui_licensinf(, int string_id)
55 input:
56
57 int string_id: 显示用的语言
58
59 output:
60 return int: NULL: 选中了OK
61 RESULT_IGNORE: 时间到了未按确定,按了PLAY键,或选中了NO
62 其他非0的值: 当热键返回
63 //===================================================================
64 */
65 int ui_licensinf(int string_id)
66 {
\ 0000 CD0000 CALL LWRD ?ENT_AUTO_DIRECT_L09
\ 0003 E2FF DEFW 65506
\ 0005 FDE5 PUSH IY
\ 0007 DD6E02 LD L,(IX+2)
\ 000A DD6603 LD H,(IX+3)
\ 000D E5 PUSH HL
\ 000E FDE1 POP IY
67 char key;
68 bool need_draw = TRUE;
69 char itemcnt = 0;
70 char subitemcnt = 0;
71 wma_inf_t licensinfbuf;
72 bool result;
73
74
75 //取lincens 信息
76 if (!musicpSendCommand(MC_GETINF, (int)&licensinfbuf))
\ 0010 DD36E200 LD (IX-30),0
\ 0014 DD36E400 LD (IX-28),0
\ 0018 210600 LD HL,6
\ 001B 39 ADD HL,SP
\ 001C 4D LD C,L
\ 001D 44 LD B,H
\ 001E 1E10 LD E,16
\ 0020 3E00 LD A,BYTE3 musicpSendCommand
\ 0022 210000 LD HL,LWRD musicpSendCommand
\ 0025 CD0000 CALL LWRD ?BANK_CALL_DIRECT_L08
\ 0028 2C INC L
\ 0029 2D DEC L
\ 002A 2834 JR Z,?0083
\ 002C ?0002:
77 {
78 //如命令出错,则跳回
79 return RESULT_IGNORE;
80 }
\ 002C ?0003:
81 if (licensinfbuf.drmmode != INF_DRMHVLICENSE)
\ 002C DD46E6 LD B,(IX-26)
\ 002F 05 DEC B
\ 0030 202E JR NZ,?0083
\ 0032 ?0004:
82 //if (licensinfbuf.drmmode == INF_NORMALWMA)
83 {
84 //普通WMA也跳回
85 return RESULT_IGNORE;
86 }
\ 0032 ?0005:
87
88
89 /*
90 //add for test
91
92 licensinfbuf.drminf.switchflag = 0xff;
93
94 licensinfbuf.drminf.originalPlayCnt = 38;
95 licensinfbuf.drminf.RemainPlayCnt = 35;
96 licensinfbuf.drminf.BeginDate.year = 2004;
97 licensinfbuf.drminf.BeginDate.month = 10;
98 licensinfbuf.drminf.BeginDate.day = 15;
99 licensinfbuf.drminf.BeginTime.hour = 3;
100 licensinfbuf.drminf.BeginTime.minute = 4;
101 licensinfbuf.drminf.BeginTime.second = 12;
102
103 licensinfbuf.drminf.ExpDate.year = 2004;
104 licensinfbuf.drminf.ExpDate.month = 12;
105 licensinfbuf.drminf.ExpDate.day = 23;
106 licensinfbuf.drminf.ExpTime.hour = 4;
107 licensinfbuf.drminf.ExpTime.minute = 15;
108 licensinfbuf.drminf.ExpTime.second = 27;
109
110 licensinfbuf.drminf.RemainStoreTime = 12;
111 licensinfbuf.drminf.RemainTime =12;
112 licensinfbuf.drminf.DealOnClkBck = 1;
113 */
114
115 // SetAsciiFont(FONT_TYPE_LARGE); //ASCII码用大字体
116 // SetAsciiFont(FONT_TYPE_SMALL); //ASCII码用小字体
117 ClearScreen(NULL);
\ 0032 58 LD E,B
\ 0033 50 LD D,B
\ 0034 CD0000 CALL LWRD ClearScreen
118
119 if ((licensinfbuf.drminf.switchflag & on_AllItem_def) == 0)
\ 0037 DDCBE77E BIT 7,(IX-25)
\ 003B 2026 JR NZ,?0007
\ 003D ?0006:
\ 003D ?0009:
120 {
121 while( ap_get_message() != NULL );//清空消息池,确保DELAY时间准确
\ 003D CD0000 CALL LWRD ap_get_message
\ 0040 B7 OR A
\ 0041 20FA JR NZ,?0006
\ 0043 ?0010:
\ 0043 ?0008:
122 ResShowMultiString(NOLIMIT, string_id, 255, 80);
\ 0043 0E50 LD C,80
\ 0045 C5 PUSH BC
\ 0046 0EFF LD C,255
\ 0048 C5 PUSH BC
\ 0049 FDE5 PUSH IY
\ 004B E1 POP HL
\ 004C 4D LD C,L
\ 004D 11C201 LD DE,450
\ 0050 CD0001 CALL LWRD ?0107
\ 0053 F1 POP AF
\ 0054 F1 POP AF
123 ap_sleep(4);
\ 0055 110400 LD DE,4
\ 0058 3E00 LD A,BYTE3 ap_sleep
\ 005A 210000 LD HL,LWRD ap_sleep
\ 005D CD0000 CALL LWRD ?BANK_CALL_DIRECT_L08
124 return RESULT_IGNORE;
\ 0060 ?0083:
\ 0060 C3E300 JP LWRD ?0019
125 }
\ 0063 ?0007:
126 ui_auto_update = FALSE;
\ 0063 AF XOR A
\ 0064 320000 LD (ui_auto_update),A
127
128 //先显示第一项
129 if (! displaycase(&licensinfbuf.drminf, itemcnt, subitemcnt, string_id))
\ 0067 FDE5 PUSH IY
\ 0069 DD6EE4 LD L,(IX-28)
\ 006C E5 PUSH HL
\ 006D DD4EE2 LD C,(IX-30)
\ 0070 210A00 LD HL,10
\ 0073 39 ADD HL,SP
\ 0074 110100 LD DE,1
\ 0077 19 ADD HL,DE
\ 0078 EB EX DE,HL
\ 0079 CD0E01 CALL LWRD ?0108
\ 007C F1 POP AF
\ 007D F1 POP AF
\ 007E 2C INC L
\ 007F 2D DEC L
\ 0080 201A JR NZ,?0012
\ 0082 ?0011:
130 {
131 itemcnt = NextItem(&licensinfbuf.drminf, itemcnt, string_id);
\ 0082 ?0087:
\ 0082 FDE5 PUSH IY
\ 0084 DD4EE2 LD C,(IX-30)
\ 0087 210800 LD HL,8
\ 008A 39 ADD HL,SP
\ 008B 110100 LD DE,1
\ 008E 19 ADD HL,DE
\ 008F EB EX DE,HL
\ 0090 3E00 LD A,BYTE3 NextItem
\ 0092 211601 LD HL,LWRD NextItem
\ 0095 ?0086:
\ 0095 CD0000 CALL LWRD ?BANK_CALL_DIRECT_L08
\ 0098 F1 POP AF
\ 0099 DD75E2 LD (IX-30),L
\ 009C ?0012:
\ 009C ?0014:
132 }
133
134 while(1)
135 {
136 UpdateScreen(NULL);
\ 009C 110000 LD DE,0
\ 009F CD0000 CALL LWRD UpdateScreen
137
138 key = ap_get_message(); //获取消息
\ 00A2 CD0000 CALL LWRD ap_get_message
139
140 switch (key)
\ 00A5 5F LD E,A
\ 00A6 CD0000 CALL LWRD ?C_V_SWITCH_L06
\ 00A9 0B00 DEFW 11
\ 00AB 03 DEFB 3
\ 00AC 04 DEFB 4
\ 00AD 05 DEFB 5
\ 00AE 06 DEFB 6
\ 00AF 1E DEFB 30
\ 00B0 21 DEFB 33
\ 00B1 30 DEFB 48
\ 00B2 43 DEFB 67
\ 00B3 44 DEFB 68
\ 00B4 45 DEFB 69
\ 00B5 46 DEFB 70
\ 00B6 E800 DEFW ?0020
\ 00B8 8200 DEFW ?0087
\ 00BA CE00 DEFW ?0018
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -