diff --git a/Makefile b/Makefile index 3121f2c2b7..a49f4997fd 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,8 @@ ifeq ($(BUILD_FILTER), 1) OBJ += hqflt/hq.o OBJ += hqflt/grayscale.o OBJ += hqflt/bleed.o + OBJ += hqflt/ntsc.o + OBJ += hqflt/snes_ntsc/snes_ntsc.o endif CFLAGS = -Wall -O3 -march=native -std=gnu99 @@ -56,6 +58,7 @@ uninstall: $(TARGET) clean: rm -f *.o rm -f hqflt/*.o + rm -f hqflt/snes_ntsc/*.o rm -f $(TARGET) .PHONY: all install uninstall clean diff --git a/config.h b/config.h index 93a86a7739..b83ed96a0b 100644 --- a/config.h +++ b/config.h @@ -41,7 +41,7 @@ // Chooses which video and audio subsystem to use. Remember to update config.mk if you change these. #define VIDEO_DRIVER VIDEO_GL -#define AUDIO_DRIVER AUDIO_RSOUND +#define AUDIO_DRIVER AUDIO_AL //////////////// @@ -54,8 +54,8 @@ static const float yscale = 4.0; // Real y res = 224 * yscale // Fullscreen static bool fullscreen = false; // To start in Fullscreen or not -static const unsigned fullscreen_x = 1280; -static const unsigned fullscreen_y = 720; +static const unsigned fullscreen_x = 1920; +static const unsigned fullscreen_y = 1200; // Video VSYNC (recommended) static const bool vsync = true; @@ -72,10 +72,11 @@ static const bool force_aspect = true; #define FILTER_HQ4X 2 #define FILTER_GRAYSCALE 3 #define FILTER_BLEED 4 +#define FILTER_NTSC 5 //////////////////////// // If you change this to something other than FILTER_NONE, make sure that you build the filter module in config.mk. -#define VIDEO_FILTER FILTER_NONE +#define VIDEO_FILTER FILTER_NTSC //////////////// @@ -86,17 +87,17 @@ static const bool force_aspect = true; static const bool audio_enable = true; // Output samplerate -static const unsigned out_rate = 48000; +static const unsigned out_rate = 44100; // Input samplerate from libSNES. // Lower this (slightly) if you are experiencing frequent audio dropouts and vsync is enabled. static const unsigned in_rate = 31930; // Audio device (e.g. hw:0,0 or /dev/audio). If NULL, will use defaults. -static const char* audio_device = "10.0.0.99"; +static const char* audio_device = NULL; // Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. -static const int out_latency = 64; +static const int out_latency = 32; // Will sync audio. (recommended) static const bool audio_sync = true; diff --git a/config.mk b/config.mk index 2a918017d7..c19020cae7 100644 --- a/config.mk +++ b/config.mk @@ -1,12 +1,12 @@ BUILD_OPENGL = 1 -BUILD_FILTER = 0 +BUILD_FILTER = 1 -BUILD_RSOUND = 1 +BUILD_RSOUND = 0 BUILD_OSS = 0 -BUILD_ALSA = 1 +BUILD_ALSA = 0 BUILD_ROAR = 0 -BUILD_AL = 0 +BUILD_AL = 1 PREFIX = /usr diff --git a/ssnes.c b/ssnes.c index 5c8bb16135..fc9bc53b98 100644 --- a/ssnes.c +++ b/ssnes.c @@ -28,6 +28,7 @@ #include "hqflt/pastlib.h" #include "hqflt/grayscale.h" #include "hqflt/bleed.h" +#include "hqflt/ntsc.h" static bool video_active = true; static bool audio_active = true; @@ -162,6 +163,8 @@ static void init_video_input(void) scale = 4; #elif VIDEO_FILTER == FILTER_HQ4X scale = 8; +#elif VIDEO_FILTER == FILTER_NTSC + scale = 8; #elif VIDEO_FILTER == FILTER_GRAYSCALE scale = 2; #elif VIDEO_FILTER == FILTER_BLEED @@ -230,6 +233,8 @@ static void video_frame(const uint16_t *data, unsigned width, unsigned height) uint16_t outputHQ2x[width * height * 2 * 2]; #elif VIDEO_FILTER == FILTER_HQ4X uint16_t outputHQ4x[width * height * 4 * 4]; +#elif VIDEO_FILTER == FILTER_NTSC + uint16_t output_ntsc[SNES_NTSC_OUT_WIDTH(width) * height]; #endif uint16_t output[width * height]; @@ -254,6 +259,10 @@ static void video_frame(const uint16_t *data, unsigned width, unsigned height) bleed_filter(output, width, height); if ( !driver.video->frame(driver.video_data, output, width, height) ) video_active = false; +#elif VIDEO_FILTER == FILTER_NTSC + ntsc_filter(output_ntsc, output, width, height); + if ( !driver.video->frame(driver.video_data, output_ntsc, SNES_NTSC_OUT_WIDTH(width), height) ) + video_active = false; #else if ( !driver.video->frame(driver.video_data, output, width, height) ) video_active = false;