diff --git a/plugins/spu2-x/src/CMakeLists.txt b/plugins/spu2-x/src/CMakeLists.txt index 1f87419db8..c32b032ff0 100644 --- a/plugins/spu2-x/src/CMakeLists.txt +++ b/plugins/spu2-x/src/CMakeLists.txt @@ -41,7 +41,6 @@ endif(CMAKE_BUILD_TYPE STREQUAL Release) set(spu2xSources ADSR.cpp Debug.cpp - Decoder.cpp Dma.cpp iconvert.cpp Lowpass.cpp @@ -124,9 +123,6 @@ target_link_libraries(${Output} ${PORTAUDIO_LIBRARIES}) # link target with SoundTouch target_link_libraries(${Output} ${SOUNDTOUCH_LIBRARIES}) -# link target with A52 -target_link_libraries(${Output} ${A52_LIBRARIES}) - # User flags options if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") diff --git a/plugins/spu2-x/src/Decoder.cpp b/plugins/spu2-x/src/Decoder.cpp deleted file mode 100644 index 59024789a9..0000000000 --- a/plugins/spu2-x/src/Decoder.cpp +++ /dev/null @@ -1,404 +0,0 @@ -//GiGaHeRz's SPU2 Driver -//Copyright (c) 2003-2008, David Quintana -// -//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 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -// - -#include "Global.h" - -// Commenting this will disable all the code in Decoder.cpp (which is the only code that uses liba52 in spu2-x.) -#ifndef ENABLE_DECODER -# define ENABLE_DECODER 1 -#endif - -#if ENABLE_DECODER - -extern "C" { -#ifdef _MSC_VER -# include "liba52/inttypes.h" -# include "liba52/a52.h" -# include "liba52/mm_accel.h" -#else -# include -# include "a52dec/a52.h" -# include "a52dec/mm_accel.h" -#endif -} - -extern u32 spdif_read_data(u8 *buff, u32 max_data); - -#define DATA_SIZE 0x100000 - -u32 use51=0; - -u8 databuffer[DATA_SIZE]; -u32 data_in_buffer; - -s32 output_buffer[0x10000][6]; -s32 output_write_cursor=0; -s32 output_read_cursor=0; -s32 output_buffer_data=0; - -int flags,srate,bitrate; - -#define CHANNEL_CENTER 1 -#define CHANNEL_STEREO 2 -#define CHANNEL_SURROUND 4 -#define CHANNEL_LFE 8 - -int sample_flags = 0; - -u32 frame_size; - -a52_state_t* ac3dec; -sample_t *decode_buffer = NULL; - -s32 data_rate=4; - -int state=0; - -FILE *fSpdifDump; - -union spdif_frame { // total size: 32bits - struct { - u32 preamble:4; //4 - u32 databits:24; //28 - u32 valid:1; //29 - u32 subcode:1; //30 - u32 chanstat:1; //31 - u32 parity:1; //32 // parity not including preamble - } bits; - u32 whole; -}; - -union spdif_block { - spdif_frame frames[192]; - u8 bytes [192*4]; -}; - -/* -spdif_block bbuffer[2]; -u8 *bbuff = bbuffer[0].bytes; -u32 bbuff_bytes = 0; -*/ - -bool check_frame(spdif_frame f) -{ - u32 w = f.whole>>4; - u32 t = 0; - - for(int i=0;i>28;i++) - { - t=t^(w&1); - w>>=1; - } - - return (t==0)&&(f.bits.valid); -} - -void spdif_Write(s32 data) -{ - spdif_frame f; - - f.whole=data; - - if(check_frame(f)) - { - int dec = f.bits.databits; - databuffer[data_in_buffer++]=(dec )&0xFF; - databuffer[data_in_buffer++]=(dec>> 8)&0xFF; - databuffer[data_in_buffer++]=(dec>>16)&0xFF; - } -} - -void spdif_remove_data(unsigned int bytes) -{ - if(bytes0)*-1; //1 if positive, -1 if negative, 0 otherwise - n=abs(n)+1; //make it [1..2] - s32 k=*(s32*)&n; - k=k&0x7FFFFF; - return k*sign; -} - -void spdif_update() -{ - - - for(int i=0;i - -extern void spdif_update(); - void ADMAOutLogWrite(void *lpData, u32 ulSize); static const s32 tbl_XA_Factor[5][2] = @@ -786,10 +782,6 @@ __forceinline void Mix() Out = clamp_mix( Out, SndOutVolumeShift ); } - // Update spdif (called each sample) - if(PlayMode&4) - spdif_update(); - SndBuffer::Write( Out ); // Update AutoDMA output positioning diff --git a/plugins/spu2-x/src/PS2E-spu2.cpp b/plugins/spu2-x/src/PS2E-spu2.cpp index e0998592ee..6449bf72ab 100644 --- a/plugins/spu2-x/src/PS2E-spu2.cpp +++ b/plugins/spu2-x/src/PS2E-spu2.cpp @@ -434,7 +434,7 @@ EXPORT_C_(s32) SPU2open(void *pDsp) try { SndBuffer::Init(); - spdif_init(); + #ifndef __LINUX__ DspLoadLibrary(dspPlugin,dspPluginModule); #endif @@ -460,7 +460,6 @@ EXPORT_C_(void) SPU2close() DspCloseLibrary(); #endif - spdif_shutdown(); SndBuffer::Cleanup(); } diff --git a/plugins/spu2-x/src/SndOut.cpp b/plugins/spu2-x/src/SndOut.cpp index 7c8e9cd6b0..0eef712446 100644 --- a/plugins/spu2-x/src/SndOut.cpp +++ b/plugins/spu2-x/src/SndOut.cpp @@ -284,9 +284,6 @@ void SndBuffer::Init() soundtouchInit(); // initializes the timestretching - // some crap - spdif_set51(mods[OutputModule]->Is51Out()); - // initialize module if( mods[OutputModule]->Init() == -1 ) _InitFail(); } diff --git a/plugins/spu2-x/src/Windows/Spu2-X.vcxproj b/plugins/spu2-x/src/Windows/Spu2-X.vcxproj index dc3daf5760..6b7b765b30 100644 --- a/plugins/spu2-x/src/Windows/Spu2-X.vcxproj +++ b/plugins/spu2-x/src/Windows/Spu2-X.vcxproj @@ -376,7 +376,6 @@ true - diff --git a/plugins/spu2-x/src/Windows/Spu2-X_vs2008.vcproj b/plugins/spu2-x/src/Windows/Spu2-X_vs2008.vcproj index 147f07471e..6847507b4a 100644 --- a/plugins/spu2-x/src/Windows/Spu2-X_vs2008.vcproj +++ b/plugins/spu2-x/src/Windows/Spu2-X_vs2008.vcproj @@ -668,10 +668,6 @@ - - diff --git a/plugins/spu2-x/src/defs.h b/plugins/spu2-x/src/defs.h index 3a7aaf13b6..fb2bdecd17 100644 --- a/plugins/spu2-x/src/defs.h +++ b/plugins/spu2-x/src/defs.h @@ -534,11 +534,6 @@ extern void StartVoices(int core, u32 value); extern void StopVoices(int core, u32 value); extern void InitADSR(); extern void CalculateADSR( V_Voice& vc ); - -extern void spdif_set51(u32 is_5_1_out); -extern u32 spdif_init(); -extern void spdif_shutdown(); -extern void spdif_get_samples(s32 *samples); // fills the buffer with [l,r,c,lfe,sl,sr] if using 5.1 output, or [l,r] if using stereo extern void UpdateSpdifMode(); namespace Savestate