Rev 3626 | Rev 4423 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3626 | Rev 4288 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | ;; ;; |
15 | ;; ;; |
16 | ;; See file COPYING for details ;; |
16 | ;; See file COPYING for details ;; |
17 | ;; ;; |
17 | ;; ;; |
18 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
18 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 19... | Line 19... | ||
19 | 19 | ||
Line 20... | Line 20... | ||
20 | $Revision: 3626 $ |
20 | $Revision: 4288 $ |
21 | 21 | ||
Line 22... | Line -... | ||
22 | - | ||
23 | ; If you're planning to write your own video driver I suggest |
- | |
24 | ; you replace the VESA12.INC file and see those instructions. |
- | |
25 | - | ||
26 | ;Screen_Max_X equ 0xfe00 |
- | |
27 | ;Screen_Max_Y equ 0xfe04 |
- | |
28 | ;BytesPerScanLine equ 0xfe08 |
- | |
Line 29... | Line 22... | ||
29 | ;LFBAddress equ 0xfe80 |
22 | |
30 | ;ScreenBPP equ 0xfbf1 |
23 | ; If you're planning to write your own video driver I suggest |
31 | 24 | ; you replace the VESA12.INC file and see those instructions. |
|
32 | 25 | ||
Line 223... | Line 216... | ||
223 | ; lea eax, [eax + eax * 2] |
216 | ; lea eax, [eax + eax * 2] |
224 | call esi |
217 | call esi |
225 | add eax, [putimg.arg_0] |
218 | add eax, [putimg.arg_0] |
226 | mov [putimg.line_increment], eax |
219 | mov [putimg.line_increment], eax |
227 | ; winmap new line increment |
220 | ; winmap new line increment |
228 | mov eax, [Screen_Max_X] |
221 | mov eax, [_display.width] |
229 | inc eax |
- | |
230 | sub eax, [putimg.real_sx] |
222 | sub eax, [putimg.real_sx] |
231 | mov [putimg.winmap_newline], eax |
223 | mov [putimg.winmap_newline], eax |
232 | ; screen new line increment |
224 | ; screen new line increment |
233 | mov eax, [_display.pitch] |
225 | mov eax, [_display.pitch] |
234 | mov ebx, [_display.bpp] |
226 | mov ebx, [_display.bpp] |
Line 247... | Line 239... | ||
247 | ; shr ebx, 3 |
239 | ; shr ebx, 3 |
248 | imul eax, ebx |
240 | imul eax, ebx |
249 | add edx, eax |
241 | add edx, eax |
250 | ; pointer to pixel map |
242 | ; pointer to pixel map |
251 | mov eax, [putimg.abs_cy] |
243 | mov eax, [putimg.abs_cy] |
252 | ; imul eax, [Screen_Max_X] |
- | |
253 | ; add eax, [putimg.abs_cy] |
- | |
254 | mov eax, [d_width_calc_area + eax*4] |
244 | mov eax, [d_width_calc_area + eax*4] |
Line 255... | Line 245... | ||
255 | 245 | ||
256 | add eax, [putimg.abs_cx] |
246 | add eax, [putimg.abs_cx] |
257 | add eax, [_WinMapAddress] |
247 | add eax, [_WinMapAddress] |
Line 693... | Line 683... | ||
693 | ; ecx = ?? RR GG BB ; 0x01000000 negation |
683 | ; ecx = ?? RR GG BB ; 0x01000000 negation |
694 | ; 0x02000000 used for draw_rectangle without top line |
684 | ; 0x02000000 used for draw_rectangle without top line |
695 | ; for example drawwindow_III and drawwindow_IV |
685 | ; for example drawwindow_III and drawwindow_IV |
696 | ; edi = 0x00000001 force |
686 | ; edi = 0x00000001 force |
Line 697... | Line -... | ||
697 | - | ||
698 | ;;; mov [novesachecksum], dword 0 |
687 | |
699 | pushad |
688 | pushad |
700 | cmp [Screen_Max_X], eax |
689 | cmp eax, [_display.width] |
701 | jb .exit |
690 | jae .exit |
702 | cmp [Screen_Max_Y], ebx |
691 | cmp ebx, [_display.height] |
703 | jb .exit |
692 | jae .exit |
704 | test edi, 1 ; force ? |
693 | test edi, 1 ; force ? |
Line 705... | Line 694... | ||
705 | jnz .forced |
694 | jnz .forced |
706 | 695 | ||
Line 887... | Line 876... | ||
887 | mov [LFB_BASE+edi], eax |
876 | mov [LFB_BASE+edi], eax |
888 | ret |
877 | ret |
889 | ;----------------------------------------------------------------------------- |
878 | ;----------------------------------------------------------------------------- |
890 | align 4 |
879 | align 4 |
891 | calculate_edi: |
880 | calculate_edi: |
892 | ; mov edi, ebx |
- | |
893 | ; imul edi, [Screen_Max_X] |
- | |
894 | ; add edi, ebx |
- | |
895 | mov edi, [d_width_calc_area + ebx*4] |
881 | mov edi, [d_width_calc_area + ebx*4] |
896 | add edi, eax |
882 | add edi, eax |
897 | ret |
883 | ret |
898 | ;----------------------------------------------------------------------------- |
884 | ;----------------------------------------------------------------------------- |
899 | ; DRAWLINE |
885 | ; DRAWLINE |
Line 1221... | Line 1207... | ||
1221 | ;-------------------------------------- |
1207 | ;-------------------------------------- |
1222 | align 4 |
1208 | align 4 |
1223 | .end_y: |
1209 | .end_y: |
1224 | mov [drbar.real_sy], ebx |
1210 | mov [drbar.real_sy], ebx |
1225 | ; line_inc_map |
1211 | ; line_inc_map |
1226 | mov eax, [Screen_Max_X] |
1212 | mov eax, [_display.width] |
1227 | sub eax, [drbar.real_sx] |
1213 | sub eax, [drbar.real_sx] |
1228 | inc eax |
- | |
1229 | mov [drbar.line_inc_map], eax |
1214 | mov [drbar.line_inc_map], eax |
1230 | ; line_inc_scr |
1215 | ; line_inc_scr |
1231 | mov eax, [drbar.real_sx] |
1216 | mov eax, [drbar.real_sx] |
1232 | mov ebx, [_display.bpp] |
1217 | mov ebx, [_display.bpp] |
1233 | shr ebx, 3 |
1218 | shr ebx, 3 |
Line 1242... | Line 1227... | ||
1242 | mov eax, [drbar.abs_cx] |
1227 | mov eax, [drbar.abs_cx] |
1243 | imul eax, ebx |
1228 | imul eax, ebx |
1244 | add edx, eax |
1229 | add edx, eax |
1245 | ; pointer to pixel map |
1230 | ; pointer to pixel map |
1246 | mov eax, [drbar.abs_cy] |
1231 | mov eax, [drbar.abs_cy] |
1247 | ; imul eax, [Screen_Max_X] |
- | |
1248 | ; add eax, [drbar.abs_cy] |
- | |
1249 | mov eax, [d_width_calc_area + eax*4] |
1232 | mov eax, [d_width_calc_area + eax*4] |
Line 1250... | Line 1233... | ||
1250 | 1233 | ||
1251 | add eax, [drbar.abs_cx] |
1234 | add eax, [drbar.abs_cx] |
1252 | add eax, [_WinMapAddress] |
1235 | add eax, [_WinMapAddress] |
Line 1767... | Line 1750... | ||
1767 | ;------------------------------------------------------------------------------ |
1750 | ;------------------------------------------------------------------------------ |
1768 | align 4 |
1751 | align 4 |
1769 | vesa20_drawbackground_stretch: |
1752 | vesa20_drawbackground_stretch: |
1770 | pushad |
1753 | pushad |
1771 | ; Helper variables |
1754 | ; Helper variables |
1772 | ; calculate 2^32*(BgrDataWidth-1) mod (ScreenWidth-1) |
1755 | ; calculate 2^32*(BgrDataWidth) mod (ScreenWidth) |
1773 | mov eax, [BgrDataWidth] |
1756 | mov eax, [BgrDataWidth] |
1774 | dec eax |
- | |
1775 | xor edx, edx |
1757 | xor edx, edx |
1776 | div dword [Screen_Max_X] |
1758 | div dword [_display.width] |
1777 | push eax ; high |
1759 | push eax ; high |
1778 | xor eax, eax |
1760 | xor eax, eax |
1779 | div dword [Screen_Max_X] |
1761 | div dword [_display.width] |
1780 | push eax ; low |
1762 | push eax ; low |
1781 | ; the same for height |
1763 | ; the same for height |
1782 | mov eax, [BgrDataHeight] |
1764 | mov eax, [BgrDataHeight] |
1783 | dec eax |
- | |
1784 | xor edx, edx |
1765 | xor edx, edx |
1785 | div dword [Screen_Max_Y] |
1766 | div dword [_display.height] |
1786 | push eax ; high |
1767 | push eax ; high |
1787 | xor eax, eax |
1768 | xor eax, eax |
1788 | div dword [Screen_Max_Y] |
1769 | div dword [_display.height] |
1789 | push eax ; low |
1770 | push eax ; low |
1790 | ; External loop for all y from start to end |
1771 | ; External loop for all y from start to end |
1791 | mov ebx, [draw_data+32+RECT.top] ; y start |
1772 | mov ebx, [draw_data+32+RECT.top] ; y start |
1792 | mov ebp, [draw_data+32+RECT.left] ; x start |
1773 | mov ebp, [draw_data+32+RECT.left] ; x start |
1793 | ; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp] |
1774 | ; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp] |
Line 1937... | Line 1918... | ||
1937 | cmp ebx, [draw_data+32+RECT.bottom] |
1918 | cmp ebx, [draw_data+32+RECT.bottom] |
1938 | ja sdpdone |
1919 | ja sdpdone |
1939 | ; advance edi, ebp to next scan line |
1920 | ; advance edi, ebp to next scan line |
1940 | sub eax, [draw_data+32+RECT.left] |
1921 | sub eax, [draw_data+32+RECT.left] |
1941 | sub ebp, eax |
1922 | sub ebp, eax |
1942 | add ebp, [Screen_Max_X] |
1923 | add ebp, [_display.width] |
1943 | add ebp, 1 |
- | |
1944 | sub edi, eax |
1924 | sub edi, eax |
1945 | sub edi, eax |
1925 | sub edi, eax |
1946 | sub edi, eax |
1926 | sub edi, eax |
1947 | cmp byte [_display.bpp], 24 |
1927 | cmp byte [_display.bpp], 24 |
1948 | jz @f |
1928 | jz @f |
Line 1969... | Line 1949... | ||
1969 | cmp ebx, -1 |
1949 | cmp ebx, -1 |
1970 | jnz bgr_resmooth0 |
1950 | jnz bgr_resmooth0 |
1971 | push edi |
1951 | push edi |
1972 | mov esi, bgr_next_line |
1952 | mov esi, bgr_next_line |
1973 | mov edi, bgr_cur_line |
1953 | mov edi, bgr_cur_line |
1974 | mov ecx, [Screen_Max_X] |
1954 | mov ecx, [_display.width] |
1975 | inc ecx |
1955 | inc ecx |
1976 | rep movsd |
1956 | rep movsd |
1977 | jmp bgr_resmooth1 |
1957 | jmp bgr_resmooth1 |
1978 | ;-------------------------------------- |
1958 | ;-------------------------------------- |
1979 | align 4 |
1959 | align 4 |