Subversion Repositories Kolibri OS

Rev

Rev 431 | Rev 684 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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