📄 main.txt
字号:
|L1.1356|
00054c 00000005 DCD ||.data|| + 5
ENDP
SelectMenuIco PROC
;;;144 uint8 SelectMenuIco(void)
;;;145 { static uint8 s_menu_start = 0; // 屏幕显示的第一个图标菜单序号
000550 e92d4038 PUSH {r3-r5,lr}
;;;146 static uint8 s_select = 0; // 当前所选择的图标菜单序号
;;;147
;;;148 uint8 s_disp_sta = 0; // 需要更新显示标志
000554 e3a05000 MOV r5,#0
;;;149 void *key;
;;;150 uint8 err;
;;;151
;;;152 // 显示当前选择菜单
;;;153 DrawSelectMenuIco(s_menu_start, s_select, 1);
000558 e3a02001 MOV r2,#1
00055c e59f03cc LDR r0,|L1.2352|
000560 e5d01000 LDRB r1,[r0,#0] ; s_select@SelectMenuIco_1
000564 e2400001 SUB r0,r0,#1
000568 e5d00000 LDRB r0,[r0,#0] ; s_menu_start@SelectMenuIco_0
00056c ebfffffe BL DrawSelectMenuIco
;;;154
;;;155 while(1)
000570 ea00004e B |L1.1712|
;;;156 {
;;;157 OSTimeDly(10);
|L1.1396|
000574 e3a0000a MOV r0,#0xa
000578 ebfffffe BL OSTimeDly
;;;158 /* 若更新了选择的菜单项,则调用DrawSelectMenuIco显示当前选择菜单 */
;;;159 if(s_disp_sta!=0)
00057c e3550000 CMP r5,#0
000580 0a000006 BEQ |L1.1440|
;;;160 { DrawSelectMenuIco(s_menu_start, s_select, 0);
000584 e3a02000 MOV r2,#0
000588 e59f03a0 LDR r0,|L1.2352|
00058c e5d01000 LDRB r1,[r0,#0] ; s_select@SelectMenuIco_1
000590 e2400001 SUB r0,r0,#1
000594 e5d00000 LDRB r0,[r0,#0] ; s_menu_start@SelectMenuIco_0
000598 ebfffffe BL DrawSelectMenuIco
;;;161 s_disp_sta = 0;
00059c e3a05000 MOV r5,#0
;;;162 }
;;;163
;;;164 /* 读取一按键 */
;;;165 key = OSMboxPend(KeyMbox, 0, &err);
|L1.1440|
0005a0 e1a0200d MOV r2,sp
0005a4 e3a01000 MOV r1,#0
0005a8 e59f0384 LDR r0,|L1.2356|
0005ac e5900000 LDR r0,[r0,#0] ; KeyMbox
0005b0 ebfffffe BL OSMboxPend
0005b4 e1a04000 MOV r4,r0
;;;166
;;;167 /* 分析按键并作相应操作 */
;;;168 switch((int)key)
0005b8 e1a00004 MOV r0,r4
0005bc e3540001 CMP r4,#1
0005c0 0a000004 BEQ |L1.1496|
0005c4 e3500002 CMP r0,#2
0005c8 0a000018 BEQ |L1.1584|
0005cc e3500004 CMP r0,#4
0005d0 1a000033 BNE |L1.1700|
0005d4 ea00002d B |L1.1680|
;;;169 { case KEY_LEFT:
|L1.1496|
0005d8 e1a00000 MOV r0,r0
;;;170 if(s_select!=0)
0005dc e59f034c LDR r0,|L1.2352|
0005e0 e5d00000 LDRB r0,[r0,#0] ; s_select@SelectMenuIco_1
0005e4 e3500000 CMP r0,#0
0005e8 0a00000f BEQ |L1.1580|
;;;171 { s_select--; // 选择项左移
0005ec e59f033c LDR r0,|L1.2352|
0005f0 e5d00000 LDRB r0,[r0,#0] ; s_select@SelectMenuIco_1
0005f4 e2400001 SUB r0,r0,#1
0005f8 e59f1330 LDR r1,|L1.2352|
0005fc e5c10000 STRB r0,[r1,#0] ; s_select@SelectMenuIco_1
;;;172
;;;173 /* 判断是否需要更新s_menu_start */
;;;174 if(s_select<s_menu_start)
000600 e2810000 ADD r0,r1,#0
000604 e5d00000 LDRB r0,[r0,#0] ; s_select@SelectMenuIco_1
000608 e2411001 SUB r1,r1,#1
00060c e5d11000 LDRB r1,[r1,#0] ; s_menu_start@SelectMenuIco_0
000610 e1500001 CMP r0,r1
000614 aa000003 BGE |L1.1576|
;;;175 { s_menu_start = s_select;
000618 e59f0310 LDR r0,|L1.2352|
00061c e5d00000 LDRB r0,[r0,#0] ; s_select@SelectMenuIco_1
000620 e59f1310 LDR r1,|L1.2360|
000624 e5c10000 STRB r0,[r1,#0] ; s_menu_start@SelectMenuIco_0
;;;176 }
;;;177
;;;178 s_disp_sta = 1; // 需要更新显示
|L1.1576|
000628 e3a05001 MOV r5,#1
;;;179 }
;;;180 break;
|L1.1580|
00062c ea00001e B |L1.1708|
;;;181
;;;182 case KEY_RIGHT:
|L1.1584|
000630 e1a00000 MOV r0,r0
;;;183 if(s_select<7)
000634 e59f02f4 LDR r0,|L1.2352|
000638 e5d00000 LDRB r0,[r0,#0] ; s_select@SelectMenuIco_1
00063c e3500007 CMP r0,#7
000640 aa000011 BGE |L1.1676|
;;;184 { s_select++; // 选择项右移
000644 e59f02e4 LDR r0,|L1.2352|
000648 e5d00000 LDRB r0,[r0,#0] ; s_select@SelectMenuIco_1
00064c e2800001 ADD r0,r0,#1
000650 e59f12d8 LDR r1,|L1.2352|
000654 e5c10000 STRB r0,[r1,#0] ; s_select@SelectMenuIco_1
;;;185
;;;186 if((s_select-s_menu_start) > 2)
000658 e2810000 ADD r0,r1,#0
00065c e5d00000 LDRB r0,[r0,#0] ; s_select@SelectMenuIco_1
000660 e2411001 SUB r1,r1,#1
000664 e5d11000 LDRB r1,[r1,#0] ; s_menu_start@SelectMenuIco_0
000668 e0400001 SUB r0,r0,r1
00066c e3500002 CMP r0,#2
000670 da000004 BLE |L1.1672|
;;;187 { s_menu_start++;
000674 e59f02bc LDR r0,|L1.2360|
000678 e5d00000 LDRB r0,[r0,#0] ; s_menu_start@SelectMenuIco_0
00067c e2800001 ADD r0,r0,#1
000680 e59f12b0 LDR r1,|L1.2360|
000684 e5c10000 STRB r0,[r1,#0] ; s_menu_start@SelectMenuIco_0
;;;188 }
;;;189
;;;190 s_disp_sta = 1; // 需要更新显示
|L1.1672|
000688 e3a05001 MOV r5,#1
;;;191 }
;;;192 break;
|L1.1676|
00068c ea000006 B |L1.1708|
;;;193
;;;194 case KEY_OK:
|L1.1680|
000690 e1a00000 MOV r0,r0
;;;195 return(s_select); // 确定,返回所选菜单序号
000694 e59f0294 LDR r0,|L1.2352|
000698 e5d00000 LDRB r0,[r0,#0] ; s_select@SelectMenuIco_1
00069c e8bd4038 POP {r3-r5,lr}
;;;196
;;;197 default:
;;;198 break;
;;;199 } // end of switch(key)...
;;;200 } // end of while(1)...
;;;201 }
0006a0 e12fff1e BX lr
|L1.1700|
0006a4 e1a00000 MOV r0,r0 ;197
0006a8 e1a00000 MOV r0,r0 ;198
|L1.1708|
0006ac e1a00000 MOV r0,r0 ;180
|L1.1712|
0006b0 eaffffaf B |L1.1396| ;155
ENDP
DrawMainWindow PROC
;;;288 void DrawMainWindow(void)
;;;289 { WINDOWS mainw;
0006b4 e52de004 PUSH {lr}
0006b8 e24dd01c SUB sp,sp,#0x1c
;;;290
;;;291 mainw.x = 0;
0006bc e3a00000 MOV r0,#0
0006c0 e58d0004 STR r0,[sp,#4]
;;;292 mainw.y = 0;
0006c4 e58d0008 STR r0,[sp,#8]
;;;293 mainw.with = 84;
0006c8 e3a00054 MOV r0,#0x54
0006cc e58d000c STR r0,[sp,#0xc]
;;;294 mainw.hight = 48;
0006d0 e3a00030 MOV r0,#0x30
0006d4 e58d0010 STR r0,[sp,#0x10]
;;;295 mainw.title = (uint8 *) "HELLO"; // 窗口标题
0006d8 e28f0f97 ADR r0,|L1.2364|
0006dc e58d0014 STR r0,[sp,#0x14]
;;;296 mainw.state = NULL; // 状态栏不显示
0006e0 e3a00000 MOV r0,#0
0006e4 e58d0018 STR r0,[sp,#0x18]
;;;297
;;;298 GUI_WindowsDraw(&mainw); // 显示窗口
0006e8 e28d0004 ADD r0,sp,#4
0006ec ebfffffe BL GUI_WindowsDraw
;;;299 }
0006f0 e28dd01c ADD sp,sp,#0x1c
0006f4 e49de004 POP {lr}
0006f8 e12fff1e BX lr
ENDP
DemoMessage PROC
;;;211 void DemoMessage(void)
;;;212 { uint8 select;
|L1.1788|
0006fc e92d4030 PUSH {r4,r5,lr}
000700 e24dd01c SUB sp,sp,#0x1c
;;;213 uint8 *key;
;;;214 uint8 err;
;;;215
;;;216 WINDOWS message;
;;;217
;;;218 message.x = 4; // 设置窗口位置和大小
000704 e3a00004 MOV r0,#4
000708 e58d0000 STR r0,[sp,#0]
;;;219 message.y = 4;
00070c e58d0004 STR r0,[sp,#4]
;;;220 message.with = 80;
000710 e3a00050 MOV r0,#0x50
000714 e58d0008 STR r0,[sp,#8]
;;;221 message.hight = 40;
000718 e3a00028 MOV r0,#0x28
00071c e58d000c STR r0,[sp,#0xc]
;;;222 message.title = (uint8 *) "Demo"; // 窗口标题
000720 e28f0f87 ADR r0,|L1.2372|
000724 e58d0010 STR r0,[sp,#0x10]
;;;223 message.state = (uint8 *) 0;
000728 e3a00000 MOV r0,#0
00072c e58d0014 STR r0,[sp,#0x14]
;;;224 GUI_WindowsDraw(&message); // 显示对话框窗口
000730 e1a0000d MOV r0,sp
000734 ebfffffe BL GUI_WindowsDraw
;;;225 //GUI_PutString(8, 15, "Hello,"); // 显示对话框的消息"Hello,ZLG/GUI"
;;;226 //GUI_PutString(8, 30, "ZLG/GUI!");
;;;227
;;;228 select = 0;
000738 e3a05000 MOV r5,#0
;;;229 while(1)
00073c ea000023 B |L1.2000|
;;;230 { if(select==0)
|L1.1856|
000740 e3550000 CMP r5,#0
000744 1a000006 BNE |L1.1892|
;;;231 {
;;;232 GUI_Button_OK1(30,15); // 选中"OK"按钮
000748 e3a0100f MOV r1,#0xf
00074c e3a0001e MOV r0,#0x1e
000750 ebfffffe BL GUI_Button_OK1
;;;233 GUI_Button_Cancle(30,30); // 取消"CANSEL"按钮的选中状态
000754 e3a0101e MOV r1,#0x1e
000758 e1a00001 MOV r0,r1
00075c ebfffffe BL GUI_Button_Cancle
000760 ea000005 B |L1.1916|
;;;234 }
;;;235 else
;;;236 {
;;;237 GUI_Button_OK(30,15);
|L1.1892|
000764 e3a0100f MOV r1,#0xf
000768 e3a0001e MOV r0,#0x1e
00076c ebfffffe BL GUI_Button_OK
;;;238 GUI_Button_Cancle1(30,30);
000770 e3a0101e MOV r1,#0x1e
000774 e1a00001 MOV r0,r1
000778 ebfffffe BL GUI_Button_Cancle1
;;;239 }
;;;240
;;;241 key = OSMboxPend(KeyMbox, 0, &err);
|L1.1916|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -