diff --git a/plugins/spu2-x/src/Linux/Alsa.h b/plugins/spu2-x/src/Linux/Alsa.h new file mode 100644 index 0000000000..62c00f3d46 --- /dev/null +++ b/plugins/spu2-x/src/Linux/Alsa.h @@ -0,0 +1,60 @@ +/* ZeroSPU2 + * Copyright (C) 2006-2007 zerofrog + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + // Modified by arcum42@gmail.com + + #ifndef __LINUX_H__ + #define __LINUX_H__ + +#include +#include + +#include +#include +#include +#include + +// Make it easier to check and set checkmarks in the gui +#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)))) +#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state) + +#define ALSA_PCM_NEW_HW_PARAMS_API +#define ALSA_PCM_NEW_SW_PARAMS_API + +#ifdef ALSA_MEM_DEF +#define ALSA_MEM_EXTERN +#else +#define ALSA_MEM_EXTERN extern +#endif + +#define SOUNDSIZE 500000 +#define SAMPLE_RATE 48000L +#define ERROR_LOG printf + +// Pull in from Alsa.cpp +extern int AlsaSetupSound(); +extern void AlsaRemoveSound(); +extern int AlsaSoundGetBytesBuffered(); +extern void AlsaSoundFeedVoiceData(unsigned char* pSound,long lBytes); + +extern int SetupSound(); +extern void RemoveSound(); +extern int SoundGetBytesBuffered(); +extern void SoundFeedVoiceData(unsigned char* pSound,long lBytes); + +#endif // __LINUX_H__ \ No newline at end of file diff --git a/plugins/spu2-x/src/Linux/Config.cpp b/plugins/spu2-x/src/Linux/Config.cpp index 4266b46dde..1be745c561 100644 --- a/plugins/spu2-x/src/Linux/Config.cpp +++ b/plugins/spu2-x/src/Linux/Config.cpp @@ -22,6 +22,36 @@ #include "Spu2.h" #include "Dialogs.h" +bool DebugEnabled=false; +bool _MsgToConsole=false; +bool _MsgKeyOnOff=false; +bool _MsgVoiceOff=false; +bool _MsgDMA=false; +bool _MsgAutoDMA=false; +bool _MsgOverruns=false; +bool _MsgCache=false; + +bool _AccessLog=false; +bool _DMALog=false; +bool _WaveLog=false; + +bool _CoresDump=false; +bool _MemDump=false; +bool _RegDump=false; + + + +wchar_t AccessLogFileName[255]; +wchar_t WaveLogFileName[255]; + +wchar_t DMA4LogFileName[255]; +wchar_t DMA7LogFileName[255]; + +wchar_t CoresDumpFileName[255]; +wchar_t MemDumpFileName[255]; +wchar_t RegDumpFileName[255]; + + #ifdef SPU2X_DEVBUILD static const int LATENCY_MAX = 3000; #else diff --git a/plugins/spu2-x/src/Linux/Config.h b/plugins/spu2-x/src/Linux/Config.h index eadd08eab3..e49aa81205 100644 --- a/plugins/spu2-x/src/Linux/Config.h +++ b/plugins/spu2-x/src/Linux/Config.h @@ -154,9 +154,9 @@ struct CONFIG_WAVEOUT } }; -extern CONFIG_DSOUNDOUT Config_DSoundOut; +/*extern CONFIG_DSOUNDOUT Config_DSoundOut; extern CONFIG_WAVEOUT Config_WaveOut; -extern CONFIG_XAUDIO2 Config_XAudio2; +extern CONFIG_XAUDIO2 Config_XAudio2;*/ ////// diff --git a/plugins/spu2-x/src/Linux/Dialogs.h b/plugins/spu2-x/src/Linux/Dialogs.h index 158511a3e9..13348bd283 100644 --- a/plugins/spu2-x/src/Linux/Dialogs.h +++ b/plugins/spu2-x/src/Linux/Dialogs.h @@ -22,6 +22,6 @@ #ifndef DIALOG_H_INCLUDED #define DIALOG_H_INCLUDED -#include "../spu2.h" +#include "../Spu2.h" #endif \ No newline at end of file diff --git a/plugins/spu2-x/src/Makefile.am b/plugins/spu2-x/src/Makefile.am index 38f4dfa30a..56eaabf0a5 100644 --- a/plugins/spu2-x/src/Makefile.am +++ b/plugins/spu2-x/src/Makefile.am @@ -1,7 +1,7 @@ # Create a shared library libSPU2X AUTOMAKE_OPTIONS = foreign noinst_LIBRARIES = libSPU2X.a -INCLUDES = -I@srcdir@/common -I@srcdir@/3rdparty -I@srcdir@/Linux +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) @@ -22,10 +22,10 @@ EXEEXT=$(preext)@so_ext@ traplib_PROGRAMS=libSPU2X libSPU2X_SOURCES= -libSPU2X_DEPENDENCIES = libSPU2X.a 3rdparty/SoundTouch/libSoundTouch.a +libSPU2X_DEPENDENCIES = libSPU2X.a libSoundTouch.a libSPU2X_LDFLAGS= @SHARED_LDFLAGS@ libSPU2X_LDFLAGS+=-Wl,-soname,@SPU2X_SONAME@ -libSPU2X_LDADD=$(llibSPU2X_a_OBJECTS) 3rdparty/SoundTouch/libSoundTouch.a +libSPU2X_LDADD=$(libSPU2X_a_OBJECTS) libSoundTouch.a libSPU2X_a_SOURCES = ADSR.cpp DllInterface.cpp Mixer.cpp RegTable.cpp SaveStateSPU.cpp ConvertUTF.cpp \ Spu2.cpp Timestretcher.cpp utf8.cpp Debug.cpp Decoder.cpp \ @@ -33,6 +33,6 @@ 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/Linux.h Linux/Alsa.cpp Linux/Alsa.h Linux/Dialogs.cpp Linux/Dialogs.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 -SUBDIRS = 3rdparty/SoundTouch +#SUBDIRS = 3rdparty/SoundTouch diff --git a/plugins/spu2-x/src/SndOut.cpp b/plugins/spu2-x/src/SndOut.cpp index 2c047736b4..5d6ebe7b5e 100644 --- a/plugins/spu2-x/src/SndOut.cpp +++ b/plugins/spu2-x/src/SndOut.cpp @@ -91,9 +91,11 @@ public: SndOutModule* mods[]= { &NullOut, +#ifdef _MSC_VER XAudio2Out, DSoundOut, WaveOut, +#endif NULL // signals the end of our list }; diff --git a/plugins/spu2-x/src/SndOut.h b/plugins/spu2-x/src/SndOut.h index c97851938d..b057f1bc3d 100644 --- a/plugins/spu2-x/src/SndOut.h +++ b/plugins/spu2-x/src/SndOut.h @@ -374,10 +374,12 @@ public: }; +#ifdef _MSC_VER //internal extern SndOutModule* WaveOut; extern SndOutModule* DSoundOut; extern SndOutModule* XAudio2Out; +#endif extern SndOutModule* mods[]; diff --git a/plugins/spu2-x/src/build.sh b/plugins/spu2-x/src/build.sh index 776d35b977..e53f769d7e 100644 --- a/plugins/spu2-x/src/build.sh +++ b/plugins/spu2-x/src/build.sh @@ -2,6 +2,21 @@ curdir=`pwd` +echo +echo SPU2-X is Windows only. Aborting. +if [ 1 == 0 ] +then +if [ $# -gt 0 ] && [ $1 = "all" ] +then + +cd ../../../3rdparty/SoundTouch/ +sh build.sh $@ +cd $curdir + +rm libSoundTouch.a +cp ../../../3rdparty/SoundTouch/libSoundTouch.a ./ + +echo echo ----------------- echo Building SPU2-X echo ----------------- @@ -10,13 +25,6 @@ if test "${SPU2XOPTIONS+set}" != set ; then export SPU2XOPTIONS="" fi -echo SPU2-X is Windows only. Aborting. - -if [ 1 == 0 ] -then -if [ $# -gt 0 ] && [ $1 = "all" ] -then - aclocal automake -a autoconf @@ -32,5 +40,5 @@ if [ $? -ne 0 ] then exit 1 fi -#cp libSPU2X*.so* ${PCSX2PLUGINS} fi +#cp libSPU2X*.so* ${PCSX2PLUGINS} diff --git a/plugins/spu2-x/src/configure.ac b/plugins/spu2-x/src/configure.ac index 691099af30..25e31aff9a 100644 --- a/plugins/spu2-x/src/configure.ac +++ b/plugins/spu2-x/src/configure.ac @@ -12,17 +12,11 @@ AC_PROG_RANLIB dnl necessary for compiling assembly AM_PROG_AS -SPU2X_CURRENT=0 -SPU2X_REVISION=1 -SPU2X_AGE=0 -SPU2X_SONAME=libSPU2X.so.[$SPU2X_CURRENT].[$SPU2X_REVISION].[$SPU2X_AGE] -SPU2X_RELEASE=[$SPU2X_CURRENT].[$SPU2X_REVISION].[$SPU2X_AGE] - -AC_SUBST(SPU2X_CURRENT) -AC_SUBST(SPU2X_REVISION) -AC_SUBST(SPU2X_AGE) -AC_SUBST(SPU2X_RELEASE) -AC_SUBST(SPU2X_SONAME) +AC_SUBST(SPU2X_CURRENT, 0) +AC_SUBST(SPU2X_REVISION, 1) +AC_SUBST(SPU2X_AGE, 0) +AC_SUBST(SPU2X_RELEASE,[$SPU2X_CURRENT].[$SPU2X_REVISION].[$SPU2X_AGE]) +AC_SUBST(SPU2X_SONAME,libSPU2X.so.[$SPU2X_CURRENT].[$SPU2X_REVISION].[$SPU2X_AGE]) CFLAGS= CPPFLAGS= @@ -66,9 +60,6 @@ dnl gtk AC_MSG_CHECKING(gtk2+) AC_CHECK_PROG(GTK_CONFIG, pkg-config, pkg-config) LIBS+=$(pkg-config --libs gtk+-2.0) - -dnl bindir = pcsx2exe - dnl Check for 64bit CPU AC_MSG_CHECKING(for a x86-64 CPU) dnl if test "$build_os" == "target_os" @@ -96,19 +87,20 @@ fi AC_MSG_RESULT($cpu64) AM_CONDITIONAL(X86_64, test x$cpu64 = xyes) +dnl bindir = pcsx2exe + dnl assuming linux environment so_ext=".so.$SPU2X_RELEASE" SHARED_LDFLAGS="-shared" AC_SUBST(so_ext) AC_SUBST(SHARED_LDFLAGS) -AC_CHECK_FUNCS(iconv, [ have_iconv="1" ], [ have_iconv="0" ]) 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_FUNCS(iconv, [ have_iconv="1" ], [ have_iconv="0" ]) AC_OUTPUT([ - 3rdparty/SoundTouch/Makefile Makefile ]) diff --git a/plugins/zerogs/opengl/targets.cpp b/plugins/zerogs/opengl/targets.cpp index 22284475a3..874ce4b8c7 100644 --- a/plugins/zerogs/opengl/targets.cpp +++ b/plugins/zerogs/opengl/targets.cpp @@ -333,9 +333,10 @@ void ZeroGS::CRenderTarget::Update(int context, ZeroGS::CRenderTarget* pdepth) cgGLEnableTextureParameter(ppsBaseTexture.sFinal); //assert( ittarg->second->fbw == fbw ); - int offset = (fbp-ittarg->second->fbp)*64/fbw; - if( psm & 2 ) // 16 bit - offset *= 2; + int offset = (fbp-ittarg->second->fbp)*64/fbw; + + // 16 bit + if (psm & 2) offset *= 2; v.x = (float)(fbw << s_AAx); v.y = (float)(fbh << s_AAy); @@ -667,7 +668,7 @@ void ZeroGS::CRenderTarget::ConvertTo16() SAFE_RELEASE_TEX(ptexFeedback); ptex = ptexConv; - free(psys); + _aligned_free(psys); psys = _aligned_malloc( (fbh<