From 4629fb11ff9e2ac8705e8029b75c853ad401270f Mon Sep 17 00:00:00 2001 From: jbo_85 <> Date: Thu, 16 Feb 2006 23:53:06 +0000 Subject: [PATCH] Fixed crash after enabling Sound Interpolation mid game. Fixed Gaussian always selected bug when MMX Support is disabled. Some options that are only available with MMX enabled are now hidden if MMX is disabled. --- zsnes/src/cpu/dspproc.asm | 27 ++++++++++++++------------- zsnes/src/gui/guiwindp.inc | 9 ++++++++- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/zsnes/src/cpu/dspproc.asm b/zsnes/src/cpu/dspproc.asm index 75ef28f2..0d34bb78 100644 --- a/zsnes/src/cpu/dspproc.asm +++ b/zsnes/src/cpu/dspproc.asm @@ -125,7 +125,7 @@ EXTSYM WDSPRegF5,WDSPRegF6,WDSPRegF7,WDSPRegF8,WDSPRegF9,WDSPRegFA,WDSPRegFB EXTSYM WDSPRegFC,WDSPRegFD,WDSPRegFE,WDSPRegFF EXTSYM spcBuffera,DSPMem,SoundInterpType,NoiseData,Voice0Disable EXTSYM cfgecho,Surround,echobuf,ENVDisable,LowPassFilterType -EXTSYM EMUPause,AudioLogging +EXTSYM EMUPause,AudioLogging,MMXSupport %ifdef __MSDOS__ EXTSYM SB_alloc_dma,SB_quality_limiter,vibracard @@ -477,18 +477,19 @@ NEWSYM conv2speed jnz .next ret -EXTSYM MMXSupport - NEWSYM AdjustFrequency + xor ebx,ebx mov al,[SoundInterpType] mov ah,[MMXSupport] - cmp ah,0 + or al,al + je near .notgaussian + or ah,ah jne .mmx + cmp al,3 + jb .mmx mov al,1 mov [SoundInterpType],al .mmx - or al,al - je near .notgaussian cmp al,2 je near .cubicspline ja near .fir_mmx @@ -1902,8 +1903,8 @@ BRRDecode: dec byte[sampleleft] jnz .nextsample - cmp byte[SoundInterpType],1 - jae .BRR_decode_ahead + cmp dword[DSPInterpolate],0 + jnz .BRR_decode_ahead cmp byte[LowPassFilterType],2 jle near .no_dlpf @@ -4444,7 +4445,7 @@ NEWSYM EchoStereo pop edx pop ebx mov ebx,[Voice0Freq+%1*4] - cmp byte[SoundInterpType],0 + cmp dword[DSPInterpolate],0 je %%notinterpsound cmp byte[StereoSound],1 je near %%EndofProcessNEnvsi @@ -4485,7 +4486,7 @@ NEWSYM EchoStereo pop edx pop ebx mov ebx,[Voice0Freq+%1*4] - cmp byte[SoundInterpType],0 + cmp dword[DSPInterpolate],0 je %%notinterpsound2 cmp byte[StereoSound],1 je near %%EndofProcessNEnvsi @@ -4500,7 +4501,7 @@ NEWSYM EchoStereo mov dword[Voice0Time+%1*4],0FFFFFFFFh %%ContinueGain mov ebx,[Voice0Freq+%1*4] - cmp byte[SoundInterpType],0 + cmp dword[DSPInterpolate],0 je %%notinterpsound3 cmp byte[StereoSound],1 je near %%EndofProcessNEnvsi @@ -4626,7 +4627,7 @@ NEWSYM EchoStereo mov byte[UniqueSoundv],1 %%NotUnique - cmp byte[SoundInterpType],0 + cmp dword[DSPInterpolate],0 je %%notinterpsound4 cmp byte[StereoSound],1 je %%NextSampleSi @@ -4801,7 +4802,7 @@ NEWSYM EchoStereo mov [Voice0End+%1],al mov ebx,[Voice0Freq+%1*4] add dword[Voice0Ptr+%1*4],9 - cmp byte[SoundInterpType],0 + cmp dword[DSPInterpolate],0 je %%notinterpsound6 cmp byte[StereoSound],1 je near %%NextSampleSi diff --git a/zsnes/src/gui/guiwindp.inc b/zsnes/src/gui/guiwindp.inc index af191263..d78abf2f 100644 --- a/zsnes/src/gui/guiwindp.inc +++ b/zsnes/src/gui/guiwindp.inc @@ -20,6 +20,8 @@ +EXTSYM VERSION_STR,placedate + SECTION .text ; Window Display Routines @@ -1742,14 +1744,20 @@ DisplayGUISound: ; Sound Related Options GUIDisplayCheckboxun 6,11,163,SoundInterpType,1,GUISoundTextE1,0 GUIDisplayCheckboxun 6,11,173,SoundInterpType,2,GUISoundTextE2,0 %ifndef __MSDOS__ + cmp byte[MMXSupport],0 + je near .no8ptinterp GUIDisplayCheckboxun 6,11,183,SoundInterpType,3,GUISoundTextE3,0 +.no8ptinterp %endif GUIDisplayTextY 6,106,158,GUISoundTextF GUIDisplayCheckboxun 6,111,163,LowPassFilterType,1,GUISoundTextF1,1 GUIDisplayCheckboxun 6,111,173,LowPassFilterType,2,GUISoundTextF2,1 %ifndef __MSDOS__ + cmp byte[MMXSupport],0 + je near .nohiqualityfilter GUIDisplayCheckboxun 6,111,183,LowPassFilterType,3,GUISoundTextF3,0 +.nohiqualityfilter %endif GUIDisplayBBox 6,15,61,69,69,167 ;Sampling Rate Box @@ -3043,7 +3051,6 @@ DisplayGUIAbout: ; Displays the About Box ;This will attach compile date onto the end of GUIGUIAboutText1 pushad - EXTSYM VERSION_STR, placedate mov eax,GUIGUIAboutTextA1 mov [VERSION_STR],eax call placedate