diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index b1612eb4a1..74dec50f21 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -254,6 +254,7 @@ namespace BizHawk.Client.Common public bool DispFixAspectRatio = true; public bool DispFixScaleInteger = true; public bool DispFullscreenHacks = true; + public bool DispAutoPrescale = true; public int DispSpeedupFeatures = 2; diff --git a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs index d0faf7c2be..d5c0214f17 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs @@ -26,7 +26,7 @@ namespace BizHawk.Client.EmuHawk { class DisplayManagerRenderTargetProvider : IRenderTargetProvider { - DisplayManagerRenderTargetProvider(Func callback) { Callback = callback; } + public DisplayManagerRenderTargetProvider(Func callback) { Callback = callback; } Func Callback; RenderTarget IRenderTargetProvider.Get(Size size) { @@ -248,13 +248,20 @@ namespace BizHawk.Client.EmuHawk if (Global.Config.DispPrescale != 1) { Filters.PrescaleFilter fPrescale = new Filters.PrescaleFilter() { Scale = Global.Config.DispPrescale }; - chain.AddFilter(fPrescale, "prescale"); + chain.AddFilter(fPrescale, "user_prescale"); } //add user-selected retro shader if (selectedChain != null) AppendRetroShaderChain(chain, "retroShader", selectedChain, selectedChainProperties); + //AutoPrescale makes no sense for a None final filter + if (Global.Config.DispAutoPrescale && Global.Config.DispFinalFilter != (int)Filters.FinalPresentation.eFilterOption.None) + { + var apf = new Filters.AutoPrescaleFilter(); + chain.AddFilter(apf, "auto_prescale"); + } + //choose final filter Filters.FinalPresentation.eFilterOption finalFilter = Filters.FinalPresentation.eFilterOption.None; if (Global.Config.DispFinalFilter == 1) finalFilter = Filters.FinalPresentation.eFilterOption.Bilinear; @@ -672,6 +679,7 @@ namespace BizHawk.Client.EmuHawk fPresent.Config_FixAspectRatio = Global.Config.DispFixAspectRatio; fPresent.Config_FixScaleInteger = Global.Config.DispFixScaleInteger; fPresent.Padding = ClientExtraPadding; + fPresent.AutoPrescale = Global.Config.DispAutoPrescale; fPresent.GL = GL; @@ -699,12 +707,16 @@ namespace BizHawk.Client.EmuHawk //do i need to check this on an intel video card to see if running excessively is a problem? (it used to be in the FinalTarget command below, shouldnt be a problem) //GraphicsControl.Begin(); //CRITICAL POINT for yabause+GL + //TODO - auto-create and age these (and dispose when old) + int rtCounter = 0; + + CurrentFilterProgram.RenderTargetProvider = new DisplayManagerRenderTargetProvider((size) => ShaderChainFrugalizers[rtCounter++].Get(size)); + GlobalWin.GL.BeginScene(); //run filter chain Texture2d texCurr = null; RenderTarget rtCurr = null; - int rtCounter = 0; bool inFinalTarget = false; foreach (var step in CurrentFilterProgram.Program) { diff --git a/BizHawk.Client.EmuHawk/DisplayManager/FilterManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/FilterManager.cs index 9129e06001..e8a23765bb 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/FilterManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/FilterManager.cs @@ -74,6 +74,11 @@ namespace BizHawk.Client.EmuHawk.FilterManager public IRenderTargetProvider RenderTargetProvider; public RenderTarget GetRenderTarget(string channel = "default") { return CurrRenderTarget; } public RenderTarget CurrRenderTarget; + + public RenderTarget GetTempTarget(int width, int height) + { + return RenderTargetProvider.Get(new Size(width, height)); + } public void AddFilter(BaseFilter filter, string name = "") { @@ -184,6 +189,11 @@ namespace BizHawk.Client.EmuHawk.FilterManager iosi.SurfaceFormat = currState.SurfaceFormat; f.SetInputFormat(channel, currState); + if (f.IsNOP) + { + continue; + } + //check if the desired disposition needs to change from texture to render target //(if so, insert a render filter) if (iosi.SurfaceDisposition == SurfaceDisposition.RenderTarget && currState.SurfaceDisposition == SurfaceDisposition.Texture) diff --git a/BizHawk.Client.EmuHawk/DisplayManager/Filters/BaseFilter.cs b/BizHawk.Client.EmuHawk/DisplayManager/Filters/BaseFilter.cs index 2653b1a84a..8b6b4de1f9 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/Filters/BaseFilter.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/Filters/BaseFilter.cs @@ -37,6 +37,8 @@ namespace BizHawk.Client.EmuHawk.Filters public virtual Size PresizeOutput(string channel, Size size) { return size; } public virtual void SetInputFormat(string channel, SurfaceState state) { } //TODO - why a different param order than DeclareOutput? public Dictionary Parameters = new Dictionary(); + public bool IsNOP { get { return _IsNop; } protected set { _IsNop = value; } } + private Boolean _IsNop = false; //runtime signals public virtual Vector2 UntransformPoint(string channel, Vector2 point) @@ -87,6 +89,8 @@ namespace BizHawk.Client.EmuHawk.Filters protected IOSurfaceInfo DeclareOutput(SurfaceDisposition disposition = SurfaceDisposition.Unspecified, string channel = "default") { return DeclareIO(SurfaceDirection.Output, channel, disposition); } //TODO - why a different param order than DeclareOutput? + protected RenderTarget GetTempTarget(int width, int height) { return FilterProgram.GetTempTarget(width, height); } + protected IOSurfaceInfo DeclareOutput(SurfaceState state, string channel = "default") { var iosi = DeclareIO(SurfaceDirection.Output, channel, state.SurfaceDisposition); diff --git a/BizHawk.Client.EmuHawk/DisplayManager/Filters/Gui.cs b/BizHawk.Client.EmuHawk/DisplayManager/Filters/Gui.cs index af8410d21b..b7325baff0 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/Filters/Gui.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/Filters/Gui.cs @@ -134,8 +134,11 @@ namespace BizHawk.Client.EmuHawk.Filters PS = trials[bestIndex]; } - vw = (int)(PS.X * oldSourceWidth); - vh = (int)(PS.Y * oldSourceHeight); + //"fix problems with gameextrapadding in >1x window scales" (other edits were made, maybe theyre whats important) + //vw = (int)(PS.X * oldSourceWidth); + //vh = (int)(PS.Y * oldSourceHeight); + vw = (int)(PS.X * sourceWidth); + vh = (int)(PS.Y * sourceHeight); widthScale = PS.X; heightScale = PS.Y; } @@ -186,6 +189,7 @@ namespace BizHawk.Client.EmuHawk.Filters Size OutputSize, InputSize; public Size TextureSize, VirtualTextureSize; public int BackgroundColor; + public bool AutoPrescale; public IGuiRenderer GuiRenderer; public bool Flip; public IGL GL; @@ -283,6 +287,9 @@ namespace BizHawk.Client.EmuHawk.Filters LL.vy += Padding.Top; } ContentSize = new Size(LL.vw,LL.vh); + + if (InputSize == ContentSize) + IsNOP = true; } public Size GetContentSize() { return ContentSize; } @@ -319,7 +326,7 @@ namespace BizHawk.Client.EmuHawk.Filters GuiRenderer.Begin(OutputSize.Width, OutputSize.Height); GuiRenderer.SetBlendState(GL.BlendNoneCopy); - + if(FilterOption != eFilterOption.None) InputTexture.SetFilterLinear(); else @@ -327,9 +334,9 @@ namespace BizHawk.Client.EmuHawk.Filters if (FilterOption == eFilterOption.Bicubic) { + //this was handled earlier by another filter } - GuiRenderer.Modelview.Translate(LL.vx, LL.vy); if (Flip) { @@ -372,6 +379,61 @@ namespace BizHawk.Client.EmuHawk.Filters } } + public class AutoPrescaleFilter : BaseFilter + { + Size OutputSize, InputSize; + int XIS, YIS; + + public override void Initialize() + { + DeclareInput(SurfaceDisposition.Texture); + } + + public override void SetInputFormat(string channel, SurfaceState state) + { + //calculate integer scaling factors + XIS = OutputSize.Width / state.SurfaceFormat.Size.Width; + YIS = OutputSize.Height / state.SurfaceFormat.Size.Height; + + OutputSize = state.SurfaceFormat.Size; + + if (XIS <= 1 && YIS <= 1) + { + IsNOP = true; + } + else + { + OutputSize.Width *= XIS; + OutputSize.Height *= YIS; + } + + var outState = new SurfaceState(); + outState.SurfaceFormat = new SurfaceFormat(OutputSize); + outState.SurfaceDisposition = SurfaceDisposition.RenderTarget; + DeclareOutput(outState); + } + + public override Size PresizeOutput(string channel, Size size) + { + OutputSize = size; + return base.PresizeOutput(channel, size); + } + + public override Size PresizeInput(string channel, Size insize) + { + InputSize = insize; + return insize; + } + public override void Run() + { + FilterProgram.GuiRenderer.Begin(OutputSize); //hope this didnt change + FilterProgram.GuiRenderer.SetBlendState(FilterProgram.GL.BlendNoneCopy); + FilterProgram.GuiRenderer.Modelview.Scale(XIS,YIS); + FilterProgram.GuiRenderer.Draw(InputTexture); + FilterProgram.GuiRenderer.End(); + } + } + public class LuaLayer : BaseFilter { public override void Initialize() diff --git a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs index 5dbf563831..83ba59c60b 100644 --- a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.Designer.cs @@ -36,7 +36,6 @@ this.lblUserFilterName = new System.Windows.Forms.Label(); this.btnSelectUserFilter = new System.Windows.Forms.Button(); this.rbUser = new System.Windows.Forms.RadioButton(); - this.tbScanlineIntensity = new BizHawk.Client.EmuHawk.TransparentTrackBar(); this.rbNone = new System.Windows.Forms.RadioButton(); this.rbScanlines = new System.Windows.Forms.RadioButton(); this.rbHq2x = new System.Windows.Forms.RadioButton(); @@ -92,11 +91,12 @@ this.cbStatusBarWindowed = new System.Windows.Forms.CheckBox(); this.label9 = new System.Windows.Forms.Label(); this.cbMenuWindowed = new System.Windows.Forms.CheckBox(); - this.trackbarFrameSizeWindowed = new BizHawk.Client.EmuHawk.TransparentTrackBar(); this.cbCaptionWindowed = new System.Windows.Forms.CheckBox(); this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.cbAutoPrescale = new System.Windows.Forms.CheckBox(); + this.tbScanlineIntensity = new BizHawk.Client.EmuHawk.TransparentTrackBar(); + this.trackbarFrameSizeWindowed = new BizHawk.Client.EmuHawk.TransparentTrackBar(); this.groupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit(); this.grpFinalFilter.SuspendLayout(); this.grpARSelection.SuspendLayout(); this.tabControl1.SuspendLayout(); @@ -109,6 +109,7 @@ this.tabPage1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackbarFrameSizeWindowed)).BeginInit(); this.SuspendLayout(); // @@ -116,7 +117,7 @@ // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(360, 404); + this.btnCancel.Location = new System.Drawing.Point(473, 339); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 5; @@ -126,7 +127,7 @@ // btnOk // this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnOk.Location = new System.Drawing.Point(279, 404); + this.btnOk.Location = new System.Drawing.Point(392, 339); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(75, 23); this.btnOk.TabIndex = 4; @@ -144,7 +145,7 @@ 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(6, 6); + this.groupBox1.Location = new System.Drawing.Point(6, 33); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(193, 132); this.groupBox1.TabIndex = 7; @@ -190,19 +191,6 @@ this.rbUser.Text = "User"; this.rbUser.UseVisualStyleBackColor = true; // - // tbScanlineIntensity - // - this.tbScanlineIntensity.LargeChange = 32; - this.tbScanlineIntensity.Location = new System.Drawing.Point(83, 55); - this.tbScanlineIntensity.Maximum = 256; - 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; - this.tbScanlineIntensity.Scroll += new System.EventHandler(this.tbScanlineIntensity_Scroll); - this.tbScanlineIntensity.ValueChanged += new System.EventHandler(this.tbScanlineIntensity_Scroll); - // // rbNone // this.rbNone.AutoSize = true; @@ -239,7 +227,7 @@ // checkLetterbox // this.checkLetterbox.AutoSize = true; - this.checkLetterbox.Location = new System.Drawing.Point(6, 148); + this.checkLetterbox.Location = new System.Drawing.Point(209, 12); this.checkLetterbox.Name = "checkLetterbox"; this.checkLetterbox.Size = new System.Drawing.Size(173, 17); this.checkLetterbox.TabIndex = 8; @@ -250,7 +238,7 @@ // checkPadInteger // this.checkPadInteger.AutoSize = true; - this.checkPadInteger.Location = new System.Drawing.Point(15, 307); + this.checkPadInteger.Location = new System.Drawing.Point(218, 171); this.checkPadInteger.Name = "checkPadInteger"; this.checkPadInteger.Size = new System.Drawing.Size(250, 17); this.checkPadInteger.TabIndex = 9; @@ -263,9 +251,9 @@ this.grpFinalFilter.Controls.Add(this.rbFinalFilterBicubic); this.grpFinalFilter.Controls.Add(this.rbFinalFilterNone); this.grpFinalFilter.Controls.Add(this.rbFinalFilterBilinear); - this.grpFinalFilter.Location = new System.Drawing.Point(205, 6); + this.grpFinalFilter.Location = new System.Drawing.Point(6, 194); this.grpFinalFilter.Name = "grpFinalFilter"; - this.grpFinalFilter.Size = new System.Drawing.Size(187, 97); + this.grpFinalFilter.Size = new System.Drawing.Size(187, 90); this.grpFinalFilter.TabIndex = 8; this.grpFinalFilter.TabStop = false; this.grpFinalFilter.Text = "Final Filter"; @@ -273,7 +261,7 @@ // rbFinalFilterBicubic // this.rbFinalFilterBicubic.AutoSize = true; - this.rbFinalFilterBicubic.Location = new System.Drawing.Point(6, 65); + this.rbFinalFilterBicubic.Location = new System.Drawing.Point(6, 64); this.rbFinalFilterBicubic.Name = "rbFinalFilterBicubic"; this.rbFinalFilterBicubic.Size = new System.Drawing.Size(142, 17); this.rbFinalFilterBicubic.TabIndex = 3; @@ -284,7 +272,7 @@ // rbFinalFilterNone // this.rbFinalFilterNone.AutoSize = true; - this.rbFinalFilterNone.Location = new System.Drawing.Point(6, 19); + this.rbFinalFilterNone.Location = new System.Drawing.Point(6, 18); this.rbFinalFilterNone.Name = "rbFinalFilterNone"; this.rbFinalFilterNone.Size = new System.Drawing.Size(51, 17); this.rbFinalFilterNone.TabIndex = 2; @@ -295,7 +283,7 @@ // rbFinalFilterBilinear // this.rbFinalFilterBilinear.AutoSize = true; - this.rbFinalFilterBilinear.Location = new System.Drawing.Point(6, 42); + this.rbFinalFilterBilinear.Location = new System.Drawing.Point(6, 41); this.rbFinalFilterBilinear.Name = "rbFinalFilterBilinear"; this.rbFinalFilterBilinear.Size = new System.Drawing.Size(59, 17); this.rbFinalFilterBilinear.TabIndex = 0; @@ -318,7 +306,7 @@ // rbUseSystem // this.rbUseSystem.AutoSize = true; - this.rbUseSystem.Location = new System.Drawing.Point(26, 58); + this.rbUseSystem.Location = new System.Drawing.Point(16, 58); this.rbUseSystem.Name = "rbUseSystem"; this.rbUseSystem.Size = new System.Drawing.Size(167, 17); this.rbUseSystem.TabIndex = 12; @@ -340,16 +328,16 @@ this.grpARSelection.Controls.Add(this.rbUseCustom); this.grpARSelection.Controls.Add(this.rbUseRaw); this.grpARSelection.Controls.Add(this.rbUseSystem); - this.grpARSelection.Location = new System.Drawing.Point(15, 171); + this.grpARSelection.Location = new System.Drawing.Point(218, 35); this.grpARSelection.Name = "grpARSelection"; - this.grpARSelection.Size = new System.Drawing.Size(377, 130); + this.grpARSelection.Size = new System.Drawing.Size(302, 130); this.grpARSelection.TabIndex = 13; this.grpARSelection.TabStop = false; this.grpARSelection.Text = "Aspect Ratio Selection"; // // txtCustomARY // - this.txtCustomARY.Location = new System.Drawing.Point(230, 102); + this.txtCustomARY.Location = new System.Drawing.Point(220, 102); this.txtCustomARY.Name = "txtCustomARY"; this.txtCustomARY.Size = new System.Drawing.Size(72, 20); this.txtCustomARY.TabIndex = 19; @@ -357,7 +345,7 @@ // label12 // this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(212, 107); + this.label12.Location = new System.Drawing.Point(202, 107); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(10, 13); this.label12.TabIndex = 17; @@ -365,7 +353,7 @@ // // txtCustomARX // - this.txtCustomARX.Location = new System.Drawing.Point(134, 102); + this.txtCustomARX.Location = new System.Drawing.Point(124, 102); this.txtCustomARX.Name = "txtCustomARX"; this.txtCustomARX.Size = new System.Drawing.Size(72, 20); this.txtCustomARX.TabIndex = 18; @@ -373,7 +361,7 @@ // rbUseCustomRatio // this.rbUseCustomRatio.AutoSize = true; - this.rbUseCustomRatio.Location = new System.Drawing.Point(26, 103); + this.rbUseCustomRatio.Location = new System.Drawing.Point(16, 103); this.rbUseCustomRatio.Name = "rbUseCustomRatio"; this.rbUseCustomRatio.Size = new System.Drawing.Size(102, 17); this.rbUseCustomRatio.TabIndex = 16; @@ -384,7 +372,7 @@ // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(23, 41); + this.label4.Location = new System.Drawing.Point(13, 41); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(257, 13); this.label4.TabIndex = 12; @@ -392,7 +380,7 @@ // // txtCustomARHeight // - this.txtCustomARHeight.Location = new System.Drawing.Point(230, 79); + this.txtCustomARHeight.Location = new System.Drawing.Point(220, 79); this.txtCustomARHeight.Name = "txtCustomARHeight"; this.txtCustomARHeight.Size = new System.Drawing.Size(72, 20); this.txtCustomARHeight.TabIndex = 15; @@ -400,7 +388,7 @@ // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(212, 84); + this.label3.Location = new System.Drawing.Point(202, 84); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(12, 13); this.label3.TabIndex = 12; @@ -408,7 +396,7 @@ // // txtCustomARWidth // - this.txtCustomARWidth.Location = new System.Drawing.Point(134, 79); + this.txtCustomARWidth.Location = new System.Drawing.Point(124, 79); this.txtCustomARWidth.Name = "txtCustomARWidth"; this.txtCustomARWidth.Size = new System.Drawing.Size(72, 20); this.txtCustomARWidth.TabIndex = 14; @@ -416,7 +404,7 @@ // rbUseCustom // this.rbUseCustom.AutoSize = true; - this.rbUseCustom.Location = new System.Drawing.Point(26, 80); + this.rbUseCustom.Location = new System.Drawing.Point(16, 80); this.rbUseCustom.Name = "rbUseCustom"; this.rbUseCustom.Size = new System.Drawing.Size(105, 17); this.rbUseCustom.TabIndex = 13; @@ -426,7 +414,7 @@ // // label2 // - this.label2.Location = new System.Drawing.Point(3, 125); + this.label2.Location = new System.Drawing.Point(6, 128); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(398, 27); this.label2.TabIndex = 17; @@ -436,7 +424,7 @@ // checkSnowyNullEmulator // this.checkSnowyNullEmulator.AutoSize = true; - this.checkSnowyNullEmulator.Location = new System.Drawing.Point(3, 105); + this.checkSnowyNullEmulator.Location = new System.Drawing.Point(6, 108); this.checkSnowyNullEmulator.Name = "checkSnowyNullEmulator"; this.checkSnowyNullEmulator.Size = new System.Drawing.Size(159, 17); this.checkSnowyNullEmulator.TabIndex = 16; @@ -447,7 +435,7 @@ // this.rbOpenGL.AutoSize = true; this.rbOpenGL.Checked = true; - this.rbOpenGL.Location = new System.Drawing.Point(6, 80); + this.rbOpenGL.Location = new System.Drawing.Point(6, 73); this.rbOpenGL.Name = "rbOpenGL"; this.rbOpenGL.Size = new System.Drawing.Size(65, 17); this.rbOpenGL.TabIndex = 3; @@ -457,7 +445,7 @@ // // label5 // - this.label5.Location = new System.Drawing.Point(21, 100); + this.label5.Location = new System.Drawing.Point(21, 93); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(359, 47); this.label5.TabIndex = 16; @@ -476,23 +464,24 @@ this.tabControl1.Location = new System.Drawing.Point(12, 12); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(423, 382); + this.tabControl1.Size = new System.Drawing.Size(536, 317); this.tabControl1.TabIndex = 17; // // tpAR // + this.tpAR.Controls.Add(this.cbAutoPrescale); this.tpAR.Controls.Add(this.label11); - this.tpAR.Controls.Add(this.label10); - this.tpAR.Controls.Add(this.nudPrescale); this.tpAR.Controls.Add(this.groupBox1); + this.tpAR.Controls.Add(this.label10); this.tpAR.Controls.Add(this.checkLetterbox); + this.tpAR.Controls.Add(this.nudPrescale); this.tpAR.Controls.Add(this.checkPadInteger); this.tpAR.Controls.Add(this.grpARSelection); this.tpAR.Controls.Add(this.grpFinalFilter); this.tpAR.Location = new System.Drawing.Point(4, 22); this.tpAR.Name = "tpAR"; this.tpAR.Padding = new System.Windows.Forms.Padding(3); - this.tpAR.Size = new System.Drawing.Size(415, 356); + this.tpAR.Size = new System.Drawing.Size(528, 291); this.tpAR.TabIndex = 0; this.tpAR.Text = "Scaling & Filtering"; this.tpAR.UseVisualStyleBackColor = true; @@ -500,7 +489,7 @@ // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(307, 117); + this.label11.Location = new System.Drawing.Point(140, 11); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(14, 13); this.label11.TabIndex = 16; @@ -509,15 +498,15 @@ // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(208, 116); + this.label10.Location = new System.Drawing.Point(7, 11); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(51, 13); + this.label10.Size = new System.Drawing.Size(76, 13); this.label10.TabIndex = 15; - this.label10.Text = "Prescale:"; + this.label10.Text = "User Prescale:"; // // nudPrescale // - this.nudPrescale.Location = new System.Drawing.Point(260, 113); + this.nudPrescale.Location = new System.Drawing.Point(93, 7); this.nudPrescale.Maximum = new decimal(new int[] { 16, 0, @@ -543,14 +532,14 @@ this.tpDispMethod.Controls.Add(this.groupBox3); this.tpDispMethod.Location = new System.Drawing.Point(4, 22); this.tpDispMethod.Name = "tpDispMethod"; - this.tpDispMethod.Size = new System.Drawing.Size(415, 356); + this.tpDispMethod.Size = new System.Drawing.Size(528, 291); this.tpDispMethod.TabIndex = 2; this.tpDispMethod.Text = "Display Method"; this.tpDispMethod.UseVisualStyleBackColor = true; // // label6 // - this.label6.Location = new System.Drawing.Point(3, 227); + this.label6.Location = new System.Drawing.Point(5, 229); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(359, 47); this.label6.TabIndex = 18; @@ -564,7 +553,7 @@ this.groupBox3.Controls.Add(this.rbGDIPlus); this.groupBox3.Controls.Add(this.label5); this.groupBox3.Controls.Add(this.rbOpenGL); - this.groupBox3.Location = new System.Drawing.Point(4, 3); + this.groupBox3.Location = new System.Drawing.Point(6, 5); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(389, 221); this.groupBox3.TabIndex = 16; @@ -619,7 +608,7 @@ this.tpMisc.Controls.Add(this.checkSnowyNullEmulator); this.tpMisc.Location = new System.Drawing.Point(4, 22); this.tpMisc.Name = "tpMisc"; - this.tpMisc.Size = new System.Drawing.Size(415, 356); + this.tpMisc.Size = new System.Drawing.Size(528, 291); this.tpMisc.TabIndex = 3; this.tpMisc.Text = "Misc"; this.tpMisc.UseVisualStyleBackColor = true; @@ -629,7 +618,7 @@ this.groupBox5.Controls.Add(this.rbDisplayAbsoluteZero); this.groupBox5.Controls.Add(this.rbDisplayMinimal); this.groupBox5.Controls.Add(this.rbDisplayFull); - this.groupBox5.Location = new System.Drawing.Point(3, 3); + this.groupBox5.Location = new System.Drawing.Point(6, 6); this.groupBox5.Name = "groupBox5"; this.groupBox5.Size = new System.Drawing.Size(371, 96); this.groupBox5.TabIndex = 20; @@ -678,7 +667,7 @@ this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(415, 356); + this.tabPage1.Size = new System.Drawing.Size(528, 291); this.tabPage1.TabIndex = 4; this.tabPage1.Text = "Window"; this.tabPage1.UseVisualStyleBackColor = true; @@ -808,17 +797,6 @@ this.cbMenuWindowed.Text = "Menu"; this.cbMenuWindowed.UseVisualStyleBackColor = true; // - // trackbarFrameSizeWindowed - // - this.trackbarFrameSizeWindowed.LargeChange = 1; - this.trackbarFrameSizeWindowed.Location = new System.Drawing.Point(6, 33); - this.trackbarFrameSizeWindowed.Maximum = 2; - this.trackbarFrameSizeWindowed.Name = "trackbarFrameSizeWindowed"; - this.trackbarFrameSizeWindowed.Size = new System.Drawing.Size(99, 42); - this.trackbarFrameSizeWindowed.TabIndex = 21; - this.trackbarFrameSizeWindowed.Value = 1; - this.trackbarFrameSizeWindowed.ValueChanged += new System.EventHandler(this.trackbarFrameSizeWindowed_ValueChanged); - // // cbCaptionWindowed // this.cbCaptionWindowed.AutoSize = true; @@ -840,13 +818,47 @@ this.linkLabel1.Text = "Documentation"; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // + // cbAutoPrescale + // + this.cbAutoPrescale.AutoSize = true; + this.cbAutoPrescale.Location = new System.Drawing.Point(6, 171); + this.cbAutoPrescale.Name = "cbAutoPrescale"; + this.cbAutoPrescale.Size = new System.Drawing.Size(92, 17); + this.cbAutoPrescale.TabIndex = 17; + this.cbAutoPrescale.Text = "Auto Prescale"; + this.cbAutoPrescale.UseVisualStyleBackColor = true; + // + // tbScanlineIntensity + // + this.tbScanlineIntensity.LargeChange = 32; + this.tbScanlineIntensity.Location = new System.Drawing.Point(83, 55); + this.tbScanlineIntensity.Maximum = 256; + 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; + this.tbScanlineIntensity.Scroll += new System.EventHandler(this.tbScanlineIntensity_Scroll); + this.tbScanlineIntensity.ValueChanged += new System.EventHandler(this.tbScanlineIntensity_Scroll); + // + // trackbarFrameSizeWindowed + // + this.trackbarFrameSizeWindowed.LargeChange = 1; + this.trackbarFrameSizeWindowed.Location = new System.Drawing.Point(6, 33); + this.trackbarFrameSizeWindowed.Maximum = 2; + this.trackbarFrameSizeWindowed.Name = "trackbarFrameSizeWindowed"; + this.trackbarFrameSizeWindowed.Size = new System.Drawing.Size(99, 42); + this.trackbarFrameSizeWindowed.TabIndex = 21; + this.trackbarFrameSizeWindowed.Value = 1; + this.trackbarFrameSizeWindowed.ValueChanged += new System.EventHandler(this.trackbarFrameSizeWindowed_ValueChanged); + // // DisplayConfigLite // this.AcceptButton = this.btnOk; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(451, 439); + this.ClientSize = new System.Drawing.Size(564, 374); this.Controls.Add(this.linkLabel1); this.Controls.Add(this.tabControl1); this.Controls.Add(this.btnCancel); @@ -857,7 +869,6 @@ this.Text = "Display Configuration"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit(); this.grpFinalFilter.ResumeLayout(false); this.grpFinalFilter.PerformLayout(); this.grpARSelection.ResumeLayout(false); @@ -879,6 +890,7 @@ this.groupBox4.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackbarFrameSizeWindowed)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -953,5 +965,6 @@ private System.Windows.Forms.TextBox txtCustomARY; private System.Windows.Forms.Label label12; private System.Windows.Forms.TextBox txtCustomARX; + private System.Windows.Forms.CheckBox cbAutoPrescale; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs index b217fcbe27..8e7e42d29b 100644 --- a/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs +++ b/BizHawk.Client.EmuHawk/config/DisplayConfigLite.cs @@ -38,6 +38,7 @@ namespace BizHawk.Client.EmuHawk.config checkLetterbox.Checked = Global.Config.DispFixAspectRatio; checkPadInteger.Checked = Global.Config.DispFixScaleInteger; cbFullscreenHacks.Checked = Global.Config.DispFullscreenHacks; + cbAutoPrescale.Checked = Global.Config.DispAutoPrescale; if (Global.Config.DispSpeedupFeatures == 2) rbDisplayFull.Checked = true; if (Global.Config.DispSpeedupFeatures == 1) rbDisplayMinimal.Checked = true; @@ -115,6 +116,7 @@ namespace BizHawk.Client.EmuHawk.config Global.Config.DispFixAspectRatio = checkLetterbox.Checked; Global.Config.DispFixScaleInteger = checkPadInteger.Checked; Global.Config.DispFullscreenHacks = cbFullscreenHacks.Checked; + Global.Config.DispAutoPrescale = cbAutoPrescale.Checked; Global.Config.DispChrome_StatusBarWindowed = cbStatusBarWindowed.Checked; Global.Config.DispChrome_CaptionWindowed = cbCaptionWindowed.Checked;