Rev 3587 | Rev 4051 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3587 | Rev 4044 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; |
1 | ; |
2 | ; END |
2 | ; END |
3 | ; KolibriOS Team 2005-2013 |
3 | ; KolibriOS Team 2005-2013 |
4 | ; |
4 | ; |
5 | ; |
- | |
6 | ; and if we know that high 24 bits of eax are zero, we can use 1st form |
- | |
7 | ; the same about ebx,ecx,edx |
- | |
8 | - | ||
9 | include "lang.inc" |
5 | include "lang.inc" |
10 | include "..\..\..\macros.inc" |
6 | include "..\..\..\macros.inc" |
Line 11... | Line 7... | ||
11 | 7 | ||
12 | meos_app_start |
8 | meos_app_start |
13 | code |
- | |
14 | 9 | code |
|
15 | do_draw: |
- | |
16 | 10 | draw_window: |
|
Line 17... | Line 11... | ||
17 | mcall 12,1 |
11 | mcall 12,1 |
18 | - | ||
19 | mov al,14 ; eax=14 - get screen max x & max y |
- | |
20 | mcall |
12 | |
21 | - | ||
22 | movzx ecx,ax |
13 | mcall 14 ;eax=14 - get screen max x & max y |
23 | 14 | movzx ecx,ax |
|
24 | shr eax,17 |
15 | shr eax,17 |
25 | shl eax,16 |
- | |
26 | lea ebx,[eax-110*10000h+222] |
16 | shl eax,16 |
27 | 17 | lea ebx,[eax-110 shl 16+222] |
|
28 | shr ecx,1 |
18 | shr ecx,1 |
- | 19 | shl ecx,16 |
|
- | 20 | lea ecx,[ecx-70 shl 16+137] |
|
Line 29... | Line -... | ||
29 | shl ecx,16 |
- | |
30 | sub ecx,50*10000h - 115 |
- | |
31 | - | ||
32 | xor eax,eax ; define and draw window |
- | |
33 | mov edx,0x01cccccc |
- | |
34 | mov esi,edx |
- | |
35 | mov edi,edx |
21 | |
36 | mcall |
22 | mcall 0, , ,0x01ffffff ;define and draw window |
37 | - | ||
38 | mcall 13,0 shl 16+222,0 shl 16+230, 0xcccccc |
23 | |
39 | mcall ,19 shl 16+87,21 shl 16+24, 0x555555 |
- | |
40 | push ebx |
24 | mcall 13, 223 , 138 ,0x9098b0 |
41 | mcall ,122 shl 16+87 |
- | |
42 | xchg ebx,[esp] |
- | |
43 | mcall ,,55 shl 16+24 |
25 | mcall ,<1,221>,<1,136>,0xffffff |
44 | pop ebx |
- | |
45 | mcall |
26 | mcall ,<2,220>,<2,135>,0xe4dfe1 |
46 | 27 | mcall ,<16,189>,<97,23>,0x9098b0 |
|
47 | mov al,8 |
- | |
48 | mcall ,15 shl 16+87,17 shl 16+24,4,0xaa0044 |
28 | |
49 | mcall ,118 shl 16+87,,2,0xbb7700 |
29 | mcall 8,<16,90> ,<20,27>,4,0x990022 ;eax=8 - draw buttons |
50 | mcall ,15 shl 16+87,51 shl 16+24,3,0x8800 |
30 | mcall ,<113,90>, ,2,0xaa7700 |
51 | mcall ,118 shl 16+87,,1,0x999999 |
31 | mcall , ,<54,27>,1,0x777777 |
52 | mcall ,10 shl 16+200,88 shl 16+15,0x40000005 |
32 | mcall ,<16,90> , ,3,0x007700 |
53 | mcall 38,27 shl 16 +193,102 shl 16 +102,0x000000dd |
- | |
54 | - | ||
55 | mov al,4 ; 0x00000004 = write text |
33 | mcall ,<17,186>,<98,20>,5,0xe4dfe1 |
56 | mov ebx,28*65536+93 |
- | |
57 | mov ecx,0x800000dd |
- | |
58 | mov edx,label4 |
- | |
59 | mcall |
- | |
60 | - | ||
61 | mov ecx,0x90eeeeee ; 8b window nro - RR GG BB color |
- | |
62 | mov ebx,24*65536+20 |
- | |
63 | mov edx,label2 ; pointer to text beginning |
- | |
64 | mcall |
34 | |
65 | - | ||
66 | mov ebx,19*65536+54 |
- | |
67 | mov edx,label3 |
- | |
68 | mcall |
35 | mcall 4,<28,105>,0x80000000,label4 ;eax=4 - write text |
69 | - | ||
70 | mov ebx,44*65536+31 |
- | |
71 | mov edx,label5 |
- | |
72 | mcall |
36 | mcall ,<35,24> ,0x80ffffff,label2 |
73 | - | ||
Line 74... | Line 37... | ||
74 | mov ebx,39*65536+65 |
37 | mcall ,<34,58> , ,label3 |
Line 75... | Line 38... | ||
75 | mov edx,label6 |
38 | mcall ,<47,37> , ,label5 |
76 | mcall |
- | |
77 | 39 | mcall ,<43,71> , ,label6 |
|
78 | mcall 12,2 |
- | |
79 | - | ||
80 | still: |
40 | |
81 | 41 | mcall 12,2 |
|
82 | mov eax,10 ; wait here for event |
42 | |
83 | mcall |
43 | still: |
84 | 44 | mcall 10 ;wait here for event |
|
85 | dec eax |
45 | dec eax |
86 | jz do_draw |
- | |
87 | dec eax |
46 | jz draw_window |
88 | jnz button |
47 | dec eax |
89 | key: |
48 | jnz button |
90 | mov al,2 ; now eax=2 - get key code |
49 | |
91 | mcall |
50 | mcall 2 ;eax=2 - get key code |
Line 101... | Line 60... | ||
101 | cmp al,181 |
60 | cmp al,181 |
102 | jz power_off |
61 | jz power_off |
103 | jmp still |
62 | jmp still |
Line 104... | Line 63... | ||
104 | 63 | ||
105 | button: |
64 | button: |
106 | mov al,17 ; now eax=17 - get pressed button id |
- | |
107 | mcall |
65 | mcall 17 ;eax=17 - get pressed button id |
108 | xchg al,ah |
66 | xchg al,ah |
109 | dec eax |
67 | dec eax |
110 | jz close_1 |
68 | jz close_1 |
111 | dec eax |
69 | dec eax |
112 | jz restart_kernel |
70 | jz restart_kernel |
113 | dec eax |
71 | dec eax |
114 | jz restart |
72 | jz restart |
115 | dec eax |
73 | dec eax |
116 | jnz run_rdsave |
- | |
117 | ; we have only one button left, this is close button |
74 | jnz run_rdsave |
118 | ; dec eax |
- | |
119 | ; jnz still |
75 | |
120 | power_off: |
76 | power_off: |
121 | push 2 |
77 | push 2 |
122 | jmp mcall_and_close |
- | |
123 | - | ||
124 | close_1: |
- | |
125 | or eax,-1 |
- | |
126 | mcall |
- | |
127 | 78 | jmp mcall_and_close |
|
128 | restart: |
79 | restart: |
129 | push 3 |
80 | push 3 |
130 | jmp mcall_and_close |
- | |
131 | 81 | jmp mcall_and_close |
|
132 | restart_kernel: |
82 | restart_kernel: |
133 | push 4 |
83 | push 4 |
134 | mcall_and_close: |
84 | mcall_and_close: |
135 | pop ecx |
85 | pop ecx |
- | 86 | mcall 18,9 |
|
- | 87 | ||
136 | mcall 18,9 |
88 | close_1: |
Line 137... | Line 89... | ||
137 | jmp close_1 |
89 | mcall -1 |
138 | - | ||
139 | run_rdsave: |
90 | |
140 | mov eax,70 |
- | |
141 | mov ebx,rdsave |
91 | run_rdsave: |
Line 142... | Line 92... | ||
142 | mcall |
92 | mcall 70,rdsave |
- | 93 | jmp still |
|
Line 143... | Line -... | ||
143 | jmp still |
- | |
144 | - | ||
145 | data |
- | |
146 | - | ||
147 | if lang eq ru |
- | |
148 | label2: |
- | |
149 | db '몫îç¨âì ¤à®',0 |
- | |
150 | label3: |
- | |
151 | db '¥à¥§ ¯ã᪠⬥ ',0 |
- | |
152 | label4: |
- | |
153 | db '®åà ¨âì áâனª¨ (Ctrl-S)',0 |
- | |
154 | - | ||
155 | else if lang eq ge |
- | |
156 | label2: |
- | |
157 | db ' Beenden Kernel',0 |
- | |
158 | label3: |
- | |
159 | db ' Neustart Abbrechen',0 |
- | |
160 | label4: |
- | |
161 | db 'Save your settings (Ctrl-S)',0 |
- | |
162 | - | ||
163 | else if lang eq it |
- | |
164 | label2: |
- | |
165 | db ' Spegni Kernel',0 |
- | |
166 | label3: |
- | |
167 | db ' Riavvio Annulla',0 |
- | |
168 | label4: |
- | |
169 | db 'Salva impostazioni (Ctrl-S)',0 |
- | |
170 | - | ||
171 | else |
- | |
172 | label2: |
- | |
173 | db 'Power off Kernel',0 |
- | |
174 | label3: |
- | |
175 | db ' Restart Cancel',0 |
- | |
176 | label4: |
- | |
177 | db 'Save your settings (Ctrl-S)',0 |
- | |
178 | - | ||
179 | end if |
- | |
180 | - | ||
181 | label5: |
- | |
182 | db '(End) (Home)',0 |
- | |
183 | label6: |
- | |
184 | db '(Enter) (Esc)',0 |
- | |
185 | - | ||
186 | rdsave: |
- | |
187 | dd 7 |
- | |
188 | dd 0 |
- | |
189 | dd 0 |
94 | |
- | 95 | data |
|
190 | dd 0 |
96 | include 'data.inc' |