Subversion Repositories Kolibri OS

Rev

Rev 106 | Rev 381 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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