mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-11 17:44:09 +03:00
91386937c1
git-svn-id: svn://kolibrios.org@3380 a494cfbc-eb01-0410-851d-a64ba20cac60
112 lines
1.9 KiB
PHP
112 lines
1.9 KiB
PHP
;-----------------------------------------------------------------------------
|
|
align 4
|
|
create_tone:
|
|
;-------------------------------------------
|
|
mov ebx,[tone_SIZE_Y]
|
|
xor eax,eax
|
|
dec al
|
|
sub al,[tone_color.red]
|
|
shl eax,24
|
|
xor edx,edx
|
|
div ebx
|
|
mov [offset_y.red],eax
|
|
|
|
xor eax,eax
|
|
dec al
|
|
sub al,[tone_color.green]
|
|
shl eax,24
|
|
xor edx,edx
|
|
div ebx
|
|
mov [offset_y.green],eax
|
|
|
|
xor eax,eax
|
|
dec al
|
|
sub al,[tone_color.blue]
|
|
shl eax,24
|
|
xor edx,edx
|
|
div ebx
|
|
mov [offset_y.blue],eax
|
|
;-------------------------------------------
|
|
mov edi,[tone_area]
|
|
xor ecx,ecx
|
|
;-------------------------------------------
|
|
align 4
|
|
@@:
|
|
mov eax,[tone_color]
|
|
; blue
|
|
mov edx,[offset_y.blue]
|
|
call next_color_Y
|
|
ror eax,8
|
|
; green
|
|
mov edx,[offset_y.green]
|
|
call next_color_Y
|
|
ror eax,8
|
|
; red
|
|
mov edx,[offset_y.red]
|
|
call next_color_Y
|
|
rol eax,16
|
|
|
|
call tone_put_line
|
|
add ecx,1
|
|
cmp ecx,[tone_SIZE_X]
|
|
jne @b
|
|
|
|
ret
|
|
;-----------------------------------------------------------------------------
|
|
tone_put_line:
|
|
push ecx
|
|
|
|
mov ecx,eax
|
|
mov ebx,[tone_SIZE_X]
|
|
shl eax,24
|
|
xor edx,edx
|
|
div ebx
|
|
mov [offset_x.blue],eax
|
|
|
|
mov eax,ecx
|
|
shr eax,8
|
|
shl eax,24
|
|
xor edx,edx
|
|
div ebx
|
|
mov [offset_x.green],eax
|
|
|
|
mov eax,ecx
|
|
shr eax,16
|
|
shl eax,24
|
|
xor edx,edx
|
|
div ebx
|
|
mov [offset_x.red],eax
|
|
mov eax,ecx
|
|
|
|
push ebx esi
|
|
mov ecx,[tone_SIZE_X]
|
|
xor edx,edx
|
|
xor ebx,ebx
|
|
xor esi,esi
|
|
@@:
|
|
mov eax,edx
|
|
shr eax,24
|
|
add edx,[offset_x.blue]
|
|
mov [edi],al
|
|
mov eax,ebx
|
|
shr eax,24
|
|
add ebx,[offset_x.green]
|
|
mov [edi+1],al
|
|
mov eax,esi
|
|
shr eax,24
|
|
add esi,[offset_x.red]
|
|
mov [edi+2],al
|
|
add edi,3
|
|
dec ecx
|
|
jnz @b
|
|
pop esi ebx
|
|
pop ecx
|
|
ret
|
|
;-----------------------------------------------------------------------------
|
|
align 4
|
|
next_color_Y:
|
|
imul edx,ecx
|
|
rol edx,8
|
|
add al,dl
|
|
ret
|
|
;----------------------------------------------------------------------------- |