diff --git a/audio/ext/Makefile b/audio/ext/Makefile new file mode 100644 index 0000000000..c02a491f4f --- /dev/null +++ b/audio/ext/Makefile @@ -0,0 +1,16 @@ +TARGET = ssnes_iir_filter.so +OBJ = ssnes_iir_filter.o + +all: $(TARGET) + +$(TARGET): $(OBJ) + $(CC) -o $@ -shared $(OBJ) + +%.o: %.c + $(CC) -c -o $@ $< -std=c99 -fPIC -O3 -march=native $(CFLAGS) + +clean: + rm -f $(TARGET) + rm -f $(OBJ) + +.PHONY: clean diff --git a/audio/ext/ssnes_iir_filter.c b/audio/ext/ssnes_iir_filter.c index e6c9c7d8b9..efcae2f84c 100644 --- a/audio/ext/ssnes_iir_filter.c +++ b/audio/ext/ssnes_iir_filter.c @@ -3,12 +3,14 @@ #include #include -// Simple IIR filter implementation. +// Simple IIR filter implementation, optimized for SSE3. -//#define USE_SSE3 +#ifdef __SSE3__ // Build with -march=native or -msse3 to let this be detected! D: +#define USE_SSE3 +#endif #ifdef USE_SSE3 -#include +#include #endif // Make a test build with standalone main() @@ -188,7 +190,8 @@ const ssnes_dsp_plugin_t dsp_plug = { .init = dsp_init, .process = dsp_process, .free = dsp_free, - .api_version = SSNES_API_VERSION + .api_version = SSNES_DSP_API_VERSION, + .ident = "IIR filter" }; SSNES_API_EXPORT const ssnes_dsp_plugin_t* diff --git a/ssnes.cfg b/ssnes.cfg index bf9f14902d..00ecc38521 100644 --- a/ssnes.cfg +++ b/ssnes.cfg @@ -260,6 +260,9 @@ # Reset the emulated SNES. # input_reset = h +# Configures DSP plugin +# input_dsp_config = c + # Pause gameplay when window focus is lost. # pause_nonactive = true