All plugins now compile correctly under Win32. Upgraded ZeroSPU2 to use a newer version of SoundTouch in the process.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@685 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
Jake.Stine 2009-02-03 08:37:32 +00:00 committed by Gregory Hainaut
parent 36a2178e68
commit 36cc4fa08c
9 changed files with 93 additions and 48 deletions

View File

@ -314,7 +314,7 @@
Name="bzip2"
>
<File
RelativePath="..\bzip2\blocksort.c"
RelativePath="..\3rdparty\bzip2\blocksort.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -338,7 +338,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\bzip2\bzlib.c"
RelativePath="..\3rdparty\bzip2\bzlib.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -362,15 +362,15 @@
</FileConfiguration>
</File>
<File
RelativePath="..\bzip2\bzlib.h"
RelativePath="..\3rdparty\bzip2\bzlib.h"
>
</File>
<File
RelativePath="..\bzip2\bzlib_private.h"
RelativePath="..\3rdparty\bzip2\bzlib_private.h"
>
</File>
<File
RelativePath="..\bzip2\compress.c"
RelativePath="..\3rdparty\bzip2\compress.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -394,7 +394,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\bzip2\crctable.c"
RelativePath="..\3rdparty\bzip2\crctable.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -418,7 +418,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\bzip2\decompress.c"
RelativePath="..\3rdparty\bzip2\decompress.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -442,7 +442,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\bzip2\huffman.c"
RelativePath="..\3rdparty\bzip2\huffman.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -466,7 +466,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\bzip2\randtable.c"
RelativePath="..\3rdparty\bzip2\randtable.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -494,7 +494,7 @@
Name="zlib"
>
<File
RelativePath="..\zlib\adler32.c"
RelativePath="..\3rdparty\zlib\adler32.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -517,7 +517,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\compress.c"
RelativePath="..\3rdparty\zlib\compress.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -540,7 +540,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\crc32.c"
RelativePath="..\3rdparty\zlib\crc32.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -562,7 +562,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\deflate.c"
RelativePath="..\3rdparty\zlib\deflate.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -585,7 +585,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\gzio.c"
RelativePath="..\3rdparty\zlib\gzio.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -607,7 +607,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\infback.c"
RelativePath="..\3rdparty\zlib\infback.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -630,7 +630,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\inffast.c"
RelativePath="..\3rdparty\zlib\inffast.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -653,7 +653,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\inflate.c"
RelativePath="..\3rdparty\zlib\inflate.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -676,7 +676,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\inftrees.c"
RelativePath="..\3rdparty\zlib\inftrees.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -699,7 +699,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\trees.c"
RelativePath="..\3rdparty\zlib\trees.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -722,7 +722,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\uncompr.c"
RelativePath="..\3rdparty\zlib\uncompr.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -745,7 +745,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\zlib\zutil.c"
RelativePath="..\3rdparty\zlib\zutil.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -771,43 +771,43 @@
Name="headers"
>
<File
RelativePath="..\zlib\crc32.h"
RelativePath="..\3rdparty\zlib\crc32.h"
>
</File>
<File
RelativePath="..\zlib\deflate.h"
RelativePath="..\3rdparty\zlib\deflate.h"
>
</File>
<File
RelativePath="..\zlib\inffast.h"
RelativePath="..\3rdparty\zlib\inffast.h"
>
</File>
<File
RelativePath="..\zlib\inffixed.h"
RelativePath="..\3rdparty\zlib\inffixed.h"
>
</File>
<File
RelativePath="..\zlib\inflate.h"
RelativePath="..\3rdparty\zlib\inflate.h"
>
</File>
<File
RelativePath="..\zlib\inftrees.h"
RelativePath="..\3rdparty\zlib\inftrees.h"
>
</File>
<File
RelativePath="..\zlib\trees.h"
RelativePath="..\3rdparty\zlib\trees.h"
>
</File>
<File
RelativePath="..\zlib\zconf.h"
RelativePath="..\3rdparty\zlib\zconf.h"
>
</File>
<File
RelativePath="..\zlib\zlib.h"
RelativePath="..\3rdparty\zlib\zlib.h"
>
</File>
<File
RelativePath="..\zlib\zutil.h"
RelativePath="..\3rdparty\zlib\zutil.h"
>
</File>
</Filter>

View File

@ -15,7 +15,7 @@
#include "zlib/zlib.h"
#include "bzip2/bzlib.h"
#include "../../common/PS2Etypes.h"
#include "common/PS2Etypes.h"
#include "CDVDiso.h"
#include "libiso.h"

View File

@ -56,7 +56,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="..\;&quot;$(ProjectDir)&quot;;..\common;..\3rdparty"
PreprocessorDefinitions="NDEBUG;__WIN32__;__MSCW32__;WIN32;_WINDOWS;_USRDLL;SPU2GHZ_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
PreprocessorDefinitions="FLOAT_SAMPLES;NDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;SPU2GHZ_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
StructMemberAlignment="5"
@ -156,7 +156,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\;&quot;$(ProjectDir)&quot;;..\common;..\3rdparty"
PreprocessorDefinitions="_DEBUG;__WIN32__;__MSCW32__;WIN32;_WINDOWS;_USRDLL;SPU2GHZ_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
PreprocessorDefinitions="FLOAT_SAMPLES;_DEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;SPU2GHZ_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -259,7 +259,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="..\;&quot;$(ProjectDir)&quot;;..\common;..\3rdparty"
PreprocessorDefinitions="NDEBUG;PUBLIC;__WIN32__;__MSCW32__;WIN32;_WINDOWS;_USRDLL;SPU2GHZ_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
PreprocessorDefinitions="FLOAT_SAMPLES;NDEBUG;PUBLIC;__WIN32__;WIN32;_WINDOWS;_USRDLL;SPU2GHZ_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
StructMemberAlignment="5"
@ -363,7 +363,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\;&quot;$(ProjectDir)&quot;;..\common;..\3rdparty"
PreprocessorDefinitions="_DEBUG_FAST;_DEBUG;__WIN32__;__MSCW32__;WIN32;_WINDOWS;_USRDLL;SPU2GHZ_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
PreprocessorDefinitions="FLOAT_SAMPLES;_DEBUG_FAST;_DEBUG;__WIN32__;__MSCW32__;WIN32;_WINDOWS;_USRDLL;SPU2GHZ_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"

View File

@ -25,6 +25,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=".\tsvnrev\updateRevision.cmd &quot;$(ProjectDir)\..&quot; &quot;$(ProjectDir)\tsvnrev&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="libs;.."
AdditionalIncludeDirectories="libs;../;../common"
PreprocessorDefinitions="_WIN32;_DEBUG;_WINDOWS;_USRDLL;ZEROPAD_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -108,6 +109,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=".\tsvnrev\updateRevision.cmd &quot;$(ProjectDir)\..&quot; &quot;$(ProjectDir)\tsvnrev&quot;"
/>
<Tool
Name="VCCustomBuildTool"
@ -128,7 +130,7 @@
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="libs;.."
AdditionalIncludeDirectories="libs;../;../common"
PreprocessorDefinitions="_WIN32;NDEBUG;_WINDOWS;_USRDLL;ZEROPAD_EXPORTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"

View File

@ -39,6 +39,9 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
WNDPROC GSwndProc=NULL;
HWND GShwnd=NULL;
extern keyEvent event;
void SaveConfig()
{
char *szTemp;
@ -188,7 +191,7 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
}
event.event = KEYPRESS;
event.evt = KEYPRESS;
event.key = wParam;
break;
@ -203,7 +206,7 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
}
event.event = KEYRELEASE;
event.evt = KEYRELEASE;
event.key = wParam;
break;
@ -250,7 +253,7 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY:
case WM_QUIT:
event.event = KEYPRESS;
event.evt = KEYPRESS;
event.key = VK_ESCAPE;
return GSwndProc(hWnd, msg, wParam, lParam);

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\;&quot;$(ProjectDir)&quot;;..\common;..\3rdparty"
PreprocessorDefinitions="_WIN32;_DEBUG;_WINDOWS;_USRDLL;ZEROSPU2_EXPORTS"
PreprocessorDefinitions="_WIN32;WIN32;_DEBUG;_WINDOWS;_USRDLL;ZEROSPU2_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -130,7 +130,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\;&quot;$(ProjectDir)&quot;;..\common;..\3rdparty"
PreprocessorDefinitions="_WIN32;NDEBUG;_WINDOWS;_USRDLL;ZEROSPU2_EXPORTS"
PreprocessorDefinitions="FLOAT_SAMPLES;_WIN32;WIN32;NDEBUG;_WINDOWS;_USRDLL;ZEROSPU2_EXPORTS"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
@ -260,6 +260,10 @@
RelativePath="..\3rdparty\SoundTouch\AAFilter.h"
>
</File>
<File
RelativePath="..\3rdparty\SoundTouch\BPMDetect.cpp"
>
</File>
<File
RelativePath="..\3rdparty\SoundTouch\BPMDetect.h"
>
@ -295,6 +299,30 @@
<File
RelativePath="..\3rdparty\SoundTouch\mmx_optimized.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\3rdparty\SoundTouch\PeakFinder.cpp"
>
</File>
<File
RelativePath="..\3rdparty\SoundTouch\PeakFinder.h"
>
</File>
<File
RelativePath="..\3rdparty\SoundTouch\RateTransposer.cpp"

View File

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "zerospu2.h"
#include <assert.h>
#include <stdlib.h>
#include "zerospu2.h"
#include "SoundTouch/SoundTouch.h"
#include "SoundTouch/WavFile.h"

View File

@ -828,6 +828,9 @@ void ResampleLinear(s16* pStereoSamples, int oldsamples, s16* pNewSamples, int n
static PCSX2_ALIGNED16(s16 s_ThreadBuffer[NSSIZE*NSFRAMES*2*5]);
// SoundTouch's INTEGER system is broken these days, so we'll need this to do float conversions...
static PCSX2_ALIGNED16(float s_floatBuffer[NSSIZE*NSFRAMES*2*5]);
// communicates with the audio hardware
#ifdef _WIN32
DWORD WINAPI SPU2ThreadProc(LPVOID)
@ -900,15 +903,24 @@ void* SPU2ThreadProc(void* lpParam)
if ((nReadBuf & 3) == 0) // wow, this if statement makes the whole difference
pSoundTouch->setTempoChange(100.0f*(float)oldsamples/(float)NewSamples - 100.0f);
pSoundTouch->putSamples((s16*)s_pAudioBuffers[nReadBuf].pbuf, oldsamples);
for( int sx=0; sx<oldsamples*2; sx++ )
s_floatBuffer[sx] = ((s16*)s_pAudioBuffers[nReadBuf].pbuf)[sx]/65536.0f;
pSoundTouch->putSamples(s_floatBuffer, oldsamples);
// extract 2*NSFRAMES ms at a time
int nOutSamples;
do
{
nOutSamples = pSoundTouch->receiveSamples(s_ThreadBuffer, NSSIZE * NSFRAMES * 5);
if ( nOutSamples > 0 ) SoundFeedVoiceData((u8*)s_ThreadBuffer, nOutSamples * 4);
nOutSamples = pSoundTouch->receiveSamples(s_floatBuffer, NSSIZE * NSFRAMES * 5);
if ( nOutSamples > 0 )
{
for( int sx=0; sx<nOutSamples*2; sx++ )
s_ThreadBuffer[sx] = (s16)(s_floatBuffer[sx]*65536.0f);
SoundFeedVoiceData((u8*)s_ThreadBuffer, nOutSamples * 4);
}
} while (nOutSamples != 0);