Rev 24 | Rev 139 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 24 | Rev 106 | ||
---|---|---|---|
1 | align 4 |
1 | align 4 |
2 | dtext: |
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 font ( 0xX0000000 ) & color ( 0x00RRGGBB ) |
5 | ; ecx start of text |
5 | ; ecx start of text |
6 | ; edx length |
6 | ; edx length |
7 | ; edi 1 force |
7 | ; edi 1 force |
8 | - | ||
9 | test ebx,0x10000000 |
- | |
10 | jnz dtext2 |
- | |
11 | 8 | ||
- | 9 | pushad |
|
- | 10 | ||
- | 11 | mov esi,edx ;esi=length |
|
12 | pushad |
12 | mov ebp,ecx ;ebp=ptr to text |
13 | 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 |
|
14 | mov esi, edx |
17 | |
15 | and esi, 0xff |
18 | dtext.lnew: |
16 | test esi, esi ; zero length ? |
19 | test esi, esi ; zero length ? |
17 | jnz @f |
- | |
18 | popad |
20 | jnz @f |
19 | ret |
- | |
20 | @@: |
- | |
21 | align 4 |
- | |
22 | .letnew: |
- | |
23 | - | ||
24 | push eax ecx edx |
- | |
25 | movzx ebx,ax |
- | |
26 | shr eax,16 |
- | |
27 | movzx edx,byte [ecx] |
- | |
28 | mov ecx,[esp+3*4+32-16] |
- | |
29 | call drawletter |
- | |
30 | pop edx ecx eax |
- | |
31 | - | ||
32 | add eax,6*65536 |
- | |
33 | - | ||
34 | inc ecx |
- | |
- | 21 | jmp dtext.output_end |
|
35 | dec edx |
22 | @@: |
- | 23 | ||
- | 24 | movzx edx,byte [ebp] ;edx=ascii code |
|
36 | jnz .letnew |
25 | test edx,edx |
37 | 26 | jz dtext.output_end |
|
38 | popad |
27 | test ecx,0x10000000 |
- | 28 | jnz dtext.letnew2 |
|
- | 29 | ||
39 | ret |
30 | align 4 |
40 | 31 | .letnew: |
|
41 | align 4 |
32 | |
42 | drawletter: |
33 | drawletter: ;output char of type 1(monotype) |
43 | ;eax - x |
34 | ;eax - x |
44 | ;ebx - y |
35 | ;ebx - y |
45 | ;ecx - color |
36 | ;ecx - color |
46 | ;edx - ascii code |
37 | ;edx - ascii code |
47 | pushad |
38 | pushad |
48 | call [disable_mouse] |
39 | call [disable_mouse] |
49 | mov esi,9 |
40 | mov esi,9 |
50 | lea ebp,[0x3F600+8*edx+edx] |
41 | lea ebp,[0x3F600+8*edx+edx] |
51 | .symloop: |
42 | .symloop: |
52 | push esi |
43 | push esi |
53 | mov dl,byte [ebp] |
44 | mov dl,byte [ebp] |
54 | mov esi,8 |
45 | mov esi,8 |
55 | .pixloop: |
46 | .pixloop: |
56 | test dl,1 |
47 | test dl,1 |
57 | jz .nopix |
48 | jz .nopix |
58 | call [putpixel] |
49 | call [putpixel] |
59 | .nopix: |
50 | .nopix: |
60 | shr dl,1 |
51 | shr dl,1 |
61 | inc eax |
52 | inc eax |
62 | dec esi |
53 | dec esi |
63 | jnz .pixloop |
54 | jnz .pixloop |
64 | sub eax,8 |
55 | sub eax,8 |
65 | inc ebx |
56 | inc ebx |
66 | inc ebp |
57 | inc ebp |
67 | pop esi |
58 | pop esi |
68 | dec esi |
59 | dec esi |
69 | jnz .symloop |
60 | jnz .symloop |
70 | popad |
61 | popad |
71 | ret |
- | |
72 | - | ||
73 | - | ||
74 | - | ||
75 | dtext2: |
- | |
76 | - | ||
77 | ; eax x & y |
- | |
78 | ; ebx color |
- | |
79 | ; ecx start of text |
- | |
80 | ; edx length |
- | |
81 | ; edi 1 force |
- | |
82 | 62 | ||
83 | pushad |
63 | add eax,6 |
84 | 64 | ||
85 | mov esi,edx |
- | |
86 | and esi,0xff |
65 | inc ebp ;ptr to text |
87 | test esi,esi ; zero length ? |
- | |
88 | jnz @f |
- | |
89 | popad |
- | |
90 | ret |
- | |
91 | @@: |
66 | dec esi ;length |
92 | - | ||
93 | align 4 |
- | |
94 | letnew2: |
- | |
95 | - | ||
96 | push ecx |
- | |
97 | push edx |
- | |
98 | movzx ebx,ax |
- | |
99 | shr eax,16 |
- | |
100 | movzx edx,byte [ecx] |
- | |
101 | mov ecx,[esp+2*4+32-16] |
- | |
102 | call drawletter2 |
- | |
103 | shl eax,16 |
- | |
104 | add eax,ebx |
- | |
105 | pop edx |
- | |
106 | pop ecx |
- | |
107 | - | ||
108 | inc ecx |
67 | jnz dtext.lnew |
109 | dec edx |
68 | |
110 | jnz letnew2 |
69 | jmp dtext.output_end |
111 | 70 | ||
112 | popad |
71 | |
113 | ret |
72 | dtext.letnew2: |
114 | 73 | ||
115 | align 4 |
74 | align 4 |
116 | drawletter2: |
75 | drawletter2: ;output char of type 2(proportional) |
117 | ;eax - x |
76 | ;eax - x |
118 | ;ebx - y |
77 | ;ebx - y |
119 | ;ecx - color |
78 | ;ecx - color |
120 | ;edx - symbol |
79 | ;edx - symbol |
121 | ;edi - force? |
80 | ;edi - force? |
122 | ;result - eax=eax+sym_size |
81 | ;result - eax=eax+sym_size |
123 | pushad |
82 | pushad |
124 | call [disable_mouse] |
83 | call [disable_mouse] |
125 | shl edx,1 |
84 | shl edx,1 |
126 | mov esi,9 |
85 | mov esi,9 |
127 | lea ebp,[0x3EC00+4*edx+edx+1] |
86 | lea ebp,[0x3EC00+4*edx+edx+1] |
128 | .symloop: |
87 | .symloop: |
129 | push esi |
88 | push esi |
130 | mov dl,byte [ebp] |
89 | mov dl,byte [ebp] |
131 | xor esi,esi |
90 | xor esi,esi |
132 | .pixloop: |
91 | .pixloop: |
133 | test dl,1 |
92 | test dl,1 |
134 | jz .nopix |
93 | jz .nopix |
135 | call [putpixel] |
94 | call [putpixel] |
136 | .nopix: |
95 | .nopix: |
137 | shr dl,1 |
96 | shr dl,1 |
138 | inc esi |
97 | inc esi |
139 | inc eax |
98 | inc eax |
140 | cmp esi,8 |
99 | cmp esi,8 |
141 | jl .pixloop |
100 | jl .pixloop |
142 | sub eax,8 |
101 | sub eax,8 |
143 | inc ebx |
102 | inc ebx |
144 | pop esi |
103 | pop esi |
145 | inc ebp |
104 | inc ebp |
146 | dec esi |
105 | dec esi |
147 | jnz .symloop |
106 | jnz .symloop |
148 | movzx edx,byte [ebp-10] |
107 | movzx edx,byte [ebp-10] |
149 | add [esp+32-4],edx |
108 | add [esp+32-4],edx |
150 | popad |
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 |
|
151 | ret |
119 | ret |
152 | 120 |