From b83c99c857edc6612bd7e9841518a8ec3e0b56b6 Mon Sep 17 00:00:00 2001 From: feos Date: Sat, 15 Sep 2018 20:30:19 +0300 Subject: [PATCH] gliden64: wire up overscan, but disable the ui option, because it somehow refuses to work --- .../N64/N64VideoPluginconfig.Designer.cs | 190 ++++++++++++++++++ .../config/N64/N64VideoPluginconfig.cs | 60 ++++++ .../Nintendo/N64/N64SyncSettings.GLideN64.cs | 54 +++++ 3 files changed, 304 insertions(+) diff --git a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs index e0cc7d6a36..1218ed5ab1 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs @@ -364,6 +364,23 @@ this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.GLideN64_ShowInternalResolution = new System.Windows.Forms.CheckBox(); this.GLideN64_ShowRenderingResolution = new System.Windows.Forms.CheckBox(); + this.GLideN64_EnableOverscan = new System.Windows.Forms.CheckBox(); + this.label90 = new System.Windows.Forms.Label(); + this.label91 = new System.Windows.Forms.Label(); + this.label92 = new System.Windows.Forms.Label(); + this.label93 = new System.Windows.Forms.Label(); + this.GLideN64_OverscanNtscTop = new System.Windows.Forms.TextBox(); + this.GLideN64_OverscanNtscBottom = new System.Windows.Forms.TextBox(); + this.GLideN64_OverscanNtscLeft = new System.Windows.Forms.TextBox(); + this.GLideN64_OverscanNtscRight = new System.Windows.Forms.TextBox(); + this.label94 = new System.Windows.Forms.Label(); + this.label95 = new System.Windows.Forms.Label(); + this.label96 = new System.Windows.Forms.Label(); + this.label97 = new System.Windows.Forms.Label(); + this.GLideN64_OverscanPalTop = new System.Windows.Forms.TextBox(); + this.GLideN64_OverscanPalBottom = new System.Windows.Forms.TextBox(); + this.GLideN64_OverscanPalLeft = new System.Windows.Forms.TextBox(); + this.GLideN64_OverscanPalRight = new System.Windows.Forms.TextBox(); this.N64plugintabcontrol.SuspendLayout(); this.N64vpluginglobaltab.SuspendLayout(); this.GLideN64Tab.SuspendLayout(); @@ -1251,6 +1268,23 @@ // // tabPage7 // + this.tabPage7.Controls.Add(this.GLideN64_OverscanPalRight); + this.tabPage7.Controls.Add(this.GLideN64_OverscanNtscRight); + this.tabPage7.Controls.Add(this.GLideN64_OverscanPalLeft); + this.tabPage7.Controls.Add(this.GLideN64_OverscanNtscLeft); + this.tabPage7.Controls.Add(this.GLideN64_OverscanPalBottom); + this.tabPage7.Controls.Add(this.GLideN64_OverscanNtscBottom); + this.tabPage7.Controls.Add(this.GLideN64_OverscanPalTop); + this.tabPage7.Controls.Add(this.label97); + this.tabPage7.Controls.Add(this.GLideN64_OverscanNtscTop); + this.tabPage7.Controls.Add(this.label96); + this.tabPage7.Controls.Add(this.label93); + this.tabPage7.Controls.Add(this.label95); + this.tabPage7.Controls.Add(this.label92); + this.tabPage7.Controls.Add(this.label94); + this.tabPage7.Controls.Add(this.label91); + this.tabPage7.Controls.Add(this.label90); + this.tabPage7.Controls.Add(this.GLideN64_EnableOverscan); this.tabPage7.Controls.Add(this.label89); this.tabPage7.Controls.Add(this.GLideN64_UseNativeResolutionFactor); this.tabPage7.Controls.Add(this.GLideN64_DisableFBInfo); @@ -4418,6 +4452,145 @@ this.GLideN64_ShowRenderingResolution.Text = "Show Rendering Resolution"; this.GLideN64_ShowRenderingResolution.UseVisualStyleBackColor = true; // + // GLideN64_EnableOverscan + // + this.GLideN64_EnableOverscan.AutoSize = true; + this.GLideN64_EnableOverscan.Location = new System.Drawing.Point(293, 171); + this.GLideN64_EnableOverscan.Name = "GLideN64_EnableOverscan"; + this.GLideN64_EnableOverscan.Size = new System.Drawing.Size(108, 17); + this.GLideN64_EnableOverscan.TabIndex = 79; + this.GLideN64_EnableOverscan.Text = "Enable Overscan"; + this.GLideN64_EnableOverscan.UseVisualStyleBackColor = true; + this.GLideN64_EnableOverscan.CheckedChanged += new System.EventHandler(this.GLideN64_EnableOverscan_CheckedChanged); + // + // label90 + // + this.label90.AutoSize = true; + this.label90.Location = new System.Drawing.Point(290, 201); + this.label90.Name = "label90"; + this.label90.Size = new System.Drawing.Size(58, 13); + this.label90.TabIndex = 80; + this.label90.Text = "NTSC Top"; + // + // label91 + // + this.label91.AutoSize = true; + this.label91.Location = new System.Drawing.Point(290, 224); + this.label91.Name = "label91"; + this.label91.Size = new System.Drawing.Size(72, 13); + this.label91.TabIndex = 81; + this.label91.Text = "NTSC Bottom"; + // + // label92 + // + this.label92.AutoSize = true; + this.label92.Location = new System.Drawing.Point(290, 247); + this.label92.Name = "label92"; + this.label92.Size = new System.Drawing.Size(57, 13); + this.label92.TabIndex = 82; + this.label92.Text = "NTSC Left"; + // + // label93 + // + this.label93.AutoSize = true; + this.label93.Location = new System.Drawing.Point(290, 269); + this.label93.Name = "label93"; + this.label93.Size = new System.Drawing.Size(64, 13); + this.label93.TabIndex = 83; + this.label93.Text = "NTSC Right"; + // + // GLideN64_OverscanNtscTop + // + this.GLideN64_OverscanNtscTop.Location = new System.Drawing.Point(368, 198); + this.GLideN64_OverscanNtscTop.Name = "GLideN64_OverscanNtscTop"; + this.GLideN64_OverscanNtscTop.Size = new System.Drawing.Size(42, 20); + this.GLideN64_OverscanNtscTop.TabIndex = 84; + // + // GLideN64_OverscanNtscBottom + // + this.GLideN64_OverscanNtscBottom.Location = new System.Drawing.Point(368, 221); + this.GLideN64_OverscanNtscBottom.Name = "GLideN64_OverscanNtscBottom"; + this.GLideN64_OverscanNtscBottom.Size = new System.Drawing.Size(42, 20); + this.GLideN64_OverscanNtscBottom.TabIndex = 85; + // + // GLideN64_OverscanNtscLeft + // + this.GLideN64_OverscanNtscLeft.Location = new System.Drawing.Point(368, 244); + this.GLideN64_OverscanNtscLeft.Name = "GLideN64_OverscanNtscLeft"; + this.GLideN64_OverscanNtscLeft.Size = new System.Drawing.Size(42, 20); + this.GLideN64_OverscanNtscLeft.TabIndex = 86; + // + // GLideN64_OverscanNtscRight + // + this.GLideN64_OverscanNtscRight.Location = new System.Drawing.Point(368, 266); + this.GLideN64_OverscanNtscRight.Name = "GLideN64_OverscanNtscRight"; + this.GLideN64_OverscanNtscRight.Size = new System.Drawing.Size(42, 20); + this.GLideN64_OverscanNtscRight.TabIndex = 87; + // + // label94 + // + this.label94.AutoSize = true; + this.label94.Location = new System.Drawing.Point(448, 201); + this.label94.Name = "label94"; + this.label94.Size = new System.Drawing.Size(49, 13); + this.label94.TabIndex = 80; + this.label94.Text = "PAL Top"; + // + // label95 + // + this.label95.AutoSize = true; + this.label95.Location = new System.Drawing.Point(448, 224); + this.label95.Name = "label95"; + this.label95.Size = new System.Drawing.Size(63, 13); + this.label95.TabIndex = 81; + this.label95.Text = "PAL Bottom"; + // + // label96 + // + this.label96.AutoSize = true; + this.label96.Location = new System.Drawing.Point(448, 247); + this.label96.Name = "label96"; + this.label96.Size = new System.Drawing.Size(48, 13); + this.label96.TabIndex = 82; + this.label96.Text = "PAL Left"; + // + // label97 + // + this.label97.AutoSize = true; + this.label97.Location = new System.Drawing.Point(448, 269); + this.label97.Name = "label97"; + this.label97.Size = new System.Drawing.Size(55, 13); + this.label97.TabIndex = 83; + this.label97.Text = "PAL Right"; + // + // GLideN64_OverscanPalTop + // + this.GLideN64_OverscanPalTop.Location = new System.Drawing.Point(517, 198); + this.GLideN64_OverscanPalTop.Name = "GLideN64_OverscanPalTop"; + this.GLideN64_OverscanPalTop.Size = new System.Drawing.Size(42, 20); + this.GLideN64_OverscanPalTop.TabIndex = 84; + // + // GLideN64_OverscanPalBottom + // + this.GLideN64_OverscanPalBottom.Location = new System.Drawing.Point(517, 221); + this.GLideN64_OverscanPalBottom.Name = "GLideN64_OverscanPalBottom"; + this.GLideN64_OverscanPalBottom.Size = new System.Drawing.Size(42, 20); + this.GLideN64_OverscanPalBottom.TabIndex = 85; + // + // GLideN64_OverscanPalLeft + // + this.GLideN64_OverscanPalLeft.Location = new System.Drawing.Point(517, 244); + this.GLideN64_OverscanPalLeft.Name = "GLideN64_OverscanPalLeft"; + this.GLideN64_OverscanPalLeft.Size = new System.Drawing.Size(42, 20); + this.GLideN64_OverscanPalLeft.TabIndex = 86; + // + // GLideN64_OverscanPalRight + // + this.GLideN64_OverscanPalRight.Location = new System.Drawing.Point(517, 266); + this.GLideN64_OverscanPalRight.Name = "GLideN64_OverscanPalRight"; + this.GLideN64_OverscanPalRight.Size = new System.Drawing.Size(42, 20); + this.GLideN64_OverscanPalRight.TabIndex = 87; + // // N64VideoPluginconfig // this.AcceptButton = this.SaveButton; @@ -4814,5 +4987,22 @@ private System.Windows.Forms.CheckBox GLideN64_FXAA; private System.Windows.Forms.CheckBox GLideN64_ShowRenderingResolution; private System.Windows.Forms.CheckBox GLideN64_ShowInternalResolution; + private System.Windows.Forms.CheckBox GLideN64_EnableOverscan; + private System.Windows.Forms.TextBox GLideN64_OverscanPalRight; + private System.Windows.Forms.TextBox GLideN64_OverscanNtscRight; + private System.Windows.Forms.TextBox GLideN64_OverscanPalLeft; + private System.Windows.Forms.TextBox GLideN64_OverscanNtscLeft; + private System.Windows.Forms.TextBox GLideN64_OverscanPalBottom; + private System.Windows.Forms.TextBox GLideN64_OverscanNtscBottom; + private System.Windows.Forms.TextBox GLideN64_OverscanPalTop; + private System.Windows.Forms.Label label97; + private System.Windows.Forms.TextBox GLideN64_OverscanNtscTop; + private System.Windows.Forms.Label label96; + private System.Windows.Forms.Label label93; + private System.Windows.Forms.Label label95; + private System.Windows.Forms.Label label92; + private System.Windows.Forms.Label label94; + private System.Windows.Forms.Label label91; + private System.Windows.Forms.Label label90; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs index 1c960fd812..afd9de98e8 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs @@ -456,6 +456,32 @@ namespace BizHawk.Client.EmuHawk ? float.Parse(GLideN64_GammaCorrectionLevel.Text) : 2.0f; + _ss.GLideN64Plugin.EnableOverscan = GLideN64_EnableOverscan.Checked; + _ss.GLideN64Plugin.OverscanNtscTop = GLideN64_OverscanNtscTop.Text.IsSigned() + ? int.Parse(GLideN64_OverscanNtscTop.Text) + : 0; + _ss.GLideN64Plugin.OverscanNtscBottom = GLideN64_OverscanNtscBottom.Text.IsSigned() + ? int.Parse(GLideN64_OverscanNtscBottom.Text) + : 0; + _ss.GLideN64Plugin.OverscanNtscLeft = GLideN64_OverscanNtscLeft.Text.IsSigned() + ? int.Parse(GLideN64_OverscanNtscLeft.Text) + : 0; + _ss.GLideN64Plugin.OverscanNtscRight = GLideN64_OverscanNtscRight.Text.IsSigned() + ? int.Parse(GLideN64_OverscanNtscRight.Text) + : 0; + _ss.GLideN64Plugin.OverscanPalTop = GLideN64_OverscanPalTop.Text.IsSigned() + ? int.Parse(GLideN64_OverscanPalTop.Text) + : 0; + _ss.GLideN64Plugin.OverscanPalBottom = GLideN64_OverscanPalBottom.Text.IsSigned() + ? int.Parse(GLideN64_OverscanPalBottom.Text) + : 0; + _ss.GLideN64Plugin.OverscanPalLeft = GLideN64_OverscanPalLeft.Text.IsSigned() + ? int.Parse(GLideN64_OverscanPalLeft.Text) + : 0; + _ss.GLideN64Plugin.OverscanPalRight = GLideN64_OverscanPalRight.Text.IsSigned() + ? int.Parse(GLideN64_OverscanPalRight.Text) + : 0; + _ss.GLideN64Plugin.EnableN64DepthCompare = GLideN64_EnableN64DepthCompare.Checked; _ss.GLideN64Plugin.EnableCopyColorToRDRAM = GLideN64_EnableCopyColorToRDRAM.SelectedItem .ToString() @@ -791,6 +817,27 @@ namespace BizHawk.Client.EmuHawk GLideN64_ForceGammaCorrection.Checked = _ss.GLideN64Plugin.ForceGammaCorrection; GLideN64_GammaCorrectionLevel.Text = _ss.GLideN64Plugin.GammaCorrectionLevel.ToString(); + GLideN64_OverscanNtscTop.Enabled = + GLideN64_OverscanNtscBottom.Enabled = + GLideN64_OverscanNtscLeft.Enabled = + GLideN64_OverscanNtscRight.Enabled = + GLideN64_OverscanPalTop.Enabled = + GLideN64_OverscanPalBottom.Enabled = + GLideN64_OverscanPalLeft.Enabled = + GLideN64_OverscanPalRight.Enabled = + GLideN64_EnableOverscan.Checked = + _ss.GLideN64Plugin.EnableOverscan = + GLideN64_EnableOverscan.Enabled = + false; + GLideN64_OverscanNtscTop.Text = _ss.GLideN64Plugin.OverscanNtscTop.ToString(); + GLideN64_OverscanNtscBottom.Text = _ss.GLideN64Plugin.OverscanNtscBottom.ToString(); + GLideN64_OverscanNtscLeft.Text = _ss.GLideN64Plugin.OverscanNtscLeft.ToString(); + GLideN64_OverscanNtscRight.Text = _ss.GLideN64Plugin.OverscanNtscRight.ToString(); + GLideN64_OverscanPalTop.Text = _ss.GLideN64Plugin.OverscanPalTop.ToString(); + GLideN64_OverscanPalBottom.Text = _ss.GLideN64Plugin.OverscanPalBottom.ToString(); + GLideN64_OverscanPalLeft.Text = _ss.GLideN64Plugin.OverscanPalLeft.ToString(); + GLideN64_OverscanPalRight.Text = _ss.GLideN64Plugin.OverscanPalRight.ToString(); + UpdateGLideN64HacksSection(); if (!_ss.GLideN64Plugin.UseDefaultHacks) { @@ -1100,6 +1147,19 @@ namespace BizHawk.Client.EmuHawk GLideN64_EnableCopyAuxiliaryToRDRAM.Enabled = val; } + private void GLideN64_EnableOverscan_CheckedChanged(object sender, EventArgs e) + { + GLideN64_OverscanNtscTop.Enabled = + GLideN64_OverscanNtscBottom.Enabled = + GLideN64_OverscanNtscLeft.Enabled = + GLideN64_OverscanNtscRight.Enabled = + GLideN64_OverscanPalTop.Enabled = + GLideN64_OverscanPalBottom.Enabled = + GLideN64_OverscanPalLeft.Enabled = + GLideN64_OverscanPalRight.Enabled = + GLideN64_EnableOverscan.Checked; + } + private void GlideUseDefaultHacks1_CheckedChanged(object sender, EventArgs e) { GlideUseDefaultHacks2.Checked = GlideUseDefaultHacks1.Checked; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GLideN64.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GLideN64.cs index 1c4f7a199e..de083bf67d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GLideN64.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GLideN64.cs @@ -61,6 +61,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 blurStrength = 20; ForceGammaCorrection = false; GammaCorrectionLevel = 2.0f; + EnableOverscan = false; + OverscanNtscTop = 0; + OverscanNtscBottom = 0; + OverscanNtscLeft = 0; + OverscanNtscRight = 0; + OverscanPalTop = 0; + OverscanPalBottom = 0; + OverscanPalLeft = 0; + OverscanPalRight = 0; } public bool UseDefaultHacks { get; set; } @@ -218,6 +227,51 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 [Description("Enable N64 depth compare instead of OpenGL standard one. Experimental.")] public bool EnableN64DepthCompare { get; set; } + [DefaultValue(false)] + [DisplayName("Enable Overscan")] + [Description("Enable resulted image crop by Overscan.")] + public bool EnableOverscan { get; set; } + + [DefaultValue(0)] + [DisplayName("Overscan NTSC Top")] + [Description("NTSC mode. Top bound of Overscan.")] + public int OverscanNtscTop { get; set; } + + [DefaultValue(0)] + [DisplayName("Overscan NTSC Bottom")] + [Description("NTSC mode. Bottom bound of Overscan.")] + public int OverscanNtscBottom { get; set; } + + [DefaultValue(0)] + [DisplayName("Overscan NTSC Left")] + [Description("NTSC mode. Left bound of Overscan.")] + public int OverscanNtscLeft { get; set; } + + [DefaultValue(0)] + [DisplayName("Overscan NTSC Right")] + [Description("NTSC mode. Right bound of Overscan.")] + public int OverscanNtscRight { get; set; } + + [DefaultValue(0)] + [DisplayName("Overscan PAL Top")] + [Description("PAL mode. Top bound of Overscan.")] + public int OverscanPalTop { get; set; } + + [DefaultValue(0)] + [DisplayName("Overscan PAL Bottom")] + [Description("PAL mode. Bottom bound of Overscan.")] + public int OverscanPalBottom { get; set; } + + [DefaultValue(0)] + [DisplayName("Overscan PAL Left")] + [Description("PAL mode. Left bound of Overscan.")] + public int OverscanPalLeft { get; set; } + + [DefaultValue(0)] + [DisplayName("Overscan PAL Right")] + [Description("PAL mode. Right bound of Overscan.")] + public int OverscanPalRight { get; set; } + [DefaultValue(true)] [DisplayName("FB Info")] [Description("Disable buffers read/write with FBInfo. Use for games, which do not work with FBInfo.")]