From 181313cdf91730a25b83bdcdda67a544684b34ce Mon Sep 17 00:00:00 2001 From: pjgat09 Date: Sun, 7 Sep 2014 03:13:53 +0000 Subject: [PATCH] N64: Removed checks to see if the correct jabo dll was present --- .../N64/N64VideoPluginconfig.Designer.cs | 120 +++++++----------- .../config/N64/N64VideoPluginconfig.cs | 42 +----- .../config/N64/N64VideoPluginconfig.resx | 3 - .../BizHawk.Emulation.Cores.csproj | 1 - .../Consoles/Nintendo/N64/N64JaboManager.cs | 94 -------------- .../N64/NativeAPI/mupen64plusVideoApi.cs | 9 -- 6 files changed, 51 insertions(+), 218 deletions(-) delete mode 100644 BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64JaboManager.cs diff --git a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs index 5cf90a5c77..a5866fed1c 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.Designer.cs @@ -32,8 +32,6 @@ 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.jaboStatusDetailLabel = new System.Windows.Forms.Label(); - this.jaboStatusLabel = 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(); @@ -275,6 +273,10 @@ 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(); this.label69 = new System.Windows.Forms.Label(); this.JaboUseForGameCheckbox = new System.Windows.Forms.CheckBox(); @@ -304,10 +306,6 @@ this.SaveButton = new System.Windows.Forms.Button(); this.CancelBT = new System.Windows.Forms.Button(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.label70 = new System.Windows.Forms.Label(); - this.label71 = new System.Windows.Forms.Label(); - this.JaboResolutionWidthBox = new BizHawk.Client.EmuHawk.WatchValueBox(); - this.JaboResolutionHeightBox = new BizHawk.Client.EmuHawk.WatchValueBox(); this.N64plugintabcontrol.SuspendLayout(); this.N64vpluginglobaltab.SuspendLayout(); this.RiceTabPage.SuspendLayout(); @@ -351,8 +349,6 @@ // // N64vpluginglobaltab // - this.N64vpluginglobaltab.Controls.Add(this.jaboStatusDetailLabel); - this.N64vpluginglobaltab.Controls.Add(this.jaboStatusLabel); this.N64vpluginglobaltab.Controls.Add(this.label49); this.N64vpluginglobaltab.Controls.Add(this.RspTypeDropdown); this.N64vpluginglobaltab.Controls.Add(this.label48); @@ -370,24 +366,6 @@ this.N64vpluginglobaltab.Text = "Global"; this.N64vpluginglobaltab.UseVisualStyleBackColor = true; // - // jaboStatusDetailLabel - // - this.jaboStatusDetailLabel.AutoSize = true; - this.jaboStatusDetailLabel.Location = new System.Drawing.Point(10, 160); - this.jaboStatusDetailLabel.Name = "jaboStatusDetailLabel"; - this.jaboStatusDetailLabel.Size = new System.Drawing.Size(91, 13); - this.jaboStatusDetailLabel.TabIndex = 20; - this.jaboStatusDetailLabel.Text = "Jabo Status detail"; - // - // jaboStatusLabel - // - this.jaboStatusLabel.AutoSize = true; - this.jaboStatusLabel.Location = new System.Drawing.Point(10, 137); - this.jaboStatusLabel.Name = "jaboStatusLabel"; - this.jaboStatusLabel.Size = new System.Drawing.Size(63, 13); - this.jaboStatusLabel.TabIndex = 19; - this.jaboStatusLabel.Text = "Jabo Status"; - // // label49 // this.label49.AutoSize = true; @@ -3316,6 +3294,50 @@ 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; + this.label71.Location = new System.Drawing.Point(15, 94); + this.label71.Name = "label71"; + this.label71.Size = new System.Drawing.Size(91, 13); + this.label71.TabIndex = 32; + this.label71.Text = "Resolution Height"; + // + // label70 + // + this.label70.AutoSize = true; + this.label70.Location = new System.Drawing.Point(15, 64); + this.label70.Name = "label70"; + this.label70.Size = new System.Drawing.Size(88, 13); + this.label70.TabIndex = 31; + this.label70.Text = "Resolution Width"; + // // JaboClearModeDropDown // this.JaboClearModeDropDown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -3601,50 +3623,6 @@ this.toolTip1.ReshowDelay = 100; this.toolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; // - // label70 - // - this.label70.AutoSize = true; - this.label70.Location = new System.Drawing.Point(15, 64); - this.label70.Name = "label70"; - this.label70.Size = new System.Drawing.Size(88, 13); - this.label70.TabIndex = 31; - this.label70.Text = "Resolution Width"; - // - // label71 - // - this.label71.AutoSize = true; - this.label71.Location = new System.Drawing.Point(15, 94); - this.label71.Name = "label71"; - this.label71.Size = new System.Drawing.Size(91, 13); - this.label71.TabIndex = 32; - this.label71.Text = "Resolution Height"; - // - // 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; - // - // 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; - // // N64VideoPluginconfig // this.AcceptButton = this.SaveButton; @@ -3949,8 +3927,6 @@ private System.Windows.Forms.Label label49; private System.Windows.Forms.ComboBox RspTypeDropdown; private System.Windows.Forms.TabPage JaboTab; - private System.Windows.Forms.Label jaboStatusLabel; - private System.Windows.Forms.Label jaboStatusDetailLabel; private System.Windows.Forms.Label label51; private System.Windows.Forms.ComboBox JaboAnisotropicFilteringLevelDropdown; private System.Windows.Forms.Label label57; diff --git a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs index 8ab8385ad4..5bed5e07f9 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs @@ -19,9 +19,6 @@ namespace BizHawk.Client.EmuHawk private N64Settings s; private N64SyncSettings ss; - private N64JaboManager.JaboStatus currentJaboStatus = N64JaboManager.JaboStatus.NotReady; - - string[] validResolutions = { "320 x 240", "400 x 300", @@ -401,10 +398,6 @@ namespace BizHawk.Client.EmuHawk private void N64VideoPluginconfig_Load(object sender, EventArgs e) { - N64JaboManager manager = new N64JaboManager(); - manager.Scan(); - currentJaboStatus = manager.Status; - s = GetSettings(); ss = GetSyncSettings(); @@ -972,41 +965,12 @@ namespace BizHawk.Client.EmuHawk if (PluginComboBox.Text == "Jabo 1.6.1") { - if (currentJaboStatus == N64JaboManager.JaboStatus.Ready || currentJaboStatus == N64JaboManager.JaboStatus.ReadyToPatch) - { - jaboStatusLabel.Text = "You are ready to use Jabo."; - jaboStatusDetailLabel.Text = ""; - - // Change resolution list to jabo - VideoResolutionComboBox.Items.Clear(); - VideoResolutionComboBox.Items.AddRange(validResolutionsJabo); - } - else - { - jaboStatusDetailLabel.Text = "To use Jabo please copy Jabo_Direct3D8.dll from a Project64 v1.6.1 installation into Bizhawk's dll directory."; - if (currentJaboStatus == N64JaboManager.JaboStatus.NotReady) - { - jaboStatusLabel.Text = "You are NOT ready to use Jabo."; - } - else if (currentJaboStatus == N64JaboManager.JaboStatus.WrongVersion16) - { - jaboStatusLabel.Text = "You are NOT ready to use Jabo. Bizhawk requires Jabo Direct3D8 v1.6.1, but found v1.6 instead."; - } - else if (currentJaboStatus == N64JaboManager.JaboStatus.WrongVersion21) - { - jaboStatusLabel.Text = "You are NOT ready to use Jabo. Bizhawk requires Jabo Direct3D8 v1.6.1, but found v2.0 instead."; - } - - programmaticallyChangingPluginComboBox = true; - PluginComboBox.SelectedItem = previousPluginSelection; - programmaticallyChangingPluginComboBox = false; - } + // Change resolution list to jabo + VideoResolutionComboBox.Items.Clear(); + VideoResolutionComboBox.Items.AddRange(validResolutionsJabo); } else { - jaboStatusLabel.Text = ""; - jaboStatusDetailLabel.Text = ""; - // Change resolution list to the rest VideoResolutionComboBox.Items.Clear(); VideoResolutionComboBox.Items.AddRange(validResolutions); diff --git a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.resx b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.resx index f1e278dae9..af1cb484f3 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.resx +++ b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.resx @@ -120,9 +120,6 @@ 17, 17 - - 17, 17 - Enable/Disable Anisotropic Filtering for Mipmapping (0=no filtering, 2-16=quality). This is uneffective if Mipmapping is 0. diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 09b371a9f5..b1a0b9ef72 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -245,7 +245,6 @@ - diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64JaboManager.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64JaboManager.cs deleted file mode 100644 index 1a6dba84aa..0000000000 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64JaboManager.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.IO; -using System.Security.Cryptography; - -namespace BizHawk.Emulation.Cores.Nintendo.N64 -{ - - public class N64JaboManager - { - string dllDir, rawPath, patchedPath; - - public N64JaboManager() - { - //THIS IS HORRIBLE! PATH MUST BE PASSED IN SOME OTHER WAY - dllDir = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "dll"); - rawPath = Path.Combine(dllDir, "Jabo_Direct3D8.dll"); - patchedPath = Path.Combine(dllDir, "Jabo_Direct3D8_patched.dll"); - } - - public JaboStatus Status { get; private set; } - - public enum JaboStatus - { - NotReady, - ReadyToPatch, - Ready, - WrongVersion21, - WrongVersion16 - }; - - public void Scan() - { - //check whether the file is patched and intact - if (File.Exists(patchedPath)) - { - using (var md5 = MD5.Create()) - { - byte[] hash = md5.ComputeHash(File.ReadAllBytes(patchedPath)); - string hash_string = BitConverter.ToString(hash).Replace("-", ""); - if (hash_string == "F4D6E624489CD88C68A5850426D4D70E") - { - Status = JaboStatus.Ready; - } - } - } - else if (File.Exists(rawPath)) - { - using (var md5 = MD5.Create()) - { - byte[] hash = md5.ComputeHash(File.ReadAllBytes(rawPath)); - string hash_string = BitConverter.ToString(hash).Replace("-", ""); - if (hash_string == "4F353AA71E7455B81205D8EC0AA339E1") - { - // jabo will be patched when a rom is loaded. user is ready to go - Status = JaboStatus.ReadyToPatch; - } - if (hash_string == "4A4173928ED33735157A8D8CD14D4C9C") - { - // wrong jabo installed (2.0) - Status = JaboStatus.WrongVersion21; - } - else if (hash_string == "FF57F60C58EDE6364B980EDCB311873B") - { - // wrong jabo installed (1.6) - Status = JaboStatus.WrongVersion16; - } - } - } - } - - public void Patch() - { - byte[] jaboDLL = File.ReadAllBytes(rawPath); - - //this converts PE sections to have some different security flags (read+write instead of just read, maybe? I can't remember the details) - //without it, NX protection would trip. Why are these flags set oddly? The dll packer, I think. - jaboDLL[583] = 0xA0; - jaboDLL[623] = 0xA0; - jaboDLL[663] = 0xA0; - jaboDLL[703] = 0xA0; - jaboDLL[743] = 0xA0; - jaboDLL[783] = 0xA0; - jaboDLL[823] = 0xA0; - jaboDLL[863] = 0xA0; - File.WriteAllBytes(patchedPath, jaboDLL); - - //re-scan, in case the file didnt get written for some weird reason - Scan(); - } - - } - - -} \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs index 9d849a19c1..90551463c3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs @@ -45,7 +45,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings) { string videoplugin; - bool jaboReady = false; switch (settings.Plugin) { default: @@ -60,14 +59,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi break; case PluginType.Jabo: videoplugin = "mupen64plus-video-jabo.dll"; - - N64JaboManager manager = new N64JaboManager(); - manager.Scan(); - if (manager.Status == N64JaboManager.JaboStatus.ReadyToPatch) - manager.Patch(); - if(manager.Status != N64JaboManager.JaboStatus.Ready) - throw new FileNotFoundException(string.Format("Error: Jabo dll was not found. please copy Jabo_Direct3D8.dll from a Project64 v1.6.1 installation into Bizhawk's dll directory.")); - break; }