Subversion Repositories Kolibri OS

Rev

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

  1. align 4
  2. dtext:  ; Text String Output (rw by Johnny_B[john@kolibrios.org])
  3.         ; eax x & y
  4.         ; ebx font ( 0xX0000000 ) & color ( 0x00RRGGBB )
  5.         ; ecx start of text
  6.         ; edx length
  7.         ; edi 1 force
  8.  
  9.         pushad
  10.  
  11.         mov    esi,edx    ;esi=length
  12.         mov    ebp,ecx    ;ebp=ptr to text
  13.         mov    ecx,ebx    ;ecx=color
  14.         movsx  ebx,ax     ;ebx=y
  15.         sar    eax,16     ;eax=x
  16.         and    esi, 0xFF  ;limit of text = 255 symbols
  17.  
  18. dtext.lnew:
  19.         test   esi, esi    ; zero length ?
  20.         jnz    @f
  21.         jmp    dtext.output_end
  22.       @@:
  23.  
  24.         movzx  edx,byte [ebp] ;edx=ascii code
  25.         test   edx,edx
  26.         jz     dtext.output_end
  27.         test   ecx,0x10000000
  28.         jnz    dtext.letnew2
  29.  
  30.         align 4
  31.       .letnew:
  32.  
  33. drawletter:  ;output char of type 1(monotype)
  34. ;eax - x
  35. ;ebx - y
  36. ;ecx - color
  37. ;edx - ascii code
  38.     pushad
  39.     call  [disable_mouse]
  40.     mov   esi,9
  41.     lea   ebp,[0x3F600+8*edx+edx]
  42. .symloop:
  43.     push  esi
  44.     mov   dl,byte [ebp]
  45.     mov   esi,8
  46. .pixloop:
  47.     test  dl,1
  48.     jz    .nopix
  49.     call  [putpixel]
  50. .nopix:
  51.     shr   dl,1    
  52.     inc   eax
  53.     dec   esi
  54.     jnz   .pixloop
  55.     sub   eax,8
  56.     inc   ebx
  57.     inc   ebp
  58.     pop   esi
  59.     dec   esi
  60.     jnz   .symloop
  61.     popad
  62.  
  63.         add    eax,6
  64.  
  65.         inc    ebp  ;ptr to text
  66.         dec    esi  ;length
  67.         jnz    dtext.lnew
  68.  
  69.         jmp dtext.output_end
  70.  
  71.  
  72.       dtext.letnew2:
  73.  
  74. align 4
  75. drawletter2:       ;output char of type 2(proportional)
  76. ;eax - x
  77. ;ebx - y
  78. ;ecx - color
  79. ;edx - symbol
  80. ;edi - force?
  81. ;result - eax=eax+sym_size
  82.     pushad
  83.     call  [disable_mouse]
  84.     shl   edx,1
  85.     mov   esi,9
  86.     lea   ebp,[0x3EC00+4*edx+edx+1]
  87. .symloop:
  88.     push  esi
  89.     mov   dl,byte [ebp]
  90.     xor   esi,esi
  91. .pixloop:
  92.     test  dl,1
  93.     jz    .nopix
  94.     call  [putpixel]
  95. .nopix:
  96.     shr   dl,1
  97.     inc   esi
  98.     inc   eax
  99.     cmp   esi,8
  100.     jl    .pixloop
  101.     sub   eax,8
  102.     inc   ebx
  103.     pop   esi
  104.     inc   ebp
  105.     dec   esi
  106.     jnz   .symloop
  107.     movzx edx,byte [ebp-10]
  108.     add   [esp+32-4],edx
  109.     popad
  110.  
  111.  
  112.         inc    ebp   ;ptr to text
  113.         dec    esi   ;length
  114.         jnz    dtext.lnew
  115.  
  116.  
  117. dtext.output_end:
  118.         popad
  119.         ret