Rev 4738 | Rev 4886 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4738 | Rev 4739 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4 | 4 | ||
5 | macro DrawRectangle x, y, w, h, color |
5 | macro DrawRectangle x, y, w, h, color |
6 | { |
6 | { |
7 | mcall 13, x shl 16 + w, y shl 16 + 1, color ; top |
7 | mcall 13, x shl 16 + w, y shl 16 + 1, color ; top |
8 | mcall , x shl 16 + 1, y shl 16 + h, color ; left |
8 | mcall , x shl 16 + 1, y shl 16 + h, color ; left |
9 | mcall , (x+w) shl 16 +1, y shl 16 + (h+1), color ; right |
9 | mcall , (x+w) shl 16 +1, y shl 16 + (h+1), color ; right |
10 | mcall , x shl 16 + w, (y+h) shl 16 + 1, color ; bottom |
10 | mcall , x shl 16 + w, (y+h) shl 16 + 1, color ; bottom |
11 | } |
11 | } |
12 | 12 | ||
13 | ;----------------------------------------------------------------------------- |
13 | ;----------------------------------------------------------------------------- |
14 | ; Color scheme |
14 | ; Color scheme |
15 | 15 | ||
16 | BLACK_ON_WHITE equ 0 |
16 | BLACK_ON_WHITE equ 0 |
17 | MOVIEOS equ 1 |
17 | MOVIEOS equ 1 |
18 | WHITE_ON_BLACK equ 2 |
18 | WHITE_ON_BLACK equ 2 |
19 | 19 | ||
20 | ; format - 0xRRGGBB |
20 | ; format - 0xRRGGBB |
21 | if COLOR_THEME eq MOVIEOS |
21 | if COLOR_THEME eq MOVIEOS |
22 | 22 | ||
23 | COLOR_BG_NORMAL = 0x1d272f |
23 | COLOR_BG_NORMAL = 0x1d272f |
24 | COLOR_BG_BREAKPOINT = 0x0000aa |
24 | COLOR_BG_BREAKPOINT = 0x0000aa |
25 | COLOR_BG_SELECTED = 0xec9300 |
25 | COLOR_BG_SELECTED = 0xec9300 |
26 | COLOR_LINE = 0x00b9a0 |
26 | COLOR_LINE = 0x00b9a0 |
27 | COLOR_TXT_NORMAL = 0xffffff |
27 | COLOR_TXT_NORMAL = 0xffffff |
28 | COLOR_TXT_INACTIVE = 0x8f7948 |
28 | COLOR_TXT_INACTIVE = 0x8f7948 |
29 | COLOR_TXT_CHANGED = 0xec9300 |
29 | COLOR_TXT_CHANGED = 0xec9300 |
30 | COLOR_TXT_SELECTED = 0x1d272f |
30 | COLOR_TXT_SELECTED = 0x1d272f |
31 | 31 | ||
32 | else if COLOR_THEME eq WHITE_ON_BLACK |
32 | else if COLOR_THEME eq WHITE_ON_BLACK |
33 | 33 | ||
34 | COLOR_BG_NORMAL = 0x101010 ; dark grey |
34 | COLOR_BG_NORMAL = 0x101010 ; dark grey |
35 | COLOR_BG_BREAKPOINT = 0xFF0000 ; red |
35 | COLOR_BG_BREAKPOINT = 0xFF0000 ; red |
36 | COLOR_BG_SELECTED = 0x0000FF ; blue |
36 | COLOR_BG_SELECTED = 0x0000FF ; blue |
37 | COLOR_LINE = 0xFFFFFF ; white |
37 | COLOR_LINE = 0xFFFFFF ; white |
38 | COLOR_TXT_NORMAL = 0xFFFFFF ; white |
38 | COLOR_TXT_NORMAL = 0xFFFFFF ; white |
39 | COLOR_TXT_INACTIVE = 0x808080 ; grey |
39 | COLOR_TXT_INACTIVE = 0x808080 ; grey |
40 | COLOR_TXT_CHANGED = 0x00AA00 ; green |
40 | COLOR_TXT_CHANGED = 0x00AA00 ; green |
41 | COLOR_TXT_SELECTED = 0xFFFFFF ; white |
41 | COLOR_TXT_SELECTED = 0xFFFFFF ; white |
42 | 42 | ||
43 | else ; BLACK ON WHITE |
43 | else ; BLACK ON WHITE |
44 | 44 | ||
45 | COLOR_BG_NORMAL = 0xffffff ; white |
45 | COLOR_BG_NORMAL = 0xffffff ; white |
46 | COLOR_BG_BREAKPOINT = 0xFF0000 ; red |
46 | COLOR_BG_BREAKPOINT = 0xFF0000 ; red |
47 | COLOR_BG_SELECTED = 0x0000FF ; blue |
47 | COLOR_BG_SELECTED = 0x0000FF ; blue |
48 | COLOR_LINE = 0x000000 ; black |
48 | COLOR_LINE = 0x000000 ; black |
49 | COLOR_TXT_NORMAL = 0x000000 ; black |
49 | COLOR_TXT_NORMAL = 0x000000 ; black |
50 | COLOR_TXT_INACTIVE = 0x808080 ; grey |
50 | COLOR_TXT_INACTIVE = 0x808080 ; grey |
51 | COLOR_TXT_CHANGED = 0x00AA00 ; green |
51 | COLOR_TXT_CHANGED = 0x00AA00 ; green |
52 | COLOR_TXT_SELECTED = 0xFFFFFF ; white |
52 | COLOR_TXT_SELECTED = 0xFFFFFF ; white |
53 | 53 | ||
54 | end if |
54 | end if |
55 | 55 | ||
56 | ;----------------------------------------------------------------------------- |
56 | ;----------------------------------------------------------------------------- |
57 | 57 | ||
58 | data_width equ 80 |
58 | data_width equ 80 |
59 | data_x_pos equ 12 |
59 | data_x_pos equ 12 |
60 | data_x_size equ data_width*6 |
60 | data_x_size equ data_width*6 |
61 | 61 | ||
62 | title_x_pos equ 30 |
62 | title_x_pos equ 30 |
63 | title_y_pos equ 32 |
63 | title_y_pos equ 32 |
64 | title_y_size equ 10 |
64 | title_y_size equ 10 |
65 | 65 | ||
66 | ;dump_y_pos equ (registers_y_pos + registers_y_size + 5) |
66 | ;dump_y_pos equ (registers_y_pos + registers_y_size + 5) |
67 | dump_y_pos equ (title_y_pos + title_y_size) |
67 | dump_y_pos equ (title_y_pos + title_y_size) |
68 | dump_height equ 6 |
68 | dump_height equ 6 |
69 | dump_y_size equ (dump_height*10) |
69 | dump_y_size equ (dump_height*10) |
70 | 70 | ||
71 | disasm_y_pos equ (dump_y_pos + dump_y_size + 4) |
71 | disasm_y_pos equ (dump_y_pos + dump_y_size + 4) |
72 | disasm_height equ 18 |
72 | disasm_height equ 18 |
73 | disasm_y_size equ (disasm_height*10) |
73 | disasm_y_size equ (disasm_height*10) |
74 | 74 | ||
75 | messages_width equ data_width |
75 | messages_width equ data_width |
76 | messages_height equ 8 |
76 | messages_height equ 8 |
77 | messages_x_pos equ data_x_pos |
77 | messages_x_pos equ data_x_pos |
78 | messages_y_pos equ (disasm_y_pos + disasm_y_size + 4) |
78 | messages_y_pos equ (disasm_y_pos + disasm_y_size + 4) |
79 | messages_x_size equ messages_width*6 |
79 | messages_x_size equ messages_width*6 |
80 | messages_y_size equ messages_height*10 |
80 | messages_y_size equ messages_height*10 |
81 | 81 | ||
82 | cmdline_width equ data_width |
82 | cmdline_width equ data_width |
83 | cmdline_x_pos equ data_x_pos |
83 | cmdline_x_pos equ data_x_pos |
84 | cmdline_y_pos equ (messages_y_pos + messages_y_size + 4) |
84 | cmdline_y_pos equ (messages_y_pos + messages_y_size + 4) |
85 | cmdline_x_size equ messages_x_size |
85 | cmdline_x_size equ messages_x_size |
86 | cmdline_y_size equ 10 |
86 | cmdline_y_size equ 10 |
87 | 87 | ||
88 | registers_x_pos equ (data_x_pos + messages_x_size + 4) |
88 | registers_x_pos equ (data_x_pos + messages_x_size + 4) |
89 | registers_y_pos equ (title_y_pos + title_y_size - 3) |
89 | registers_y_pos equ (title_y_pos + title_y_size - 3) |
90 | registers_x_size equ 134 |
90 | registers_x_size equ 134 |
91 | registers_y_size equ (cmdline_y_pos + cmdline_y_size - registers_y_pos+1) |
91 | registers_y_size equ (cmdline_y_pos + cmdline_y_size - registers_y_pos+1) |
92 | 92 | ||
93 | wnd_x_size equ (data_x_pos + messages_x_size + data_x_pos + registers_x_size+3) |
93 | wnd_x_size equ (data_x_pos + messages_x_size + data_x_pos + registers_x_size+3) |
94 | wnd_y_size equ (cmdline_y_pos + cmdline_y_size + data_x_pos) |
94 | wnd_y_size equ (cmdline_y_pos + cmdline_y_size + data_x_pos) |
95 | 95 | ||
96 | ;----------------------------------------------------------------------------- |
96 | ;----------------------------------------------------------------------------- |
97 | ; Entry point |
97 | ; Entry point |
98 | 98 | ||
99 | ; TODO: split all gui part in independent function, move entry point into mtdbg.asm |
99 | ; TODO: split all gui part in independent function, move entry point into mtdbg.asm |
100 | 100 | ||
101 | start: |
101 | start: |
102 | ; initialize process heap |
102 | ; initialize process heap |
103 | mcall 68, 11 |
103 | mcall 68, 11 |
104 | mov edi, messages |
104 | mov edi, messages |
105 | mov ecx, messages_width*messages_height |
105 | mov ecx, messages_width*messages_height |
106 | mov al, ' ' |
106 | mov al, ' ' |
107 | rep stosb |
107 | rep stosb |
108 | xor eax, eax |
108 | xor eax, eax |
109 | mov [messages_pos], eax |
109 | mov [messages_pos], eax |
110 | mov [cmdline_len], eax |
110 | mov [cmdline_len], eax |
111 | mov [cmdline_pos], eax |
111 | mov [cmdline_pos], eax |
112 | mov edi, needzerostart |
112 | mov edi, needzerostart |
113 | mov ecx, (needzeroend-needzerostart+3)/4 |
113 | mov ecx, (needzeroend-needzerostart+3)/4 |
114 | rep stosd |
114 | rep stosd |
115 | mov esi, begin_str |
115 | mov esi, begin_str |
116 | call put_message_nodraw |
116 | call put_message_nodraw |
117 | ; set event mask - default events and debugging events |
117 | ; set event mask - default events and debugging events |
118 | ;push 40 |
118 | ;push 40 |
119 | ;pop eax |
119 | ;pop eax |
120 | ;mov ebx, 0x107 |
120 | ;mov ebx, 0x107 |
121 | mcall 40, 0x107 |
121 | mcall 40, 0x107 |
122 | ; set debug messages buffer |
122 | ; set debug messages buffer |
123 | mov ecx, dbgbufsize |
123 | mov ecx, dbgbufsize |
124 | mov dword [ecx], 256 |
124 | mov dword [ecx], 256 |
125 | xor ebx, ebx |
125 | xor ebx, ebx |
126 | mov [ecx+4], ebx |
126 | mov [ecx+4], ebx |
127 | mov al, 69 |
127 | mov al, 69 |
128 | mcall |
128 | mcall |
129 | mov esi, i_param |
129 | mov esi, i_param |
130 | call get_arg.skip_spaces |
130 | call get_arg.skip_spaces |
131 | test al, al |
131 | test al, al |
132 | jz dodraw |
132 | jz dodraw |
133 | push esi |
133 | push esi |
134 | call draw_window |
134 | call draw_window |
135 | pop esi |
135 | pop esi |
136 | call OnLoadInit |
136 | call OnLoadInit |
137 | jmp waitevent |
137 | jmp waitevent |
138 | 138 | ||
139 | dodraw: |
139 | dodraw: |
140 | call draw_window |
140 | call draw_window |
141 | 141 | ||
142 | waitevent: |
142 | waitevent: |
143 | ;push 10 |
143 | ;push 10 |
144 | ;pop eax |
144 | ;pop eax |
145 | mcall 10 |
145 | mcall 10 |
146 | cmp al, 9 |
146 | cmp al, 9 |
147 | jz debugmsg |
147 | jz debugmsg |
148 | dec eax |
148 | dec eax |
149 | jz dodraw |
149 | jz dodraw |
150 | dec eax |
150 | dec eax |
151 | jz keypressed |
151 | jz keypressed |
152 | dec eax |
152 | dec eax |
153 | jnz waitevent |
153 | jnz waitevent |
154 | ; button pressed - we have only one button (close) |
154 | ; button pressed - we have only one button (close) |
155 | ;push -1 |
155 | ;push -1 |
156 | ;pop eax |
156 | ;pop eax |
157 | mcall -1 |
157 | mcall -1 |
158 | 158 | ||
159 | ; TODO: split in more independent function |
159 | ; TODO: split in more independent function |
160 | keypressed: |
160 | keypressed: |
161 | mov al, 2 |
161 | mov al, 2 |
162 | mcall |
162 | mcall |
163 | shr eax, 8 |
163 | shr eax, 8 |
164 | cmp al, 8 |
164 | cmp al, 8 |
165 | jz .backspace |
165 | jz .backspace |
166 | cmp al, 0xB0 |
166 | cmp al, 0xB0 |
167 | jz .left |
167 | jz .left |
168 | cmp al, 0xB3 |
168 | cmp al, 0xB3 |
169 | jz .right |
169 | jz .right |
170 | cmp al, 0x0D |
170 | cmp al, 0x0D |
171 | jz .enter |
171 | jz .enter |
172 | cmp al, 0xB6 |
172 | cmp al, 0xB6 |
173 | jz .del |
173 | jz .del |
174 | cmp al, 0xB4 |
174 | cmp al, 0xB4 |
175 | jz .home |
175 | jz .home |
176 | cmp al, 0xB5 |
176 | cmp al, 0xB5 |
177 | jz .end |
177 | jz .end |
178 | cmp al, 0xB1 |
178 | cmp al, 0xB1 |
179 | jz .down |
179 | jz .down |
180 | cmp al, 0xB2 |
180 | cmp al, 0xB2 |
181 | jz .up |
181 | jz .up |
182 | cmp ah, 0x41 |
182 | cmp ah, 0x41 |
183 | jz F7 |
183 | jz F7 |
184 | cmp ah, 0x42 |
184 | cmp ah, 0x42 |
185 | jz F8 |
185 | jz F8 |
186 | cmp [cmdline_len], cmdline_width |
186 | cmp [cmdline_len], cmdline_width |
187 | jae waitevent |
187 | jae waitevent |
188 | push eax |
188 | push eax |
189 | call clear_cmdline_end |
189 | call clear_cmdline_end |
190 | pop eax |
190 | pop eax |
191 | mov edi, cmdline |
191 | mov edi, cmdline |
192 | mov ecx, [cmdline_len] |
192 | mov ecx, [cmdline_len] |
193 | add edi, ecx |
193 | add edi, ecx |
194 | lea esi, [edi-1] |
194 | lea esi, [edi-1] |
195 | sub ecx, [cmdline_pos] |
195 | sub ecx, [cmdline_pos] |
196 | std |
196 | std |
197 | rep movsb |
197 | rep movsb |
198 | cld |
198 | cld |
199 | stosb |
199 | stosb |
200 | inc [cmdline_len] |
200 | inc [cmdline_len] |
201 | call draw_cmdline_end |
201 | call draw_cmdline_end |
202 | inc [cmdline_pos] |
202 | inc [cmdline_pos] |
203 | call draw_cursor |
203 | call draw_cursor |
204 | jmp waitevent |
204 | jmp waitevent |
205 | 205 | ||
206 | .backspace: |
206 | .backspace: |
207 | cmp [cmdline_pos], 0 |
207 | cmp [cmdline_pos], 0 |
208 | jz waitevent |
208 | jz waitevent |
209 | dec [cmdline_pos] |
209 | dec [cmdline_pos] |
210 | 210 | ||
211 | .delchar: |
211 | .delchar: |
212 | call clear_cmdline_end |
212 | call clear_cmdline_end |
213 | mov edi, [cmdline_pos] |
213 | mov edi, [cmdline_pos] |
214 | dec [cmdline_len] |
214 | dec [cmdline_len] |
215 | mov ecx, [cmdline_len] |
215 | mov ecx, [cmdline_len] |
216 | sub ecx, edi |
216 | sub ecx, edi |
217 | add edi, cmdline |
217 | add edi, cmdline |
218 | lea esi, [edi+1] |
218 | lea esi, [edi+1] |
219 | rep movsb |
219 | rep movsb |
220 | call draw_cmdline_end |
220 | call draw_cmdline_end |
221 | call draw_cursor |
221 | call draw_cursor |
222 | jmp waitevent |
222 | jmp waitevent |
223 | 223 | ||
224 | .del: |
224 | .del: |
225 | mov eax, [cmdline_pos] |
225 | mov eax, [cmdline_pos] |
226 | cmp eax, [cmdline_len] |
226 | cmp eax, [cmdline_len] |
227 | jae waitevent |
227 | jae waitevent |
228 | jmp .delchar |
228 | jmp .delchar |
229 | 229 | ||
230 | .left: |
230 | .left: |
231 | cmp [cmdline_pos], 0 |
231 | cmp [cmdline_pos], 0 |
232 | jz waitevent |
232 | jz waitevent |
233 | call hide_cursor |
233 | call hide_cursor |
234 | dec [cmdline_pos] |
234 | dec [cmdline_pos] |
235 | call draw_cursor |
235 | call draw_cursor |
236 | jmp waitevent |
236 | jmp waitevent |
237 | 237 | ||
238 | .right: |
238 | .right: |
239 | mov eax, [cmdline_pos] |
239 | mov eax, [cmdline_pos] |
240 | cmp eax, [cmdline_len] |
240 | cmp eax, [cmdline_len] |
241 | jae waitevent |
241 | jae waitevent |
242 | call hide_cursor |
242 | call hide_cursor |
243 | inc [cmdline_pos] |
243 | inc [cmdline_pos] |
244 | call draw_cursor |
244 | call draw_cursor |
245 | jmp waitevent |
245 | jmp waitevent |
246 | 246 | ||
247 | .home: |
247 | .home: |
248 | call hide_cursor |
248 | call hide_cursor |
249 | and [cmdline_pos], 0 |
249 | and [cmdline_pos], 0 |
250 | call draw_cursor |
250 | call draw_cursor |
251 | jmp waitevent |
251 | jmp waitevent |
252 | 252 | ||
253 | .end: |
253 | .end: |
254 | call hide_cursor |
254 | call hide_cursor |
255 | mov eax, [cmdline_len] |
255 | mov eax, [cmdline_len] |
256 | mov [cmdline_pos], eax |
256 | mov [cmdline_pos], eax |
257 | call draw_cursor |
257 | call draw_cursor |
258 | 258 | ||
259 | .up: |
259 | .up: |
260 | .down: |
260 | .down: |
261 | jmp waitevent |
261 | jmp waitevent |
262 | 262 | ||
263 | ; We also trying to execute previous command, if empty command_line |
263 | ; We also trying to execute previous command, if empty command_line |
264 | .enter: |
264 | .enter: |
265 | mov ecx, [cmdline_len] |
265 | mov ecx, [cmdline_len] |
266 | test ecx, ecx |
266 | test ecx, ecx |
267 | jnz .exec_cur |
267 | jnz .exec_cur |
268 | mov cl, byte [cmdline_prev] |
268 | mov cl, byte [cmdline_prev] |
269 | cmp cl, 0 |
269 | cmp cl, 0 |
270 | jz waitevent |
270 | jz waitevent |
271 | 271 | ||
272 | .exec_prev: |
272 | .exec_prev: |
273 | mov esi, cmdline_prev |
273 | mov esi, cmdline_prev |
274 | jmp .exec |
274 | jmp .exec |
275 | 275 | ||
276 | .exec_cur: |
276 | .exec_cur: |
277 | mov esi, cmdline |
277 | mov esi, cmdline |
278 | 278 | ||
279 | .exec: |
279 | .exec: |
280 | mov byte [esi+ecx], 0 |
280 | mov byte [esi+ecx], 0 |
281 | and [cmdline_pos], 0 |
281 | and [cmdline_pos], 0 |
282 | push esi |
282 | push esi |
283 | call clear_cmdline_end |
283 | call clear_cmdline_end |
284 | call draw_cursor |
284 | call draw_cursor |
285 | pop esi |
285 | pop esi |
286 | and [cmdline_len], 0 |
286 | and [cmdline_len], 0 |
287 | ; skip leading spaces |
287 | ; skip leading spaces |
288 | call get_arg.skip_spaces |
288 | call get_arg.skip_spaces |
289 | cmp al, 0 |
289 | cmp al, 0 |
290 | jz waitevent |
290 | jz waitevent |
291 | ; now esi points to command |
291 | ; now esi points to command |
292 | push esi |
292 | push esi |
293 | mov esi, prompt |
293 | mov esi, prompt |
294 | call put_message_nodraw |
294 | call put_message_nodraw |
295 | pop esi |
295 | pop esi |
296 | push esi |
296 | push esi |
297 | call put_message_nodraw |
297 | call put_message_nodraw |
298 | 298 | ||
299 | ; TODO: add meaningful name |
299 | ; TODO: add meaningful name |
300 | z1: |
300 | z1: |
301 | mov esi, newline |
301 | mov esi, newline |
302 | call put_message |
302 | call put_message |
303 | pop esi |
303 | pop esi |
304 | push esi |
304 | push esi |
305 | call get_arg |
305 | call get_arg |
306 | mov [curarg], esi |
306 | mov [curarg], esi |
307 | pop edi |
307 | pop edi |
308 | mov esi, commands |
308 | mov esi, commands |
309 | call find_cmd |
309 | call find_cmd |
310 | mov eax, aUnknownCommand |
310 | mov eax, aUnknownCommand |
311 | jc .x11 |
311 | jc .x11 |
312 | 312 | ||
313 | ; check command requirements |
313 | ; check command requirements |
314 | ; flags field: |
314 | ; flags field: |
315 | ; &1: command may be called without parameters |
315 | ; &1: command may be called without parameters |
316 | ; &2: command may be called with parameters |
316 | ; &2: command may be called with parameters |
317 | ; &4: command may be called without loaded program |
317 | ; &4: command may be called without loaded program |
318 | ; &8: command may be called with loaded program |
318 | ; &8: command may be called with loaded program |
319 | mov eax, [esi+8] |
319 | mov eax, [esi+8] |
320 | mov ecx, [curarg] |
320 | mov ecx, [curarg] |
321 | cmp byte [ecx], 0 |
321 | cmp byte [ecx], 0 |
322 | jz .noargs |
322 | jz .noargs |
323 | test byte [esi+16], 2 |
323 | test byte [esi+16], 2 |
324 | jz .x11 |
324 | jz .x11 |
325 | jmp @f |
325 | jmp @f |
326 | 326 | ||
327 | .noargs: |
327 | .noargs: |
328 | test byte [esi+16], 1 |
328 | test byte [esi+16], 1 |
329 | jz .x11 |
329 | jz .x11 |
330 | 330 | ||
331 | @@: |
331 | @@: |
332 | cmp [debuggee_pid], 0 |
332 | cmp [debuggee_pid], 0 |
333 | jz .nodebuggee |
333 | jz .nodebuggee |
334 | mov eax, aAlreadyLoaded |
334 | mov eax, aAlreadyLoaded |
335 | test byte [esi+16], 8 |
335 | test byte [esi+16], 8 |
336 | jz .x11 |
336 | jz .x11 |
337 | jmp .x9 |
337 | jmp .x9 |
338 | 338 | ||
339 | .nodebuggee: |
339 | .nodebuggee: |
340 | mov eax, need_debuggee |
340 | mov eax, need_debuggee |
341 | test byte [esi+16], 4 |
341 | test byte [esi+16], 4 |
342 | jnz .x9 |
342 | jnz .x9 |
343 | 343 | ||
344 | .x11: |
344 | .x11: |
345 | xchg esi, eax |
345 | xchg esi, eax |
346 | call put_message |
346 | call put_message |
347 | 347 | ||
348 | ; store cmdline for repeating |
348 | ; store cmdline for repeating |
349 | .x10: |
349 | .x10: |
350 | mov esi, cmdline |
350 | mov esi, cmdline |
351 | mov ecx, [cmdline_len] |
351 | mov ecx, [cmdline_len] |
352 | 352 | ||
353 | @@: |
353 | @@: |
354 | cmp ecx, 0 |
354 | cmp ecx, 0 |
355 | jle .we |
355 | jle .we |
356 | mov al, [esi + ecx] |
356 | mov al, [esi + ecx] |
357 | mov [cmdline_prev + ecx], al |
357 | mov [cmdline_prev + ecx], al |
358 | dec ecx |
358 | dec ecx |
359 | jmp @b |
359 | jmp @b |
360 | 360 | ||
361 | .we: |
361 | .we: |
362 | mov [cmdline_len], 0 |
362 | mov [cmdline_len], 0 |
363 | jmp waitevent |
363 | jmp waitevent |
364 | 364 | ||
365 | .x9: |
365 | .x9: |
366 | call dword [esi+4] |
366 | call dword [esi+4] |
367 | jmp .x10 |
367 | jmp .x10 |
368 | 368 | ||
369 | ;----------------------------------------------------------------------------- |
369 | ;----------------------------------------------------------------------------- |
370 | ; Cmdline handling |
370 | ; Cmdline handling |
371 | 371 | ||
372 | clear_cmdline_end: |
372 | clear_cmdline_end: |
373 | mov ebx, [cmdline_pos] |
373 | mov ebx, [cmdline_pos] |
374 | mov ecx, [cmdline_len] |
374 | mov ecx, [cmdline_len] |
375 | sub ecx, ebx |
375 | sub ecx, ebx |
376 | ;push 13 |
376 | ;push 13 |
377 | ;pop eax |
377 | ;pop eax |
378 | imul ebx, 6 |
378 | imul ebx, 6 |
379 | imul ecx, 6 |
379 | imul ecx, 6 |
380 | inc ecx |
380 | inc ecx |
381 | add ebx, cmdline_x_pos |
381 | add ebx, cmdline_x_pos |
382 | shl ebx, 16 |
382 | shl ebx, 16 |
383 | or ebx, ecx |
383 | or ebx, ecx |
384 | mov ecx, cmdline_y_pos*10000h + cmdline_y_size |
384 | mov ecx, cmdline_y_pos*10000h + cmdline_y_size |
385 | ; setting up container color scheme |
385 | ; setting up container color scheme |
386 | ; COLOR_BG_NORMAL was 0xFFFFFF |
386 | ; COLOR_BG_NORMAL was 0xFFFFFF |
387 | mov edx, COLOR_BG_NORMAL |
387 | mov edx, COLOR_BG_NORMAL |
388 | ; draw container rectangle/box for cmdline |
388 | ; draw container rectangle/box for cmdline |
389 | mcall 13 |
389 | mcall 13 |
390 | ret |
390 | ret |
391 | 391 | ||
392 | draw_cmdline: |
392 | draw_cmdline: |
393 | xor ebx, ebx |
393 | xor ebx, ebx |
394 | jmp @f |
394 | jmp @f |
395 | 395 | ||
396 | ; TODO: make it local |
396 | ; TODO: make it local |
397 | draw_cmdline_end: |
397 | draw_cmdline_end: |
398 | mov ebx, [cmdline_pos] |
398 | mov ebx, [cmdline_pos] |
399 | 399 | ||
400 | @@: |
400 | @@: |
401 | mov esi, [cmdline_len] |
401 | mov esi, [cmdline_len] |
402 | sub esi, ebx |
402 | sub esi, ebx |
403 | ;push 4 |
403 | ;push 4 |
404 | ;pop eax |
404 | ;pop eax |
405 | ; setting up text color scheme and attributes |
405 | ; setting up text color scheme and attributes |
406 | ; was 'xor ecx, ecx' |
406 | ; was 'xor ecx, ecx' |
407 | mov ecx, COLOR_TXT_NORMAL |
407 | mov ecx, COLOR_TXT_NORMAL |
408 | lea edx, [cmdline+ebx] |
408 | lea edx, [cmdline+ebx] |
409 | imul ebx, 6 |
409 | imul ebx, 6 |
410 | add ebx, cmdline_x_pos |
410 | add ebx, cmdline_x_pos |
411 | shl ebx, 16 |
411 | shl ebx, 16 |
412 | or ebx, cmdline_y_pos+1 |
412 | or ebx, cmdline_y_pos+1 |
413 | ; draw a text string in the window, color in ecx |
413 | ; draw a text string in the window, color in ecx |
414 | mcall 4 |
414 | mcall 4 |
415 | ret |
415 | ret |
416 | 416 | ||
417 | ;----------------------------------------------------------------------------- |
417 | ;----------------------------------------------------------------------------- |
418 | ; Working with messages |
418 | ; Working with messages |
419 | ; in: esi->ASCIIZ message |
419 | ; in: esi->ASCIIZ message |
420 | put_message_nodraw: |
420 | put_message_nodraw: |
421 | mov edx, [messages_pos] |
421 | mov edx, [messages_pos] |
422 | 422 | ||
423 | .m: |
423 | .m: |
424 | lea edi, [messages+edx] |
424 | lea edi, [messages+edx] |
425 | 425 | ||
426 | .l: |
426 | .l: |
427 | lodsb |
427 | lodsb |
428 | cmp al, 0 |
428 | cmp al, 0 |
429 | jz .done |
429 | jz .done |
430 | call test_scroll |
430 | call test_scroll |
431 | cmp al, 10 |
431 | cmp al, 10 |
432 | jz .newline |
432 | jz .newline |
433 | cmp al, '%' |
433 | cmp al, '%' |
434 | jnz @f |
434 | jnz @f |
435 | cmp dword [esp], z1 |
435 | cmp dword [esp], z1 |
436 | jnz .format |
436 | jnz .format |
437 | 437 | ||
438 | @@: |
438 | @@: |
439 | stosb |
439 | stosb |
440 | inc edx |
440 | inc edx |
441 | jmp .l |
441 | jmp .l |
442 | 442 | ||
443 | .newline: |
443 | .newline: |
444 | push edx |
444 | push edx |
445 | mov ecx, messages_width |
445 | mov ecx, messages_width |
446 | xor eax, eax |
446 | xor eax, eax |
447 | xchg eax, edx |
447 | xchg eax, edx |
448 | div ecx |
448 | div ecx |
449 | xchg eax, edx |
449 | xchg eax, edx |
450 | pop edx |
450 | pop edx |
451 | test eax, eax |
451 | test eax, eax |
452 | jz .m |
452 | jz .m |
453 | sub edx, eax |
453 | sub edx, eax |
454 | add edx, ecx |
454 | add edx, ecx |
455 | jmp .m |
455 | jmp .m |
456 | 456 | ||
457 | .done: |
457 | .done: |
458 | mov [messages_pos], edx |
458 | mov [messages_pos], edx |
459 | ret |
459 | ret |
460 | 460 | ||
461 | ; at this moment all format specs must be % |
461 | ; at this moment all format specs must be % |
462 | .format: |
462 | .format: |
463 | lodsb ; get |
463 | lodsb ; get |
464 | sub al, '0' |
464 | sub al, '0' |
465 | movzx ecx, al |
465 | movzx ecx, al |
466 | lodsb |
466 | lodsb |
467 | pop eax |
467 | pop eax |
468 | pop ebp |
468 | pop ebp |
469 | push eax |
469 | push eax |
470 | ; write number in ebp with ecx digits |
470 | ; write number in ebp with ecx digits |
471 | dec ecx |
471 | dec ecx |
472 | shl ecx, 2 |
472 | shl ecx, 2 |
473 | 473 | ||
474 | .writenibble: |
474 | .writenibble: |
475 | push ecx |
475 | push ecx |
476 | call test_scroll |
476 | call test_scroll |
477 | pop ecx |
477 | pop ecx |
478 | mov eax, ebp |
478 | mov eax, ebp |
479 | shr eax, cl |
479 | shr eax, cl |
480 | and al, 0xF |
480 | and al, 0xF |
481 | cmp al, 10 |
481 | cmp al, 10 |
482 | sbb al, 69h |
482 | sbb al, 69h |
483 | das |
483 | das |
484 | stosb |
484 | stosb |
485 | inc edx |
485 | inc edx |
486 | sub ecx, 4 |
486 | sub ecx, 4 |
487 | jns .writenibble |
487 | jns .writenibble |
488 | jmp .l |
488 | jmp .l |
489 | 489 | ||
490 | test_scroll: |
490 | test_scroll: |
491 | cmp edx, messages_width*messages_height |
491 | cmp edx, messages_width*messages_height |
492 | jnz .ret |
492 | jnz .ret |
493 | push esi |
493 | push esi |
494 | mov edi, messages |
494 | mov edi, messages |
495 | lea esi, [edi+messages_width] |
495 | lea esi, [edi+messages_width] |
496 | mov ecx, (messages_height-1)*messages_width/4 |
496 | mov ecx, (messages_height-1)*messages_width/4 |
497 | rep movsd |
497 | rep movsd |
498 | push eax |
498 | push eax |
499 | mov al, ' ' |
499 | mov al, ' ' |
500 | push edi |
500 | push edi |
501 | push messages_width |
501 | push messages_width |
502 | pop ecx |
502 | pop ecx |
503 | sub edx, ecx |
503 | sub edx, ecx |
504 | rep stosb |
504 | rep stosb |
505 | pop edi |
505 | pop edi |
506 | pop eax |
506 | pop eax |
507 | pop esi |
507 | pop esi |
508 | 508 | ||
509 | .ret: |
509 | .ret: |
510 | ret |
510 | ret |
511 | 511 | ||
512 | ;----------------------------------------------------------------------------- |
512 | ;----------------------------------------------------------------------------- |
513 | 513 | ||
514 | put_message: |
514 | put_message: |
515 | call put_message_nodraw |
515 | call put_message_nodraw |
516 | 516 | ||
517 | draw_messages: |
517 | draw_messages: |
518 | ;push 13 |
518 | ;push 13 |
519 | ;pop eax |
519 | ;pop eax |
520 | ;mov edx, 0xFFFFFF |
520 | ;mov edx, 0xFFFFFF |
521 | ;mov ebx, messages_x_pos*10000h+messages_x_size |
521 | ;mov ebx, messages_x_pos*10000h+messages_x_size |
522 | ;mov ecx, messages_y_pos*10000h+messages_y_size |
522 | ;mov ecx, messages_y_pos*10000h+messages_y_size |
523 | ; draw container rectanle/box |
523 | ; draw container rectanle/box |
524 | ; COLOR_BG_NORMAL was 0xFFFFFF |
524 | ; COLOR_BG_NORMAL was 0xFFFFFF |
525 | mcall 13, messages_x_pos*10000h+messages_x_size, messages_y_pos*10000h+messages_y_size, COLOR_BG_NORMAL |
525 | mcall 13, messages_x_pos*10000h+messages_x_size, messages_y_pos*10000h+messages_y_size, COLOR_BG_NORMAL |
526 | mov edx, messages |
526 | mov edx, messages |
527 | push messages_width |
527 | push messages_width |
528 | pop esi |
528 | pop esi |
529 | ; setting up text color scheme/attributes |
529 | ; setting up text color scheme/attributes |
530 | ; was 'xor ecx, ecx' |
530 | ; was 'xor ecx, ecx' |
531 | mov ecx, COLOR_TXT_NORMAL |
531 | mov ecx, COLOR_TXT_NORMAL |
532 | ;mov al, 4 |
532 | ;mov al, 4 |
533 | mov ebx, messages_x_pos*10000h+messages_y_pos |
533 | mov ebx, messages_x_pos*10000h+messages_y_pos |
534 | 534 | ||
535 | @@: |
535 | @@: |
536 | ; display text string in the window |
536 | ; display text string in the window |
537 | mcall 4 |
537 | mcall 4 |
538 | add edx, esi |
538 | add edx, esi |
539 | add ebx, 10 |
539 | add ebx, 10 |
540 | cmp edx, messages+messages_width*messages_height |
540 | cmp edx, messages+messages_width*messages_height |
541 | jb @b |
541 | jb @b |
542 | ret |
542 | ret |
543 | 543 | ||
544 | ;----------------------------------------------------------------------------- |
544 | ;----------------------------------------------------------------------------- |
545 | ; Show/hide cursor in command line |
545 | ; Show/hide cursor in command line |
546 | 546 | ||
547 | ; TODO: make it cursor.draw and cursor.hide ??? |
547 | ; TODO: make it cursor.draw and cursor.hide ??? |
548 | draw_cursor: |
548 | draw_cursor: |
549 | ;push 38 |
549 | ;push 38 |
550 | ;pop eax |
550 | ;pop eax |
551 | mov ecx, cmdline_y_pos*10001h+cmdline_y_size-1 |
551 | mov ecx, cmdline_y_pos*10001h+cmdline_y_size-1 |
552 | mov ebx, [cmdline_pos] |
552 | mov ebx, [cmdline_pos] |
553 | imul ebx, 6 |
553 | imul ebx, 6 |
554 | add ebx, cmdline_x_pos |
554 | add ebx, cmdline_x_pos |
555 | mov edx, ebx |
555 | mov edx, ebx |
556 | shl ebx, 16 |
556 | shl ebx, 16 |
557 | or ebx, edx |
557 | or ebx, edx |
558 | ; setting line color |
558 | ; setting line color |
559 | ; was 'xor edx, edx' - black |
559 | ; was 'xor edx, edx' - black |
560 | mov edx, COLOR_LINE |
560 | mov edx, COLOR_LINE |
561 | ; draw line, color in edx |
561 | ; draw line, color in edx |
562 | mcall 38 |
562 | mcall 38 |
563 | ret |
563 | ret |
564 | 564 | ||
565 | hide_cursor: |
565 | hide_cursor: |
566 | mov ebx, [cmdline_pos] |
566 | mov ebx, [cmdline_pos] |
567 | ;push 13 |
567 | ;push 13 |
568 | ;pop eax |
568 | ;pop eax |
569 | imul ebx, 6 |
569 | imul ebx, 6 |
570 | add ebx, cmdline_x_pos |
570 | add ebx, cmdline_x_pos |
571 | shl ebx, 16 |
571 | shl ebx, 16 |
572 | inc ebx |
572 | inc ebx |
573 | mov ecx, cmdline_y_pos*10000h + cmdline_y_size |
573 | mov ecx, cmdline_y_pos*10000h + cmdline_y_size |
574 | ; setting up rectangle color |
574 | ; setting up rectangle color |
575 | ; was 0xFFFFFF |
575 | ; was 0xFFFFFF |
576 | mov edx, COLOR_BG_NORMAL |
576 | mov edx, COLOR_BG_NORMAL |
577 | ; draw container rectangle/box |
577 | ; draw container rectangle/box |
578 | mcall 13 |
578 | mcall 13 |
579 | mov ebx, [cmdline_pos] |
579 | mov ebx, [cmdline_pos] |
580 | cmp ebx, [cmdline_len] |
580 | cmp ebx, [cmdline_len] |
581 | jae .ret |
581 | jae .ret |
582 | ;mov al, 4 |
582 | ;mov al, 4 |
583 | ; setting up text color scheme and attributes |
583 | ; setting up text color scheme and attributes |
584 | ;was 'xor ecx, ecx' |
584 | ;was 'xor ecx, ecx' |
585 | mov ecx, COLOR_TXT_NORMAL |
585 | mov ecx, COLOR_TXT_NORMAL |
586 | lea edx, [cmdline+ebx] |
586 | lea edx, [cmdline+ebx] |
587 | imul ebx, 6 |
587 | imul ebx, 6 |
588 | add ebx, cmdline_x_pos |
588 | add ebx, cmdline_x_pos |
589 | shl ebx, 16 |
589 | shl ebx, 16 |
590 | or ebx, cmdline_y_pos+1 |
590 | or ebx, cmdline_y_pos+1 |
591 | push 1 |
591 | push 1 |
592 | pop esi |
592 | pop esi |
593 | ; draw text string in the window |
593 | ; draw text string in the window |
594 | mcall 4 |
594 | mcall 4 |
595 | 595 | ||
596 | .ret: |
596 | .ret: |
597 | ret |
597 | ret |
598 | 598 | ||
599 | ;----------------------------------------------------------------------------- |
599 | ;----------------------------------------------------------------------------- |
600 | ; Draw program window title |
600 | ; Draw program window title |
601 | 601 | ||
602 | ; FIXME: something wrong here |
602 | ; FIXME: something wrong here |
603 | redraw_title: |
603 | redraw_title: |
604 | ;push 13 |
604 | ;push 13 |
605 | ;pop eax |
605 | ;pop eax |
606 | ;mov edx, 0xFFFFFF |
606 | ;mov edx, 0xFFFFFF |
607 | ;mov ebx, title_x_pos*10000h + data_x_pos+data_x_size-title_x_pos |
607 | ;mov ebx, title_x_pos*10000h + data_x_pos+data_x_size-title_x_pos |
608 | ;mov ecx, title_y_pos*10000h + title_y_size |
608 | ;mov ecx, title_y_pos*10000h + title_y_size |
609 | ; draw container rectangle/box |
609 | ; draw container rectangle/box |
610 | ; color was 0xFFFFFF |
610 | ; color was 0xFFFFFF |
611 | mcall 13, title_x_pos*10000h+data_x_pos+data_x_size-title_x_pos, title_y_pos*10000h+title_y_size, COLOR_BG_NORMAL |
611 | mcall 13, title_x_pos*10000h+data_x_pos+data_x_size-title_x_pos, title_y_pos*10000h+title_y_size, COLOR_BG_NORMAL |
612 | 612 | ||
613 | draw_title: |
613 | draw_title: |
614 | ;mov al, 38 |
614 | ;mov al, 38 |
615 | ;mov ebx, (data_x_pos-2)*10000h + title_x_pos-5 |
615 | ;mov ebx, (data_x_pos-2)*10000h + title_x_pos-5 |
616 | ;mov ecx, (title_y_pos+5)*10001h |
616 | ;mov ecx, (title_y_pos+5)*10001h |
617 | ; draw line with COLOR_LINE (in edx) |
617 | ; draw line with COLOR_LINE (in edx) |
618 | mcall 38, (data_x_pos-2)*10000h+title_x_pos-5, (title_y_pos+5)*10001h, COLOR_LINE |
618 | mcall 38, (data_x_pos-2)*10000h+title_x_pos-5, (title_y_pos+5)*10001h, COLOR_LINE |
619 | push NoPrgLoaded_len |
619 | push NoPrgLoaded_len |
620 | pop esi |
620 | pop esi |
621 | cmp [debuggee_pid], 0 |
621 | cmp [debuggee_pid], 0 |
622 | jz @f |
622 | jz @f |
623 | mov esi, [prgname_len] |
623 | mov esi, [prgname_len] |
624 | 624 | ||
625 | @@: |
625 | @@: |
626 | imul ebx, esi, 6 |
626 | imul ebx, esi, 6 |
627 | add ebx, title_x_pos+4 |
627 | add ebx, title_x_pos+4 |
628 | shl ebx, 16 |
628 | shl ebx, 16 |
629 | mov bx, data_x_pos+data_x_size-10-5-6*7 |
629 | mov bx, data_x_pos+data_x_size-10-5-6*7 |
630 | cmp [bSuspended], 0 |
630 | cmp [bSuspended], 0 |
631 | jz @f |
631 | jz @f |
632 | add ebx, 6 |
632 | add ebx, 6 |
633 | 633 | ||
634 | @@: |
634 | @@: |
635 | ; draw line with COLOR_LINE (in edx) |
635 | ; draw line with COLOR_LINE (in edx) |
636 | mcall |
636 | mcall |
637 | mov ebx, (data_x_pos+data_x_size-10+4)*0x10000 + data_x_pos+data_x_size+2 |
637 | mov ebx, (data_x_pos+data_x_size-10+4)*0x10000 + data_x_pos+data_x_size+2 |
638 | ; draw line with COLOR_LINE (in edx) |
638 | ; draw line with COLOR_LINE (in edx) |
639 | mcall |
639 | mcall |
640 | mov al, 4 |
640 | mov al, 4 |
641 | mov ebx, title_x_pos*10000h+title_y_pos |
641 | mov ebx, title_x_pos*10000h+title_y_pos |
642 | ; setting up text color scheme and attributes |
642 | ; setting up text color scheme and attributes |
643 | mov ecx, COLOR_TXT_NORMAL |
643 | mov ecx, COLOR_TXT_NORMAL |
644 | mov edx, NoPrgLoaded_str |
644 | mov edx, NoPrgLoaded_str |
645 | cmp [debuggee_pid], 0 |
645 | cmp [debuggee_pid], 0 |
646 | jz @f |
646 | jz @f |
647 | mov edx, [prgname_ptr] |
647 | mov edx, [prgname_ptr] |
648 | 648 | ||
649 | @@: |
649 | @@: |
650 | ; draw text string in the window |
650 | ; draw text string in the window |
651 | mcall |
651 | mcall |
652 | cmp [debuggee_pid], 0 |
652 | cmp [debuggee_pid], 0 |
653 | jz .nodebuggee |
653 | jz .nodebuggee |
654 | mov ebx, (data_x_pos+data_x_size-10-6*7)*10000h + title_y_pos |
654 | mov ebx, (data_x_pos+data_x_size-10-6*7)*10000h + title_y_pos |
655 | mov edx, aRunning |
655 | mov edx, aRunning |
656 | push 7 |
656 | push 7 |
657 | pop esi |
657 | pop esi |
658 | cmp [bSuspended], 0 |
658 | cmp [bSuspended], 0 |
659 | jz @f |
659 | jz @f |
660 | add ebx, 6*10000h |
660 | add ebx, 6*10000h |
661 | mov edx, aPaused |
661 | mov edx, aPaused |
662 | dec esi |
662 | dec esi |
663 | 663 | ||
664 | @@: |
664 | @@: |
665 | ; draw line with COLOR_LINE (in edx) in one case |
665 | ; draw line with COLOR_LINE (in edx) in one case |
666 | ; and draw text string with color COLOR_TXT_NORMAL (in ecx) in another |
666 | ; and draw text string with color COLOR_TXT_NORMAL (in ecx) in another |
667 | mcall |
667 | mcall |
668 | ret |
668 | ret |
669 | 669 | ||
670 | .nodebuggee: |
670 | .nodebuggee: |
671 | mov al, 38 |
671 | mov al, 38 |
672 | mov ebx, (data_x_pos+data_x_size-10-6*7-5)*0x10000 + data_x_pos+data_x_size+2 |
672 | mov ebx, (data_x_pos+data_x_size-10-6*7-5)*0x10000 + data_x_pos+data_x_size+2 |
673 | mov ecx, (title_y_pos+5)*10001h |
673 | mov ecx, (title_y_pos+5)*10001h |
674 | mov edx, COLOR_LINE |
674 | mov edx, COLOR_LINE |
675 | jmp @b |
675 | jmp @b |
676 | 676 | ||
677 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
677 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
678 | ;;;;;;;;;;;;;;;;;;; REGISTERS PANEL ;;;;;;;;;;;;;;;;;;;;;;;;;; |
678 | ;;;;;;;;;;;;;;;;;;; REGISTERS PANEL ;;;;;;;;;;;;;;;;;;;;;;;;;; |
679 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
679 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
680 | 680 | ||
681 | ;----------------------------------------------------------------------------- |
681 | ;----------------------------------------------------------------------------- |
682 | ; Display common register content |
682 | ; Display common register content |
683 | 683 | ||
684 | ; TODO: add format support (e.g. numerical value, or address offset/pointer) |
684 | ; TODO: add format support (e.g. numerical value, or address offset/pointer) |
685 | 685 | ||
686 | ; in: esi->value, edx->string, ecx = string length, ebx = coord |
686 | ; in: esi->value, edx->string, ecx = string length, ebx = coord |
687 | draw_register: |
687 | draw_register: |
688 | push edx |
688 | push edx |
689 | push ecx |
689 | push ecx |
690 | push esi |
690 | push esi |
691 | mov eax, esi |
691 | mov eax, esi |
692 | mov esi, ecx |
692 | mov esi, ecx |
693 | ; setting up registers colors |
693 | ; setting up registers colors |
694 | ; can be usual, inactive and changed |
694 | ; can be usual, inactive and changed |
695 | ; inactive color |
695 | ; inactive color |
696 | ; was 0x40808080 - grey |
696 | ; was 0x40808080 - grey |
697 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
697 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
698 | cmp [debuggee_pid], 0 |
698 | cmp [debuggee_pid], 0 |
699 | jz .cd |
699 | jz .cd |
700 | cmp [bSuspended], 0 |
700 | cmp [bSuspended], 0 |
701 | jz .cd |
701 | jz .cd |
702 | ; normal color |
702 | ; normal color |
703 | ; was 0x40000000 - black |
703 | ; was 0x40000000 - black |
704 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
704 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
705 | push edi |
705 | push edi |
706 | mov edi, [eax] |
706 | mov edi, [eax] |
707 | cmp dword [eax+oldcontext-context], edi |
707 | cmp dword [eax+oldcontext-context], edi |
708 | pop edi |
708 | pop edi |
709 | jz .cd |
709 | jz .cd |
710 | ; changed register color |
710 | ; changed register color |
711 | ; was 0x4000AA00 - green |
711 | ; was 0x4000AA00 - green |
712 | mov ecx, (COLOR_TXT_CHANGED or 0x40000000) |
712 | mov ecx, (COLOR_TXT_CHANGED or 0x40000000) |
713 | 713 | ||
714 | .cd: |
714 | .cd: |
715 | ;push 4 |
715 | ;push 4 |
716 | ;pop eax |
716 | ;pop eax |
717 | ; draw a text string in the window |
717 | ; draw a text string in the window |
718 | mcall 4 |
718 | mcall 4 |
719 | imul esi, 60000h |
719 | imul esi, 60000h |
720 | lea edx, [ebx+esi] |
720 | lea edx, [ebx+esi] |
721 | ;mov al, 47 |
721 | ;mov al, 47 |
722 | ;mov ebx, 80101h |
722 | ;mov ebx, 80101h |
723 | mov esi, ecx |
723 | mov esi, ecx |
724 | pop ecx |
724 | pop ecx |
725 | ; draw a number in the window |
725 | ; draw a number in the window |
726 | ; color in the esi (same value as for usual text) |
726 | ; color in the esi (same value as for usual text) |
727 | mcall 47, 80101h |
727 | mcall 47, 80101h |
728 | lea ebx, [edx+60000h*18] |
728 | lea ebx, [edx+60000h*18] |
729 | mov esi, ecx |
729 | mov esi, ecx |
730 | pop ecx |
730 | pop ecx |
731 | pop edx |
731 | pop edx |
732 | add edx, ecx |
732 | add edx, ecx |
733 | ret |
733 | ret |
734 | 734 | ||
735 | ;----------------------------------------------------------------------------- |
735 | ;----------------------------------------------------------------------------- |
736 | ; Display FPU register (ST0 - ST7) content |
736 | ; Display FPU register (ST0 - ST7) content |
737 | ; |
737 | ; |
738 | ; in: esi->value, edx->string, ecx = string length, ebx = coord |
738 | ; in: esi->value, edx->string, ecx = string length, ebx = coord |
739 | draw_fpu_register: |
739 | draw_fpu_register: |
740 | push edx |
740 | push edx |
741 | push ecx |
741 | push ecx |
742 | push esi |
742 | push esi |
743 | mov eax, esi |
743 | mov eax, esi |
744 | mov esi, ecx |
744 | mov esi, ecx |
745 | ; setting up registers color |
745 | ; setting up registers color |
746 | ; can be usual, inactive and changed |
746 | ; can be usual, inactive and changed |
747 | ; inactive color |
747 | ; inactive color |
748 | ; was 0x40808080 - grey |
748 | ; was 0x40808080 - grey |
749 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
749 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
750 | cmp [debuggee_pid], 0 |
750 | cmp [debuggee_pid], 0 |
751 | jz .cd |
751 | jz .cd |
752 | cmp [bSuspended], 0 |
752 | cmp [bSuspended], 0 |
753 | jz .cd |
753 | jz .cd |
754 | ; normal color |
754 | ; normal color |
755 | ; was 0x40000000 - black |
755 | ; was 0x40000000 - black |
756 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
756 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
757 | push edi |
757 | push edi |
758 | mov edi, [eax] |
758 | mov edi, [eax] |
759 | cmp dword [eax+oldcontext-context], edi |
759 | cmp dword [eax+oldcontext-context], edi |
760 | pop edi |
760 | pop edi |
761 | jnz .scol |
761 | jnz .scol |
762 | push edi |
762 | push edi |
763 | mov edi, [eax+4] |
763 | mov edi, [eax+4] |
764 | cmp dword [eax+oldcontext-context+4], edi |
764 | cmp dword [eax+oldcontext-context+4], edi |
765 | pop edi |
765 | pop edi |
766 | jz .cd |
766 | jz .cd |
767 | 767 | ||
768 | .scol: |
768 | .scol: |
769 | ; changed register color |
769 | ; changed register color |
770 | ; was 0x4000AA00 - green |
770 | ; was 0x4000AA00 - green |
771 | mov ecx, (COLOR_TXT_CHANGED or 0x40000000) |
771 | mov ecx, (COLOR_TXT_CHANGED or 0x40000000) |
772 | 772 | ||
773 | .cd: |
773 | .cd: |
774 | ;push 4 |
774 | ;push 4 |
775 | ;pop eax |
775 | ;pop eax |
776 | ; draw a text string in the window |
776 | ; draw a text string in the window |
777 | mcall 4 |
777 | mcall 4 |
778 | imul esi, 60000h |
778 | imul esi, 60000h |
779 | lea edx, [ebx+esi] |
779 | lea edx, [ebx+esi] |
780 | ;mov al, 47 |
780 | ;mov al, 47 |
781 | ;mov ebx, 40100101h ; [20] show 16 chars set [30] bit - qword |
781 | ;mov ebx, 40100101h ; [20] show 16 chars set [30] bit - qword |
782 | mov esi, ecx |
782 | mov esi, ecx |
783 | pop ecx |
783 | pop ecx |
784 | ; draw a number in the window |
784 | ; draw a number in the window |
785 | ; color is the same as for previous text draw function |
785 | ; color is the same as for previous text draw function |
786 | ; ebx : [20] show 16 chars set [30] bit - qword |
786 | ; ebx : [20] show 16 chars set [30] bit - qword |
787 | mcall 47, 40100101h |
787 | mcall 47, 40100101h |
788 | lea ebx, [edx+60000h*18] |
788 | lea ebx, [edx+60000h*18] |
789 | mov esi, ecx |
789 | mov esi, ecx |
790 | pop ecx |
790 | pop ecx |
791 | pop edx |
791 | pop edx |
792 | add edx, ecx |
792 | add edx, ecx |
793 | ret |
793 | ret |
794 | 794 | ||
795 | ;----------------------------------------------------------------------------- |
795 | ;----------------------------------------------------------------------------- |
796 | ; Show FPU MMX register content |
796 | ; Show FPU MMX register content |
797 | ; |
797 | ; |
798 | ; in: esi->value, edx->string, ecx = string length, ebx = coord |
798 | ; in: esi->value, edx->string, ecx = string length, ebx = coord |
799 | draw_mmx_register: |
799 | draw_mmx_register: |
800 | push edx |
800 | push edx |
801 | push ecx |
801 | push ecx |
802 | push esi |
802 | push esi |
803 | mov eax, esi |
803 | mov eax, esi |
804 | mov esi, ecx |
804 | mov esi, ecx |
805 | ; setting up registers color |
805 | ; setting up registers color |
806 | ; can be usual, inactive and changed |
806 | ; can be usual, inactive and changed |
807 | ; inactive color |
807 | ; inactive color |
808 | ; was 0x40808080 - grey |
808 | ; was 0x40808080 - grey |
809 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
809 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
810 | cmp [debuggee_pid], 0 |
810 | cmp [debuggee_pid], 0 |
811 | jz .cd |
811 | jz .cd |
812 | cmp [bSuspended], 0 |
812 | cmp [bSuspended], 0 |
813 | jz .cd |
813 | jz .cd |
814 | ; normal color |
814 | ; normal color |
815 | ; was 0x40000000 - black |
815 | ; was 0x40000000 - black |
816 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
816 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
817 | push edi |
817 | push edi |
818 | mov edi, [eax] |
818 | mov edi, [eax] |
819 | cmp dword [eax+oldcontext-context], edi |
819 | cmp dword [eax+oldcontext-context], edi |
820 | pop edi |
820 | pop edi |
821 | jnz .scol |
821 | jnz .scol |
822 | push edi |
822 | push edi |
823 | mov edi, [eax+4] |
823 | mov edi, [eax+4] |
824 | cmp dword [eax+oldcontext-context+4], edi |
824 | cmp dword [eax+oldcontext-context+4], edi |
825 | pop edi |
825 | pop edi |
826 | jz .cd |
826 | jz .cd |
827 | 827 | ||
828 | .scol: |
828 | .scol: |
829 | ; changed color |
829 | ; changed color |
830 | ; was 0x4000AA00 - green |
830 | ; was 0x4000AA00 - green |
831 | mov ecx, (COLOR_TXT_CHANGED or 0x40000000) |
831 | mov ecx, (COLOR_TXT_CHANGED or 0x40000000) |
832 | 832 | ||
833 | .cd: |
833 | .cd: |
834 | ;push 4 |
834 | ;push 4 |
835 | ;pop eax |
835 | ;pop eax |
836 | ; draw a text string in the window |
836 | ; draw a text string in the window |
837 | mcall 4 |
837 | mcall 4 |
838 | imul esi, 60000h |
838 | imul esi, 60000h |
839 | lea edx, [ebx+esi] |
839 | lea edx, [ebx+esi] |
840 | ;mov al, 47 |
840 | ;mov al, 47 |
841 | ;mov ebx, 40100101h ; [20] show 16 chars set [30] bit - qword |
841 | ;mov ebx, 40100101h ; [20] show 16 chars set [30] bit - qword |
842 | mov esi, ecx |
842 | mov esi, ecx |
843 | pop ecx |
843 | pop ecx |
844 | ; draw a number in the window |
844 | ; draw a number in the window |
845 | ; color is the same as for previous draw text function |
845 | ; color is the same as for previous draw text function |
846 | ; ebx : [20] show 16 chars set [30] bit - qword |
846 | ; ebx : [20] show 16 chars set [30] bit - qword |
847 | mcall 47, 40100101h |
847 | mcall 47, 40100101h |
848 | lea ebx, [edx+60000h*18] |
848 | lea ebx, [edx+60000h*18] |
849 | mov esi, ecx |
849 | mov esi, ecx |
850 | pop ecx |
850 | pop ecx |
851 | pop edx |
851 | pop edx |
852 | add edx, ecx |
852 | add edx, ecx |
853 | ret |
853 | ret |
854 | 854 | ||
855 | ; TODO add SSE registers |
855 | ; TODO add SSE registers |
856 | ; TODO add AVX registers |
856 | ; TODO add AVX registers |
857 | 857 | ||
858 | ;----------------------------------------------------------------------------- |
858 | ;----------------------------------------------------------------------------- |
859 | ; Display contents of EFLAGS register |
859 | ; Display contents of EFLAGS register |
860 | draw_flag: |
860 | draw_flag: |
861 | movzx edi, byte [edx+7] |
861 | movzx edi, byte [edx+7] |
862 | bt [_eflags], edi |
862 | bt [_eflags], edi |
863 | jc .on |
863 | jc .on |
864 | or byte [edx], 20h |
864 | or byte [edx], 20h |
865 | jmp .onoff |
865 | jmp .onoff |
866 | 866 | ||
867 | .on: |
867 | .on: |
868 | and byte [edx], not 20h |
868 | and byte [edx], not 20h |
869 | 869 | ||
870 | .onoff: |
870 | .onoff: |
871 | ; setting up registers colors |
871 | ; setting up registers colors |
872 | ; can be usual, inactive and changed |
872 | ; can be usual, inactive and changed |
873 | ; inactive color |
873 | ; inactive color |
874 | ; was 0x40808080 - grey |
874 | ; was 0x40808080 - grey |
875 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
875 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
876 | cmp [debuggee_pid], 0 |
876 | cmp [debuggee_pid], 0 |
877 | jz .doit |
877 | jz .doit |
878 | cmp [bSuspended], 0 |
878 | cmp [bSuspended], 0 |
879 | jz .doit |
879 | jz .doit |
880 | ; normal color |
880 | ; normal color |
881 | ; was 0x40000000 - black |
881 | ; was 0x40000000 - black |
882 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
882 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
883 | bt [_eflags], edi |
883 | bt [_eflags], edi |
884 | lahf |
884 | lahf |
885 | bt dword [_eflags + oldcontext - context], edi |
885 | bt dword [_eflags + oldcontext - context], edi |
886 | rcl ah, 1 |
886 | rcl ah, 1 |
887 | test ah, 3 |
887 | test ah, 3 |
888 | jp .doit |
888 | jp .doit |
889 | ; changed color |
889 | ; changed color |
890 | ; was 0x4000AA00 - green |
890 | ; was 0x4000AA00 - green |
891 | mov ecx, (COLOR_TXT_CHANGED or 0x40000000) |
891 | mov ecx, (COLOR_TXT_CHANGED or 0x40000000) |
892 | 892 | ||
893 | .doit: |
893 | .doit: |
894 | mov ah, 0 |
894 | mov ah, 0 |
895 | ; background color for text string or number |
895 | ; background color for text string or number |
896 | ; was 0xFFFFFF - white |
896 | ; was 0xFFFFFF - white |
897 | mov edi, COLOR_BG_NORMAL |
897 | mov edi, COLOR_BG_NORMAL |
898 | ; draw a text string in the window in one case |
898 | ; draw a text string in the window in one case |
899 | ; and a number in another |
899 | ; and a number in another |
900 | ; color scheme same as for previously called function (was in ecx) |
900 | ; color scheme same as for previously called function (was in ecx) |
901 | mcall |
901 | mcall |
902 | ret |
902 | ret |
903 | 903 | ||
904 | ;----------------------------------------------------------------------------- |
904 | ;----------------------------------------------------------------------------- |
905 | ; Draw registers frame title |
905 | ; Draw registers frame title |
906 | 906 | ||
907 | ; Also show current register set (common + MMX, SSE or AVX) |
907 | ; Also show current register set (common + MMX, SSE or AVX) |
908 | draw_reg_title: |
908 | draw_reg_title: |
909 | ;push 4 |
909 | ;push 4 |
910 | ;pop eax |
910 | ;pop eax |
911 | ; setting up text backround color |
911 | ; setting up text backround color |
912 | ; was 0xFFFFFF - white |
912 | ; was 0xFFFFFF - white |
913 | mov edi, COLOR_BG_NORMAL |
913 | mov edi, COLOR_BG_NORMAL |
914 | ; setting up text color |
914 | ; setting up text color |
915 | ; can be usual and inactive |
915 | ; can be usual and inactive |
916 | ; normal color |
916 | ; normal color |
917 | ; was 0x40000000 - black |
917 | ; was 0x40000000 - black |
918 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
918 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
919 | mov esi, 7 |
919 | mov esi, 7 |
920 | cmp [reg_mode], REG_MODE_CPU |
920 | cmp [reg_mode], REG_MODE_CPU |
921 | jz @f |
921 | jz @f |
922 | ; inactive color |
922 | ; inactive color |
923 | ; was 0x40808080 - grey |
923 | ; was 0x40808080 - grey |
924 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
924 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
925 | 925 | ||
926 | @@: |
926 | @@: |
927 | mov edx, aMain |
927 | mov edx, aMain |
928 | ;mov ebx, (registers_x_pos+4)*10000h + registers_y_pos+2 |
928 | ;mov ebx, (registers_x_pos+4)*10000h + registers_y_pos+2 |
929 | ; draw a text string in the window |
929 | ; draw a text string in the window |
930 | mcall 4, (registers_x_pos+4)*10000h+registers_y_pos+2 |
930 | mcall 4, (registers_x_pos+4)*10000h+registers_y_pos+2 |
931 | cmp [reg_mode], REG_MODE_SSE |
931 | cmp [reg_mode], REG_MODE_SSE |
932 | jz @f |
932 | jz @f |
933 | ; inactive color |
933 | ; inactive color |
934 | ; was 0x40808080 - grey |
934 | ; was 0x40808080 - grey |
935 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
935 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
936 | 936 | ||
937 | @@: |
937 | @@: |
938 | mov edx, aSSE |
938 | mov edx, aSSE |
939 | ;mov ebx, (registers_x_pos+46)*10000h + registers_y_pos+2 |
939 | ;mov ebx, (registers_x_pos+46)*10000h + registers_y_pos+2 |
940 | ; draw a text string in the window |
940 | ; draw a text string in the window |
941 | mcall 4, (registers_x_pos+46)*10000h+registers_y_pos+2 |
941 | mcall 4, (registers_x_pos+46)*10000h+registers_y_pos+2 |
942 | cmp [reg_mode], REG_MODE_AVX |
942 | cmp [reg_mode], REG_MODE_AVX |
943 | jz @f |
943 | jz @f |
944 | ; inactive color |
944 | ; inactive color |
945 | ; was 0x40808080 - grey |
945 | ; was 0x40808080 - grey |
946 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
946 | mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) |
947 | 947 | ||
948 | @@: |
948 | @@: |
949 | mov edx, aAVX |
949 | mov edx, aAVX |
950 | ;mov ebx, (registers_x_pos+88)*10000h + registers_y_pos+2 |
950 | ;mov ebx, (registers_x_pos+88)*10000h + registers_y_pos+2 |
951 | ; draw a text string in the window |
951 | ; draw a text string in the window |
952 | mcall 4, (registers_x_pos+88)*10000h+registers_y_pos+2 |
952 | mcall 4, (registers_x_pos+88)*10000h+registers_y_pos+2 |
953 | ret |
953 | ret |
954 | 954 | ||
955 | ;----------------------------------------------------------------------------- |
955 | ;----------------------------------------------------------------------------- |
956 | ; Display common registers set + MMX + FPU |
956 | ; Display common registers set + MMX + FPU |
957 | 957 | ||
958 | draw_main_registers: |
958 | draw_main_registers: |
959 | ;push 13 |
959 | ;push 13 |
960 | ;pop eax |
960 | ;pop eax |
961 | ;mov edx, 0xFFFFFF |
961 | ;mov edx, 0xFFFFFF |
962 | ;mov ebx, (registers_x_pos-1)*10000h + (registers_x_size+2) |
962 | ;mov ebx, (registers_x_pos-1)*10000h + (registers_x_size+2) |
963 | ;mov ecx, (registers_y_pos-1)*10000h + (registers_y_size+2) |
963 | ;mov ecx, (registers_y_pos-1)*10000h + (registers_y_size+2) |
964 | ; draw container rectangle/box with COLOR_BG_NORMAL |
964 | ; draw container rectangle/box with COLOR_BG_NORMAL |
965 | ; color in edx, was 0xFFFFFF - white |
965 | ; color in edx, was 0xFFFFFF - white |
966 | mcall 13, (registers_x_pos-1)*10000h+(registers_x_size+2), (registers_y_pos-1)*10000h+(registers_y_size+2), COLOR_BG_NORMAL |
966 | mcall 13, (registers_x_pos-1)*10000h+(registers_x_size+2), (registers_y_pos-1)*10000h+(registers_y_size+2), COLOR_BG_NORMAL |
967 | 967 | ||
968 | ; TODO: add support for FPU ST0-ST7 registers |
968 | ; TODO: add support for FPU ST0-ST7 registers |
969 | .redraw: |
969 | .redraw: |
970 | ; setting up background color for text and numbers output |
970 | ; setting up background color for text and numbers output |
971 | ; was 0xFFFFFF - white |
971 | ; was 0xFFFFFF - white |
972 | mov edi, COLOR_BG_NORMAL |
972 | mov edi, COLOR_BG_NORMAL |
973 | mov esi, _eax |
973 | mov esi, _eax |
974 | push 4 |
974 | push 4 |
975 | pop ecx |
975 | pop ecx |
976 | mov edx, regs_strs |
976 | mov edx, regs_strs |
977 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+22 |
977 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+22 |
978 | call draw_register |
978 | call draw_register |
979 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+32 |
979 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+32 |
980 | add esi, _ebx-_eax |
980 | add esi, _ebx-_eax |
981 | call draw_register |
981 | call draw_register |
982 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+42 |
982 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+42 |
983 | add esi, _ecx-_ebx |
983 | add esi, _ecx-_ebx |
984 | call draw_register |
984 | call draw_register |
985 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+52 |
985 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+52 |
986 | add esi, _edx-_ecx |
986 | add esi, _edx-_ecx |
987 | call draw_register |
987 | call draw_register |
988 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+62 |
988 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+62 |
989 | add esi, _esi-_edx |
989 | add esi, _esi-_edx |
990 | call draw_register |
990 | call draw_register |
991 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+72 |
991 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+72 |
992 | add esi, _edi-_esi |
992 | add esi, _edi-_esi |
993 | call draw_register |
993 | call draw_register |
994 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+82 |
994 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+82 |
995 | add esi, _ebp-_edi |
995 | add esi, _ebp-_edi |
996 | call draw_register |
996 | call draw_register |
997 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+92 |
997 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+92 |
998 | add esi, _esp-_ebp |
998 | add esi, _esp-_ebp |
999 | call draw_register |
999 | call draw_register |
1000 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+102 |
1000 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+102 |
1001 | add esi, _eip-_esp |
1001 | add esi, _eip-_esp |
1002 | call draw_register |
1002 | call draw_register |
1003 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+112 |
1003 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+112 |
1004 | push cx |
1004 | push cx |
1005 | mov cl, 7 |
1005 | mov cl, 7 |
1006 | add esi, _eflags-_eip |
1006 | add esi, _eflags-_eip |
1007 | call draw_register |
1007 | call draw_register |
1008 | pop cx |
1008 | pop cx |
1009 | 1009 | ||
1010 | ; MMX registers |
1010 | ; MMX registers |
1011 | mov edx, mmx_strs |
1011 | mov edx, mmx_strs |
1012 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+142 |
1012 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+142 |
1013 | mov esi, _mm0 |
1013 | mov esi, _mm0 |
1014 | call draw_mmx_register |
1014 | call draw_mmx_register |
1015 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+152 |
1015 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+152 |
1016 | add esi, _mm1-_mm0 |
1016 | add esi, _mm1-_mm0 |
1017 | call draw_mmx_register |
1017 | call draw_mmx_register |
1018 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+162 |
1018 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+162 |
1019 | add esi, _mm2-_mm1 |
1019 | add esi, _mm2-_mm1 |
1020 | call draw_mmx_register |
1020 | call draw_mmx_register |
1021 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+172 |
1021 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+172 |
1022 | add esi, _mm3-_mm2 |
1022 | add esi, _mm3-_mm2 |
1023 | call draw_mmx_register |
1023 | call draw_mmx_register |
1024 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+182 |
1024 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+182 |
1025 | add esi, _mm4-_mm3 |
1025 | add esi, _mm4-_mm3 |
1026 | call draw_mmx_register |
1026 | call draw_mmx_register |
1027 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+192 |
1027 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+192 |
1028 | add esi, _mm5-_mm4 |
1028 | add esi, _mm5-_mm4 |
1029 | call draw_mmx_register |
1029 | call draw_mmx_register |
1030 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+202 |
1030 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+202 |
1031 | add esi, _mm6-_mm5 |
1031 | add esi, _mm6-_mm5 |
1032 | call draw_mmx_register |
1032 | call draw_mmx_register |
1033 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+212 |
1033 | mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+212 |
1034 | add esi, _mm7-_mm6 |
1034 | add esi, _mm7-_mm6 |
1035 | call draw_mmx_register |
1035 | call draw_mmx_register |
1036 | ;mov al, 4 |
1036 | ;mov al, 4 |
1037 | ; setting up text color |
1037 | ; setting up text color |
1038 | ; inactive color |
1038 | ; inactive color |
1039 | ; was 0x808080 - grey |
1039 | ; was 0x808080 - grey |
1040 | mov ecx, COLOR_TXT_INACTIVE |
1040 | mov ecx, COLOR_TXT_INACTIVE |
1041 | cmp [debuggee_pid], 0 |
1041 | cmp [debuggee_pid], 0 |
1042 | jz @f |
1042 | jz @f |
1043 | cmp [bSuspended], 0 |
1043 | cmp [bSuspended], 0 |
1044 | jz @f |
1044 | jz @f |
1045 | xor ecx, ecx |
1045 | xor ecx, ecx |
1046 | 1046 | ||
1047 | @@: |
1047 | @@: |
1048 | mov edx, aColon |
1048 | mov edx, aColon |
1049 | xor esi, esi |
1049 | xor esi, esi |
1050 | inc esi |
1050 | inc esi |
1051 | mov ecx, COLOR_TXT_INACTIVE |
1051 | mov ecx, COLOR_TXT_INACTIVE |
1052 | ;mov ebx, (registers_x_pos+10)*10000h + registers_y_pos+122 |
1052 | ;mov ebx, (registers_x_pos+10)*10000h + registers_y_pos+122 |
1053 | ; draw a text string in the window, color in ecx |
1053 | ; draw a text string in the window, color in ecx |
1054 | mcall 4, (registers_x_pos+10)*10000h+registers_y_pos+122 |
1054 | mcall 4, (registers_x_pos+10)*10000h+registers_y_pos+122 |
1055 | mov edx, flags |
1055 | mov edx, flags |
1056 | 1056 | ||
1057 | @@: |
1057 | @@: |
1058 | add ebx, 2*6*10000h |
1058 | add ebx, 2*6*10000h |
1059 | call draw_flag |
1059 | call draw_flag |
1060 | inc edx |
1060 | inc edx |
1061 | cmp dl, flags_bits and 0xFF |
1061 | cmp dl, flags_bits and 0xFF |
1062 | jnz @b |
1062 | jnz @b |
1063 | ret |
1063 | ret |
1064 | 1064 | ||
1065 | ;----------------------------------------------------------------------------- |
1065 | ;----------------------------------------------------------------------------- |
1066 | ; Draw SSE registers set |
1066 | ; Draw SSE registers set |
1067 | 1067 | ||
1068 | draw_sse_registers: |
1068 | draw_sse_registers: |
1069 | .redraw: |
1069 | .redraw: |
1070 | ret |
1070 | ret |
1071 | 1071 | ||
1072 | ;----------------------------------------------------------------------------- |
1072 | ;----------------------------------------------------------------------------- |
1073 | ; Draw AVX registers set |
1073 | ; Draw AVX registers set |
1074 | 1074 | ||
1075 | draw_avx_registers: |
1075 | draw_avx_registers: |
1076 | .redraw: |
1076 | .redraw: |
1077 | ret |
1077 | ret |
1078 | 1078 | ||
1079 | ;----------------------------------------------------------------------------- |
1079 | ;----------------------------------------------------------------------------- |
1080 | ; Draw all registers sets |
1080 | ; Draw all registers sets |
1081 | draw_registers: |
1081 | draw_registers: |
1082 | call draw_reg_title |
1082 | call draw_reg_title |
1083 | cmp [reg_mode], REG_MODE_CPU |
1083 | cmp [reg_mode], REG_MODE_CPU |
1084 | jnz @f |
1084 | jnz @f |
1085 | call draw_main_registers |
1085 | call draw_main_registers |
1086 | ret |
1086 | ret |
1087 | 1087 | ||
1088 | @@: |
1088 | @@: |
1089 | cmp [reg_mode], REG_MODE_SSE |
1089 | cmp [reg_mode], REG_MODE_SSE |
1090 | jnz @f |
1090 | jnz @f |
1091 | call draw_sse_registers |
1091 | call draw_sse_registers |
1092 | ret |
1092 | ret |
1093 | 1093 | ||
1094 | @@: |
1094 | @@: |
1095 | call draw_avx_registers |
1095 | call draw_avx_registers |
1096 | ret |
1096 | ret |
1097 | 1097 | ||
1098 | .redraw: |
1098 | .redraw: |
1099 | call draw_reg_title |
1099 | call draw_reg_title |
1100 | cmp [reg_mode], REG_MODE_CPU |
1100 | cmp [reg_mode], REG_MODE_CPU |
1101 | jnz @f |
1101 | jnz @f |
1102 | call draw_main_registers.redraw |
1102 | call draw_main_registers.redraw |
1103 | ret |
1103 | ret |
1104 | 1104 | ||
1105 | @@: |
1105 | @@: |
1106 | cmp [reg_mode], REG_MODE_SSE |
1106 | cmp [reg_mode], REG_MODE_SSE |
1107 | jnz @f |
1107 | jnz @f |
1108 | call draw_sse_registers.redraw |
1108 | call draw_sse_registers.redraw |
1109 | ret |
1109 | ret |
1110 | 1110 | ||
1111 | @@: |
1111 | @@: |
1112 | call draw_avx_registers.redraw |
1112 | call draw_avx_registers.redraw |
1113 | ret |
1113 | ret |
1114 | 1114 | ||
1115 | ;----------------------------------------------------------------------------- |
1115 | ;----------------------------------------------------------------------------- |
1116 | ; Display memory dump |
1116 | ; Display memory dump |
1117 | 1117 | ||
1118 | draw_dump: |
1118 | draw_dump: |
1119 | ;push 13 |
1119 | ;push 13 |
1120 | ;pop eax |
1120 | ;pop eax |
1121 | ;mov edx, 0xFFFFFF |
1121 | ;mov edx, 0xFFFFFF |
1122 | ;mov ebx, data_x_pos*10000h + data_x_size |
1122 | ;mov ebx, data_x_pos*10000h + data_x_size |
1123 | ;mov ecx, dump_y_pos*10000h + dump_y_size |
1123 | ;mov ecx, dump_y_pos*10000h + dump_y_size |
1124 | ; draw container rectangle/box in the window |
1124 | ; draw container rectangle/box in the window |
1125 | ; with color in COLOR_BG_NORMAL (was 0xFFFFFF - white) |
1125 | ; with color in COLOR_BG_NORMAL (was 0xFFFFFF - white) |
1126 | mcall 13, data_x_pos*10000h+data_x_size, dump_y_pos*10000h+dump_y_size, COLOR_BG_NORMAL |
1126 | mcall 13, data_x_pos*10000h+data_x_size, dump_y_pos*10000h+dump_y_size, COLOR_BG_NORMAL |
1127 | 1127 | ||
1128 | .redraw: |
1128 | .redraw: |
1129 | ; addresses |
1129 | ; addresses |
1130 | ;mov al, 47 |
1130 | ;mov al, 47 |
1131 | mov ebx, 80100h |
1131 | mov ebx, 80100h |
1132 | mov edx, data_x_pos*10000h + dump_y_pos |
1132 | mov edx, data_x_pos*10000h + dump_y_pos |
1133 | mov ecx, [dumppos] |
1133 | mov ecx, [dumppos] |
1134 | ; background color for text string |
1134 | ; background color for text string |
1135 | ; was 0xFFFFFF - white |
1135 | ; was 0xFFFFFF - white |
1136 | mov edi, COLOR_BG_NORMAL |
1136 | mov edi, COLOR_BG_NORMAL |
1137 | ; inactive color |
1137 | ; inactive color |
1138 | ; was 0x40808080 - grey |
1138 | ; was 0x40808080 - grey |
1139 | mov esi, (COLOR_TXT_INACTIVE or 0x40000000) |
1139 | mov esi, (COLOR_TXT_INACTIVE or 0x40000000) |
1140 | cmp [debuggee_pid], 0 |
1140 | cmp [debuggee_pid], 0 |
1141 | jz @f |
1141 | jz @f |
1142 | cmp [bSuspended], 0 |
1142 | cmp [bSuspended], 0 |
1143 | jz @f |
1143 | jz @f |
1144 | ; normal color |
1144 | ; normal color |
1145 | ; was 0x40000000 - black |
1145 | ; was 0x40000000 - black |
1146 | mov esi, (COLOR_TXT_NORMAL or 0x40000000) |
1146 | mov esi, (COLOR_TXT_NORMAL or 0x40000000) |
1147 | 1147 | ||
1148 | @@: |
1148 | @@: |
1149 | ; draw a number in the window, color in esi |
1149 | ; draw a number in the window, color in esi |
1150 | mcall 47 |
1150 | mcall 47 |
1151 | add ecx, 10h |
1151 | add ecx, 10h |
1152 | add edx, 10 |
1152 | add edx, 10 |
1153 | cmp dl, dump_y_pos + dump_y_size |
1153 | cmp dl, dump_y_pos + dump_y_size |
1154 | jb @b |
1154 | jb @b |
1155 | ; hex dump of data |
1155 | ; hex dump of data |
1156 | mov ecx, dumpdata |
1156 | mov ecx, dumpdata |
1157 | push ecx |
1157 | push ecx |
1158 | xor ebx, ebx |
1158 | xor ebx, ebx |
1159 | mov edx, (data_x_pos+12*6)*10000h + dump_y_pos |
1159 | mov edx, (data_x_pos+12*6)*10000h + dump_y_pos |
1160 | cmp [dumpread], ebx |
1160 | cmp [dumpread], ebx |
1161 | jz .hexdumpdone1 |
1161 | jz .hexdumpdone1 |
1162 | 1162 | ||
1163 | .hexdumploop1: |
1163 | .hexdumploop1: |
1164 | push ebx |
1164 | push ebx |
1165 | mov ebx, 20101h |
1165 | mov ebx, 20101h |
1166 | ; draw a number in the window, color in esi |
1166 | ; draw a number in the window, color in esi |
1167 | mcall |
1167 | mcall |
1168 | pop ebx |
1168 | pop ebx |
1169 | add edx, 3*6*10000h |
1169 | add edx, 3*6*10000h |
1170 | inc ecx |
1170 | inc ecx |
1171 | inc ebx |
1171 | inc ebx |
1172 | test bl, 15 |
1172 | test bl, 15 |
1173 | jz .16 |
1173 | jz .16 |
1174 | test bl, 7 |
1174 | test bl, 7 |
1175 | jnz @f |
1175 | jnz @f |
1176 | add edx, 2*6*10000h - 10 + 6*(3*10h+2)*10000h |
1176 | add edx, 2*6*10000h - 10 + 6*(3*10h+2)*10000h |
1177 | 1177 | ||
1178 | .16: |
1178 | .16: |
1179 | add edx, 10 - 6*(3*10h+2)*10000h |
1179 | add edx, 10 - 6*(3*10h+2)*10000h |
1180 | 1180 | ||
1181 | @@: |
1181 | @@: |
1182 | cmp ebx, [dumpread] |
1182 | cmp ebx, [dumpread] |
1183 | jb .hexdumploop1 |
1183 | jb .hexdumploop1 |
1184 | 1184 | ||
1185 | .hexdumpdone1: |
1185 | .hexdumpdone1: |
1186 | mov al, 4 |
1186 | mov al, 4 |
1187 | ; copy color value from esi to ecx |
1187 | ; copy color value from esi to ecx |
1188 | ; to draw text string with 'mcall 4' |
1188 | ; to draw text string with 'mcall 4' |
1189 | mov ecx, esi |
1189 | mov ecx, esi |
1190 | xchg ebx, edx |
1190 | xchg ebx, edx |
1191 | push 2 |
1191 | push 2 |
1192 | pop esi |
1192 | pop esi |
1193 | 1193 | ||
1194 | .hexdumploop2: |
1194 | .hexdumploop2: |
1195 | cmp edx, dump_height*10h |
1195 | cmp edx, dump_height*10h |
1196 | jae .hexdumpdone2 |
1196 | jae .hexdumpdone2 |
1197 | push edx |
1197 | push edx |
1198 | mov edx, aQuests |
1198 | mov edx, aQuests |
1199 | ; draw text string with color in ecx, copied from esi |
1199 | ; draw text string with color in ecx, copied from esi |
1200 | mcall |
1200 | mcall |
1201 | pop edx |
1201 | pop edx |
1202 | add ebx, 3*6*10000h |
1202 | add ebx, 3*6*10000h |
1203 | inc edx |
1203 | inc edx |
1204 | test dl, 15 |
1204 | test dl, 15 |
1205 | jz .16x |
1205 | jz .16x |
1206 | test dl, 7 |
1206 | test dl, 7 |
1207 | jnz .hexdumploop2 |
1207 | jnz .hexdumploop2 |
1208 | add ebx, 2*6*10000h - 10 + 6*(3*10h+2)*10000h |
1208 | add ebx, 2*6*10000h - 10 + 6*(3*10h+2)*10000h |
1209 | 1209 | ||
1210 | .16x: |
1210 | .16x: |
1211 | add ebx, 10 - 6*(3*10h+2)*10000h |
1211 | add ebx, 10 - 6*(3*10h+2)*10000h |
1212 | jmp .hexdumploop2 |
1212 | jmp .hexdumploop2 |
1213 | 1213 | ||
1214 | .hexdumpdone2: |
1214 | .hexdumpdone2: |
1215 | dec esi |
1215 | dec esi |
1216 | ; colon, minus signs |
1216 | ; colon, minus signs |
1217 | mov ebx, (data_x_pos+8*6)*10000h + dump_y_pos |
1217 | mov ebx, (data_x_pos+8*6)*10000h + dump_y_pos |
1218 | mov edx, aColon |
1218 | mov edx, aColon |
1219 | 1219 | ||
1220 | @@: |
1220 | @@: |
1221 | mcall |
1221 | mcall |
1222 | add ebx, 10 |
1222 | add ebx, 10 |
1223 | cmp bl, dump_y_pos+dump_height*10 |
1223 | cmp bl, dump_y_pos+dump_height*10 |
1224 | jb @b |
1224 | jb @b |
1225 | mov ebx, (data_x_pos+(12+3*8)*6)*10000h + dump_y_pos |
1225 | mov ebx, (data_x_pos+(12+3*8)*6)*10000h + dump_y_pos |
1226 | mov edx, aMinus |
1226 | mov edx, aMinus |
1227 | 1227 | ||
1228 | @@: |
1228 | @@: |
1229 | mcall |
1229 | mcall |
1230 | add ebx, 10 |
1230 | add ebx, 10 |
1231 | cmp bl, dump_y_pos+dump_height*10 |
1231 | cmp bl, dump_y_pos+dump_height*10 |
1232 | jb @b |
1232 | jb @b |
1233 | ; ASCII data |
1233 | ; ASCII data |
1234 | mov ebx, (data_x_pos+(12+3*10h+2+2)*6)*10000h + dump_y_pos |
1234 | mov ebx, (data_x_pos+(12+3*10h+2+2)*6)*10000h + dump_y_pos |
1235 | pop edx |
1235 | pop edx |
1236 | push dump_height*10h |
1236 | push dump_height*10h |
1237 | 1237 | ||
1238 | .asciiloop: |
1238 | .asciiloop: |
1239 | push edx |
1239 | push edx |
1240 | cmp byte [edx], 20h |
1240 | cmp byte [edx], 20h |
1241 | jae @f |
1241 | jae @f |
1242 | mov edx, aPoint |
1242 | mov edx, aPoint |
1243 | 1243 | ||
1244 | @@: |
1244 | @@: |
1245 | ; draw a text string in the window, color in ecx |
1245 | ; draw a text string in the window, color in ecx |
1246 | mcall |
1246 | mcall |
1247 | pop edx |
1247 | pop edx |
1248 | inc edx |
1248 | inc edx |
1249 | add ebx, 6*10000h |
1249 | add ebx, 6*10000h |
1250 | dec dword [esp] |
1250 | dec dword [esp] |
1251 | jz .asciidone |
1251 | jz .asciidone |
1252 | test byte [esp], 15 |
1252 | test byte [esp], 15 |
1253 | jnz .asciiloop |
1253 | jnz .asciiloop |
1254 | add ebx, 10 - 6*10h*10000h |
1254 | add ebx, 10 - 6*10h*10000h |
1255 | jmp .asciiloop |
1255 | jmp .asciiloop |
1256 | 1256 | ||
1257 | .asciidone: |
1257 | .asciidone: |
1258 | pop ecx |
1258 | pop ecx |
1259 | ret |
1259 | ret |
1260 | 1260 | ||
1261 | ;----------------------------------------------------------------------------- |
1261 | ;----------------------------------------------------------------------------- |
1262 | ; Display disassembled code |
1262 | ; Display disassembled code |
1263 | 1263 | ||
1264 | ; @@@@@ WAS: |
1264 | ; @@@@@ WAS: |
1265 | ; redraw_disasm: |
1265 | ; redraw_disasm: |
1266 | ; push 13 |
1266 | ; push 13 |
1267 | ; pop eax |
1267 | ; pop eax |
1268 | ; mov edx, 0xFFFFFF |
1268 | ; mov edx, 0xFFFFFF |
1269 | ; mov ebx, data_x_pos*10000h + data_x_size |
1269 | ; mov ebx, data_x_pos*10000h + data_x_size |
1270 | ; mov ecx, (disasm_y_pos-1)*10000h + (disasm_y_size+1) |
1270 | ; mov ecx, (disasm_y_pos-1)*10000h + (disasm_y_size+1) |
1271 | ; mcall |
1271 | ; mcall |
1272 | ; |
1272 | ; |
1273 | ; @@@@@ NOW: |
1273 | ; @@@@@ NOW: |
1274 | draw_disasm: |
1274 | draw_disasm: |
1275 | 1275 | ||
1276 | .redraw: |
1276 | .redraw: |
1277 | mov eax, [disasm_start_pos] |
1277 | mov eax, [disasm_start_pos] |
1278 | mov [disasm_cur_pos], eax |
1278 | mov [disasm_cur_pos], eax |
1279 | and [disasm_cur_str], 0 |
1279 | and [disasm_cur_str], 0 |
1280 | 1280 | ||
1281 | .loop: |
1281 | .loop: |
1282 | mov eax, [disasm_cur_pos] |
1282 | mov eax, [disasm_cur_pos] |
1283 | call find_symbol |
1283 | call find_symbol |
1284 | jc .nosymb |
1284 | jc .nosymb |
1285 | mov ebx, [disasm_cur_str] |
1285 | mov ebx, [disasm_cur_str] |
1286 | imul ebx, 10 |
1286 | imul ebx, 10 |
1287 | push ebx |
1287 | push ebx |
1288 | lea ecx, [ebx+disasm_y_pos-1] |
1288 | lea ecx, [ebx+disasm_y_pos-1] |
1289 | shl ecx, 16 |
1289 | shl ecx, 16 |
1290 | mov cl, 11 |
1290 | mov cl, 11 |
1291 | ; setting up background color for disassembled text |
1291 | ; setting up background color for disassembled text |
1292 | mov edx, COLOR_BG_NORMAL |
1292 | mov edx, COLOR_BG_NORMAL |
1293 | ;mov ebx, data_x_pos*10000h + data_x_size |
1293 | ;mov ebx, data_x_pos*10000h + data_x_size |
1294 | ;push 13 |
1294 | ;push 13 |
1295 | ;pop eax |
1295 | ;pop eax |
1296 | ; draw container rectangle/box with color COLOR_BG_NORMAL (was 0xFFFFFF - white) |
1296 | ; draw container rectangle/box with color COLOR_BG_NORMAL (was 0xFFFFFF - white) |
1297 | mcall 13, data_x_pos*10000h+data_x_size |
1297 | mcall 13, data_x_pos*10000h+data_x_size |
1298 | pop ebx |
1298 | pop ebx |
1299 | ; copy color value from edx (COLOR_BG_NORMAL) |
1299 | ; copy color value from edx (COLOR_BG_NORMAL) |
1300 | mov edi, edx |
1300 | mov edi, edx |
1301 | add ebx, (data_x_pos+6*2)*10000h+disasm_y_pos |
1301 | add ebx, (data_x_pos+6*2)*10000h+disasm_y_pos |
1302 | mov edx, esi |
1302 | mov edx, esi |
1303 | 1303 | ||
1304 | @@: |
1304 | @@: |
1305 | lodsb |
1305 | lodsb |
1306 | test al, al |
1306 | test al, al |
1307 | jnz @b |
1307 | jnz @b |
1308 | mov byte [esi-1], ':' |
1308 | mov byte [esi-1], ':' |
1309 | sub esi, edx |
1309 | sub esi, edx |
1310 | ; normal color |
1310 | ; normal color |
1311 | ; was 0x40000000 |
1311 | ; was 0x40000000 |
1312 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
1312 | mov ecx, (COLOR_TXT_NORMAL or 0x40000000) |
1313 | mov al, 4 |
1313 | mov al, 4 |
1314 | ; draw a text string in the window with color COLOR_TXT_NORMAL in ecx |
1314 | ; draw a text string in the window with color COLOR_TXT_NORMAL in ecx |
1315 | mcall |
1315 | mcall |
1316 | mov byte [esi+edx-1], 0 |
1316 | mov byte [esi+edx-1], 0 |
1317 | lea esi, [esi*3] |
1317 | lea esi, [esi*3] |
1318 | movzx ecx, bx |
1318 | movzx ecx, bx |
1319 | shr ebx, 16 |
1319 | shr ebx, 16 |
1320 | lea ebx, [ebx+esi*2] |
1320 | lea ebx, [ebx+esi*2] |
1321 | shl ecx, 16 |
1321 | shl ecx, 16 |
1322 | mov cl, 10 |
1322 | mov cl, 10 |
1323 | imul ebx, 10001h |
1323 | imul ebx, 10001h |
1324 | sub bx, data_x_pos+data_x_size |
1324 | sub bx, data_x_pos+data_x_size |
1325 | neg bx |
1325 | neg bx |
1326 | mov al, 13 |
1326 | mov al, 13 |
1327 | ; copy color value from edi |
1327 | ; copy color value from edi |
1328 | mov edx, edi |
1328 | mov edx, edi |
1329 | ; draw container rectangle/box for disassembled text, color in edx |
1329 | ; draw container rectangle/box for disassembled text, color in edx |
1330 | mcall |
1330 | mcall |
1331 | inc [disasm_cur_str] |
1331 | inc [disasm_cur_str] |
1332 | cmp [disasm_cur_str], disasm_height |
1332 | cmp [disasm_cur_str], disasm_height |
1333 | jae .loopend |
1333 | jae .loopend |
1334 | 1334 | ||
1335 | .nosymb: |
1335 | .nosymb: |
1336 | push [disasm_cur_pos] |
1336 | push [disasm_cur_pos] |
1337 | call disasm_instr |
1337 | call disasm_instr |
1338 | pop ebp |
1338 | pop ebp |
1339 | jc .loopend |
1339 | jc .loopend |
1340 | ; setting up colors |
1340 | ; setting up colors |
1341 | ; was 'xor esi, esi' - default color: black |
1341 | ; was 'xor esi, esi' - default color: black |
1342 | mov esi, COLOR_TXT_NORMAL |
1342 | mov esi, COLOR_TXT_NORMAL |
1343 | ; was 0xFFFFFF - default background: white |
1343 | ; was 0xFFFFFF - default background: white |
1344 | mov edx, COLOR_BG_NORMAL |
1344 | mov edx, COLOR_BG_NORMAL |
1345 | mov ebx, data_x_pos*10000h + data_x_size |
1345 | mov ebx, data_x_pos*10000h + data_x_size |
1346 | mov ecx, [disasm_cur_str] |
1346 | mov ecx, [disasm_cur_str] |
1347 | imul ecx, 10*10000h |
1347 | imul ecx, 10*10000h |
1348 | add ecx, (disasm_y_pos-1)*10000h + 10 |
1348 | add ecx, (disasm_y_pos-1)*10000h + 10 |
1349 | mov eax, ebp |
1349 | mov eax, ebp |
1350 | pushad |
1350 | pushad |
1351 | call find_enabled_breakpoint |
1351 | call find_enabled_breakpoint |
1352 | popad |
1352 | popad |
1353 | jnz .nored |
1353 | jnz .nored |
1354 | ; setting up background color for breakpoint |
1354 | ; setting up background color for breakpoint |
1355 | ; was 0xFF0000 - red |
1355 | ; was 0xFF0000 - red |
1356 | mov edx, COLOR_BG_BREAKPOINT |
1356 | mov edx, COLOR_BG_BREAKPOINT |
1357 | 1357 | ||
1358 | .nored: |
1358 | .nored: |
1359 | mov eax, [_eip] |
1359 | mov eax, [_eip] |
1360 | cmp eax, ebp |
1360 | cmp eax, ebp |
1361 | jnz .noblue |
1361 | jnz .noblue |
1362 | ; setting up background color for selected text |
1362 | ; setting up background color for selected text |
1363 | ; (current running instruction) |
1363 | ; (current running instruction) |
1364 | ; was 0x0000FF - blue |
1364 | ; was 0x0000FF - blue |
1365 | mov edx, COLOR_BG_SELECTED |
1365 | mov edx, COLOR_BG_SELECTED |
1366 | ; setting up selected text color |
1366 | ; setting up selected text color |
1367 | ; (current running instruction) |
1367 | ; (current running instruction) |
1368 | ; was 0xFFFFFF - white |
1368 | ; was 0xFFFFFF - white |
1369 | mov esi, COLOR_TXT_SELECTED |
1369 | mov esi, COLOR_TXT_SELECTED |
1370 | 1370 | ||
1371 | .noblue: |
1371 | .noblue: |
1372 | ;push 13 |
1372 | ;push 13 |
1373 | ;pop eax |
1373 | ;pop eax |
1374 | ; draw container rectangle/box for disassembled text |
1374 | ; draw container rectangle/box for disassembled text |
1375 | ; color in edx |
1375 | ; color in edx |
1376 | mcall 13 |
1376 | mcall 13 |
1377 | ;mov al, 47 |
1377 | ;mov al, 47 |
1378 | ;mov ebx, 80100h |
1378 | ;mov ebx, 80100h |
1379 | mov edx, [disasm_cur_str] |
1379 | mov edx, [disasm_cur_str] |
1380 | imul edx, 10 |
1380 | imul edx, 10 |
1381 | add edx, data_x_pos*10000h + disasm_y_pos |
1381 | add edx, data_x_pos*10000h + disasm_y_pos |
1382 | ;mov ecx, ebp |
1382 | ;mov ecx, ebp |
1383 | ; draw a number in the window, color in esi |
1383 | ; draw a number in the window, color in esi |
1384 | mcall 47, 80100h, ebp |
1384 | mcall 47, 80100h, ebp |
1385 | ;mov al, 4 |
1385 | ;mov al, 4 |
1386 | lea ebx, [edx+8*6*10000h] |
1386 | lea ebx, [edx+8*6*10000h] |
1387 | ; copy color value from esi |
1387 | ; copy color value from esi |
1388 | mov ecx, esi |
1388 | mov ecx, esi |
1389 | push 2 |
1389 | push 2 |
1390 | pop esi |
1390 | pop esi |
1391 | mov edx, aColon |
1391 | mov edx, aColon |
1392 | ; draw a text string in the window, color in ecx |
1392 | ; draw a text string in the window, color in ecx |
1393 | mcall 4 |
1393 | mcall 4 |
1394 | push 9 |
1394 | push 9 |
1395 | pop edi |
1395 | pop edi |
1396 | lea edx, [ebx+2*6*10000h] |
1396 | lea edx, [ebx+2*6*10000h] |
1397 | mov esi, ecx |
1397 | mov esi, ecx |
1398 | mov ecx, ebp |
1398 | mov ecx, ebp |
1399 | sub ecx, [disasm_start_pos] |
1399 | sub ecx, [disasm_start_pos] |
1400 | add ecx, disasm_buffer |
1400 | add ecx, disasm_buffer |
1401 | 1401 | ||
1402 | .drawhex: |
1402 | .drawhex: |
1403 | ;mov al, 47 |
1403 | ;mov al, 47 |
1404 | ;mov ebx, 20101h |
1404 | ;mov ebx, 20101h |
1405 | ; draw a number in the window, color in esi |
1405 | ; draw a number in the window, color in esi |
1406 | mcall 47, 20101h |
1406 | mcall 47, 20101h |
1407 | add edx, 6*3*10000h |
1407 | add edx, 6*3*10000h |
1408 | inc ecx |
1408 | inc ecx |
1409 | inc ebp |
1409 | inc ebp |
1410 | cmp ebp, [disasm_cur_pos] |
1410 | cmp ebp, [disasm_cur_pos] |
1411 | jae .hexdone |
1411 | jae .hexdone |
1412 | dec edi |
1412 | dec edi |
1413 | jnz .drawhex |
1413 | jnz .drawhex |
1414 | push esi |
1414 | push esi |
1415 | mov esi, [disasm_cur_pos] |
1415 | mov esi, [disasm_cur_pos] |
1416 | dec esi |
1416 | dec esi |
1417 | cmp esi, ebp |
1417 | cmp esi, ebp |
1418 | pop esi |
1418 | pop esi |
1419 | jbe .drawhex |
1419 | jbe .drawhex |
1420 | ;mov al, 4 |
1420 | ;mov al, 4 |
1421 | lea ebx, [edx-6*10000h] |
1421 | lea ebx, [edx-6*10000h] |
1422 | ; copy color value from esi |
1422 | ; copy color value from esi |
1423 | mov ecx, esi |
1423 | mov ecx, esi |
1424 | push 3 |
1424 | push 3 |
1425 | pop esi |
1425 | pop esi |
1426 | mov edx, aDots |
1426 | mov edx, aDots |
1427 | ; draw a text string in the window, color in ecx |
1427 | ; draw a text string in the window, color in ecx |
1428 | mcall 4 |
1428 | mcall 4 |
1429 | ; copy color value from ecx |
1429 | ; copy color value from ecx |
1430 | mov esi, ecx |
1430 | mov esi, ecx |
1431 | 1431 | ||
1432 | .hexdone: |
1432 | .hexdone: |
1433 | xor eax, eax |
1433 | xor eax, eax |
1434 | mov edi, disasm_string |
1434 | mov edi, disasm_string |
1435 | mov edx, edi |
1435 | mov edx, edi |
1436 | or ecx, -1 |
1436 | or ecx, -1 |
1437 | repnz scasb |
1437 | repnz scasb |
1438 | not ecx |
1438 | not ecx |
1439 | dec ecx |
1439 | dec ecx |
1440 | xchg ecx, esi |
1440 | xchg ecx, esi |
1441 | mov ebx, [disasm_cur_str] |
1441 | mov ebx, [disasm_cur_str] |
1442 | imul ebx, 10 |
1442 | imul ebx, 10 |
1443 | add ebx, (data_x_pos+6*40)*10000h+disasm_y_pos |
1443 | add ebx, (data_x_pos+6*40)*10000h+disasm_y_pos |
1444 | ;mov al, 4 |
1444 | ;mov al, 4 |
1445 | ; draw a text string in the window, color in ecx |
1445 | ; draw a text string in the window, color in ecx |
1446 | mcall 4 |
1446 | mcall 4 |
1447 | inc [disasm_cur_str] |
1447 | inc [disasm_cur_str] |
1448 | cmp [disasm_cur_str], disasm_height |
1448 | cmp [disasm_cur_str], disasm_height |
1449 | jb .loop |
1449 | jb .loop |
1450 | 1450 | ||
1451 | .loopend: |
1451 | .loopend: |
1452 | mov ecx, disasm_height |
1452 | mov ecx, disasm_height |
1453 | sub ecx, [disasm_cur_str] |
1453 | sub ecx, [disasm_cur_str] |
1454 | jz @f |
1454 | jz @f |
1455 | imul ecx, 10 |
1455 | imul ecx, 10 |
1456 | inc ecx |
1456 | inc ecx |
1457 | mov eax, disasm_y_pos + disasm_y_size |
1457 | mov eax, disasm_y_pos + disasm_y_size |
1458 | sub eax, ecx |
1458 | sub eax, ecx |
1459 | shl eax, 16 |
1459 | shl eax, 16 |
1460 | add ecx, eax |
1460 | add ecx, eax |
1461 | ;push 13 |
1461 | ;push 13 |
1462 | ;pop eax |
1462 | ;pop eax |
1463 | ;mov ebx, data_x_pos*65536 + data_x_size |
1463 | ;mov ebx, data_x_pos*65536 + data_x_size |
1464 | ; set backroung color for disassembly container |
1464 | ; set backroung color for disassembly container |
1465 | ; was 0xFFFFFF - white |
1465 | ; was 0xFFFFFF - white |
1466 | mov edx, COLOR_BG_NORMAL |
1466 | mov edx, COLOR_BG_NORMAL |
1467 | ; draw container rectangle/box with color COLOR_BG_NORMAL (in edx) |
1467 | ; draw container rectangle/box with color COLOR_BG_NORMAL (in edx) |
1468 | mcall 13, data_x_pos*65536+data_x_size |
1468 | mcall 13, data_x_pos*65536+data_x_size |
1469 | 1469 | ||
1470 | @@: |
1470 | @@: |
1471 | ret |
1471 | ret |
1472 | 1472 | ||
1473 | ;----------------------------------------------------------------------------- |
1473 | ;----------------------------------------------------------------------------- |
1474 | 1474 | ||
1475 | ; TODO: cleanup of this function, make some global labels local |
1475 | ; TODO: cleanup of this function, make some global labels local |
1476 | update_disasm_eip: |
1476 | update_disasm_eip: |
1477 | ; test if instruction at eip is showed |
1477 | ; test if instruction at eip is showed |
1478 | mov ecx, disasm_height |
1478 | mov ecx, disasm_height |
1479 | mov eax, [disasm_start_pos] |
1479 | mov eax, [disasm_start_pos] |
1480 | mov [disasm_cur_pos], eax |
1480 | mov [disasm_cur_pos], eax |
1481 | 1481 | ||
1482 | .l: |
1482 | .l: |
1483 | mov eax, [disasm_cur_pos] |
1483 | mov eax, [disasm_cur_pos] |
1484 | call find_symbol |
1484 | call find_symbol |
1485 | jc @f |
1485 | jc @f |
1486 | dec ecx |
1486 | dec ecx |
1487 | jz .m |
1487 | jz .m |
1488 | 1488 | ||
1489 | @@: |
1489 | @@: |
1490 | cmp [_eip], eax |
1490 | cmp [_eip], eax |
1491 | jz draw_disasm.redraw |
1491 | jz draw_disasm.redraw |
1492 | push ecx |
1492 | push ecx |
1493 | call disasm_instr |
1493 | call disasm_instr |
1494 | pop ecx |
1494 | pop ecx |
1495 | jc .m |
1495 | jc .m |
1496 | loop .l |
1496 | loop .l |
1497 | 1497 | ||
1498 | .m: |
1498 | .m: |
1499 | 1499 | ||
1500 | update_disasm_eip_force: |
1500 | update_disasm_eip_force: |
1501 | mov eax, [_eip] |
1501 | mov eax, [_eip] |
1502 | mov [disasm_start_pos], eax |
1502 | mov [disasm_start_pos], eax |
1503 | 1503 | ||
1504 | update_disasm: |
1504 | update_disasm: |
1505 | cmp [debuggee_pid], 0 |
1505 | cmp [debuggee_pid], 0 |
1506 | jz .no |
1506 | jz .no |
1507 | ;push 69 |
1507 | ;push 69 |
1508 | ;pop eax |
1508 | ;pop eax |
1509 | ;push 6 |
1509 | ;push 6 |
1510 | ;pop ebx |
1510 | ;pop ebx |
1511 | ;mov ecx, [debuggee_pid] |
1511 | ;mov ecx, [debuggee_pid] |
1512 | ;mov edi, disasm_buffer |
1512 | ;mov edi, disasm_buffer |
1513 | ;mov edx, 256 |
1513 | ;mov edx, 256 |
1514 | ;mov esi, [disasm_start_pos] |
1514 | ;mov esi, [disasm_start_pos] |
1515 | mcall 69, 6, [debuggee_pid], 256, [disasm_start_pos], disasm_buffer |
1515 | mcall 69, 6, [debuggee_pid], 256, [disasm_start_pos], disasm_buffer |
1516 | cmp eax, -1 |
1516 | cmp eax, -1 |
1517 | jnz @f |
1517 | jnz @f |
1518 | mov esi, read_mem_err |
1518 | mov esi, read_mem_err |
1519 | call put_message |
1519 | call put_message |
1520 | 1520 | ||
1521 | .no: |
1521 | .no: |
1522 | xor eax, eax |
1522 | xor eax, eax |
1523 | 1523 | ||
1524 | @@: |
1524 | @@: |
1525 | mov [disasm_buf_size], eax |
1525 | mov [disasm_buf_size], eax |
1526 | call restore_from_breaks |
1526 | call restore_from_breaks |
1527 | jmp draw_disasm.redraw |
1527 | jmp draw_disasm.redraw |
1528 | 1528 | ||
1529 | 1529 | ||
1530 | ;----------------------------------------------------------------------------- |
1530 | ;----------------------------------------------------------------------------- |
1531 | ; Draw main window |
1531 | ; Draw main window |
1532 | 1532 | ||
1533 | draw_window: |
1533 | draw_window: |
1534 | ; start window redraw |
1534 | ; start window redraw |
1535 | mcall 12, 1 |
1535 | mcall 12, 1 |
1536 | 1536 | ||
1537 | ; define window |
1537 | ; define window |
1538 | mcall 0, wnd_x_size, wnd_y_size, (COLOR_BG_NORMAL or 0x54000000), , caption_str |
1538 | mcall 0, wnd_x_size, wnd_y_size, (COLOR_BG_NORMAL or 0x54000000), , caption_str |
1539 | 1539 | ||
1540 | ; clear unused areas |
1540 | ; clear unused areas |
1541 | ; get window skin height |
1541 | ; get window skin height |
1542 | mcall 48, 4 |
1542 | mcall 48, 4 |
1543 | cmp eax, title_y_pos |
1543 | cmp eax, title_y_pos |
1544 | jb @f |
1544 | jb @f |
1545 | push registers_y_pos |
1545 | push registers_y_pos |
1546 | pop eax |
1546 | pop eax |
1547 | 1547 | ||
1548 | @@: |
1548 | @@: |
1549 | push registers_y_pos |
1549 | push registers_y_pos |
1550 | pop ecx |
1550 | pop ecx |
1551 | push eax |
1551 | push eax |
1552 | sub ecx, eax |
1552 | sub ecx, eax |
1553 | shl eax, 16 |
1553 | shl eax, 16 |
1554 | add ecx, eax |
1554 | add ecx, eax |
1555 | mov ebx, 5*10000h + (wnd_x_size-9) |
1555 | mov ebx, 5*10000h + (wnd_x_size-9) |
1556 | mov edx, COLOR_BG_NORMAL |
1556 | mov edx, COLOR_BG_NORMAL |
1557 | ; draw container rectangle/box for registers information region |
1557 | ; draw container rectangle/box for registers information region |
1558 | mcall 13 |
1558 | mcall 13 |
1559 | mov ecx, (dump_y_pos+dump_y_size)*10000h + (disasm_y_pos-dump_y_pos-dump_y_size) |
1559 | mov ecx, (dump_y_pos+dump_y_size)*10000h + (disasm_y_pos-dump_y_pos-dump_y_size) |
1560 | ; draw container rectangle/box for dump memory region |
1560 | ; draw container rectangle/box for dump memory region |
1561 | mcall |
1561 | mcall |
1562 | mov ecx, (disasm_y_pos-1+disasm_y_size)*10000h + (messages_y_pos-disasm_y_pos+1-disasm_y_size) |
1562 | mov ecx, (disasm_y_pos-1+disasm_y_size)*10000h + (messages_y_pos-disasm_y_pos+1-disasm_y_size) |
1563 | ; draw container rectangle/box for disassembled code region |
1563 | ; draw container rectangle/box for disassembled code region |
1564 | mcall |
1564 | mcall |
1565 | mov ecx, (messages_y_pos+messages_y_size)*10000h + (wnd_y_size-messages_y_pos-messages_y_size-4) |
1565 | mov ecx, (messages_y_pos+messages_y_size)*10000h + (wnd_y_size-messages_y_pos-messages_y_size-4) |
1566 | ; draw container rectangle/box for messages window region |
1566 | ; draw container rectangle/box for messages window region |
1567 | mcall |
1567 | mcall |
1568 | mov ebx, 5*10000h + (data_x_pos-5) |
1568 | mov ebx, 5*10000h + (data_x_pos-5) |
1569 | pop ecx |
1569 | pop ecx |
1570 | imul ecx, 10001h |
1570 | imul ecx, 10001h |
1571 | sub cx, wnd_y_size-4 |
1571 | sub cx, wnd_y_size-4 |
1572 | neg cx |
1572 | neg cx |
1573 | ; draw container rectangle/box |
1573 | ; draw container rectangle/box |
1574 | mcall |
1574 | mcall |
1575 | mov ebx, (data_x_pos+data_x_size)*10000h + (wnd_x_size-data_x_pos-data_x_size-4) |
1575 | mov ebx, (data_x_pos+data_x_size)*10000h + (wnd_x_size-data_x_pos-data_x_size-4) |
1576 | ; draw container rectangle/box |
1576 | ; draw container rectangle/box |
1577 | mcall |
1577 | mcall |
1578 | mov ebx, 5*10000h + title_x_pos - 5 |
1578 | mov ebx, 5*10000h + title_x_pos - 5 |
1579 | mov ecx, (title_y_pos)*10000h + (title_y_size) |
1579 | mov ecx, (title_y_pos)*10000h + (title_y_size) |
1580 | ; draw container rectangle/box for dump memory region title |
1580 | ; draw container rectangle/box for dump memory region title |
1581 | mcall |
1581 | mcall |
1582 | 1582 | ||
1583 | ; messages frame |
1583 | ; messages frame |
1584 | mov ebx, (messages_x_pos-2)*10000h + (messages_x_pos+messages_x_size+2) |
1584 | mov ebx, (messages_x_pos-2)*10000h + (messages_x_pos+messages_x_size+2) |
1585 | push ebx |
1585 | push ebx |
1586 | mov ecx, (messages_y_pos-2)*10001h |
1586 | mov ecx, (messages_y_pos-2)*10001h |
1587 | mov edx, COLOR_LINE |
1587 | mov edx, COLOR_LINE |
1588 | mcall 38 |
1588 | mcall 38 |
1589 | mov ecx, (messages_y_pos+messages_y_size+2)*10001h |
1589 | mov ecx, (messages_y_pos+messages_y_size+2)*10001h |
1590 | mcall |
1590 | mcall |
1591 | mov ebx, (messages_x_pos-2)*10001h |
1591 | mov ebx, (messages_x_pos-2)*10001h |
1592 | push ebx |
1592 | push ebx |
1593 | mov ecx, (messages_y_pos-2)*10000h + (messages_y_pos+messages_y_size+2) |
1593 | mov ecx, (messages_y_pos-2)*10000h + (messages_y_pos+messages_y_size+2) |
1594 | mcall |
1594 | mcall |
1595 | mov ebx, (messages_x_pos+messages_x_size+2)*10001h |
1595 | mov ebx, (messages_x_pos+messages_x_size+2)*10001h |
1596 | push ebx |
1596 | push ebx |
1597 | mcall |
1597 | mcall |
1598 | 1598 | ||
1599 | ; command line frame |
1599 | ; command line frame |
1600 | mov ecx, (cmdline_y_pos-2)*10000h + (cmdline_y_pos+cmdline_y_size+2) |
1600 | mov ecx, (cmdline_y_pos-2)*10000h + (cmdline_y_pos+cmdline_y_size+2) |
1601 | pop ebx |
1601 | pop ebx |
1602 | mcall |
1602 | mcall |
1603 | pop ebx |
1603 | pop ebx |
1604 | mcall |
1604 | mcall |
1605 | pop ebx |
1605 | pop ebx |
1606 | mov ecx, (cmdline_y_pos+cmdline_y_size+2)*10001h |
1606 | mov ecx, (cmdline_y_pos+cmdline_y_size+2)*10001h |
1607 | mcall |
1607 | mcall |
1608 | mov ecx, (cmdline_y_pos-2)*10001h |
1608 | mov ecx, (cmdline_y_pos-2)*10001h |
1609 | mcall |
1609 | mcall |
1610 | 1610 | ||
1611 | ; registers frame |
1611 | ; registers frame |
1612 | ; mov ebx, (registers_x_pos-2)*10000h + (registers_x_size+4) |
- | |
1613 | ; mov ecx, (registers_y_pos-2)*10000h + (registers_y_size+4) |
- | |
1614 | DrawRectangle (registers_x_pos-2), (registers_y_pos-2), (registers_x_size+3), (registers_y_size+3), COLOR_LINE |
1612 | DrawRectangle (registers_x_pos-2), (registers_y_pos-2), (registers_x_size+3), (registers_y_size+3), COLOR_LINE |
1615 | ; draw container rectangle/box for registers information window region |
1613 | ; draw container rectangle/box for registers information window region |
1616 | mcall 13 |
- | |
1617 | 1614 | ||
1618 | ; messages |
1615 | ; messages |
1619 | call draw_messages |
1616 | call draw_messages |
1620 | 1617 | ||
1621 | ; command line & cursor |
1618 | ; command line & cursor |
1622 | call draw_cmdline |
1619 | call draw_cmdline |
1623 | call draw_cursor |
1620 | call draw_cursor |
1624 | 1621 | ||
1625 | ; title & registers & dump & disasm |
1622 | ; title & registers & dump & disasm |
1626 | mov ebx, (data_x_pos-2)*10001h |
1623 | mov ebx, (data_x_pos-2)*10001h |
1627 | mov ecx, (title_y_pos+5)*10000h + (messages_y_pos-2) |
1624 | mov ecx, (title_y_pos+5)*10000h + (messages_y_pos-2) |
1628 | mov edx, COLOR_LINE |
1625 | mov edx, COLOR_LINE |
1629 | mcall 38 |
1626 | mcall 38 |
1630 | mov ebx, (data_x_pos+data_x_size+2)*10001h |
1627 | mov ebx, (data_x_pos+data_x_size+2)*10001h |
1631 | mcall |
1628 | mcall |
1632 | mov ebx, (data_x_pos-2)*10000h + (data_x_pos+data_x_size+2) |
1629 | mov ebx, (data_x_pos-2)*10000h + (data_x_pos+data_x_size+2) |
1633 | mov ecx, (disasm_y_pos-4)*10001h |
1630 | mov ecx, (disasm_y_pos-4)*10001h |
1634 | mcall |
1631 | mcall |
1635 | 1632 | ||
1636 | ; redraw whole window again |
1633 | ; redraw whole window again |
1637 | call redraw_title |
1634 | call redraw_title |
1638 | call draw_registers |
1635 | call draw_registers |
1639 | call draw_dump |
1636 | call draw_dump |
1640 | call draw_disasm.redraw |
1637 | call draw_disasm.redraw |
1641 | 1638 | ||
1642 | ; end of window redraw |
1639 | ; end of window redraw |
1643 | mcall 12, 2 |
1640 | mcall 12, 2 |
1644 | ret |
1641 | ret |
1645 | 1642 | ||
1646 | ; vim: ft=fasm tabstop=4 |
1643 | ; vim: ft=fasm tabstop=4 |