diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 806b5d9258..e3fbb05b13 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -123,6 +123,7 @@ namespace BizHawk.Client.Common public DateTime? Update_LastCheckTimeUTC = null; public string Update_LatestVersion = ""; public string Update_IgnoreVersion = ""; + public bool SkipOutdatedOSCheck = false; public bool CDLAutoSave = true, CDLAutoStart = true, CDLAutoResume = true; /// @@ -268,11 +269,8 @@ namespace BizHawk.Client.Common public int DispPrescale = 1; - /// - /// warning: we dont even want to deal with changing this at runtime. but we want it changed here for config purposes. so dont check this variable. check in GlobalWin or something like that. - /// force DX for Windows and OpenGL for Unix when a new config is generated - /// - public EDispMethod DispMethod = OSTailoredCode.IsUnixHost ? EDispMethod.OpenGL : EDispMethod.SlimDX9; + /// warning: we dont even want to deal with changing this at runtime. but we want it changed here for config purposes. so dont check this variable. check in GlobalWin or something like that. + public EDispMethod DispMethod = EDispMethod.OpenGL; public int DispChrome_FrameWindowed = 2; public bool DispChrome_StatusBarWindowed = true; @@ -300,7 +298,7 @@ namespace BizHawk.Client.Common public int DispCropBottom = 0; // Sound options - public ESoundOutputMethod SoundOutputMethod = OSTailoredCode.IsUnixHost ? ESoundOutputMethod.OpenAL : ESoundOutputMethod.DirectSound; // force OpenAL for Unix when config is generated + public ESoundOutputMethod SoundOutputMethod = ESoundOutputMethod.OpenAL; public bool SoundEnabled = true; public bool SoundEnabledNormal = true; public bool SoundEnabledRWFF = true; diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index 3a97da79d2..18a785832a 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -605,12 +605,6 @@ MsgBox.cs - - Form - - - PrereqsAlert.cs - Component @@ -1469,9 +1463,6 @@ MsgBox.cs - - PrereqsAlert.cs - diff --git a/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.Designer.cs b/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.Designer.cs deleted file mode 100644 index 3ebf156da0..0000000000 --- a/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.Designer.cs +++ /dev/null @@ -1,171 +0,0 @@ -namespace BizHawk.Client.EmuHawk.CustomControls -{ - partial class PrereqsAlert - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PrereqsAlert)); - this.linkLabel1 = new System.Windows.Forms.LinkLabel(); - this.label1 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.linkLabel2 = new System.Windows.Forms.LinkLabel(); - this.button1 = new System.Windows.Forms.Button(); - this.label4 = new System.Windows.Forms.Label(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // linkLabel1 - // - this.linkLabel1.AutoSize = true; - this.linkLabel1.Location = new System.Drawing.Point(21, 214); - this.linkLabel1.Name = "linkLabel1"; - this.linkLabel1.Size = new System.Drawing.Size(168, 13); - this.linkLabel1.TabIndex = 0; - this.linkLabel1.TabStop = true; - this.linkLabel1.Text = "http://tasvideos.org/Bizhawk.html"; - this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(425, 13); - this.label1.TabIndex = 1; - this.label1.Text = "You\'re missing some of the following prerequisites, which prevents BizHawk from r" + - "unning:"; - // - // textBox1 - // - this.textBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.textBox1.Location = new System.Drawing.Point(12, 34); - this.textBox1.Multiline = true; - this.textBox1.Name = "textBox1"; - this.textBox1.ReadOnly = true; - this.textBox1.Size = new System.Drawing.Size(422, 142); - this.textBox1.TabIndex = 2; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(4, 191); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(362, 13); - this.label2.TabIndex = 3; - this.label2.Text = "You should run the latest prerequisites installer from the location indexed by:"; - // - // linkLabel2 - // - this.linkLabel2.AutoSize = true; - this.linkLabel2.Location = new System.Drawing.Point(21, 261); - this.linkLabel2.Name = "linkLabel2"; - this.linkLabel2.Size = new System.Drawing.Size(283, 13); - this.linkLabel2.TabIndex = 4; - this.linkLabel2.TabStop = true; - this.linkLabel2.Text = "https://github.com/TASVideos/BizHawk-Prereqs/releases"; - this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked); - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.Location = new System.Drawing.Point(374, 410); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 6; - this.button1.Text = "Close"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(4, 286); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(141, 13); - this.label4.TabIndex = 7; - this.label4.Text = "Here\'s some general advice:"; - // - // textBox2 - // - this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.textBox2.Location = new System.Drawing.Point(12, 308); - this.textBox2.Multiline = true; - this.textBox2.Name = "textBox2"; - this.textBox2.ReadOnly = true; - this.textBox2.Size = new System.Drawing.Size(332, 125); - this.textBox2.TabIndex = 8; - this.textBox2.Text = resources.GetString("textBox2.Text"); - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(4, 238); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(282, 13); - this.label3.TabIndex = 5; - this.label3.Text = "In case that URL is gone, you can get more information at:"; - // - // PrereqsAlert - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(461, 445); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.label4); - this.Controls.Add(this.button1); - this.Controls.Add(this.label3); - this.Controls.Add(this.linkLabel2); - this.Controls.Add(this.label2); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.label1); - this.Controls.Add(this.linkLabel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "PrereqsAlert"; - this.Text = "Prerequisites Missing!"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.LinkLabel linkLabel1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.LinkLabel linkLabel2; - private System.Windows.Forms.Button button1; - public System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.Label label3; - } -} \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.cs b/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.cs deleted file mode 100644 index 8ba01ec39b..0000000000 --- a/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace BizHawk.Client.EmuHawk.CustomControls -{ - public partial class PrereqsAlert : Form - { - public PrereqsAlert(bool warnOnly) - { - InitializeComponent(); - if (warnOnly) - { - button1.Text = "Continue"; - } - } - - private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - linkLabel1.LinkVisited = true; - System.Diagnostics.Process.Start("http://tasvideos.org/Bizhawk.html"); - } - - private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - linkLabel2.LinkVisited = true; - System.Diagnostics.Process.Start("https://github.com/TASVideos/BizHawk-Prereqs/releases"); - } - - private void button1_Click(object sender, EventArgs e) - { - Close(); - } - } -} diff --git a/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.resx b/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.resx deleted file mode 100644 index 6eeb0fa9ed..0000000000 --- a/BizHawk.Client.EmuHawk/CustomControls/PrereqsAlert.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - We're not checking the version number of the VC 2010 runtime. Be sure you have the SP1 version installed. -DirectX Web Update is reportedly failing for some people as part of our prereqs installer. Try installing it manually. -The VC 2015 prerequisite has prerequisites of its own, so install it yourself manually at your own peril. -You can proceed without Direct3d9 fully installed, but we're going to continue warning you, so you'll come help us figure out what's going wrong. - - \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/Input/IPCKeyInput.cs b/BizHawk.Client.EmuHawk/Input/IPCKeyInput.cs index 8403e9f440..ec59956e1d 100644 --- a/BizHawk.Client.EmuHawk/Input/IPCKeyInput.cs +++ b/BizHawk.Client.EmuHawk/Input/IPCKeyInput.cs @@ -16,8 +16,8 @@ namespace BizHawk.Client.EmuHawk } - private static readonly List PendingEventList = new List(); - private static readonly List EventList = new List(); + private static readonly List PendingEventList = new List(); + private static readonly List EventList = new List(); static void IPCThread() { @@ -38,14 +38,14 @@ namespace BizHawk.Client.EmuHawk int e = br.ReadInt32(); bool pressed = (e & 0x80000000) != 0; lock (PendingEventList) - PendingEventList.Add(new KeyInput.KeyEvent { Key = (Key)(e & 0x7FFFFFFF), Pressed = pressed }); + PendingEventList.Add(new KeyEvent { Key = KeyInput.KeyEnumMap[(Key)(e & 0x7FFFFFFF)], Pressed = pressed }); } } catch { } } } - public static IEnumerable Update() + public static IEnumerable Update() { EventList.Clear(); diff --git a/BizHawk.Client.EmuHawk/Input/Input.cs b/BizHawk.Client.EmuHawk/Input/Input.cs index 9939462753..bce802a768 100644 --- a/BizHawk.Client.EmuHawk/Input/Input.cs +++ b/BizHawk.Client.EmuHawk/Input/Input.cs @@ -129,6 +129,10 @@ namespace BizHawk.Client.EmuHawk public static void Initialize(Control parent) { +#if true + OTK_Keyboard.Initialize(); + OTK_GamePad.Initialize(); +#else if (OSTailoredCode.IsUnixHost) { OTK_Keyboard.Initialize(); @@ -141,16 +145,19 @@ namespace BizHawk.Client.EmuHawk GamePad.Initialize(parent); GamePad360.Initialize(); } +#endif Instance = new Input(); } public static void Cleanup() { +#if false if (!OSTailoredCode.IsUnixHost) { KeyInput.Cleanup(); GamePad.Cleanup(); } +#endif } public enum InputEventType @@ -346,6 +353,10 @@ namespace BizHawk.Client.EmuHawk { while (true) { +#if true + var keyEvents = OTK_Keyboard.Update(); + OTK_GamePad.UpdateAll(); +#else var keyEvents = OSTailoredCode.IsUnixHost ? OTK_Keyboard.Update() : KeyInput.Update().Concat(IPCKeyInput.Update()); @@ -358,6 +369,7 @@ namespace BizHawk.Client.EmuHawk GamePad.UpdateAll(); GamePad360.UpdateAll(); } +#endif //this block is going to massively modify data structures that the binding method uses, so we have to lock it all lock (this) @@ -388,6 +400,7 @@ namespace BizHawk.Client.EmuHawk } } +#if false // analyze xinput foreach (var pad in GamePad360.EnumerateDevices()) { @@ -421,6 +434,7 @@ namespace BizHawk.Client.EmuHawk _floatValues[n] = f; } } +#endif // analyze moose // other sorts of mouse api (raw input) could easily be added as a separate listing under a different class diff --git a/BizHawk.Client.EmuHawk/Input/Keyboard.cs b/BizHawk.Client.EmuHawk/Input/Keyboard.cs index 0306791686..f0fea6692a 100644 --- a/BizHawk.Client.EmuHawk/Input/Keyboard.cs +++ b/BizHawk.Client.EmuHawk/Input/Keyboard.cs @@ -44,6 +44,25 @@ namespace BizHawk.Client.EmuHawk } } + internal static readonly Dictionary KeyEnumMap = new Dictionary + { + // A-Z + {Key.A, OpenTK.Input.Key.A}, {Key.B, OpenTK.Input.Key.B}, {Key.C, OpenTK.Input.Key.C}, {Key.D, OpenTK.Input.Key.D}, {Key.E, OpenTK.Input.Key.E}, {Key.F, OpenTK.Input.Key.F}, {Key.G, OpenTK.Input.Key.G}, {Key.H, OpenTK.Input.Key.H}, {Key.I, OpenTK.Input.Key.I}, {Key.J, OpenTK.Input.Key.J}, {Key.K, OpenTK.Input.Key.K}, {Key.L, OpenTK.Input.Key.L}, {Key.M, OpenTK.Input.Key.M}, {Key.N, OpenTK.Input.Key.N}, {Key.O, OpenTK.Input.Key.O}, {Key.P, OpenTK.Input.Key.P}, {Key.Q, OpenTK.Input.Key.Q}, {Key.R, OpenTK.Input.Key.R}, {Key.S, OpenTK.Input.Key.S}, {Key.T, OpenTK.Input.Key.T}, {Key.U, OpenTK.Input.Key.U}, {Key.V, OpenTK.Input.Key.V}, {Key.W, OpenTK.Input.Key.W}, {Key.X, OpenTK.Input.Key.X}, {Key.Y, OpenTK.Input.Key.Y}, {Key.Z, OpenTK.Input.Key.Z}, + // 0-9 + {Key.D1, OpenTK.Input.Key.Number1}, {Key.D2, OpenTK.Input.Key.Number2}, {Key.D3, OpenTK.Input.Key.Number3}, {Key.D4, OpenTK.Input.Key.Number4}, {Key.D5, OpenTK.Input.Key.Number5}, {Key.D6, OpenTK.Input.Key.Number6}, {Key.D7, OpenTK.Input.Key.Number7}, {Key.D8, OpenTK.Input.Key.Number8}, {Key.D9, OpenTK.Input.Key.Number9}, {Key.D0, OpenTK.Input.Key.Number0}, + // misc. printables (ASCII order) + {Key.Space, OpenTK.Input.Key.Space}, {Key.Apostrophe, OpenTK.Input.Key.Quote}, {Key.Comma, OpenTK.Input.Key.Comma}, {Key.Minus, OpenTK.Input.Key.Minus}, {Key.Period, OpenTK.Input.Key.Period}, {Key.Slash, OpenTK.Input.Key.Slash}, {Key.Semicolon, OpenTK.Input.Key.Semicolon}, {Key.Equals, OpenTK.Input.Key.Plus}, {Key.LeftBracket, OpenTK.Input.Key.BracketLeft}, {Key.Backslash, OpenTK.Input.Key.BackSlash}, {Key.RightBracket, OpenTK.Input.Key.BracketRight}, {Key.Grave, OpenTK.Input.Key.Tilde}, + // misc. (alphabetically) + {Key.Backspace, OpenTK.Input.Key.BackSpace}, {Key.CapsLock, OpenTK.Input.Key.CapsLock}, {Key.Delete, OpenTK.Input.Key.Delete}, {Key.DownArrow, OpenTK.Input.Key.Down}, {Key.End, OpenTK.Input.Key.End}, {Key.Return, OpenTK.Input.Key.Enter}, {Key.Escape, OpenTK.Input.Key.Escape}, {Key.Home, OpenTK.Input.Key.Home}, {Key.Insert, OpenTK.Input.Key.Insert}, {Key.LeftArrow, OpenTK.Input.Key.Left}, {Key.PageDown, OpenTK.Input.Key.PageDown}, {Key.PageUp, OpenTK.Input.Key.PageUp}, {Key.Pause, OpenTK.Input.Key.Pause}, {Key.RightArrow, OpenTK.Input.Key.Right}, {Key.ScrollLock, OpenTK.Input.Key.ScrollLock}, {Key.Tab, OpenTK.Input.Key.Tab}, {Key.UpArrow, OpenTK.Input.Key.Up}, + // modifier + {Key.LeftWindowsKey, OpenTK.Input.Key.WinLeft}, {Key.RightWindowsKey, OpenTK.Input.Key.WinRight}, {Key.LeftControl, OpenTK.Input.Key.ControlLeft}, {Key.RightControl, OpenTK.Input.Key.ControlRight}, {Key.LeftAlt, OpenTK.Input.Key.AltLeft}, {Key.RightAlt, OpenTK.Input.Key.AltRight}, {Key.LeftShift, OpenTK.Input.Key.ShiftLeft}, {Key.RightShift, OpenTK.Input.Key.ShiftRight}, + + // function + {Key.F1, OpenTK.Input.Key.F1}, {Key.F2, OpenTK.Input.Key.F2}, {Key.F3, OpenTK.Input.Key.F3}, {Key.F4, OpenTK.Input.Key.F4}, {Key.F5, OpenTK.Input.Key.F5}, {Key.F6, OpenTK.Input.Key.F6}, {Key.F7, OpenTK.Input.Key.F7}, {Key.F8, OpenTK.Input.Key.F8}, {Key.F9, OpenTK.Input.Key.F9}, {Key.F10, OpenTK.Input.Key.F10}, {Key.F11, OpenTK.Input.Key.F11}, {Key.F12, OpenTK.Input.Key.F12}, + // keypad (alphabetically) + {Key.NumberPad0, OpenTK.Input.Key.Keypad0}, {Key.NumberPad1, OpenTK.Input.Key.Keypad1}, {Key.NumberPad2, OpenTK.Input.Key.Keypad2}, {Key.NumberPad3, OpenTK.Input.Key.Keypad3}, {Key.NumberPad4, OpenTK.Input.Key.Keypad4}, {Key.NumberPad5, OpenTK.Input.Key.Keypad5}, {Key.NumberPad6, OpenTK.Input.Key.Keypad6}, {Key.NumberPad7, OpenTK.Input.Key.Keypad7}, {Key.NumberPad8, OpenTK.Input.Key.Keypad8}, {Key.NumberPad9, OpenTK.Input.Key.Keypad9}, {Key.NumberPadPlus, OpenTK.Input.Key.KeypadAdd}, {Key.NumberPadPeriod, OpenTK.Input.Key.KeypadDecimal}, {Key.NumberPadSlash, OpenTK.Input.Key.KeypadDivide}, {Key.NumberPadEnter, OpenTK.Input.Key.KeypadEnter}, {Key.NumberPadStar, OpenTK.Input.Key.KeypadMultiply}, {Key.NumberPadMinus, OpenTK.Input.Key.KeypadSubtract} + }; + public static IEnumerable Update() { lock (SyncObj) @@ -61,20 +80,14 @@ namespace BizHawk.Client.EmuHawk foreach (var e in events) { foreach (var k in e.PressedKeys) - EventList.Add(new KeyEvent { Key = KeyboardMapping.Handle(k), Pressed = true }); + EventList.Add(new KeyEvent { Key = KeyEnumMap[KeyboardMapping.Handle(k)], Pressed = true }); foreach (var k in e.ReleasedKeys) - EventList.Add(new KeyEvent { Key = KeyboardMapping.Handle(k), Pressed = false }); + EventList.Add(new KeyEvent { Key = KeyEnumMap[KeyboardMapping.Handle(k)], Pressed = false }); } } return EventList; } } - - public struct KeyEvent - { - public Key Key; - public bool Pressed; - } } } diff --git a/BizHawk.Client.EmuHawk/Input/OTK_Keyboard.cs b/BizHawk.Client.EmuHawk/Input/OTK_Keyboard.cs index 7ab287ab5a..ab52f7b0c0 100644 --- a/BizHawk.Client.EmuHawk/Input/OTK_Keyboard.cs +++ b/BizHawk.Client.EmuHawk/Input/OTK_Keyboard.cs @@ -5,26 +5,25 @@ namespace BizHawk.Client.EmuHawk { public static class OTK_Keyboard { - private static readonly Dictionary KeyEnumMap = new Dictionary - { + private static readonly Key[] KeyList = { // A-Z - {Key.A, SlimDX.DirectInput.Key.A}, {Key.B, SlimDX.DirectInput.Key.B}, {Key.C, SlimDX.DirectInput.Key.C}, {Key.D, SlimDX.DirectInput.Key.D}, {Key.E, SlimDX.DirectInput.Key.E}, {Key.F, SlimDX.DirectInput.Key.F}, {Key.G, SlimDX.DirectInput.Key.G}, {Key.H, SlimDX.DirectInput.Key.H}, {Key.I, SlimDX.DirectInput.Key.I}, {Key.J, SlimDX.DirectInput.Key.J}, {Key.K, SlimDX.DirectInput.Key.K}, {Key.L, SlimDX.DirectInput.Key.L}, {Key.M, SlimDX.DirectInput.Key.M}, {Key.N, SlimDX.DirectInput.Key.N}, {Key.O, SlimDX.DirectInput.Key.O}, {Key.P, SlimDX.DirectInput.Key.P}, {Key.Q, SlimDX.DirectInput.Key.Q}, {Key.R, SlimDX.DirectInput.Key.R}, {Key.S, SlimDX.DirectInput.Key.S}, {Key.T, SlimDX.DirectInput.Key.T}, {Key.U, SlimDX.DirectInput.Key.U}, {Key.V, SlimDX.DirectInput.Key.V}, {Key.W, SlimDX.DirectInput.Key.W}, {Key.X, SlimDX.DirectInput.Key.X}, {Key.Y, SlimDX.DirectInput.Key.Y}, {Key.Z, SlimDX.DirectInput.Key.Z}, + Key.A, Key.B, Key.C, Key.D, Key.E, Key.F, Key.G, Key.H, Key.I, Key.J, Key.K, Key.L, Key.M, Key.N, Key.O, Key.P, Key.Q, Key.R, Key.S, Key.T, Key.U, Key.V, Key.W, Key.X, Key.Y, Key.Z, // 0-9 - {Key.Number1, SlimDX.DirectInput.Key.D1}, {Key.Number2, SlimDX.DirectInput.Key.D2}, {Key.Number3, SlimDX.DirectInput.Key.D3}, {Key.Number4, SlimDX.DirectInput.Key.D4}, {Key.Number5, SlimDX.DirectInput.Key.D5}, {Key.Number6, SlimDX.DirectInput.Key.D6}, {Key.Number7, SlimDX.DirectInput.Key.D7}, {Key.Number8, SlimDX.DirectInput.Key.D8}, {Key.Number9, SlimDX.DirectInput.Key.D9}, {Key.Number0, SlimDX.DirectInput.Key.D0}, + Key.Number1, Key.Number2, Key.Number3, Key.Number4, Key.Number5, Key.Number6, Key.Number7, Key.Number8, Key.Number9, Key.Number0, // misc. printables (ASCII order) - {Key.Space, SlimDX.DirectInput.Key.Space}, {Key.Quote, SlimDX.DirectInput.Key.Apostrophe}, {Key.Comma, SlimDX.DirectInput.Key.Comma}, {Key.Minus, SlimDX.DirectInput.Key.Minus}, {Key.Period, SlimDX.DirectInput.Key.Period}, {Key.Slash, SlimDX.DirectInput.Key.Slash}, {Key.Semicolon, SlimDX.DirectInput.Key.Semicolon}, {Key.Plus, SlimDX.DirectInput.Key.Equals}, {Key.BracketLeft, SlimDX.DirectInput.Key.LeftBracket}, {Key.BackSlash, SlimDX.DirectInput.Key.Backslash}, {Key.BracketRight, SlimDX.DirectInput.Key.RightBracket}, {Key.Tilde, SlimDX.DirectInput.Key.Grave}, + Key.Space, Key.Quote, Key.Comma, Key.Minus, Key.Period, Key.Slash, Key.Semicolon, Key.Plus, Key.BracketLeft, Key.BackSlash, Key.BracketRight, Key.Tilde, // misc. (alphabetically) - {Key.BackSpace, SlimDX.DirectInput.Key.Backspace}, {Key.CapsLock, SlimDX.DirectInput.Key.CapsLock}, {Key.Delete, SlimDX.DirectInput.Key.Delete}, {Key.Down, SlimDX.DirectInput.Key.DownArrow}, {Key.End, SlimDX.DirectInput.Key.End}, {Key.Enter, SlimDX.DirectInput.Key.Return}, {Key.Escape, SlimDX.DirectInput.Key.Escape}, {Key.Home, SlimDX.DirectInput.Key.Home}, {Key.Insert, SlimDX.DirectInput.Key.Insert}, {Key.Left, SlimDX.DirectInput.Key.LeftArrow}, {Key.PageDown, SlimDX.DirectInput.Key.PageDown}, {Key.PageUp, SlimDX.DirectInput.Key.PageUp}, {Key.Pause, SlimDX.DirectInput.Key.Pause}, {Key.Right, SlimDX.DirectInput.Key.RightArrow}, {Key.ScrollLock, SlimDX.DirectInput.Key.ScrollLock}, {Key.Tab, SlimDX.DirectInput.Key.Tab}, {Key.Up, SlimDX.DirectInput.Key.UpArrow}, + Key.BackSpace, Key.CapsLock, Key.Delete, Key.Down, Key.End, Key.Enter, Key.Escape, Key.Home, Key.Insert, Key.Left, Key.PageDown, Key.PageUp, Key.Pause, Key.Right, Key.ScrollLock, Key.Tab, Key.Up, // modifier - {Key.WinLeft, SlimDX.DirectInput.Key.LeftWindowsKey}, {Key.WinRight, SlimDX.DirectInput.Key.RightWindowsKey}, {Key.ControlLeft, SlimDX.DirectInput.Key.LeftControl}, {Key.ControlRight, SlimDX.DirectInput.Key.RightControl}, {Key.AltLeft, SlimDX.DirectInput.Key.LeftAlt}, {Key.AltRight, SlimDX.DirectInput.Key.RightAlt}, {Key.ShiftLeft, SlimDX.DirectInput.Key.LeftShift}, {Key.ShiftRight, SlimDX.DirectInput.Key.RightShift}, + Key.WinLeft, Key.WinRight, Key.ControlLeft, Key.ControlRight, Key.AltLeft, Key.AltRight, Key.ShiftLeft, Key.ShiftRight, // function - {Key.F1, SlimDX.DirectInput.Key.F1}, {Key.F2, SlimDX.DirectInput.Key.F2}, {Key.F3, SlimDX.DirectInput.Key.F3}, {Key.F4, SlimDX.DirectInput.Key.F4}, {Key.F5, SlimDX.DirectInput.Key.F5}, {Key.F6, SlimDX.DirectInput.Key.F6}, {Key.F7, SlimDX.DirectInput.Key.F7}, {Key.F8, SlimDX.DirectInput.Key.F8}, {Key.F9, SlimDX.DirectInput.Key.F9}, {Key.F10, SlimDX.DirectInput.Key.F10}, {Key.F11, SlimDX.DirectInput.Key.F11}, {Key.F12, SlimDX.DirectInput.Key.F12}, + Key.F1, Key.F2, Key.F3, Key.F4, Key.F5, Key.F6, Key.F7, Key.F8, Key.F9, Key.F10, Key.F11, Key.F12, // keypad (alphabetically) - {Key.Keypad0, SlimDX.DirectInput.Key.NumberPad0}, {Key.Keypad1, SlimDX.DirectInput.Key.NumberPad1}, {Key.Keypad2, SlimDX.DirectInput.Key.NumberPad2}, {Key.Keypad3, SlimDX.DirectInput.Key.NumberPad3}, {Key.Keypad4, SlimDX.DirectInput.Key.NumberPad4}, {Key.Keypad5, SlimDX.DirectInput.Key.NumberPad5}, {Key.Keypad6, SlimDX.DirectInput.Key.NumberPad6}, {Key.Keypad7, SlimDX.DirectInput.Key.NumberPad7}, {Key.Keypad8, SlimDX.DirectInput.Key.NumberPad8}, {Key.Keypad9, SlimDX.DirectInput.Key.NumberPad9}, {Key.KeypadAdd, SlimDX.DirectInput.Key.NumberPadPlus}, {Key.KeypadDecimal, SlimDX.DirectInput.Key.NumberPadPeriod}, {Key.KeypadDivide, SlimDX.DirectInput.Key.NumberPadSlash}, {Key.KeypadEnter, SlimDX.DirectInput.Key.NumberPadEnter}, {Key.KeypadMultiply, SlimDX.DirectInput.Key.NumberPadStar}, {Key.KeypadSubtract, SlimDX.DirectInput.Key.NumberPadMinus} + Key.Keypad0, Key.Keypad1, Key.Keypad2, Key.Keypad3, Key.Keypad4, Key.Keypad5, Key.Keypad6, Key.Keypad7, Key.Keypad8, Key.Keypad9, Key.KeypadAdd, Key.KeypadDecimal, Key.KeypadDivide, Key.KeypadEnter, Key.KeypadMultiply, Key.KeypadSubtract }; - private static readonly List EventList = new List(); + private static readonly List EventList = new List(); private static KeyboardState _kbState; public static void Initialize () @@ -32,19 +31,19 @@ namespace BizHawk.Client.EmuHawk _kbState = Keyboard.GetState(); } - public static IEnumerable Update () + public static IEnumerable Update() { EventList.Clear(); var lastState = _kbState; try { _kbState = Keyboard.GetState(); - foreach (KeyValuePair entry in KeyEnumMap) + foreach (var key in KeyList) { - if (lastState.IsKeyUp(entry.Key) && _kbState.IsKeyDown(entry.Key)) - EventList.Add(new KeyInput.KeyEvent { Key = entry.Value, Pressed = true }); - else if (lastState.IsKeyDown(entry.Key) && _kbState.IsKeyUp(entry.Key)) - EventList.Add(new KeyInput.KeyEvent { Key = entry.Value, Pressed = false }); + if (lastState.IsKeyUp(key) && _kbState.IsKeyDown(key)) + EventList.Add(new KeyEvent { Key = key, Pressed = true }); + else if (lastState.IsKeyDown(key) && _kbState.IsKeyUp(key)) + EventList.Add(new KeyEvent { Key = key, Pressed = false }); } } catch @@ -104,4 +103,10 @@ namespace BizHawk.Client.EmuHawk return false; } } + + public struct KeyEvent + { + public Key Key; + public bool Pressed; + } } diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 49c0b91cf3..fb61a68148 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -500,6 +500,36 @@ namespace BizHawk.Client.EmuHawk { // I would like to trigger a repaint here, but this isn't done yet }; + + if (!OSTailoredCode.IsUnixHost && !Config.SkipOutdatedOSCheck) + { + static string GetRegValue(string key) + { + using var proc = OSTailoredCode.ConstructSubshell("REG", $@"QUERY ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"" /V {key}"); + proc.Start(); + return proc.StandardOutput.ReadToEnd().Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(new[] { '\t', ' ' }, StringSplitOptions.RemoveEmptyEntries)[2]; + } + var winVer = float.Parse(GetRegValue("CurrentVersion")); + if (winVer < 6.3f) + { + // less than is just easier than equals + using var box = new ExceptionBox($"Quick reminder: Windows {(winVer < 6.2f ? winVer < 6.1f ? winVer < 6.0f ? "XP" : "Vista" : "7" : "8")} is no longer supported by Microsoft. EmuHawk will continue to work, but please get a new operating system for increased security (either Windows 8.1, Windows 10, or a GNU+Linux distro)."); + box.ShowDialog(); + } + else if (GetRegValue("ProductName").Contains("Windows 10")) + { + var win10version = int.Parse(GetRegValue("ReleaseId")); + if (win10version < 1809) + { + using var box = new ExceptionBox($"Quick reminder: version {win10version} of Windows 10 is no longer supported by Microsoft. EmuHawk will continue to work, but please update to at least 1809 \"Redstone 5\" for increased security."); + box.ShowDialog(); + } + } + else + { + // 8.1: can't be bothered writing code for KB installed check, not that I have a Win8.1 machine to test on anyway, so it gets a free pass --yoshi + } + } } private readonly bool _suppressSyncSettingsWarning; diff --git a/BizHawk.Client.EmuHawk/Program.cs b/BizHawk.Client.EmuHawk/Program.cs index c4b6bc10ec..9165e408fd 100644 --- a/BizHawk.Client.EmuHawk/Program.cs +++ b/BizHawk.Client.EmuHawk/Program.cs @@ -11,6 +11,8 @@ using Microsoft.VisualBasic.ApplicationServices; using BizHawk.Common; using BizHawk.Client.Common; +using OSTC = EXE_PROJECT.OSTailoredCode; + namespace BizHawk.Client.EmuHawk { internal static class Program @@ -21,61 +23,47 @@ namespace BizHawk.Client.EmuHawk Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - if (EXE_PROJECT.OSTailoredCode.IsUnixHost) + if (OSTC.IsUnixHost) { // for Unix, skip everything else and just wire up the event handler AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; + return; } - else + + static void CheckLib(string dllToLoad, string desc) { - var libLoader = EXE_PROJECT.OSTailoredCode.LinkedLibManager; - - //http://www.codeproject.com/Articles/310675/AppDomain-AssemblyResolve-Event-Tips - - //try loading libraries we know we'll need - //something in the winforms, etc. code below will cause .net to popup a missing msvcr100.dll in case that one's missing - //but oddly it lets us proceed and we'll then catch it here - var d3dx9 = libLoader.LoadOrNull("d3dx9_43.dll"); - var vc2015 = libLoader.LoadOrNull("vcruntime140.dll"); - var vc2012 = libLoader.LoadOrNull("msvcr120.dll"); //TODO - check version? - var vc2010 = libLoader.LoadOrNull("msvcr100.dll"); //TODO - check version? - var vc2010p = libLoader.LoadOrNull("msvcp100.dll"); - var reqPresent = vc2015.HasValue && vc2010.HasValue && vc2012.HasValue && vc2010p.HasValue; - var optPresent = d3dx9.HasValue; - if (!reqPresent || !optPresent) + var p = OSTC.LinkedLibManager.LoadOrNull(dllToLoad); + if (p == null) { - var alertLines = new[] - { - "[ OK ] .NET CLR (You wouldn't even get here without it)", - $"[{(d3dx9.HasValue ? " OK " : "WARN")}] Direct3d 9", - $"[{(vc2010.HasValue && vc2010p.HasValue ? " OK " : "FAIL")}] Visual C++ 2010 SP1 Runtime", - $"[{(vc2012.HasValue ? " OK " : "FAIL")}] Visual C++ 2012 Runtime", - $"[{(vc2015.HasValue ? " OK " : "FAIL")}] Visual C++ 2015 Runtime" - }; - using var box = new CustomControls.PrereqsAlert(reqPresent) - { - textBox1 = { Text = string.Join(Environment.NewLine, alertLines) } - }; - box.ShowDialog(); - if (!reqPresent) Process.GetCurrentProcess().Kill(); + using (var box = new ExceptionBox($"EmuHawk needs {desc} in order to run! See the readme for more info. (EmuHawk will now close.)")) box.ShowDialog(); + Process.GetCurrentProcess().Kill(); + return; } + OSTC.LinkedLibManager.FreeByPtr(p.Value); + } + CheckLib("vcruntime140.dll", "Microsoft's Universal CRT (MSVC 14.0+ / VS 2015+)"); + CheckLib("msvcr120.dll", "Microsoft's Visual C++ Runtime 12.0 (VS 2013)"); // for Mupen64Plus + CheckLib("msvcr100.dll", "Microsoft's Visual C++ Runtime 10.0 (VS 2010)"); // for BSNES and Mupen64Plus - foreach (var p in new[] { d3dx9, vc2015, vc2012, vc2010, vc2010p }) - if (p.HasValue) libLoader.FreeByPtr(p.Value); + // this will look in subdirectory "dll" to load pinvoked stuff + var dllDir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "dll"); + SetDllDirectory(dllDir); - // this will look in subdirectory "dll" to load pinvoked stuff - var dllDir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "dll"); - SetDllDirectory(dllDir); + //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them + AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; - //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them - AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; - - //but before we even try doing that, whack the MOTW from everything in that directory (thats a dll) - //otherwise, some people will have crashes at boot-up due to .net security disliking MOTW. - //some people are getting MOTW through a combination of browser used to download bizhawk, and program used to dearchive it - WhackAllMOTW(dllDir); - - //We need to do it here too... otherwise people get exceptions when externaltools we distribute try to startup + //but before we even try doing that, whack the MOTW from everything in that directory (thats a dll) + //otherwise, some people will have crashes at boot-up due to .net security disliking MOTW. + //some people are getting MOTW through a combination of browser used to download bizhawk, and program used to dearchive it + //We need to do it here too... otherwise people get exceptions when externaltools we distribute try to startup + static void RemoveMOTW(string path) => DeleteFileW($"{path}:Zone.Identifier"); + var todo = new Queue(new[] { new DirectoryInfo(dllDir) }); + while (todo.Count != 0) + { + var di = todo.Dequeue(); + foreach (var disub in di.GetDirectories()) todo.Enqueue(disub); + foreach (var fi in di.GetFiles("*.dll")) RemoveMOTW(fi.FullName); + foreach (var fi in di.GetFiles("*.exe")) RemoveMOTW(fi.FullName); } } @@ -83,7 +71,7 @@ namespace BizHawk.Client.EmuHawk private static int Main(string[] args) { var exitCode = SubMain(args); - if (EXE_PROJECT.OSTailoredCode.IsUnixHost) + if (OSTC.IsUnixHost) { Console.WriteLine("BizHawk has completed its shutdown routines, killing process..."); Process.GetCurrentProcess().Kill(); @@ -99,7 +87,7 @@ namespace BizHawk.Client.EmuHawk // and there was a TypeLoadException before the first line of SubMain was reached (some static ColorType init?) // zero 25-dec-2012 - only do for public builds. its annoying during development // and don't bother when installed from a package manager i.e. not Windows --yoshi - if (!VersionInfo.DeveloperBuild && !EXE_PROJECT.OSTailoredCode.IsUnixHost) + if (!VersionInfo.DeveloperBuild && !OSTC.IsUnixHost) { var thisversion = typeof(Program).Assembly.GetName().Version; var utilversion = Assembly.Load(new AssemblyName("Bizhawk.Client.Common")).GetName().Version; @@ -197,7 +185,7 @@ namespace BizHawk.Client.EmuHawk goto REDO_DISPMETHOD; } - if (!EXE_PROJECT.OSTailoredCode.IsUnixHost) + if (!OSTC.IsUnixHost) { //WHY do we have to do this? some intel graphics drivers (ig7icd64.dll 10.18.10.3304 on an unknown chip on win8.1) are calling SetDllDirectory() for the process, which ruins stuff. //The relevant initialization happened just before in "create IGL context". @@ -279,25 +267,7 @@ namespace BizHawk.Client.EmuHawk [DllImport("kernel32.dll", EntryPoint = "DeleteFileW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] private static extern bool DeleteFileW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName); - private static void RemoveMOTW(string path) - { - DeleteFileW($"{path}:Zone.Identifier"); - } - - private static void WhackAllMOTW(string dllDir) - { - var todo = new Queue(new[] { new DirectoryInfo(dllDir) }); - while (todo.Count > 0) - { - var di = todo.Dequeue(); - foreach (var disub in di.GetDirectories()) todo.Enqueue(disub); - foreach (var fi in di.GetFiles("*.dll")) - RemoveMOTW(fi.FullName); - foreach (var fi in di.GetFiles("*.exe")) - RemoveMOTW(fi.FullName); - } - } - + /// http://www.codeproject.com/Articles/310675/AppDomain-AssemblyResolve-Event-Tips private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { var requested = args.Name; @@ -316,7 +286,7 @@ namespace BizHawk.Client.EmuHawk //so.. we're going to resort to something really bad. //avert your eyes. var configPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.ini"); - if (!EXE_PROJECT.OSTailoredCode.IsUnixHost // LuaInterface is not currently working on Mono + if (!OSTC.IsUnixHost // LuaInterface is not currently working on Mono && File.Exists(configPath) && (Array.Find(File.ReadAllLines(configPath), line => line.Contains(" \"LuaEngine\": ")) ?? string.Empty) .Contains("0")) diff --git a/README.md b/README.md index abb1343106..01076d4f4b 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,18 @@ A multi-system emulator written in C#. As well as quality-of-life features for casual players, it also has recording/playback and debugging tools, making it the first choice for TASers (Tool-Assisted Speedrunners). -[![unique systems emulated | 27](https://img.shields.io/badge/unique_systems_emulated-27-darkgreen.svg?logo=data:image/png;base64,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&style=popout)](#cores) [![GitHub latest release](https://img.shields.io/github/release/TASVideos/BizHawk.svg?logo=github&logoColor=333333&style=popout)](https://github.com/TASVideos/BizHawk/releases/latest) [![dev builds | AppVeyor](https://img.shields.io/badge/dev_builds-AppVeyor-orange.svg?logo=appveyor&logoColor=333333&style=popout)](https://ci.appveyor.com/project/zeromus/bizhawk-udexo/history) -[![Windows prereqs | GitHub](https://img.shields.io/badge/Windows_prereqs-GitHub-darkred.svg?logo=github&logoColor=333333&style=popout)](https://github.com/TASVideos/BizHawk-Prereqs/releases/latest) [![GitHub open issues counter](https://img.shields.io/github/issues-raw/TASVideos/BizHawk.svg?logo=github&logoColor=333333&style=popout)](https://github.com/TASVideos/BizHawk/issues) -*** - -Click the "release" button above to grab the latest stable version ([changelog at TASVideos](http://tasvideos.org/Bizhawk/ReleaseHistory.html)). - -New user on Windows? Install the prerequisites first, click the "prereqs" button to get that and see [*Installing*](#windows-78110) for info. - -**Never mix different versions** of BizHawk — Keep each version in its own folder. +--- Jump to: * Installing - * [Windows 7/8.1/10](#windows-78110) + * [Windows](#windows) * [Unix](#unix) * Building - * [Windows 7/8.1/10](#windows-78110-1) + * [Windows](#windows-1) * [Unix](#unix-1) * [Usage](#usage) * [TASing](#tasing) @@ -88,27 +80,19 @@ See [*Usage*](#usage) below for info on basic config needed to play games. ## Installing -### Windows 7/8.1/10 +### Windows -Released binaries can be found right here on GitHub: +Released binaries can be found right here on GitHub (also linked at the top of this readme): [![Windows | binaries](https://img.shields.io/badge/Windows-binaries-%230078D6.svg?logo=windows&logoColor=0078D6&style=popout)](https://github.com/TASVideos/BizHawk/releases/latest) -Click `BizHawk-.zip` to download it. Also note the changelog, the full version of which is [here at TASVideos](http://tasvideos.org/Bizhawk/ReleaseHistory.html). **Don't mix different versions** of BizHawk, keep each version in its own folder. +Click `BizHawk-.zip` to download it. Also note the changelog, the full version of which is [here at TASVideos](http://tasvideos.org/Bizhawk/ReleaseHistory.html). Extract it anywhere, but **don't mix different versions** of BizHawk, keep each version in its own folder. Run `EmuHawk.exe` to start. You may move or rename the folder containing `EmuHawk.exe`, even to another drive — as long as you keep all the files together, and the prerequisites are installed when you go to run it. -**Note**: Before you start (by running `EmuHawk.exe`), you'll need the Windows-only prerequisites installed. You can get them all at once with [this program](https://github.com/TASVideos/BizHawk-Prereqs/releases/latest) (you don't need to do this every time BizHawk updates, check the date on its release page, but it can't hurt installing it again to be sure). The specific libraries it installs are: -* .NET Framework 4.6.1 -* Visual C++ Redists - * 2010 SP1 - * 2012 - * 2015 -* Direct3D 9 +EmuHawk does have some prerequisites which it can't work without (it will let you know if they're missing). The list is [here](https://github.com/TASVideos/BizHawk-Prereqs), and we've made an all-in-one installer which you can get [here](https://github.com/TASVideos/BizHawk-Prereqs/releases/latest). You should only have to run this once per machine, unless the changelog says we need something extra. -BizHawk functions like a "portable" program, you may move or rename the folder containing `EmuHawk.exe`, even to another drive — as long as you keep all the files together, and the prerequisites are installed when you go to run it. +We will be [following Microsoft](https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet) in dropping Windows support, that is, we reserve the right to ignore your problems unless you've updated to at least Win10 1809 "Redstone 5" or Win8.1 KB4530702 (latest at time of writing). -Following [Microsoft's support lifecycle](https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet), the supported versions of Windows are: Win10 from 1809 "Redstone 5", Win8.1, and until January, Win7 SP1. - -A "backport" release, [1.13.2](https://github.com/TASVideos/BizHawk/releases/tag/1.13.2), is available for users of Windows XP and/or 32-bit Windows. Being in the 1.x series, many bugs remain and features are missing. +A "backport" release, [1.13.2](https://github.com/TASVideos/BizHawk/releases/tag/1.13.2), is available for users of Windows XP, 7, or 8.1 32-bit. It has many bugs that will never be fixed and it doesn't have all the features of the later versions. [to top](#bizhawk) @@ -126,18 +110,17 @@ The systems that currently work are: GB + GBC (GBHawk), NES (NesHawk), SMS, Atar ## Building -### Windows 7/8.1/10 +### Windows -If you have WSL, Git BASH, or similar, clone the repo with: +If you don't have Git, download [an archive of `master`](https://github.com/TASVideos/BizHawk/archive/master.zip). If you have WSL, Git BASH, or similar, clone the repo with: ``` git clone https://github.com/TASVideos/BizHawk.git BizHawk_master # or ssh: git clone git@github.com:TASVideos/BizHawk.git BizHawk_master ``` -...or use a [Git GUI](https://desktop.github.com). Without git, you'll have to download [an archive of master](https://github.com/TASVideos/BizHawk/archive/master.zip). -Once it's downloaded and extracted, go into the repo's `Dist` folder and run `BuildAndPackage_Release.bat`. BizHawk will be built as a .zip just like any other release. +Once it's downloaded and extracted, go into the repo's `Dist` folder and run `BuildAndPackage_Release.bat`. This is the same process used by AppVeyor. -For anything more complicated than just building, you'll need an IDE like [VS Community 2019](https://visualstudio.microsoft.com/vs/community), currently the best free C# IDE (you may prefer Rider, MonoDevelop, or something else). To start with VS, open `BizHawk.sln` and use the toolbar to choose `Release | Any CPU | BizHawk.Client.EmuHawk` and click the Start button. See [Compiling at TASVideos](http://tasvideos.org/Bizhawk/Compiling.html) for more detailed instructions (warning: somewhat outdated). +For anything more complicated than just building, you'll need an IDE like [VS Community 2019](https://visualstudio.microsoft.com/vs/community), currently the best free C# IDE (you may prefer Rider, MonoDevelop, or something else). To build with VS, open `BizHawk.sln` and use the toolbar to choose `Release | Any CPU | BizHawk.Client.EmuHawk` and click the Start button. See [*Compiling* at TASVideos](http://tasvideos.org/Bizhawk/Compiling.html) for more detailed instructions (warning: somewhat outdated). [to top](#bizhawk)