Hack at spu2-x until it compiles in Linux, and is usable as a null plugin. (No, no sound yet, or configuration dialogs. It's a step in the right direction, though.)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2616 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-02-21 08:04:45 +00:00
parent d36fca730b
commit dcb76739c8
11 changed files with 237 additions and 46 deletions

View File

View File

View File

View File

@ -22,6 +22,7 @@
#include "Global.h"
#include "Dialogs.h"
#include "Config.h"
#include "SoundTouch/SoundTouch.h"
namespace SoundtouchCfg
{
@ -32,6 +33,13 @@ void ClampValues()
Clampify( OverlapMS, Overlap_Min, Overlap_Max );
}
void ApplySettings( soundtouch::SoundTouch& sndtouch )
{
sndtouch.setSetting( SETTING_SEQUENCE_MS, SequenceLenMS );
sndtouch.setSetting( SETTING_SEEKWINDOW_MS, SeekWindowMS );
sndtouch.setSetting( SETTING_OVERLAP_MS, OverlapMS );
}
void ReadSettings()
{
//SequenceLenMS = CfgReadInt( L"SOUNDTOUCH", L"SequenceLengthMS", 63 );

View File

@ -16,3 +16,59 @@
*/
// To be continued...
#include "Dialogs.h"
#include <gtk/gtk.h>
#include <cstring>
void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wstring& Data)
{
}
void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wstring& Data, int DataSize, const wchar_t* Default)
{
}
void __forceinline SysMessage(const char *fmt, ...)
{
va_list list;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
GtkWidget *dialog;
dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
"%s", msg);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
void SysMessage(wchar_t const*, ...)
{
}
void DspUpdate()
{
}
s32 DspLoadLibrary(wchar_t* fileName, int modnum)
{
return 0;
}
void AboutBox()
{
SysMessage("Yay: Aboutbox.");
}
void CfgSetSettingsDir(const char* dir)
{
}

View File

@ -18,7 +18,18 @@
#ifndef DIALOG_H_INCLUDED
#define DIALOG_H_INCLUDED
#include "../Config.h"
#include "../Global.h"
#include "../Config.h"
extern void CfgSetSettingsDir(const char* dir);
//extern void CfgWriteBool(const wchar_t* Section, const wchar_t* Name, bool Value);
//extern void CfgWriteInt(const wchar_t* Section, const wchar_t* Name, int Value);
extern void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wstring& Data);
//extern bool CfgReadBool(const wchar_t *Section,const wchar_t* Name, bool Default);
extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wstring& Data, int DataSize, const wchar_t* Default);
//extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wchar_t* Data, int DataSize, const wchar_t* Default);
//extern int CfgReadInt(const wchar_t* Section, const wchar_t* Name,int Default);
#endif

View File

@ -13,7 +13,6 @@
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
<Add option="`wx-config --version=2.8 --static=no --unicode=yes --debug=yes --cflags`" />
</Compiler>
<Linker>
<Add library="../../../../deps/debug/libsoundtouch-dbg.a" />
@ -26,7 +25,6 @@
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
<Add option="`wx-config --version=2.8 --static=no --unicode=yes --debug=no --cflags`" />
</Compiler>
<Linker>
<Add option="-s" />
@ -37,6 +35,7 @@
<Compiler>
<Add option="-Wall" />
<Add option="`wx-config --version=2.8 --static=no --unicode=yes --cflags`" />
<Add option="`pkg-config gtk+-2.0 --cflags`" />
<Add option="-fPIC" />
<Add option="-m32" />
<Add option="-liconv" />
@ -48,12 +47,15 @@
<Add directory="../../../../common/include" />
<Add directory="../../../../3rdparty/SoundTouch" />
<Add directory="../../../../3rdparty" />
<Add directory="../../../../common/src/x86emitter" />
</Compiler>
<Linker>
<Add option="`wx-config --version=2.8 --static=no --unicode=yes --libs`" />
<Add option="`pkg-config gtk+-2.0 --libs`" />
<Add option="-shared" />
<Add library="asound" />
<Add library="stdc++" />
<Add library="portaudio" />
</Linker>
<Unit filename="../3rdparty/liba52/a52.h" />
<Unit filename="../3rdparty/liba52/a52_internal.h" />
@ -81,14 +83,20 @@
<Unit filename="../3rdparty/liba52/tables.h" />
<Unit filename="../3rdparty/liba52/tendra.h" />
<Unit filename="../ADSR.cpp" />
<Unit filename="../Config.h" />
<Unit filename="../ConvertUTF.cpp" />
<Unit filename="../ConvertUTF.h" />
<Unit filename="../DPLII.h" />
<Unit filename="../Debug.cpp" />
<Unit filename="../Debug.h" />
<Unit filename="../DecodeDPLII.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Decoder.cpp" />
<Unit filename="../Dma.cpp" />
<Unit filename="../Dma.h" />
<Unit filename="../Global.h" />
<Unit filename="Alsa.cpp" />
<Unit filename="Alsa.h" />
<Unit filename="Config.cpp" />
@ -100,20 +108,90 @@
<Unit filename="../Lowpass.cpp" />
<Unit filename="../Lowpass.h" />
<Unit filename="../Mixer.cpp" />
<Unit filename="../Mixer.h" />
<Unit filename="../PS2E-spu2.cpp" />
<Unit filename="../PS2E-spu2.h" />
<Unit filename="../PrecompiledHeader.cpp" />
<Unit filename="../ReadInput.cpp" />
<Unit filename="../RegLog.cpp" />
<Unit filename="../RegTable.cpp" />
<Unit filename="../Reverb.cpp" />
<Unit filename="../SndOut.cpp" />
<Unit filename="../SndOut.h" />
<Unit filename="../SndOut_Portaudio.cpp" />
<Unit filename="../Spu2replay.cpp" />
<Unit filename="../Spu2replay.h" />
<Unit filename="../Timestretcher.cpp" />
<Unit filename="../Wavedump_wav.cpp" />
<Unit filename="../Windows/AboutBox.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/CfgHelpers.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/Config.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/ConfigDebug.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/ConfigSoundtouch.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/Dialogs.h" />
<Unit filename="../Windows/Dsound51.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/Hyperlinks.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/Hyperlinks.h" />
<Unit filename="../Windows/RealtimeDebugger.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/SndOut_DSound.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/SndOut_XAudio2.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/SndOut_waveOut.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/Spu2-X.def" />
<Unit filename="../Windows/Spu2-X.rc">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/Spu2-X_vs2008.vcproj" />
<Unit filename="../Windows/UIHelpers.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/WinConfig.h" />
<Unit filename="../Windows/dsp.cpp">
<Option compile="0" />
<Option link="0" />
</Unit>
<Unit filename="../Windows/dsp.h" />
<Unit filename="../Windows/resource.h" />
<Unit filename="../defs.h" />
<Unit filename="../iconvert.cpp" />
<Unit filename="../regs.h" />
<Unit filename="../spdif.h" />
<Unit filename="../spu2freeze.cpp" />
<Unit filename="../spu2sys.cpp" />
<Unit filename="../utf8.cpp" />
<Unit filename="../utf8.h" />
<Extensions>

View File

@ -17,10 +17,12 @@
#include "Global.h"
#include "PS2E-spu2.h"
#include "dma.h"
#include "Dma.h"
#include "Dialogs.h"
#ifndef __LINUX__
#include "x86emitter/tools.h"
#endif
#ifdef _MSC_VER
# include "svnrev.h"
@ -110,6 +112,8 @@ static bool cpu_detected = false;
static bool CheckSSE()
{
// I'll worry about checking sse2 in Linux later.
#ifndef __LINUX__
if( !cpu_detected )
{
cpudetectInit();
@ -121,6 +125,7 @@ static bool CheckSSE()
SysMessage( "Your CPU does not support SSE2 instructions.\nThe SPU2-X plugin requires SSE2 to run." );
return false;
}
#endif
return true;
}

View File

@ -22,6 +22,14 @@
#include "portaudio/include/portaudio.h"
#ifdef __LINUX__
int PaLinuxCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData );
#endif
class Portaudio : public SndOutModule
{
private:
@ -47,6 +55,7 @@ private:
bool started;
PaStream* stream;
#ifndef __LINUX__
static int PaCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
@ -55,8 +64,9 @@ private:
{
return PA.ActualPaCallback(inputBuffer,outputBuffer,framesPerBuffer,timeInfo,statusFlags,userData);
}
#endif
public:
int ActualPaCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
@ -75,7 +85,6 @@ private:
return 0;
}
public:
Portaudio()
{
m_ApiId=-1;
@ -114,7 +123,10 @@ public:
MultiByteToWideChar(CP_UTF8,0,info->name,strlen(info->name),buffer,999);
buffer[999]=0;
#else
# error TODO
//# error TODO
static wchar_t buffer [1000];
//MultiByteToWideChar(CP_UTF8,0,info->name,strlen(info->name),buffer,999);
buffer[999]=0;
#endif
if(m_Device == buffer)
@ -153,20 +165,30 @@ public:
paInt32,
0, //?
NULL
};
err = Pa_OpenStream(&stream,
NULL, &outParams, SampleRate,
SndOutPacketSize,
paNoFlag, PaCallback, NULL);
paNoFlag,
#ifndef __LINUX__
PaCallback,
#else
PaLinuxCallback,
#endif
NULL);
}
else
{
err = Pa_OpenDefaultStream( &stream,
0, 2, paInt32, 48000,
SndOutPacketSize,
PaCallback, NULL );
#ifndef __LINUX__
PaCallback,
#else
PaLinuxCallback,
#endif
NULL );
}
if( err != paNoError )
{
@ -302,4 +324,15 @@ public:
} static PA;
#ifdef __LINUX__
int PaLinuxCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData )
{
return PA.ActualPaCallback(inputBuffer,outputBuffer,framesPerBuffer,timeInfo,statusFlags,userData);
}
#endif
SndOutModule *PortaudioOut = &PA;

View File

@ -23,7 +23,7 @@
#include "Global.h"
#include "dma.h"
#include "Dma.h"
#include "PS2E-spu2.h" // needed until I figure out a nice solution for irqcallback dependencies.