Rev 129 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 129 | Rev 384 | ||
---|---|---|---|
Line 120... | Line 120... | ||
120 | .cx dd 0 |
120 | .cx dd 0 |
121 | endg |
121 | endg |
Line 122... | Line 122... | ||
122 | 122 | ||
Line 123... | Line 123... | ||
123 | checkVga_N13: |
123 | checkVga_N13: |
124 | 124 | ||
Line 125... | Line 125... | ||
125 | cmp [0xfe0c],dword 0x13 |
125 | cmp [SCR_MODE],dword 0x13 |
126 | jne @f |
126 | jne @f |
127 | 127 | ||
128 | ; cnvl: |
128 | ; cnvl: |
129 | pushad |
129 | pushad |
130 | cmp [EGA_counter],1 |
130 | cmp [EGA_counter],1 |
131 | je novesal |
131 | je novesal |
132 | mov ecx,[0xfb0a] |
132 | mov ecx,[MOUSE_X] |
133 | cmp ecx,[novesachecksum] |
133 | cmp ecx,[novesachecksum] |
134 | jne novesal |
134 | jne novesal |
Line 149... | Line 149... | ||
149 | mov eax,480-100 |
149 | mov eax,480-100 |
150 | m13l4: |
150 | m13l4: |
151 | sub eax,100 |
151 | sub eax,100 |
152 | imul eax,640*4 |
152 | imul eax,640*4 |
153 | add ecx,eax |
153 | add ecx,eax |
154 | movzx eax,word [0xfb0a] |
154 | movzx eax,word [MOUSE_X] |
155 | cmp eax,160 |
155 | cmp eax,160 |
156 | jge m13l1 |
156 | jge m13l1 |
157 | mov eax,160 |
157 | mov eax,160 |
158 | m13l1: |
158 | m13l1: |
159 | cmp eax,640-160 |
159 | cmp eax,640-160 |
Line 161... | Line 161... | ||
161 | mov eax,640-160 |
161 | mov eax,640-160 |
162 | m13l2: |
162 | m13l2: |
163 | sub eax,160 |
163 | sub eax,160 |
164 | shl eax,2 |
164 | shl eax,2 |
165 | add ecx,eax |
165 | add ecx,eax |
166 | mov esi,[0xfe80] |
166 | mov esi,[LFBAddress] |
167 | add esi,ecx |
167 | add esi,ecx |
168 | mov edi,0xa0000 |
168 | mov edi,VGABasePtr |
169 | mov edx,200 |
169 | mov edx,200 |
170 | mov ecx,320 |
170 | mov ecx,320 |
171 | cld |
171 | cld |
172 | m13pix: |
172 | m13pix: |
173 | lodsd |
173 | lodsd |
Line 195... | Line 195... | ||
195 | popad |
195 | popad |
196 | ret |
196 | ret |
Line 197... | Line 197... | ||
197 | 197 | ||
198 | VGA_drawbackground: |
198 | VGA_drawbackground: |
199 | ; draw all |
199 | ; draw all |
200 | cmp [0xfe0c],dword 0x12 |
200 | cmp [SCR_MODE],dword 0x12 |
201 | jne .end |
201 | jne .end |
202 | pushad |
202 | pushad |
203 | mov esi,[0xfe80] |
203 | mov esi,[LFBAddress] |
204 | mov edi,0xa0000 |
204 | mov edi,VGABasePtr |
205 | mov ebx,640/32 ; 640*480/(8*4) |
205 | mov ebx,640/32 ; 640*480/(8*4) |
206 | mov edx,480 |
206 | mov edx,480 |
207 | @@: |
207 | @@: |
208 | push ebx edx esi edi |
208 | push ebx edx esi edi |
Line 320... | Line 320... | ||
320 | mov eax, [esp+32-8+4] ; color |
320 | mov eax, [esp+32-8+4] ; color |
321 | shl ebx,9 |
321 | shl ebx,9 |
322 | lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5 |
322 | lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5 |
323 | lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32) |
323 | lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32) |
324 | mov edi,edx |
324 | mov edi,edx |
325 | add edi, [0xfe80] ; + LFB address |
325 | add edi, [LFBAddress] ; + LFB address |
326 | mov [edi], eax ; write to LFB for Vesa2.0 |
326 | mov [edi], eax ; write to LFB for Vesa2.0 |
327 | shr edx,5 ; change BytesPerPixel to 1/8 |
327 | shr edx,5 ; change BytesPerPixel to 1/8 |
328 | mov edi,edx |
328 | mov edi,edx |
329 | add edi, 0x0a0000 ; address of pixel in VGA area |
329 | add edi, VGABasePtr ; address of pixel in VGA area |
330 | and ecx,0x07 ; bit no. (modulo 8) |
330 | and ecx,0x07 ; bit no. (modulo 8) |
331 | pushfd |
331 | pushfd |
332 | ; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8) |
332 | ; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8) |
333 | xor edx,edx |
333 | xor edx,edx |
334 | cmp eax,0 |
334 | cmp eax,0 |
Line 371... | Line 371... | ||
371 | ret |
371 | ret |
Line 372... | Line 372... | ||
372 | 372 | ||
373 | VGA__putimage: |
373 | VGA__putimage: |
374 | ; ecx = size [x|y] |
374 | ; ecx = size [x|y] |
375 | ; edx = coordinates [x|y] |
375 | ; edx = coordinates [x|y] |
376 | cmp [0xfe0c],dword 0x12 |
376 | cmp [SCR_MODE],dword 0x12 |
377 | jne @f |
377 | jne @f |
378 | pushad |
378 | pushad |
379 | rol edx,16 |
379 | rol edx,16 |
380 | movzx eax,dx |
380 | movzx eax,dx |
Line 391... | Line 391... | ||
391 | VGA_draw_bar: |
391 | VGA_draw_bar: |
392 | ; eax cx |
392 | ; eax cx |
393 | ; ebx cy |
393 | ; ebx cy |
394 | ; ecx xe |
394 | ; ecx xe |
395 | ; edx ye |
395 | ; edx ye |
396 | cmp [0xfe0c],dword 0x12 |
396 | cmp [SCR_MODE],dword 0x12 |
397 | jne @f |
397 | jne @f |
398 | pushad |
398 | pushad |
399 | sub ecx,eax |
399 | sub ecx,eax |
400 | sub edx,ebx |
400 | sub edx,ebx |
401 | and eax,0xffff |
401 | and eax,0xffff |
Line 407... | Line 407... | ||
407 | @@: |
407 | @@: |
408 | ret |
408 | ret |
Line 409... | Line 409... | ||
409 | 409 | ||
410 | VGA_draw_bar_1: |
410 | VGA_draw_bar_1: |
411 | mov [temp.cx],eax |
411 | mov [temp.cx],eax |
412 | mov eax, [0x3010] |
412 | mov eax, [TASK_BASE] |
413 | add ebx, [eax-twdw + 4] |
413 | add ebx, [eax-twdw + 4] |
414 | mov eax, [eax-twdw + 0] |
414 | mov eax, [eax-twdw + 0] |
415 | add eax, [temp.cx] |
415 | add eax, [temp.cx] |
416 | and eax,0xfff8 |
416 | and eax,0xfff8 |
417 | shl ebx,9 |
417 | shl ebx,9 |
418 | lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5 |
418 | lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5 |
419 | lea ebx, [ebx+eax*4] ; + x*BytesPerPixel (Vesa2.0 32) |
419 | lea ebx, [ebx+eax*4] ; + x*BytesPerPixel (Vesa2.0 32) |
420 | mov esi,ebx |
420 | mov esi,ebx |
421 | add esi, [0xfe80] ; + LFB address |
421 | add esi, [LFBAddress] ; + LFB address |
422 | shr ebx,5 ; change BytesPerPixel to 1/8 |
422 | shr ebx,5 ; change BytesPerPixel to 1/8 |
423 | mov edi,ebx |
423 | mov edi,ebx |
424 | add edi, 0x0a0000 ; address of pixel in VGA area |
424 | add edi, VGABasePtr ; address of pixel in VGA area |
425 | mov ebx,ecx |
425 | mov ebx,ecx |
426 | shr ebx,5 |
426 | shr ebx,5 |
427 | inc ebx |
427 | inc ebx |
428 | .main_loop: |
428 | .main_loop: |