Rev 9715 | Rev 9930 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9715 | Rev 9925 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; VESA20.INC ;; |
6 | ;; VESA20.INC ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; Vesa 2.0 functions for MenuetOS ;; |
8 | ;; Vesa 2.0 functions for MenuetOS ;; |
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: 9715 $ |
20 | $Revision: 9925 $ |
21 | 21 | ||
22 | uglobal |
22 | uglobal |
23 | align 4 |
23 | align 4 |
Line 2011... | Line 2011... | ||
2011 | align 4 |
2011 | align 4 |
2012 | vesa20_drawbackground_tiled: |
2012 | vesa20_drawbackground_tiled: |
Line 2013... | Line 2013... | ||
2013 | 2013 | ||
2014 | pushad |
2014 | pushad |
2015 | ; External loop for all y from start to end |
2015 | ; External loop for all y from start to end |
2016 | mov ebx, [draw_data + 32 + RECT.top] ; y start |
2016 | mov ebx, [draw_data + sizeof.WDATA + RECT.top] ; y start |
2017 | dp2: |
2017 | dp2: |
2018 | mov ebp, [draw_data + 32 + RECT.left] ; x start |
2018 | mov ebp, [draw_data + sizeof.WDATA + RECT.left] ; x start |
2019 | ; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp] |
2019 | ; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp] |
2020 | ; and LFB data (output for our function) [edi] |
2020 | ; and LFB data (output for our function) [edi] |
2021 | ; mov eax, [BytesPerScanLine] |
2021 | ; mov eax, [BytesPerScanLine] |
2022 | ; mul ebx |
2022 | ; mul ebx |
Line 2111... | Line 2111... | ||
2111 | add esi, 3 |
2111 | add esi, 3 |
2112 | add edi, [_display.bytes_per_pixel] |
2112 | add edi, [_display.bytes_per_pixel] |
Line 2113... | Line 2113... | ||
2113 | 2113 | ||
2114 | add ebp, edx |
2114 | add ebp, edx |
2115 | add eax, edx |
2115 | add eax, edx |
2116 | cmp eax, [draw_data + 32 + RECT.right] |
2116 | cmp eax, [draw_data + sizeof.WDATA + RECT.right] |
2117 | ja dp4 |
2117 | ja dp4 |
2118 | sub ecx, edx |
2118 | sub ecx, edx |
Line 2119... | Line 2119... | ||
2119 | jnz dp3 |
2119 | jnz dp3 |
Line 2126... | Line 2126... | ||
2126 | jmp dp3 |
2126 | jmp dp3 |
Line 2127... | Line 2127... | ||
2127 | 2127 | ||
2128 | dp4: |
2128 | dp4: |
2129 | ; next scan line |
2129 | ; next scan line |
2130 | inc ebx |
2130 | inc ebx |
2131 | cmp ebx, [draw_data + 32 + RECT.bottom] |
2131 | cmp ebx, [draw_data + sizeof.WDATA + RECT.bottom] |
2132 | jbe dp2 |
2132 | jbe dp2 |
2133 | popad |
2133 | popad |
2134 | mov [EGA_counter], 1 |
2134 | mov [EGA_counter], 1 |
2135 | cmp [SCR_MODE], 0x12 |
2135 | cmp [SCR_MODE], 0x12 |
Line 2164... | Line 2164... | ||
2164 | xor eax, eax |
2164 | xor eax, eax |
2165 | div dword [_display.height] |
2165 | div dword [_display.height] |
2166 | push eax ; low |
2166 | push eax ; low |
Line 2167... | Line 2167... | ||
2167 | 2167 | ||
2168 | ; External loop for all y from start to end |
2168 | ; External loop for all y from start to end |
2169 | mov ebx, [draw_data + 32 + RECT.top] ; y start |
2169 | mov ebx, [draw_data + sizeof.WDATA + RECT.top] ; y start |
2170 | mov ebp, [draw_data + 32 + RECT.left] ; x start |
2170 | mov ebp, [draw_data + sizeof.WDATA + RECT.left] ; x start |
2171 | ; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp] |
2171 | ; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp] |
2172 | ; and LFB data (output for our function) [edi] |
2172 | ; and LFB data (output for our function) [edi] |
2173 | ; mov eax, [BytesPerScanLine] |
2173 | ; mov eax, [BytesPerScanLine] |
2174 | ; mul ebx |
2174 | ; mul ebx |
Line 2307... | Line 2307... | ||
2307 | add ebp, 1 |
2307 | add ebp, 1 |
2308 | mov eax, [esp+20] |
2308 | mov eax, [esp+20] |
2309 | add eax, 1 |
2309 | add eax, 1 |
2310 | mov [esp+20], eax |
2310 | mov [esp+20], eax |
2311 | add esi, 4 |
2311 | add esi, 4 |
2312 | cmp eax, [draw_data+32+RECT.right] |
2312 | cmp eax, [draw_data + sizeof.WDATA + RECT.right] |
2313 | jbe sdp3a |
2313 | jbe sdp3a |
Line 2314... | Line 2314... | ||
2314 | 2314 | ||
2315 | sdp4: |
2315 | sdp4: |
2316 | ; next y |
2316 | ; next y |
2317 | mov ebx, [esp+24] |
2317 | mov ebx, [esp+24] |
2318 | add ebx, 1 |
2318 | add ebx, 1 |
2319 | mov [esp+24], ebx |
2319 | mov [esp+24], ebx |
2320 | cmp ebx, [draw_data + 32 + RECT.bottom] |
2320 | cmp ebx, [draw_data + sizeof.WDATA + RECT.bottom] |
Line 2321... | Line 2321... | ||
2321 | ja sdpdone |
2321 | ja sdpdone |
2322 | 2322 | ||
2323 | ; advance edi, ebp to next scan line |
2323 | ; advance edi, ebp to next scan line |
2324 | sub eax, [draw_data + 32 + RECT.left] |
2324 | sub eax, [draw_data + sizeof.WDATA + RECT.left] |
2325 | sub ebp, eax |
2325 | sub ebp, eax |
2326 | add ebp, [_display.width] |
2326 | add ebp, [_display.width] |
2327 | sub edi, eax |
2327 | sub edi, eax |
Line 2344... | Line 2344... | ||
2344 | sub eax, [esp+16] |
2344 | sub eax, [esp+16] |
2345 | mov ebx, eax |
2345 | mov ebx, eax |
2346 | lea eax, [eax*3] |
2346 | lea eax, [eax*3] |
2347 | imul eax, [BgrDataWidth] |
2347 | imul eax, [BgrDataWidth] |
2348 | sub [esp], eax |
2348 | sub [esp], eax |
2349 | mov eax, [draw_data + 32 + RECT.left] |
2349 | mov eax, [draw_data + sizeof.WDATA + RECT.left] |
2350 | mov [esp+20], eax |
2350 | mov [esp+20], eax |
2351 | test ebx, ebx |
2351 | test ebx, ebx |
2352 | jz sdp3 |
2352 | jz sdp3 |
2353 | cmp ebx, -1 |
2353 | cmp ebx, -1 |
2354 | jnz bgr_resmooth0 |
2354 | jnz bgr_resmooth0 |
Line 2384... | Line 2384... | ||
2384 | @@: |
2384 | @@: |
2385 | stosd |
2385 | stosd |
2386 | mov eax, [esp+20+8] |
2386 | mov eax, [esp+20+8] |
2387 | add eax, 1 |
2387 | add eax, 1 |
2388 | mov [esp+20+8], eax |
2388 | mov [esp+20+8], eax |
2389 | cmp eax, [draw_data + 32 + RECT.right] |
2389 | cmp eax, [draw_data + sizeof.WDATA + RECT.right] |
2390 | ja @f |
2390 | ja @f |
2391 | add ecx, [esp+36+8] |
2391 | add ecx, [esp+36+8] |
2392 | mov eax, edx |
2392 | mov eax, edx |
2393 | adc edx, [esp+40+8] |
2393 | adc edx, [esp+40+8] |
2394 | sub eax, edx |
2394 | sub eax, edx |
2395 | lea eax, [eax*3] |
2395 | lea eax, [eax*3] |
2396 | sub esi, eax |
2396 | sub esi, eax |
2397 | jmp smooth_line |
2397 | jmp smooth_line |
2398 | @@: |
2398 | @@: |
2399 | mov eax, [draw_data + 32 + RECT.left] |
2399 | mov eax, [draw_data + sizeof.WDATA + RECT.left] |
2400 | mov [esp+20+8], eax |
2400 | mov [esp+20+8], eax |
2401 | ret |
2401 | ret |
Line 2402... | Line 2402... | ||
2402 | 2402 |