mirror of https://github.com/PCSX2/pcsx2.git
Fix a segfault issue in ConvertTo16 on ZeroGS, and make a few changes in spu2-x for later use.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@631 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
b66db6ffd3
commit
0fb4e4ea07
|
@ -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 <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/soundcard.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
// 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__
|
|
@ -22,6 +22,36 @@
|
||||||
#include "Spu2.h"
|
#include "Spu2.h"
|
||||||
#include "Dialogs.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
|
#ifdef SPU2X_DEVBUILD
|
||||||
static const int LATENCY_MAX = 3000;
|
static const int LATENCY_MAX = 3000;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -154,9 +154,9 @@ struct CONFIG_WAVEOUT
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CONFIG_DSOUNDOUT Config_DSoundOut;
|
/*extern CONFIG_DSOUNDOUT Config_DSoundOut;
|
||||||
extern CONFIG_WAVEOUT Config_WaveOut;
|
extern CONFIG_WAVEOUT Config_WaveOut;
|
||||||
extern CONFIG_XAUDIO2 Config_XAudio2;
|
extern CONFIG_XAUDIO2 Config_XAudio2;*/
|
||||||
|
|
||||||
//////
|
//////
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,6 @@
|
||||||
#ifndef DIALOG_H_INCLUDED
|
#ifndef DIALOG_H_INCLUDED
|
||||||
#define DIALOG_H_INCLUDED
|
#define DIALOG_H_INCLUDED
|
||||||
|
|
||||||
#include "../spu2.h"
|
#include "../Spu2.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -1,7 +1,7 @@
|
||||||
# Create a shared library libSPU2X
|
# Create a shared library libSPU2X
|
||||||
AUTOMAKE_OPTIONS = foreign
|
AUTOMAKE_OPTIONS = foreign
|
||||||
noinst_LIBRARIES = libSPU2X.a
|
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_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0)
|
||||||
libSPU2X_a_CFLAGS = $(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
|
traplib_PROGRAMS=libSPU2X
|
||||||
libSPU2X_SOURCES=
|
libSPU2X_SOURCES=
|
||||||
libSPU2X_DEPENDENCIES = libSPU2X.a 3rdparty/SoundTouch/libSoundTouch.a
|
libSPU2X_DEPENDENCIES = libSPU2X.a libSoundTouch.a
|
||||||
libSPU2X_LDFLAGS= @SHARED_LDFLAGS@
|
libSPU2X_LDFLAGS= @SHARED_LDFLAGS@
|
||||||
libSPU2X_LDFLAGS+=-Wl,-soname,@SPU2X_SONAME@
|
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 \
|
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 \
|
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 \
|
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
|
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
|
||||||
|
|
|
@ -91,9 +91,11 @@ public:
|
||||||
SndOutModule* mods[]=
|
SndOutModule* mods[]=
|
||||||
{
|
{
|
||||||
&NullOut,
|
&NullOut,
|
||||||
|
#ifdef _MSC_VER
|
||||||
XAudio2Out,
|
XAudio2Out,
|
||||||
DSoundOut,
|
DSoundOut,
|
||||||
WaveOut,
|
WaveOut,
|
||||||
|
#endif
|
||||||
NULL // signals the end of our list
|
NULL // signals the end of our list
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -374,10 +374,12 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
//internal
|
//internal
|
||||||
extern SndOutModule* WaveOut;
|
extern SndOutModule* WaveOut;
|
||||||
extern SndOutModule* DSoundOut;
|
extern SndOutModule* DSoundOut;
|
||||||
extern SndOutModule* XAudio2Out;
|
extern SndOutModule* XAudio2Out;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern SndOutModule* mods[];
|
extern SndOutModule* mods[];
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,21 @@
|
||||||
|
|
||||||
curdir=`pwd`
|
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 -----------------
|
||||||
echo Building SPU2-X
|
echo Building SPU2-X
|
||||||
echo -----------------
|
echo -----------------
|
||||||
|
@ -10,13 +25,6 @@ if test "${SPU2XOPTIONS+set}" != set ; then
|
||||||
export SPU2XOPTIONS=""
|
export SPU2XOPTIONS=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo SPU2-X is Windows only. Aborting.
|
|
||||||
|
|
||||||
if [ 1 == 0 ]
|
|
||||||
then
|
|
||||||
if [ $# -gt 0 ] && [ $1 = "all" ]
|
|
||||||
then
|
|
||||||
|
|
||||||
aclocal
|
aclocal
|
||||||
automake -a
|
automake -a
|
||||||
autoconf
|
autoconf
|
||||||
|
@ -32,5 +40,5 @@ if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
#cp libSPU2X*.so* ${PCSX2PLUGINS}
|
|
||||||
fi
|
fi
|
||||||
|
#cp libSPU2X*.so* ${PCSX2PLUGINS}
|
||||||
|
|
|
@ -12,17 +12,11 @@ AC_PROG_RANLIB
|
||||||
dnl necessary for compiling assembly
|
dnl necessary for compiling assembly
|
||||||
AM_PROG_AS
|
AM_PROG_AS
|
||||||
|
|
||||||
SPU2X_CURRENT=0
|
AC_SUBST(SPU2X_CURRENT, 0)
|
||||||
SPU2X_REVISION=1
|
AC_SUBST(SPU2X_REVISION, 1)
|
||||||
SPU2X_AGE=0
|
AC_SUBST(SPU2X_AGE, 0)
|
||||||
SPU2X_SONAME=libSPU2X.so.[$SPU2X_CURRENT].[$SPU2X_REVISION].[$SPU2X_AGE]
|
AC_SUBST(SPU2X_RELEASE,[$SPU2X_CURRENT].[$SPU2X_REVISION].[$SPU2X_AGE])
|
||||||
SPU2X_RELEASE=[$SPU2X_CURRENT].[$SPU2X_REVISION].[$SPU2X_AGE]
|
AC_SUBST(SPU2X_SONAME,libSPU2X.so.[$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)
|
|
||||||
|
|
||||||
CFLAGS=
|
CFLAGS=
|
||||||
CPPFLAGS=
|
CPPFLAGS=
|
||||||
|
@ -66,9 +60,6 @@ dnl gtk
|
||||||
AC_MSG_CHECKING(gtk2+)
|
AC_MSG_CHECKING(gtk2+)
|
||||||
AC_CHECK_PROG(GTK_CONFIG, pkg-config, pkg-config)
|
AC_CHECK_PROG(GTK_CONFIG, pkg-config, pkg-config)
|
||||||
LIBS+=$(pkg-config --libs gtk+-2.0)
|
LIBS+=$(pkg-config --libs gtk+-2.0)
|
||||||
|
|
||||||
dnl bindir = pcsx2exe
|
|
||||||
|
|
||||||
dnl Check for 64bit CPU
|
dnl Check for 64bit CPU
|
||||||
AC_MSG_CHECKING(for a x86-64 CPU)
|
AC_MSG_CHECKING(for a x86-64 CPU)
|
||||||
dnl if test "$build_os" == "target_os"
|
dnl if test "$build_os" == "target_os"
|
||||||
|
@ -96,19 +87,20 @@ fi
|
||||||
AC_MSG_RESULT($cpu64)
|
AC_MSG_RESULT($cpu64)
|
||||||
AM_CONDITIONAL(X86_64, test x$cpu64 = xyes)
|
AM_CONDITIONAL(X86_64, test x$cpu64 = xyes)
|
||||||
|
|
||||||
|
dnl bindir = pcsx2exe
|
||||||
|
|
||||||
dnl assuming linux environment
|
dnl assuming linux environment
|
||||||
so_ext=".so.$SPU2X_RELEASE"
|
so_ext=".so.$SPU2X_RELEASE"
|
||||||
SHARED_LDFLAGS="-shared"
|
SHARED_LDFLAGS="-shared"
|
||||||
AC_SUBST(so_ext)
|
AC_SUBST(so_ext)
|
||||||
AC_SUBST(SHARED_LDFLAGS)
|
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(stdc++,main,[LIBS="$LIBS -lstdc++"])
|
||||||
AC_CHECK_LIB(dl,main,[LIBS="$LIBS -ldl"])
|
AC_CHECK_LIB(dl,main,[LIBS="$LIBS -ldl"])
|
||||||
AC_CHECK_LIB(asound,main,[LIBS="$LIBS -lasound"])
|
AC_CHECK_LIB(asound,main,[LIBS="$LIBS -lasound"])
|
||||||
|
AC_CHECK_FUNCS(iconv, [ have_iconv="1" ], [ have_iconv="0" ])
|
||||||
|
|
||||||
AC_OUTPUT([
|
AC_OUTPUT([
|
||||||
3rdparty/SoundTouch/Makefile
|
|
||||||
Makefile
|
Makefile
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
|
@ -333,9 +333,10 @@ void ZeroGS::CRenderTarget::Update(int context, ZeroGS::CRenderTarget* pdepth)
|
||||||
cgGLEnableTextureParameter(ppsBaseTexture.sFinal);
|
cgGLEnableTextureParameter(ppsBaseTexture.sFinal);
|
||||||
|
|
||||||
//assert( ittarg->second->fbw == fbw );
|
//assert( ittarg->second->fbw == fbw );
|
||||||
int offset = (fbp-ittarg->second->fbp)*64/fbw;
|
int offset = (fbp-ittarg->second->fbp)*64/fbw;
|
||||||
if( psm & 2 ) // 16 bit
|
|
||||||
offset *= 2;
|
// 16 bit
|
||||||
|
if (psm & 2) offset *= 2;
|
||||||
|
|
||||||
v.x = (float)(fbw << s_AAx);
|
v.x = (float)(fbw << s_AAx);
|
||||||
v.y = (float)(fbh << s_AAy);
|
v.y = (float)(fbh << s_AAy);
|
||||||
|
@ -667,7 +668,7 @@ void ZeroGS::CRenderTarget::ConvertTo16()
|
||||||
SAFE_RELEASE_TEX(ptexFeedback);
|
SAFE_RELEASE_TEX(ptexFeedback);
|
||||||
ptex = ptexConv;
|
ptex = ptexConv;
|
||||||
|
|
||||||
free(psys);
|
_aligned_free(psys);
|
||||||
psys = _aligned_malloc( (fbh<<s_AAy) * (fbw<<s_AAx) * (GetRenderFormat() == RFT_float16 ? 8 : 4), 16 );
|
psys = _aligned_malloc( (fbh<<s_AAy) * (fbw<<s_AAx) * (GetRenderFormat() == RFT_float16 ? 8 : 4), 16 );
|
||||||
|
|
||||||
if( conf.options & GSOPTION_WIREFRAME ) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
if( conf.options & GSOPTION_WIREFRAME ) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||||
|
|
Loading…
Reference in New Issue