Subversion Repositories Kolibri OS

Rev

Rev 205 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 205 Rev 307
Line 1... Line -...
1
macro use_gp
-
 
2
{
-
 
3
;esi - screen size
1
;esi - screen size
4
;edi - pointer to image
2
;edi - pointer to image
5
csi_width equ [esi+2]
3
csi_width equ [esi+2]
6
csi_height equ [esi]
4
csi_height equ [esi]
7
csi_bitspp equ [esi+4]
5
csi_bitspp equ [esi+4]
8
csi_bytesps equ [esi+6]
6
csi_bytesps equ [esi+6]
-
 
7
 
-
 
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
Line -... Line 14...
-
 
14
 
-
 
15
	bt	dword [use_rect.flags],1
-
 
16
	jc	copy_area
14
 
17
 
15
	cmp	csi_bitspp,word 24
18
	cmp	csi_bitspp,word 24
Line 16... Line 19...
16
	je	.next_str_24
19
	je	.next_str_24
17
 
20
 
Line 58... Line 61...
58
	inc	bx
61
	inc	bx
59
	cmp	bx,csi_height
62
	cmp	bx,csi_height
60
	jl	.next_str_24
63
	jl	.next_str_24
61
popa
64
popa
62
ret
65
ret
63
}
-
 
64
66
 
-
 
67
copy_area:
-
 
68
	mov	eax,[scr.bytesps]
-
 
69
	mov	ebx,eax
-
 
70
	movzx	ecx,word [rect.top]
-
 
71
	mul	ecx
-
 
72
	movzx	ecx,word [rect.width]
-
 
73
	shl	ecx,2
-
 
74
	sub	ebx,ecx
-
 
75
	movzx	ecx,word [rect.left]
-
 
76
	shl	ecx,2
-
 
77
	add	eax,ecx
-
 
78
	movzx	ecx,word [rect.height]
-
 
79
	mov	edx,eax
-
 
80
.next_str:
-
 
81
	movzx	esi,word [rect.width]
-
 
82
.next_pixel:
-
 
83
	mov	eax,[gs:edx]
-
 
84
	mov	[edi],ax
-
 
85
	shr	eax,8
-
 
86
	mov	[edi+2],ah
-
 
87
	add	edx,4
-
 
88
	add	edi,3
-
 
89
	dec	esi
-
 
90
	jnz	.next_pixel
-
 
91
	add	edx,ebx
-
 
92
	loop	.next_str
-
 
93
popa
-
 
94
ret
-
 
95
65
96