Added surround option to windows and linux port
This commit is contained in:
@@ -130,7 +130,7 @@ EXTSYM NoiseData,SoundCompD,Voice0Disable,csounddisable,dssel,spcRamcmp
|
|||||||
EXTSYM cfgecho,Surround,SoundBufEn
|
EXTSYM cfgecho,Surround,SoundBufEn
|
||||||
EXTSYM echobuf,ENVDisable
|
EXTSYM echobuf,ENVDisable
|
||||||
EXTSYM LowPassFilterType
|
EXTSYM LowPassFilterType
|
||||||
EXTSYM UseCubicSpline,NoiseDisTemp
|
EXTSYM NoiseDisTemp
|
||||||
|
|
||||||
NEWSYM DspProcAsmStart
|
NEWSYM DspProcAsmStart
|
||||||
|
|
||||||
@@ -5639,6 +5639,7 @@ NEWSYM LPFstereo
|
|||||||
; mov ecx, <------------------- # of samples to mix / 4
|
; mov ecx, <------------------- # of samples to mix / 4
|
||||||
mov ebx,[LPFsample1]
|
mov ebx,[LPFsample1]
|
||||||
mov edx,[LPFsample2]
|
mov edx,[LPFsample2]
|
||||||
|
|
||||||
NEWSYM LPFstereoloop
|
NEWSYM LPFstereoloop
|
||||||
push ecx
|
push ecx
|
||||||
mov eax,[esi]
|
mov eax,[esi]
|
||||||
@@ -5664,7 +5665,49 @@ NEWSYM LPFstereoloop
|
|||||||
jnz near LPFstereoloop
|
jnz near LPFstereoloop
|
||||||
mov [LPFsample1],ebx
|
mov [LPFsample1],ebx
|
||||||
mov [LPFsample2],edx
|
mov [LPFsample2],edx
|
||||||
|
|
||||||
NEWSYM LPFexit
|
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
|
ret
|
||||||
|
|
||||||
NEWSYM stopsbsound16
|
NEWSYM stopsbsound16
|
||||||
|
|||||||
@@ -1226,18 +1226,10 @@ GUISoundKeys:
|
|||||||
jne .notrevst
|
jne .notrevst
|
||||||
xor byte[RevStereo],1
|
xor byte[RevStereo],1
|
||||||
.notrevst
|
.notrevst
|
||||||
%ifdef __MSDOS__
|
|
||||||
cmp dh,'U'
|
cmp dh,'U'
|
||||||
jne .nosurround
|
jne .nosurround
|
||||||
xor byte[Surround],1
|
xor byte[Surround],1
|
||||||
.nosurround
|
.nosurround
|
||||||
%endif
|
|
||||||
%ifdef __WIN32__
|
|
||||||
cmp dh,'X'
|
|
||||||
jne .noexclusivesound
|
|
||||||
xor byte[ExclusiveSound],1
|
|
||||||
.noexclusivesound
|
|
||||||
%endif
|
|
||||||
cmp dh,'B'
|
cmp dh,'B'
|
||||||
jne .nosoundbuf
|
jne .nosoundbuf
|
||||||
xor byte[SoundBufEn],1
|
xor byte[SoundBufEn],1
|
||||||
|
|||||||
@@ -2323,12 +2323,7 @@ DisplayGUISoundClick:
|
|||||||
GUIClickCButtonS 11,111,byte[RevStereo]
|
GUIClickCButtonS 11,111,byte[RevStereo]
|
||||||
; cmp byte[OSPort],3
|
; cmp byte[OSPort],3
|
||||||
; je near .win32sound
|
; je near .win32sound
|
||||||
%ifdef __MSDOS__
|
|
||||||
GUIClickCButton 11,121,byte[Surround]
|
GUIClickCButton 11,121,byte[Surround]
|
||||||
%endif
|
|
||||||
%ifdef __WIN32__
|
|
||||||
GUIClickCButton 11,121,byte[ExclusiveSound]
|
|
||||||
%endif
|
|
||||||
;.win32sound
|
;.win32sound
|
||||||
GUIClickCButton 11,131,byte[SoundBufEn]
|
GUIClickCButton 11,131,byte[SoundBufEn]
|
||||||
GUIClickCButton 11,141,byte[SPCDisable]
|
GUIClickCButton 11,141,byte[SPCDisable]
|
||||||
|
|||||||
@@ -2171,13 +2171,8 @@ DisplayGUISound:
|
|||||||
GUIOuttextwin2u 6,26,116,GUISoundTextH,2
|
GUIOuttextwin2u 6,26,116,GUISoundTextH,2
|
||||||
; cmp byte[OSPort],3
|
; cmp byte[OSPort],3
|
||||||
; je near .win32s2
|
; je near .win32s2
|
||||||
%ifdef __MSDOS__
|
|
||||||
GUIOuttextwin2u 6,26,126,GUISoundTextI,1
|
GUIOuttextwin2u 6,26,126,GUISoundTextI,1
|
||||||
%endif
|
|
||||||
;.win32s2
|
;.win32s2
|
||||||
%ifdef __WIN32__
|
|
||||||
GUIOuttextwin2u 6,26,126,GUISoundTextO,1
|
|
||||||
%endif
|
|
||||||
GUIOuttextwin2u 6,26,136,GUISoundTextJ,6
|
GUIOuttextwin2u 6,26,136,GUISoundTextJ,6
|
||||||
GUIOuttextwin2u 6,26,146,GUISoundTextK,0
|
GUIOuttextwin2u 6,26,146,GUISoundTextK,0
|
||||||
GUIOuttextwin2u 6,26,166,GUISoundTextQ,0
|
GUIOuttextwin2u 6,26,166,GUISoundTextQ,0
|
||||||
@@ -2199,13 +2194,8 @@ DisplayGUISound:
|
|||||||
GUIOuttextwin2 6,25,115,GUISoundTextH
|
GUIOuttextwin2 6,25,115,GUISoundTextH
|
||||||
; cmp byte[OSPort],3
|
; cmp byte[OSPort],3
|
||||||
; je near .win32s
|
; je near .win32s
|
||||||
%ifdef __MSDOS__
|
|
||||||
GUIOuttextwin2 6,25,125,GUISoundTextI
|
GUIOuttextwin2 6,25,125,GUISoundTextI
|
||||||
%endif
|
|
||||||
;.win32s
|
;.win32s
|
||||||
%ifdef __WIN32__
|
|
||||||
GUIOuttextwin2 6,25,125,GUISoundTextO
|
|
||||||
%endif
|
|
||||||
GUIOuttextwin2 6,25,135,GUISoundTextJ
|
GUIOuttextwin2 6,25,135,GUISoundTextJ
|
||||||
GUIOuttextwin2 6,25,145,GUISoundTextK
|
GUIOuttextwin2 6,25,145,GUISoundTextK
|
||||||
GUIOuttextwin2 6,25,165,GUISoundTextQ
|
GUIOuttextwin2 6,25,165,GUISoundTextQ
|
||||||
@@ -2243,6 +2233,7 @@ DisplayGUISound:
|
|||||||
mov dword[GUITemp],GUIIconDataCheckBoxC
|
mov dword[GUITemp],GUIIconDataCheckBoxC
|
||||||
.nocheckbox1
|
.nocheckbox1
|
||||||
GUIDisplayIconWin 6,11,30,[GUITemp]
|
GUIDisplayIconWin 6,11,30,[GUITemp]
|
||||||
|
%ifdef __MSDOS__
|
||||||
mov dword[GUITemp],GUIIconDataCheckBoxUC
|
mov dword[GUITemp],GUIIconDataCheckBoxUC
|
||||||
cmp byte[RaisePitch],0
|
cmp byte[RaisePitch],0
|
||||||
je .nocheckbox1b
|
je .nocheckbox1b
|
||||||
@@ -2250,7 +2241,6 @@ DisplayGUISound:
|
|||||||
.nocheckbox1b
|
.nocheckbox1b
|
||||||
; cmp byte[OSPort],3
|
; cmp byte[OSPort],3
|
||||||
; je near .win32
|
; je near .win32
|
||||||
%ifdef __MSDOS__
|
|
||||||
GUIDisplayIconWin 6,11,39,[GUITemp]
|
GUIDisplayIconWin 6,11,39,[GUITemp]
|
||||||
%endif
|
%endif
|
||||||
;.win32
|
;.win32
|
||||||
@@ -2266,24 +2256,14 @@ DisplayGUISound:
|
|||||||
mov dword[GUITemp],GUIIconDataCheckBoxC
|
mov dword[GUITemp],GUIIconDataCheckBoxC
|
||||||
.nocheckbox3
|
.nocheckbox3
|
||||||
GUIDisplayIconWin 6,11,111,[GUITemp]
|
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
|
; cmp byte[OSPort],3
|
||||||
; je near .nocheckbox42
|
; je near .nocheckbox42
|
||||||
%ifdef __MSDOS__
|
|
||||||
mov dword[GUITemp],GUIIconDataCheckBoxUC
|
mov dword[GUITemp],GUIIconDataCheckBoxUC
|
||||||
cmp byte[Surround],0
|
cmp byte[Surround],0
|
||||||
je .nocheckbox4
|
je .nocheckbox4
|
||||||
mov dword[GUITemp],GUIIconDataCheckBoxC
|
mov dword[GUITemp],GUIIconDataCheckBoxC
|
||||||
.nocheckbox4
|
.nocheckbox4
|
||||||
GUIDisplayIconWin 6,11,121,[GUITemp]
|
GUIDisplayIconWin 6,11,121,[GUITemp]
|
||||||
%endif
|
|
||||||
mov dword[GUITemp],GUIIconDataCheckBoxUC
|
mov dword[GUITemp],GUIIconDataCheckBoxUC
|
||||||
cmp byte[SoundBufEn],0
|
cmp byte[SoundBufEn],0
|
||||||
je .nocheckbox5
|
je .nocheckbox5
|
||||||
@@ -2419,7 +2399,6 @@ GUISoundTextH db 'REVERSE STEREO',0
|
|||||||
GUISoundTextI db 'SURROUND SOUND',0
|
GUISoundTextI db 'SURROUND SOUND',0
|
||||||
GUISoundTextJ db 'SOUND BUFFERING',0
|
GUISoundTextJ db 'SOUND BUFFERING',0
|
||||||
GUISoundTextK db 'DISABLE SPC EMULATION',0
|
GUISoundTextK db 'DISABLE SPC EMULATION',0
|
||||||
GUISoundTextO db 'EXCLUSIVE MODE',0
|
|
||||||
GUISoundTextP db 'INTERPOLATION :',0
|
GUISoundTextP db 'INTERPOLATION :',0
|
||||||
GUISoundTextQ db 'GAUSSIAN',0
|
GUISoundTextQ db 'GAUSSIAN',0
|
||||||
GUISoundTextR db 'CUBIC SPLINE',0
|
GUISoundTextR db 'CUBIC SPLINE',0
|
||||||
|
|||||||
@@ -318,7 +318,6 @@ void DosExit(void);
|
|||||||
extern BYTE GUIOn2;
|
extern BYTE GUIOn2;
|
||||||
extern BYTE StereoSound;
|
extern BYTE StereoSound;
|
||||||
extern DWORD SoundQuality;
|
extern DWORD SoundQuality;
|
||||||
extern BYTE ExclusiveSound;
|
|
||||||
extern BYTE HighPriority;
|
extern BYTE HighPriority;
|
||||||
extern BYTE AlwaysOnTop;
|
extern BYTE AlwaysOnTop;
|
||||||
extern BYTE SaveMainWindowPos;
|
extern BYTE SaveMainWindowPos;
|
||||||
@@ -628,18 +627,7 @@ InitSound()
|
|||||||
|
|
||||||
if (DS_OK == pDirectSoundCreate8(NULL, &lpDirectSound,NULL))
|
if (DS_OK == pDirectSoundCreate8(NULL, &lpDirectSound,NULL))
|
||||||
{
|
{
|
||||||
if (ExclusiveSound == 0)
|
if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_NORMAL))
|
||||||
{
|
|
||||||
if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_NORMAL))
|
|
||||||
{
|
|
||||||
if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_EXCLUSIVE))
|
|
||||||
{
|
|
||||||
SoundEnabled=0;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_EXCLUSIVE))
|
if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_EXCLUSIVE))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user