From 37e9af7ca62b5bac72a56b2b8e847e5c0a5a1a6b Mon Sep 17 00:00:00 2001 From: RogueAI42 Date: Mon, 19 Jun 2017 20:01:38 +1000 Subject: made MindBlow wayyy faster More threads. More responsive. The IBFListener calls don't wait for the WinForms updates to finish now. They put changes onto a few variables using a lock and then activate a dormant thread to actually run those on the worker thread. Once it's done, that dormant thread goes back to waiting for an AutoResetEvent to fire that tells it when there's actually work to do. So it shouldn't chew up any CPU. I found out about this object working on this project and now I want to find everywhere in the game that uses a while loop to wait for stuff, and replace it with this. --- ShiftOS.WinForms/Applications/MindBlow.Designer.cs | 48 +++++++++++----------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'ShiftOS.WinForms/Applications/MindBlow.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/MindBlow.Designer.cs b/ShiftOS.WinForms/Applications/MindBlow.Designer.cs index ad2304d..6a8474d 100644 --- a/ShiftOS.WinForms/Applications/MindBlow.Designer.cs +++ b/ShiftOS.WinForms/Applications/MindBlow.Designer.cs @@ -32,16 +32,16 @@ this.console = new System.Windows.Forms.TabPage(); this.consoleout = new System.Windows.Forms.TextBox(); this.program = new System.Windows.Forms.TabPage(); + this.stop = new System.Windows.Forms.Button(); this.run = new System.Windows.Forms.Button(); this.save = new System.Windows.Forms.Button(); this.load = new System.Windows.Forms.Button(); this.programinput = new System.Windows.Forms.TextBox(); this.monitor = new System.Windows.Forms.TabPage(); + this.reset = new System.Windows.Forms.Button(); this.memlist = new System.Windows.Forms.ListBox(); this.instptr = new System.Windows.Forms.Label(); this.memptr = new System.Windows.Forms.Label(); - this.stop = new System.Windows.Forms.Button(); - this.reset = new System.Windows.Forms.Button(); this.tabs.SuspendLayout(); this.console.SuspendLayout(); this.program.SuspendLayout(); @@ -79,6 +79,7 @@ this.consoleout.Multiline = true; this.consoleout.Name = "consoleout"; this.consoleout.ReadOnly = true; + this.consoleout.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.consoleout.Size = new System.Drawing.Size(378, 237); this.consoleout.TabIndex = 0; // @@ -97,6 +98,16 @@ this.program.Text = "Program"; this.program.UseVisualStyleBackColor = true; // + // stop + // + this.stop.Location = new System.Drawing.Point(303, 217); + this.stop.Name = "stop"; + this.stop.Size = new System.Drawing.Size(75, 23); + this.stop.TabIndex = 4; + this.stop.Text = "Stop"; + this.stop.UseVisualStyleBackColor = true; + this.stop.Click += new System.EventHandler(this.stop_Click); + // // run // this.run.Location = new System.Drawing.Point(196, 217); @@ -132,6 +143,7 @@ this.programinput.Location = new System.Drawing.Point(3, 0); this.programinput.Multiline = true; this.programinput.Name = "programinput"; + this.programinput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.programinput.Size = new System.Drawing.Size(378, 218); this.programinput.TabIndex = 0; // @@ -148,6 +160,17 @@ this.monitor.Text = "Monitor"; this.monitor.UseVisualStyleBackColor = true; // + // reset + // + this.reset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.reset.Location = new System.Drawing.Point(306, 8); + this.reset.Name = "reset"; + this.reset.Size = new System.Drawing.Size(75, 23); + this.reset.TabIndex = 3; + this.reset.Text = "Reset"; + this.reset.UseVisualStyleBackColor = true; + this.reset.Click += new System.EventHandler(this.reset_Click); + // // memlist // this.memlist.FormattingEnabled = true; @@ -176,27 +199,6 @@ this.memptr.TabIndex = 0; this.memptr.Text = "Memory: 0"; // - // stop - // - this.stop.Location = new System.Drawing.Point(303, 217); - this.stop.Name = "stop"; - this.stop.Size = new System.Drawing.Size(75, 23); - this.stop.TabIndex = 4; - this.stop.Text = "Stop"; - this.stop.UseVisualStyleBackColor = true; - this.stop.Click += new System.EventHandler(this.stop_Click); - // - // reset - // - this.reset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.reset.Location = new System.Drawing.Point(306, 8); - this.reset.Name = "reset"; - this.reset.Size = new System.Drawing.Size(75, 23); - this.reset.TabIndex = 3; - this.reset.Text = "Reset"; - this.reset.UseVisualStyleBackColor = true; - this.reset.Click += new System.EventHandler(this.reset_Click); - // // MindBlow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); -- cgit v1.2.3