From cfd3d7a56a2459c727222b95f6324ed4018d0ea9 Mon Sep 17 00:00:00 2001 From: sictransit Date: Sun, 16 Apr 2023 15:49:19 +0200 Subject: [PATCH] changed target to net6.0 * changed target to net6.0 * upgraded dependencies * fixed assembler test * code cleanup --- Core/Core.csproj | 6 +++--- Emulator/Emulator.csproj | 8 ++++---- Emulator/Options.cs | 2 +- Emulator/Program.cs | 7 ++++--- Extensions/Extensions.csproj | 4 ++-- Floppy/Floppy.csproj | 4 ++-- Floppy/States/Abstract/ReadWriteSectorBase.cs | 4 ++-- Floppy/States/Abstract/StateBase.cs | 2 +- Floppy/States/Initialize.cs | 4 ++-- Floppy/States/ReadStatus.cs | 4 ++-- Model/Model.csproj | 4 ++-- Teletype/ASR33.cs | 3 +-- Teletype/PunchSettings.cs | 6 +----- Teletype/SVGPunch.cs | 5 +---- Teletype/Teletype.csproj | 6 +++--- TerminalServer/TerminalServer.csproj | 10 +++++----- Tests/Core8Tests/AssemblerTest.cs | 2 +- Tests/Core8Tests/Core8Tests.csproj | 16 ++++++++-------- Tests/Core8Tests/LabelerTest.cs | 9 +++------ Tests/Core8Tests/PunchTests.cs | 1 - Utilities/Utilities.csproj | 4 ++-- 21 files changed, 50 insertions(+), 61 deletions(-) diff --git a/Core/Core.csproj b/Core/Core.csproj index 03982ac..4c1615f 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -2,15 +2,15 @@ Library - net5.0 + net6.0 Core8.Core - - + + diff --git a/Emulator/Emulator.csproj b/Emulator/Emulator.csproj index 7fc7777..0ca4620 100644 --- a/Emulator/Emulator.csproj +++ b/Emulator/Emulator.csproj @@ -2,15 +2,15 @@ Exe - net5.0 + net6.0 Core8 Mikael Fredriksson <micke@sictransit.net> - - - + + + diff --git a/Emulator/Options.cs b/Emulator/Options.cs index 234d9d1..67e85bd 100644 --- a/Emulator/Options.cs +++ b/Emulator/Options.cs @@ -7,7 +7,7 @@ public class Options [Option(Required = false, Default = false, HelpText = "play TINT")] public bool TINT { get; set; } - [Option(Required = false, Default = @"c:\bin\palbart\palbart.exe", HelpText = "PALBART executable, required for assemble")] + [Option(Required = false, Default = @"c:\bin\palbart.exe", HelpText = "PALBART executable, required for assemble")] public string PALBART { get; set; } [Option(Required = false, HelpText = "PAL assembly file")] diff --git a/Emulator/Program.cs b/Emulator/Program.cs index 2ee63d1..fa39e38 100644 --- a/Emulator/Program.cs +++ b/Emulator/Program.cs @@ -5,11 +5,11 @@ using Core8.Utilities; using Serilog; using Serilog.Core; +using Serilog.Events; using System; using System.IO; using System.Net.Http; using System.Threading; -using Serilog.Events; namespace Core8 { @@ -68,8 +68,9 @@ public static void Main(string[] args) if (o.Run) { - if (o.Debug) { - LoggingLevel.MinimumLevel = Serilog.Events.LogEventLevel.Debug; + if (o.Debug) + { + LoggingLevel.MinimumLevel = Serilog.Events.LogEventLevel.Debug; } Run(o.StartingAddress, o.DumpMemory); diff --git a/Extensions/Extensions.csproj b/Extensions/Extensions.csproj index 3afe37e..fa3b8be 100644 --- a/Extensions/Extensions.csproj +++ b/Extensions/Extensions.csproj @@ -1,7 +1,7 @@ - + - net5.0 + net6.0 Core8.Extensions diff --git a/Floppy/Floppy.csproj b/Floppy/Floppy.csproj index 7af24c9..321b2a5 100644 --- a/Floppy/Floppy.csproj +++ b/Floppy/Floppy.csproj @@ -1,12 +1,12 @@  - net5.0 + net6.0 Core8.Peripherals.Floppy - + diff --git a/Floppy/States/Abstract/ReadWriteSectorBase.cs b/Floppy/States/Abstract/ReadWriteSectorBase.cs index aa44a2d..fe70db7 100644 --- a/Floppy/States/Abstract/ReadWriteSectorBase.cs +++ b/Floppy/States/Abstract/ReadWriteSectorBase.cs @@ -1,5 +1,5 @@ -using System; -using Core8.Peripherals.Floppy.Interfaces; +using Core8.Peripherals.Floppy.Interfaces; +using System; namespace Core8.Peripherals.Floppy.States.Abstract { diff --git a/Floppy/States/Abstract/StateBase.cs b/Floppy/States/Abstract/StateBase.cs index 7439ae8..951e5eb 100644 --- a/Floppy/States/Abstract/StateBase.cs +++ b/Floppy/States/Abstract/StateBase.cs @@ -8,7 +8,7 @@ internal abstract class StateBase { private readonly int initialTicks; - private readonly Stopwatch executionTime = new Stopwatch(); + private readonly Stopwatch executionTime = new(); protected StateBase(IController controller) { diff --git a/Floppy/States/Initialize.cs b/Floppy/States/Initialize.cs index f1b645b..da95181 100644 --- a/Floppy/States/Initialize.cs +++ b/Floppy/States/Initialize.cs @@ -1,6 +1,6 @@ -using System; -using Core8.Peripherals.Floppy.Interfaces; +using Core8.Peripherals.Floppy.Interfaces; using Core8.Peripherals.Floppy.States.Abstract; +using System; namespace Core8.Peripherals.Floppy.States { diff --git a/Floppy/States/ReadStatus.cs b/Floppy/States/ReadStatus.cs index b8c3ecc..b9c0d53 100644 --- a/Floppy/States/ReadStatus.cs +++ b/Floppy/States/ReadStatus.cs @@ -1,6 +1,6 @@ -using System; -using Core8.Peripherals.Floppy.Interfaces; +using Core8.Peripherals.Floppy.Interfaces; using Core8.Peripherals.Floppy.States.Abstract; +using System; namespace Core8.Peripherals.Floppy.States { diff --git a/Model/Model.csproj b/Model/Model.csproj index 471ed54..e6b4f2f 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -1,12 +1,12 @@  - net5.0 + net6.0 Core8.Model - + diff --git a/Teletype/ASR33.cs b/Teletype/ASR33.cs index 03d5ae0..e8bf57f 100644 --- a/Teletype/ASR33.cs +++ b/Teletype/ASR33.cs @@ -6,7 +6,6 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Drawing; using System.Linq; using System.Text; @@ -126,7 +125,7 @@ public void RemovePaperTape() } public string Printout => - Encoding.ASCII.GetString(output.Select(x => (byte) (x & 0b_000_001_111_111)).ToArray()); + Encoding.ASCII.GetString(output.Select(x => (byte)(x & 0b_000_001_111_111)).ToArray()); public bool InterruptRequested => InputIRQ || OutputIRQ; diff --git a/Teletype/PunchSettings.cs b/Teletype/PunchSettings.cs index 8ecb044..28fcd3b 100644 --- a/Teletype/PunchSettings.cs +++ b/Teletype/PunchSettings.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Core8.Peripherals.Teletype { @@ -11,7 +7,7 @@ public class PunchSettings { public PunchSettings() : this(Color.LightYellow) { - + } public PunchSettings(Color paperColor, int wrap = 80, bool trimLeader = true, int nullPadding = 12) diff --git a/Teletype/SVGPunch.cs b/Teletype/SVGPunch.cs index 72e322b..09a35ba 100644 --- a/Teletype/SVGPunch.cs +++ b/Teletype/SVGPunch.cs @@ -3,10 +3,7 @@ using System.Collections.Generic; using System.Drawing; using System.Globalization; -using System.IO; using System.Linq; -using System.Security.Cryptography.X509Certificates; -using System.Xml; using System.Xml.Linq; namespace Core8.Peripherals.Teletype @@ -40,7 +37,7 @@ public string Punch(byte[] data, string label = null, string comment = null) if (settings.NullPadding != 0) { - var nulls = Enumerable.Repeat((byte) 0, settings.NullPadding).ToArray(); + var nulls = Enumerable.Repeat((byte)0, settings.NullPadding).ToArray(); data = nulls.Concat(data.SkipWhile(x => x == 0).Reverse().SkipWhile(x => x == 0).Reverse()).Concat(nulls).ToArray(); } diff --git a/Teletype/Teletype.csproj b/Teletype/Teletype.csproj index 27c043d..a1c9557 100644 --- a/Teletype/Teletype.csproj +++ b/Teletype/Teletype.csproj @@ -1,14 +1,14 @@  - net5.0 + net6.0 Core8.Peripherals.Teletype Teletype - - + + diff --git a/TerminalServer/TerminalServer.csproj b/TerminalServer/TerminalServer.csproj index 8dac030..46b563b 100644 --- a/TerminalServer/TerminalServer.csproj +++ b/TerminalServer/TerminalServer.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 Core8.Peripherals Exe @@ -9,10 +9,10 @@ - - - - + + + + diff --git a/Tests/Core8Tests/AssemblerTest.cs b/Tests/Core8Tests/AssemblerTest.cs index e6e0a56..2fcd116 100644 --- a/Tests/Core8Tests/AssemblerTest.cs +++ b/Tests/Core8Tests/AssemblerTest.cs @@ -11,7 +11,7 @@ public class AssemblerTest : PDPTestsBase [TestMethod] public void TestAssembler() { - var assembler = new Assembler(@"c:\bin\palbart\palbart.exe"); + var assembler = new Assembler(@"c:\bin\palbart.exe"); var result = assembler.TryAssemble(@"Assembler\HelloWorld.asm", out string binFilename); diff --git a/Tests/Core8Tests/Core8Tests.csproj b/Tests/Core8Tests/Core8Tests.csproj index 3684421..71aa293 100644 --- a/Tests/Core8Tests/Core8Tests.csproj +++ b/Tests/Core8Tests/Core8Tests.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 false @@ -9,16 +9,16 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/Tests/Core8Tests/LabelerTest.cs b/Tests/Core8Tests/LabelerTest.cs index 4ceab47..8f5b0e2 100644 --- a/Tests/Core8Tests/LabelerTest.cs +++ b/Tests/Core8Tests/LabelerTest.cs @@ -1,20 +1,17 @@ -using Core8.Tests.Abstract; +using Core8.Peripherals.Teletype; +using Core8.Tests.Abstract; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Diagnostics; using System.Drawing; using System.Linq; using System.Net.Http; -using System.Text; using System.Threading; using System.Threading.Tasks; -using Core8.Extensions; -using Core8.Peripherals.Teletype; namespace Core8.Tests { [TestClass] public class LabelerTest : PDPTestsBase - { + { [TestMethod] public async Task TestLabeler() { diff --git a/Tests/Core8Tests/PunchTests.cs b/Tests/Core8Tests/PunchTests.cs index 0762639..ccf653f 100644 --- a/Tests/Core8Tests/PunchTests.cs +++ b/Tests/Core8Tests/PunchTests.cs @@ -1,6 +1,5 @@ using Core8.Peripherals.Teletype; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; using System.Drawing; using System.Linq; using System.Text; diff --git a/Utilities/Utilities.csproj b/Utilities/Utilities.csproj index dac7475..fe31e8e 100644 --- a/Utilities/Utilities.csproj +++ b/Utilities/Utilities.csproj @@ -1,12 +1,12 @@  - net5.0 + net6.0 Core8.Utilities - +