Rev 1980 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1980 | Rev 5093 | ||
---|---|---|---|
1 | ; Battery Indicator v0.ALPHA by Gluk |
1 | ; Battery Indicator v0.ALPHA by Gluk |
2 | include "macros.inc" |
2 | include "../../macros.inc" |
3 | MEOS_APP_START |
3 | MEOS_APP_START |
4 | CODE |
4 | CODE |
5 | 5 | ||
6 | init: |
6 | init: |
7 | mov cl,48d ; setting waitingmask |
7 | mov cl,48d ; setting waitingmask |
8 | mov edx,0x110 |
8 | mov edx,0x110 |
9 | mcall 66,4 |
9 | mcall 66,4 |
10 | 10 | ||
11 | mov word[vminor],0 |
11 | mov word[vminor],0 |
12 | mov dx,0x5300 |
12 | mov dx,0x5300 |
13 | xor ebx,ebx |
13 | xor ebx,ebx |
14 | mov eax,49 |
14 | mov eax,49 |
15 | jnc @f |
15 | jnc @f |
16 | mov word[vminor],ax |
16 | mov word[vminor],ax |
17 | @@: |
17 | @@: |
18 | mov dx,0x5308 |
18 | mov dx,0x5308 |
19 | mov bx,1 |
19 | mov bx,1 |
20 | mov cx,bx |
20 | mov cx,bx |
21 | mov eax,49 |
21 | mov eax,49 |
22 | int 0x40 |
22 | int 0x40 |
23 | mov dx,0x530E |
23 | mov dx,0x530E |
24 | xor bx,bx |
24 | xor bx,bx |
25 | mov cx,0x0102 |
25 | mov cx,0x0102 |
26 | mov eax,49 |
26 | mov eax,49 |
27 | int 0x40 |
27 | int 0x40 |
28 | mov dx,0x530D |
28 | mov dx,0x530D |
29 | mov bx,1 |
29 | mov bx,1 |
30 | mov cx,bx |
30 | mov cx,bx |
31 | mov eax,49 |
31 | mov eax,49 |
32 | int 0x40 |
32 | int 0x40 |
33 | mov dx,0x530F |
33 | mov dx,0x530F |
34 | mov bx,1 |
34 | mov bx,1 |
35 | mov cx,bx |
35 | mov cx,bx |
36 | mov eax,49 |
36 | mov eax,49 |
37 | int 0x40 |
37 | int 0x40 |
38 | xor ebx,ebx |
38 | xor ebx,ebx |
39 | mov bx,[bid] ; find a bid |
39 | mov bx,[bid] ; find a bid |
40 | dec ebx |
40 | dec ebx |
41 | @@: |
41 | @@: |
42 | mov eax,49 |
42 | mov eax,49 |
43 | mov dx,530Ah |
43 | mov dx,530Ah |
44 | inc ebx |
44 | inc ebx |
45 | int 0x40 |
45 | int 0x40 |
46 | jc @b |
46 | jc @b |
47 | ;cmp cl,0xff |
47 | ;cmp cl,0xff |
48 | ;je @b |
48 | ;je @b |
49 | finded: |
49 | finded: |
50 | mov [bid],bx |
50 | mov [bid],bx |
51 | ;mcall 49,0,0,5310h |
51 | ;mcall 49,0,0,5310h |
52 | 52 | ||
53 | mcall 9,streaminfo,-1 ; get process data |
53 | mcall 9,streaminfo,-1 ; get process data |
54 | mov ecx,dword[streaminfo+30d] |
54 | mov ecx,dword[streaminfo+30d] |
55 | mcall 18,21 |
55 | mcall 18,21 |
56 | mov [slotid],eax |
56 | mov [slotid],eax |
57 | 57 | ||
58 | mov eax,48 ; get system colors |
58 | mov eax,48 ; get system colors |
59 | mov ebx,3 |
59 | mov ebx,3 |
60 | mov ecx,sc |
60 | mov ecx,sc |
61 | mov edx,sizeof.system_colors |
61 | mov edx,sizeof.system_colors |
62 | mcall |
62 | mcall |
63 | initend: |
63 | initend: |
64 | 64 | ||
65 | redraw: |
65 | redraw: |
66 | call draw_window |
66 | call draw_window |
67 | 67 | ||
68 | wait_event: ; main cycle |
68 | wait_event: ; main cycle |
69 | call redata |
69 | call redata |
70 | mov ebx,[waiting] |
70 | mov ebx,[waiting] |
71 | mcall 23 |
71 | mcall 23 |
72 | cmp eax,0 |
72 | cmp eax,0 |
73 | jz wait_event |
73 | jz wait_event |
74 | dec eax |
74 | dec eax |
75 | jz redraw |
75 | jz redraw |
76 | dec eax |
76 | dec eax |
77 | jz key |
77 | jz key |
78 | dec eax |
78 | dec eax |
79 | jz button |
79 | jz button |
80 | jmp wait_event |
80 | jmp wait_event |
81 | 81 | ||
82 | button: |
82 | button: |
83 | mcall 17 |
83 | mcall 17 |
84 | @@: ;1: |
84 | @@: ;1: |
85 | dec ah |
85 | dec ah |
86 | ;jnz @f |
86 | ;jnz @f |
87 | ; or eax,-1 |
87 | ; or eax,-1 |
88 | ; mcall |
88 | ; mcall |
89 | ;@@: ;2 |
89 | ;@@: ;2 |
90 | dec ah |
90 | dec ah |
91 | jnz @f |
91 | jnz @f |
92 | mov eax,dword[whatview] |
92 | mov eax,dword[whatview] |
93 | mov ebx,views_end-3 |
93 | mov ebx,views_end-3 |
94 | add eax,4 |
94 | add eax,4 |
95 | cmp eax,ebx |
95 | cmp eax,ebx |
96 | jb allok1 |
96 | jb allok1 |
97 | mov eax,views_start |
97 | mov eax,views_start |
98 | allok1: |
98 | allok1: |
99 | mov [whatview],eax |
99 | mov [whatview],eax |
100 | mov eax,[eax] |
100 | mov eax,[eax] |
101 | mov [viewer],eax |
101 | mov [viewer],eax |
102 | @@: |
102 | @@: |
103 | jmp wait_event |
103 | jmp wait_event |
104 | 104 | ||
105 | redata: |
105 | redata: |
106 | call getdata |
106 | call getdata |
107 | mov al,[window] |
107 | mov al,[window] |
108 | cmp al,0 |
108 | cmp al,0 |
109 | jz @f |
109 | jz @f |
110 | call regraph |
110 | call regraph |
111 | call rebutton |
111 | call rebutton |
112 | @@: |
112 | @@: |
113 | ret |
113 | ret |
114 | 114 | ||
115 | key: ; key event handler |
115 | key: ; key event handler |
116 | mov al,2 ; get key code |
116 | mov al,2 ; get key code |
117 | mcall |
117 | mcall |
118 | cmp al,2 |
118 | cmp al,2 |
119 | jne wait_event |
119 | jne wait_event |
120 | call rewindow |
120 | call rewindow |
121 | jmp wait_event |
121 | jmp wait_event |
122 | 122 | ||
123 | draw_window: |
123 | draw_window: |
124 | mov eax,12 |
124 | mov eax,12 |
125 | mov ebx,1 |
125 | mov ebx,1 |
126 | mcall |
126 | mcall |
127 | 127 | ||
128 | mov al,byte[window] |
128 | mov al,byte[window] |
129 | cmp al,0 |
129 | cmp al,0 |
130 | jz nowindow |
130 | jz nowindow |
131 | 131 | ||
132 | mcall 48,5 |
132 | mcall 48,5 |
133 | sub eax,[winotstx] |
133 | sub eax,[winotstx] |
134 | sub eax,[winsizex] |
134 | sub eax,[winsizex] |
135 | shl eax,16 |
135 | shl eax,16 |
136 | sub ebx,[winotsty] |
136 | sub ebx,[winotsty] |
137 | sub ebx,[winsizey] |
137 | sub ebx,[winsizey] |
138 | shl ebx,16 |
138 | shl ebx,16 |
139 | mov ecx,ebx |
139 | mov ecx,ebx |
140 | mov ebx,eax |
140 | mov ebx,eax |
141 | 141 | ||
142 | xor eax,eax ; create and draw the window |
142 | xor eax,eax ; create and draw the window |
143 | add ebx,dword[winsizex] |
143 | add ebx,dword[winsizex] |
144 | dec ebx ; (window_c)*65536+(window_s) |
144 | dec ebx ; (window_c)*65536+(window_s) |
145 | add ecx,dword[winsizey] |
145 | add ecx,dword[winsizey] |
146 | dec ecx |
146 | dec ecx |
147 | mov edx,[sc.work] ; work area color |
147 | mov edx,[sc.work] ; work area color |
148 | or edx, 0x61000000 ; & window type 1 |
148 | or edx, 0x61000000 ; & window type 1 |
149 | int 0x40 |
149 | int 0x40 |
150 | 150 | ||
151 | mov eax,13d ;printing pryamougolniks |
151 | mov eax,13d ;printing pryamougolniks |
152 | push eax ;pipka out |
152 | push eax ;pipka out |
153 | mov eax,[winsizex] |
153 | mov eax,[winsizex] |
154 | xor edx,edx |
154 | xor edx,edx |
155 | mov ebx,3 |
155 | mov ebx,3 |
156 | div ebx |
156 | div ebx |
157 | mov ebx,eax |
157 | mov ebx,eax |
158 | ; pusha |
158 | ; pusha |
159 | ;mov [nowpoint],0 |
159 | ;mov [nowpoint],0 |
160 | ;in: ebx - piplenght |
160 | ;in: ebx - piplenght |
161 | ; mov eax,0 |
161 | ; mov eax,0 |
162 | ;mov edi, nowpoint |
162 | ;mov edi, nowpoint |
163 | ; add edi,winform |
163 | ; add edi,winform |
164 | ; mov ecx,ebx |
164 | ; mov ecx,ebx |
165 | ; rep stosb |
165 | ; rep stosb |
166 | ; mov eax,1 |
166 | ; mov eax,1 |
167 | ;mov edi, nowpoint |
167 | ;mov edi, nowpoint |
168 | ; add edi,winform |
168 | ; add edi,winform |
169 | ; mov ecx,ebx |
169 | ; mov ecx,ebx |
170 | ; rep stosb |
170 | ; rep stosb |
171 | ; mov eax,0 |
171 | ; mov eax,0 |
172 | ;mov edi, nowpoint |
172 | ;mov edi, nowpoint |
173 | ; add edi,winform |
173 | ; add edi,winform |
174 | ; mov ecx,ebx |
174 | ; mov ecx,ebx |
175 | ; rep stosb |
175 | ; rep stosb |
176 | ; popa |
176 | ; popa |
177 | mov ecx,ebx |
177 | mov ecx,ebx |
178 | shl ebx,16 |
178 | shl ebx,16 |
179 | pop eax |
179 | pop eax |
180 | add ebx,ecx |
180 | add ebx,ecx |
181 | mov ecx,[winsizey] |
181 | mov ecx,[winsizey] |
182 | shr ecx,4 ;div 16 ;) |
182 | shr ecx,4 ;div 16 ;) |
183 | xor edx,edx |
183 | xor edx,edx |
184 | int 0x40 |
184 | int 0x40 |
185 | 185 | ||
186 | add ebx,65536-2 ;pipka in |
186 | add ebx,65536-2 ;pipka in |
187 | add ecx,65536-1 |
187 | add ecx,65536-1 |
188 | mov edx,[sc] |
188 | mov edx,[sc] |
189 | int 0x40 |
189 | int 0x40 |
190 | 190 | ||
191 | mov ebx,[winsizex] ;korpus out |
191 | mov ebx,[winsizex] ;korpus out |
192 | mov ecx,[winsizey] |
192 | mov ecx,[winsizey] |
193 | shr ecx,4 |
193 | shr ecx,4 |
194 | mov edx,ecx |
194 | mov edx,ecx |
195 | shl ecx,16 |
195 | shl ecx,16 |
196 | add ecx,[winsizey] |
196 | add ecx,[winsizey] |
197 | sub ecx,edx |
197 | sub ecx,edx |
198 | xor edx,edx |
198 | xor edx,edx |
199 | int 0x40 |
199 | int 0x40 |
200 | 200 | ||
201 | add ebx,65536-2 ;korpus in |
201 | add ebx,65536-2 ;korpus in |
202 | add ecx,65536-2 |
202 | add ecx,65536-2 |
203 | mov edx,[sc] |
203 | mov edx,[sc] |
204 | int 0x40 |
204 | int 0x40 |
205 | 205 | ||
206 | mov edx,[winborts] |
206 | mov edx,[winborts] |
207 | mov edi,edx |
207 | mov edi,edx |
208 | shl edx,16 |
208 | shl edx,16 |
209 | add ebx,edx |
209 | add ebx,edx |
210 | sub ebx,edi |
210 | sub ebx,edi |
211 | sub ebx,edi ;black contur |
211 | sub ebx,edi ;black contur |
212 | add ecx,65536-3 |
212 | add ecx,65536-3 |
213 | sub ecx,[winknopy] |
213 | sub ecx,[winknopy] |
214 | xor edx,edx |
214 | xor edx,edx |
215 | int 0x40 |
215 | int 0x40 |
216 | 216 | ||
217 | add ebx,65536-2 ;working area |
217 | add ebx,65536-2 ;working area |
218 | add ecx,65536-2 |
218 | add ecx,65536-2 |
219 | mov edx,[sc.work] |
219 | mov edx,[sc.work] |
220 | int 0x40 |
220 | int 0x40 |
221 | mov [winworkx],ebx |
221 | mov [winworkx],ebx |
222 | mov [winworky],ecx |
222 | mov [winworky],ecx |
223 | 223 | ||
224 | call redata |
224 | call redata |
225 | nowindow: |
225 | nowindow: |
226 | mov eax,12 ;finish drawing |
226 | mov eax,12 ;finish drawing |
227 | mov ebx,2 |
227 | mov ebx,2 |
228 | int 0x40 |
228 | int 0x40 |
229 | ret |
229 | ret |
230 | 230 | ||
231 | rebutton: |
231 | rebutton: |
232 | mov eax,8 |
232 | mov eax,8 |
233 | mov edx,0x80000002 |
233 | mov edx,0x80000002 |
234 | int 0x40 |
234 | int 0x40 |
235 | 235 | ||
236 | mov ebx,[winsizex] |
236 | mov ebx,[winsizex] |
237 | add ebx,65536-3 |
237 | add ebx,65536-3 |
238 | mov edi,[winknopy] |
238 | mov edi,[winknopy] |
239 | mov ecx,[winsizey] |
239 | mov ecx,[winsizey] |
240 | sub ecx,edi |
240 | sub ecx,edi |
241 | sub ecx,2 |
241 | sub ecx,2 |
242 | shl ecx,16 |
242 | shl ecx,16 |
243 | add ecx,edi |
243 | add ecx,edi |
244 | mov edx,0x00000002 |
244 | mov edx,0x00000002 |
245 | mov esi,[sc.work_button] |
245 | mov esi,[sc.work_button] |
246 | int 0x40 |
246 | int 0x40 |
247 | 247 | ||
248 | mov [wintextx],3 |
248 | mov [wintextx],3 |
249 | sub edi,[winfonty] |
249 | sub edi,[winfonty] |
250 | shr edi,1 |
250 | shr edi,1 |
251 | mov ebx,edi |
251 | mov ebx,edi |
252 | add ebx,[winsizey] |
252 | add ebx,[winsizey] |
253 | sub ebx,[winknopy] |
253 | sub ebx,[winknopy] |
254 | mov [wintexty],ebx |
254 | mov [wintexty],ebx |
255 | call dword[viewer] |
255 | call dword[viewer] |
256 | ret |
256 | ret |
257 | 257 | ||
258 | 258 | ||
259 | rewindow: |
259 | rewindow: |
260 | mov al,byte[window] |
260 | mov al,byte[window] |
261 | cmp al,1 |
261 | cmp al,1 |
262 | jne @f |
262 | jne @f |
263 | mcall 67,1,1,0,0 |
263 | mcall 67,1,1,0,0 |
264 | mov byte[window],0 |
264 | mov byte[window],0 |
265 | mcall 40,2 |
265 | mcall 40,2 |
266 | jmp endrew |
266 | jmp endrew |
267 | @@: |
267 | @@: |
268 | mcall 48,5 |
268 | mcall 48,5 |
269 | sub eax,[winotstx] |
269 | sub eax,[winotstx] |
270 | sub eax,[winsizex] |
270 | sub eax,[winsizex] |
271 | sub ebx,[winotsty] |
271 | sub ebx,[winotsty] |
272 | sub ebx,[winsizey] |
272 | sub ebx,[winsizey] |
273 | mov ecx,ebx |
273 | mov ecx,ebx |
274 | mov ebx,eax |
274 | mov ebx,eax |
275 | 275 | ||
276 | mov eax,67 |
276 | mov eax,67 |
277 | mov edx,[winsizex] |
277 | mov edx,[winsizex] |
278 | dec edx |
278 | dec edx |
279 | mov esi,[winsizey] |
279 | mov esi,[winsizey] |
280 | dec esi |
280 | dec esi |
281 | int 0x40 |
281 | int 0x40 |
282 | 282 | ||
283 | mov byte[window],1 |
283 | mov byte[window],1 |
284 | mov ecx,[slotid] |
284 | mov ecx,[slotid] |
285 | mcall 18,3 |
285 | mcall 18,3 |
286 | 286 | ||
287 | mcall 40,7 |
287 | mcall 40,7 |
288 | endrew: |
288 | endrew: |
289 | call draw_window |
289 | call draw_window |
290 | ret |
290 | ret |
291 | 291 | ||
292 | regraph: |
292 | regraph: |
293 | mov eax,13 |
293 | mov eax,13 |
294 | mov ebx,[winworkx] ;working area |
294 | mov ebx,[winworkx] ;working area |
295 | mov ecx,[winworky] |
295 | mov ecx,[winworky] |
296 | mov edx,[sc.work] |
296 | mov edx,[sc.work] |
297 | int 0x40 |
297 | int 0x40 |
298 | 298 | ||
299 | mov ebx,[winworky] |
299 | mov ebx,[winworky] |
300 | shl ebx,16 |
300 | shl ebx,16 |
301 | shr ebx,16 |
301 | shr ebx,16 |
302 | sub ebx,[wingotst] |
302 | sub ebx,[wingotst] |
303 | sub ebx,[wingotst] |
303 | sub ebx,[wingotst] |
304 | mov eax,ebx |
304 | mov eax,ebx |
305 | shr ebx,3 ;div 8 ;) |
305 | shr ebx,3 ;div 8 ;) |
306 | shl eax,29 |
306 | shl eax,29 |
307 | shr eax,32 ;ostatok |
307 | shr eax,32 ;ostatok |
308 | add eax,[wingotst] |
308 | add eax,[wingotst] |
309 | cmp eax,ebx |
309 | cmp eax,ebx |
310 | jb @f |
310 | jb @f |
311 | inc ebx |
311 | inc ebx |
312 | @@: |
312 | @@: |
313 | mov [winlines],ebx |
313 | mov [winlines],ebx |
314 | mov ecx,[delenia] |
314 | mov ecx,[delenia] |
315 | @@: |
315 | @@: |
316 | push ecx |
316 | push ecx |
317 | mov edi,ecx |
317 | mov edi,ecx |
318 | 318 | ||
319 | mov edx,[wingotst] |
319 | mov edx,[wingotst] |
320 | mov ebx,[winworkx] |
320 | mov ebx,[winworkx] |
321 | shl edx,16 |
321 | shl edx,16 |
322 | add ebx,edx |
322 | add ebx,edx |
323 | shr edx,16 |
323 | shr edx,16 |
324 | sub ebx,edx |
324 | sub ebx,edx |
325 | sub ebx,edx |
325 | sub ebx,edx |
326 | 326 | ||
327 | mov ecx,[winworky] |
327 | mov ecx,[winworky] |
328 | mov eax,[winworky] |
328 | mov eax,[winworky] |
329 | shl eax,16 |
329 | shl eax,16 |
330 | add ecx,eax |
330 | add ecx,eax |
331 | 331 | ||
332 | push edx |
332 | push edx |
333 | mov eax,[winlines] |
333 | mov eax,[winlines] |
334 | mul edi |
334 | mul edi |
335 | pop edx |
335 | pop edx |
336 | add edx,eax |
336 | add edx,eax |
337 | 337 | ||
338 | shl edx,16 |
338 | shl edx,16 |
339 | sub ecx,edx |
339 | sub ecx,edx |
340 | 340 | ||
341 | shr ecx,16 |
341 | shr ecx,16 |
342 | inc ecx |
342 | inc ecx |
343 | shl ecx,16 |
343 | shl ecx,16 |
344 | add ecx,[winlines] |
344 | add ecx,[winlines] |
345 | sub ecx,1 ;promezhutki |
345 | sub ecx,1 ;promezhutki |
346 | mov edx,[sc.work_graph] |
346 | mov edx,[sc.work_graph] |
347 | mov eax,13 |
347 | mov eax,13 |
348 | int 0x40 |
348 | int 0x40 |
349 | 349 | ||
350 | pop ecx |
350 | pop ecx |
351 | loop @b |
351 | loop @b |
352 | endreg: |
352 | endreg: |
353 | ret |
353 | ret |
354 | 354 | ||
355 | getdata: |
355 | getdata: |
356 | xor ecx,ecx |
356 | xor ecx,ecx |
357 | xor edx,edx |
357 | xor edx,edx |
358 | 358 | ||
359 | ;HERE YOU MAY GET A PERCENTAGE AND REMAINING TIME FOR BATTERY UNIT [bid], AND PUT THEY INTO [gotperc] AND [gottime] |
359 | ;HERE YOU MAY GET A PERCENTAGE AND REMAINING TIME FOR BATTERY UNIT [bid], AND PUT THEY INTO [gotperc] AND [gottime] |
360 | mov bx,[bid] |
360 | mov bx,[bid] |
361 | mov eax,49 |
361 | mov eax,49 |
362 | mov dx,530Ah |
362 | mov dx,530Ah |
363 | int 0x40 |
363 | int 0x40 |
364 | mov [gotperc],cl |
364 | mov [gotperc],cl |
365 | mov [gottime],dx |
365 | mov [gottime],dx |
366 | ;/HERE |
366 | ;/HERE |
367 | 367 | ||
368 | xor eax,eax |
368 | xor eax,eax |
369 | mov al,[gotperc] |
369 | mov al,[gotperc] |
370 | cmp al,0 |
370 | cmp al,0 |
371 | jne @f |
371 | jne @f |
372 | mov [delenia],1 |
372 | mov [delenia],1 |
373 | ret |
373 | ret |
374 | @@: |
374 | @@: |
375 | cmp al,100 |
375 | cmp al,100 |
376 | jb @f |
376 | jb @f |
377 | mov [delenia],8 |
377 | mov [delenia],8 |
378 | ret |
378 | ret |
379 | @@: |
379 | @@: |
380 | shl eax,3 |
380 | shl eax,3 |
381 | mov ebx,100 |
381 | mov ebx,100 |
382 | xor edx,edx |
382 | xor edx,edx |
383 | div ebx |
383 | div ebx |
384 | inc eax |
384 | inc eax |
385 | mov [delenia],eax |
385 | mov [delenia],eax |
386 | ret |
386 | ret |
387 | 387 | ||
388 | viewers: |
388 | viewers: |
389 | time: |
389 | time: |
390 | xor edx,edx |
390 | xor edx,edx |
391 | mov dx,[gottime] |
391 | mov dx,[gottime] |
392 | cmp dx,0xffff |
392 | cmp dx,0xffff |
393 | jne @f |
393 | jne @f |
394 | mov eax,4 |
394 | mov eax,4 |
395 | mov ebx,[wintextx] |
395 | mov ebx,[wintextx] |
396 | shl ebx,16 |
396 | shl ebx,16 |
397 | add ebx,[wintexty] |
397 | add ebx,[wintexty] |
398 | mov ecx,0x00000000 |
398 | mov ecx,0x00000000 |
399 | mov edx,simbols |
399 | mov edx,simbols |
400 | mov esi,3 |
400 | mov esi,3 |
401 | add ecx,[sc.work_button_text] |
401 | add ecx,[sc.work_button_text] |
402 | int 0x40 |
402 | int 0x40 |
403 | ret |
403 | ret |
404 | @@: |
404 | @@: |
405 | shl edx,17 |
405 | shl edx,17 |
406 | shr edx,31 |
406 | shr edx,31 |
407 | mov eax,4 |
407 | mov eax,4 |
408 | mov ebx,[wintextx] |
408 | mov ebx,[wintextx] |
409 | add ebx,2*8 |
409 | add ebx,2*8 |
410 | shl ebx,16 |
410 | shl ebx,16 |
411 | add ebx,[wintexty] |
411 | add ebx,[wintexty] |
412 | mov ecx,0x00000000 |
412 | mov ecx,0x00000000 |
413 | add edx,simbols |
413 | add edx,simbols |
414 | mov esi,1 |
414 | mov esi,1 |
415 | add ecx,[sc.work_button_text] |
415 | add ecx,[sc.work_button_text] |
416 | int 0x40 |
416 | int 0x40 |
417 | ;12345678901234567890123456789012 |
417 | ;12345678901234567890123456789012 |
418 | mov eax,47 |
418 | mov eax,47 |
419 | mov bl,2 ;cifr |
419 | mov bl,2 ;cifr |
420 | mov bh,0 |
420 | mov bh,0 |
421 | shl ebx,16 |
421 | shl ebx,16 |
422 | mov bl,0 ;ecx is chislo |
422 | mov bl,0 ;ecx is chislo |
423 | mov bh,0 |
423 | mov bh,0 |
424 | xor ecx,ecx |
424 | xor ecx,ecx |
425 | mov cx,[gottime] |
425 | mov cx,[gottime] |
426 | shl ecx,18 |
426 | shl ecx,18 |
427 | shr ecx,18 |
427 | shr ecx,18 |
428 | mov edx,[wintextx] |
428 | mov edx,[wintextx] |
429 | shl edx,16 |
429 | shl edx,16 |
430 | add edx,[wintexty] |
430 | add edx,[wintexty] |
431 | mov esi,0x10000000 |
431 | mov esi,0x10000000 |
432 | add esi,[sc.work_button_text] |
432 | add esi,[sc.work_button_text] |
433 | int 0x40 |
433 | int 0x40 |
434 | ret |
434 | ret |
435 | percent: |
435 | percent: |
436 | mov dl,[gotperc] |
436 | mov dl,[gotperc] |
437 | cmp dl,0xff |
437 | cmp dl,0xff |
438 | jne @f |
438 | jne @f |
439 | mov eax,4 |
439 | mov eax,4 |
440 | mov ebx,[wintextx] |
440 | mov ebx,[wintextx] |
441 | shl ebx,16 |
441 | shl ebx,16 |
442 | add ebx,[wintexty] |
442 | add ebx,[wintexty] |
443 | mov ecx,0x00000000 |
443 | mov ecx,0x00000000 |
444 | mov edx,simbols |
444 | mov edx,simbols |
445 | mov esi,4 |
445 | mov esi,4 |
446 | add ecx,[sc.work_button_text] |
446 | add ecx,[sc.work_button_text] |
447 | int 0x40 |
447 | int 0x40 |
448 | ret |
448 | ret |
449 | @@: |
449 | @@: |
450 | mov eax,4 |
450 | mov eax,4 |
451 | mov ebx,[wintextx] |
451 | mov ebx,[wintextx] |
452 | add ebx,3*8 |
452 | add ebx,3*8 |
453 | shl ebx,16 |
453 | shl ebx,16 |
454 | add ebx,[wintexty] |
454 | add ebx,[wintexty] |
455 | mov ecx,0x00000000 |
455 | mov ecx,0x00000000 |
456 | mov edx,simbols |
456 | mov edx,simbols |
457 | add edx,3 |
457 | add edx,3 |
458 | mov esi,1 |
458 | mov esi,1 |
459 | add ecx,[sc.work_button_text] |
459 | add ecx,[sc.work_button_text] |
460 | int 0x40 |
460 | int 0x40 |
461 | 461 | ||
462 | mov eax,47 |
462 | mov eax,47 |
463 | mov bl,3 ;cifr |
463 | mov bl,3 ;cifr |
464 | mov bh,0 |
464 | mov bh,0 |
465 | shl ebx,16 |
465 | shl ebx,16 |
466 | mov bl,0 ;ecx is chislo |
466 | mov bl,0 ;ecx is chislo |
467 | mov bh,0 |
467 | mov bh,0 |
468 | xor ecx,ecx |
468 | xor ecx,ecx |
469 | mov cl,[gotperc] |
469 | mov cl,[gotperc] |
470 | mov edx,[wintextx] |
470 | mov edx,[wintextx] |
471 | shl edx,16 |
471 | shl edx,16 |
472 | add edx,[wintexty] |
472 | add edx,[wintexty] |
473 | mov esi,0x10000000 |
473 | mov esi,0x10000000 |
474 | add esi,[sc.work_button_text] |
474 | add esi,[sc.work_button_text] |
475 | int 0x40 |
475 | int 0x40 |
476 | ret |
476 | ret |
477 | ; <--- initialised data ---> |
477 | ; <--- initialised data ---> |
478 | DATA |
478 | DATA |
479 | 479 | ||
480 | bid dw 8000h |
480 | bid dw 8000h |
481 | 481 | ||
482 | viewer dd percent |
482 | viewer dd percent |
483 | whatview dd views_start |
483 | whatview dd views_start |
484 | views_start: |
484 | views_start: |
485 | dd percent |
485 | dd percent |
486 | dd time |
486 | dd time |
487 | views_end: |
487 | views_end: |
488 | 488 | ||
489 | simbols db 'smh%??m???%' |
489 | simbols db 'smh%??m???%' |
490 | 490 | ||
491 | waiting dd 1000 |
491 | waiting dd 1000 |
492 | watchings: |
492 | watchings: |
493 | window db 1 |
493 | window db 1 |
494 | winotstx dd 7 |
494 | winotstx dd 7 |
495 | winotsty dd 7 |
495 | winotsty dd 7 |
496 | winsizex dd 48 |
496 | winsizex dd 48 |
497 | winsizey dd 64 |
497 | winsizey dd 64 |
498 | winborts dd 1 |
498 | winborts dd 1 |
499 | winfonty dd 9 |
499 | winfonty dd 9 |
500 | winknopy dd 10 |
500 | winknopy dd 10 |
501 | wingotst dd 2 |
501 | wingotst dd 2 |
502 | ; <--- uninitialised data ---> |
502 | ; <--- uninitialised data ---> |
503 | UDATA |
503 | UDATA |
504 | vminor dw ? |
504 | vminor dw ? |
505 | sc system_colors |
505 | sc system_colors |
506 | streaminfo rb 1024 |
506 | streaminfo rb 1024 |
507 | winform rb 1024 |
507 | winform rb 1024 |
508 | slotid dd ? |
508 | slotid dd ? |
509 | 509 | ||
510 | gotperc db ? |
510 | gotperc db ? |
511 | gottime dw ? |
511 | gottime dw ? |
512 | delenia dd ? |
512 | delenia dd ? |
513 | 513 | ||
514 | uwatchings: |
514 | uwatchings: |
515 | winhomex dd ? |
515 | winhomex dd ? |
516 | winhomey dd ? |
516 | winhomey dd ? |
517 | winworkx dd ? ;cx*65536+sx |
517 | winworkx dd ? ;cx*65536+sx |
518 | winworky dd ? ;cy*65536+sy |
518 | winworky dd ? ;cy*65536+sy |
519 | winlines dd ? |
519 | winlines dd ? |
520 | wintextx dd ? |
520 | wintextx dd ? |
521 | wintexty dd ? |
521 | wintexty dd ? |
522 | MEOS_APP_END--->---> |
522 | MEOS_APP_END--->---> |