Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to .NET Core 3 #4

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e077c42
build against 3.0
negativeeddy Sep 25, 2019
0c4be28
enabled non-nullable reference and fixed some issues
negativeeddy Sep 25, 2019
0e4abdb
code cleanup based on new analyzers and new c# syntax
negativeeddy Sep 25, 2019
9c6b6b5
remove unnecessary variable
negativeeddy Sep 25, 2019
ee40481
code cleanup
negativeeddy Sep 25, 2019
dd771b3
replace string extensions with String.Join
negativeeddy Sep 25, 2019
be48d74
remove old comments
negativeeddy Sep 25, 2019
93334e7
passing all unit tests!
negativeeddy Sep 26, 2019
9211188
nullable update for zoperand
negativeeddy Sep 26, 2019
1ddba26
document meaning of null Store property
negativeeddy Sep 26, 2019
45bdc55
nullable private field
negativeeddy Sep 26, 2019
25f386d
remove unused code
negativeeddy Sep 26, 2019
c04a58f
param doesnt support null
negativeeddy Sep 26, 2019
b2b76eb
dont use null
negativeeddy Sep 26, 2019
fdef09a
dont allow return from first stackframe
negativeeddy Sep 26, 2019
f2590be
remove unused code
negativeeddy Sep 26, 2019
e45fd14
remove unused code
negativeeddy Sep 26, 2019
6be9782
re-add the removed serailzation constructor
negativeeddy Sep 26, 2019
c2e905d
more nullable fixins
negativeeddy Sep 26, 2019
b0eae93
fix nullable warnings
negativeeddy Sep 26, 2019
b917ad1
style
negativeeddy Sep 26, 2019
181067a
nullable
negativeeddy Sep 26, 2019
e040e86
removing unused property which was complicating serialization
negativeeddy Sep 26, 2019
5cd2beb
remove unused parameter
negativeeddy Sep 26, 2019
4de1d46
simplifying test
negativeeddy Sep 26, 2019
088e4c7
mark Input nullable
negativeeddy Oct 27, 2019
0794d48
add performance tests
negativeeddy Mar 18, 2020
c498a06
disable perf tests
negativeeddy Oct 25, 2021
ea242af
update to .NET 6
negativeeddy Oct 25, 2021
856ea40
simplify new expression
negativeeddy Oct 25, 2021
d7a4f26
upgrade to latest C#
negativeeddy Oct 25, 2021
57ab4d9
using implicit namespaces and file scoped namespaces
negativeeddy Oct 25, 2021
391f365
simplify startup with top level statements
negativeeddy Oct 25, 2021
55e5b84
updating syntax
negativeeddy Oct 25, 2021
bd31cfd
nulls and optimizations
negativeeddy Oct 25, 2021
c29d480
nulls and style changes
negativeeddy Oct 25, 2021
83f0fba
fixing namespaces
negativeeddy Oct 25, 2021
d2bdbe8
updating style
negativeeddy Oct 25, 2021
ca2a074
update style
negativeeddy Oct 25, 2021
f779ffe
change BranchOffset to use Span
negativeeddy Oct 25, 2021
3796d92
style
negativeeddy Oct 25, 2021
8e017c0
make ZOperand a record
negativeeddy Oct 26, 2021
37df513
style changes to tests
negativeeddy Oct 26, 2021
8f44646
use switch expression
negativeeddy Oct 26, 2021
fb5f012
IList<> to Memory/Span
negativeeddy Oct 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions src/NegativeEddy.Leaflet.CoreConsoleHost/ConsoleInput.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
using System;
using NegativeEddy.Leaflet.IO;
using NegativeEddy.Leaflet.IO;

namespace NegativeEddy.Leaflet.CoreConsoleHost
namespace NegativeEddy.Leaflet.CoreConsoleHost;

class ConsoleInput : IZInput
{
class ConsoleInput : IZInput
{
public char ReadChar()
{
return Console.ReadKey().KeyChar;
}
public char ReadChar() => Console.ReadKey().KeyChar;

public string ReadLine()
{
return Console.ReadLine();
}
}
public string? ReadLine() => Console.ReadLine();
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>NegativeEddy.Leaflet.CoreConsoleHost</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>NegativeEddy.Leaflet.CoreConsoleHost</PackageId>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64;rhel.7.2-x64;ubuntu.14.04-x64</RuntimeIdentifiers>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NegativeEddy.Leaflet\NegativeEddy.Leaflet.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="GameFiles\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
49 changes: 19 additions & 30 deletions src/NegativeEddy.Leaflet.CoreConsoleHost/Program.cs
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
using System;
using NegativeEddy.Leaflet;
using NegativeEddy.Leaflet.CoreConsoleHost;
using System.Diagnostics;
using System.IO;

namespace NegativeEddy.Leaflet.CoreConsoleHost
var zm = new Interpreter
{
public class Program
{
public static void Main(string[] args)
{
var zm = new Interpreter();
zm.Input = new ConsoleInput();
zm.Output.Subscribe(x => Console.Write(x));
zm.Diagnostics.Subscribe(x => Debug.Write(x));
zm.DiagnosticsOutputLevel = Interpreter.DiagnosticsLevel.Verbose;
Input = new ConsoleInput(),
DiagnosticsOutputLevel = Interpreter.DiagnosticsLevel.Verbose,
};

string filename = Path.Combine("GameFiles", "minizork.z3");
using (var stream = File.OpenRead(filename))
{
zm.LoadStory(stream);
}
Console.WriteLine($"Gamefile Version {zm.MainMemory.Header.Version}");
zm.Output.Subscribe(x => Console.Write(x));
zm.Diagnostics.Subscribe(x => Debug.Write(x));

//DumpObjectTree(zm);
string filename = Path.Combine("GameFiles", "minizork.z3");
using (var stream = File.OpenRead(filename))
{
zm.LoadStory(stream);
}
Console.WriteLine($"Gamefile Version {zm.MainMemory.Header.Version}");

//DumpObjects(zm);
//DumpObjectTree(zm);

RunGame(zm);
}
//DumpObjects(zm);

private static void RunGame(Interpreter zm)
{
while (zm.IsRunning)
{
zm.ExecuteCurrentInstruction();
}
}
}
while (zm.IsRunning)
{
zm.ExecuteCurrentInstruction();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
open mailbox
read leaflet
s
e
607,601 changes: 607,601 additions & 0 deletions src/NegativeEddy.Leaflet.CoreTests/GameFiles/miniZork_opcodes_mailbox.dasm

Large diffs are not rendered by default.

304,977 changes: 304,977 additions & 0 deletions src/NegativeEddy.Leaflet.CoreTests/GameFiles/miniZork_opcodes_walkthrough.dasm

Large diffs are not rendered by default.

Binary file not shown.
Loading