Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 693 → Rev 694

/kernel/trunk/drivers/infinity.asm
1,11 → 1,11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2006-2008. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
; (C) copyright Serge 2006
; Serge 2006-2008
; email: infinity_sound@mail.ru
 
format MS COFF
28,8 → 28,11
FORCE_MMX equ 0 ;set to 1 to force use mmx or
FORCE_MMX_128 equ 0 ;integer sse2 extensions
;and reduce driver size
 
;USE_SSE equ 0
 
USE_SSE2_MIXER equ 0 ;floating point mixer. Disabled by default
 
DEBUG equ 1
 
 
897,6 → 900,7
call .calc
 
fistp word [edx+STREAM.l_amp]
fstp dword [edx+STREAM.l_amp_f]
fstp st0
 
fild word [r_vol]
904,6 → 908,7
call .calc
 
fistp word [edx+STREAM.r_amp]
fstp dword [edx+STREAM.r_amp_f]
fstp st0
 
fnclex
923,6 → 928,7
fld1
faddp st1, st0
fscale
fld st0
fimul dword [_32767]
ret 0
endp
1064,12 → 1070,20
.add_buff:
mov ecx, [ebx+STREAM.out_rp]
mov [eax],ecx
 
if USE_SSE2_MIXER
mov edi, dword [ebx+STREAM.l_amp_f]
mov [eax+4], edi
mov edi, dword [ebx+STREAM.r_amp_f]
mov [eax+8], edi
else
mov edi, dword [ebx+STREAM.l_amp]
mov [eax+4], edi
end if
add [ebx+STREAM.out_rp], 512
sub [ebx+STREAM.out_count], 512
 
add eax, 8
add eax, 12
inc edx
.next:
mov ebx, [ebx+STREAM.str_fd]
/kernel/trunk/drivers/main.inc
1,11 → 1,11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2006-2008. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
; (C) copyright Serge 2006-2007
; Serge 2006-2008
; email: infinity_sound@mail.ru
 
 
111,7 → 111,7
.out_wp dd ?
.out_rp dd ?
.out_count dd ?
.out_top dd ?
.out_top dd ? ;16*4
 
.r_size dd ?
.r_dt dd ?
122,6 → 122,8
.l_amp dw ?
.r_amp dw ?
.pan dd ?
.l_amp_f dd ? ;float point left
.r_amp_f dd ? ;float point right
 
.in_base dd ?
.in_size dd ?
135,7 → 137,7
.notify_id dd ?
}
 
STREAM_SIZE equ 34*4
STREAM_SIZE equ 36*4
FD_OFFSET equ 24
 
virtual at 0
/kernel/trunk/drivers/mixer.asm
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2006-2008. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9,10 → 9,9
; email: infinity_sound@mail.ru
 
 
 
align 4
 
mix_list rq 32
mix_list rd 32*3
 
align 4
proc new_mix stdcall, output:dword
252,10 → 251,87
ret
endp
 
if USE_SSE2_MIXER
 
align 4
proc mix_all stdcall, dest:dword, list:dword, count:dword
 
mov edi, [dest]
mov ebx, 32
.mix:
mov edx, [list]
mov ecx, [count]
 
mov eax, [edx]
 
movdqa xmm1, [eax]
movss xmm2, [edx+4]
movss xmm3, [edx+8]
 
punpcklwd xmm0, xmm1
punpckhwd xmm1, xmm1
 
shufps xmm2, xmm3, 0
shufps xmm2, xmm2, 0x88
 
psrad xmm0, 16
psrad xmm1, 16
cvtdq2ps xmm0, xmm0 ;time to use all power
cvtdq2ps xmm1, xmm1 ;of the dark side
mulps xmm0, xmm2
mulps xmm1, xmm2
 
.mix_loop:
add dword [edx], 16
add edx, 12
dec ecx
jz @F
 
mov eax, [edx]
 
movdqa xmm3, [eax]
movss xmm4, [edx+4]
movss xmm5, [edx+8]
 
punpcklwd xmm2, xmm3
punpckhwd xmm3, xmm3
 
shufps xmm4, xmm5, 0
shufps xmm4, xmm4, 0x88
 
psrad xmm2, 16
psrad xmm3, 16
 
cvtdq2ps xmm2, xmm2
cvtdq2ps xmm3, xmm3
 
mulps xmm2, xmm4
mulps xmm3, xmm4
addps xmm0, xmm2
addps xmm1, xmm3
 
jmp .mix_loop
@@:
cvtps2dq xmm0, xmm0
cvtps2dq xmm1, xmm1
packssdw xmm0, xmm0
packssdw xmm1, xmm1
punpcklqdq xmm0, xmm1
movntdq [edi], xmm0
 
add edi, 16
dec ebx
jnz .mix
 
ret
endp
 
else ; fixed point mmx version
 
align 4
proc mix_all stdcall, dest:dword, list:dword, count:dword
 
mov edi, [dest]
mov ebx, 64
.mix:
mov edx, [list]
262,7 → 338,9
mov ecx, [count]
 
mov eax, [edx]
 
movq mm0, [eax]
 
movd mm1, [edx+4]
punpckldq mm1,mm1
pmulhw mm0, mm1
270,7 → 348,7
 
.mix_loop:
add dword [edx], 8
add edx, 8
add edx, 12
dec ecx
jz @F
 
291,6 → 369,9
ret
endp
 
end if
 
 
align 4
proc resample_1 stdcall, dest:dword,src:dword,\
r_dt:dword, r_size:dword,r_end:dword