Rev 8576 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8576 | Rev 9198 | ||
---|---|---|---|
1 | ;-----------------------; |
1 | ;-----------------------; |
2 | ; CPU - process manager ; |
2 | ; CPU - process manager ; |
3 | ;-----------------------; |
3 | ;-----------------------; |
4 | 4 | ||
5 | format binary as "" |
5 | format binary as "" |
6 | 6 | ||
7 | use32 |
7 | use32 |
8 | org 0x0 |
8 | org 0x0 |
9 | 9 | ||
10 | db "MENUET01" ; 8 byte id |
10 | db "MENUET01" ; 8 byte id |
11 | dd 0x01 ; header version |
11 | dd 0x01 ; header version |
12 | dd START ; start of code |
12 | dd START ; start of code |
13 | dd IM_END ; size of image |
13 | dd IM_END ; size of image |
14 | dd U_END ; memory for app |
14 | dd U_END ; memory for app |
15 | dd stack_area ; esp |
15 | dd stack_area ; esp |
16 | dd 0x0 ; boot parameters |
16 | dd 0x0 ; boot parameters |
17 | dd cur_dir_path ; path |
17 | dd cur_dir_path ; path |
18 | ;------------------------------------------------------------------------------- |
18 | ;------------------------------------------------------------------------------- |
19 | include "lang.inc" |
19 | include "lang.inc" |
20 | include "../../../macros.inc" |
20 | include "../../../macros.inc" |
21 | include "../../../develop/libraries/box_lib/trunk/box_lib.mac" |
21 | include "../../../develop/libraries/box_lib/trunk/box_lib.mac" |
22 | include "../../../KOSfuncs.inc" |
22 | include "../../../KOSfuncs.inc" |
23 | include "../../../load_lib.mac" |
23 | include "../../../load_lib.mac" |
24 | ;------------------------------------------------------------------------------- |
24 | ;------------------------------------------------------------------------------- |
25 | DISPLAY_PROCESSES = 20 ;number of processes to show |
25 | DISPLAY_PROCESSES = 20 ;number of processes to show |
26 | ;------------------------------------------------------------------------------- |
26 | ;------------------------------------------------------------------------------- |
27 | WINDOW.WIDTH = PROCESS_TABLE.WIDTH + 10*2 |
27 | WINDOW.WIDTH = PROCESS_TABLE.WIDTH + 10*2 |
28 | WINDOW.HEIGHT = WORK_AREA.HEIGHT + 30 |
28 | WINDOW.HEIGHT = WORK_AREA.HEIGHT + 30 |
29 | WORK_AREA.HEIGHT = CHECKBOX.Y + BUTTON.HEIGHT + 10 |
29 | WORK_AREA.HEIGHT = CHECKBOX.Y + BUTTON.HEIGHT + 10 |
30 | PROCESS_TABLE: |
30 | PROCESS_TABLE: |
31 | .X = 10 |
31 | .X = 10 |
32 | .Y = 10 |
32 | .Y = 10 |
33 | .WIDTH = 640 |
33 | .WIDTH = 640 |
34 | .HEIGHT = DISPLAY_PROCESSES * BUTTON.HEIGHT |
34 | .HEIGHT = DISPLAY_PROCESSES * BUTTON.HEIGHT |
35 | UNDERTABLE: |
35 | UNDERTABLE: |
36 | .X = PROCESS_TABLE.X |
36 | .X = PROCESS_TABLE.X |
37 | .Y = PROCESS_TABLE.Y + PROCESS_TABLE.HEIGHT + 20 |
37 | .Y = PROCESS_TABLE.Y + PROCESS_TABLE.HEIGHT + 20 |
38 | BUTTON: |
38 | BUTTON: |
39 | .WIDTH = 120 |
39 | .WIDTH = 130 |
40 | .HEIGHT = 16 + 4 |
40 | .HEIGHT = 16 + 4 |
41 | EDITBOX: |
41 | EDITBOX: |
42 | .X = CHECKBOX.X + 100 |
42 | .X = CHECKBOX.X + 100 |
43 | .Y = UNDERTABLE.Y + BUTTON.HEIGHT + 20 |
43 | .Y = UNDERTABLE.Y + BUTTON.HEIGHT + 20 |
44 | .WIDTH = 465 |
44 | .WIDTH = 465 |
45 | .HEIGHT = 23 |
45 | .HEIGHT = 23 |
46 | 46 | ||
47 | CHECKBOX: |
47 | CHECKBOX: |
48 | .X = PROCESS_TABLE.X |
48 | .X = PROCESS_TABLE.X |
49 | .Y = UNDERTABLE.Y + BUTTON.HEIGHT + 25 |
49 | .Y = UNDERTABLE.Y + BUTTON.HEIGHT + 25 |
50 | ;------------------------------------------------------------------------------- |
50 | ;------------------------------------------------------------------------------- |
51 | @use_library ;use load lib macros |
51 | @use_library ;use load lib macros |
52 | ;------------------------------------------------------------------------------- |
52 | ;------------------------------------------------------------------------------- |
53 | struc utf8z string |
53 | struc utf8z string |
54 | { |
54 | { |
55 | . db string, 0 |
55 | . db string, 0 |
56 | .size = $ - . - 1 |
56 | .size = $ - . - 1 |
57 | } |
57 | } |
58 | 58 | ||
59 | ;------------------------------------------------------------------------------- |
59 | ;------------------------------------------------------------------------------- |
60 | START: ; start of execution |
60 | START: ; start of execution |
61 | mcall SF_SYS_MISC,SSF_HEAP_INIT |
61 | mcall SF_SYS_MISC,SSF_HEAP_INIT |
62 | sys_load_library library_name, library_path, system_path, myimport |
62 | sys_load_library library_name, library_path, system_path, myimport |
63 | inc eax |
63 | inc eax |
64 | jz close |
64 | jz close |
65 | ;------------------------------------------------------------------------------- |
65 | ;------------------------------------------------------------------------------- |
66 | mcall SF_SET_EVENTS_MASK,0x80000027 ;set event |
66 | mcall SF_SET_EVENTS_MASK,0x80000027 ;set event |
67 | ;------------------------------------------------------------------------------- |
67 | ;------------------------------------------------------------------------------- |
68 | ;set window size and position for 0 function |
68 | ;set window size and position for 0 function |
69 | ;to [winxpos] and [winypos] variables |
69 | ;to [winxpos] and [winypos] variables |
70 | ;get screen size |
70 | ;get screen size |
71 | mcall SF_GET_SCREEN_SIZE |
71 | mcall SF_GET_SCREEN_SIZE |
72 | mov ebx,eax |
72 | mov ebx,eax |
73 | ;calculate (x_screen-WINDOW.WIDTH)/2 |
73 | ;calculate (x_screen-WINDOW.WIDTH)/2 |
74 | shr ebx,16+1 |
74 | shr ebx,16+1 |
75 | sub ebx,WINDOW.WIDTH/2 |
75 | sub ebx,WINDOW.WIDTH/2 |
76 | shl ebx,16 |
76 | shl ebx,16 |
77 | mov bx,WINDOW.WIDTH |
77 | mov bx,WINDOW.WIDTH |
78 | ;winxpos=xcoord*65536+xsize |
78 | ;winxpos=xcoord*65536+xsize |
79 | mov [winxpos],ebx |
79 | mov [winxpos],ebx |
80 | ;calculate (y_screen-WINDOW.HEIGHT)/2 |
80 | ;calculate (y_screen-WINDOW.HEIGHT)/2 |
81 | and eax,0xffff |
81 | and eax,0xffff |
82 | shr eax,1 |
82 | shr eax,1 |
83 | sub eax,WINDOW.HEIGHT/2 |
83 | sub eax,WINDOW.HEIGHT/2 |
84 | shl eax,16 |
84 | shl eax,16 |
85 | mov ax,WINDOW.HEIGHT |
85 | mov ax,WINDOW.HEIGHT |
86 | ;winypos=ycoord*65536+ysize |
86 | ;winypos=ycoord*65536+ysize |
87 | mov [winypos],eax |
87 | mov [winypos],eax |
88 | ;------------------------------------------------------------------------------- |
88 | ;------------------------------------------------------------------------------- |
89 | init_checkboxes2 check1,check1_end |
89 | init_checkboxes2 check1,check1_end |
90 | mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,40 |
90 | mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,40 |
91 | edit_boxes_set_sys_color edit1,edit1_end,sc ;set color |
91 | edit_boxes_set_sys_color edit1,edit1_end,sc ;set color |
92 | ;check_boxes_set_sys_color2 check1,check1_end,sc ;set color |
92 | ;check_boxes_set_sys_color2 check1,check1_end,sc ;set color |
93 | ;------------------------------------------------------------------------------- |
93 | ;------------------------------------------------------------------------------- |
94 | align 4 |
94 | align 4 |
95 | ;main loop when process name isn"t edited. |
95 | ;main loop when process name isn"t edited. |
96 | red: |
96 | red: |
97 | call draw_window ; redraw all window |
97 | call draw_window ; redraw all window |
98 | mcall 71, 2, strings.window_caption, 3 ;set window caption |
98 | mcall 71, 2, strings.window_caption, 3 ;set window caption |
99 | ;------------------------------------------------------------------------------- |
99 | ;------------------------------------------------------------------------------- |
100 | align 4 |
100 | align 4 |
101 | still: |
101 | still: |
102 | mcall SF_WAIT_EVENT_TIMEOUT,100 ; wait here for event 1 sec. |
102 | mcall SF_WAIT_EVENT_TIMEOUT,100 ; wait here for event 1 sec. |
103 | 103 | ||
104 | test eax,eax |
104 | test eax,eax |
105 | jz still_end |
105 | jz still_end |
106 | 106 | ||
107 | dec eax ; redraw request ? |
107 | dec eax ; redraw request ? |
108 | jz red |
108 | jz red |
109 | 109 | ||
110 | dec eax ; key in buffer ? |
110 | dec eax ; key in buffer ? |
111 | jz key |
111 | jz key |
112 | 112 | ||
113 | dec eax ; button in buffer ? |
113 | dec eax ; button in buffer ? |
114 | jz button |
114 | jz button |
115 | 115 | ||
116 | push dword edit1 |
116 | push dword edit1 |
117 | call [edit_box_mouse] |
117 | call [edit_box_mouse] |
118 | 118 | ||
119 | push dword[check1.flags] |
119 | push dword[check1.flags] |
120 | 120 | ||
121 | push dword check1 |
121 | push dword check1 |
122 | call [check_box_mouse] |
122 | call [check_box_mouse] |
123 | 123 | ||
124 | pop eax |
124 | pop eax |
125 | 125 | ||
126 | cmp eax, dword[check1.flags] |
126 | cmp eax, dword[check1.flags] |
127 | jz still_end |
127 | jz still_end |
128 | 128 | ||
129 | push dword check1 |
129 | push dword check1 |
130 | call [check_box_draw] |
130 | call [check_box_draw] |
131 | ;------------------------------------------------------------------------------- |
131 | ;------------------------------------------------------------------------------- |
132 | align 4 |
132 | align 4 |
133 | show_process_info_1: |
133 | show_process_info_1: |
134 | mcall SF_SYSTEM_GET, SSF_TIME_COUNT |
134 | mcall SF_SYSTEM_GET, SSF_TIME_COUNT |
135 | add eax, 100 |
135 | add eax, 100 |
136 | mov [time_counter],eax |
136 | mov [time_counter],eax |
137 | 137 | ||
138 | call show_process_info ; draw new state of processes |
138 | call show_process_info ; draw new state of processes |
139 | jmp still |
139 | jmp still |
140 | ;------------------------------------------------------------------------------- |
140 | ;------------------------------------------------------------------------------- |
141 | align 4 |
141 | align 4 |
142 | still_end: |
142 | still_end: |
143 | mcall SF_SYSTEM_GET,SSF_TIME_COUNT |
143 | mcall SF_SYSTEM_GET,SSF_TIME_COUNT |
144 | cmp [time_counter],eax |
144 | cmp [time_counter],eax |
145 | ja still |
145 | ja still |
146 | 146 | ||
147 | add eax,100 |
147 | add eax,100 |
148 | mov [time_counter],eax |
148 | mov [time_counter],eax |
149 | 149 | ||
150 | call show_process_info ; draw new state of processes |
150 | call show_process_info ; draw new state of processes |
151 | jmp still |
151 | jmp still |
152 | ;------------------------------------------------------------------------------- |
152 | ;------------------------------------------------------------------------------- |
153 | align 4 |
153 | align 4 |
154 | key: ; key |
154 | key: ; key |
155 | mcall SF_GET_KEY |
155 | mcall SF_GET_KEY |
156 | 156 | ||
157 | cmp ah,184 ; PageUp |
157 | cmp ah,184 ; PageUp |
158 | jz pgdn |
158 | jz pgdn |
159 | 159 | ||
160 | cmp ah,183 |
160 | cmp ah,183 |
161 | jz pgup ; PageDown |
161 | jz pgup ; PageDown |
162 | 162 | ||
163 | cmp ah,27 |
163 | cmp ah,27 |
164 | jz close ; Esc |
164 | jz close ; Esc |
165 | 165 | ||
166 | push dword edit1 |
166 | push dword edit1 |
167 | call [edit_box_key] |
167 | call [edit_box_key] |
168 | ; Check ENTER with ed_focus edit_box |
168 | ; Check ENTER with ed_focus edit_box |
169 | lea edi,[edit1] |
169 | lea edi,[edit1] |
170 | test word ed_flags,ed_focus |
170 | test word ed_flags,ed_focus |
171 | jz still_end |
171 | jz still_end |
172 | 172 | ||
173 | sub ah,13 ; ENTER? |
173 | sub ah,13 ; ENTER? |
174 | jz program_start ; RUN a program |
174 | jz program_start ; RUN a program |
175 | 175 | ||
176 | jmp still |
176 | jmp still |
177 | ;------------------------------------------------------------------------------- |
177 | ;------------------------------------------------------------------------------- |
178 | align 4 |
178 | align 4 |
179 | button: |
179 | button: |
180 | ; get button id |
180 | ; get button id |
181 | mcall SF_GET_BUTTON |
181 | mcall SF_GET_BUTTON |
182 | mov bl, al ; save mouse button to bl |
182 | mov bl, al ; save mouse button to bl |
183 | shr eax,8 |
183 | shr eax,8 |
184 | ;id in [10,50] corresponds to terminate buttons. |
184 | ;id in [10,50] corresponds to terminate buttons. |
185 | cmp eax,10 |
185 | cmp eax,10 |
186 | jb noterm |
186 | jb noterm |
187 | 187 | ||
188 | cmp eax,50 |
188 | cmp eax,50 |
189 | jg noterm |
189 | jg noterm |
190 | ;calculate button index |
190 | ;calculate button index |
191 | sub eax,11 |
191 | sub eax,11 |
192 | ;calculate process slot |
192 | ;calculate process slot |
193 | mov ecx,[tasklist+4*eax] |
193 | mov ecx,[tasklist+4*eax] |
194 | ;ignore empty buttons |
194 | ;ignore empty buttons |
195 | test ecx,ecx |
195 | test ecx,ecx |
196 | jle still_end |
196 | jle still_end |
197 | test bl, bl ; check mouse button |
197 | test bl, bl ; check mouse button |
198 | jz .terminate |
198 | jz .terminate |
199 | mov eax, ecx |
199 | mov eax, ecx |
200 | mov edi, tinfo.params_buf |
200 | mov edi, tinfo.params_buf |
201 | ;; number in eax |
201 | ;; number in eax |
202 | ;; buffer in edi |
202 | ;; buffer in edi |
203 | ; int2str: |
203 | ; int2str: |
204 | push 0 |
204 | push 0 |
205 | mov ecx, 10 |
205 | mov ecx, 10 |
206 | .push: |
206 | .push: |
207 | xor edx, edx |
207 | xor edx, edx |
208 | div ecx |
208 | div ecx |
209 | add edx, 48 |
209 | add edx, 48 |
210 | push edx |
210 | push edx |
211 | test eax, eax |
211 | test eax, eax |
212 | jnz .push |
212 | jnz .push |
213 | .pop: |
213 | .pop: |
214 | pop eax |
214 | pop eax |
215 | stosb |
215 | stosb |
216 | test eax, eax |
216 | test eax, eax |
217 | jnz .pop |
217 | jnz .pop |
218 | ; launch tinfo app |
218 | ; launch tinfo app |
219 | mov ebx, tinfo |
219 | mov ebx, tinfo |
220 | mov eax, SF_FILE |
220 | mov eax, SF_FILE |
221 | int 64 |
221 | int 64 |
222 | jmp show_process_info_1 |
222 | jmp show_process_info_1 |
223 | .terminate: |
223 | .terminate: |
224 | ;terminate application |
224 | ;terminate application |
225 | mcall SF_SYSTEM,SSF_TERMINATE_THREAD |
225 | mcall SF_SYSTEM,SSF_TERMINATE_THREAD |
226 | jmp show_process_info_1 |
226 | jmp show_process_info_1 |
227 | ;------------------------------------------------------------------------------- |
227 | ;------------------------------------------------------------------------------- |
228 | align 4 |
228 | align 4 |
229 | noterm: |
229 | noterm: |
230 | ;special buttons |
230 | ;special buttons |
231 | dec eax |
231 | dec eax |
232 | jz close |
232 | jz close |
233 | 233 | ||
234 | sub eax,50 |
234 | sub eax,50 |
235 | jz pgdn ;51 |
235 | jz pgdn ;51 |
236 | 236 | ||
237 | dec eax |
237 | dec eax |
238 | jz pgup ;52 |
238 | jz pgup ;52 |
239 | 239 | ||
240 | dec eax |
240 | dec eax |
241 | jz reboot ;53 |
241 | jz reboot ;53 |
242 | 242 | ||
243 | dec eax |
243 | dec eax |
244 | jz program_start ;54 |
244 | jz program_start ;54 |
245 | 245 | ||
246 | jmp still_end |
246 | jmp still_end |
247 | ;buttons handlers |
247 | ;buttons handlers |
248 | ;------------------------------------------------------------------------------- |
248 | ;------------------------------------------------------------------------------- |
249 | align 4 |
249 | align 4 |
250 | pgdn: |
250 | pgdn: |
251 | sub [list_start],DISPLAY_PROCESSES |
251 | sub [list_start],DISPLAY_PROCESSES |
252 | jge show_process_info_1 |
252 | jge show_process_info_1 |
253 | mov [list_start],0 |
253 | mov [list_start],0 |
254 | jmp show_process_info_1 |
254 | jmp show_process_info_1 |
255 | ;------------------------------------------------------------------------------- |
255 | ;------------------------------------------------------------------------------- |
256 | align 4 |
256 | align 4 |
257 | pgup: |
257 | pgup: |
258 | mov eax,[list_add] ;maximal displayed process slot |
258 | mov eax,[list_add] ;maximal displayed process slot |
259 | mov [list_start],eax |
259 | mov [list_start],eax |
260 | jmp show_process_info_1 |
260 | jmp show_process_info_1 |
261 | ;------------------------------------------------------------------------------- |
261 | ;------------------------------------------------------------------------------- |
262 | align 4 |
262 | align 4 |
263 | program_start: |
263 | program_start: |
264 | mcall SF_FILE,file_start |
264 | mcall SF_FILE,file_start |
265 | jmp show_process_info_1 |
265 | jmp show_process_info_1 |
266 | ;------------------------------------------------------------------------------- |
266 | ;------------------------------------------------------------------------------- |
267 | align 4 |
267 | align 4 |
268 | reboot: |
268 | reboot: |
269 | mcall SF_FILE,sys_reboot |
269 | mcall SF_FILE,sys_reboot |
270 | ;close program if we going to reboot |
270 | ;close program if we going to reboot |
271 | ;------------------------------------------------------------------------------- |
271 | ;------------------------------------------------------------------------------- |
272 | align 4 |
272 | align 4 |
273 | close: |
273 | close: |
274 | or eax,SF_TERMINATE_PROCESS ; close this program |
274 | or eax,SF_TERMINATE_PROCESS ; close this program |
275 | mcall |
275 | mcall |
276 | ;------------------------------------------------------------------------------- |
276 | ;------------------------------------------------------------------------------- |
277 | align 4 |
277 | align 4 |
278 | draw_empty_slot: |
278 | draw_empty_slot: |
279 | cmp [draw_window_flag],1 |
279 | cmp [draw_window_flag],1 |
280 | je @f |
280 | je @f |
281 | mov ecx,[curposy] |
281 | mov ecx,[curposy] |
282 | shl ecx,16 |
282 | shl ecx,16 |
283 | mov cx, BUTTON.HEIGHT |
283 | mov cx, BUTTON.HEIGHT |
284 | mcall SF_DRAW_RECT, <132, PROCESS_TABLE.WIDTH-131>, , [bar_bacground_color] |
284 | mcall SF_DRAW_RECT, <141, PROCESS_TABLE.WIDTH-141>, , [bar_bacground_color] |
285 | @@: |
285 | @@: |
286 | ret |
286 | ret |
287 | ;------------------------------------------------------------------------------- |
287 | ;------------------------------------------------------------------------------- |
288 | align 4 |
288 | align 4 |
289 | draw_next_process: |
289 | draw_next_process: |
290 | ;input: |
290 | ;input: |
291 | ; edi - current slot |
291 | ; edi - current slot |
292 | ; [curposy] - y position |
292 | ; [curposy] - y position |
293 | ;output: |
293 | ;output: |
294 | ; edi - next slot (or -1 if no next slot) |
294 | ; edi - next slot (or -1 if no next slot) |
295 | ;registers corrupted! |
295 | ;registers corrupted! |
296 | 296 | ||
297 | ;putting 2 pixels to make the list of buttons visually solid |
297 | ;putting 2 pixels to make the list of buttons visually solid |
298 | mov ecx,[curposy] |
298 | mov ecx,[curposy] |
299 | mcall SF_PUT_PIXEL, PROCESS_TABLE.X, , 0x586468 |
299 | mcall SF_PUT_PIXEL, PROCESS_TABLE.X, , 0x586468 |
300 | add ebx, BUTTON.WIDTH |
300 | add ebx, BUTTON.WIDTH |
301 | mcall |
301 | mcall |
302 | 302 | ||
303 | ;create terminate process button |
303 | ;create terminate process button |
304 | ;mov ecx,[curposy] |
304 | ;mov ecx,[curposy] |
305 | shl ecx,16 |
305 | shl ecx,16 |
306 | mov cx, BUTTON.HEIGHT |
306 | mov cx, BUTTON.HEIGHT |
307 | mov edx,[index] |
307 | mov edx,[index] |
308 | add edx,11 |
308 | add edx,11 |
309 | mov esi,0xaabbcc |
309 | mov esi,0xaabbcc |
310 | test dword [index],1 |
310 | test dword [index],1 |
311 | jz @f |
311 | jz @f |
312 | mov esi,0xccddee |
312 | mov esi,0xccddee |
313 | @@: |
313 | @@: |
314 | add edx,0x80000000 ; delete a button |
314 | add edx,0x80000000 ; delete a button |
315 | mcall SF_DEFINE_BUTTON ; before create |
315 | mcall SF_DEFINE_BUTTON ; before create |
316 | sub edx,0x80000000 ; a new one below |
316 | sub edx,0x80000000 ; a new one below |
317 | mcall SF_DEFINE_BUTTON, |
317 | mcall SF_DEFINE_BUTTON, |
318 | mov [btn_bacground_color],esi |
318 | mov [btn_bacground_color],esi |
319 | ;draw background for proccess information |
319 | ;draw background for proccess information |
320 | mov edx,0xDDDddf |
320 | mov edx,0xDDDddf |
321 | test dword [index],1 |
321 | test dword [index],1 |
322 | jz @f |
322 | jz @f |
323 | mov edx,0xFFFfff |
323 | mov edx,0xFFFfff |
324 | @@: |
324 | @@: |
325 | ;inc cx |
325 | ;inc cx |
326 | 326 | ||
327 | mcall SF_DRAW_RECT, <131, PROCESS_TABLE.WIDTH-131> |
327 | mcall SF_DRAW_RECT, <141, PROCESS_TABLE.WIDTH-141> |
328 | 328 | ||
329 | mov [bar_bacground_color],edx |
329 | mov [bar_bacground_color],edx |
330 | ;nothing else should be done if there is no process for this button |
330 | ;nothing else should be done if there is no process for this button |
331 | cmp edi,-1 |
331 | cmp edi,-1 |
332 | jne .return_1 |
332 | jne .return_1 |
333 | 333 | ||
334 | call draw_empty_slot |
334 | call draw_empty_slot |
335 | or edi,-1 |
335 | or edi,-1 |
336 | jmp .ret |
336 | jmp .ret |
337 | ;------------------------------------------------------------------------------- |
337 | ;------------------------------------------------------------------------------- |
338 | align 4 |
338 | align 4 |
339 | .return_1: |
339 | .return_1: |
340 | ;find process |
340 | ;find process |
341 | inc edi |
341 | inc edi |
342 | ;more comfortable register for next loop |
342 | ;more comfortable register for next loop |
343 | mov ecx,edi |
343 | mov ecx,edi |
344 | ;precacluate pointer to process buffer |
344 | ;precacluate pointer to process buffer |
345 | mov ebx,process_info_buffer |
345 | mov ebx,process_info_buffer |
346 | ;------------------------------------------------------------------------------- |
346 | ;------------------------------------------------------------------------------- |
347 | align 4 |
347 | align 4 |
348 | .find_loop: |
348 | .find_loop: |
349 | cmp ecx,256 |
349 | cmp ecx,256 |
350 | jge .no_processes |
350 | jge .no_processes |
351 | ;load process information in buffer |
351 | ;load process information in buffer |
352 | mcall SF_THREAD_INFO |
352 | mcall SF_THREAD_INFO |
353 | ;if current slot greater than maximal slot, |
353 | ;if current slot greater than maximal slot, |
354 | ;there is no more proccesses. |
354 | ;there is no more proccesses. |
355 | cmp ecx,eax |
355 | cmp ecx,eax |
356 | jg .no_processes |
356 | jg .no_processes |
357 | ;if slot state is equal to 9, it is empty. |
357 | ;if slot state is equal to 9, it is empty. |
358 | cmp [process_info_buffer+process_information.slot_state],9 |
358 | cmp [process_info_buffer+process_information.slot_state],9 |
359 | jnz .process_found |
359 | jnz .process_found |
360 | 360 | ||
361 | inc ecx |
361 | inc ecx |
362 | jmp .find_loop |
362 | jmp .find_loop |
363 | ;------------------------------------------------------------------------------- |
363 | ;------------------------------------------------------------------------------- |
364 | align 4 |
364 | align 4 |
365 | .no_processes: |
365 | .no_processes: |
366 | call draw_empty_slot |
366 | call draw_empty_slot |
367 | or edi,-1 |
367 | or edi,-1 |
368 | ret |
368 | ret |
369 | ;------------------------------------------------------------------------------- |
369 | ;------------------------------------------------------------------------------- |
370 | align 4 |
370 | align 4 |
371 | .process_found: |
371 | .process_found: |
372 | ;check on/off check box |
372 | ;check on/off check box |
373 | test dword [check1.flags], ch_flag_en |
373 | test dword [check1.flags], ch_flag_en |
374 | jnz .no_filter |
374 | jnz .no_filter |
375 | 375 | ||
376 | cmp dword [process_info_buffer+10],"ICON" |
376 | cmp dword [process_info_buffer+10],"ICON" |
377 | jnz @f |
377 | jnz @f |
378 | cmp dword [process_info_buffer+10+4],0 |
378 | cmp dword [process_info_buffer+10+4],0 |
379 | jz .return_1 |
379 | jz .return_1 |
380 | @@: |
380 | @@: |
381 | cmp dword [process_info_buffer+10],"IDLE" |
381 | cmp dword [process_info_buffer+10],"IDLE" |
382 | jnz @f |
382 | jnz @f |
383 | cmp dword [process_info_buffer+10+4],0 |
383 | cmp dword [process_info_buffer+10+4],0 |
384 | jz .return_1 |
384 | jz .return_1 |
385 | @@: |
385 | @@: |
386 | cmp word [process_info_buffer+10],"OS" |
386 | cmp word [process_info_buffer+10],"OS" |
387 | jnz @f |
387 | jnz @f |
388 | cmp dword [process_info_buffer+10+2],0 |
388 | cmp dword [process_info_buffer+10+2],0 |
389 | jz .return_1 |
389 | jz .return_1 |
390 | @@: |
390 | @@: |
391 | cmp byte [process_info_buffer+10],"@" |
391 | cmp byte [process_info_buffer+10],"@" |
392 | jz .return_1 |
392 | jz .return_1 |
393 | ;------------------------------------------------------------------------------- |
393 | ;------------------------------------------------------------------------------- |
394 | align 4 |
394 | align 4 |
395 | .no_filter: |
395 | .no_filter: |
396 | mov edi,ecx |
396 | mov edi,ecx |
397 | mov [list_add],ecx |
397 | mov [list_add],ecx |
398 | ;get processor cpeed |
398 | ;get processor cpeed |
399 | ;for percent calculating |
399 | ;for percent calculating |
400 | mcall SF_SYSTEM,SSF_GET_CPU_FREQUENCY |
400 | mcall SF_SYSTEM,SSF_GET_CPU_FREQUENCY |
401 | xor edx,edx |
401 | xor edx,edx |
402 | mov ebx,100 |
402 | mov ebx,100 |
403 | div ebx |
403 | div ebx |
404 | ;eax = number of operation for 1% now |
404 | ;eax = number of operation for 1% now |
405 | ;calculate process cpu usage percent |
405 | ;calculate process cpu usage percent |
406 | mov ebx,eax |
406 | mov ebx,eax |
407 | mov eax,[process_info_buffer+process_information.cpu_usage] |
407 | mov eax,[process_info_buffer+process_information.cpu_usage] |
408 | ; cdq |
408 | ; cdq |
409 | xor edx,edx ; for CPU more 2 GHz - mike.dld |
409 | xor edx,edx ; for CPU more 2 GHz - mike.dld |
410 | div ebx |
410 | div ebx |
411 | mov [cpu_percent],eax |
411 | mov [cpu_percent],eax |
412 | ;set text color to display process information |
412 | ;set text color to display process information |
413 | ;0% : black |
413 | ;0% : black |
414 | ;1-80% : green |
414 | ;1-80% : green |
415 | ;81-100% : red |
415 | ;81-100% : red |
416 | test eax,eax |
416 | test eax,eax |
417 | jnz .no_black |
417 | jnz .no_black |
418 | 418 | ||
419 | mov esi, 0x10000000 |
419 | mov esi, 0x10000000 |
420 | jmp .color_set |
420 | jmp .color_set |
421 | ;------------------------------------------------------------------------------- |
421 | ;------------------------------------------------------------------------------- |
422 | align 4 |
422 | align 4 |
423 | .no_black: |
423 | .no_black: |
424 | cmp eax,80 |
424 | cmp eax,80 |
425 | ja .no_green |
425 | ja .no_green |
426 | 426 | ||
427 | mov esi, 0x10107A30 |
427 | mov esi, 0x10107A30 |
428 | jmp .color_set |
428 | jmp .color_set |
429 | ;------------------------------------------------------------------------------- |
429 | ;------------------------------------------------------------------------------- |
430 | align 4 |
430 | align 4 |
431 | .no_green: |
431 | .no_green: |
432 | mov esi,0x10AC0000 |
432 | mov esi,0x10AC0000 |
433 | ;------------------------------------------------------------------------------- |
433 | ;------------------------------------------------------------------------------- |
434 | align 4 |
434 | align 4 |
435 | .color_set: |
435 | .color_set: |
436 | ;show slot number |
436 | ;show slot number |
437 | ;ecx haven"t changed since .process_found |
437 | ;ecx haven"t changed since .process_found |
438 | push edi |
438 | push edi |
439 | mov eax, ecx |
439 | mov eax, ecx |
440 | mov ebx, [curposy] |
440 | mov ebx, [curposy] |
441 | add ebx, 40 shl 16 + 3 |
441 | add ebx, 40 shl 16 + 3 |
442 | mov ecx, esi |
442 | mov ecx, esi |
443 | xor edx, edx |
443 | xor edx, edx |
444 | call draw_ra_dec_number |
444 | call draw_ra_dec_number |
445 | push ecx |
445 | push ecx |
446 | ;show process name |
446 | ;show process name |
447 | mov ebx,[curposy] |
447 | mov ebx,[curposy] |
448 | add ebx,50*65536+3 |
448 | add ebx,50*65536+3 |
449 | mov ecx, esi |
449 | mov ecx, esi |
450 | or ecx, 0x80000000 |
450 | or ecx, 0x80000000 |
451 | mcall SF_DRAW_TEXT,,,process_info_buffer.process_name,11 |
451 | mcall SF_DRAW_TEXT,,,process_info_buffer.process_name,11 |
452 | pop ecx |
452 | pop ecx |
453 | ;show PTID |
453 | ;show PTID |
454 | mov eax, [process_info_buffer.PID] |
454 | mov eax, [process_info_buffer.PID] |
455 | add ebx, 160 shl 16 |
455 | add ebx, 160 shl 16 |
456 | xor edx, edx |
456 | xor edx, edx |
457 | call draw_ra_dec_number |
457 | call draw_ra_dec_number |
458 | ;show cpu usage |
458 | ;show cpu usage |
459 | mov eax, [process_info_buffer.cpu_usage] |
459 | mov eax, [process_info_buffer.cpu_usage] |
460 | add ebx, 100 shl 16 |
460 | add ebx, 100 shl 16 |
461 | call draw_ra_dec_number |
461 | call draw_ra_dec_number |
462 | ;show cpu percent |
462 | ;show cpu percent |
463 | mov eax, [cpu_percent] |
463 | mov eax, [cpu_percent] |
464 | add ebx, 55 shl 16 |
464 | add ebx, 55 shl 16 |
465 | call draw_ra_dec_number |
465 | call draw_ra_dec_number |
466 | ;show memory usage |
466 | ;show memory usage |
467 | mov eax, [process_info_buffer.used_memory] |
467 | mov eax, [process_info_buffer.used_memory] |
468 | add ebx, 60 shl 16 |
468 | add ebx, 60 shl 16 |
469 | call draw_ra_data_size |
469 | call draw_ra_data_size |
470 | ;show window stack position |
470 | ;show window stack position |
471 | movzx eax, word [process_info_buffer.window_stack_position] |
471 | movzx eax, word [process_info_buffer.window_stack_position] |
472 | add ebx, 70 shl 16 |
472 | add ebx, 70 shl 16 |
473 | call draw_ra_dec_number |
473 | call draw_ra_dec_number |
474 | ;show window x size |
474 | ;show window x size |
475 | movzx eax, word [process_info_buffer.box.left] |
475 | movzx eax, word [process_info_buffer.box.left] |
476 | add ebx, 70 shl 16 |
476 | add ebx, 70 shl 16 |
477 | call draw_ra_dec_number |
477 | call draw_ra_dec_number |
478 | ;show window y size |
478 | ;show window y size |
479 | movzx eax, word [process_info_buffer.box.top] |
479 | movzx eax, word [process_info_buffer.box.top] |
480 | add ebx, 70 shl 16 |
480 | add ebx, 70 shl 16 |
481 | call draw_ra_dec_number |
481 | call draw_ra_dec_number |
482 | pop edi |
482 | pop edi |
483 | ;------------------------------------------------------------------------------- |
483 | ;------------------------------------------------------------------------------- |
484 | align 4 |
484 | align 4 |
485 | .ret: |
485 | .ret: |
486 | ;build index->slot map for terminating processes. |
486 | ;build index->slot map for terminating processes. |
487 | mov eax,[index] |
487 | mov eax,[index] |
488 | mov [tasklist+4*eax],edi |
488 | mov [tasklist+4*eax],edi |
489 | ret |
489 | ret |
490 | ;------------------------------------------------------------------------------- |
490 | ;------------------------------------------------------------------------------- |
491 | align 4 |
491 | align 4 |
492 | f11: |
492 | f11: |
493 | ;full update |
493 | ;full update |
494 | push edi |
494 | push edi |
495 | call draw_window |
495 | call draw_window |
496 | pop edi |
496 | pop edi |
497 | ;------------------------------------------------------------------------------- |
497 | ;------------------------------------------------------------------------------- |
498 | ; ********************************************* |
498 | ; ********************************************* |
499 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
499 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
500 | ; ********************************************* |
500 | ; ********************************************* |
501 | align 4 |
501 | align 4 |
502 | draw_window: |
502 | draw_window: |
503 | mcall SF_REDRAW, SSF_BEGIN_DRAW |
503 | mcall SF_REDRAW, SSF_BEGIN_DRAW |
504 | ; DRAW WINDOW |
504 | ; DRAW WINDOW |
505 | xor eax,eax ; function 0 : define and draw window |
505 | xor eax,eax ; function 0 : define and draw window |
506 | xor esi,esi |
506 | xor esi,esi |
507 | mcall ,[winxpos],[winypos], 0x24FFFFFF |
507 | mcall ,[winxpos],[winypos], 0x24FFFFFF |
508 | 508 | ||
509 | mcall SF_THREAD_INFO,process_info_buffer,-1 |
509 | mcall SF_THREAD_INFO,process_info_buffer,-1 |
510 | 510 | ||
511 | mov eax,[ebx+70] |
511 | mov eax,[ebx+70] |
512 | mov [window_status],eax |
512 | mov [window_status],eax |
513 | test [window_status],100b ; window is rolled up |
513 | test [window_status],100b ; window is rolled up |
514 | jnz .exit |
514 | jnz .exit |
515 | 515 | ||
516 | test [window_status],10b ; window is minimized to panel |
516 | test [window_status],10b ; window is minimized to panel |
517 | jnz .exit |
517 | jnz .exit |
518 | 518 | ||
519 | mov eax, strings.process_name |
519 | mov eax, strings.process_name |
520 | mov ebx, 130 shl 16 + 5 |
520 | mov ebx, 130 shl 16 + 5 |
521 | xor ecx, ecx |
521 | xor ecx, ecx |
522 | call draw_ra_text |
522 | call draw_ra_text |
523 | 523 | ||
524 | mov eax, strings.ptid |
524 | mov eax, strings.ptid |
525 | add ebx, 80 shl 16 |
525 | add ebx, 80 shl 16 |
526 | call draw_ra_text |
526 | call draw_ra_text |
527 | 527 | ||
528 | mov eax, strings.cpu_usage_cycles |
528 | mov eax, strings.cpu_usage_cycles |
529 | add ebx, 100 shl 16 |
529 | add ebx, 100 shl 16 |
530 | call draw_ra_text |
530 | call draw_ra_text |
531 | 531 | ||
532 | mov eax, strings.cpu_usage_percent |
532 | mov eax, strings.cpu_usage_percent |
533 | add ebx, 55 shl 16 |
533 | add ebx, 55 shl 16 |
534 | call draw_ra_text |
534 | call draw_ra_text |
535 | 535 | ||
536 | mov eax, strings.memory_usage |
536 | mov eax, strings.memory_usage |
537 | add ebx, 60 shl 16 |
537 | add ebx, 60 shl 16 |
538 | call draw_ra_text |
538 | call draw_ra_text |
539 | 539 | ||
540 | mov eax, strings.window_stack_pos |
540 | mov eax, strings.window_stack_pos |
541 | add ebx, 70 shl 16 |
541 | add ebx, 70 shl 16 |
542 | call draw_ra_text |
542 | call draw_ra_text |
543 | 543 | ||
544 | mov eax, strings.window_position.x |
544 | mov eax, strings.window_position.x |
545 | add ebx, 70 shl 16 |
545 | add ebx, 70 shl 16 |
546 | call draw_ra_text |
546 | call draw_ra_text |
547 | 547 | ||
548 | mov eax, strings.window_position.y |
548 | mov eax, strings.window_position.y |
549 | add ebx, 70 shl 16 |
549 | add ebx, 70 shl 16 |
550 | call draw_ra_text |
550 | call draw_ra_text |
551 | 551 | ||
552 | mcall SF_SYSTEM_GET,SSF_TIME_COUNT |
552 | mcall SF_SYSTEM_GET,SSF_TIME_COUNT |
553 | add eax,100 |
553 | add eax,100 |
554 | mov [time_counter],eax |
554 | mov [time_counter],eax |
555 | 555 | ||
556 | mov [draw_window_flag],1 |
556 | mov [draw_window_flag],1 |
557 | call show_process_info |
557 | call show_process_info |
558 | mov [draw_window_flag],0 |
558 | mov [draw_window_flag],0 |
559 | 559 | ||
560 | push dword edit1 |
560 | push dword edit1 |
561 | call [edit_box_draw] |
561 | call [edit_box_draw] |
562 | 562 | ||
563 | push dword check1 |
563 | push dword check1 |
564 | call [check_box_draw] |
564 | call [check_box_draw] |
565 | 565 | ||
566 | ;previous page button, ID = 51: |
566 | ;previous page button, ID = 51: |
567 | mov eax, strings.previous_page |
567 | mov eax, strings.previous_page |
568 | mov ebx, UNDERTABLE.X shl 16 + UNDERTABLE.Y |
568 | mov ebx, UNDERTABLE.X shl 16 + UNDERTABLE.Y |
569 | mov ecx, 51 |
569 | mov ecx, 51 |
570 | mov edx, 0xCCDDEE |
570 | mov edx, 0xCCDDEE |
571 | xor esi, esi |
571 | xor esi, esi |
572 | call draw_button_with_caption |
572 | call draw_button_with_caption |
573 | ;next page button, ID = 52: |
573 | ;next page button, ID = 52: |
574 | mov eax, strings.next_page |
574 | mov eax, strings.next_page |
575 | add ebx, 10 shl 16 |
575 | add ebx, 10 shl 16 |
576 | inc ecx |
576 | inc ecx |
577 | call draw_button_with_caption |
577 | call draw_button_with_caption |
578 | ;reboot button, ID = 53: |
578 | ;reboot button, ID = 53: |
579 | mov eax, strings.reboot |
579 | mov eax, strings.reboot |
580 | add ebx, 345 shl 16 |
580 | add ebx, 345 shl 16 |
581 | inc ecx |
581 | inc ecx |
582 | call draw_button_with_caption |
582 | call draw_button_with_caption |
583 | ;run button, ID = 54 |
583 | ;run button, ID = 54 |
584 | mov eax, strings.run |
584 | mov eax, strings.run |
585 | mov ebx, (EDITBOX.X + EDITBOX.WIDTH + 10) shl 16 + (EDITBOX.Y + EDITBOX.HEIGHT/2 - BUTTON.HEIGHT/2) |
585 | mov ebx, (EDITBOX.X + EDITBOX.WIDTH + 10) shl 16 + (EDITBOX.Y + EDITBOX.HEIGHT/2 - BUTTON.HEIGHT/2) |
586 | inc ecx |
586 | inc ecx |
587 | call draw_button_with_caption |
587 | call draw_button_with_caption |
588 | ;------------------------------------------------------------------------------- |
588 | ;------------------------------------------------------------------------------- |
589 | align 4 |
589 | align 4 |
590 | .exit: |
590 | .exit: |
591 | mcall SF_REDRAW, SSF_END_DRAW |
591 | mcall SF_REDRAW, SSF_END_DRAW |
592 | ret |
592 | ret |
593 | ;------------------------------------------------------------------------------- |
593 | ;------------------------------------------------------------------------------- |
594 | align 4 |
594 | align 4 |
595 | show_process_info: |
595 | show_process_info: |
596 | test [window_status], 100b ; window is rolled up |
596 | test [window_status], 100b ; window is rolled up |
597 | jnz .exit |
597 | jnz .exit |
598 | 598 | ||
599 | test [window_status], 10b ; window is minimized to panel |
599 | test [window_status], 10b ; window is minimized to panel |
600 | jnz .exit |
600 | jnz .exit |
601 | 601 | ||
602 | mov ecx,DISPLAY_PROCESSES |
602 | mov ecx,DISPLAY_PROCESSES |
603 | mov edi,tasklist |
603 | mov edi,tasklist |
604 | xor eax,eax |
604 | xor eax,eax |
605 | cld |
605 | cld |
606 | rep stosd |
606 | rep stosd |
607 | 607 | ||
608 | mov edi,[list_start] |
608 | mov edi,[list_start] |
609 | mov [list_add],edi |
609 | mov [list_add],edi |
610 | mov dword [index],0 |
610 | mov dword [index],0 |
611 | mov dword [curposy],20 |
611 | mov dword [curposy],20 |
612 | ;------------------------------------------------------------------------------- |
612 | ;------------------------------------------------------------------------------- |
613 | align 4 |
613 | align 4 |
614 | .loop_draw: |
614 | .loop_draw: |
615 | call draw_next_process |
615 | call draw_next_process |
616 | inc dword [index] |
616 | inc dword [index] |
617 | add dword [curposy],16+4 |
617 | add dword [curposy],16+4 |
618 | cmp [index],DISPLAY_PROCESSES |
618 | cmp [index],DISPLAY_PROCESSES |
619 | jl .loop_draw |
619 | jl .loop_draw |
620 | ;------------------------------------------------------------------------------- |
620 | ;------------------------------------------------------------------------------- |
621 | align 4 |
621 | align 4 |
622 | .exit: |
622 | .exit: |
623 | ret |
623 | ret |
624 | 624 | ||
625 | ;------------------------------------------------------------------------------- |
625 | ;------------------------------------------------------------------------------- |
626 | 626 | ||
627 | draw_ra_dec_number: |
627 | draw_ra_dec_number: |
628 | ;------------------------------------------------------------------------------- |
628 | ;------------------------------------------------------------------------------- |
629 | ;draws (posfixed) number with flush right alignment in decimal form |
629 | ;draws (posfixed) number with flush right alignment in decimal form |
630 | ;8x16 number + 8x16 UTF8Z text |
630 | ;8x16 number + 8x16 UTF8Z text |
631 | ;in: |
631 | ;in: |
632 | ;eax = number |
632 | ;eax = number |
633 | ;ebx = right margin coordinates (x shl 16 + y) |
633 | ;ebx = right margin coordinates (x shl 16 + y) |
634 | ;ecx = 0x00RRGGBB |
634 | ;ecx = 0x00RRGGBB |
635 | ;edx = pointer to postfix string or 0 - no postfix |
635 | ;edx = pointer to postfix string or 0 - no postfix |
636 | ;------------------------------------------------------------------------------- |
636 | ;------------------------------------------------------------------------------- |
637 | pusha |
637 | pusha |
638 | 638 | ||
639 | ror ebx, 16 |
639 | ror ebx, 16 |
640 | mov ebp, eax |
640 | mov ebp, eax |
641 | 641 | ||
642 | test edx, edx |
642 | test edx, edx |
643 | jz .no_postfix |
643 | jz .no_postfix |
644 | 644 | ||
645 | mov eax, edx |
645 | mov eax, edx |
646 | call count_utf8z_chars |
646 | call count_utf8z_chars |
647 | 647 | ||
648 | test eax, eax |
648 | test eax, eax |
649 | jz .no_postfix |
649 | jz .no_postfix |
650 | push ecx |
650 | push ecx |
651 | lea eax, [eax*8] |
651 | lea eax, [eax*8] |
652 | sub bx, ax |
652 | sub bx, ax |
653 | rol ebx, 16 |
653 | rol ebx, 16 |
654 | or ecx, 0xB0000000 |
654 | or ecx, 0xB0000000 |
655 | mcall SF_DRAW_TEXT |
655 | mcall SF_DRAW_TEXT |
656 | ror ebx, 16 |
656 | ror ebx, 16 |
657 | pop ecx |
657 | pop ecx |
658 | 658 | ||
659 | .no_postfix: |
659 | .no_postfix: |
660 | mov eax, ebp |
660 | mov eax, ebp |
661 | push edx |
661 | push edx |
662 | 662 | ||
663 | xor edi, edi |
663 | xor edi, edi |
664 | 664 | ||
665 | mov esi, 10 |
665 | mov esi, 10 |
666 | @@: |
666 | @@: |
667 | xor edx, edx |
667 | xor edx, edx |
668 | div esi |
668 | div esi |
669 | inc edi |
669 | inc edi |
670 | test eax, eax |
670 | test eax, eax |
671 | jz @f |
671 | jz @f |
672 | jmp @b |
672 | jmp @b |
673 | 673 | ||
674 | @@: |
674 | @@: |
675 | pop edx |
675 | pop edx |
676 | mov esi, ecx |
676 | mov esi, ecx |
677 | or esi, 0x10000000 |
677 | or esi, 0x10000000 |
678 | mov ecx, ebp |
678 | mov ecx, ebp |
679 | mov edx, ebx |
679 | mov edx, ebx |
680 | lea eax, [edi*8] |
680 | lea eax, [edi*8] |
681 | sub dx, ax |
681 | sub dx, ax |
682 | rol edx, 16 |
682 | rol edx, 16 |
683 | mcall SF_DRAW_NUMBER, (11 shl 16) or 0x80000000 |
683 | mcall SF_DRAW_NUMBER, (11 shl 16) or 0x80000000 |
684 | 684 | ||
685 | popa |
685 | popa |
686 | ret |
686 | ret |
687 | ;------------------------------------------------------------------------------- |
687 | ;------------------------------------------------------------------------------- |
688 | 688 | ||
689 | draw_ra_data_size: |
689 | draw_ra_data_size: |
690 | ;------------------------------------------------------------------------------- |
690 | ;------------------------------------------------------------------------------- |
691 | ;draws data size with flush right alignment in following form: |
691 | ;draws data size with flush right alignment in following form: |
692 | ;n (for <1024 bytes) or n xB (KB/MB/GB) |
692 | ;n (for <1024 bytes) or n xB (KB/MB/GB) |
693 | ;8x16 font |
693 | ;8x16 font |
694 | ;in: |
694 | ;in: |
695 | ;eax = number |
695 | ;eax = number |
696 | ;ebx = right margin coordinates (x shl 16 + y) |
696 | ;ebx = right margin coordinates (x shl 16 + y) |
697 | ;ecx = 0x00RRGGBB |
697 | ;ecx = 0x00RRGGBB |
698 | ;------------------------------------------------------------------------------- |
698 | ;------------------------------------------------------------------------------- |
699 | pusha |
699 | pusha |
700 | 700 | ||
701 | xor edx, edx |
701 | xor edx, edx |
702 | cmp eax, 1024 |
702 | cmp eax, 1024 |
703 | ja @f |
703 | ja @f |
704 | jmp .draw_text |
704 | jmp .draw_text |
705 | 705 | ||
706 | @@: |
706 | @@: |
707 | cmp eax, 1024*1024 |
707 | cmp eax, 1024*1024 |
708 | jae @f |
708 | jae @f |
709 | mov esi, 1024 |
709 | mov esi, 1024 |
710 | div esi |
710 | div esi |
711 | mov edx, strings.KB |
711 | mov edx, strings.KB |
712 | jmp .draw_text |
712 | jmp .draw_text |
713 | 713 | ||
714 | @@: |
714 | @@: |
715 | cmp eax, 1024*1024*1024 |
715 | cmp eax, 1024*1024*1024 |
716 | jae @f |
716 | jae @f |
717 | mov esi, 1024*1024 |
717 | mov esi, 1024*1024 |
718 | div esi |
718 | div esi |
719 | mov edx, strings.MB |
719 | mov edx, strings.MB |
720 | jmp .draw_text |
720 | jmp .draw_text |
721 | 721 | ||
722 | @@: |
722 | @@: |
723 | mov esi, 1024*1024*1024 |
723 | mov esi, 1024*1024*1024 |
724 | div esi |
724 | div esi |
725 | mov edx, strings.GB |
725 | mov edx, strings.GB |
726 | 726 | ||
727 | .draw_text: |
727 | .draw_text: |
728 | call draw_ra_dec_number |
728 | call draw_ra_dec_number |
729 | 729 | ||
730 | popa |
730 | popa |
731 | ret |
731 | ret |
732 | ;------------------------------------------------------------------------------- |
732 | ;------------------------------------------------------------------------------- |
733 | 733 | ||
734 | draw_ra_text: |
734 | draw_ra_text: |
735 | ;------------------------------------------------------------------------------- |
735 | ;------------------------------------------------------------------------------- |
736 | ;draws 8x16 UTF8Z text with flush right alignment in decimal form |
736 | ;draws 8x16 UTF8Z text with flush right alignment in decimal form |
737 | ;in: |
737 | ;in: |
738 | ;eax = pointer to text string |
738 | ;eax = pointer to text string |
739 | ;ebx = right margin coordinates (x shl 16 + y) |
739 | ;ebx = right margin coordinates (x shl 16 + y) |
740 | ;ecx = 0x00RRGGBB |
740 | ;ecx = 0x00RRGGBB |
741 | ;------------------------------------------------------------------------------- |
741 | ;------------------------------------------------------------------------------- |
742 | pusha |
742 | pusha |
743 | 743 | ||
744 | ror ebx, 16 |
744 | ror ebx, 16 |
745 | mov edx, eax |
745 | mov edx, eax |
746 | 746 | ||
747 | call count_utf8z_chars |
747 | call count_utf8z_chars |
748 | 748 | ||
749 | test eax, eax |
749 | test eax, eax |
750 | jz .ret |
750 | jz .ret |
751 | lea eax, [eax*8] |
751 | lea eax, [eax*8] |
752 | sub bx, ax |
752 | sub bx, ax |
753 | rol ebx, 16 |
753 | rol ebx, 16 |
754 | or ecx, 0xB0000000 |
754 | or ecx, 0xB0000000 |
755 | mcall SF_DRAW_TEXT |
755 | mcall SF_DRAW_TEXT |
756 | 756 | ||
757 | .ret: |
757 | .ret: |
758 | popa |
758 | popa |
759 | ret |
759 | ret |
760 | ;------------------------------------------------------------------------------- |
760 | ;------------------------------------------------------------------------------- |
761 | 761 | ||
762 | draw_button_with_caption: |
762 | draw_button_with_caption: |
763 | ;------------------------------------------------------------------------------- |
763 | ;------------------------------------------------------------------------------- |
764 | ;draws button with 8x16 UTF8Z caption in center |
764 | ;draws button with 8x16 UTF8Z caption in center |
765 | ;in: |
765 | ;in: |
766 | ;eax = pointer to button caption or 0 - no caption |
766 | ;eax = pointer to button caption or 0 - no caption |
767 | ;ebx = x shl 16 + y |
767 | ;ebx = x shl 16 + y |
768 | ;ecx = 0x00XXXXXX, where XXXXXX - button ID |
768 | ;ecx = 0x00XXXXXX, where XXXXXX - button ID |
769 | ;edx = 0x00RRGGBB - button color |
769 | ;edx = 0x00RRGGBB - button color |
770 | ;esi = 0x00RRGGBB - text color |
770 | ;esi = 0x00RRGGBB - text color |
771 | ;out: |
771 | ;out: |
772 | ;eax = width of button |
772 | ;eax = width of button |
773 | ;ebx = x+width shl 16 + y |
773 | ;ebx = x+width shl 16 + y |
774 | ;------------------------------------------------------------------------------- |
774 | ;------------------------------------------------------------------------------- |
775 | pusha |
775 | pusha |
776 | 776 | ||
777 | xor ebp, ebp |
777 | xor ebp, ebp |
778 | mov edi, eax |
778 | mov edi, eax |
779 | test eax, eax |
779 | test eax, eax |
780 | jz .no_caption_0 |
780 | jz .no_caption_0 |
781 | 781 | ||
782 | call count_utf8z_chars |
782 | call count_utf8z_chars |
783 | mov ebp, eax |
783 | mov ebp, eax |
784 | 784 | ||
785 | .no_caption_0: |
785 | .no_caption_0: |
786 | push ebx esi |
786 | push ebx esi |
787 | lea eax, [ebp*8] |
787 | lea eax, [ebp*8] |
788 | mov esi, edx |
788 | mov esi, edx |
789 | mov edx, ecx |
789 | mov edx, ecx |
790 | mov ecx, ebx |
790 | mov ecx, ebx |
791 | shl ecx, 16 |
791 | shl ecx, 16 |
792 | mov bx, ax |
792 | mov bx, ax |
793 | add bx, 3*2 |
793 | add bx, 3*2 |
794 | movzx eax, bx |
794 | movzx eax, bx |
795 | mov dword [esp+4*2+4*7], eax ;out eax = width |
795 | mov dword [esp+4*2+4*7], eax ;out eax = width |
796 | add word [esp+4*2+4*4+2], ax ;out ebx = x+width shl 16 + y |
796 | add word [esp+4*2+4*4+2], ax ;out ebx = x+width shl 16 + y |
797 | mov cx, BUTTON.HEIGHT |
797 | mov cx, BUTTON.HEIGHT |
798 | mcall SF_DEFINE_BUTTON |
798 | mcall SF_DEFINE_BUTTON |
799 | pop esi ebx |
799 | pop esi ebx |
800 | test edi, edi |
800 | test edi, edi |
801 | jz .no_caption_1 |
801 | jz .no_caption_1 |
802 | mov edx, edi |
802 | mov edx, edi |
803 | add ebx, 3 shl 16 + 3 |
803 | add ebx, 3 shl 16 + 3 |
804 | mov ecx, esi |
804 | mov ecx, esi |
805 | or ecx, 0xB0000000 |
805 | or ecx, 0xB0000000 |
806 | mcall SF_DRAW_TEXT |
806 | mcall SF_DRAW_TEXT |
807 | 807 | ||
808 | .no_caption_1: |
808 | .no_caption_1: |
809 | popa |
809 | popa |
810 | ret |
810 | ret |
811 | ;------------------------------------------------------------------------------- |
811 | ;------------------------------------------------------------------------------- |
812 | 812 | ||
813 | count_utf8z_chars: |
813 | count_utf8z_chars: |
814 | ;------------------------------------------------------------------------------- |
814 | ;------------------------------------------------------------------------------- |
815 | ;in: |
815 | ;in: |
816 | ;eax = pointer to UTF8Z string |
816 | ;eax = pointer to UTF8Z string |
817 | ;out: |
817 | ;out: |
818 | ;eax = count of chars (excluding finishing zero) (0 if string is empty or invalid) |
818 | ;eax = count of chars (excluding finishing zero) (0 if string is empty or invalid) |
819 | ;------------------------------------------------------------------------------- |
819 | ;------------------------------------------------------------------------------- |
820 | push esi ebx |
820 | push esi ebx |
821 | mov esi, eax |
821 | mov esi, eax |
822 | xor ebx, ebx |
822 | xor ebx, ebx |
823 | 823 | ||
824 | .0: |
824 | .0: |
825 | lodsb |
825 | lodsb |
826 | test al, al |
826 | test al, al |
827 | jz .ok |
827 | jz .ok |
828 | inc ebx |
828 | inc ebx |
829 | cmp al, 0x7F |
829 | cmp al, 0x7F |
830 | ja @f |
830 | ja @f |
831 | jmp .0 |
831 | jmp .0 |
832 | @@: |
832 | @@: |
833 | cmp al, 0xC0 |
833 | cmp al, 0xC0 |
834 | jb .err |
834 | jb .err |
835 | cmp al, 0xDF |
835 | cmp al, 0xDF |
836 | ja @f |
836 | ja @f |
837 | inc esi |
837 | inc esi |
838 | jmp .0 |
838 | jmp .0 |
839 | 839 | ||
840 | @@: |
840 | @@: |
841 | cmp al, 0xEF |
841 | cmp al, 0xEF |
842 | ja @f |
842 | ja @f |
843 | inc esi |
843 | inc esi |
844 | inc esi |
844 | inc esi |
845 | jmp .0 |
845 | jmp .0 |
846 | 846 | ||
847 | @@: |
847 | @@: |
848 | cmp al, 0xF7 |
848 | cmp al, 0xF7 |
849 | ja .err |
849 | ja .err |
850 | add esi, 3 |
850 | add esi, 3 |
851 | jmp .0 |
851 | jmp .0 |
852 | 852 | ||
853 | .ok: |
853 | .ok: |
854 | mov eax, ebx |
854 | mov eax, ebx |
855 | pop ebx esi |
855 | pop ebx esi |
856 | ret |
856 | ret |
857 | 857 | ||
858 | .err: |
858 | .err: |
859 | xor eax, eax |
859 | xor eax, eax |
860 | pop ebx esi |
860 | pop ebx esi |
861 | ret |
861 | ret |
862 | ;------------------------------------------------------------------------------- |
862 | ;------------------------------------------------------------------------------- |
863 | 863 | ||
864 | ; DATA AREA |
864 | ; DATA AREA |
865 | ;------------------------------------------------------------------------------- |
865 | ;------------------------------------------------------------------------------- |
866 | system_path db "/sys/lib/" |
866 | system_path db "/sys/lib/" |
867 | library_name db "box_lib.obj", 0 |
867 | library_name db "box_lib.obj", 0 |
868 | 868 | ||
869 | ;------------------------------------------------------------------------------- |
869 | ;------------------------------------------------------------------------------- |
870 | align 4 |
870 | align 4 |
871 | myimport: |
871 | myimport: |
872 | edit_box_draw dd aEdit_box_draw |
872 | edit_box_draw dd aEdit_box_draw |
873 | edit_box_key dd aEdit_box_key |
873 | edit_box_key dd aEdit_box_key |
874 | edit_box_mouse dd aEdit_box_mouse |
874 | edit_box_mouse dd aEdit_box_mouse |
875 | ;version_ed dd aVersion_ed |
875 | ;version_ed dd aVersion_ed |
876 | 876 | ||
877 | init_checkbox dd aInit_checkbox |
877 | init_checkbox dd aInit_checkbox |
878 | check_box_draw dd aCheck_box_draw |
878 | check_box_draw dd aCheck_box_draw |
879 | check_box_mouse dd aCheck_box_mouse |
879 | check_box_mouse dd aCheck_box_mouse |
880 | ;version_ch dd aVersion_ch |
880 | ;version_ch dd aVersion_ch |
881 | 881 | ||
882 | ;option_box_draw dd aOption_box_draw |
882 | ;option_box_draw dd aOption_box_draw |
883 | ;option_box_mouse dd aOption_box_mouse |
883 | ;option_box_mouse dd aOption_box_mouse |
884 | ;version_op dd aVersion_op |
884 | ;version_op dd aVersion_op |
885 | 885 | ||
886 | dd 0 |
886 | dd 0 |
887 | dd 0 |
887 | dd 0 |
888 | 888 | ||
889 | aEdit_box_draw db "edit_box",0 |
889 | aEdit_box_draw db "edit_box",0 |
890 | aEdit_box_key db "edit_box_key",0 |
890 | aEdit_box_key db "edit_box_key",0 |
891 | aEdit_box_mouse db "edit_box_mouse",0 |
891 | aEdit_box_mouse db "edit_box_mouse",0 |
892 | ;aVersion_ed db "version_ed",0 |
892 | ;aVersion_ed db "version_ed",0 |
893 | 893 | ||
894 | aInit_checkbox db "init_checkbox2",0 |
894 | aInit_checkbox db "init_checkbox2",0 |
895 | aCheck_box_draw db "check_box_draw2",0 |
895 | aCheck_box_draw db "check_box_draw2",0 |
896 | aCheck_box_mouse db "check_box_mouse2",0 |
896 | aCheck_box_mouse db "check_box_mouse2",0 |
897 | ;aVersion_ch db "version_ch",0 |
897 | ;aVersion_ch db "version_ch",0 |
898 | 898 | ||
899 | ;aOption_box_draw db "option_box_draw",0 |
899 | ;aOption_box_draw db "option_box_draw",0 |
900 | ;aOption_box_mouse db "option_box_mouse",0 |
900 | ;aOption_box_mouse db "option_box_mouse",0 |
901 | ;aVersion_op db "version_op",0 |
901 | ;aVersion_op db "version_op",0 |
902 | ;------------------------------------------------------------------------------- |
902 | ;------------------------------------------------------------------------------- |
903 | align 4 |
903 | align 4 |
904 | check1 check_box2 CHECKBOX.X shl 16 + 12, CHECKBOX.Y shl 16 + 12, 6, 0x80D6DEE7, 0x4C5258, 0xB0000000, strings.checkbox_caption, ch_flag_top |
904 | check1 check_box2 CHECKBOX.X shl 16 + 12, CHECKBOX.Y shl 16 + 12, 6, 0x80D6DEE7, 0x4C5258, 0xB0000000, strings.checkbox_caption, ch_flag_top |
905 | check1_end: |
905 | check1_end: |
906 | edit1 edit_box EDITBOX.WIDTH, EDITBOX.X, EDITBOX.Y, 0xffffff, 0x6f9480, 0, 0xAABBCC, 0x10000000, start_application_c,\ |
906 | edit1 edit_box EDITBOX.WIDTH, EDITBOX.X, EDITBOX.Y, 0xffffff, 0x6f9480, 0, 0xAABBCC, 0x10000000, start_application_c,\ |
907 | start_application,mouse_dd,ed_focus,start_application_e,start_application_e |
907 | start_application,mouse_dd,ed_focus,start_application_e,start_application_e |
908 | edit1_end: |
908 | edit1_end: |
909 | list_start dd 0 |
909 | list_start dd 0 |
910 | ;------------------------------------------------------------------------------- |
910 | ;------------------------------------------------------------------------------- |
911 | align 4 |
911 | align 4 |
912 | sys_reboot: |
912 | sys_reboot: |
913 | dd SSF_START_APP |
913 | dd SSF_START_APP |
914 | dd 0 |
914 | dd 0 |
915 | dd 0 |
915 | dd 0 |
916 | dd 0 |
916 | dd 0 |
917 | dd 0 |
917 | dd 0 |
918 | db "/sys/end",0 |
918 | db "/sys/end",0 |
919 | ;------------------------------------------------------------------------------- |
919 | ;------------------------------------------------------------------------------- |
920 | strings: |
920 | strings: |
921 | if lang eq de |
921 | if lang eq de |
922 | .window_caption utf8z "Prozesse v0.2.3 - [Ctrl+Alt+Del]" |
922 | .window_caption utf8z "Prozesse v0.2.3 - [Ctrl+Alt+Del]" |
923 | 923 | ||
924 | .process_name utf8z "NAME/BEENDEN" |
924 | .process_name utf8z "NAME/BEENDEN" |
925 | .ptid utf8z "PID/TID" |
925 | .ptid utf8z "PID/TID" |
926 | .cpu_usage_cycles utf8z "CPU(ZYKLEN)" |
926 | .cpu_usage_cycles utf8z "CPU(ZYKLEN)" |
927 | .cpu_usage_percent utf8z "CPU(%)" |
927 | .cpu_usage_percent utf8z "CPU(%)" |
928 | .memory_usage utf8z "SPEICHER" |
928 | .memory_usage utf8z "SPEICHER" |
929 | .window_stack_pos utf8z "W-STACK" |
929 | .window_stack_pos utf8z "W-STACK" |
930 | .window_position.x utf8z " WIN-X" |
930 | .window_position.x utf8z " WIN-X" |
931 | .window_position.y utf8z " WIN-Y" |
931 | .window_position.y utf8z " WIN-Y" |
932 | 932 | ||
933 | .previous_page utf8z "SEITE ZURUECK" |
933 | .previous_page utf8z "SEITE ZURUECK" |
934 | .next_page utf8z "SEITE VOR" |
934 | .next_page utf8z "SEITE VOR" |
935 | .reboot utf8z "REBOOT SYSTEM" |
935 | .reboot utf8z "REBOOT SYSTEM" |
936 | .run utf8z "START" |
936 | .run utf8z "START" |
937 | 937 | ||
938 | .checkbox_caption utf8z "System" |
938 | .checkbox_caption utf8z "System" |
939 | 939 | ||
940 | .KB utf8z " KB" |
940 | .KB utf8z " KB" |
941 | .MB utf8z " MB" |
941 | .MB utf8z " MB" |
942 | .GB utf8z " GB" |
942 | .GB utf8z " GB" |
943 | ;------------------------------------------------------------------------------- |
943 | ;------------------------------------------------------------------------------- |
944 | else if lang eq et |
944 | else if lang eq et |
945 | .window_caption utf8z "Protsessid v0.2.3 - [Ctrl+Alt+Del]" |
945 | .window_caption utf8z "Protsessid v0.2.3 - [Ctrl+Alt+Del]" |
946 | 946 | ||
947 | .process_name utf8z "NIMI/LÕPETA" |
947 | .process_name utf8z "NIMI/LÕPETA" |
948 | .ptid utf8z "PID/TID" |
948 | .ptid utf8z "PID/TID" |
949 | .cpu_usage_cycles utf8z "CPU(TSÜKLID)" |
949 | .cpu_usage_cycles utf8z "CPU(TSÜKLID)" |
950 | .cpu_usage_percent utf8z "CPU(%)" |
950 | .cpu_usage_percent utf8z "CPU(%)" |
951 | .memory_usage utf8z "MÄLU" |
951 | .memory_usage utf8z "MÄLU" |
952 | .window_stack_pos utf8z "W-PUHVER" |
952 | .window_stack_pos utf8z "W-PUHVER" |
953 | .window_position.x utf8z " WIN-X" |
953 | .window_position.x utf8z " WIN-X" |
954 | .window_position.y utf8z " WIN-Y" |
954 | .window_position.y utf8z " WIN-Y" |
955 | 955 | ||
956 | .previous_page utf8z "EELMINE LEHT" |
956 | .previous_page utf8z "EELMINE LEHT" |
957 | .next_page utf8z "JÄRGMINE LEHT" |
957 | .next_page utf8z "JÄRGMINE LEHT" |
958 | .reboot utf8z "REBOODI SÜSTEEM" |
958 | .reboot utf8z "REBOODI SÜSTEEM" |
959 | .run utf8z "START" |
959 | .run utf8z "START" |
960 | 960 | ||
961 | .checkbox_caption utf8z "System" |
961 | .checkbox_caption utf8z "System" |
962 | 962 | ||
963 | .KB utf8z " KB" |
963 | .KB utf8z " KB" |
964 | .MB utf8z " MB" |
964 | .MB utf8z " MB" |
965 | .GB utf8z " GB" |
965 | .GB utf8z " GB" |
966 | ;------------------------------------------------------------------------------- |
966 | ;------------------------------------------------------------------------------- |
967 | else if lang eq ru |
967 | else if lang eq ru |
968 | .window_caption utf8z "Диспетчер процессов v0.2.3 - [Ctrl+Alt+Del]" |
968 | .window_caption utf8z "Диспетчер процессов v0.2.3 - [Ctrl+Alt+Del]" |
969 | 969 | ||
970 | .process_name utf8z "ИМЯ/ЗАВЕРШИТЬ" |
970 | .process_name utf8z "ИМЯ/ЗАВЕРШИТЬ" |
971 | .ptid utf8z "PID/TID" |
971 | .ptid utf8z "PID/TID" |
972 | .cpu_usage_cycles utf8z "CPU(ТАКТЫ)" |
972 | .cpu_usage_cycles utf8z "CPU(ТАКТЫ)" |
973 | .cpu_usage_percent utf8z "CPU(%)" |
973 | .cpu_usage_percent utf8z "CPU(%)" |
974 | .memory_usage utf8z "ПАМЯТЬ" |
974 | .memory_usage utf8z "ПАМЯТЬ" |
975 | .window_stack_pos utf8z "W-STACK" |
975 | .window_stack_pos utf8z "W-STACK" |
976 | .window_position.x utf8z " WIN-X" |
976 | .window_position.x utf8z " WIN-X" |
977 | .window_position.y utf8z " WIN-Y" |
977 | .window_position.y utf8z " WIN-Y" |
978 | 978 | ||
979 | .previous_page utf8z "ПРЕД. СТР." |
979 | .previous_page utf8z "ПРЕД. СТР." |
980 | .next_page utf8z "СЛЕД. СТР." |
980 | .next_page utf8z "СЛЕД. СТР." |
981 | .reboot utf8z "ПЕРЕЗАГРУЗКА" |
981 | .reboot utf8z "ПЕРЕЗАГРУЗКА" |
982 | .run utf8z "ЗАПУСК" |
982 | .run utf8z "ЗАПУСК" |
983 | 983 | ||
984 | .checkbox_caption utf8z "Системные" |
984 | .checkbox_caption utf8z "Системные" |
985 | 985 | ||
986 | .KB utf8z " КБ" |
986 | .KB utf8z " КБ" |
987 | .MB utf8z " МБ" |
987 | .MB utf8z " МБ" |
988 | .GB utf8z " ГБ" |
988 | .GB utf8z " ГБ" |
989 | ;------------------------------------------------------------------------------- |
989 | ;------------------------------------------------------------------------------- |
990 | else if lang eq it |
990 | else if lang eq it |
991 | .window_caption utf8z "Gestore processi v0.2.3 - [Ctrl+Alt+Del]" |
991 | .window_caption utf8z "Gestore processi v0.2.3 - [Ctrl+Alt+Del]" |
992 | 992 | ||
993 | .process_name utf8z "NOME-PROGRAMMA" |
993 | .process_name utf8z "NOME-PROGRAMMA" |
994 | .ptid utf8z "PID/TID" |
994 | .ptid utf8z "PID/TID" |
995 | .cpu_usage_cycles utf8z "CPU(CICLI)" |
995 | .cpu_usage_cycles utf8z "CPU(CICLI)" |
996 | .cpu_usage_percent utf8z "CPU(%)" |
996 | .cpu_usage_percent utf8z "CPU(%)" |
997 | .memory_usage utf8z "MEMORY" |
997 | .memory_usage utf8z "MEMORY" |
998 | .window_stack_pos utf8z "W-STACK" |
998 | .window_stack_pos utf8z "W-STACK" |
999 | .window_position.x utf8z " WIN-X" |
999 | .window_position.x utf8z " WIN-X" |
1000 | .window_position.y utf8z " WIN-Y" |
1000 | .window_position.y utf8z " WIN-Y" |
1001 | 1001 | ||
1002 | .previous_page utf8z "INDIETRO" |
1002 | .previous_page utf8z "INDIETRO" |
1003 | .next_page utf8z "AVANTI" |
1003 | .next_page utf8z "AVANTI" |
1004 | .reboot utf8z "RIAVVIA SISTEMA" |
1004 | .reboot utf8z "RIAVVIA SISTEMA" |
1005 | .run utf8z "START" |
1005 | .run utf8z "START" |
1006 | 1006 | ||
1007 | .checkbox_caption utf8z "System" |
1007 | .checkbox_caption utf8z "System" |
1008 | 1008 | ||
1009 | .KB utf8z " KB" |
1009 | .KB utf8z " KB" |
1010 | .MB utf8z " MB" |
1010 | .MB utf8z " MB" |
1011 | .GB utf8z " GB" |
1011 | .GB utf8z " GB" |
1012 | ;------------------------------------------------------------------------------- |
1012 | ;------------------------------------------------------------------------------- |
1013 | else |
1013 | else |
1014 | .window_caption utf8z "Process manager v0.2.3 - [Ctrl+Alt+Del]" |
1014 | .window_caption utf8z "Process manager v0.2.3 - [Ctrl+Alt+Del]" |
1015 | 1015 | ||
1016 | .process_name utf8z "NAME/TERMINATE" |
1016 | .process_name utf8z "NAME/TERMINATE" |
1017 | .ptid utf8z "PID/TID" |
1017 | .ptid utf8z "PID/TID" |
1018 | .cpu_usage_cycles utf8z "CPU(CYCLES)" |
1018 | .cpu_usage_cycles utf8z "CPU(CYCLES)" |
1019 | .cpu_usage_percent utf8z "CPU(%)" |
1019 | .cpu_usage_percent utf8z "CPU(%)" |
1020 | .memory_usage utf8z "MEMORY" |
1020 | .memory_usage utf8z "MEMORY" |
1021 | .window_stack_pos utf8z "W-STACK" |
1021 | .window_stack_pos utf8z "W-STACK" |
1022 | .window_position.x utf8z " WIN-X" |
1022 | .window_position.x utf8z " WIN-X" |
1023 | .window_position.y utf8z " WIN-Y" |
1023 | .window_position.y utf8z " WIN-Y" |
1024 | 1024 | ||
1025 | 1025 | ||
1026 | .previous_page utf8z "PREV PAGE" |
1026 | .previous_page utf8z "PREV PAGE" |
1027 | .next_page utf8z "NEXT PAGE" |
1027 | .next_page utf8z "NEXT PAGE" |
1028 | .reboot utf8z "REBOOT SYSTEM" |
1028 | .reboot utf8z "REBOOT SYSTEM" |
1029 | .run utf8z "RUN" |
1029 | .run utf8z "RUN" |
1030 | 1030 | ||
1031 | .checkbox_caption utf8z "System" |
1031 | .checkbox_caption utf8z "System" |
1032 | 1032 | ||
1033 | .KB utf8z " KB" |
1033 | .KB utf8z " KB" |
1034 | .MB utf8z " MB" |
1034 | .MB utf8z " MB" |
1035 | .GB utf8z " GB" |
1035 | .GB utf8z " GB" |
1036 | end if |
1036 | end if |
1037 | ;------------------------------------------------------------------------------- |
1037 | ;------------------------------------------------------------------------------- |
1038 | align 4 |
1038 | align 4 |
1039 | tinfo: |
1039 | tinfo: |
1040 | dd SSF_START_APP |
1040 | dd SSF_START_APP |
1041 | dd 0 |
1041 | dd 0 |
1042 | .params dd .params_buf |
1042 | .params dd .params_buf |
1043 | dd 0 |
1043 | dd 0 |
1044 | dd 0 |
1044 | dd 0 |
1045 | db 0 |
1045 | db 0 |
1046 | .file_path dd sz_tinfo_file_path |
1046 | .file_path dd sz_tinfo_file_path |
1047 | align 4 |
1047 | align 4 |
1048 | .params_buf: |
1048 | .params_buf: |
1049 | times 11 db 0 ; at now 4 bytes will be enough, but may be in the future not |
1049 | times 11 db 0 ; at now 4 bytes will be enough, but may be in the future not |
1050 | align 4 |
1050 | align 4 |
1051 | sz_tinfo_file_path db "/sys/tinfo",0 |
1051 | sz_tinfo_file_path db "/sys/tinfo",0 |
1052 | ;------------------------------------------------------------------------------- |
1052 | ;------------------------------------------------------------------------------- |
1053 | align 4 |
1053 | align 4 |
1054 | file_start: |
1054 | file_start: |
1055 | dd SSF_START_APP |
1055 | dd SSF_START_APP |
1056 | dd 0 |
1056 | dd 0 |
1057 | dd 0 |
1057 | dd 0 |
1058 | dd 0 |
1058 | dd 0 |
1059 | dd 0 |
1059 | dd 0 |
1060 | start_application: db "/sys/LAUNCHER",0 |
1060 | start_application: db "/sys/LAUNCHER",0 |
1061 | start_application_e=$-start_application-1 |
1061 | start_application_e=$-start_application-1 |
1062 | ; times 60 db 0 |
1062 | ; times 60 db 0 |
1063 | rb 60 |
1063 | rb 60 |
1064 | start_application_c=$-start_application-1 |
1064 | start_application_c=$-start_application-1 |
1065 | ;------------------------------------------------------------------------------- |
1065 | ;------------------------------------------------------------------------------- |
1066 | IM_END: |
1066 | IM_END: |
1067 | ;------------------------------------------------------------------------------- |
1067 | ;------------------------------------------------------------------------------- |
1068 | align 4 |
1068 | align 4 |
1069 | sc system_colors |
1069 | sc system_colors |
1070 | winxpos rd 1 |
1070 | winxpos rd 1 |
1071 | winypos rd 1 |
1071 | winypos rd 1 |
1072 | mouse_dd rd 1 |
1072 | mouse_dd rd 1 |
1073 | cpu_percent rd 1 |
1073 | cpu_percent rd 1 |
1074 | list_add rd 1 |
1074 | list_add rd 1 |
1075 | curposy rd 1 |
1075 | curposy rd 1 |
1076 | index rd 1 |
1076 | index rd 1 |
1077 | tasklist rd DISPLAY_PROCESSES |
1077 | tasklist rd DISPLAY_PROCESSES |
1078 | time_counter rd 1 |
1078 | time_counter rd 1 |
1079 | 1079 | ||
1080 | window_status rd 1 |
1080 | window_status rd 1 |
1081 | client_area_x_size rd 1 |
1081 | client_area_x_size rd 1 |
1082 | client_area_y_size rd 1 |
1082 | client_area_y_size rd 1 |
1083 | bar_bacground_color rd 1 |
1083 | bar_bacground_color rd 1 |
1084 | btn_bacground_color rd 1 |
1084 | btn_bacground_color rd 1 |
1085 | draw_window_flag rd 1 |
1085 | draw_window_flag rd 1 |
1086 | ;------------------------------------------------------------------------------- |
1086 | ;------------------------------------------------------------------------------- |
1087 | align 4 |
1087 | align 4 |
1088 | library_path: |
1088 | library_path: |
1089 | process_info_buffer process_information |
1089 | process_info_buffer process_information |
1090 | ;------------------------------------------------------------------------------- |
1090 | ;------------------------------------------------------------------------------- |
1091 | align 4 |
1091 | align 4 |
1092 | cur_dir_path: |
1092 | cur_dir_path: |
1093 | rb 1024 |
1093 | rb 1024 |
1094 | rb 1024 |
1094 | rb 1024 |
1095 | stack_area: |
1095 | stack_area: |
1096 | U_END:1024>131,>132,> |
1096 | U_END:1024>141,>141,> |