Subversion Repositories Kolibri OS

Rev

Rev 7861 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7861 Rev 9570
Line 1644... Line 1644...
1644
	cmp edi,esi
1644
	cmp edi,esi
1645
	je .c0_c1
1645
	je .c0_c1
Line 1646... Line 1646...
1646
 
1646
 
1647
	;¯¥à¥¢®à ç¨¢ ¥¬ §­ ç¥­¨ï ¯à®§à ç­®á⥩
1647
	;¯¥à¥¢®à ç¨¢ ¥¬ §­ ç¥­¨ï ¯à®§à ç­®á⥩
1648
	neg edi
-
 
1649
	inc edi
1648
	neg edi
1650
	add edi,255
1649
	add edi,256
1651
	neg esi
-
 
1652
	inc esi
1650
	neg esi
Line 1653... Line 1651...
1653
	add esi,255
1651
	add esi,256
1654
 
1652
 
1655
	movzx ecx,byte[eax]
1653
	movzx ecx,byte[eax]
1656
	imul ecx,edi
1654
	imul ecx,edi
Line 1692... Line 1690...
1692
	mov bl,al
1690
	mov bl,al
Line 1693... Line 1691...
1693
 
1691
 
1694
	shr ecx,1
1692
	shr ecx,1
1695
	;¯¥à¥¢®à ç¨¢ ¥¬ §­ ç¥­¨ï ¯à®§à ç­®áâ¨
1693
	;¯¥à¥¢®à ç¨¢ ¥¬ §­ ç¥­¨ï ¯à®§à ç­®áâ¨
1696
	neg ecx
-
 
1697
	inc ecx
1694
	neg ecx
Line 1698... Line 1695...
1698
	add ecx,255
1695
	add ecx,256
1699
 
1696
 
1700
	shl ecx,24
1697
	shl ecx,24
1701
	add ebx,ecx
1698
	add ebx,ecx
Line 1702... Line 1699...
1702
	mov edx,ebx
1699
	mov edx,ebx
1703
pop ebx eax
1700
pop ebx eax
1704
 
1701
 
1705
	jmp .end_f
1702
	jmp .end_f
1706
	.c0_c1: ;¥á«¨ ¯à®§à ç­®á⨠®¡®¨å 梥⮢ ᮢ¯ ¤ îâ
1703
	.c0_c1: ;¥á«¨ ¯à®§à ç­®á⨠®¡®¨å 梥⮢ ᮢ¯ ¤ îâ
1707
		mov edx,dword[eax]
1704
		mov edx,[eax]
1708
		shr edx,1
1705
		shr edx,1
1709
		and edx,011111110111111101111111b
1706
		and edx,011111110111111101111111b
1710
		mov esi,dword[ebx]
1707
		mov esi,[ebx]
1711
		shr esi,1
1708
		shr esi,1
1712
		and esi,011111110111111101111111b
1709
		and esi,011111110111111101111111b
1713
		add edx,esi
1710
		add edx,esi
1714
		ror edi,8 ;¯¥à¥¬¥é ¥¬ §­ ç¥­¨¥ ¯à®§à ç­®á⨠¢ áâ à訩 ¡ ©â edi
1711
		ror edi,8 ;¯¥à¥¬¥é ¥¬ §­ ç¥­¨¥ ¯à®§à ç­®á⨠¢ áâ à訩 ¡ ©â edi
1715
		or edx,edi
1712
		or edx,edi
1716
		jmp .end_f
1713
		jmp .end_f
1717
	.c0z: ;¥á«¨ 梥⠢ eax ¯à®§à ç­ë©
1714
	.c0z: ;¥á«¨ 梥⠢ eax ¯à®§à ç­ë©
1718
		mov edx,dword[ebx]
1715
		mov edx,[ebx]
1719
		movzx edi,byte[ebx+3]
1716
		movzx edi,byte[ebx+3]
1720
		jmp @f
1717
		jmp @f
1721
	.c1z: ;¥á«¨ 梥⠢ ebx ¯à®§à ç­ë©
1718
	.c1z: ;¥á«¨ 梥⠢ ebx ¯à®§à ç­ë©
1722
		mov edx,dword[eax]
1719
		mov edx,[eax]
1723
	@@:
1720
	@@:
1724
		add edi,255 ;¤¥« ¥¬ 梥⠭  ¯®«®¢¨­ã ¯à®§à ç­ë¬
1721
		add edi,255 ;¤¥« ¥¬ 梥⠭  ¯®«®¢¨­ã ¯à®§à ç­ë¬
1725
		shr edi,1
1722
		shr edi,1
1726
		cmp edi,255
1723
		cmp edi,255
1727
		jl @f
1724
		jle @f
1728
			mov edi,255 ;¬ ªá¨¬ «ì­ ï ¯à®§à ç­®áâì ­¥ ¡®«¥¥ 255
1725
			mov edi,255 ;¬ ªá¨¬ «ì­ ï ¯à®§à ç­®áâì ­¥ ¡®«¥¥ 255
1729
		@@:
1726
		@@:
Line 2269... Line 2266...
2269
	popad
2266
	popad
2270
	ret
2267
	ret
2271
endp
2268
endp
Line 2272... Line 2269...
2272
 
2269
 
2273
;input:
2270
;input:
2274
; esi = pointer to color1 + transparent
2271
; esi = pointer to color1 + transparent (32b)
2275
; edi = pointer to background color2
2272
; edi = pointer to background color2 (24b)
2276
;output:
2273
;output:
2277
; [edi] = combine color
2274
; [edi] = combine color (24b)
2278
align 4
2275
align 4
2279
combine_colors_0:
2276
combine_colors_0:
2280
	push ax bx cx dx
-
 
2281
	mov bx,0x00ff ;---get transparent---
2277
	push ax cx
-
 
2278
	movzx cx,byte[esi+3] ;pro
-
 
2279
	cmp cx,255
-
 
2280
	je .end_f
-
 
2281
	or cx,cx
-
 
2282
	jnz @f
-
 
2283
		mov ax,[esi]
-
 
2284
		mov [edi],ax
-
 
2285
		mov al,[esi+2]
-
 
2286
		mov [edi+2],al
-
 
2287
		jmp .end_f
-
 
2288
align 4
-
 
2289
	@@:
-
 
2290
	inc cx
-
 
2291
	push bx dx
2282
	movzx cx,byte[esi+3] ;pro
2292
	mov bx,0x0100 ;---get transparent---
2283
	sub bx,cx ;256-pro
2293
	sub bx,cx ;256-pro
2284
	;---blye---
2294
	;---blye---
2285
	movzx ax,byte[esi]
2295
	movzx ax,byte[esi]
2286
	imul ax,bx
2296
	imul ax,bx
Line 2300... Line 2310...
2300
	imul ax,bx
2310
	imul ax,bx
2301
	movzx dx,byte[edi+2]
2311
	movzx dx,byte[edi+2]
2302
	imul dx,cx
2312
	imul dx,cx
2303
	add ax,dx
2313
	add ax,dx
2304
	mov byte[edi+2],ah
2314
	mov byte[edi+2],ah
-
 
2315
	pop dx bx
2305
 
2316
.end_f:
2306
	pop dx cx bx ax
2317
	pop cx ax
2307
	ret
2318
	ret
Line 2308... Line 2319...
2308
 
2319
 
2309
;äã­ªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥­¨¥ ¨§ ¡ãä¥à  buf_source (32b) ¢ buf_destination (24b)
2320
;äã­ªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥­¨¥ ¨§ ¡ãä¥à  buf_source (32b) ¢ buf_destination (24b)
2310
; 㪠§ë¢ îâáï ª®®à¤¨­ âë ¢áâ ¢ª¨ ¡ãä¥à  buf_source ®â­®á¨â¥«ì­® buf_destination
2321
; 㪠§ë¢ îâáï ª®®à¤¨­ âë ¢áâ ¢ª¨ ¡ãä¥à  buf_source ®â­®á¨â¥«ì­® buf_destination
Line 2424... Line 2435...
2424
	popad
2435
	popad
2425
	ret
2436
	ret
2426
endp
2437
endp
Line 2427... Line 2438...
2427
 
2438
 
2428
;input:
2439
;input:
2429
; ebx - color1
2440
; ebx - color1 (24b)
2430
; esi = pointer to transparent
2441
; esi = pointer to transparent (8b)
2431
; edi = pointer to background color2
2442
; edi = pointer to background color2 (24b)
2432
;output:
2443
;output:
2433
; [edi] = combine color
2444
; [edi] = combine color (24b)
2434
align 4
2445
align 4
2435
combine_colors_2:
2446
combine_colors_2:
2436
	push ax ebx cx dx si
2447
	push ebx cx
-
 
2448
	movzx cx,byte[esi] ;pro
-
 
2449
	cmp cx,255
2437
	mov cl,byte[esi] ;pro
2450
	je .end_f
-
 
2451
	or cx,cx
-
 
2452
	jnz @f
-
 
2453
		mov [edi],bx
-
 
2454
		shr ebx,16
-
 
2455
		mov [edi+2],bl
-
 
2456
		jmp .end_f
-
 
2457
align 4
-
 
2458
	@@:
-
 
2459
	inc cx
2438
	xor ch,ch
2460
	push ax dx si
2439
	mov si,0x00ff ;---get transparent---
2461
	mov si,0x0100 ;---get transparent---
Line 2440... Line 2462...
2440
	sub si,cx ;256-pro
2462
	sub si,cx ;256-pro
2441
 
2463
 
2442
		;---blye---
2464
		;---blye---
Line 2460... Line 2482...
2460
		imul ax,si
2482
		imul ax,si
2461
		movzx dx,byte[edi+2]
2483
		movzx dx,byte[edi+2]
2462
		imul dx,cx
2484
		imul dx,cx
2463
		add ax,dx
2485
		add ax,dx
2464
		mov byte[edi+2],ah
2486
		mov byte[edi+2],ah
-
 
2487
	pop si dx ax
2465
 
2488
.end_f:
2466
	pop si dx cx ebx ax
2489
	pop cx ebx
2467
	ret
2490
	ret
Line 2468... Line 2491...
2468
 
2491
 
2469
;äã­ªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥­¨¥ ¨§ ¡ãä¥à  buf_source (8b) ¢ buf_destination (24b)
2492
;äã­ªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥­¨¥ ¨§ ¡ãä¥à  buf_source (8b) ¢ buf_destination (24b)
2470
; 㪠§ë¢ îâáï ª®®à¤¨­ âë ¢áâ ¢ª¨ ¡ãä¥à  buf_source ®â­®á¨â¥«ì­® buf_destination
2493
; 㪠§ë¢ îâáï ª®®à¤¨­ âë ¢áâ ¢ª¨ ¡ãä¥à  buf_source ®â­®á¨â¥«ì­® buf_destination