N64 - ability to set core type in the front end

This commit is contained in:
adelikat 2014-05-10 17:30:03 +00:00
parent 3e843b2b0f
commit 3488df36c4
6 changed files with 3000 additions and 2938 deletions

View File

@ -386,7 +386,7 @@
this.MainformMenu.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow;
this.MainformMenu.Location = new System.Drawing.Point(0, 0);
this.MainformMenu.Name = "MainformMenu";
this.MainformMenu.Size = new System.Drawing.Size(470, 61);
this.MainformMenu.Size = new System.Drawing.Size(470, 42);
this.MainformMenu.TabIndex = 0;
this.MainformMenu.Text = "menuStrip1";
this.MainformMenu.MenuActivate += new System.EventHandler(this.MainformMenu_MenuActivate);
@ -2414,15 +2414,15 @@
//
this.N64PluginSettingsMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("N64PluginSettingsMenuItem.Image")));
this.N64PluginSettingsMenuItem.Name = "N64PluginSettingsMenuItem";
this.N64PluginSettingsMenuItem.Size = new System.Drawing.Size(195, 22);
this.N64PluginSettingsMenuItem.Text = "Video Plugin Settings...";
this.N64PluginSettingsMenuItem.Size = new System.Drawing.Size(181, 22);
this.N64PluginSettingsMenuItem.Text = "Plugins";
this.N64PluginSettingsMenuItem.Click += new System.EventHandler(this.N64PluginSettingsMenuItem_Click);
//
// N64ControllerSettingsMenuItem
//
this.N64ControllerSettingsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.GameController;
this.N64ControllerSettingsMenuItem.Name = "N64ControllerSettingsMenuItem";
this.N64ControllerSettingsMenuItem.Size = new System.Drawing.Size(195, 22);
this.N64ControllerSettingsMenuItem.Size = new System.Drawing.Size(181, 22);
this.N64ControllerSettingsMenuItem.Text = "Controller Settings...";
this.N64ControllerSettingsMenuItem.Click += new System.EventHandler(this.N64ControllerSettingsMenuItem_Click);
//

View File

@ -270,6 +270,8 @@
this.SaveButton = new System.Windows.Forms.Button();
this.CancelBT = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.CoreTypeDropdown = new System.Windows.Forms.ComboBox();
this.label48 = new System.Windows.Forms.Label();
this.N64plugintabcontrol.SuspendLayout();
this.N64vpluginglobaltab.SuspendLayout();
this.RiceTabPage.SuspendLayout();
@ -309,6 +311,8 @@
//
// N64vpluginglobaltab
//
this.N64vpluginglobaltab.Controls.Add(this.label48);
this.N64vpluginglobaltab.Controls.Add(this.CoreTypeDropdown);
this.N64vpluginglobaltab.Controls.Add(this.label47);
this.N64vpluginglobaltab.Controls.Add(this.label2);
this.N64vpluginglobaltab.Controls.Add(this.VideoResolutionComboBox);
@ -325,7 +329,7 @@
// label47
//
this.label47.AutoSize = true;
this.label47.Location = new System.Drawing.Point(10, 58);
this.label47.Location = new System.Drawing.Point(10, 115);
this.label47.Name = "label47";
this.label47.Size = new System.Drawing.Size(275, 13);
this.label47.TabIndex = 14;
@ -334,7 +338,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(10, 107);
this.label2.Location = new System.Drawing.Point(10, 164);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(87, 13);
this.label2.TabIndex = 13;
@ -358,10 +362,10 @@
"1600 x 1200",
"1920 x 1440",
"2048 x 1536"});
this.VideoResolutionComboBox.Location = new System.Drawing.Point(13, 123);
this.VideoResolutionComboBox.Location = new System.Drawing.Point(13, 180);
this.VideoResolutionComboBox.Name = "VideoResolutionComboBox";
this.VideoResolutionComboBox.Size = new System.Drawing.Size(136, 21);
this.VideoResolutionComboBox.TabIndex = 12;
this.VideoResolutionComboBox.TabIndex = 10;
//
// PluginComboBox
//
@ -371,15 +375,15 @@
"Rice",
"Glide64",
"Glide64mk2"});
this.PluginComboBox.Location = new System.Drawing.Point(13, 34);
this.PluginComboBox.Location = new System.Drawing.Point(13, 91);
this.PluginComboBox.Name = "PluginComboBox";
this.PluginComboBox.Size = new System.Drawing.Size(173, 21);
this.PluginComboBox.TabIndex = 2;
this.PluginComboBox.TabIndex = 5;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 18);
this.label1.Location = new System.Drawing.Point(10, 75);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(99, 13);
this.label1.TabIndex = 1;
@ -3161,7 +3165,7 @@
this.SaveButton.Location = new System.Drawing.Point(409, 373);
this.SaveButton.Name = "SaveButton";
this.SaveButton.Size = new System.Drawing.Size(75, 23);
this.SaveButton.TabIndex = 1;
this.SaveButton.TabIndex = 100;
this.SaveButton.Text = "Save";
this.SaveButton.UseVisualStyleBackColor = true;
this.SaveButton.Click += new System.EventHandler(this.button1_Click);
@ -3173,7 +3177,7 @@
this.CancelBT.Location = new System.Drawing.Point(490, 373);
this.CancelBT.Name = "CancelBT";
this.CancelBT.Size = new System.Drawing.Size(75, 23);
this.CancelBT.TabIndex = 2;
this.CancelBT.TabIndex = 105;
this.CancelBT.Text = "Cancel";
this.CancelBT.UseVisualStyleBackColor = true;
this.CancelBT.Click += new System.EventHandler(this.CancelBT_Click);
@ -3186,6 +3190,28 @@
this.toolTip1.ReshowDelay = 100;
this.toolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
//
// CoreTypeDropdown
//
this.CoreTypeDropdown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CoreTypeDropdown.FormattingEnabled = true;
this.CoreTypeDropdown.Items.AddRange(new object[] {
"Pure Interpreter",
"Interpreter",
"DynaRec"});
this.CoreTypeDropdown.Location = new System.Drawing.Point(13, 29);
this.CoreTypeDropdown.Name = "CoreTypeDropdown";
this.CoreTypeDropdown.Size = new System.Drawing.Size(136, 21);
this.CoreTypeDropdown.TabIndex = 1;
//
// label48
//
this.label48.AutoSize = true;
this.label48.Location = new System.Drawing.Point(10, 13);
this.label48.Name = "label48";
this.label48.Size = new System.Drawing.Size(56, 13);
this.label48.TabIndex = 16;
this.label48.Text = "Core Type";
//
// N64VideoPluginconfig
//
this.AcceptButton = this.SaveButton;
@ -3200,7 +3226,7 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "N64VideoPluginconfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Video Plugin Configuration";
this.Text = "Plugin Settings";
this.Load += new System.EventHandler(this.N64VideoPluginconfig_Load);
this.N64plugintabcontrol.ResumeLayout(false);
this.N64vpluginglobaltab.ResumeLayout(false);
@ -3480,5 +3506,7 @@
private System.Windows.Forms.ComboBox Glide64mk2_fb_crc_mode;
private System.Windows.Forms.Label label45;
private System.Windows.Forms.Label label47;
private System.Windows.Forms.Label label48;
private System.Windows.Forms.ComboBox CoreTypeDropdown;
}
}

View File

@ -1,8 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Emulation.Cores.Nintendo.N64;
using BizHawk.Common;
namespace BizHawk.Client.EmuHawk
{
@ -50,6 +55,7 @@ namespace BizHawk.Client.EmuHawk
private void SaveSettings()
{
var s = GetS();
//Global
var video_settings = VideoResolutionComboBox.SelectedItem.ToString();
var strArr = video_settings.Split('x');
@ -280,11 +286,23 @@ namespace BizHawk.Client.EmuHawk
s.Glide64mk2Plugin.read_back_to_screen = Glide64mk2_read_back_to_screen.SelectedIndex;
s.Glide64mk2Plugin.fast_crc = Glide64mk2_fast_crc.Checked;
s.CoreType = EnumHelper.GetValueFromDescription<N64SyncSettings.CORETYPE>(
CoreTypeDropdown.SelectedItem.ToString());
PutS(s);
}
private void N64VideoPluginconfig_Load(object sender, EventArgs e)
{
var n64Settings = (N64SyncSettings)Global.Emulator.GetSyncSettings();
CoreTypeDropdown.Items.Clear();
CoreTypeDropdown.Items.AddRange(
EnumHelper.GetDescriptions<N64SyncSettings.CORETYPE>()
.ToArray());
CoreTypeDropdown.SelectedItem = EnumHelper.GetDescription(n64Settings.CoreType);
var s = GetS();
//Load Variables

View File

@ -120,6 +120,9 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="AnisotropicFiltering_LB.ToolTip" xml:space="preserve">
<value>Enable/Disable Anisotropic Filtering for Mipmapping (0=no filtering, 2-16=quality).
This is uneffective if Mipmapping is 0.

View File

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
@ -54,5 +56,15 @@ namespace BizHawk.Common
return default(T);
}
public static IEnumerable<string> GetDescriptions<T>()
{
var vals = Enum.GetValues(typeof(T));
foreach (var v in vals)
{
yield return GetDescription(v);
}
}
}
}

View File

@ -41,6 +41,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
{
return new N64SyncSettings
{
CoreType = CoreType,
VidPlugin = VidPlugin,
VideoSizeX = VideoSizeX,
VideoSizeY = VideoSizeY,