; ********************************************************* ; * ; * FILTER routine ; * ; * [EAX = filter type] ; * [EBX = cutoff] ; * ECX = number of samples ; * ESI = source/target buffer ; * ; * ; ********************************************************* section .text bits 32 %define KF_TYPE 0 %define KF_CUTOFF 4 %define KF_RESO 8 %define KF_DRY 12 %define KF_WET 16 global _KZG_filterMass@0 _KZG_filterMass@0: %ifdef DEBUG mov ebp,_KZG_fmass_type %endif mov eax,dword [ebp+KF_RESO] mov dword [_KZG_filter_reso],eax mov ebx,[ebp+KF_CUTOFF] mov eax,[ebp+KF_TYPE] mov edi,_KZG_filter_sample _KZG_filter_onesample: mov dword [_KZG_filter_cutoff],ebx movsd sub edi,byte 4 fld dword [edi] fmul dword [ebp+KF_DRY] call _KZG_filter@0 fmul dword [ebp+KF_WET] faddp st1 fstp dword [esi-4] loop _KZG_filter_onesample ret %ifdef DEBUG section .data bits 32 global _KZG_fmass_type _KZG_fmass_type dd 0 global _KZG_fmass_cutoff _KZG_fmass_cutoff dd 0 global _KZG_fmass_reso _KZG_fmass_reso dd 0 global _KZG_fmass_dry _KZG_fmass_dry dd 0 global _KZG_fmass_wet _KZG_fmass_wet dd 0 %endif