Infinity without MMX+ instructions

git-svn-id: svn://kolibrios.org@1916 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Asper 2011-04-02 16:47:56 +00:00
parent 3cf149de61
commit 918d343097

View File

@ -962,6 +962,26 @@ proc SetBufferVol stdcall, str:dword,l_vol:dword,r_vol:dword
ret
endp
proc minw stdcall, arg1:dword, arg2:dword
mov ax, word [arg1]
cmp ax, word [arg2]
jle @f
mov eax, [arg2]
@@:
ret
endp
proc maxw stdcall, arg1:dword, arg2:dword
mov ax, word [arg1]
cmp ax, word [arg2]
jge @f
mov eax, [arg2]
@@:
ret
endp
proc set_vol_param stdcall, l_vol:dword,r_vol:dword,pan:dword
locals
_600 dd ?
@ -975,31 +995,34 @@ proc set_vol_param stdcall, l_vol:dword,r_vol:dword,pan:dword
lea ebx, [state]
fnsave [ebx]
movq mm0, qword [l_vol]
pminsw mm0, qword [vol_max]
pmaxsw mm0, qword [vol_min]
movq qword [l_vol], mm0
movq qword [edx+STREAM.l_vol], mm0
stdcall minw, [l_vol], [vol_max]
stdcall maxw, eax, [vol_min]
mov [l_vol], eax
mov [edx+STREAM.l_vol], eax
stdcall minw, [r_vol], [vol_max+4]
stdcall maxw, eax, [vol_min+4]
mov [r_vol], eax
mov [edx+STREAM.r_vol], eax
movd mm1,[pan]
pminsw mm1, qword [pan_max]
pmaxsw mm1, qword [vol_min]
movd [edx+STREAM.pan], mm1
stdcall minw, [pan], [pan_max]
stdcall maxw, eax, [vol_min]
mov [edx+STREAM.pan], eax
cmp word [edx+STREAM.pan], 0
jl @F
jl .@f
psubsw mm0,mm1
pminsw mm0, qword [vol_max]
pmaxsw mm0, qword [vol_min]
movd [l_vol],mm0
mov ebx, [l_vol]
sub ebx, eax
stdcall minw, ebx, [vol_max]
stdcall maxw, eax, [vol_min]
mov [l_vol], eax
jmp .calc_amp
@@:
punpckhdq mm0,mm0
paddsw mm0,mm1
pminsw mm0, qword [vol_max]
pmaxsw mm0, qword [vol_min]
movd [r_vol], mm0
mov ebx, [r_vol]
add ebx, [pan]
stdcall minw, ebx, [vol_max+4]
stdcall maxw, eax, [vol_min+4]
mov [r_vol], eax
.calc_amp:
emms
fild word [l_vol]
@ -1040,6 +1063,7 @@ proc set_vol_param stdcall, l_vol:dword,r_vol:dword,pan:dword
ret 0
endp
align 4
proc GetBufferVol stdcall, str:dword,p_lvol:dword,p_rvol:dword