Rev 6596 | Rev 9826 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6596 | Rev 9092 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; Written by hidnplayr@kolibrios.org ;; |
6 | ;; Written by hidnplayr@kolibrios.org ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; GNU GENERAL PUBLIC LICENSE ;; |
8 | ;; GNU GENERAL PUBLIC LICENSE ;; |
Line 173... | Line 173... | ||
173 | 173 | ||
Line -... | Line 174... | ||
- | 174 | jmp .continue |
|
- | 175 | ||
- | 176 | ||
- | 177 | ||
- | 178 | ;----------------------------------------------- |
|
- | 179 | ; Draw text of the current window to the screen |
|
174 | jmp .continue |
180 | ; |
Line 175... | Line 181... | ||
175 | 181 | ; IN: / |
|
176 | 182 | ; OUT: / |
|
Line 310... | Line 316... | ||
310 | mov edx, [colors.work] |
316 | mov edx, [colors.work] |
311 | mcall 13 ; draw rectangle |
317 | mcall 13 ; draw rectangle |
312 | popa |
318 | popa |
Line 313... | Line 319... | ||
313 | 319 | ||
314 | push eax |
- | |
315 | mov esi, [textbox_width] |
320 | push eax |
316 | .line: |
321 | .line: |
317 | cmp byte[edx], 0 |
322 | cmp byte[edx], 0 |
318 | je .end_of_text |
323 | je .end_of_text |
319 | cmp byte[edx], 13 |
324 | cmp byte[edx], 13 |
320 | je .newline_soft |
325 | je .newline_soft |
321 | cmp byte[edx], 10 |
326 | cmp byte[edx], 10 |
Line 322... | Line -... | ||
322 | je .newline_hard |
- | |
323 | 327 | je .newline_hard |
|
324 | push esi |
328 | |
325 | cmp byte[edx], 3 ; escape code for mIRC colors |
329 | cmp byte[edx], 3 ; escape code for mIRC colors |
326 | jne .no_colors |
330 | jne .no_colors |
327 | inc edx |
331 | inc edx |
Line 337... | Line 341... | ||
337 | jz .no_colors |
341 | jz .no_colors |
338 | mov edi, [irc_colors + 4*esi] |
342 | mov edi, [irc_colors + 4*esi] |
339 | or ecx, 0x40000000 |
343 | or ecx, 0x40000000 |
340 | .no_colors: |
344 | .no_colors: |
Line 341... | Line 345... | ||
341 | 345 | ||
342 | mov esi, 1 |
346 | ;------------------------------------------- |
Line -... | Line 347... | ||
- | 347 | ; Count characters until 0, 10, 13 or 3 byte |
|
343 | mcall 4 ; draw text |
348 | |
- | 349 | push edx |
|
- | 350 | xor esi, esi |
|
- | 351 | dec esi |
|
- | 352 | .next_char: |
|
- | 353 | inc esi |
|
344 | 354 | cmp esi, [textbox_width] |
|
- | 355 | je .cnt_done |
|
- | 356 | mov al, byte[edx] |
|
- | 357 | cmp al, 13 |
|
- | 358 | jbe .cnt_done |
|
345 | mov esi, 1 |
359 | |
346 | mov al, byte[edx] |
360 | inc edx |
- | 361 | test al, 10000000b |
|
347 | test al, 10000000b |
362 | jz .next_char ; 1 byte wide |
348 | jz @f |
363 | |
349 | mov esi, 4 |
364 | add edx, 4 |
350 | and al, 11111000b |
365 | and al, 11111000b |
- | 366 | cmp al, 11110000b |
|
351 | cmp al, 11110000b |
367 | je .next_char ; 4 bytes wide |
352 | je @f |
368 | |
353 | dec esi |
369 | dec edx |
- | 370 | and al, 11110000b |
|
- | 371 | cmp al, 11100000b |
|
- | 372 | je .next_char ; 3 bytes wide |
|
- | 373 | dec edx ; 2 bytes wide |
|
354 | and al, 11110000b |
374 | jmp .next_char |
355 | cmp al, 11100000b |
375 | .cnt_done: |
356 | je @f |
376 | mov eax, edx |
- | 377 | pop edx |
|
- | 378 | push eax |
|
Line 357... | Line 379... | ||
357 | dec esi |
379 | mcall 4 ; draw text |
358 | @@: |
380 | pop edx ; next start ptr |
359 | 381 | ||
360 | add ebx, FONT_WIDTH shl 16 |
382 | cmp esi, [textbox_width] |
361 | add edx, esi |
383 | je .line_full |
362 | pop esi |
- | |
Line 363... | Line 384... | ||
363 | dec esi |
384 | imul esi, FONT_WIDTH shl 16 |
364 | jnz .line |
385 | add ebx, esi |
365 | jmp .line_full |
386 | jmp .line |
366 | 387 |