mirror of
https://github.com/holub/mame
synced 2025-06-08 22:03:55 +03:00
MAMETesters bugs fixed:
- 04361: all: When using HLSL screen size not correct nwn: Frickin' finally...
This commit is contained in:
parent
3e437e09f0
commit
59d38593e8
@ -58,6 +58,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
|||||||
{
|
{
|
||||||
VS_OUTPUT Output = (VS_OUTPUT)0;
|
VS_OUTPUT Output = (VS_OUTPUT)0;
|
||||||
|
|
||||||
|
float2 invDims = float2(1.0f / RawWidth, 1.0f / RawHeight);
|
||||||
Output.Position = float4(Input.Position.xyz, 1.0f);
|
Output.Position = float4(Input.Position.xyz, 1.0f);
|
||||||
Output.Position.x /= TargetWidth;
|
Output.Position.x /= TargetWidth;
|
||||||
Output.Position.y /= TargetHeight;
|
Output.Position.y /= TargetHeight;
|
||||||
@ -66,7 +67,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
|||||||
Output.Position.y -= 0.5f;
|
Output.Position.y -= 0.5f;
|
||||||
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
|
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
|
||||||
Output.Color = Input.Color;
|
Output.Color = Input.Color;
|
||||||
Output.TexCoord = Input.TexCoord;
|
Output.TexCoord = Input.TexCoord + 0.5f * invDims;
|
||||||
|
|
||||||
return Output;
|
return Output;
|
||||||
}
|
}
|
||||||
@ -105,7 +106,7 @@ uniform float BluPower = 2.2f;
|
|||||||
|
|
||||||
float4 ps_main(PS_INPUT Input) : COLOR
|
float4 ps_main(PS_INPUT Input) : COLOR
|
||||||
{
|
{
|
||||||
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord + 0.5f / float2(-RawWidth, -RawHeight));
|
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord);
|
||||||
|
|
||||||
float3 OutRGB = BaseTexel.rgb;
|
float3 OutRGB = BaseTexel.rgb;
|
||||||
|
|
||||||
|
@ -124,22 +124,22 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
|||||||
GrnCoord.y = GrnCoord.y - frac(GrnCoord.y);
|
GrnCoord.y = GrnCoord.y - frac(GrnCoord.y);
|
||||||
BluCoord.y = BluCoord.y - frac(BluCoord.y);
|
BluCoord.y = BluCoord.y - frac(BluCoord.y);
|
||||||
|
|
||||||
float RedTexel = tex2D(DiffuseSampler, lerp(TexCoord, RedCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).r;
|
float RedTexel = tex2D(DiffuseSampler, lerp(TexCoord, RedCoord, Deconverge) / RawDims + 0.5f / RawDims).r;
|
||||||
float GrnTexel = tex2D(DiffuseSampler, lerp(TexCoord, GrnCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).g;
|
float GrnTexel = tex2D(DiffuseSampler, lerp(TexCoord, GrnCoord, Deconverge) / RawDims + 0.5f / RawDims).g;
|
||||||
float BluTexel = tex2D(DiffuseSampler, lerp(TexCoord, BluCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).b;
|
float BluTexel = tex2D(DiffuseSampler, lerp(TexCoord, BluCoord, Deconverge) / RawDims + 0.5f / RawDims).b;
|
||||||
|
|
||||||
RedTexel *= Input.RedCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
//RedTexel *= Input.RedCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
||||||
RedTexel *= Input.RedCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
//RedTexel *= Input.RedCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
||||||
RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
//RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
||||||
RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
//RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
||||||
GrnTexel *= Input.GrnCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
//GrnTexel *= Input.GrnCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
||||||
GrnTexel *= Input.GrnCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
//GrnTexel *= Input.GrnCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
||||||
GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
//GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
||||||
GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
//GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
||||||
BluTexel *= Input.BluCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
//BluTexel *= Input.BluCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
||||||
BluTexel *= Input.BluCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
//BluTexel *= Input.BluCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
||||||
BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
//BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
||||||
BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
//BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
||||||
|
|
||||||
return float4(RedTexel, GrnTexel, BluTexel, Alpha);
|
return float4(RedTexel, GrnTexel, BluTexel, Alpha);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
|||||||
Output.Position.y -= 0.5f;
|
Output.Position.y -= 0.5f;
|
||||||
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
|
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
|
||||||
Output.Color = Input.Color;
|
Output.Color = Input.Color;
|
||||||
Output.TexCoord = Input.TexCoord + 0.5f / float2(RawWidth, RawHeight);
|
Output.TexCoord = Input.TexCoord + 0.5f / float2(TargetWidth, TargetHeight);
|
||||||
|
|
||||||
//float Zoom = 32.0f;
|
//float Zoom = 32.0f;
|
||||||
//Output.TexCoord /= Zoom;
|
//Output.TexCoord /= Zoom;
|
||||||
@ -150,8 +150,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
|||||||
// -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
|
// -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
|
||||||
clip((BaseCoord.x < WidthRatio / RawWidth) ? -1 : 1);
|
clip((BaseCoord.x < WidthRatio / RawWidth) ? -1 : 1);
|
||||||
clip((BaseCoord.y < HeightRatio / RawHeight) ? -1 : 1);
|
clip((BaseCoord.y < HeightRatio / RawHeight) ? -1 : 1);
|
||||||
clip((BaseCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth)) ? -1 : 1);
|
//clip((BaseCoord.x > 1.0f / WidthRatio) ? -1 : 1);
|
||||||
clip((BaseCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight)) ? -1 : 1);
|
//clip((BaseCoord.y > 1.0f / HeightRatio) ? -1 : 1);
|
||||||
|
|
||||||
// -- Scanline Simulation --
|
// -- Scanline Simulation --
|
||||||
float InnerSine = BaseCoord.y * RawHeight * ScanlineScale + 0.5f;
|
float InnerSine = BaseCoord.y * RawHeight * ScanlineScale + 0.5f;
|
||||||
|
Loading…
Reference in New Issue
Block a user