Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. $Revision: 431 $
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;;                                                              ;;
  4. ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
  5. ;; Distributed under terms of the GNU General Public License    ;;
  6. ;;                                                              ;;
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9. align 4
  10. dtext:  ; Text String Output (rw by Johnny_B[john@kolibrios.org])
  11.         ; eax x & y
  12.         ; ebx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
  13.         ; X = ABnnb:
  14.         ; nn = font
  15.         ; A = 0 <=> output edx characters; otherwise output ASCIIZ string
  16.         ; B = 1 <=> fill background with color esi
  17.         ; ecx start of text
  18.         ; edi 1 force
  19.  
  20.         pushad
  21.         call    [disable_mouse]
  22.  
  23.         mov     ebp, ecx        ; ebp=pointer to text
  24.         mov     ecx, ebx        ; ecx=color
  25.         movsx   ebx, ax         ; ebx=y
  26.         sar     eax, 16         ; eax=x
  27.         cmp     edx, 255
  28.         jb      .loop
  29.         mov     edx, 255
  30. .loop:
  31.         test    ecx, ecx
  32.         js      .test_asciiz
  33.         dec     edx
  34.         js      .end
  35.         jmp     @f
  36. .test_asciiz:
  37.         cmp     byte [ebp], 0
  38.         jz      .end
  39. @@:
  40.         push    edx
  41.         movzx   edx, byte [ebp]
  42.         inc     ebp
  43.         test    ecx, 0x10000000
  44.         jnz     .font2
  45.         pushad
  46.         mov     esi, 9
  47.         lea     ebp, [FONT_I+8*edx+edx]
  48. .symloop1:
  49.         mov     dl, byte [ebp]
  50.         or      dl, 1 shl 6
  51. .pixloop1:
  52.         shr     dl, 1
  53.         jz      .pixloop1end
  54.         jnc     .nopix
  55.         call    [putpixel]
  56.         jmp     .pixloop1cont
  57. .nopix:
  58.         test    ecx, 0x40000000
  59.         jz      .pixloop1cont
  60.         push    ecx
  61.         mov     ecx, [esp+4+4]
  62.         call    [putpixel]
  63.         pop     ecx
  64. .pixloop1cont:
  65.         inc     eax
  66.         jmp     .pixloop1
  67. .pixloop1end:
  68.         sub     eax, 6
  69.         inc     ebx
  70.         inc     ebp
  71.         dec     esi
  72.         jnz     .symloop1
  73.         popad
  74.         add     eax, 6
  75.         pop     edx
  76.         jmp     .loop
  77. .font2:
  78.         pushad
  79.         add     edx, edx
  80.         lea     ebp, [FONT_II+4*edx+edx+1]
  81.         push    9
  82.         movzx   esi, byte [ebp-1]
  83. .symloop2:
  84.         mov     dl, byte [ebp]
  85.         push    esi
  86. .pixloop2:
  87.         shr     dl, 1
  88.         jnc     .nopix2
  89.         call    [putpixel]
  90.         jmp     .pixloop2cont
  91. .nopix2:
  92.         test    ecx, 0x40000000
  93.         jz      .pixloop2cont
  94.         push    ecx
  95.         mov     ecx, [esp+12+4]
  96.         call    [putpixel]
  97.         pop     ecx
  98. .pixloop2cont:
  99.         inc     eax
  100.         dec     esi
  101.         jnz     .pixloop2
  102.         pop     esi
  103.         sub     eax, esi
  104.         inc     ebx
  105.         inc     ebp
  106.         dec     dword [esp]
  107.         jnz     .symloop2
  108.         pop     eax
  109.         add     dword [esp+28], esi
  110.         popad
  111.         pop     edx
  112.         jmp     .loop
  113. .end:
  114.         popad
  115.         ret
  116.