Rev 24 | Rev 139 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | ha | 1 | align 4 |
106 | john | 2 | dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org]) |
1 | ha | 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 | |||
106 | john | 11 | mov esi,edx ;esi=length |
12 | mov ebp,ecx ;ebp=ptr to text |
||
13 | mov ecx,ebx ;ecx=color |
||
14 | movzx ebx,ax ;ebx=y |
||
15 | shr eax,16 ;eax=x |
||
16 | and esi, 0xFF ;limit of text = 255 symbols |
||
17 | |||
18 | dtext.lnew: |
||
1 | ha | 19 | test esi, esi ; zero length ? |
20 | jnz @f |
||
106 | john | 21 | jmp dtext.output_end |
1 | ha | 22 | @@: |
106 | john | 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 | |||
1 | ha | 30 | align 4 |
31 | .letnew: |
||
32 | |||
106 | john | 33 | drawletter: ;output char of type 1(monotype) |
12 | halyavin | 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 |
||
1 | ha | 62 | |
106 | john | 63 | add eax,6 |
1 | ha | 64 | |
106 | john | 65 | inc ebp ;ptr to text |
66 | dec esi ;length |
||
67 | jnz dtext.lnew |
||
1 | ha | 68 | |
106 | john | 69 | jmp dtext.output_end |
1 | ha | 70 | |
71 | |||
106 | john | 72 | dtext.letnew2: |
1 | ha | 73 | |
74 | align 4 |
||
106 | john | 75 | drawletter2: ;output char of type 2(proportional) |
12 | halyavin | 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] |
||
24 | halyavin | 84 | shl edx,1 |
12 | halyavin | 85 | mov esi,9 |
24 | halyavin | 86 | lea ebp,[0x3EC00+4*edx+edx+1] |
12 | halyavin | 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 |
||
24 | halyavin | 107 | movzx edx,byte [ebp-10] |
12 | halyavin | 108 | add [esp+32-4],edx |
109 | popad |
||
106 | john | 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 |