Rev 5670 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5670 | Rev 5708 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | ;; ;; |
12 | ;; ;; |
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 14... | Line 14... | ||
14 | 14 | ||
Line 15... | Line 15... | ||
15 | encoding_CopyRect: |
15 | encoding_CopyRect: |
Line 16... | Line 16... | ||
16 | 16 | ||
17 | DEBUGF 2,"CopyRect\n" |
17 | DEBUGF 1,"CopyRect\n" |
18 | 18 | ||
19 | @@: |
19 | @@: |
Line 36... | Line 36... | ||
36 | lea esi, [framebuffer_data+eax*3] ; esi = framebuffer_data+([screen.width]*[src.y]+[src.x])*3 |
36 | lea esi, [framebuffer_data+eax*3] ; esi = framebuffer_data+([screen.width]*[src.y]+[src.x])*3 |
Line 37... | Line 37... | ||
37 | 37 | ||
38 | mov eax, [rectangle.y] |
38 | mov eax, [rectangle.y] |
39 | movzx ebx, [screen.width] |
39 | movzx ebx, [screen.width] |
40 | mul ebx ; [screen.width]*[rectangle.y] |
- | |
41 | mov ebx, [rectangle.x] |
40 | mul ebx ; [screen.width]*[rectangle.y] |
42 | add eax, ebx ; [screen.width]*[rectangle.y]+[rectangle.x] |
41 | add eax, [rectangle.x] ; [screen.width]*[rectangle.y]+[rectangle.x] |
Line 43... | Line 42... | ||
43 | lea edi, [framebuffer_data+eax*3] ; edi = framebuffer_data+([screen.width]*[rectangle.y]+[rectangle.x])*3 |
42 | lea edi, [framebuffer_data+eax*3] ; edi = framebuffer_data+([screen.width]*[rectangle.y]+[rectangle.x])*3 |
44 | 43 | ||
45 | movzx eax, [screen.width] |
44 | movzx eax, [screen.width] |
Line 46... | Line 45... | ||
46 | sub eax, [rectangle.width] |
45 | sub eax, [rectangle.width] |
47 | lea ebp, [eax*3] ; ebp = ([screen.width]-[rectangle.width])*3 |
46 | lea ebp, [eax*3] ; ebp = ([screen.width]-[rectangle.width])*3 |
Line 48... | Line 47... | ||
48 | 47 | ||
- | 48 | cmp esi, edi |
|
49 | cmp esi, edi |
49 | ja .not_backwards |
- | 50 | ||
50 | ja .copy |
51 | ; Source pixels come before destination in buffer, copy backwards. |
51 | 52 | DEBUGF 1,"backwards\n" |
|
52 | ; source pixels come before destination in buffer, copy backwards |
53 | mov eax, [rectangle.height] |
- | 54 | dec eax |
|
53 | mov eax, [rectangle.height] |
55 | movzx edx, [screen.width] |
54 | movzx edx, [screen.width] |
56 | mul edx |
55 | mul edx |
- | |
56 | lea eax, [eax*3-1] |
57 | add eax, [rectangle.width] |
57 | add esi, eax |
58 | lea eax, [eax*3-1] ; eax = (([rectangle.height]-1)*[screen.width]+[rectangle.width])*3-1 |
58 | add edi, eax |
59 | add esi, eax |
Line -... | Line 60... | ||
- | 60 | add edi, eax |
|
- | 61 | neg ebp |
|
- | 62 | std |
|
- | 63 | .not_backwards: |
|
- | 64 | ||
- | 65 | ; Do the actual copying |
|
59 | 66 | mov eax, [rectangle.width] |
|
60 | neg ebp |
- | |
61 | std |
- | |
62 | .copy: |
67 | lea eax, [eax*3] |
63 | 68 | mov ebx, eax |
|
64 | mov edx, [rectangle.height] |
69 | and eax, 11b |
65 | mov ecx, [rectangle.width] |
70 | shr ebx, 2 |
66 | lea ecx, [ecx*3] |
- | |
- | 71 | mov edx, [rectangle.height] |
|
67 | .lineloop: |
72 | .lineloop: |
68 | push ecx |
73 | mov ecx, eax |
69 | rep movsb |
74 | rep movsb |
70 | pop ecx |
75 | mov ecx, ebx |