Make sound processing use less CPU cycles.
This commit is contained in:
@@ -1074,24 +1074,20 @@ NEWSYM StartSound
|
|||||||
call JoyRead
|
call JoyRead
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
NEWSYM SoundProcess ; This function is called ~60 times/s at full speed
|
NEWSYM SoundProcess ; This function is called ~60 times/s at full speed
|
||||||
pushad
|
|
||||||
cmp byte[soundon],0
|
cmp byte[soundon],0
|
||||||
je .nosound
|
je .nosound
|
||||||
cmp byte[DSPDisable],1
|
cmp byte[DSPDisable],1
|
||||||
je .nosound
|
je .nosound
|
||||||
mov eax,256 ; Size
|
mov dword[BufferSizeB],256
|
||||||
mov [BufferSizeB],eax
|
mov dword[BufferSizeW],512
|
||||||
add eax,eax
|
|
||||||
mov [BufferSizeW],eax
|
|
||||||
pushad
|
pushad
|
||||||
call ProcessSoundBuffer
|
call ProcessSoundBuffer
|
||||||
popad
|
popad
|
||||||
|
|
||||||
; DSPBuffer should contain the processed buffer in the specified size
|
; DSPBuffer should contain the processed buffer in the specified size
|
||||||
; You will have to convert/clip it to 16-bit for actual sound process
|
; You will have to convert/clip it to 16-bit for actual sound process
|
||||||
.nosound
|
.nosound
|
||||||
popad
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
NEWSYM delay
|
NEWSYM delay
|
||||||
|
|||||||
Reference in New Issue
Block a user