diff --git a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs index a5866fed1c..10360867f8 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs @@ -32,6 +32,8 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(N64VideoPluginconfig)); this.N64plugintabcontrol = new System.Windows.Forms.TabControl(); this.N64vpluginglobaltab = new System.Windows.Forms.TabPage(); + this.LabelVideoResolutionY = new System.Windows.Forms.Label(); + this.LabelVideoResolutionX = new System.Windows.Forms.Label(); this.label49 = new System.Windows.Forms.Label(); this.RspTypeDropdown = new System.Windows.Forms.ComboBox(); this.label48 = new System.Windows.Forms.Label(); @@ -273,8 +275,6 @@ this.Glide64mk2_UseDefaultHacks2 = new System.Windows.Forms.CheckBox(); this.JaboTab = new System.Windows.Forms.TabPage(); this.JaboPerGameHacksGroupBox = new System.Windows.Forms.GroupBox(); - this.JaboResolutionHeightBox = new BizHawk.Client.EmuHawk.WatchValueBox(); - this.JaboResolutionWidthBox = new BizHawk.Client.EmuHawk.WatchValueBox(); this.label71 = new System.Windows.Forms.Label(); this.label70 = new System.Windows.Forms.Label(); this.JaboClearModeDropDown = new System.Windows.Forms.ComboBox(); @@ -306,6 +306,10 @@ this.SaveButton = new System.Windows.Forms.Button(); this.CancelBT = new System.Windows.Forms.Button(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.VideoResolutionYTextBox = new System.Windows.Forms.TextBox(); + this.VideoResolutionXTextBox = new System.Windows.Forms.TextBox(); + this.JaboResolutionHeightBox = new BizHawk.Client.EmuHawk.WatchValueBox(); + this.JaboResolutionWidthBox = new BizHawk.Client.EmuHawk.WatchValueBox(); this.N64plugintabcontrol.SuspendLayout(); this.N64vpluginglobaltab.SuspendLayout(); this.RiceTabPage.SuspendLayout(); @@ -349,6 +353,10 @@ // // N64vpluginglobaltab // + this.N64vpluginglobaltab.Controls.Add(this.VideoResolutionYTextBox); + this.N64vpluginglobaltab.Controls.Add(this.LabelVideoResolutionY); + this.N64vpluginglobaltab.Controls.Add(this.VideoResolutionXTextBox); + this.N64vpluginglobaltab.Controls.Add(this.LabelVideoResolutionX); this.N64vpluginglobaltab.Controls.Add(this.label49); this.N64vpluginglobaltab.Controls.Add(this.RspTypeDropdown); this.N64vpluginglobaltab.Controls.Add(this.label48); @@ -366,6 +374,26 @@ this.N64vpluginglobaltab.Text = "Global"; this.N64vpluginglobaltab.UseVisualStyleBackColor = true; // + // LabelVideoResolutionY + // + this.LabelVideoResolutionY.AutoSize = true; + this.LabelVideoResolutionY.Location = new System.Drawing.Point(22, 273); + this.LabelVideoResolutionY.Name = "LabelVideoResolutionY"; + this.LabelVideoResolutionY.Size = new System.Drawing.Size(41, 13); + this.LabelVideoResolutionY.TabIndex = 21; + this.LabelVideoResolutionY.Text = "Height:"; + this.LabelVideoResolutionY.Visible = false; + // + // LabelVideoResolutionX + // + this.LabelVideoResolutionX.AutoSize = true; + this.LabelVideoResolutionX.Location = new System.Drawing.Point(22, 247); + this.LabelVideoResolutionX.Name = "LabelVideoResolutionX"; + this.LabelVideoResolutionX.Size = new System.Drawing.Size(38, 13); + this.LabelVideoResolutionX.TabIndex = 19; + this.LabelVideoResolutionX.Text = "Width:"; + this.LabelVideoResolutionX.Visible = false; + // // label49 // this.label49.AutoSize = true; @@ -445,11 +473,13 @@ "1400 x 1050", "1600 x 1200", "1920 x 1440", - "2048 x 1536"}); + "2048 x 1536", + "Custom"}); this.VideoResolutionComboBox.Location = new System.Drawing.Point(13, 217); this.VideoResolutionComboBox.Name = "VideoResolutionComboBox"; this.VideoResolutionComboBox.Size = new System.Drawing.Size(136, 21); this.VideoResolutionComboBox.TabIndex = 10; + this.VideoResolutionComboBox.SelectedIndexChanged += new System.EventHandler(this.VideoResolutionComboBox_SelectedIndexChanged); // // PluginComboBox // @@ -3294,32 +3324,6 @@ this.JaboPerGameHacksGroupBox.TabStop = false; this.JaboPerGameHacksGroupBox.Text = "Per game settings"; // - // JaboResolutionHeightBox - // - this.JaboResolutionHeightBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte; - this.JaboResolutionHeightBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.JaboResolutionHeightBox.Location = new System.Drawing.Point(127, 90); - this.JaboResolutionHeightBox.MaxLength = 4; - this.JaboResolutionHeightBox.Name = "JaboResolutionHeightBox"; - this.JaboResolutionHeightBox.Nullable = false; - this.JaboResolutionHeightBox.Size = new System.Drawing.Size(52, 20); - this.JaboResolutionHeightBox.TabIndex = 34; - this.JaboResolutionHeightBox.Text = "0"; - this.JaboResolutionHeightBox.Type = BizHawk.Client.Common.Watch.DisplayType.Signed; - // - // JaboResolutionWidthBox - // - this.JaboResolutionWidthBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte; - this.JaboResolutionWidthBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.JaboResolutionWidthBox.Location = new System.Drawing.Point(127, 60); - this.JaboResolutionWidthBox.MaxLength = 4; - this.JaboResolutionWidthBox.Name = "JaboResolutionWidthBox"; - this.JaboResolutionWidthBox.Nullable = false; - this.JaboResolutionWidthBox.Size = new System.Drawing.Size(52, 20); - this.JaboResolutionWidthBox.TabIndex = 33; - this.JaboResolutionWidthBox.Text = "0"; - this.JaboResolutionWidthBox.Type = BizHawk.Client.Common.Watch.DisplayType.Signed; - // // label71 // this.label71.AutoSize = true; @@ -3623,6 +3627,52 @@ this.toolTip1.ReshowDelay = 100; this.toolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; // + // VideoResolutionYTextBox + // + this.VideoResolutionYTextBox.Location = new System.Drawing.Point(66, 270); + this.VideoResolutionYTextBox.MaxLength = 5; + this.VideoResolutionYTextBox.Name = "VideoResolutionYTextBox"; + this.VideoResolutionYTextBox.Size = new System.Drawing.Size(35, 20); + this.VideoResolutionYTextBox.TabIndex = 22; + this.VideoResolutionYTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.VideoResolutionYTextBox.Visible = false; + // + // VideoResolutionXTextBox + // + this.VideoResolutionXTextBox.Location = new System.Drawing.Point(66, 244); + this.VideoResolutionXTextBox.MaxLength = 5; + this.VideoResolutionXTextBox.Name = "VideoResolutionXTextBox"; + this.VideoResolutionXTextBox.Size = new System.Drawing.Size(35, 20); + this.VideoResolutionXTextBox.TabIndex = 20; + this.VideoResolutionXTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.VideoResolutionXTextBox.Visible = false; + // + // JaboResolutionHeightBox + // + this.JaboResolutionHeightBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte; + this.JaboResolutionHeightBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.JaboResolutionHeightBox.Location = new System.Drawing.Point(127, 90); + this.JaboResolutionHeightBox.MaxLength = 4; + this.JaboResolutionHeightBox.Name = "JaboResolutionHeightBox"; + this.JaboResolutionHeightBox.Nullable = false; + this.JaboResolutionHeightBox.Size = new System.Drawing.Size(52, 20); + this.JaboResolutionHeightBox.TabIndex = 34; + this.JaboResolutionHeightBox.Text = "0"; + this.JaboResolutionHeightBox.Type = BizHawk.Client.Common.Watch.DisplayType.Signed; + // + // JaboResolutionWidthBox + // + this.JaboResolutionWidthBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte; + this.JaboResolutionWidthBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.JaboResolutionWidthBox.Location = new System.Drawing.Point(127, 60); + this.JaboResolutionWidthBox.MaxLength = 4; + this.JaboResolutionWidthBox.Name = "JaboResolutionWidthBox"; + this.JaboResolutionWidthBox.Nullable = false; + this.JaboResolutionWidthBox.Size = new System.Drawing.Size(52, 20); + this.JaboResolutionWidthBox.TabIndex = 33; + this.JaboResolutionWidthBox.Text = "0"; + this.JaboResolutionWidthBox.Type = BizHawk.Client.Common.Watch.DisplayType.Signed; + // // N64VideoPluginconfig // this.AcceptButton = this.SaveButton; @@ -3958,5 +4008,9 @@ private WatchValueBox JaboResolutionHeightBox; private WatchValueBox JaboResolutionWidthBox; private System.Windows.Forms.Label label71; + private System.Windows.Forms.Label LabelVideoResolutionY; + private System.Windows.Forms.Label LabelVideoResolutionX; + private System.Windows.Forms.TextBox VideoResolutionYTextBox; + private System.Windows.Forms.TextBox VideoResolutionXTextBox; } } \ 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 053ff76534..b8adfa38e8 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs @@ -32,7 +32,8 @@ namespace BizHawk.Client.EmuHawk "1400 x 1050", "1600 x 1200", "1920 x 1440", - "2048 x 1536" + "2048 x 1536", + "Custom" }; string[] validResolutionsJabo = { @@ -126,10 +127,23 @@ namespace BizHawk.Client.EmuHawk private void SaveSettings() { // Global - var video_settings = VideoResolutionComboBox.SelectedItem.ToString(); - var strArr = video_settings.Split('x'); - s.VideoSizeX = int.Parse(strArr[0].Trim()); - s.VideoSizeY = int.Parse(strArr[1].Trim()); + if (VideoResolutionComboBox.Text != "Custom") + { + var video_settings = VideoResolutionComboBox.SelectedItem.ToString(); + var strArr = video_settings.Split('x'); + s.VideoSizeX = int.Parse(strArr[0].Trim()); + s.VideoSizeY = int.Parse(strArr[1].Trim()); + } + else + { + s.VideoSizeX = + VideoResolutionXTextBox.Text.IsUnsigned() ? + int.Parse(VideoResolutionXTextBox.Text) : 320; + + s.VideoSizeY = + VideoResolutionYTextBox.Text.IsUnsigned() ? + int.Parse(VideoResolutionYTextBox.Text) : 240; + } switch (PluginComboBox.Text) { case "Rice": ss.VideoPlugin = PluginType.Rice; break; @@ -420,6 +434,9 @@ namespace BizHawk.Client.EmuHawk break; } + VideoResolutionXTextBox.Text = s.VideoSizeX.ToString(); + VideoResolutionYTextBox.Text = s.VideoSizeY.ToString(); + var video_setting = s.VideoSizeX + " x " + s.VideoSizeY; @@ -429,6 +446,11 @@ namespace BizHawk.Client.EmuHawk { VideoResolutionComboBox.SelectedIndex = index; } + else if (PluginComboBox.SelectedIndex != 4) + { + VideoResolutionComboBox.SelectedIndex = 13; + ShowCustomVideoResolutionControls(); + } // Jabo JaboUseForGameCheckbox.Checked = ss.JaboPlugin.UseDefaultHacks; @@ -958,10 +980,21 @@ namespace BizHawk.Client.EmuHawk VideoResolutionComboBox.SelectedIndex = 0; } + var strArr = new string[] {}; + int OldSizeX, OldSizeY; + var oldResolution = VideoResolutionComboBox.SelectedItem.ToString(); - var strArr = oldResolution.Split('x'); - int OldSizeX = int.Parse(strArr[0].Trim()); - int OldSizeY = int.Parse(strArr[1].Trim()); + if (oldResolution != "Custom") + { + strArr = oldResolution.Split('x'); + OldSizeX = int.Parse(strArr[0].Trim()); + OldSizeY = int.Parse(strArr[1].Trim()); + } + else + { + OldSizeX = int.Parse(VideoResolutionXTextBox.Text); + OldSizeY = int.Parse(VideoResolutionYTextBox.Text); + } if (PluginComboBox.Text == "Jabo 1.6.1") { @@ -988,21 +1021,24 @@ namespace BizHawk.Client.EmuHawk int bestFit = -1; for (int i = 0; i < VideoResolutionComboBox.Items.Count; i++) { - string option = (string)VideoResolutionComboBox.Items[i]; - strArr = option.Split('x'); - int newSizeX = int.Parse(strArr[0].Trim()); - int newSizeY = int.Parse(strArr[1].Trim()); - if (OldSizeX < newSizeX || OldSizeX == newSizeX && OldSizeY < newSizeY) + if ((string)VideoResolutionComboBox.Items[i] != "Custom") { - if (i == 0) + string option = (string)VideoResolutionComboBox.Items[i]; + strArr = option.Split('x'); + int newSizeX = int.Parse(strArr[0].Trim()); + int newSizeY = int.Parse(strArr[1].Trim()); + if (OldSizeX < newSizeX || OldSizeX == newSizeX && OldSizeY < newSizeY) { - bestFit = 0; - break; - } - else - { - bestFit = i - 1; - break; + if (i == 0) + { + bestFit = 0; + break; + } + else + { + bestFit = i - 1; + break; + } } } } @@ -1048,5 +1084,36 @@ namespace BizHawk.Client.EmuHawk } } + private void VideoResolutionComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (VideoResolutionComboBox.Text == "Custom") + { + ShowCustomVideoResolutionControls(); + } + else + { + HideCustomVideoResolutionControls(); + var new_resolution = VideoResolutionComboBox.SelectedItem.ToString(); + var strArr = new_resolution.Split('x'); + VideoResolutionXTextBox.Text = strArr[0].Trim(); + VideoResolutionYTextBox.Text = strArr[1].Trim(); + } + } + + private void ShowCustomVideoResolutionControls() + { + LabelVideoResolutionX.Visible = true; + LabelVideoResolutionY.Visible = true; + VideoResolutionXTextBox.Visible = true; + VideoResolutionYTextBox.Visible = true; + } + + private void HideCustomVideoResolutionControls() + { + LabelVideoResolutionX.Visible = false; + LabelVideoResolutionY.Visible = false; + VideoResolutionXTextBox.Visible = false; + VideoResolutionYTextBox.Visible = false; + } } } diff --git a/BizHawk.Client.EmuHawk/config/N64/NewN64PluginSettings.Designer.cs b/BizHawk.Client.EmuHawk/config/N64/NewN64PluginSettings.Designer.cs index 0f4a47bece..c85820fff7 100644 --- a/BizHawk.Client.EmuHawk/config/N64/NewN64PluginSettings.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/N64/NewN64PluginSettings.Designer.cs @@ -31,6 +31,8 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewN64PluginSettings)); this.PluginTabs = new System.Windows.Forms.TabControl(); this.GlobalTab = new System.Windows.Forms.TabPage(); + this.VideoResolutionXTextBox = new System.Windows.Forms.TextBox(); + this.LabelVideoResolutionX = new System.Windows.Forms.Label(); this.label49 = new System.Windows.Forms.Label(); this.RspTypeDropdown = new System.Windows.Forms.ComboBox(); this.label48 = new System.Windows.Forms.Label(); @@ -40,15 +42,17 @@ this.PluginComboBox = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.RiceTab = new System.Windows.Forms.TabPage(); + this.RicePropertyGrid = new System.Windows.Forms.PropertyGrid(); this.Glide64mk2 = new System.Windows.Forms.TabPage(); + this.Glidemk2PropertyGrid = new System.Windows.Forms.PropertyGrid(); this.Glide64Tab = new System.Windows.Forms.TabPage(); + this.GlidePropertyGrid = new System.Windows.Forms.PropertyGrid(); this.JaboTab = new System.Windows.Forms.TabPage(); + this.JaboPropertyGrid = new System.Windows.Forms.PropertyGrid(); this.SaveBtn = new System.Windows.Forms.Button(); this.CancelBtn = new System.Windows.Forms.Button(); - this.RicePropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.Glidemk2PropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.GlidePropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.JaboPropertyGrid = new System.Windows.Forms.PropertyGrid(); + this.LabelVideoResolutionY = new System.Windows.Forms.Label(); + this.VideoResolutionYTextBox = new System.Windows.Forms.TextBox(); this.PluginTabs.SuspendLayout(); this.GlobalTab.SuspendLayout(); this.RiceTab.SuspendLayout(); @@ -75,6 +79,10 @@ // // GlobalTab // + this.GlobalTab.Controls.Add(this.VideoResolutionYTextBox); + this.GlobalTab.Controls.Add(this.LabelVideoResolutionY); + this.GlobalTab.Controls.Add(this.VideoResolutionXTextBox); + this.GlobalTab.Controls.Add(this.LabelVideoResolutionX); this.GlobalTab.Controls.Add(this.label49); this.GlobalTab.Controls.Add(this.RspTypeDropdown); this.GlobalTab.Controls.Add(this.label48); @@ -91,6 +99,26 @@ this.GlobalTab.Text = "Global"; this.GlobalTab.UseVisualStyleBackColor = true; // + // VideoResolutionXTextBox + // + this.VideoResolutionXTextBox.Location = new System.Drawing.Point(402, 91); + this.VideoResolutionXTextBox.MaxLength = 5; + this.VideoResolutionXTextBox.Name = "VideoResolutionXTextBox"; + this.VideoResolutionXTextBox.Size = new System.Drawing.Size(35, 20); + this.VideoResolutionXTextBox.TabIndex = 28; + this.VideoResolutionXTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.VideoResolutionXTextBox.Visible = false; + // + // LabelVideoResolutionX + // + this.LabelVideoResolutionX.AutoSize = true; + this.LabelVideoResolutionX.Location = new System.Drawing.Point(358, 94); + this.LabelVideoResolutionX.Name = "LabelVideoResolutionX"; + this.LabelVideoResolutionX.Size = new System.Drawing.Size(38, 13); + this.LabelVideoResolutionX.TabIndex = 27; + this.LabelVideoResolutionX.Text = "Width:"; + this.LabelVideoResolutionX.Visible = false; + // // label49 // this.label49.AutoSize = true; @@ -161,11 +189,13 @@ "1400 x 1050", "1600 x 1200", "1920 x 1440", - "2048 x 1536"}); + "2048 x 1536", + "Custom"}); this.VideoResolutionComboBox.Location = new System.Drawing.Point(216, 91); this.VideoResolutionComboBox.Name = "VideoResolutionComboBox"; this.VideoResolutionComboBox.Size = new System.Drawing.Size(136, 21); this.VideoResolutionComboBox.TabIndex = 22; + this.VideoResolutionComboBox.SelectedIndexChanged += new System.EventHandler(this.VideoResolutionComboBox_SelectedIndexChanged); // // PluginComboBox // @@ -201,6 +231,16 @@ this.RiceTab.Text = "Rice"; this.RiceTab.UseVisualStyleBackColor = true; // + // RicePropertyGrid + // + this.RicePropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.RicePropertyGrid.Location = new System.Drawing.Point(3, 3); + this.RicePropertyGrid.Name = "RicePropertyGrid"; + this.RicePropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; + this.RicePropertyGrid.Size = new System.Drawing.Size(566, 436); + this.RicePropertyGrid.TabIndex = 1; + this.RicePropertyGrid.ToolbarVisible = false; + // // Glide64mk2 // this.Glide64mk2.Controls.Add(this.Glidemk2PropertyGrid); @@ -211,6 +251,16 @@ this.Glide64mk2.Text = "Glide64mk2"; this.Glide64mk2.UseVisualStyleBackColor = true; // + // Glidemk2PropertyGrid + // + this.Glidemk2PropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.Glidemk2PropertyGrid.Location = new System.Drawing.Point(0, 0); + this.Glidemk2PropertyGrid.Name = "Glidemk2PropertyGrid"; + this.Glidemk2PropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; + this.Glidemk2PropertyGrid.Size = new System.Drawing.Size(572, 442); + this.Glidemk2PropertyGrid.TabIndex = 2; + this.Glidemk2PropertyGrid.ToolbarVisible = false; + // // Glide64Tab // this.Glide64Tab.Controls.Add(this.GlidePropertyGrid); @@ -221,6 +271,16 @@ this.Glide64Tab.Text = "Glide64"; this.Glide64Tab.UseVisualStyleBackColor = true; // + // GlidePropertyGrid + // + this.GlidePropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.GlidePropertyGrid.Location = new System.Drawing.Point(0, 0); + this.GlidePropertyGrid.Name = "GlidePropertyGrid"; + this.GlidePropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; + this.GlidePropertyGrid.Size = new System.Drawing.Size(572, 442); + this.GlidePropertyGrid.TabIndex = 3; + this.GlidePropertyGrid.ToolbarVisible = false; + // // JaboTab // this.JaboTab.Controls.Add(this.JaboPropertyGrid); @@ -231,6 +291,16 @@ this.JaboTab.Text = "Jabo"; this.JaboTab.UseVisualStyleBackColor = true; // + // JaboPropertyGrid + // + this.JaboPropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.JaboPropertyGrid.Location = new System.Drawing.Point(0, 0); + this.JaboPropertyGrid.Name = "JaboPropertyGrid"; + this.JaboPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; + this.JaboPropertyGrid.Size = new System.Drawing.Size(572, 442); + this.JaboPropertyGrid.TabIndex = 3; + this.JaboPropertyGrid.ToolbarVisible = false; + // // SaveBtn // this.SaveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -254,45 +324,25 @@ this.CancelBtn.UseVisualStyleBackColor = true; this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click); // - // RicePropertyGrid + // LabelVideoResolutionY // - this.RicePropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; - this.RicePropertyGrid.Location = new System.Drawing.Point(3, 3); - this.RicePropertyGrid.Name = "RicePropertyGrid"; - this.RicePropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; - this.RicePropertyGrid.Size = new System.Drawing.Size(566, 436); - this.RicePropertyGrid.TabIndex = 1; - this.RicePropertyGrid.ToolbarVisible = false; + this.LabelVideoResolutionY.AutoSize = true; + this.LabelVideoResolutionY.Location = new System.Drawing.Point(447, 94); + this.LabelVideoResolutionY.Name = "LabelVideoResolutionY"; + this.LabelVideoResolutionY.Size = new System.Drawing.Size(41, 13); + this.LabelVideoResolutionY.TabIndex = 107; + this.LabelVideoResolutionY.Text = "Height:"; + this.LabelVideoResolutionY.Visible = false; // - // Glidemk2PropertyGrid + // VideoResolutionYTextBox // - this.Glidemk2PropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; - this.Glidemk2PropertyGrid.Location = new System.Drawing.Point(0, 0); - this.Glidemk2PropertyGrid.Name = "Glidemk2PropertyGrid"; - this.Glidemk2PropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; - this.Glidemk2PropertyGrid.Size = new System.Drawing.Size(572, 442); - this.Glidemk2PropertyGrid.TabIndex = 2; - this.Glidemk2PropertyGrid.ToolbarVisible = false; - // - // GlidePropertyGrid - // - this.GlidePropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; - this.GlidePropertyGrid.Location = new System.Drawing.Point(0, 0); - this.GlidePropertyGrid.Name = "GlidePropertyGrid"; - this.GlidePropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; - this.GlidePropertyGrid.Size = new System.Drawing.Size(572, 442); - this.GlidePropertyGrid.TabIndex = 3; - this.GlidePropertyGrid.ToolbarVisible = false; - // - // JaboPropertyGrid - // - this.JaboPropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; - this.JaboPropertyGrid.Location = new System.Drawing.Point(0, 0); - this.JaboPropertyGrid.Name = "JaboPropertyGrid"; - this.JaboPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; - this.JaboPropertyGrid.Size = new System.Drawing.Size(572, 442); - this.JaboPropertyGrid.TabIndex = 3; - this.JaboPropertyGrid.ToolbarVisible = false; + this.VideoResolutionYTextBox.Location = new System.Drawing.Point(494, 91); + this.VideoResolutionYTextBox.MaxLength = 5; + this.VideoResolutionYTextBox.Name = "VideoResolutionYTextBox"; + this.VideoResolutionYTextBox.Size = new System.Drawing.Size(35, 20); + this.VideoResolutionYTextBox.TabIndex = 108; + this.VideoResolutionYTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.VideoResolutionYTextBox.Visible = false; // // NewN64PluginSettings // @@ -340,5 +390,9 @@ private System.Windows.Forms.PropertyGrid Glidemk2PropertyGrid; private System.Windows.Forms.PropertyGrid GlidePropertyGrid; private System.Windows.Forms.PropertyGrid JaboPropertyGrid; + private System.Windows.Forms.Label LabelVideoResolutionX; + private System.Windows.Forms.TextBox VideoResolutionXTextBox; + private System.Windows.Forms.Label LabelVideoResolutionY; + private System.Windows.Forms.TextBox VideoResolutionYTextBox; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/config/N64/NewN64PluginSettings.cs b/BizHawk.Client.EmuHawk/config/N64/NewN64PluginSettings.cs index 5a9a455ee1..b8c0f69b6e 100644 --- a/BizHawk.Client.EmuHawk/config/N64/NewN64PluginSettings.cs +++ b/BizHawk.Client.EmuHawk/config/N64/NewN64PluginSettings.cs @@ -30,10 +30,23 @@ namespace BizHawk.Client.EmuHawk private void SaveBtn_Click(object sender, EventArgs e) { - var video_settings = VideoResolutionComboBox.SelectedItem.ToString(); - var strArr = video_settings.Split('x'); - s.VideoSizeX = int.Parse(strArr[0].Trim()); - s.VideoSizeY = int.Parse(strArr[1].Trim()); + if (VideoResolutionComboBox.Text != "Custom") + { + var video_settings = VideoResolutionComboBox.SelectedItem.ToString(); + var strArr = video_settings.Split('x'); + s.VideoSizeX = int.Parse(strArr[0].Trim()); + s.VideoSizeY = int.Parse(strArr[1].Trim()); + } + else + { + s.VideoSizeX = + VideoResolutionXTextBox.Text.IsUnsigned() ? + int.Parse(VideoResolutionXTextBox.Text) : 320; + + s.VideoSizeY = + VideoResolutionYTextBox.Text.IsUnsigned() ? + int.Parse(VideoResolutionYTextBox.Text) : 240; + } ss.Core = CoreTypeDropdown.SelectedItem .ToString() @@ -63,6 +76,9 @@ namespace BizHawk.Client.EmuHawk RspTypeDropdown.PopulateFromEnum(ss.Rsp); PluginComboBox.PopulateFromEnum(ss.VideoPlugin); + VideoResolutionXTextBox.Text = s.VideoSizeX.ToString(); + VideoResolutionYTextBox.Text = s.VideoSizeY.ToString(); + var video_setting = s.VideoSizeX + " x " + s.VideoSizeY; @@ -72,6 +88,11 @@ namespace BizHawk.Client.EmuHawk { VideoResolutionComboBox.SelectedIndex = index; } + else if (PluginComboBox.SelectedIndex != 4) + { + VideoResolutionComboBox.SelectedIndex = 13; + ShowCustomVideoResolutionControls(); + } RicePropertyGrid.SelectedObject = ss.RicePlugin; Glidemk2PropertyGrid.SelectedObject = ss.Glide64mk2Plugin; @@ -128,5 +149,37 @@ namespace BizHawk.Client.EmuHawk } #endregion + + private void VideoResolutionComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (VideoResolutionComboBox.Text == "Custom") + { + ShowCustomVideoResolutionControls(); + } + else + { + HideCustomVideoResolutionControls(); + var new_resolution = VideoResolutionComboBox.SelectedItem.ToString(); + var strArr = new_resolution.Split('x'); + VideoResolutionXTextBox.Text = strArr[0].Trim(); + VideoResolutionYTextBox.Text = strArr[1].Trim(); + } + } + + private void ShowCustomVideoResolutionControls() + { + LabelVideoResolutionX.Visible = true; + LabelVideoResolutionY.Visible = true; + VideoResolutionXTextBox.Visible = true; + VideoResolutionYTextBox.Visible = true; + } + + private void HideCustomVideoResolutionControls() + { + LabelVideoResolutionX.Visible = false; + LabelVideoResolutionY.Visible = false; + VideoResolutionXTextBox.Visible = false; + VideoResolutionYTextBox.Visible = false; + } } }