feat(a1): .NET 8 solution scaffold + Model + OpcodeTable loader

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-06 13:49:02 -04:00
parent a2b49445b1
commit ae495967f9
14 changed files with 196 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Age.Engine\Age.Engine.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
using Age.Engine.Sys4;
using Xunit;
public class OpcodeTableTests
{
[Fact]
public void LoadsAll248FromJson()
{
var t = OpcodeTableJson.Load(Paths.OpcodesJson);
Assert.Equal(248, t.Count);
Assert.True(t.TryGet(0x55, out var label, out var argc));
Assert.Equal("mov", label);
Assert.Equal(2, argc);
Assert.Equal("u0041BEB0", t.Label(0x90));
Assert.Equal(7, t.Argc(0x90));
Assert.Equal(-1, t.Argc(0x9999)); // absent -> -1
}
}