diff --git a/plugins/build.sh b/plugins/build.sh index f51c1264a3..d8b432137e 100644 --- a/plugins/build.sh +++ b/plugins/build.sh @@ -3,6 +3,8 @@ curdir=`pwd` buildplugin() { +if [ -d ${curdir}/$1 ] +then cd ${curdir}/$1 sh build.sh $2 @@ -10,6 +12,7 @@ if [ $? -ne 0 ] then exit 1 fi +fi } buildplugin CDVDnull $@ @@ -19,6 +22,7 @@ buildplugin USBnull $@ buildplugin SPU2null $@ buildplugin zerogs $@ +buildplugin zzogl $@ buildplugin zeropad $@ buildplugin zerospu2 $@ diff --git a/plugins/spu2-x/src/Linux/Alsa.cpp b/plugins/spu2-x/src/Linux/Alsa.cpp index 018250f92a..97df382e53 100644 --- a/plugins/spu2-x/src/Linux/Alsa.cpp +++ b/plugins/spu2-x/src/Linux/Alsa.cpp @@ -24,17 +24,19 @@ #define ALSA_MEM_DEF #include "Alsa.h" +#include "SndOut.h" class AlsaMod: public SndOutModule { protected: static const int PacketsPerBuffer = 1; // increase this if ALSA can't keep up with 512-sample packets static const int MAX_BUFFER_COUNT = 4; - static const int NumBuffers = 4; // TODO: this should be configurable someday -- lower values reduce latency. + static const int NumBuffers = 4; // TODO: this should be configurable someday -- lower values reduce latency. + unsigned int pspeed; - snd_pcm_t *handle = NULL; + snd_pcm_t *handle; snd_pcm_uframes_t buffer_size; - snd_async_handler_t *pcm_callback = NULL; + snd_async_handler_t *pcm_callback; uint period_time; uint buffer_time; @@ -64,7 +66,7 @@ protected: // entry point for our C++ified object state. :) static void ExternalCallback( snd_async_handler_t *pcm_callback ) { - AlsaMod *data = snd_async_handler_get_callback_private( pcm_callback ); + AlsaMod *data = (AlsaMod*)snd_async_handler_get_callback_private( pcm_callback ); jASSUME( data != NULL ); jASSUME( data->handle == snd_async_handler_get_pcm(pcm_callback) ); @@ -85,6 +87,10 @@ public: int pchannels = 2; snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE; + handle = NULL; + pcm_callback = NULL; + pspeed = SAMPLE_RATE; + // buffer time and period time are in microseconds... // (don't simplify the equation below -- it'll just cause integer rounding errors. period_time = (SndOutPacketSize*1000) / (SampleRate / 1000); @@ -191,13 +197,11 @@ public: handle = NULL; } - virtual void Configure(HWND parent) + virtual void Configure(uptr parent) { } - virtual bool Is51Out() const { return false; } - { - } + virtual bool Is51Out() const { return false; } s32 Test() const { diff --git a/plugins/spu2-x/src/Linux/Config.h b/plugins/spu2-x/src/Linux/Config.h index e49aa81205..ae3a159d8e 100644 --- a/plugins/spu2-x/src/Linux/Config.h +++ b/plugins/spu2-x/src/Linux/Config.h @@ -103,11 +103,11 @@ public: static void ReadSettings(); static void WriteSettings(); - //static void OpenDialog( HWND hWnd ); + static void OpenDialog( uptr hWnd ); protected: static void ClampValues(); - //static BOOL CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam); + //static bool CALLBACK DialogProc(uptr hWnd,u32 uMsg,WPARAM wParam,LPARAM lParam); }; diff --git a/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp b/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp new file mode 100644 index 0000000000..be18a39d28 --- /dev/null +++ b/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp @@ -0,0 +1,57 @@ +/* SPU2-X, A plugin for Emulating the Sound Processing Unit of the Playstation 2 + * Developed and maintained by the Pcsx2 Development Team. + * + * Original portions from SPU2ghz are (c) 2008 by David Quintana [gigaherz] + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the the License, or (at your + * option) any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with this library; if not, write to the Free Software Foundation, Inc., 59 + * Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "Dialogs.h" + +int SoundtouchCfg::SequenceLenMS = 63; +int SoundtouchCfg::SeekWindowMS = 16; +int SoundtouchCfg::OverlapMS = 7; + +void SoundtouchCfg::ClampValues() +{ + Clampify( SequenceLenMS, SequenceLen_Min, SequenceLen_Max ); + Clampify( SeekWindowMS, SeekWindow_Min, SeekWindow_Max ); + Clampify( OverlapMS, Overlap_Min, Overlap_Max ); +} + +void SoundtouchCfg::ReadSettings() +{ + //SequenceLenMS = CfgReadInt( L"SOUNDTOUCH", L"SequenceLengthMS", 63 ); + //SeekWindowMS = CfgReadInt( L"SOUNDTOUCH", L"SeekWindowMS", 16 ); + //OverlapMS = CfgReadInt( L"SOUNDTOUCH", L"OverlapMS", 7 ); + + ClampValues(); +} + +void SoundtouchCfg::WriteSettings() +{ + //CfgWriteInt( L"SOUNDTOUCH", L"SequenceLengthMS", SequenceLenMS ); + //CfgWriteInt( L"SOUNDTOUCH", L"SeekWindowMS", SeekWindowMS ); + //CfgWriteInt( L"SOUNDTOUCH", L"OverlapMS", OverlapMS ); +} + +/*bool CALLBACK SoundtouchCfg::DialogProc(uptr hWnd,u32 uMsg,uptr wParam,uptr lParam) +{ +}*/ + +void SoundtouchCfg::OpenDialog( uptr hWnd ) +{ +} diff --git a/plugins/spu2-x/src/Makefile.am b/plugins/spu2-x/src/Makefile.am index 56eaabf0a5..41449973a1 100644 --- a/plugins/spu2-x/src/Makefile.am +++ b/plugins/spu2-x/src/Makefile.am @@ -3,8 +3,8 @@ AUTOMAKE_OPTIONS = foreign noinst_LIBRARIES = libSPU2X.a INCLUDES = -I@srcdir@/../../../common/include -I@srcdir@/3rdparty -I@srcdir@/../../../3rdparty -I@srcdir@/Linux -libSPU2X_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0) -libSPU2X_a_CFLAGS = $(shell pkg-config --cflags gtk+-2.0) +libSPU2X_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0) -liconv +libSPU2X_a_CFLAGS = $(shell pkg-config --cflags gtk+-2.0) -liconv if X86_64 libSPU2X_a_CXXFLAGS += -fPIC @@ -33,6 +33,14 @@ Dma.cpp Lowpass.cpp RegLog.cpp Reverb.cpp SndOut.cpp Spu2replay.cpp Wavedump_w libSPU2X_a_SOURCES += BaseTypes.h Debug.h Dma.h Lowpass.h RegTable.h SndOut.h ConvertUTF.h \ Spu2.h Spu2replay.h defs.h regs.h spdif.h utf8.h -libSPU2X_a_SOURCES += Linux/Config.h Linux/Config.cpp Linux/ConfigSoundTouch.cpp Linux/Linux.h Linux/Alsa.cpp Linux/Alsa.h Linux/Dialogs.cpp Linux/Dialogs.h + +libSPU2X_a_SOURCES += Linux/Config.h Linux/Config.cpp Linux/Linux.h Linux/Alsa.cpp Linux/Alsa.h \ +Linux/Dialogs.cpp Linux/Dialogs.h Linux/ConfigSoundTouch.cpp + +libSPU2X_a_SOURCES += 3rdparty/liba52/bitstream.c 3rdparty/liba52/downmix.c 3rdparty/liba52/parse.c \ +3rdparty/liba52/bit_allocate.c 3rdparty/liba52/imdct.c \ +3rdparty/liba52/a52.h 3rdparty/liba52/attributes.h 3rdparty/liba52/config.h 3rdparty/liba52/inttypes.h \ +3rdparty/liba52/tendra.h 3rdparty/liba52/a52_internal.h 3rdparty/liba52/bitstream.h \ +3rdparty/liba52/mm_accel.h 3rdparty/liba52/tables.h #SUBDIRS = 3rdparty/SoundTouch diff --git a/plugins/spu2-x/src/configure.ac b/plugins/spu2-x/src/configure.ac index 25e31aff9a..eb2596fcef 100644 --- a/plugins/spu2-x/src/configure.ac +++ b/plugins/spu2-x/src/configure.ac @@ -98,6 +98,7 @@ AC_SUBST(SHARED_LDFLAGS) AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"]) AC_CHECK_LIB(dl,main,[LIBS="$LIBS -ldl"]) AC_CHECK_LIB(asound,main,[LIBS="$LIBS -lasound"]) +AC_CHECK_LIB(iconv,main,[LIBS="$LIBS -liconv"]) AC_CHECK_FUNCS(iconv, [ have_iconv="1" ], [ have_iconv="0" ]) AC_OUTPUT([