Subversion Repositories Kolibri OS

Rev

Rev 307 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 307 Rev 5158
1
;esi - screen size
1
;esi - screen size
2
;edi - pointer to image
2
;edi - pointer to image
3
csi_width equ [esi+2]
3
csi_width equ [esi+2]
4
csi_height equ [esi]
4
csi_height equ [esi]
5
csi_bitspp equ [esi+4]
5
csi_bitspp equ [esi+4]
6
csi_bytesps equ [esi+6]
6
csi_bytesps equ [esi+6]
7
 
7
 
8
 
8
 
9
copy_screen_to_image:
9
copy_screen_to_image:
10
pusha
10
pusha
11
	xor	edx,edx
11
	xor	edx,edx
12
	xor	ecx,ecx
12
	xor	ecx,ecx
13
	xor	ebx,ebx
13
	xor	ebx,ebx
14
 
14
 
15
	bt	dword [use_rect.flags],1
15
	bt	dword [use_rect.flags],1
16
	jc	copy_area
16
	jc	copy_area
17
 
17
 
18
	cmp	csi_bitspp,word 24
18
	cmp	csi_bitspp,word 24
19
	je	.next_str_24
19
	je	.next_str_24
-
 
20
	cmp	csi_bitspp,word 16
-
 
21
	je	.next_str_16
20
 
22
 
21
.next_str_32:
23
.next_str_32:
22
	push	edx ebx
24
	push	edx ebx
23
	xor	ebx,ebx
25
	xor	ebx,ebx
24
@@:
26
@@:
25
	;push    eax
27
	;push	 eax
26
	mov	eax,[gs:edx]
28
	mov	eax,[gs:edx]
27
	mov	[edi+ecx],ax
29
	mov	[edi+ecx],ax
28
	shr	eax,8
30
	shr	eax,8
29
	mov	[edi+ecx+2],ah
31
	mov	[edi+ecx+2],ah
30
	;pop     eax
32
	;pop	 eax
31
	add	ecx,3
33
	add	ecx,3
32
	add	edx,4;eax
34
	add	edx,4;eax
33
	inc	bx
35
	inc	bx
34
	cmp	bx,csi_width
36
	cmp	bx,csi_width
35
	jl     @b
37
	jl     @b
36
	pop	ebx edx
38
	pop	ebx edx
37
	add	edx,csi_bytesps
39
	add	edx,csi_bytesps
38
	inc	bx
40
	inc	bx
39
	cmp	bx,csi_height
41
	cmp	bx,csi_height
40
	jl	.next_str_32
42
	jl	.next_str_32
41
popa
43
popa
42
ret
44
ret
43
 
45
 
44
.next_str_24:
46
.next_str_24:
45
	push	edx ebx
47
	push	edx ebx
46
	xor	ebx,ebx
48
	xor	ebx,ebx
47
@@:
49
@@:
48
	;push    eax
50
	;push	 eax
49
	mov	eax,[gs:edx]
51
	mov	eax,[gs:edx]
50
	mov	[edi+ecx],ax
52
	mov	[edi+ecx],ax
51
	shr	eax,8
53
	shr	eax,8
52
	mov	[edi+ecx+2],ah
54
	mov	[edi+ecx+2],ah
53
	;pop     eax
55
	;pop	 eax
54
	add	ecx,3
56
	add	ecx,3
55
	add	edx,3;eax
57
	add	edx,3;eax
56
	inc	bx
58
	inc	bx
57
	cmp	bx,csi_width
59
	cmp	bx,csi_width
58
	jl     @b
60
	jl     @b
59
	pop	ebx edx
61
	pop	ebx edx
60
	add	edx,csi_bytesps
62
	add	edx,csi_bytesps
61
	inc	bx
63
	inc	bx
62
	cmp	bx,csi_height
64
	cmp	bx,csi_height
63
	jl	.next_str_24
65
	jl	.next_str_24
64
popa
66
popa
-
 
67
ret
-
 
68
 
-
 
69
.next_str_16:
-
 
70
	push	edx ebx
-
 
71
	xor	ebx,ebx
-
 
72
@@:
-
 
73
	;push	 eax
-
 
74
	mov	eax,[gs:edx]
-
 
75
	shl	eax, 3
-
 
76
	ror	eax, 8
-
 
77
	shl	ax, 2
-
 
78
	ror	eax, 8
-
 
79
	shl	al, 3
-
 
80
	mov	[edi+ecx+2],al
-
 
81
	rol	eax, 16
-
 
82
	mov	[edi+ecx],ax
-
 
83
	;pop	 eax
-
 
84
	add	ecx,3
-
 
85
	add	edx,2
-
 
86
	inc	bx
-
 
87
	cmp	bx,csi_width
-
 
88
	jl     @b
-
 
89
	pop	ebx edx
-
 
90
	add	edx,csi_bytesps
-
 
91
	inc	bx
-
 
92
	cmp	bx,csi_height
-
 
93
	jl	.next_str_16
-
 
94
popa
65
ret
95
ret
66
 
96
 
67
copy_area:
97
copy_area:
68
	mov	eax,[scr.bytesps]
98
	mov	eax,[scr.bytesps]
69
	mov	ebx,eax
99
	mov	ebx,eax
70
	movzx	ecx,word [rect.top]
100
	movzx	ecx,word [rect.top]
71
	mul	ecx
101
	mul	ecx
72
	movzx	ecx,word [rect.width]
102
	movzx	ecx,word [rect.width]
73
	shl	ecx,2
103
	shl	ecx,2
74
	sub	ebx,ecx
104
	sub	ebx,ecx
75
	movzx	ecx,word [rect.left]
105
	movzx	ecx,word [rect.left]
76
	shl	ecx,2
106
	shl	ecx,2
77
	add	eax,ecx
107
	add	eax,ecx
78
	movzx	ecx,word [rect.height]
108
	movzx	ecx,word [rect.height]
79
	mov	edx,eax
109
	mov	edx,eax
80
.next_str:
110
.next_str:
81
	movzx	esi,word [rect.width]
111
	movzx	esi,word [rect.width]
82
.next_pixel:
112
.next_pixel:
83
	mov	eax,[gs:edx]
113
	mov	eax,[gs:edx]
84
	mov	[edi],ax
114
	mov	[edi],ax
85
	shr	eax,8
115
	shr	eax,8
86
	mov	[edi+2],ah
116
	mov	[edi+2],ah
87
	add	edx,4
117
	add	edx,4
88
	add	edi,3
118
	add	edi,3
89
	dec	esi
119
	dec	esi
90
	jnz	.next_pixel
120
	jnz	.next_pixel
91
	add	edx,ebx
121
	add	edx,ebx
92
	loop	.next_str
122
	loop	.next_str
93
popa
123
popa
94
ret
124
ret