Added surround option to windows and linux port

This commit is contained in:
pagefault
2001-09-04 16:38:14 +00:00
parent 9bd2c361f7
commit 6d742a5e5b
5 changed files with 46 additions and 49 deletions

View File

@@ -130,7 +130,7 @@ EXTSYM NoiseData,SoundCompD,Voice0Disable,csounddisable,dssel,spcRamcmp
EXTSYM cfgecho,Surround,SoundBufEn
EXTSYM echobuf,ENVDisable
EXTSYM LowPassFilterType
EXTSYM UseCubicSpline,NoiseDisTemp
EXTSYM NoiseDisTemp
NEWSYM DspProcAsmStart
@@ -5639,6 +5639,7 @@ NEWSYM LPFstereo
; mov ecx, <------------------- # of samples to mix / 4
mov ebx,[LPFsample1]
mov edx,[LPFsample2]
NEWSYM LPFstereoloop
push ecx
mov eax,[esi]
@@ -5664,7 +5665,49 @@ NEWSYM LPFstereoloop
jnz near LPFstereoloop
mov [LPFsample1],ebx
mov [LPFsample2],edx
NEWSYM LPFexit
%ifndef __MSDOS__
cmp byte[Surround],1
jnz near .nosurround
cmp byte[StereoSound],1
jnz near .nosurround
mov esi,DSPBuffer
mov ecx,[BufferSizeB]
shr ecx,1
.loop
mov eax,[esi]
mov edx,[esi+4]
add edx,eax
sar edx,1
sub eax,edx ; possibly eliminate center
shl eax,3
mov ebx,[esi+4]
sub [esi+4],eax
sub ebx,edx ; possibly eliminate center
shl ebx,3
sub [esi],ebx
sar dword[esi],1
sar dword[esi+4],1
mov eax,[esi]
mov edx,[esi+4]
add edx,eax
sar edx,1
add [esi],edx
add [esi+4],edx
add esi,8
dec ecx
jnz near .loop
.nosurround
%endif
ret
NEWSYM stopsbsound16

View File

@@ -1226,18 +1226,10 @@ GUISoundKeys:
jne .notrevst
xor byte[RevStereo],1
.notrevst
%ifdef __MSDOS__
cmp dh,'U'
jne .nosurround
xor byte[Surround],1
.nosurround
%endif
%ifdef __WIN32__
cmp dh,'X'
jne .noexclusivesound
xor byte[ExclusiveSound],1
.noexclusivesound
%endif
cmp dh,'B'
jne .nosoundbuf
xor byte[SoundBufEn],1

View File

@@ -2323,12 +2323,7 @@ DisplayGUISoundClick:
GUIClickCButtonS 11,111,byte[RevStereo]
; cmp byte[OSPort],3
; je near .win32sound
%ifdef __MSDOS__
GUIClickCButton 11,121,byte[Surround]
%endif
%ifdef __WIN32__
GUIClickCButton 11,121,byte[ExclusiveSound]
%endif
;.win32sound
GUIClickCButton 11,131,byte[SoundBufEn]
GUIClickCButton 11,141,byte[SPCDisable]

View File

@@ -2171,13 +2171,8 @@ DisplayGUISound:
GUIOuttextwin2u 6,26,116,GUISoundTextH,2
; cmp byte[OSPort],3
; je near .win32s2
%ifdef __MSDOS__
GUIOuttextwin2u 6,26,126,GUISoundTextI,1
%endif
;.win32s2
%ifdef __WIN32__
GUIOuttextwin2u 6,26,126,GUISoundTextO,1
%endif
GUIOuttextwin2u 6,26,136,GUISoundTextJ,6
GUIOuttextwin2u 6,26,146,GUISoundTextK,0
GUIOuttextwin2u 6,26,166,GUISoundTextQ,0
@@ -2199,13 +2194,8 @@ DisplayGUISound:
GUIOuttextwin2 6,25,115,GUISoundTextH
; cmp byte[OSPort],3
; je near .win32s
%ifdef __MSDOS__
GUIOuttextwin2 6,25,125,GUISoundTextI
%endif
;.win32s
%ifdef __WIN32__
GUIOuttextwin2 6,25,125,GUISoundTextO
%endif
GUIOuttextwin2 6,25,135,GUISoundTextJ
GUIOuttextwin2 6,25,145,GUISoundTextK
GUIOuttextwin2 6,25,165,GUISoundTextQ
@@ -2243,6 +2233,7 @@ DisplayGUISound:
mov dword[GUITemp],GUIIconDataCheckBoxC
.nocheckbox1
GUIDisplayIconWin 6,11,30,[GUITemp]
%ifdef __MSDOS__
mov dword[GUITemp],GUIIconDataCheckBoxUC
cmp byte[RaisePitch],0
je .nocheckbox1b
@@ -2250,7 +2241,6 @@ DisplayGUISound:
.nocheckbox1b
; cmp byte[OSPort],3
; je near .win32
%ifdef __MSDOS__
GUIDisplayIconWin 6,11,39,[GUITemp]
%endif
;.win32
@@ -2266,24 +2256,14 @@ DisplayGUISound:
mov dword[GUITemp],GUIIconDataCheckBoxC
.nocheckbox3
GUIDisplayIconWin 6,11,111,[GUITemp]
%ifdef __WIN32__
mov dword[GUITemp],GUIIconDataCheckBoxUC
cmp byte[ExclusiveSound],0
je .nocheckbox32
mov dword[GUITemp],GUIIconDataCheckBoxC
.nocheckbox32
GUIDisplayIconWin 6,11,121,[GUITemp]
%endif
; cmp byte[OSPort],3
; je near .nocheckbox42
%ifdef __MSDOS__
mov dword[GUITemp],GUIIconDataCheckBoxUC
cmp byte[Surround],0
je .nocheckbox4
mov dword[GUITemp],GUIIconDataCheckBoxC
.nocheckbox4
GUIDisplayIconWin 6,11,121,[GUITemp]
%endif
mov dword[GUITemp],GUIIconDataCheckBoxUC
cmp byte[SoundBufEn],0
je .nocheckbox5
@@ -2419,7 +2399,6 @@ GUISoundTextH db 'REVERSE STEREO',0
GUISoundTextI db 'SURROUND SOUND',0
GUISoundTextJ db 'SOUND BUFFERING',0
GUISoundTextK db 'DISABLE SPC EMULATION',0
GUISoundTextO db 'EXCLUSIVE MODE',0
GUISoundTextP db 'INTERPOLATION :',0
GUISoundTextQ db 'GAUSSIAN',0
GUISoundTextR db 'CUBIC SPLINE',0

View File

@@ -318,7 +318,6 @@ void DosExit(void);
extern BYTE GUIOn2;
extern BYTE StereoSound;
extern DWORD SoundQuality;
extern BYTE ExclusiveSound;
extern BYTE HighPriority;
extern BYTE AlwaysOnTop;
extern BYTE SaveMainWindowPos;
@@ -627,8 +626,6 @@ InitSound()
PrevStereoSound=StereoSound;
if (DS_OK == pDirectSoundCreate8(NULL, &lpDirectSound,NULL))
{
if (ExclusiveSound == 0)
{
if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_NORMAL))
{
@@ -640,15 +637,6 @@ InitSound()
}
}
else
{
if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_EXCLUSIVE))
{
SoundEnabled=0;
return FALSE;
}
}
}
else
{
SoundEnabled=0; return FALSE;
}