From: <man...@us...> - 2013-04-12 14:57:27
|
Revision: 1858 http://sourceforge.net/p/modplug/code/1858 Author: manxorist Date: 2013-04-12 14:57:05 +0000 (Fri, 12 Apr 2013) Log Message: ----------- [Ref] Replace SNDMIX_* flags with PROCSUPPORT_* flags. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/sounddsp/EQ.cpp trunk/OpenMPT/sounddsp/Reverb.cpp trunk/OpenMPT/soundlib/Fastmix.cpp trunk/OpenMPT/soundlib/Mmx_mix.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -129,11 +129,11 @@ if (m_dwSoundSetup & SOUNDSETUP_SECONDARY) CheckDlgButton(IDC_CHECK4, MF_CHECKED); if (!(m_dwSoundSetup & SOUNDSETUP_NOBOOSTTHREADPRIORITY)) CheckDlgButton(IDC_CHECK5, MF_CHECKED); // Multimedia extensions - ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK3), (CSoundFile::GetSysInfo() & SYSMIX_ENABLEMMX) ? TRUE : FALSE); - if(CSoundFile::GetSysInfo() & SYSMIX_SSE) + ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK3), (CSoundFile::GetSysInfo() & PROCSUPPORT_MMX) ? TRUE : FALSE); + if(CSoundFile::GetSysInfo() & PROCSUPPORT_SSE) { SetDlgItemText(IDC_CHECK3, _T("Enable SSE acceleration")); - } else if (CSoundFile::GetSysInfo() & SYSMIX_3DNOW) + } else if (CSoundFile::GetSysInfo() & PROCSUPPORT_3DNOW) { SetDlgItemText(IDC_CHECK3, _T("Enable 3DNow! acceleration")); } @@ -613,7 +613,7 @@ } } m_CbnReverbPreset.SetCurSel(nSel); - if (!(CSoundFile::GetSysInfo() & SYSMIX_ENABLEMMX)) + if (!(CSoundFile::GetSysInfo() & PROCSUPPORT_MMX)) { ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK6), FALSE); m_SbReverbDepth.EnableWindow(FALSE); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -891,12 +891,12 @@ // Initialize Audio DWORD sysinfo = CSoundFile::GetSysInfo(); - if(sysinfo & SYSMIX_ENABLEMMX) + if(sysinfo & PROCSUPPORT_MMX) { TrackerSettings::Instance().m_MixerSettings.MixerFlags |= SNDMIX_ENABLEMMX; TrackerSettings::Instance().m_ResamplerSettings.SrcMode = SRCMODE_SPLINE; } - if(sysinfo & SYSMIX_MMXEX) + if(sysinfo & PROCSUPPORT_MMXEX) { TrackerSettings::Instance().m_ResamplerSettings.SrcMode = SRCMODE_POLYPHASE; } Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -718,7 +718,7 @@ smin = 32767; smax = -32768; #ifdef ENABLE_MMX - if (sysinfo & SYSMIX_MMXEX) + if (sysinfo & PROCSUPPORT_MMXEX) { mmxex_findminmax16(p, scanlen, smplsize, &smin, &smax); } else @@ -741,7 +741,7 @@ smin = 127; smax = -128; #ifdef ENABLE_MMX - if (sysinfo & SYSMIX_MMXEX) + if (sysinfo & PROCSUPPORT_MMXEX) { mmxex_findminmax8(p, scanlen, smplsize, &smin, &smax); } else Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -3409,7 +3409,7 @@ #ifdef ENABLE_MMX #ifdef ENABLE_SSE - if(CSoundFile::GetSysInfo() & SYSMIX_SSE) + if(CSoundFile::GetSysInfo() & PROCSUPPORT_SSE) { SSEInterleaveFloatToInt16(inputs[0], inputs[1], samples); m_pMediaProcess->Process(samples * 2 * sizeof(int16), reinterpret_cast<BYTE *>(m_pMixBuffer), m_DataTime, DMO_INPLACE_NORMAL); Modified: trunk/OpenMPT/sounddsp/EQ.cpp =================================================================== --- trunk/OpenMPT/sounddsp/EQ.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/sounddsp/EQ.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -345,7 +345,7 @@ // Still allow the check, because the user can turn this on/off - if ((SysInfoFlags & SYSMIX_SSE) && (SoundSetupFlags & SNDMIX_ENABLEMMX)) + if ((SysInfoFlags & PROCSUPPORT_SSE) && (SoundSetupFlags & SNDMIX_ENABLEMMX)) { int sse_state, sse_eqstate; SSE_MonoMixToFloat(pbuffer, MixFloatBuffer, nCount*2, config.getIntToFloat()); @@ -371,7 +371,7 @@ // We still perform the MMX check because the user can enable/disable this - if ((SysInfoFlags & SYSMIX_3DNOW) && (SoundSetupFlags & SNDMIX_ENABLEMMX)) + if ((SysInfoFlags & PROCSUPPORT_3DNOW) && (SoundSetupFlags & SNDMIX_ENABLEMMX)) { AMD_MonoMixToFloat(pbuffer, MixFloatBuffer, nCount*2, config.getIntToFloat()); Modified: trunk/OpenMPT/sounddsp/Reverb.cpp =================================================================== --- trunk/OpenMPT/sounddsp/Reverb.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/sounddsp/Reverb.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -404,7 +404,7 @@ if ((!gnReverbSend) && (!gnReverbSamples)) return; if (!gnReverbSend) X86_StereoFill(MixReverbBuffer, nSamples, &gnRvbROfsVol, &gnRvbLOfsVol); - if (!(sysinfo & SYSMIX_ENABLEMMX)) return; + if (!(sysinfo & PROCSUPPORT_MMX)) return; // Dynamically adjust reverb master gains LONG lMasterGain; lMasterGain = ((g_RefDelay.lMasterGain * m_Settings.m_nReverbDepth) >> 4); Modified: trunk/OpenMPT/soundlib/Fastmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Fastmix.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/soundlib/Fastmix.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -1489,9 +1489,9 @@ pbuffer = MixSoundBuffer; #ifndef NO_REVERB #ifdef ENABLE_MMX - if((m_MixerSettings.DSPMask & SNDDSP_REVERB) && (gdwSysInfo & SYSMIX_ENABLEMMX) && !pChannel->dwFlags[CHN_NOREVERB]) + if((m_MixerSettings.DSPMask & SNDDSP_REVERB) && (gdwSysInfo & PROCSUPPORT_MMX) && !pChannel->dwFlags[CHN_NOREVERB]) pbuffer = MixReverbBuffer; - if(pChannel->dwFlags[CHN_REVERB] && (gdwSysInfo & SYSMIX_ENABLEMMX)) + if(pChannel->dwFlags[CHN_REVERB] && (gdwSysInfo & PROCSUPPORT_MMX)) pbuffer = MixReverbBuffer; #endif #endif @@ -1790,14 +1790,14 @@ if(m_MixerSettings.MixerFlags & SNDMIX_ENABLEMMX) { #ifdef ENABLE_SSE - if(gdwSysInfo & SYSMIX_SSE) + if(gdwSysInfo & PROCSUPPORT_SSE) { SSE_StereoMixToFloat(pSrc, pOut1, pOut2, nCount, m_PlayConfig.getIntToFloat()); return; } #endif // ENABLE_SSE #ifdef ENABLE_3DNOW - if(gdwSysInfo & SYSMIX_3DNOW) + if(gdwSysInfo & PROCSUPPORT_3DNOW) { AMD_StereoMixToFloat(pSrc, pOut1, pOut2, nCount, m_PlayConfig.getIntToFloat()); return; @@ -1816,7 +1816,7 @@ if(m_MixerSettings.MixerFlags & SNDMIX_ENABLEMMX) { #ifdef ENABLE_3DNOW - if(gdwSysInfo & SYSMIX_3DNOW) + if(gdwSysInfo & PROCSUPPORT_3DNOW) { AMD_FloatToStereoMix(pIn1, pIn2, pOut, nCount, m_PlayConfig.getFloatToInt()); return; @@ -1833,14 +1833,14 @@ if(m_MixerSettings.MixerFlags & SNDMIX_ENABLEMMX) { #ifdef ENABLE_SSE - if(gdwSysInfo & SYSMIX_SSE) + if(gdwSysInfo & PROCSUPPORT_SSE) { SSE_MonoMixToFloat(pSrc, pOut, nCount, m_PlayConfig.getIntToFloat()); return; } #endif // ENABLE_SSE #ifdef ENABLE_3DNOW - if(gdwSysInfo & SYSMIX_3DNOW) + if(gdwSysInfo & PROCSUPPORT_3DNOW) { AMD_MonoMixToFloat(pSrc, pOut, nCount, m_PlayConfig.getIntToFloat()); return; @@ -1858,7 +1858,7 @@ if(m_MixerSettings.MixerFlags & SNDMIX_ENABLEMMX) { #ifdef ENABLE_3DNOW - if(gdwSysInfo & SYSMIX_3DNOW) + if(gdwSysInfo & PROCSUPPORT_3DNOW) { AMD_FloatToMonoMix(pIn, pOut, nCount, m_PlayConfig.getFloatToInt()); return; Modified: trunk/OpenMPT/soundlib/Mmx_mix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Mmx_mix.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/soundlib/Mmx_mix.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -24,13 +24,9 @@ #include "sndfile.h" #include "../common/Reporting.h" -#define PROCSUPPORT_CPUID 0x01 -#define PROCSUPPORT_MMX 0x02 -#define PROCSUPPORT_MMXEX 0x04 -#define PROCSUPPORT_3DNOW 0x08 -#define PROCSUPPORT_SSE 0x10 -static unsigned int QueryProcessorExtensions() +DWORD CSoundFile::GetSysInfo() +//---------------------------- { static unsigned int fProcessorExtensions = 0; static bool bMMXChecked = false; @@ -86,26 +82,6 @@ } -DWORD CSoundFile::GetSysInfo() -//---------------------------- -{ - DWORD d = 0; - DWORD dwProcSupport = QueryProcessorExtensions(); - if (dwProcSupport & PROCSUPPORT_MMX) d |= SYSMIX_ENABLEMMX; - if (dwProcSupport & PROCSUPPORT_MMXEX) d |= SYSMIX_MMXEX; - if (dwProcSupport & PROCSUPPORT_3DNOW) d |= SYSMIX_3DNOW; - if (dwProcSupport & PROCSUPPORT_SSE) d |= SYSMIX_SSE; - return d; -} - - -////////////////////////////////////////////////////////////////////////////////// -// -// Misc. mix functions -// - - - //////////////////////////////////////////////////////////////////////////////////// // 3DNow! optimizations Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2013-04-12 14:57:05 UTC (rev 1858) @@ -234,12 +234,14 @@ #define DNA_NOTEOFF 1 #define DNA_NOTEFADE 2 -// Mixer Hardware-Dependent features -#define SYSMIX_ENABLEMMX 0x01 // Hardware acceleration features (MMX/3DNow!/SSE) are supported by this processor -#define SYSMIX_MMXEX 0x08 // Processor supports AMD MMX extensions -#define SYSMIX_3DNOW 0x10 // Processor supports AMD 3DNow! instructions -#define SYSMIX_SSE 0x20 // Processor supports SSE instructions +#define PROCSUPPORT_CPUID 0x01 +#define PROCSUPPORT_MMX 0x02 // Processor supports MMX instructions +#define PROCSUPPORT_MMXEX 0x04 // Processor supports AMD MMX extensions +#define PROCSUPPORT_3DNOW 0x08 // Processor supports AMD 3DNow! instructions +#define PROCSUPPORT_SSE 0x10 // Processor supports SSE instructions + + // Module flags FLAGSET(SongFlags) { Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-12 14:21:57 UTC (rev 1857) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-12 14:57:05 UTC (rev 1858) @@ -911,7 +911,7 @@ //---------------------------------------------------------------------------------------------------- { CriticalSection cs; - if(!(GetSysInfo() & SYSMIX_ENABLEMMX)) DSPMask &= ~SNDDSP_REVERB; + if(!(GetSysInfo() & PROCSUPPORT_MMX)) DSPMask &= ~SNDDSP_REVERB; m_MixerSettings.DSPMask = DSPMask; InitPlayer(FALSE); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |