Rev 2288 | Rev 2448 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2288 | Rev 2436 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | ;; ;; |
9 | ;; ;; |
10 | ;; Paul Butcher, paul.butcher@asa.co.uk ;; |
10 | ;; Paul Butcher, paul.butcher@asa.co.uk ;; |
11 | ;; ;; |
11 | ;; ;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 13... | Line 13... | ||
13 | 13 | ||
14 | $Revision: 2288 $ |
- | |
Line -... | Line 14... | ||
- | 14 | $Revision: 2436 $ |
|
- | 15 | ||
15 | 16 | ;------------------------------------------------------------------------------ |
|
Line 16... | Line 17... | ||
16 | 17 | align 4 |
|
17 | paletteVGA: |
18 | paletteVGA: |
18 | 19 | ||
19 | ;16 colour palette |
20 | ;16 colour palette |
Line 20... | Line 21... | ||
20 | mov dx, 0x3c8 |
21 | mov dx, 0x3c8 |
21 | mov al, 0 |
22 | mov al, 0 |
22 | out dx, al |
23 | out dx, al |
- | 24 | ||
23 | 25 | mov ecx, 16 |
|
24 | mov ecx, 16 |
26 | mov dx, 0x3c9 |
25 | mov dx, 0x3c9 |
- | |
26 | xor eax, eax |
27 | xor eax, eax |
27 | 28 | ;-------------------------------------- |
|
28 | palvganew: |
29 | align 4 |
29 | 30 | palvganew: |
|
30 | mov al, 0 |
31 | mov al, 0 |
31 | test ah, 4 |
32 | test ah, 4 |
32 | jz palvgalbl1 |
33 | jz palvgalbl1 |
- | 34 | add al, 31 |
|
- | 35 | test ah, 8 |
|
33 | add al, 31 |
36 | jz palvgalbl1 |
34 | test ah, 8 |
37 | add al, 32 |
35 | jz palvgalbl1 |
38 | ;-------------------------------------- |
36 | add al, 32 |
39 | align 4 |
37 | palvgalbl1: |
40 | palvgalbl1: |
38 | out dx, al; red 0,31 or 63 |
41 | out dx, al; red 0,31 or 63 |
39 | mov al, 0 |
42 | mov al, 0 |
40 | test ah, 2 |
43 | test ah, 2 |
41 | jz palvgalbl2 |
44 | jz palvgalbl2 |
- | 45 | add al, 31 |
|
- | 46 | test ah, 8 |
|
42 | add al, 31 |
47 | jz palvgalbl2 |
43 | test ah, 8 |
48 | add al, 32 |
44 | jz palvgalbl2 |
49 | ;-------------------------------------- |
45 | add al, 32 |
50 | align 4 |
46 | palvgalbl2: |
51 | palvgalbl2: |
47 | out dx, al; blue 0,31 or 63 |
52 | out dx, al; blue 0,31 or 63 |
48 | mov al, 0 |
53 | mov al, 0 |
49 | test ah, 1 |
54 | test ah, 1 |
50 | jz palvgalbl3 |
55 | jz palvgalbl3 |
- | 56 | add al, 31 |
|
- | 57 | test ah, 8 |
|
51 | add al, 31 |
58 | jz palvgalbl3 |
52 | test ah, 8 |
59 | add al, 32 |
53 | jz palvgalbl3 |
60 | ;-------------------------------------- |
54 | add al, 32 |
61 | align 4 |
55 | palvgalbl3: |
62 | palvgalbl3: |
56 | out dx, al; green 0,31 or 63 |
63 | out dx, al; green 0,31 or 63 |
57 | add ah, 1 |
64 | add ah, 1 |
58 | loop palvganew |
65 | loop palvganew |
- | 66 | ; mov dx, 3ceh |
|
59 | ; mov dx, 3ceh |
67 | ; mov ax, 0005h |
60 | ; mov ax, 0005h |
68 | ; out dx, ax |
61 | ; out dx, ax |
- | |
62 | ret |
69 | ret |
63 | 70 | ;------------------------------------------------------------------------------ |
|
64 | palette320x200: |
71 | align 4 |
65 | 72 | palette320x200: |
|
66 | mov edx, 0x3c8 |
73 | mov edx, 0x3c8 |
67 | xor eax, eax |
74 | xor eax, eax |
- | 75 | out dx, al |
|
68 | out dx, al |
76 | mov ecx, 256 |
69 | mov ecx, 256 |
77 | mov edx, 0x3c9 |
70 | mov edx, 0x3c9 |
78 | xor eax, eax |
71 | xor eax, eax |
79 | ;-------------------------------------- |
72 | 80 | align 4 |
|
73 | palnew: |
81 | palnew: |
- | 82 | mov al, 0 |
|
- | 83 | test ah, 64 |
|
74 | mov al, 0 |
84 | jz pallbl1 |
75 | test ah, 64 |
85 | add al, 21 |
76 | jz pallbl1 |
86 | ;-------------------------------------- |
77 | add al, 21 |
87 | align 4 |
- | 88 | pallbl1: |
|
- | 89 | test ah, 128 |
|
78 | pallbl1: |
90 | jz pallbl2 |
79 | test ah, 128 |
91 | add al, 42 |
80 | jz pallbl2 |
92 | ;-------------------------------------- |
81 | add al, 42 |
93 | align 4 |
82 | pallbl2: |
94 | pallbl2: |
83 | out dx, al |
95 | out dx, al |
- | 96 | mov al, 0 |
|
- | 97 | test ah, 8 |
|
84 | mov al, 0 |
98 | jz pallbl3 |
85 | test ah, 8 |
99 | add al, 8 |
86 | jz pallbl3 |
100 | ;-------------------------------------- |
87 | add al, 8 |
101 | align 4 |
- | 102 | pallbl3: |
|
- | 103 | test ah, 16 |
|
88 | pallbl3: |
104 | jz pallbl4 |
89 | test ah, 16 |
105 | add al, 15 |
90 | jz pallbl4 |
106 | ;-------------------------------------- |
91 | add al, 15 |
107 | align 4 |
- | 108 | pallbl4: |
|
- | 109 | test ah, 32 |
|
92 | pallbl4: |
110 | jz pallbl5 |
93 | test ah, 32 |
111 | add al, 40 |
94 | jz pallbl5 |
112 | ;-------------------------------------- |
95 | add al, 40 |
113 | align 4 |
96 | pallbl5: |
114 | pallbl5: |
97 | out dx, al |
115 | out dx, al |
- | 116 | mov al, 0 |
|
- | 117 | test ah, 1 |
|
98 | mov al, 0 |
118 | jz pallbl6 |
99 | test ah, 1 |
119 | add al, 8 |
100 | jz pallbl6 |
120 | ;-------------------------------------- |
101 | add al, 8 |
121 | align 4 |
- | 122 | pallbl6: |
|
- | 123 | test ah, 2 |
|
102 | pallbl6: |
124 | jz pallbl7 |
103 | test ah, 2 |
125 | add al, 15 |
104 | jz pallbl7 |
126 | ;-------------------------------------- |
105 | add al, 15 |
127 | align 4 |
- | 128 | pallbl7: |
|
- | 129 | test ah, 4 |
|
106 | pallbl7: |
130 | jz pallbl8 |
107 | test ah, 4 |
131 | add al, 40 |
108 | jz pallbl8 |
132 | ;-------------------------------------- |
109 | add al, 40 |
133 | align 4 |
110 | pallbl8: |
- | |
111 | out dx, al |
134 | pallbl8: |
- | 135 | out dx, al |
|
112 | add ah, 1 |
136 | add ah, 1 |
113 | loop palnew |
137 | loop palnew |
114 | 138 | ret |
|
115 | ret |
139 | ;------------------------------------------------------------------------------ |
116 | align 4 |
140 | align 4 |
117 | uglobal |
141 | uglobal |
118 | novesachecksum dd 0x0 |
142 | novesachecksum dd 0x0 |
119 | EGA_counter db 0 |
143 | EGA_counter db 0 |
120 | VGA_drawing_screen db 0 |
144 | VGA_drawing_screen db 0 |
121 | VGA_8_pixels: |
145 | VGA_8_pixels: |
- | 146 | rb 16 |
|
122 | rb 16 |
147 | temp: |
123 | temp: |
148 | .cx dd 0 |
124 | .cx dd 0 |
- | |
125 | endg |
149 | endg |
126 | align 4 |
150 | ;------------------------------------------------------------------------------ |
Line 127... | Line -... | ||
127 | checkVga_N13: |
- | |
128 | 151 | align 4 |
|
129 | cmp [SCR_MODE], dword 0x13 |
152 | checkVga_N13: |
130 | jne @f |
153 | cmp [SCR_MODE], dword 0x13 |
131 | 154 | jne @f |
|
132 | ; cnvl: |
155 | |
133 | pushad |
156 | pushad |
134 | cmp [EGA_counter], 1 |
157 | cmp [EGA_counter], 1 |
- | 158 | je novesal |
|
- | 159 | mov ecx, [MOUSE_X] |
|
135 | je novesal |
160 | cmp ecx, [novesachecksum] |
136 | mov ecx, [MOUSE_X] |
161 | jne novesal |
- | 162 | popad |
|
137 | cmp ecx, [novesachecksum] |
163 | ;-------------------------------------- |
138 | jne novesal |
164 | align 4 |
139 | popad |
165 | @@: |
140 | @@: |
166 | ret |
141 | ret |
167 | ;-------------------------------------- |
142 | 168 | align 4 |
|
143 | novesal: |
169 | novesal: |
144 | mov [novesachecksum], ecx |
170 | mov [novesachecksum], ecx |
- | 171 | mov ecx, 0 |
|
- | 172 | movzx eax, word [MOUSE_Y] |
|
145 | mov ecx, 0 |
173 | cmp eax, 100 |
146 | movzx eax, word [MOUSE_Y] |
174 | jge m13l3 |
147 | cmp eax, 100 |
175 | mov eax, 100 |
148 | jge m13l3 |
176 | ;-------------------------------------- |
- | 177 | align 4 |
|
- | 178 | m13l3: |
|
149 | mov eax, 100 |
179 | cmp eax, 480-100 |
150 | m13l3: |
180 | jbe m13l4 |
151 | cmp eax, 480-100 |
181 | mov eax, 480-100 |
152 | jbe m13l4 |
182 | ;-------------------------------------- |
153 | mov eax, 480-100 |
183 | align 4 |
154 | m13l4: |
184 | m13l4: |
155 | sub eax, 100 |
185 | sub eax, 100 |
156 | imul eax, 640*4 |
186 | imul eax, 640*4 |
- | 187 | add ecx, eax |
|
- | 188 | movzx eax, word [MOUSE_X] |
|
157 | add ecx, eax |
189 | cmp eax, 160 |
158 | movzx eax, word [MOUSE_X] |
190 | jge m13l1 |
159 | cmp eax, 160 |
191 | mov eax, 160 |
160 | jge m13l1 |
192 | ;-------------------------------------- |
- | 193 | align 4 |
|
- | 194 | m13l1: |
|
161 | mov eax, 160 |
195 | cmp eax, 640-160 |
162 | m13l1: |
196 | jbe m13l2 |
163 | cmp eax, 640-160 |
197 | mov eax, 640-160 |
164 | jbe m13l2 |
198 | ;-------------------------------------- |
165 | mov eax, 640-160 |
199 | align 4 |
166 | m13l2: |
200 | m13l2: |
167 | sub eax, 160 |
201 | sub eax, 160 |
168 | shl eax, 2 |
202 | shl eax, 2 |
169 | add ecx, eax |
203 | add ecx, eax |
170 | mov esi, [LFBAddress] |
204 | mov esi, [LFBAddress] |
- | 205 | add esi, ecx |
|
- | 206 | mov edi, VGABasePtr |
|
171 | add esi, ecx |
207 | mov edx, 200 |
172 | mov edi, VGABasePtr |
208 | mov ecx, 320 |
173 | mov edx, 200 |
209 | cld |
174 | mov ecx, 320 |
210 | ;-------------------------------------- |
175 | cld |
211 | align 4 |
Line 186... | Line 222... | ||
186 | add eax, ebx |
222 | add eax, ebx |
187 | pop ebx |
223 | pop ebx |
188 | and ebx, (128+64)*256*256; red |
224 | and ebx, (128+64)*256*256; red |
189 | shr ebx, 8+8 |
225 | shr ebx, 8+8 |
190 | add eax, ebx |
226 | add eax, ebx |
- | 227 | ;-------------------------------------- |
|
- | 228 | align 4 |
|
191 | .save_pixel: |
229 | .save_pixel: |
192 | stosb |
230 | stosb |
193 | loop m13pix |
231 | loop m13pix |
194 | mov ecx, 320 |
232 | mov ecx, 320 |
195 | add esi, 4*(640-320) |
233 | add esi, 4*(640-320) |
196 | dec edx |
234 | dec edx |
197 | jnz m13pix |
235 | jnz m13pix |
198 | mov [EGA_counter], 0 |
236 | mov [EGA_counter], 0 |
199 | popad |
237 | popad |
200 | ret |
238 | ret |
- | 239 | ;------------------------------------------------------------------------------ |
|
201 | 240 | align 4 |
|
202 | VGA_drawbackground: |
241 | VGA_drawbackground: |
203 | ; draw all |
242 | ; draw all |
204 | cmp [SCR_MODE], dword 0x12 |
- | |
205 | jne .end |
- | |
206 | pushad |
243 | pushad |
207 | mov esi, [LFBAddress] |
244 | mov esi, [LFBAddress] |
208 | mov edi, VGABasePtr |
245 | mov edi, VGABasePtr |
209 | mov ebx, 640/32; 640*480/(8*4) |
246 | mov ebx, 640/32; 640*480/(8*4) |
210 | mov edx, 480 |
247 | mov edx, 480 |
- | 248 | ;-------------------------------------- |
|
- | 249 | align 4 |
|
211 | @@: |
250 | @@: |
212 | push ebx edx esi edi |
251 | push ebx edx esi edi |
213 | shl edx, 9 |
252 | shl edx, 9 |
214 | lea edx, [edx+edx*4] |
253 | lea edx, [edx+edx*4] |
215 | add esi, edx |
254 | add esi, edx |
Line 219... | Line 258... | ||
219 | pop edi esi edx ebx |
258 | pop edi esi edx ebx |
220 | dec edx |
259 | dec edx |
221 | jnz @r |
260 | jnz @r |
222 | call VGA_draw_long_line_1 |
261 | call VGA_draw_long_line_1 |
223 | popad |
262 | popad |
224 | .end: |
- | |
225 | ret |
263 | ret |
- | 264 | ;------------------------------------------------------------------------------ |
|
226 | 265 | align 4 |
|
227 | VGA_draw_long_line: |
266 | VGA_draw_long_line: |
228 | mov dx, 3ceh |
267 | mov dx, 3ceh |
229 | mov ax, 0ff08h |
268 | mov ax, 0ff08h |
230 | cli |
269 | cli |
231 | out dx, ax |
270 | out dx, ax |
232 | mov ax, 0005h |
271 | mov ax, 0005h |
233 | out dx, ax |
272 | out dx, ax |
- | 273 | ;-------------------------------------- |
|
- | 274 | align 4 |
|
234 | m12pix: |
275 | m12pix: |
235 | call VGA_draw_32_pixels |
276 | call VGA_draw_32_pixels |
236 | dec ebx |
277 | dec ebx |
237 | jnz m12pix |
278 | jnz m12pix |
238 | mov dx, 3c4h |
279 | mov dx, 3c4h |
Line 244... | Line 285... | ||
244 | mov dx, 3ceh |
285 | mov dx, 3ceh |
245 | mov al, 08h |
286 | mov al, 08h |
246 | out dx, al |
287 | out dx, al |
247 | sti |
288 | sti |
248 | ret |
289 | ret |
- | 290 | ;------------------------------------------------------------------------------ |
|
249 | 291 | align 4 |
|
250 | VGA_draw_32_pixels: |
292 | VGA_draw_32_pixels: |
251 | xor eax, eax |
293 | xor eax, eax |
252 | mov ebp, VGA_8_pixels |
294 | mov ebp, VGA_8_pixels |
253 | mov [ebp], eax |
295 | mov [ebp], eax |
254 | mov [ebp+4], eax |
296 | mov [ebp+4], eax |
255 | mov [ebp+8], eax |
297 | mov [ebp+8], eax |
256 | mov [ebp+12], eax |
298 | mov [ebp+12], eax |
257 | mov ch, 4 |
299 | mov ch, 4 |
- | 300 | ;-------------------------------------- |
|
- | 301 | align 4 |
|
258 | .main_loop: |
302 | .main_loop: |
259 | mov cl, 8 |
303 | mov cl, 8 |
- | 304 | ;-------------------------------------- |
|
- | 305 | align 4 |
|
260 | .convert_pixels_to_VGA: |
306 | .convert_pixels_to_VGA: |
261 | lodsd ; eax = 24bit colour |
307 | lodsd ; eax = 24bit colour |
262 | test eax, eax |
308 | test eax, eax |
263 | jz .end |
309 | jz .end |
264 | rol eax, 8 |
310 | rol eax, 8 |
Line 271... | Line 317... | ||
271 | jbe .p13green |
317 | jbe .p13green |
272 | or [ebp], ch |
318 | or [ebp], ch |
273 | cmp al, 170 |
319 | cmp al, 170 |
274 | jbe .p13green |
320 | jbe .p13green |
275 | or [ebp+12], ch |
321 | or [ebp+12], ch |
- | 322 | ;-------------------------------------- |
|
- | 323 | align 4 |
|
276 | .p13green: |
324 | .p13green: |
277 | cmp ah, 85 |
325 | cmp ah, 85 |
278 | jbe .p13red |
326 | jbe .p13red |
279 | or [ebp+4], ch |
327 | or [ebp+4], ch |
280 | cmp ah, 170 |
328 | cmp ah, 170 |
281 | jbe .p13red |
329 | jbe .p13red |
282 | or [ebp+12], ch |
330 | or [ebp+12], ch |
- | 331 | ;-------------------------------------- |
|
- | 332 | align 4 |
|
283 | .p13red: |
333 | .p13red: |
284 | shr eax, 8 |
334 | shr eax, 8 |
285 | cmp ah, 85 |
335 | cmp ah, 85 |
286 | jbe .p13cont |
336 | jbe .p13cont |
287 | or [ebp+8], ch |
337 | or [ebp+8], ch |
288 | cmp ah, 170 |
338 | cmp ah, 170 |
289 | jbe .p13cont |
339 | jbe .p13cont |
290 | or [ebp+12], ch |
340 | or [ebp+12], ch |
- | 341 | ;-------------------------------------- |
|
- | 342 | align 4 |
|
291 | .p13cont: |
343 | .p13cont: |
292 | ror eax, 8 |
344 | ror eax, 8 |
293 | mov ch, ah |
345 | mov ch, ah |
294 | inc cl |
346 | inc cl |
- | 347 | ;-------------------------------------- |
|
- | 348 | align 4 |
|
295 | .end: |
349 | .end: |
296 | dec cl |
350 | dec cl |
297 | jnz .convert_pixels_to_VGA |
351 | jnz .convert_pixels_to_VGA |
298 | inc ebp |
352 | inc ebp |
299 | dec ch |
353 | dec ch |
Line 301... | Line 355... | ||
301 | push esi |
355 | push esi |
302 | sub ebp, 4 |
356 | sub ebp, 4 |
303 | mov esi, ebp |
357 | mov esi, ebp |
304 | mov dx, 3c4h |
358 | mov dx, 3c4h |
305 | mov ah, 1h |
359 | mov ah, 1h |
- | 360 | ;-------------------------------------- |
|
- | 361 | align 4 |
|
306 | @@: |
362 | @@: |
307 | mov al, 02h |
363 | mov al, 02h |
308 | out dx, ax |
364 | out dx, ax |
309 | xchg ax, bp |
365 | xchg ax, bp |
310 | lodsd |
366 | lodsd |
Line 314... | Line 370... | ||
314 | cmp ah, 10h |
370 | cmp ah, 10h |
315 | jnz @r |
371 | jnz @r |
316 | add edi, 4 |
372 | add edi, 4 |
317 | pop esi |
373 | pop esi |
318 | ret |
374 | ret |
- | 375 | ;------------------------------------------------------------------------------ |
|
319 | 376 | align 4 |
|
320 | VGA_putpixel: |
377 | VGA_putpixel: |
321 | ; eax = x |
378 | ; eax = x |
322 | ; ebx = y |
379 | ; ebx = y |
323 | mov ecx, eax |
380 | mov ecx, eax |
324 | mov eax, [esp+32-8+4] ; color |
381 | mov eax, [esp+32-8+4] ; color |
- | 382 | ;-------------------------------------- |
|
- | 383 | push ecx |
|
- | 384 | shl ecx, 16 |
|
- | 385 | mov cx, bx |
|
- | 386 | ; check mouse area for putpixel |
|
- | 387 | test eax, 0x04000000 |
|
- | 388 | jnz @f |
|
- | 389 | call [_display.check_mouse] |
|
- | 390 | ;-------------------------------------- |
|
- | 391 | align 4 |
|
- | 392 | @@: |
|
- | 393 | pop ecx |
|
325 | shl ebx, 9 |
394 | shl ebx, 9 |
326 | lea ebx, [ebx+ebx*4] ; óìíîæåíèå íà 5 |
395 | lea ebx, [ebx+ebx*4] ; óìíîæåíèå íà 5 |
327 | lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32) |
396 | lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32) |
328 | mov edi, edx |
397 | mov edi, edx |
329 | add edi, [LFBAddress] ; + LFB address |
398 | add edi, [LFBAddress] ; + LFB address |
Line 341... | Line 410... | ||
341 | jbe .p13green |
410 | jbe .p13green |
342 | or dl, 0x01 |
411 | or dl, 0x01 |
343 | cmp al, 170 |
412 | cmp al, 170 |
344 | jbe .p13green |
413 | jbe .p13green |
345 | or dl, 0x08 |
414 | or dl, 0x08 |
- | 415 | ;-------------------------------------- |
|
- | 416 | align 4 |
|
346 | .p13green: |
417 | .p13green: |
347 | cmp ah, 85 |
418 | cmp ah, 85 |
348 | jbe .p13red |
419 | jbe .p13red |
349 | or dl, 0x02 |
420 | or dl, 0x02 |
350 | cmp ah, 170 |
421 | cmp ah, 170 |
351 | jbe .p13red |
422 | jbe .p13red |
352 | or dl, 0x08 |
423 | or dl, 0x08 |
- | 424 | ;-------------------------------------- |
|
- | 425 | align 4 |
|
353 | .p13red: |
426 | .p13red: |
354 | shr eax, 8 |
427 | shr eax, 8 |
355 | cmp ah, 85 |
428 | cmp ah, 85 |
356 | jbe .p13cont |
429 | jbe .p13cont |
357 | or dl, 0x04 |
430 | or dl, 0x04 |
358 | cmp ah, 170 |
431 | cmp ah, 170 |
359 | jbe .p13cont |
432 | jbe .p13cont |
360 | or dl, 0x08 |
433 | or dl, 0x08 |
- | 434 | ;-------------------------------------- |
|
- | 435 | align 4 |
|
361 | .p13cont: |
436 | .p13cont: |
362 | ror edx, 8 |
437 | ror edx, 8 |
363 | inc cl |
438 | inc cl |
364 | xor eax, eax |
439 | xor eax, eax |
365 | inc ah |
440 | inc ah |
Line 369... | Line 444... | ||
369 | out dx, al |
444 | out dx, al |
370 | mov al, [edi] ; dummy read |
445 | mov al, [edi] ; dummy read |
371 | rol edx, 8 |
446 | rol edx, 8 |
372 | mov [edi], dl |
447 | mov [edi], dl |
373 | popfd |
448 | popfd |
374 | ;.end: |
- | |
375 | ret |
449 | ret |
- | 450 | ;------------------------------------------------------------------------------ |
|
376 | 451 | align 4 |
|
377 | VGA__putimage: |
452 | VGA__putimage: |
378 | ; ecx = size [x|y] |
453 | ; ecx = size [x|y] |
379 | ; edx = coordinates [x|y] |
454 | ; edx = coordinates [x|y] |
380 | cmp [SCR_MODE], dword 0x12 |
- | |
381 | jne @f |
- | |
382 | pushad |
455 | pushad |
383 | rol edx, 16 |
456 | rol edx, 16 |
384 | movzx eax, dx |
457 | movzx eax, dx |
385 | rol edx, 16 |
458 | rol edx, 16 |
386 | movzx ebx, dx |
459 | movzx ebx, dx |
387 | movzx edx, cx |
460 | movzx edx, cx |
388 | rol ecx, 16 |
461 | rol ecx, 16 |
389 | movzx ecx, cx |
462 | movzx ecx, cx |
390 | call VGA_draw_bar_1 |
463 | call VGA_draw_bar_1 |
391 | popad |
464 | popad |
392 | @@: |
- | |
393 | ret |
465 | ret |
- | 466 | ;------------------------------------------------------------------------------ |
|
394 | 467 | align 4 |
|
395 | VGA_draw_bar: |
468 | VGA_draw_bar: |
396 | ; eax cx |
469 | ; eax cx |
397 | ; ebx cy |
470 | ; ebx cy |
398 | ; ecx xe |
471 | ; ecx xe |
399 | ; edx ye |
472 | ; edx ye |
400 | cmp [SCR_MODE], dword 0x12 |
- | |
401 | jne @f |
- | |
402 | pushad |
473 | pushad |
403 | sub ecx, eax |
474 | sub ecx, eax |
404 | sub edx, ebx |
475 | sub edx, ebx |
405 | and eax, 0xffff |
476 | and eax, 0xffff |
406 | and ebx, 0xffff |
477 | and ebx, 0xffff |
407 | and ecx, 0xffff |
478 | and ecx, 0xffff |
408 | and edx, 0xffff |
479 | and edx, 0xffff |
409 | call VGA_draw_bar_1 |
480 | call VGA_draw_bar_1 |
410 | popad |
481 | popad |
411 | @@: |
- | |
412 | ret |
482 | ret |
- | 483 | ;------------------------------------------------------------------------------ |
|
413 | 484 | align 4 |
|
414 | VGA_draw_bar_1: |
485 | VGA_draw_bar_1: |
415 | mov [temp.cx], eax |
486 | mov [temp.cx], eax |
416 | mov eax, [TASK_BASE] |
487 | mov eax, [TASK_BASE] |
417 | add ebx, [eax-twdw + 4] |
488 | add ebx, [eax-twdw + 4] |
418 | mov eax, [eax-twdw + 0] |
489 | mov eax, [eax-twdw + 0] |
Line 427... | Line 498... | ||
427 | mov edi, ebx |
498 | mov edi, ebx |
428 | add edi, VGABasePtr ; address of pixel in VGA area |
499 | add edi, VGABasePtr ; address of pixel in VGA area |
429 | mov ebx, ecx |
500 | mov ebx, ecx |
430 | shr ebx, 5 |
501 | shr ebx, 5 |
431 | inc ebx |
502 | inc ebx |
- | 503 | ;-------------------------------------- |
|
- | 504 | align 4 |
|
432 | .main_loop: |
505 | .main_loop: |
433 | call VGA_draw_long_line_1 |
506 | call VGA_draw_long_line_1 |
434 | dec edx |
507 | dec edx |
435 | jnz .main_loop |
508 | jnz .main_loop |
436 | call VGA_draw_long_line_1 |
509 | call VGA_draw_long_line_1 |
437 | ret |
510 | ret |
- | 511 | ;------------------------------------------------------------------------------ |
|
438 | 512 | align 4 |
|
439 | VGA_draw_long_line_1: |
513 | VGA_draw_long_line_1: |
440 | push ebx edx esi edi |
514 | push ebx edx esi edi |
441 | shl edx, 9 |
515 | shl edx, 9 |
442 | lea edx, [edx+edx*4] |
516 | lea edx, [edx+edx*4] |
443 | add esi, edx |
517 | add esi, edx |
444 | shr edx, 5 |
518 | shr edx, 5 |
445 | add edi, edx |
519 | add edi, edx |
446 | call VGA_draw_long_line |
520 | call VGA_draw_long_line |
447 | pop edi esi edx ebx |
521 | pop edi esi edx ebx |
448 | ret |
522 | ret |
449 | - | ||
450 | - | ||
- | 523 | ;------------------------------------------------------------------------------ |