Subversion Repositories Kolibri OS

Rev

Rev 593 | Rev 831 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                              ;;
  3. ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
  4. ;; Distributed under terms of the GNU General Public License    ;;
  5. ;;                                                              ;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8. $Revision: 684 $
  9.  
  10.  
  11. align 4
  12. dtext:  ; Text String Output (rw by Johnny_B[john@kolibrios.org])
  13.         ; ebx x & y
  14.         ; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
  15.         ; X = ABnnb:
  16.         ; nn = font
  17.         ; A = 0 <=> output esi characters; otherwise output ASCIIZ string
  18.         ; B = 1 <=> fill background with color eax
  19.         ; edx start of text
  20.         ; edi 1 force
  21.  
  22.         pushad
  23.         call    [disable_mouse]
  24.  
  25.         movsx   eax, bx         ; eax=y
  26.         sar     ebx, 16         ; ebx=x
  27.         xchg    eax, ebx        ; eax=x, ebx=y
  28.         cmp     esi, 255
  29.         jb      .loop
  30.         mov     esi, 255
  31. .loop:
  32.         test    ecx, ecx
  33.         js      .test_asciiz
  34.         dec     esi
  35.         js      .end
  36.         jmp     @f
  37. .test_asciiz:
  38.         cmp     byte [edx], 0
  39.         jz      .end
  40. @@:
  41.         inc     edx
  42.         pushad
  43.         movzx   edx, byte [edx-1]
  44.         test    ecx, 0x10000000
  45.         jnz     .font2
  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+20h+1Ch]
  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.         jmp     .loop
  76. .font2:
  77.         add     edx, edx
  78.         lea     ebp, [FONT_II+4*edx+edx+1]
  79.         push    9
  80.         movzx   esi, byte [ebp-1]
  81. .symloop2:
  82.         mov     dl, byte [ebp]
  83.         push    esi
  84. .pixloop2:
  85.         shr     dl, 1
  86.         jnc     .nopix2
  87.         call    [putpixel]
  88.         jmp     .pixloop2cont
  89. .nopix2:
  90.         test    ecx, 0x40000000
  91.         jz      .pixloop2cont
  92.         push    ecx
  93.         mov     ecx, [esp+12+20h+1Ch]
  94.         call    [putpixel]
  95.         pop     ecx
  96. .pixloop2cont:
  97.         inc     eax
  98.         dec     esi
  99.         jnz     .pixloop2
  100.         pop     esi
  101.         sub     eax, esi
  102.         inc     ebx
  103.         inc     ebp
  104.         dec     dword [esp]
  105.         jnz     .symloop2
  106.         pop     eax
  107.         add     dword [esp+28], esi
  108.         popad
  109.         jmp     .loop
  110. .end:
  111.         popad
  112.         ret
  113.