Subversion Repositories Kolibri OS

Rev

Rev 307 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
205 heavyiron 1
macro use_gp
2
{
3
;esi - screen size
4
;edi - pointer to image
5
csi_width equ [esi+2]
6
csi_height equ [esi]
7
csi_bitspp equ [esi+4]
8
csi_bytesps equ [esi+6]
9
copy_screen_to_image:
10
pusha
11
	xor	edx,edx
12
	xor	ecx,ecx
13
	xor	ebx,ebx
14
 
15
	cmp	csi_bitspp,word 24
16
	je	.next_str_24
17
 
18
.next_str_32:
19
	push	edx ebx
20
	xor	ebx,ebx
21
@@:
22
	;push    eax
23
	mov	eax,[gs:edx]
24
	mov	[edi+ecx],ax
25
	shr	eax,8
26
	mov	[edi+ecx+2],ah
27
	;pop     eax
28
	add	ecx,3
29
	add	edx,4;eax
30
	inc	bx
31
	cmp	bx,csi_width
32
	jl     @b
33
	pop	ebx edx
34
	add	edx,csi_bytesps
35
	inc	bx
36
	cmp	bx,csi_height
37
	jl	.next_str_32
38
popa
39
ret
40
 
41
.next_str_24:
42
	push	edx ebx
43
	xor	ebx,ebx
44
@@:
45
	;push    eax
46
	mov	eax,[gs:edx]
47
	mov	[edi+ecx],ax
48
	shr	eax,8
49
	mov	[edi+ecx+2],ah
50
	;pop     eax
51
	add	ecx,3
52
	add	edx,3;eax
53
	inc	bx
54
	cmp	bx,csi_width
55
	jl     @b
56
	pop	ebx edx
57
	add	edx,csi_bytesps
58
	inc	bx
59
	cmp	bx,csi_height
60
	jl	.next_str_24
61
popa
62
ret
63
}