Rev 529 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 529 | Rev 748 | ||
---|---|---|---|
1 | ; |
1 | ; |
2 | ; END |
2 | ; END |
3 | ; |
3 | ; |
4 | ; |
4 | ; |
5 | ; and if we know that high 24 bits of eax are zero, we can use 1st form |
5 | ; and if we know that high 24 bits of eax are zero, we can use 1st form |
6 | ; the same about ebx,ecx,edx |
6 | ; the same about ebx,ecx,edx |
- | 7 | ; |
|
- | 8 | ; 15.02.2007 merge old END with new one (fron Veliant & Leency) by Heavyiron |
|
7 | - | ||
8 | include "lang.inc" |
9 | |
9 | include "..\..\..\macros.inc" |
10 | include "..\..\..\macros.inc" |
10 | 11 | ||
11 | meos_app_start |
12 | meos_app_start |
12 | code |
13 | code |
13 | 14 | ||
14 | do_draw: |
- | |
15 | - | ||
16 | mov eax,48 |
- | |
17 | mov ebx,3 |
- | |
18 | mov ecx,sc |
- | |
19 | mov edx,sizeof.system_colors |
- | |
20 | mcall |
15 | draw: |
21 | 16 | ||
22 | mov al,12 ; eax=12 - tell os about redraw start |
17 | mov al,12 ; eax=12 - tell os about redraw start |
23 | mov bl,1 |
18 | mov ebx,1 |
24 | mcall |
19 | mcall |
25 | 20 | ||
26 | mov al,14 ; eax=14 - get screen max x & max y |
21 | mov al,14 ; eax=14 - get screen max x & max y |
27 | mcall |
22 | mcall |
28 | 23 | ||
29 | movzx ecx,ax |
24 | movzx ecx, ax |
30 | - | ||
31 | shr eax,17 |
- | |
32 | shl eax,16 |
25 | shr eax, 16 |
33 | lea ebx,[eax-110*10000h+220] |
- | |
34 | - | ||
35 | shr ecx,1 |
26 | shr ecx, 1 |
- | 27 | shr eax, 1 |
|
- | 28 | sub eax, 157 |
|
- | 29 | sub ecx, 100 |
|
- | 30 | mov ebx, eax |
|
- | 31 | shl ebx, 16 |
|
- | 32 | add ebx, 253 |
|
36 | shl ecx,16 |
33 | shl ecx, 16 |
37 | sub ecx,50*10000h - 120 |
34 | add ecx, 154 |
38 | 35 | ||
39 | xor eax,eax ; define and draw window |
36 | xor eax,eax ; define and draw window |
40 | mov edx,[sc.work] |
- | |
41 | mov esi,edx |
- | |
42 | mov edi,edx |
37 | mov edx,0x41ffffff |
43 | mcall |
- | |
44 | 38 | mcall |
|
45 | mov edx,0x444444 |
- | |
46 | mov al,13 |
- | |
47 | mcall ,18 shl 16+90,29 shl 16+27 |
- | |
48 | push ebx |
39 | |
49 | mcall ,121 shl 16+90 |
40 | mov al, 7 |
50 | xchg ebx,[esp] |
41 | mov ebx, background |
51 | mcall ,,63 shl 16+27 |
42 | mov ecx, 254 shl 16 + 155 |
52 | pop ebx |
- | |
53 | mcall |
43 | xor edx, edx |
54 | mcall ,179 shl 16+30,99 shl 16+15 |
44 | mcall |
- | 45 | ||
55 | 46 | ||
56 | xor edx,edx |
47 | mov al,8 |
57 | mov al,8 |
48 | mcall ,58 shl 16 + 32,59 shl 16 + 34, 1 shl 30 + 1 |
58 | inc edx |
49 | inc edx |
59 | mcall ,15 shl 16+87,26 shl 16+24,,0xbb0055 |
50 | mcall ,110 shl 16 + 32,54 shl 16 + 32 |
60 | inc edx |
51 | inc edx |
61 | mcall ,118 shl 16+87,,,0xaaaa ;cccc |
52 | mcall ,161 shl 16 + 32,59 shl 16 + 34 |
62 | inc edx |
- | |
63 | mcall ,15 shl 16+87,60 shl 16+24,,0x9900 |
- | |
64 | inc edx |
- | |
65 | mcall ,118 shl 16+87,,,0xaaaaaa ;cccccc |
- | |
66 | inc edx |
- | |
67 | mcall ,175 shl 16+30,95 shl 16+15,,[sc.work_button] |
- | |
68 | - | ||
69 | mov al,4 ; 0x00000004 = write text |
- | |
70 | mov ebx,75*65536+10 |
- | |
71 | mov ecx,[sc.work_text] ; 8b window nro - RR GG BB color |
- | |
72 | or ecx,0x90000000 |
- | |
73 | mov edx,label1 ; pointer to text beginning |
- | |
74 | mcall |
- | |
75 | - | ||
76 | mov ebx,15*65536+101 |
- | |
77 | mov edx,label4 |
- | |
78 | mcall |
- | |
79 | - | ||
80 | mov ecx,0x90eeeeee ; 8b window nro - RR GG BB color |
- | |
81 | mov ebx,25*65536+30 |
- | |
82 | mov edx,label2 ; pointer to text beginning |
- | |
83 | mcall |
- | |
84 | - | ||
85 | mov ebx,20*65536+64 |
- | |
86 | mov edx,label3 |
53 | inc edx |
87 | mcall |
- | |
88 | - | ||
89 | mov ebx,45*65536+41 |
- | |
90 | mov edx,label5 |
- | |
91 | mcall |
- | |
92 | - | ||
93 | mov ebx,40*65536+75 |
54 | mcall ,193 shl 16 + 43,125 shl 16 + 16, |
94 | mov edx,label6 |
55 | inc edx |
95 | mcall |
56 | mcall ,144 shl 16 + 43 |
96 | 57 | ||
97 | mov al,12 ;end of redraw |
58 | mov al,12 ;end of redraw |
98 | mov ebx,2 |
59 | mov ebx,2 |
99 | mcall |
60 | mcall |
100 | 61 | ||
101 | still: |
62 | still: |
102 | 63 | ||
103 | mov eax,10 ; wait here for event |
64 | mov eax,10 ; wait here for event |
104 | mcall |
65 | mcall |
105 | 66 | ||
106 | dec eax |
67 | dec eax |
107 | jz do_draw |
68 | jz draw |
108 | dec eax |
69 | dec eax |
109 | jnz button |
70 | jnz button |
110 | key: |
71 | key: |
111 | mov al,2 ; now eax=2 - get key code |
72 | mov al,2 ; now eax=2 - get key code |
112 | mcall |
73 | mcall |
113 | mov al,ah |
74 | mov al,ah |
114 | cmp al,13 |
75 | cmp al,13 |
115 | jz restart |
76 | jz restart |
116 | cmp al,27 |
77 | cmp al,27 |
117 | jz close_1 |
78 | jz close_1 |
118 | cmp al,180 |
79 | cmp al,180 |
119 | jz restart_kernel |
80 | jz restart_kernel |
120 | cmp al,181 |
81 | cmp al,181 |
121 | jz power_off |
82 | jz power_off |
122 | jmp still |
83 | jmp still |
123 | 84 | ||
124 | button: |
85 | button: |
125 | mov al,17 ; now eax=17 - get pressed button id |
86 | mov al,17 ; now eax=17 - get pressed button id |
126 | mcall |
87 | mcall |
127 | xchg al,ah |
88 | xchg al,ah |
128 | dec eax |
89 | dec eax |
129 | jz power_off |
- | |
130 | dec eax |
- | |
131 | jz restart_kernel |
90 | jz restart_kernel |
132 | dec eax |
91 | dec eax |
- | 92 | jz power_off |
|
- | 93 | dec eax |
|
133 | jz restart |
94 | jz restart |
134 | dec eax |
95 | dec eax |
135 | jnz run_rdsave |
96 | jnz run_rdsave |
136 | ; we have only one button left, this is close button |
97 | ; we have only one button left, this is close button |
137 | ; dec eax |
98 | ; dec eax |
138 | ; jnz still |
99 | ; jnz still |
139 | close_1: |
100 | close_1: |
140 | or eax,-1 |
101 | or eax,-1 |
141 | mcall |
102 | mcall |
142 | 103 | ||
143 | power_off: |
104 | power_off: |
144 | push 2 |
105 | push 2 |
145 | jmp mcall_and_close |
106 | jmp mcall_and_close |
146 | 107 | ||
147 | restart: |
108 | restart: |
148 | push 3 |
109 | push 3 |
149 | jmp mcall_and_close |
110 | jmp mcall_and_close |
150 | 111 | ||
151 | restart_kernel: |
112 | restart_kernel: |
152 | push 4 |
113 | push 4 |
153 | mcall_and_close: |
114 | mcall_and_close: |
154 | pop ecx |
115 | pop ecx |
155 | mcall 18,9 |
116 | mcall 18,9 |
156 | jmp close_1 |
117 | jmp close_1 |
157 | 118 | ||
158 | run_rdsave: |
119 | run_rdsave: |
159 | mov eax,70 |
120 | mov eax,70 |
160 | mov ebx,rdsave |
121 | mov ebx,rdsave |
161 | mcall |
122 | mcall |
162 | jmp still |
123 | jmp still |
163 | 124 | ||
164 | data |
125 | data |
165 | - | ||
166 | if lang eq ru |
- | |
167 | label1: |
- | |
168 | db ' è ¢ë¡®à:',0 |
- | |
169 | label2: |
- | |
170 | db '몫îç¨âì ¤à®',0 |
- | |
171 | label3: |
- | |
172 | db '¥à¥§ ¯ã᪠⬥ ',0 |
- | |
173 | label4: |
- | |
174 | db '®åà ¨âì áâனª¨',0 |
- | |
175 | - | ||
176 | else if lang eq en |
- | |
177 | label1: |
- | |
178 | db ' SELECT:',0 |
- | |
179 | label2: |
- | |
180 | db 'POWER OFF KERNEL',0 |
- | |
181 | label3: |
- | |
182 | db ' RESTART CANCEL',0 |
- | |
183 | label4: |
- | |
184 | db 'Save settings',0 |
- | |
185 | - | ||
186 | else if lang eq et |
- | |
187 | label1: |
- | |
188 | db ' VALI:',0 |
- | |
189 | label2: |
- | |
190 | db 'LÜLITA VÄLJA KERNEL',0 |
- | |
191 | label3: |
- | |
192 | db ' RESTART TÜHISTA',0 |
- | |
193 | label4: |
- | |
194 | db 'Save settings',0 |
- | |
195 | - | ||
196 | else |
- | |
197 | label1: |
- | |
198 | db 'WAEHLEN:',0 |
- | |
199 | label2: |
- | |
200 | db ' BEENDEN KERNEL',0 |
- | |
201 | label3: |
- | |
202 | db ' NEUSTART ABBRECHEN',0 |
- | |
203 | label4: |
- | |
204 | db 'Save settings',0 |
126 | background file 'back.raw' |
205 | - | ||
206 | end if |
- | |
207 | label5: |
- | |
208 | db '(End) (Home)',0 |
- | |
209 | label6: |
- | |
210 | db '(Enter) (Esc)',0 |
- | |
211 | - | ||
212 | rdsave: |
127 | rdsave: |
213 | dd 7 |
128 | dd 7 |
214 | dd 0 |
129 | dd 0 |
215 | dd 0 |
130 | dd 0 |
216 | dd 0 |
131 | dd 0 |
217 | dd 0 |
132 | dd 0 |
218 | db '/sys/rdsave',0 |
133 | db '/sys/rdsave',0 |
219 | udata |
134 | udata |
220 | sc system_colors |
- | |
221 | 135 | ||
222 | meos_app_end |
136 | meos_app_end |