restore scanlines filter as shader
This commit is contained in:
parent
582a3ae58a
commit
cd7ca56441
|
@ -49,7 +49,7 @@ namespace BizHawk.Client.Common
|
|||
public int Input_Hotkey_OverrideOptions = 0;
|
||||
public bool StackOSDMessages = true;
|
||||
public int TargetZoomFactor = 2;
|
||||
public int TargetScanlineFilterIntensity = 0; // choose between 0 and 256
|
||||
public int TargetScanlineFilterIntensity = 128; // choose between 0 and 256
|
||||
public int TargetDisplayFilter = 0;
|
||||
public RecentFiles RecentRoms = new RecentFiles(8);
|
||||
public bool PauseWhenMenuActivated = true;
|
||||
|
|
|
@ -470,12 +470,6 @@
|
|||
<Compile Include="PresentationPanel.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ScanlineSlider.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ScanlineSlider.Designer.cs">
|
||||
<DependentUpon>ScanlineSlider.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Throttle.cs" />
|
||||
<Compile Include="tools\BatchRun.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
@ -1003,9 +997,6 @@
|
|||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="ScanlineSlider.resx">
|
||||
<DependentUpon>ScanlineSlider.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="tools\BatchRun.resx">
|
||||
<DependentUpon>BatchRun.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -1161,6 +1152,7 @@
|
|||
<DependentUpon>WatchEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DisplayManager\Filters\hq2x.glsl" />
|
||||
<EmbeddedResource Include="DisplayManager\Filters\BizScanlines.glsl" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
|
|
@ -49,9 +49,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
RetroShader_Hq2x = new Bizware.BizwareGL.Drivers.OpenTK.RetroShader(GL, str);
|
||||
}
|
||||
|
||||
using (var stream = typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Client.EmuHawk.DisplayManager.Filters.BizScanlines.glsl"))
|
||||
{
|
||||
var str = new System.IO.StreamReader(stream).ReadToEnd();
|
||||
RetroShader_BizScanlines = new Bizware.BizwareGL.Drivers.OpenTK.RetroShader(GL, str);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Bizware.BizwareGL.Drivers.OpenTK.RetroShader RetroShader_Hq2x;
|
||||
Bizware.BizwareGL.Drivers.OpenTK.RetroShader RetroShader_Hq2x, RetroShader_BizScanlines;
|
||||
|
||||
public bool Disposed { get; private set; }
|
||||
|
||||
|
@ -112,6 +118,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaEmuTexture = LuaEmuTextureFrugalizer.Get(luaEmuSurface);
|
||||
|
||||
|
||||
//TargetScanlineFilterIntensity
|
||||
//apply filter chain (currently, over-simplified)
|
||||
Texture2d currentTexture = videoTexture;
|
||||
if (Global.Config.TargetDisplayFilter == 1)
|
||||
|
@ -122,6 +129,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
RetroShader_Hq2x.Run(videoTexture, videoTexture.Size, outSize, true);
|
||||
currentTexture = rt.Texture2d;
|
||||
}
|
||||
if (Global.Config.TargetDisplayFilter == 2)
|
||||
{
|
||||
var rt = Video2xFrugalizer.Get(videoTexture.IntWidth*2,videoTexture.IntHeight*2);
|
||||
rt.Bind();
|
||||
Size outSize = new Size(videoTexture.IntWidth * 2, videoTexture.IntHeight * 2);
|
||||
RetroShader_BizScanlines.Bind();
|
||||
RetroShader_BizScanlines.Pipeline["uIntensity"].Set(1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f);
|
||||
RetroShader_BizScanlines.Run(videoTexture, videoTexture.Size, outSize, true);
|
||||
currentTexture = rt.Texture2d;
|
||||
}
|
||||
|
||||
//begin drawing to the PresentationPanel:
|
||||
GraphicsControl.Begin();
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
#if defined(VERTEX)
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
#define COMPAT_VARYING out
|
||||
#define COMPAT_ATTRIBUTE in
|
||||
#define COMPAT_TEXTURE texture
|
||||
#else
|
||||
#define COMPAT_VARYING varying
|
||||
#define COMPAT_ATTRIBUTE attribute
|
||||
#define COMPAT_TEXTURE texture2D
|
||||
#endif
|
||||
|
||||
#ifdef GL_ES
|
||||
#define COMPAT_PRECISION mediump
|
||||
#else
|
||||
#define COMPAT_PRECISION
|
||||
#endif
|
||||
|
||||
COMPAT_ATTRIBUTE vec4 VertexCoord;
|
||||
COMPAT_ATTRIBUTE vec4 COLOR;
|
||||
COMPAT_ATTRIBUTE vec4 TexCoord;
|
||||
|
||||
COMPAT_VARYING vec2 vTexCoord0;
|
||||
|
||||
uniform mat4 MVPMatrix;
|
||||
uniform int FrameDirection;
|
||||
uniform int FrameCount;
|
||||
uniform COMPAT_PRECISION vec2 OutputSize;
|
||||
uniform COMPAT_PRECISION vec2 TextureSize;
|
||||
uniform COMPAT_PRECISION vec2 InputSize;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVPMatrix * VertexCoord;
|
||||
vTexCoord0 = TexCoord;
|
||||
}
|
||||
|
||||
#elif defined(FRAGMENT)
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
#define COMPAT_VARYING in
|
||||
#define COMPAT_TEXTURE texture
|
||||
out vec4 FragColor;
|
||||
#else
|
||||
#define COMPAT_VARYING varying
|
||||
#define FragColor gl_FragColor
|
||||
#define COMPAT_TEXTURE texture2D
|
||||
#endif
|
||||
|
||||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#define COMPAT_PRECISION mediump
|
||||
#else
|
||||
#define COMPAT_PRECISION
|
||||
#endif
|
||||
|
||||
COMPAT_VARYING vec2 vTexCoord0;
|
||||
uniform sampler2D Texture;
|
||||
uniform int FrameDirection;
|
||||
uniform int FrameCount;
|
||||
uniform COMPAT_PRECISION vec2 OutputSize;
|
||||
uniform COMPAT_PRECISION vec2 TextureSize;
|
||||
uniform COMPAT_PRECISION vec2 InputSize;
|
||||
uniform float uIntensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 temp = texture2D(Texture,vTexCoord0);
|
||||
if(((int)gl_FragCoord.y)%2==1) temp.rgb *= uIntensity;
|
||||
FragColor = temp;
|
||||
}
|
||||
#endif
|
|
@ -1,536 +0,0 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
//what license is this?? who knows??
|
||||
//ref: http://vba-rerecording.googlecode.com/svn/trunk/src/2xsai.cpp
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
|
||||
class Hq2xBase_2xSai : Hq2xBase {}
|
||||
class Hq2xBase_Super2xSai : Hq2xBase { }
|
||||
class Hq2xBase_SuperEagle : Hq2xBase { }
|
||||
|
||||
public abstract class Hq2xBase : IDisplayFilter
|
||||
{
|
||||
public DisplayFilterAnalysisReport Analyze(Size sourceSize)
|
||||
{
|
||||
var ret = new DisplayFilterAnalysisReport();
|
||||
ret.Success = true;
|
||||
ret.OutputSize = new Size(sourceSize.Width * 2, sourceSize.Height * 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public unsafe DisplaySurface Execute(DisplaySurface surface)
|
||||
{
|
||||
int w = surface.Width;
|
||||
int h = surface.Height;
|
||||
var ret = new DisplaySurface(w * 2, h * 2);
|
||||
using (var padded = surface.ToPaddedSurface(1, 1, 2, 2))
|
||||
{
|
||||
if(this is Hq2xBase_2xSai) _2xSaI32((byte*)padded.PixelPtr + padded.OffsetOf(1, 1), (uint)(padded.Stride), null, (byte*)ret.PixelPtr, (uint)(ret.Stride), (uint)w, (uint)h);
|
||||
if (this is Hq2xBase_Super2xSai) Super2xSaI32((byte*)padded.PixelPtr + padded.OffsetOf(1, 1), (uint)(padded.Stride), null, (byte*)ret.PixelPtr, (uint)(ret.Stride), (uint)w, (uint)h);
|
||||
if (this is Hq2xBase_SuperEagle) SuperEagle32((byte*)padded.PixelPtr + padded.OffsetOf(1, 1), (uint)(padded.Stride), null, (byte*)ret.PixelPtr, (uint)(ret.Stride), (uint)w, (uint)h);
|
||||
padded.Dispose();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int GetResult1 (uint A, uint B, uint C, uint D, uint E )
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int r = 0;
|
||||
|
||||
if (A == C)
|
||||
x += 1;
|
||||
else if (B == C)
|
||||
y += 1;
|
||||
if (A == D)
|
||||
x += 1;
|
||||
else if (B == D)
|
||||
y += 1;
|
||||
if (x <= 1)
|
||||
r += 1;
|
||||
if (y <= 1)
|
||||
r -= 1;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
static int GetResult2 (uint A, uint B, uint C, uint D, uint E )
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int r = 0;
|
||||
|
||||
if (A == C)
|
||||
x += 1;
|
||||
else if (B == C)
|
||||
y += 1;
|
||||
if (A == D)
|
||||
x += 1;
|
||||
else if (B == D)
|
||||
y += 1;
|
||||
if (x <= 1)
|
||||
r -= 1;
|
||||
if (y <= 1)
|
||||
r += 1;
|
||||
return r;
|
||||
}
|
||||
|
||||
static int GetResult (uint A, uint B, uint C, uint D)
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int r = 0;
|
||||
|
||||
if (A == C)
|
||||
x += 1;
|
||||
else if (B == C)
|
||||
y += 1;
|
||||
if (A == D)
|
||||
x += 1;
|
||||
else if (B == D)
|
||||
y += 1;
|
||||
if (x <= 1)
|
||||
r += 1;
|
||||
if (y <= 1)
|
||||
r -= 1;
|
||||
return r;
|
||||
}
|
||||
|
||||
const uint colorMask = 0xfefefe;
|
||||
const uint lowPixelMask = 0x010101;
|
||||
const uint qcolorMask = 0xfcfcfc;
|
||||
const uint qlowpixelMask = 0x030303;
|
||||
const uint redblueMask = 0xF81F;
|
||||
const uint greenMask = 0x7E0;
|
||||
|
||||
static uint INTERPOLATE (uint A, uint B)
|
||||
{
|
||||
if (A != B) {
|
||||
return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) +
|
||||
(A & B & lowPixelMask));
|
||||
} else
|
||||
return A;
|
||||
}
|
||||
|
||||
static uint Q_INTERPOLATE(uint A, uint B, uint C, uint D)
|
||||
{
|
||||
uint x = ((A & qcolorMask) >> 2) +
|
||||
((B & qcolorMask) >> 2) +
|
||||
((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2);
|
||||
uint y = (A & qlowpixelMask) +
|
||||
(B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask);
|
||||
|
||||
y = (y >> 2) & qlowpixelMask;
|
||||
return x + y;
|
||||
}
|
||||
|
||||
|
||||
unsafe static void _2xSaI32 (byte *srcPtr, uint srcPitch, byte * deltaPtr ,
|
||||
byte *dstPtr, uint dstPitch, uint width, uint height)
|
||||
{
|
||||
uint *dP;
|
||||
uint *bP;
|
||||
uint inc_bP = 1;
|
||||
|
||||
uint Nextline = srcPitch >> 2;
|
||||
|
||||
for (; height!=0; height--) {
|
||||
bP = (uint *) srcPtr;
|
||||
dP = (uint *) dstPtr;
|
||||
|
||||
for (uint finish = width; finish!=0; finish -= inc_bP) {
|
||||
uint colorA, colorB;
|
||||
uint colorC, colorD,
|
||||
colorE, colorF, colorG, colorH,
|
||||
colorI, colorJ, colorK, colorL,
|
||||
|
||||
colorM, colorN, colorO, colorP;
|
||||
uint product, product1, product2;
|
||||
|
||||
//---------------------------------------
|
||||
// Map of the pixels: I|E F|J
|
||||
// G|A B|K
|
||||
// H|C D|L
|
||||
// M|N O|P
|
||||
colorI = *(bP - Nextline - 1);
|
||||
colorE = *(bP - Nextline);
|
||||
colorF = *(bP - Nextline + 1);
|
||||
colorJ = *(bP - Nextline + 2);
|
||||
|
||||
colorG = *(bP - 1);
|
||||
colorA = *(bP);
|
||||
colorB = *(bP + 1);
|
||||
colorK = *(bP + 2);
|
||||
|
||||
colorH = *(bP + Nextline - 1);
|
||||
colorC = *(bP + Nextline);
|
||||
colorD = *(bP + Nextline + 1);
|
||||
colorL = *(bP + Nextline + 2);
|
||||
|
||||
colorM = *(bP + Nextline + Nextline - 1);
|
||||
colorN = *(bP + Nextline + Nextline);
|
||||
colorO = *(bP + Nextline + Nextline + 1);
|
||||
colorP = *(bP + Nextline + Nextline + 2);
|
||||
|
||||
if ((colorA == colorD) && (colorB != colorC)) {
|
||||
if (((colorA == colorE) && (colorB == colorL)) ||
|
||||
((colorA == colorC) && (colorA == colorF)
|
||||
&& (colorB != colorE) && (colorB == colorJ))) {
|
||||
product = colorA;
|
||||
} else {
|
||||
product = INTERPOLATE (colorA, colorB);
|
||||
}
|
||||
|
||||
if (((colorA == colorG) && (colorC == colorO)) ||
|
||||
((colorA == colorB) && (colorA == colorH)
|
||||
&& (colorG != colorC) && (colorC == colorM))) {
|
||||
product1 = colorA;
|
||||
} else {
|
||||
product1 = INTERPOLATE (colorA, colorC);
|
||||
}
|
||||
product2 = colorA;
|
||||
} else if ((colorB == colorC) && (colorA != colorD)) {
|
||||
if (((colorB == colorF) && (colorA == colorH)) ||
|
||||
((colorB == colorE) && (colorB == colorD)
|
||||
&& (colorA != colorF) && (colorA == colorI))) {
|
||||
product = colorB;
|
||||
} else {
|
||||
product = INTERPOLATE (colorA, colorB);
|
||||
}
|
||||
|
||||
if (((colorC == colorH) && (colorA == colorF)) ||
|
||||
((colorC == colorG) && (colorC == colorD)
|
||||
&& (colorA != colorH) && (colorA == colorI))) {
|
||||
product1 = colorC;
|
||||
} else {
|
||||
product1 = INTERPOLATE (colorA, colorC);
|
||||
}
|
||||
product2 = colorB;
|
||||
} else if ((colorA == colorD) && (colorB == colorC)) {
|
||||
if (colorA == colorB) {
|
||||
product = colorA;
|
||||
product1 = colorA;
|
||||
product2 = colorA;
|
||||
} else {
|
||||
int r = 0;
|
||||
|
||||
product1 = INTERPOLATE (colorA, colorC);
|
||||
product = INTERPOLATE (colorA, colorB);
|
||||
|
||||
r += GetResult1 (colorA, colorB, colorG, colorE, colorI);
|
||||
r += GetResult2 (colorB, colorA, colorK, colorF, colorJ);
|
||||
r += GetResult2 (colorB, colorA, colorH, colorN, colorM);
|
||||
r += GetResult1 (colorA, colorB, colorL, colorO, colorP);
|
||||
|
||||
if (r > 0)
|
||||
product2 = colorA;
|
||||
else if (r < 0)
|
||||
product2 = colorB;
|
||||
else {
|
||||
product2 = Q_INTERPOLATE (colorA, colorB, colorC, colorD);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
product2 = Q_INTERPOLATE (colorA, colorB, colorC, colorD);
|
||||
|
||||
if ((colorA == colorC) && (colorA == colorF)
|
||||
&& (colorB != colorE) && (colorB == colorJ)) {
|
||||
product = colorA;
|
||||
} else if ((colorB == colorE) && (colorB == colorD)
|
||||
&& (colorA != colorF) && (colorA == colorI)) {
|
||||
product = colorB;
|
||||
} else {
|
||||
product = INTERPOLATE (colorA, colorB);
|
||||
}
|
||||
|
||||
if ((colorA == colorB) && (colorA == colorH)
|
||||
&& (colorG != colorC) && (colorC == colorM)) {
|
||||
product1 = colorA;
|
||||
} else if ((colorC == colorG) && (colorC == colorD)
|
||||
&& (colorA != colorH) && (colorA == colorI)) {
|
||||
product1 = colorC;
|
||||
} else {
|
||||
product1 = INTERPOLATE (colorA, colorC);
|
||||
}
|
||||
}
|
||||
*(dP) = colorA | 0xFF000000;
|
||||
*(dP + 1) = product | 0xFF000000;
|
||||
*(dP + (dstPitch >> 2)) = product1 | 0xFF000000;
|
||||
*(dP + (dstPitch >> 2) + 1) = product2 | 0xFF000000;
|
||||
|
||||
bP += inc_bP;
|
||||
dP += 2;
|
||||
} // end of for ( finish= width etc..)
|
||||
|
||||
srcPtr += srcPitch;
|
||||
dstPtr += dstPitch * 2;
|
||||
// deltaPtr += srcPitch;
|
||||
} // endof: for (height; height; height--)
|
||||
}
|
||||
|
||||
|
||||
unsafe void SuperEagle32 (byte *srcPtr, uint srcPitch, byte * deltaPtr,
|
||||
byte* dstPtr, uint dstPitch, uint width, uint height)
|
||||
{
|
||||
uint *dP;
|
||||
uint *bP;
|
||||
// uint *xP;
|
||||
uint inc_bP;
|
||||
|
||||
inc_bP = 1;
|
||||
|
||||
uint Nextline = srcPitch >> 2;
|
||||
|
||||
for (; height!=0; height--) {
|
||||
bP = (uint *) srcPtr;
|
||||
// xP = (uint *) deltaPtr;
|
||||
dP = (uint *)dstPtr;
|
||||
for (uint finish = width; finish!=0; finish -= inc_bP) {
|
||||
uint color4, color5, color6;
|
||||
uint color1, color2, color3;
|
||||
uint colorA1, colorA2, colorB1, colorB2, colorS1, colorS2;
|
||||
uint product1a, product1b, product2a, product2b;
|
||||
|
||||
colorB1 = *(bP - Nextline);
|
||||
colorB2 = *(bP - Nextline + 1);
|
||||
|
||||
color4 = *(bP - 1);
|
||||
color5 = *(bP);
|
||||
color6 = *(bP + 1);
|
||||
colorS2 = *(bP + 2);
|
||||
|
||||
color1 = *(bP + Nextline - 1);
|
||||
color2 = *(bP + Nextline);
|
||||
color3 = *(bP + Nextline + 1);
|
||||
colorS1 = *(bP + Nextline + 2);
|
||||
|
||||
colorA1 = *(bP + Nextline + Nextline);
|
||||
colorA2 = *(bP + Nextline + Nextline + 1);
|
||||
|
||||
// --------------------------------------
|
||||
if (color2 == color6 && color5 != color3) {
|
||||
product1b = product2a = color2;
|
||||
if ((color1 == color2) || (color6 == colorB2)) {
|
||||
product1a = INTERPOLATE (color2, color5);
|
||||
product1a = INTERPOLATE (color2, product1a);
|
||||
// product1a = color2;
|
||||
} else {
|
||||
product1a = INTERPOLATE (color5, color6);
|
||||
}
|
||||
|
||||
if ((color6 == colorS2) || (color2 == colorA1)) {
|
||||
product2b = INTERPOLATE (color2, color3);
|
||||
product2b = INTERPOLATE (color2, product2b);
|
||||
// product2b = color2;
|
||||
} else {
|
||||
product2b = INTERPOLATE (color2, color3);
|
||||
}
|
||||
} else if (color5 == color3 && color2 != color6) {
|
||||
product2b = product1a = color5;
|
||||
|
||||
if ((colorB1 == color5) || (color3 == colorS1)) {
|
||||
product1b = INTERPOLATE (color5, color6);
|
||||
product1b = INTERPOLATE (color5, product1b);
|
||||
// product1b = color5;
|
||||
} else {
|
||||
product1b = INTERPOLATE (color5, color6);
|
||||
}
|
||||
|
||||
if ((color3 == colorA2) || (color4 == color5)) {
|
||||
product2a = INTERPOLATE (color5, color2);
|
||||
product2a = INTERPOLATE (color5, product2a);
|
||||
// product2a = color5;
|
||||
} else {
|
||||
product2a = INTERPOLATE (color2, color3);
|
||||
}
|
||||
|
||||
} else if (color5 == color3 && color2 == color6) {
|
||||
int r = 0;
|
||||
|
||||
r += GetResult (color6, color5, color1, colorA1);
|
||||
r += GetResult (color6, color5, color4, colorB1);
|
||||
r += GetResult (color6, color5, colorA2, colorS1);
|
||||
r += GetResult (color6, color5, colorB2, colorS2);
|
||||
|
||||
if (r > 0) {
|
||||
product1b = product2a = color2;
|
||||
product1a = product2b = INTERPOLATE (color5, color6);
|
||||
} else if (r < 0) {
|
||||
product2b = product1a = color5;
|
||||
product1b = product2a = INTERPOLATE (color5, color6);
|
||||
} else {
|
||||
product2b = product1a = color5;
|
||||
product1b = product2a = color2;
|
||||
}
|
||||
} else {
|
||||
product2b = product1a = INTERPOLATE (color2, color6);
|
||||
product2b =
|
||||
Q_INTERPOLATE (color3, color3, color3, product2b);
|
||||
product1a =
|
||||
Q_INTERPOLATE (color5, color5, color5, product1a);
|
||||
|
||||
product2a = product1b = INTERPOLATE (color5, color3);
|
||||
product2a =
|
||||
Q_INTERPOLATE (color2, color2, color2, product2a);
|
||||
product1b =
|
||||
Q_INTERPOLATE (color6, color6, color6, product1b);
|
||||
|
||||
// product1a = color5;
|
||||
// product1b = color6;
|
||||
// product2a = color2;
|
||||
// product2b = color3;
|
||||
}
|
||||
*(dP) = product1a | 0xFF000000;
|
||||
*(dP+1) = product1b | 0xFF000000;
|
||||
*(dP + (dstPitch >> 2)) = product2a | 0xFF000000;
|
||||
*(dP + (dstPitch >> 2) +1) = product2b | 0xFF000000;
|
||||
// *xP = color5;
|
||||
|
||||
bP += inc_bP;
|
||||
// xP += inc_bP;
|
||||
dP += 2;
|
||||
} // end of for ( finish= width etc..)
|
||||
|
||||
srcPtr += srcPitch;
|
||||
dstPtr += dstPitch * 2;
|
||||
// deltaPtr += srcPitch;
|
||||
} // endof: for (height; height; height--)
|
||||
}
|
||||
|
||||
|
||||
unsafe void Super2xSaI32 (byte *srcPtr, uint srcPitch,
|
||||
byte * deltaPtr , byte *dstPtr, uint dstPitch,
|
||||
uint width, uint height)
|
||||
{
|
||||
uint *bP;
|
||||
uint *dP;
|
||||
uint inc_bP;
|
||||
uint Nextline = srcPitch >> 2;
|
||||
inc_bP = 1;
|
||||
|
||||
for (; height!=0; height--) {
|
||||
bP = (uint *) srcPtr;
|
||||
dP = (uint *) dstPtr;
|
||||
|
||||
for (uint finish = width; finish!=0; finish -= inc_bP) {
|
||||
uint color4, color5, color6;
|
||||
uint color1, color2, color3;
|
||||
uint colorA0, colorA1, colorA2, colorA3,
|
||||
colorB0, colorB1, colorB2, colorB3, colorS1, colorS2;
|
||||
uint product1a, product1b, product2a, product2b;
|
||||
|
||||
//--------------------------------------- B1 B2
|
||||
// 4 5 6 S2
|
||||
// 1 2 3 S1
|
||||
// A1 A2
|
||||
|
||||
colorB0 = *(bP - Nextline - 1);
|
||||
colorB1 = *(bP - Nextline);
|
||||
colorB2 = *(bP - Nextline + 1);
|
||||
colorB3 = *(bP - Nextline + 2);
|
||||
|
||||
color4 = *(bP - 1);
|
||||
color5 = *(bP);
|
||||
color6 = *(bP + 1);
|
||||
colorS2 = *(bP + 2);
|
||||
|
||||
color1 = *(bP + Nextline - 1);
|
||||
color2 = *(bP + Nextline);
|
||||
color3 = *(bP + Nextline + 1);
|
||||
colorS1 = *(bP + Nextline + 2);
|
||||
|
||||
colorA0 = *(bP + Nextline + Nextline - 1);
|
||||
colorA1 = *(bP + Nextline + Nextline);
|
||||
colorA2 = *(bP + Nextline + Nextline + 1);
|
||||
colorA3 = *(bP + Nextline + Nextline + 2);
|
||||
|
||||
//--------------------------------------
|
||||
if (color2 == color6 && color5 != color3) {
|
||||
product2b = product1b = color2;
|
||||
} else if (color5 == color3 && color2 != color6) {
|
||||
product2b = product1b = color5;
|
||||
} else if (color5 == color3 && color2 == color6) {
|
||||
int r = 0;
|
||||
|
||||
r += GetResult (color6, color5, color1, colorA1);
|
||||
r += GetResult (color6, color5, color4, colorB1);
|
||||
r += GetResult (color6, color5, colorA2, colorS1);
|
||||
r += GetResult (color6, color5, colorB2, colorS2);
|
||||
|
||||
if (r > 0)
|
||||
product2b = product1b = color6;
|
||||
else if (r < 0)
|
||||
product2b = product1b = color5;
|
||||
else {
|
||||
product2b = product1b = INTERPOLATE (color5, color6);
|
||||
}
|
||||
} else {
|
||||
if (color6 == color3 && color3 == colorA1
|
||||
&& color2 != colorA2 && color3 != colorA0)
|
||||
product2b =
|
||||
Q_INTERPOLATE (color3, color3, color3, color2);
|
||||
else if (color5 == color2 && color2 == colorA2
|
||||
&& colorA1 != color3 && color2 != colorA3)
|
||||
product2b =
|
||||
Q_INTERPOLATE (color2, color2, color2, color3);
|
||||
else
|
||||
product2b = INTERPOLATE (color2, color3);
|
||||
|
||||
if (color6 == color3 && color6 == colorB1
|
||||
&& color5 != colorB2 && color6 != colorB0)
|
||||
product1b =
|
||||
Q_INTERPOLATE (color6, color6, color6, color5);
|
||||
else if (color5 == color2 && color5 == colorB2
|
||||
&& colorB1 != color6 && color5 != colorB3)
|
||||
product1b =
|
||||
Q_INTERPOLATE (color6, color5, color5, color5);
|
||||
else
|
||||
product1b = INTERPOLATE (color5, color6);
|
||||
}
|
||||
|
||||
if (color5 == color3 && color2 != color6 && color4 == color5
|
||||
&& color5 != colorA2)
|
||||
product2a = INTERPOLATE (color2, color5);
|
||||
else
|
||||
if (color5 == color1 && color6 == color5
|
||||
&& color4 != color2 && color5 != colorA0)
|
||||
product2a = INTERPOLATE (color2, color5);
|
||||
else
|
||||
product2a = color2;
|
||||
|
||||
if (color2 == color6 && color5 != color3 && color1 == color2
|
||||
&& color2 != colorB2)
|
||||
product1a = INTERPOLATE (color2, color5);
|
||||
else
|
||||
if (color4 == color2 && color3 == color2
|
||||
&& color1 != color5 && color2 != colorB0)
|
||||
product1a = INTERPOLATE (color2, color5);
|
||||
else
|
||||
product1a = color5;
|
||||
*(dP) = product1a | 0xFF000000;
|
||||
*(dP + 1) = product1b | 0xFF000000;
|
||||
*(dP + (dstPitch >> 2)) = product2a | 0xFF000000;
|
||||
*(dP + (dstPitch >> 2) + 1) = product2b | 0xFF000000;
|
||||
|
||||
bP += inc_bP;
|
||||
dP += 2;
|
||||
} // end of for ( finish= width etc..)
|
||||
|
||||
srcPtr += srcPitch;
|
||||
dstPtr += dstPitch * 2;
|
||||
// deltaPtr += srcPitch;
|
||||
} // endof: for (; height; height--)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
//what license is this?? who knows??
|
||||
//ref: http://vba-rerecording.googlecode.com/svn/trunk/src/2xsai.cpp
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public class Scanlines2x : IDisplayFilter
|
||||
{
|
||||
public DisplayFilterAnalysisReport Analyze(Size sourceSize)
|
||||
{
|
||||
var ret = new DisplayFilterAnalysisReport();
|
||||
ret.Success = true;
|
||||
ret.OutputSize = new Size(sourceSize.Width * 2, sourceSize.Height * 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public unsafe DisplaySurface Execute(DisplaySurface surface)
|
||||
{
|
||||
int w = surface.Width;
|
||||
int h = surface.Height;
|
||||
var ret = new DisplaySurface(w * 2, h * 2);
|
||||
RunScanlines((byte*)surface.PixelPtr, surface.Stride, (byte*)ret.PixelPtr, ret.Stride, w, h);
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsafe static void RunScanlines(byte* srcPtr, int srcPitch, byte* destPtr, int dstPitch, int width, int height)
|
||||
{
|
||||
int intensity = Global.Config.TargetScanlineFilterIntensity;
|
||||
|
||||
byte* srcLine = srcPtr;
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
byte *s = srcLine;
|
||||
//first copied line (2x width)
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
*destPtr++ = s[0];
|
||||
*destPtr++ = s[1];
|
||||
*destPtr++ = s[2];
|
||||
*destPtr++ = s[3];
|
||||
*destPtr++ = s[0];
|
||||
*destPtr++ = s[1];
|
||||
*destPtr++ = s[2];
|
||||
*destPtr++ = s[3];
|
||||
s += 4;
|
||||
}
|
||||
|
||||
destPtr += dstPitch - width*2 * 4;
|
||||
s = srcLine;
|
||||
//second copied line (2x width, dimmed)
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
*destPtr++ = (byte)((s[0] * intensity) >> 8);
|
||||
*destPtr++ = (byte)((s[1] * intensity) >> 8);
|
||||
*destPtr++ = (byte)((s[2] * intensity) >> 8);
|
||||
*destPtr++ = s[3];
|
||||
*destPtr++ = (byte)((s[0] * intensity) >> 8);
|
||||
*destPtr++ = (byte)((s[1] * intensity) >> 8);
|
||||
*destPtr++ = (byte)((s[2] * intensity) >> 8);
|
||||
*destPtr++ = s[3];
|
||||
s += 4;
|
||||
}
|
||||
srcLine += srcPitch;
|
||||
destPtr += dstPitch - width * 2 * 4;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
partial class ScanlineSlider
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.scanlinetrackbar = new System.Windows.Forms.TrackBar();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.scanlinetrackbar)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// scanlinetrackbar
|
||||
//
|
||||
this.scanlinetrackbar.Location = new System.Drawing.Point(2, 7);
|
||||
this.scanlinetrackbar.Maximum = 100;
|
||||
this.scanlinetrackbar.Name = "scanlinetrackbar";
|
||||
this.scanlinetrackbar.Size = new System.Drawing.Size(207, 45);
|
||||
this.scanlinetrackbar.TabIndex = 0;
|
||||
this.scanlinetrackbar.TickFrequency = 5;
|
||||
this.scanlinetrackbar.TickStyle = System.Windows.Forms.TickStyle.Both;
|
||||
this.scanlinetrackbar.Scroll += new System.EventHandler(this.scanlinetrackbar_Scroll);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(206, 20);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(21, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "0%";
|
||||
//
|
||||
// ScanlineSlider
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(237, 58);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.scanlinetrackbar);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ScanlineSlider";
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Scanline Intensity";
|
||||
this.Load += new System.EventHandler(this.ScanlineSlider_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.scanlinetrackbar)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TrackBar scanlinetrackbar;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class ScanlineSlider : Form
|
||||
{
|
||||
public ScanlineSlider()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void scanlinetrackbar_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
label1.Text = scanlinetrackbar.Value.ToString() + "%";
|
||||
Global.Config.TargetScanlineFilterIntensity = 256 - (256 * scanlinetrackbar.Value / 100);
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void ScanlineSlider_Load(object sender, EventArgs e)
|
||||
{
|
||||
float intensity = (256 - (float)Global.Config.TargetScanlineFilterIntensity) / 256 * 100;
|
||||
scanlinetrackbar.Value = (int)intensity;
|
||||
label1.Text = scanlinetrackbar.Value.ToString() + "%";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -36,7 +36,9 @@
|
|||
this.rbHq2x = new System.Windows.Forms.RadioButton();
|
||||
this.rbScanlines = new System.Windows.Forms.RadioButton();
|
||||
this.rbNone = new System.Windows.Forms.RadioButton();
|
||||
this.tbScanlineIntensity = new System.Windows.Forms.TrackBar();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnCancel
|
||||
|
@ -64,7 +66,7 @@
|
|||
// checkBilinearFilter
|
||||
//
|
||||
this.checkBilinearFilter.AutoSize = true;
|
||||
this.checkBilinearFilter.Location = new System.Drawing.Point(12, 143);
|
||||
this.checkBilinearFilter.Location = new System.Drawing.Point(12, 145);
|
||||
this.checkBilinearFilter.Name = "checkBilinearFilter";
|
||||
this.checkBilinearFilter.Size = new System.Drawing.Size(85, 17);
|
||||
this.checkBilinearFilter.TabIndex = 0;
|
||||
|
@ -82,12 +84,13 @@
|
|||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.tbScanlineIntensity);
|
||||
this.groupBox1.Controls.Add(this.rbNone);
|
||||
this.groupBox1.Controls.Add(this.rbScanlines);
|
||||
this.groupBox1.Controls.Add(this.rbHq2x);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 34);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(200, 92);
|
||||
this.groupBox1.Size = new System.Drawing.Size(200, 105);
|
||||
this.groupBox1.TabIndex = 7;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Filter";
|
||||
|
@ -95,7 +98,7 @@
|
|||
// rbHq2x
|
||||
//
|
||||
this.rbHq2x.AutoSize = true;
|
||||
this.rbHq2x.Location = new System.Drawing.Point(14, 42);
|
||||
this.rbHq2x.Location = new System.Drawing.Point(6, 42);
|
||||
this.rbHq2x.Name = "rbHq2x";
|
||||
this.rbHq2x.Size = new System.Drawing.Size(50, 17);
|
||||
this.rbHq2x.TabIndex = 0;
|
||||
|
@ -106,7 +109,7 @@
|
|||
// rbScanlines
|
||||
//
|
||||
this.rbScanlines.AutoSize = true;
|
||||
this.rbScanlines.Location = new System.Drawing.Point(14, 65);
|
||||
this.rbScanlines.Location = new System.Drawing.Point(6, 65);
|
||||
this.rbScanlines.Name = "rbScanlines";
|
||||
this.rbScanlines.Size = new System.Drawing.Size(71, 17);
|
||||
this.rbScanlines.TabIndex = 1;
|
||||
|
@ -117,7 +120,7 @@
|
|||
// rbNone
|
||||
//
|
||||
this.rbNone.AutoSize = true;
|
||||
this.rbNone.Location = new System.Drawing.Point(14, 19);
|
||||
this.rbNone.Location = new System.Drawing.Point(6, 19);
|
||||
this.rbNone.Name = "rbNone";
|
||||
this.rbNone.Size = new System.Drawing.Size(51, 17);
|
||||
this.rbNone.TabIndex = 2;
|
||||
|
@ -125,6 +128,17 @@
|
|||
this.rbNone.Text = "None";
|
||||
this.rbNone.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tbScanlineIntensity
|
||||
//
|
||||
this.tbScanlineIntensity.LargeChange = 32;
|
||||
this.tbScanlineIntensity.Location = new System.Drawing.Point(83, 55);
|
||||
this.tbScanlineIntensity.Maximum = 255;
|
||||
this.tbScanlineIntensity.Name = "tbScanlineIntensity";
|
||||
this.tbScanlineIntensity.Size = new System.Drawing.Size(70, 42);
|
||||
this.tbScanlineIntensity.TabIndex = 3;
|
||||
this.tbScanlineIntensity.TickFrequency = 32;
|
||||
this.tbScanlineIntensity.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
|
||||
//
|
||||
// DisplayConfigLite
|
||||
//
|
||||
this.AcceptButton = this.btnOk;
|
||||
|
@ -142,6 +156,7 @@
|
|||
this.Text = "Display Configuration";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -157,5 +172,6 @@
|
|||
private System.Windows.Forms.RadioButton rbNone;
|
||||
private System.Windows.Forms.RadioButton rbScanlines;
|
||||
private System.Windows.Forms.RadioButton rbHq2x;
|
||||
private System.Windows.Forms.TrackBar tbScanlineIntensity;
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ namespace BizHawk.Client.EmuHawk.config
|
|||
rbHq2x.Checked = Global.Config.TargetDisplayFilter == 1;
|
||||
rbScanlines.Checked = Global.Config.TargetDisplayFilter == 2;
|
||||
checkBilinearFilter.Checked = Global.Config.DispBlurry;
|
||||
tbScanlineIntensity.Value = Global.Config.TargetScanlineFilterIntensity;
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
|
@ -34,6 +35,7 @@ namespace BizHawk.Client.EmuHawk.config
|
|||
Global.Config.TargetDisplayFilter = 2;
|
||||
|
||||
Global.Config.DispBlurry = checkBilinearFilter.Checked;
|
||||
Global.Config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value;
|
||||
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
Close();
|
||||
|
|
|
@ -36,10 +36,16 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
|||
VertexLayout = null;
|
||||
}
|
||||
|
||||
public void Bind()
|
||||
{
|
||||
//lame...
|
||||
Owner.BindPipeline(Pipeline);
|
||||
}
|
||||
|
||||
public unsafe void Run(Texture2d tex, Size InputSize, Size OutputSize, bool flip)
|
||||
{
|
||||
//ack! make sure to set the pipeline before setting
|
||||
Owner.BindPipeline(Pipeline);
|
||||
Bind();
|
||||
|
||||
Pipeline["InputSize"].Set(new Vector2(InputSize.Width,InputSize.Height));
|
||||
Pipeline["TextureSize"].Set(new Vector2(InputSize.Width, InputSize.Height));
|
||||
|
|
Loading…
Reference in New Issue