Rev 3587 | Rev 4051 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1742 | mario79 | 1 | ; |
2 | ; END |
||
3443 | leency | 3 | ; KolibriOS Team 2005-2013 |
1742 | mario79 | 4 | ; |
5 | include "lang.inc" |
||
6 | include "..\..\..\macros.inc" |
||
7 | |||
8 | meos_app_start |
||
9 | code |
||
4044 | heavyiron | 10 | draw_window: |
2676 | leency | 11 | mcall 12,1 |
1742 | mario79 | 12 | |
4044 | heavyiron | 13 | mcall 14 ;eax=14 - get screen max x & max y |
1742 | mario79 | 14 | movzx ecx,ax |
15 | shr eax,17 |
||
16 | shl eax,16 |
||
4044 | heavyiron | 17 | lea ebx,[eax-110 shl 16+222] |
1742 | mario79 | 18 | shr ecx,1 |
19 | shl ecx,16 |
||
4044 | heavyiron | 20 | lea ecx,[ecx-70 shl 16+137] |
1742 | mario79 | 21 | |
4044 | heavyiron | 22 | mcall 0, , ,0x01ffffff ;define and draw window |
1742 | mario79 | 23 | |
4044 | heavyiron | 24 | mcall 13, 223 , 138 ,0x9098b0 |
25 | mcall ,<1,221>,<1,136>,0xffffff |
||
26 | mcall ,<2,220>,<2,135>,0xe4dfe1 |
||
27 | mcall ,<16,189>,<97,23>,0x9098b0 |
||
1742 | mario79 | 28 | |
4044 | heavyiron | 29 | mcall 8,<16,90> ,<20,27>,4,0x990022 ;eax=8 - draw buttons |
30 | mcall ,<113,90>, ,2,0xaa7700 |
||
31 | mcall , ,<54,27>,1,0x777777 |
||
32 | mcall ,<16,90> , ,3,0x007700 |
||
33 | mcall ,<17,186>,<98,20>,5,0xe4dfe1 |
||
1742 | mario79 | 34 | |
4044 | heavyiron | 35 | mcall 4,<28,105>,0x80000000,label4 ;eax=4 - write text |
36 | mcall ,<35,24> ,0x80ffffff,label2 |
||
37 | mcall ,<34,58> , ,label3 |
||
38 | mcall ,<47,37> , ,label5 |
||
39 | mcall ,<43,71> , ,label6 |
||
1742 | mario79 | 40 | |
2676 | leency | 41 | mcall 12,2 |
1742 | mario79 | 42 | |
43 | still: |
||
4044 | heavyiron | 44 | mcall 10 ;wait here for event |
1742 | mario79 | 45 | dec eax |
4044 | heavyiron | 46 | jz draw_window |
1742 | mario79 | 47 | dec eax |
48 | jnz button |
||
4044 | heavyiron | 49 | |
50 | mcall 2 ;eax=2 - get key code |
||
1742 | mario79 | 51 | mov al,ah |
52 | cmp al,13 |
||
53 | jz restart |
||
54 | cmp al,19 |
||
55 | jz run_rdsave |
||
56 | cmp al,27 |
||
57 | jz close_1 |
||
58 | cmp al,180 |
||
59 | jz restart_kernel |
||
60 | cmp al,181 |
||
61 | jz power_off |
||
62 | jmp still |
||
63 | |||
4044 | heavyiron | 64 | button: |
65 | mcall 17 ;eax=17 - get pressed button id |
||
1742 | mario79 | 66 | xchg al,ah |
67 | dec eax |
||
2676 | leency | 68 | jz close_1 |
1742 | mario79 | 69 | dec eax |
70 | jz restart_kernel |
||
71 | dec eax |
||
72 | jz restart |
||
73 | dec eax |
||
74 | jnz run_rdsave |
||
4044 | heavyiron | 75 | |
2676 | leency | 76 | power_off: |
77 | push 2 |
||
78 | jmp mcall_and_close |
||
79 | restart: |
||
1742 | mario79 | 80 | push 3 |
81 | jmp mcall_and_close |
||
4044 | heavyiron | 82 | restart_kernel: |
1742 | mario79 | 83 | push 4 |
84 | mcall_and_close: |
||
85 | pop ecx |
||
86 | mcall 18,9 |
||
87 | |||
4044 | heavyiron | 88 | close_1: |
89 | mcall -1 |
||
90 | |||
1742 | mario79 | 91 | run_rdsave: |
4044 | heavyiron | 92 | mcall 70,rdsave |
1742 | mario79 | 93 | jmp still |
94 | |||
95 | data |
||
4044 | heavyiron | 96 | include 'data.inc' |
1742 | mario79 | 97 | |
4044 | heavyiron | 98 | udata |
1742 | mario79 | 99 | |
4044 | heavyiron | 100 | meos_app_end43,71>47,37>34,58>35,24>28,105>98,20>17,186>16,90>54,27>113,90>20,27>16,90>97,23>16,189>2,135>2,220>1,136>1,221> |