RESERVADO
-Uchiha-
Highlander
Registrado
15.4K Mensagens
919 Curtidas
afonso220 disse:Muito bom, mais em cada tópico do emulador, você poderia ter colocado qual seria a configuração minima para o emulador rodar os jogos
sem travamentos etc, pois a maquina de teste que está usando é forte, então entende-se que quase todos vão rodar sem problemas, agora em pcs
mais ''básicos'' ou menos parrudo, não se sabe como ira ocorrer essa emulação.
mednafen.exe "D:\jogosSaturn\Legend of Heroes III.cue"
mednafen.exe "D:\jogosPCFX\Zeroigar.cue"
pce.scanlines 30
pce.xres 640
pce.yres 480
pce.xscale 2.000000
pce.yscale 2.000000
pcfx.scanlines 30
pcfx.xres 640
pcfx.yres 480
pcfx.xscale 2.000000
pcfx.yscale 2.000000
#pragma parameter InputGamma "Input gamma" 2.4 0.0 5.0 0.1
#pragma parameter OutputGamma "Output Gamma" 2.2 0.0 5.0 0.1
#pragma parameter DILATION_STRENGTH "Dilation Strength" 0.9 0.0 1.0 0.05
#pragma parameter SHARPNESS "Sharpness" 2.0 0.0 5.0 0.1
#pragma parameter RED_BOOST "Red Boost" 1.0 1.0 2.0 0.01
#pragma parameter GREEN_BOOST "Green Boost" 1.0 1.0 2.0 0.01
#pragma parameter SCANLINES_STRENGTH "Scanline Strength" 0.7 0.0 1.0 0.01
#pragma parameter BEAM_MIN_WIDTH "Min. Beam Width" 0.1 0.0 1.0 0.01
#pragma parameter BEAM_MAX_WIDTH "Max Beam Width" 0.7 0.0 1.0 0.01
#pragma parameter COLOR_BOOST "Color Boost" 1.2 1.0 2.0 0.05
#pragma parameter BEAM_WIDTH_SENSITIVITY "Beam Width Sensitivity" 0.5 0.0 1.0 0.01
#pragma parameter CRT_TV_BLUE_TINT "CRT TV Blue Tint" 1.05 1.0 2.0 0.01
#ifdef PARAMETER_UNIFORM
uniform float InputGamma;
uniform float OutputGamma;
uniform float DILATION_STRENGTH;
uniform float SHARPNESS;
uniform float RED_BOOST;
uniform float GREEN_BOOST;
uniform float SCANLINES_STRENGTH;
uniform float BEAM_MIN_WIDTH;
uniform float BEAM_MAX_WIDTH;
uniform float COLOR_BOOST;
uniform float BEAM_WIDTH_SENSITIVITY;
uniform float CRT_TV_BLUE_TINT;
#else
#define InputGamma 2.4
#define OutputGamma 2.2
#define DILATION_STRENGTH 0.9
#define SHARPNESS 2.0
#define RED_BOOST 1.0
#define GREEN_BOOST 1.0
#define SCANLINES_STRENGTH 0.7
#define BEAM_MIN_WIDTH 0.1
#define BEAM_MAX_WIDTH 0.7
#define COLOR_BOOST 1.2
#define BEAM_WIDTH_SENSITIVITY 0.5
#define CRT_TV_BLUE_TINT 1.05
#endif
// END PARAMETERS //
/* COMPATIBILITY
- HLSL compilers
- Cg compilers
*/
/*
Hyllian's CRT Shader
Copyright (C) 2011-2014 Hyllian/Jararaca - sergiogdb@gmail.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Uncomment to enable anti-ringing to horizontal filter.
#define ANTI_RINGING
// Uncomment to dilate bright pixels horizontally.
#define DILATION
// Uncomment to increase the sharpness of the scanlines.
//#define SHARPER
// Comment next line if you don't desire the phosphor effect.
#define PHOSPHOR
// Uncomment to enable adjustment of red and green saturation.
//#define RED_GREEN_CONTROL
#define GAMMA_IN(color) pow(color, float3(InputGamma, InputGamma, InputGamma))
#define GAMMA_OUT(color) pow(color, float3(1.0 / OutputGamma, 1.0 / OutputGamma, 1.0 / OutputGamma))
// Horizontal cubic filter.
// Some known filters use these values:
// B = 0.0, C = 0.0 => Hermite cubic filter.
// B = 1.0, C = 0.0 => Cubic B-Spline filter.
// B = 0.0, C = 0.5 => Catmull-Rom Spline filter. This is the default used in this shader.
// B = C = 1.0/3.0 => Mitchell-Netravali cubic filter.
// B = 0.3782, C = 0.3109 => Robidoux filter.
// B = 0.2620, C = 0.3690 => Robidoux Sharp filter.
// B = 0.36, C = 0.28 => My best config for ringing elimination in pixel art (Hyllian).
// For more info, see: http://www.imagemagick.org/Usage/img_diagrams/cubic_survey.gif
// Change these params to configure the horizontal filter.
const static float B = 0.0;
const static float C = 0.5;
const static float4x4 invX = float4x4( (-B - 6.0*C)/6.0, (3.0*B + 12.0*C)/6.0, (-3.0*B - 6.0*C)/6.0, B/6.0,
(12.0 - 9.0*B - 6.0*C)/6.0, (-18.0 + 12.0*B + 6.0*C)/6.0, 0.0, (6.0 - 2.0*B)/6.0,
-(12.0 - 9.0*B - 6.0*C)/6.0, (18.0 - 15.0*B - 12.0*C)/6.0, (3.0*B + 6.0*C)/6.0, B/6.0,
(B + 6.0*C)/6.0, -C, 0.0, 0.0);
struct input
{
float2 video_size;
float2 texture_size;
float2 output_size;
float frame_count;
float frame_direction;
float frame_rotation;
};
struct out_vertex {
float2 texCoord;
};
/* VERTEX_SHADER */
out_vertex main_vertex
(
float4 position : POSITION,
out float4 oPosition : POSITION,
float2 texCoord : TEXCOORD0,
uniform float4x4 modelViewProj,
uniform input IN
)
{
oPosition = mul(modelViewProj, position);
out_vertex OUT = {
texCoord
};
return OUT;
}
float4 main_fragment(in out_vertex VAR, uniform sampler2D s_p : TEXUNIT0, uniform input IN) : COLOR
{
#ifdef SHARPER
float2 TextureSize = float2(SHARPNESS*IN.texture_size.x, IN.texture_size.y);
#else
float2 TextureSize = IN.texture_size;
#endif
float2 dx = float2(1.0/TextureSize.x, 0.0);
float2 dy = float2(0.0, 1.0/TextureSize.y);
float2 pix_coord = VAR.texCoord*TextureSize-float2(0.5,0.0);
float2 tc = (floor(pix_coord)+float2(0.5,0.5))/TextureSize;
float2 fp = frac(pix_coord);
float3 c10 = tex2D(s_p, tc - dx).xyz;
float3 c11 = tex2D(s_p, tc ).xyz;
float3 c12 = tex2D(s_p, tc + dx).xyz;
float3 c13 = tex2D(s_p, tc + 2.0*dx).xyz;
#ifdef ANTI_RINGING
// Get min/max samples
float3 min_sample = min(c11, c12);
float3 max_sample = max(c11, c12);
#endif
float4x3 color_matrix = float4x3(c10, c11, c12, c13);
float4 invX_Px = mul(invX, float4(fp.x*fp.x*fp.x, fp.x*fp.x, fp.x, 1.0));
float3 color = mul(invX_Px, color_matrix);
#ifdef DILATION
float dz = DILATION_STRENGTH*IN.video_size.x/(IN.output_size.x);
float2 fpf = float2(fp.x + dz, fp.y);
float2 fpd = float2(fp.x - dz, fp.y);
invX_Px = mul(invX, float4(fpf.x*fpf.x*fpf.x, fpf.x*fpf.x, fpf.x, 1.0));
float3 colorf = mul(invX_Px, color_matrix);
invX_Px = mul(invX, float4(fpd.x*fpd.x*fpd.x, fpd.x*fpd.x, fpd.x, 1.0));
float3 colord = mul(invX_Px, color_matrix);
color = max(color, max(colorf, colord));
#endif
#ifdef ANTI_RINGING
// Anti-ringing
color = clamp(color, min_sample, max_sample);
#endif
float pos = abs(fp.y - 0.5);
float3 lum = lerp(float3(BEAM_MIN_WIDTH), float3(BEAM_MAX_WIDTH), color);
lum = pow(lum,float3(BEAM_WIDTH_SENSITIVITY));
float3 d = clamp(pos/lum, 0.0, 1.0);
d = smoothstep(0.0, 1.0, 1.0-d);
d = SCANLINES_STRENGTH*(d-1.0)+1.0;
#ifdef RED_GREEN_CONTROL
color.rgb *= float3(RED_BOOST, GREEN_BOOST, CRT_TV_BLUE_TINT);
#else
color.b *= CRT_TV_BLUE_TINT;
#endif
color = clamp(color*d, 0.0, 1.0);
color = GAMMA_IN(color);
#ifdef PHOSPHOR
float mod_factor = VAR.texCoord.x * IN.output_size.x * IN.texture_size.x / IN.video_size.x;
float3 dotMaskWeights = lerp(
float3(1.0, 0.7, 1.0),
float3(0.7, 1.0, 0.7),
floor(fmod(mod_factor, 2.0))
);
color.rgb *= dotMaskWeights;
#endif
color *= COLOR_BOOST;
color = GAMMA_OUT(color);
return float4(color, 1.0);
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
CRT shader
Copyright (C) 2010, 2011 cgwg, Themaister and DOLLS
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
(cgwg gave their consent to have the original version of this shader
distributed under the GPL in this message:
http://board.byuu.org/viewtopic.php?p=26075#p26075
"Feel free to distribute my shaders under the GPL. After all, the
barrel distortion code was taken from the Curvature shader, which is
under the GPL."
)
-->
<shader language="GLSL">
<vertex><![CDATA[
uniform vec2 rubyInputSize;
uniform vec2 rubyOutputSize;
uniform vec2 rubyTextureSize;
// Define some calculations that will be used in fragment shader.
varying vec2 texCoord;
varying vec2 one;
varying float mod_factor;
void main()
{
// Do the standard vertex processing.
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// Precalculate a bunch of useful values we'll need in the fragment
// shader.
// Texture coords.
texCoord = gl_MultiTexCoord0.xy;
// The size of one texel, in texture-coordinates.
one = 1.0 / rubyTextureSize;
// Resulting X pixel-coordinate of the pixel we're drawing.
mod_factor = texCoord.x * rubyTextureSize.x * rubyOutputSize.x / rubyInputSize.x;
}
]]></vertex>
<fragment><![CDATA[
uniform sampler2D rubyTexture;
uniform vec2 rubyInputSize;
uniform vec2 rubyOutputSize;
uniform vec2 rubyTextureSize;
varying vec2 texCoord;
varying vec2 one;
varying float mod_factor;
// Comment the next line to disable interpolation in linear gamma (and gain speed).
#define LINEAR_PROCESSING
// Compensate for 16-235 level range as per Rec. 601.
#define REF_LEVELS
// Enable screen curvature.
#define CURVATURE
// Controls the intensity of the barrel distortion used to emulate the
// curvature of a CRT. 0.0 is perfectly flat, 1.0 is annoyingly
// distorted, higher values are increasingly ridiculous.
#define distortion 0.2
// Simulate a CRT gamma of 2.4.
#define inputGamma 2.4
// Compensate for the standard sRGB gamma of 2.2.
#define outputGamma 2.2
// Macros.
#define FIX(c) max(abs(c), 1e-5);
#define PI 3.141592653589
#ifdef REF_LEVELS
# define LEVELS(c) max((c - 16.0 / 255.0) * 255.0 / (235.0 - 16.0), 0.0)
#else
# define LEVELS(c) c
#endif
#ifdef LINEAR_PROCESSING
# define TEX2D(c) pow(LEVELS(texture2D(rubyTexture, (c))), vec4(inputGamma))
#else
# define TEX2D(c) LEVELS(texture2D(rubyTexture, (c)))
#endif
// Apply radial distortion to the given coordinate.
vec2 radialDistortion(vec2 coord)
{
coord *= rubyTextureSize / rubyInputSize;
vec2 cc = coord - 0.5;
float dist = dot(cc, cc) * distortion;
return (coord + cc * (1.0 + dist) * dist) * rubyInputSize / rubyTextureSize;
}
// Calculate the influence of a scanline on the current pixel.
//
// 'distance' is the distance in texture coordinates from the current
// pixel to the scanline in question.
// 'color' is the colour of the scanline at the horizontal location of
// the current pixel.
vec4 scanlineWeights(float distance, vec4 color)
{
// The "width" of the scanline beam is set as 2*(1 + x^4) for
// each RGB channel.
vec4 wid = 2.0 + 2.0 * pow(color, vec4(4.0));
// The "weights" lines basically specify the formula that gives
// you the profile of the beam, i.e. the intensity as
// a function of distance from the vertical center of the
// scanline. In this case, it is gaussian if width=2, and
// becomes nongaussian for larger widths. Ideally this should
// be normalized so that the integral across the beam is
// independent of its width. That is, for a narrower beam
// "weights" should have a higher peak at the center of the
// scanline than for a wider beam.
vec4 weights = vec4(distance / 0.3);
return 1.4 * exp(-pow(weights * inversesqrt(0.5 * wid), wid)) / (0.6 + 0.2 * wid);
}
void main()
{
// Here's a helpful diagram to keep in mind while trying to
// understand the code:
//
// | | | | |
// -------------------------------
// | | | | |
// | 01 | 11 | 21 | 31 | <-- current scanline
// | | @ | | |
// -------------------------------
// | | | | |
// | 02 | 12 | 22 | 32 | <-- next scanline
// | | | | |
// -------------------------------
// | | | | |
//
// Each character-cell represents a pixel on the output
// surface, "@" represents the current pixel (always somewhere
// in the bottom half of the current scan-line, or the top-half
// of the next scanline). The grid of lines represents the
// edges of the texels of the underlying texture.
// Texture coordinates of the texel containing the active pixel.
#ifdef CURVATURE
vec2 xy = radialDistortion(texCoord);
#else
vec2 xy = texCoord;
#endif
// Of all the pixels that are mapped onto the texel we are
// currently rendering, which pixel are we currently rendering?
vec2 ratio_scale = xy * rubyTextureSize - vec2(0.5);
vec2 uv_ratio = fract(ratio_scale);
// Snap to the center of the underlying texel.
xy = (floor(ratio_scale) + vec2(0.5)) / rubyTextureSize;
// Calculate Lanczos scaling coefficients describing the effect
// of various neighbour texels in a scanline on the current
// pixel.
vec4 coeffs = PI * vec4(1.0 + uv_ratio.x, uv_ratio.x, 1.0 - uv_ratio.x, 2.0 - uv_ratio.x);
// Prevent division by zero.
coeffs = FIX(coeffs);
// Lanczos2 kernel.
coeffs = 2.0 * sin(coeffs) * sin(coeffs / 2.0) / (coeffs * coeffs);
// Normalize.
coeffs /= dot(coeffs, vec4(1.0));
// Calculate the effective colour of the current and next
// scanlines at the horizontal location of the current pixel,
// using the Lanczos coefficients above.
vec4 col = clamp(mat4(
TEX2D(xy + vec2(-one.x, 0.0)),
TEX2D(xy),
TEX2D(xy + vec2(one.x, 0.0)),
TEX2D(xy + vec2(2.0 * one.x, 0.0))) * coeffs,
0.0, 1.0);
vec4 col2 = clamp(mat4(
TEX2D(xy + vec2(-one.x, one.y)),
TEX2D(xy + vec2(0.0, one.y)),
TEX2D(xy + one),
TEX2D(xy + vec2(2.0 * one.x, one.y))) * coeffs,
0.0, 1.0);
#ifndef LINEAR_PROCESSING
col = pow(col , vec4(inputGamma));
col2 = pow(col2, vec4(inputGamma));
#endif
// Calculate the influence of the current and next scanlines on
// the current pixel.
vec4 weights = scanlineWeights(uv_ratio.y, col);
vec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);
vec3 mul_res = (col * weights + col2 * weights2).rgb;
// dot-mask emulation:
// Output pixels are alternately tinted green and magenta.
vec3 dotMaskWeights = mix(
vec3(1.0, 0.7, 1.0),
vec3(0.7, 1.0, 0.7),
floor(mod(mod_factor, 2.0))
);
mul_res *= dotMaskWeights;
// Convert the image gamma for display on our output device.
mul_res = pow(mul_res, vec3(1.0 / outputGamma));
// Color the texel.
gl_FragColor = vec4(mul_res, 1.0);
}
]]></fragment>
</shader>
/*
Copyright (C) 2007 guest(r) - guest.r@gmail.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
The 4xSoft shader processes a gfx. surface and redraws it 4x finer.
Note: set scaler to normal2x.
*/
const static half3 dt = half3(1.0, 1.0, 1.0);
struct input
{
half2 video_size;
half2 texture_size;
half2 output_size;
};
struct out_vertex {
half4 position : POSITION;
half4 color : COLOR;
half2 texCoord : TEXCOORD0;
half4 t1 : TEXCOORD1;
half4 t2 : TEXCOORD2;
half4 t3 : TEXCOORD3;
half4 t4 : TEXCOORD4;
half4 t5 : TEXCOORD5;
half4 t6 : TEXCOORD6;
};
/* VERTEX_SHADER */
out_vertex main_vertex
(
half4 position : POSITION,
half4 color : COLOR,
half2 tex : TEXCOORD0,
uniform half4x4 modelViewProj,
uniform input IN
)
{
half2 ps = half2(1.0/960.0, 1.0/592.0);
half dx = ps.x;
half dy = ps.y;
half sx = ps.x * 0.5;
half sy = ps.y * 0.5;
out_vertex OUT = {
mul(modelViewProj, position),
color,
tex,
half4(tex,tex) + half4(-dx, -dy, dx, -dy), // outer diag. texels
half4(tex,tex) + half4(dx, dy, -dx, dy),
half4(tex,tex) + half4(-sx, -sy, sx, -sy), // inner diag. texels
half4(tex,tex) + half4(sx, sy, -sx, sy),
half4(tex,tex) + half4(-dx, 0, dx, 0), // inner hor/vert texels
half4(tex,tex) + half4(0, -dy, 0, dy)
};
return OUT;
}
half4 main_fragment(in out_vertex VAR, uniform sampler2D s_p : TEXUNIT0, uniform input IN) : COLOR
{
half3 c11 = tex2D(s_p, VAR.texCoord).xyz;
half3 c00 = tex2D(s_p, VAR.t1.xy).xyz;
half3 c20 = tex2D(s_p, VAR.t1.zw).xyz;
half3 c22 = tex2D(s_p, VAR.t2.xy).xyz;
half3 c02 = tex2D(s_p, VAR.t2.zw).xyz;
half3 s00 = tex2D(s_p, VAR.t3.xy).xyz;
half3 s20 = tex2D(s_p, VAR.t3.zw).xyz;
half3 s22 = tex2D(s_p, VAR.t4.xy).xyz;
half3 s02 = tex2D(s_p, VAR.t4.zw).xyz;
half3 c01 = tex2D(s_p, VAR.t5.xy).xyz;
half3 c21 = tex2D(s_p, VAR.t5.zw).xyz;
half3 c10 = tex2D(s_p, VAR.t6.xy).xyz;
half3 c12 = tex2D(s_p, VAR.t6.zw).xyz;
half d1=dot(abs(c00-c22),dt)+0.0001;
half d2=dot(abs(c20-c02),dt)+0.0001;
half hl=dot(abs(c01-c21),dt)+0.0001;
half vl=dot(abs(c10-c12),dt)+0.0001;
half m1=dot(abs(c00-c22),dt)+0.001;
half m2=dot(abs(c02-c20),dt)+0.001;
half3 t1=(hl*(c10+c12)+vl*(c01+c21)+(hl+vl)*c11)/(3.0*(hl+vl));
half3 t2=(d1*(c20+c02)+d2*(c00+c22)+(d1+d2)*c11)/(3.0*(d1+d2));
return half4(0.25*(t1+t2+(m2*(s00+s22)+m1*(s02+s20))/(m1+m2)),0);
}
Julaes disse:Muito bom o tópico, gostei bastante!
Só não entendi qual o problema de selecionar widescreen no emulador do PS One, você comentou que não recomenda mas não informou o que de ruim acontece caso a opção seja selecionada.
-Uchiha- disse:Removi do Guia a parte do "Não recomendo" por ser uma opinião pessoal. Eu particularmente não recomendo pois em jogos 2D, o aspect ratio fica deformado... irei dar uma revisada no tutorial do PSOne acrescentando novas informações...
Julaes disse:A imagem "estica" quando a opção é selecionada?
sephiroth0 disse:Tutorial de Saturn adicionado.
https://www.hardware.com.br/comunidade/posts/7846875/
Muito bom o Demul Uchiha. Não conhecia.
-Uchiha- disse:Entendo o questionamento, mas é mais complicado que isso... vou ver o que consigo fazer mais o problema é que os requisitos mínimos variam muito de jogo para jogo. Alguns jogos são mais exigentes que outros, além de em determinados casos, o emulador ser melhor otimizado para X jogo.
De todo modo, vou tentar elaborar uma metodologia para atender isso.