mirror of
https://github.com/libretro/RetroArch
synced 2025-03-18 04:21:19 +00:00
blah
This commit is contained in:
parent
3835100101
commit
ed9e0d746a
4
Makefile
4
Makefile
@ -4,7 +4,7 @@ TARGET = ssnes
|
|||||||
|
|
||||||
DEFINES =
|
DEFINES =
|
||||||
OBJ = ssnes.o
|
OBJ = ssnes.o
|
||||||
libsnes = -lsnes
|
libsnes = libsnes.a
|
||||||
|
|
||||||
LIBS = -lsamplerate $(libsnes)
|
LIBS = -lsamplerate $(libsnes)
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ ifeq ($(BUILD_FILTER), 1)
|
|||||||
OBJ += hqflt/snes_ntsc/snes_ntsc.o
|
OBJ += hqflt/snes_ntsc/snes_ntsc.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS = -Wall -O3 -march=native -std=gnu99 -Wno-unused-variable -I. $(DEFINES)
|
CFLAGS = -Wall -O3 -std=gnu99 -Wno-unused-variable -I. $(DEFINES) -fprofile-use
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
|
12
config.h
12
config.h
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
// Chooses which video and audio subsystem to use. Remember to update config.mk if you change these.
|
// Chooses which video and audio subsystem to use. Remember to update config.mk if you change these.
|
||||||
#define VIDEO_DRIVER VIDEO_GL
|
#define VIDEO_DRIVER VIDEO_GL
|
||||||
#define AUDIO_DRIVER AUDIO_ALSA
|
#define AUDIO_DRIVER AUDIO_RSOUND
|
||||||
|
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
@ -54,14 +54,14 @@ static const float yscale = 3.0; // Real y res = 224 * yscale
|
|||||||
|
|
||||||
// Fullscreen
|
// Fullscreen
|
||||||
static bool fullscreen = false; // To start in Fullscreen or not
|
static bool fullscreen = false; // To start in Fullscreen or not
|
||||||
static const unsigned fullscreen_x = 1280;
|
static const unsigned fullscreen_x = 1920;
|
||||||
static const unsigned fullscreen_y = 720;
|
static const unsigned fullscreen_y = 1200;
|
||||||
|
|
||||||
// Video VSYNC (recommended)
|
// Video VSYNC (recommended)
|
||||||
static const bool vsync = true;
|
static const bool vsync = true;
|
||||||
|
|
||||||
// Smooths picture
|
// Smooths picture
|
||||||
static const bool video_smooth = true;
|
static const bool video_smooth = false;
|
||||||
|
|
||||||
// Path to custom Cg shader. If using custom shaders, it is recommended to disable video_smooth.
|
// Path to custom Cg shader. If using custom shaders, it is recommended to disable video_smooth.
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
@ -93,7 +93,7 @@ static const bool force_aspect = true;
|
|||||||
static const bool audio_enable = true;
|
static const bool audio_enable = true;
|
||||||
|
|
||||||
// Output samplerate
|
// Output samplerate
|
||||||
static const unsigned out_rate = 48000;
|
static const unsigned out_rate = 96000;
|
||||||
|
|
||||||
// Input samplerate from libSNES.
|
// Input samplerate from libSNES.
|
||||||
// Lower this (slightly) if you are experiencing frequent audio dropouts while vsync is enabled.
|
// Lower this (slightly) if you are experiencing frequent audio dropouts while vsync is enabled.
|
||||||
@ -103,7 +103,7 @@ static const unsigned in_rate = 31950;
|
|||||||
static const char* audio_device = NULL;
|
static const char* audio_device = NULL;
|
||||||
|
|
||||||
// Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency.
|
// 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)
|
// Will sync audio. (recommended)
|
||||||
static const bool audio_sync = true;
|
static const bool audio_sync = true;
|
||||||
|
@ -3,9 +3,9 @@ BUILD_OPENGL = 1
|
|||||||
BUILD_CG = 1
|
BUILD_CG = 1
|
||||||
BUILD_FILTER = 0
|
BUILD_FILTER = 0
|
||||||
|
|
||||||
BUILD_RSOUND = 0
|
BUILD_RSOUND = 1
|
||||||
BUILD_OSS = 0
|
BUILD_OSS = 0
|
||||||
BUILD_ALSA = 1
|
BUILD_ALSA = 0
|
||||||
BUILD_ROAR = 0
|
BUILD_ROAR = 0
|
||||||
BUILD_AL = 0
|
BUILD_AL = 0
|
||||||
|
|
||||||
|
@ -1,21 +1,62 @@
|
|||||||
|
|
||||||
/* Default Vertex shader */
|
struct input
|
||||||
void main_vertex
|
{
|
||||||
|
float2 video_size;
|
||||||
|
float2 texture_size;
|
||||||
|
float2 output_size;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct VERTEX_OUTPUT
|
||||||
|
{
|
||||||
|
float4 position : POSITION;
|
||||||
|
float4 color : COLOR;
|
||||||
|
float2 texCoord : TEXCOORD0;
|
||||||
|
float4 t1 : TEXCOORD1;
|
||||||
|
float4 t2 : TEXCOORD2;
|
||||||
|
float4 t3 : TEXCOORD3;
|
||||||
|
float4 t4 : TEXCOORD4;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct VERTEX_INPUT
|
||||||
|
{
|
||||||
|
float4 position : POSITION;
|
||||||
|
float4 color : COLOR;
|
||||||
|
float2 CT : TEXCOORD0;
|
||||||
|
float4 t1 : TEXCOORD1;
|
||||||
|
float4 t2 : TEXCOORD2;
|
||||||
|
float4 t3 : TEXCOORD3;
|
||||||
|
float4 t4 : TEXCOORD4;
|
||||||
|
};
|
||||||
|
|
||||||
|
VERTEX_OUTPUT main_vertex
|
||||||
(
|
(
|
||||||
float4 position : POSITION,
|
float4 position : POSITION,
|
||||||
float4 color : COLOR,
|
float4 color : COLOR,
|
||||||
float2 texCoord : TEXCOORD0,
|
float2 texCoord : TEXCOORD0,
|
||||||
|
|
||||||
uniform float4x4 modelViewProj,
|
uniform float4x4 modelViewProj,
|
||||||
|
uniform input IN
|
||||||
out float4 oPosition : POSITION,
|
|
||||||
out float4 oColor : COLOR,
|
|
||||||
out float2 otexCoord : TEXCOORD
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
oPosition = mul(modelViewProj, position);
|
VERTEX_OUTPUT OUT;
|
||||||
oColor = color;
|
OUT.position = mul(modelViewProj, position);
|
||||||
otexCoord = texCoord;
|
OUT.color = color;
|
||||||
|
OUT.texCoord = texCoord;
|
||||||
|
|
||||||
|
float2 ps = float2(1.0/IN.texture_size.x, 1.0/IN.texture_size.y);
|
||||||
|
float dx = ps.x;
|
||||||
|
float dy = ps.y;
|
||||||
|
|
||||||
|
OUT.texCoord = texCoord;
|
||||||
|
OUT.t1.xy = texCoord + float2(-dx, 0);
|
||||||
|
OUT.t2.xy = texCoord + float2( dx, 0);
|
||||||
|
OUT.t3.xy = texCoord + float2( 2 * dx, 0);
|
||||||
|
OUT.t4.xy = texCoord + float2( 0, dy);
|
||||||
|
OUT.t1.zw = texCoord + float2(-dx,-dy);
|
||||||
|
OUT.t2.zw = texCoord + float2(-dx, dy);
|
||||||
|
OUT.t3.zw = texCoord + float2( 2 * dx, dy);
|
||||||
|
OUT.t4.zw = texCoord + float2( dx, dy);
|
||||||
|
return OUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TEX2D(c) tex2D(decal,(c))
|
#define TEX2D(c) tex2D(decal,(c))
|
||||||
@ -29,12 +70,6 @@ struct output
|
|||||||
float4 color : COLOR;
|
float4 color : COLOR;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct input
|
|
||||||
{
|
|
||||||
float2 video_size;
|
|
||||||
float2 texture_size;
|
|
||||||
float2 output_size;
|
|
||||||
};
|
|
||||||
|
|
||||||
float2 barrelDistortion(float2 coord)
|
float2 barrelDistortion(float2 coord)
|
||||||
{
|
{
|
||||||
@ -43,7 +78,7 @@ float2 barrelDistortion(float2 coord)
|
|||||||
return coord + cc * (dist + distortion * dist * dist) * distortion;
|
return coord + cc * (dist + distortion * dist * dist) * distortion;
|
||||||
}
|
}
|
||||||
|
|
||||||
output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXUNIT0, uniform input IN)
|
output main_fragment(in VERTEX_INPUT VAR, uniform sampler2D decal : TEXUNIT0, uniform input IN)
|
||||||
{
|
{
|
||||||
output OUT;
|
output OUT;
|
||||||
|
|
||||||
@ -51,10 +86,11 @@ output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXU
|
|||||||
float2 rubyOutputSize = IN.output_size;
|
float2 rubyOutputSize = IN.output_size;
|
||||||
float2 rubyTextureSize = IN.texture_size;
|
float2 rubyTextureSize = IN.texture_size;
|
||||||
|
|
||||||
float2 xy = barrelDistortion(texCoord.xy);
|
//float2 xy = barrelDistortion(texCoord.xy);
|
||||||
float2 one = 1.0/rubyTextureSize;
|
//float2 one = 1.0/rubyTextureSize;
|
||||||
xy = xy + float2(0.0 , -0.5 * (phase + (1-phase) * rubyInputSize.y/rubyOutputSize.y) * one.y);
|
//xy = xy + float2(0.0 , -0.5 * (phase + (1-phase) * rubyInputSize.y/rubyOutputSize.y) * one.y);
|
||||||
float4 texels[8];
|
float4 texels[8];
|
||||||
|
/*
|
||||||
texels[0] = TEX2D(xy + float2(-one.x,0.0));
|
texels[0] = TEX2D(xy + float2(-one.x,0.0));
|
||||||
texels[1] = TEX2D(xy);
|
texels[1] = TEX2D(xy);
|
||||||
texels[2] = TEX2D(xy + float2(one.x, 0.0));
|
texels[2] = TEX2D(xy + float2(one.x, 0.0));
|
||||||
@ -63,9 +99,18 @@ output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXU
|
|||||||
texels[5] = TEX2D(xy + float2(0.0, one.y));
|
texels[5] = TEX2D(xy + float2(0.0, one.y));
|
||||||
texels[6] = TEX2D(xy + one);
|
texels[6] = TEX2D(xy + one);
|
||||||
texels[7] = TEX2D(xy + float2(2 * one.x, one.y));
|
texels[7] = TEX2D(xy + float2(2 * one.x, one.y));
|
||||||
|
*/
|
||||||
|
texels[0] = TEX2D(VAR.t1.xy);
|
||||||
|
texels[1] = TEX2D(VAR.CT);
|
||||||
|
texels[2] = TEX2D(VAR.t2.xy);
|
||||||
|
texels[3] = TEX2D(VAR.t3.xy);
|
||||||
|
texels[4] = TEX2D(VAR.t2.zw);
|
||||||
|
texels[5] = TEX2D(VAR.t4.xy);
|
||||||
|
texels[6] = TEX2D(VAR.t4.zw);
|
||||||
|
texels[7] = TEX2D(VAR.t3.zw);
|
||||||
|
|
||||||
|
|
||||||
float2 uv_ratio = frac(xy*rubyTextureSize);
|
float2 uv_ratio = frac(VAR.CT * rubyTextureSize);
|
||||||
|
|
||||||
float4 col, col2;
|
float4 col, col2;
|
||||||
|
|
||||||
@ -86,7 +131,7 @@ output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXU
|
|||||||
weights2 = 0.51*exp(-pow(weights2*sqrt(2/wid),wid))/0.3/(0.6+0.2*wid);
|
weights2 = 0.51*exp(-pow(weights2*sqrt(2/wid),wid))/0.3/(0.6+0.2*wid);
|
||||||
|
|
||||||
float4 mcol = 1.0;
|
float4 mcol = 1.0;
|
||||||
if ( fmod(xy.x*rubyOutputSize.x,2.0) < 1.0)
|
if ( fmod(VAR.CT.x*rubyOutputSize.x,2.0) < 1.0)
|
||||||
mcol.g = 0.7;
|
mcol.g = 0.7;
|
||||||
else
|
else
|
||||||
mcol.rb = 0.7;
|
mcol.rb = 0.7;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user