diff --git a/StoneRed.LogicSimulator/Program.cs b/StoneRed.LogicSimulator/Program.cs index c727631..bba67a6 100644 --- a/StoneRed.LogicSimulator/Program.cs +++ b/StoneRed.LogicSimulator/Program.cs @@ -1,2 +1,9 @@ -using StoneRed.LogicSimulator.Srls srls = new StoneRed.LogicSimulator.Srls(); +using Myra.Utility; + +using System; +using System.IO; + +AppDomain.CurrentDomain.UnhandledException += (_, e) => File.WriteAllText(Path.Combine(PathUtils.ExecutingAssemblyDirectory, "error.txt"), e.ExceptionObject.ToString()); + +using StoneRed.LogicSimulator.Srls srls = new StoneRed.LogicSimulator.Srls(); srls.Run(); \ No newline at end of file diff --git a/StoneRed.LogicSimulator/Simulation/LogicGates/TestLogicGate.cs b/StoneRed.LogicSimulator/Simulation/LogicGates/TestLogicGate.cs index 4e01ccf..71dd436 100644 --- a/StoneRed.LogicSimulator/Simulation/LogicGates/TestLogicGate.cs +++ b/StoneRed.LogicSimulator/Simulation/LogicGates/TestLogicGate.cs @@ -20,7 +20,7 @@ internal class TestLogicGate : LogicGate, Interfaces.IDrawable { get { - Draw(); + texture.SetData(colors); return texture; } } @@ -28,12 +28,6 @@ internal class TestLogicGate : LogicGate, Interfaces.IDrawable protected internal override void Initialize() { texture = CreateTexture(3, 3); - texture.SetData(new Color[] - { - Color.Red, Color.Blue, Color.Red, - Color.Blue, Color.Red, Color.Blue, - Color.Red, Color.Blue, Color.Red - }); } protected override void Execute() @@ -43,11 +37,6 @@ internal class TestLogicGate : LogicGate, Interfaces.IDrawable colors[i] = GetInputBit(i) == 1 ? Color.Red : Color.Gray; } } - - private void Draw() - { - texture.SetData(colors); - } } #endif \ No newline at end of file