mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-01-11 07:30:10 +00:00
Update stylecop (plus add stylecop packages to the Intel 8080 set).
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
9a1d5cc762
commit
4799e097de
@ -39,7 +39,7 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
@ -68,6 +68,8 @@
|
|||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
||||||
|
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="MSTest.TestAdapter" version="2.0.0-beta2" targetFramework="net472" />
|
<package id="MSTest.TestAdapter" version="2.0.0-beta2" targetFramework="net472" />
|
||||||
<package id="MSTest.TestFramework" version="2.0.0-beta2" targetFramework="net472" />
|
<package id="MSTest.TestFramework" version="2.0.0-beta2" targetFramework="net472" />
|
||||||
<package id="StyleCop.Analyzers" version="1.1.1-rc.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers" version="1.1.1-rc.108" targetFramework="net472" developmentDependency="true" />
|
||||||
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.108" targetFramework="net472" developmentDependency="true" />
|
||||||
</packages>
|
</packages>
|
@ -34,7 +34,7 @@
|
|||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
|
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
@ -42,12 +42,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AccessLevel.cs" />
|
<Compile Include="AccessLevel.cs" />
|
||||||
@ -79,11 +73,11 @@
|
|||||||
<AdditionalFiles Include="stylecop.json" />
|
<AdditionalFiles Include="stylecop.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.101\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
<None Include="packages.config" />
|
||||||
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.101\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
||||||
|
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="StyleCop.Analyzers" version="1.1.1-rc.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers" version="1.1.1-rc.108" targetFramework="net472" developmentDependency="true" />
|
||||||
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.108" targetFramework="net472" developmentDependency="true" />
|
||||||
</packages>
|
</packages>
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
namespace EightBit
|
namespace EightBit
|
||||||
{
|
{
|
||||||
|
using System;
|
||||||
|
|
||||||
public class Disassembler
|
public class Disassembler
|
||||||
{
|
{
|
||||||
public Disassembler(Bus bus) => this.Bus = bus;
|
public Disassembler(Bus bus) => this.Bus = bus;
|
||||||
@ -124,46 +126,10 @@ namespace EightBit
|
|||||||
throw new System.ArgumentOutOfRangeException(nameof(which));
|
throw new System.ArgumentOutOfRangeException(nameof(which));
|
||||||
}
|
}
|
||||||
|
|
||||||
private string Disassemble(Intel8080 cpu, ushort pc)
|
private static Tuple<string, int> Disassemble(int x, int y, int z, int p, int q)
|
||||||
{
|
{
|
||||||
var opCode = this.Bus.Peek(pc);
|
|
||||||
|
|
||||||
var decoded = cpu.GetDecodedOpCode(opCode);
|
|
||||||
|
|
||||||
var x = decoded.X;
|
|
||||||
var y = decoded.Y;
|
|
||||||
var z = decoded.Z;
|
|
||||||
|
|
||||||
var p = decoded.P;
|
|
||||||
var q = decoded.Q;
|
|
||||||
|
|
||||||
var immediate = this.Bus.Peek((ushort)(pc + 1));
|
|
||||||
var absolute = cpu.PeekWord((ushort)(pc + 1)).Word;
|
|
||||||
var displacement = (sbyte)immediate;
|
|
||||||
var relative = pc + displacement + 2;
|
|
||||||
var indexedImmediate = this.Bus.Peek((ushort)(pc + 1));
|
|
||||||
|
|
||||||
var dumpCount = 0;
|
var dumpCount = 0;
|
||||||
|
|
||||||
var output = $"{opCode:x2}";
|
|
||||||
|
|
||||||
var specification = string.Empty;
|
var specification = string.Empty;
|
||||||
output += Disassemble(ref specification, ref dumpCount, x, y, z, p, q);
|
|
||||||
|
|
||||||
for (var i = 0; i < dumpCount; ++i)
|
|
||||||
{
|
|
||||||
output += $"{this.Bus.Peek((ushort)(pc + i + 1)):x2}";
|
|
||||||
}
|
|
||||||
|
|
||||||
output += '\t';
|
|
||||||
output += string.Format(specification, (int)immediate, (int)absolute, relative, (int)displacement, indexedImmediate);
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string Disassemble(ref string specification, ref int dumpCount, int x, int y, int z, int p, int q)
|
|
||||||
{
|
|
||||||
var output = string.Empty;
|
|
||||||
switch (x)
|
switch (x)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@ -190,7 +156,7 @@ namespace EightBit
|
|||||||
switch (q)
|
switch (q)
|
||||||
{
|
{
|
||||||
case 0: // LD rp,nn
|
case 0: // LD rp,nn
|
||||||
specification = "LXI " + RP(p) + ",{1:X4}H";
|
specification = $"LXI {RP(p)}" + ",{1:X4}H";
|
||||||
dumpCount += 2;
|
dumpCount += 2;
|
||||||
break;
|
break;
|
||||||
case 1: // ADD HL,rp
|
case 1: // ADD HL,rp
|
||||||
@ -415,7 +381,7 @@ namespace EightBit
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return new Tuple<string, int>(specification, dumpCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string RP(int rp)
|
private static string RP(int rp)
|
||||||
@ -476,5 +442,40 @@ namespace EightBit
|
|||||||
|
|
||||||
throw new System.ArgumentOutOfRangeException(nameof(r));
|
throw new System.ArgumentOutOfRangeException(nameof(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string Disassemble(Intel8080 cpu, ushort pc)
|
||||||
|
{
|
||||||
|
var opCode = this.Bus.Peek(pc);
|
||||||
|
|
||||||
|
var decoded = cpu.GetDecodedOpCode(opCode);
|
||||||
|
|
||||||
|
var x = decoded.X;
|
||||||
|
var y = decoded.Y;
|
||||||
|
var z = decoded.Z;
|
||||||
|
|
||||||
|
var p = decoded.P;
|
||||||
|
var q = decoded.Q;
|
||||||
|
|
||||||
|
var immediate = this.Bus.Peek((ushort)(pc + 1));
|
||||||
|
var absolute = cpu.PeekWord((ushort)(pc + 1)).Word;
|
||||||
|
var displacement = (sbyte)immediate;
|
||||||
|
var relative = pc + displacement + 2;
|
||||||
|
var indexedImmediate = this.Bus.Peek((ushort)(pc + 1));
|
||||||
|
|
||||||
|
var disassembled = Disassemble(x, y, z, p, q);
|
||||||
|
var specification = disassembled.Item1;
|
||||||
|
var dumpCount = disassembled.Item2;
|
||||||
|
|
||||||
|
var output = $"{opCode:x2}";
|
||||||
|
for (var i = 0; i < dumpCount; ++i)
|
||||||
|
{
|
||||||
|
output += $"{this.Bus.Peek((ushort)(pc + i + 1)):x2}";
|
||||||
|
}
|
||||||
|
|
||||||
|
output += '\t';
|
||||||
|
output += string.Format(specification, (int)immediate, (int)absolute, relative, (int)displacement, indexedImmediate);
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,12 +37,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Board.cs" />
|
<Compile Include="Board.cs" />
|
||||||
@ -53,6 +47,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<AdditionalFiles Include="stylecop.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\EightBit\EightBit.csproj">
|
<ProjectReference Include="..\..\EightBit\EightBit.csproj">
|
||||||
@ -64,5 +60,9 @@
|
|||||||
<Name>Intel8080</Name>
|
<Name>Intel8080</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
||||||
|
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
@ -6,14 +6,14 @@ namespace Intel8080.Test
|
|||||||
{
|
{
|
||||||
public static class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var configuration = new Configuration();
|
var configuration = new Configuration();
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
configuration.DebugMode = true;
|
configuration.DebugMode = true;
|
||||||
#endif
|
#endif
|
||||||
//configuration.DebugMode = true;
|
configuration.DebugMode = true;
|
||||||
|
|
||||||
using (var harness = new TestHarness(configuration))
|
using (var harness = new TestHarness(configuration))
|
||||||
{
|
{
|
||||||
|
5
Intel8080/Intel8080.Test/packages.config
Normal file
5
Intel8080/Intel8080.Test/packages.config
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="StyleCop.Analyzers" version="1.1.1-rc.108" targetFramework="net472" developmentDependency="true" />
|
||||||
|
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.108" targetFramework="net472" developmentDependency="true" />
|
||||||
|
</packages>
|
19
Intel8080/Intel8080.Test/stylecop.json
Normal file
19
Intel8080/Intel8080.Test/stylecop.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
// ACTION REQUIRED: This file was automatically added to your project, but it
|
||||||
|
// will not take effect until additional steps are taken to enable it. See the
|
||||||
|
// following page for additional information:
|
||||||
|
//
|
||||||
|
// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md
|
||||||
|
|
||||||
|
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
||||||
|
"settings": {
|
||||||
|
"documentationRules": {
|
||||||
|
"documentInterfaces": false,
|
||||||
|
"documentExposedElements": false,
|
||||||
|
"documentInternalElements": false,
|
||||||
|
"documentPrivateElements": false,
|
||||||
|
"documentPrivateFields": false,
|
||||||
|
"companyName": "Adrian Conlon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -246,6 +246,7 @@ namespace EightBit
|
|||||||
this.Tick(4);
|
this.Tick(4);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 1: // 16-bit load immediate/add
|
case 1: // 16-bit load immediate/add
|
||||||
switch (q)
|
switch (q)
|
||||||
@ -261,6 +262,7 @@ namespace EightBit
|
|||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2: // Indirect loading
|
case 2: // Indirect loading
|
||||||
switch (q)
|
switch (q)
|
||||||
@ -289,6 +291,7 @@ namespace EightBit
|
|||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
switch (p)
|
switch (p)
|
||||||
@ -314,10 +317,12 @@ namespace EightBit
|
|||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 3: // 16-bit INC/DEC
|
case 3: // 16-bit INC/DEC
|
||||||
switch (q)
|
switch (q)
|
||||||
@ -331,6 +336,7 @@ namespace EightBit
|
|||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Tick(6);
|
this.Tick(6);
|
||||||
break;
|
break;
|
||||||
case 4: // 8-bit INC
|
case 4: // 8-bit INC
|
||||||
@ -385,25 +391,28 @@ namespace EightBit
|
|||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Tick(4);
|
this.Tick(4);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 1: // 8-bit loading
|
case 1: // 8-bit loading
|
||||||
if (z == 6 && y == 6) // Exception (replaces LD (HL), (HL))
|
if (z == 6 && y == 6)
|
||||||
{
|
{
|
||||||
this.Halt();
|
this.Halt(); // Exception (replaces LD (HL), (HL))
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.R(y, this.R(z));
|
this.R(y, this.R(z));
|
||||||
if ((y == 6) || (z == 6)) // M operations
|
if ((y == 6) || (z == 6))
|
||||||
{
|
{
|
||||||
this.Tick(3);
|
this.Tick(3); // M operations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Tick(4);
|
this.Tick(4);
|
||||||
break;
|
break;
|
||||||
case 2: // Operate on accumulator and register/memory location
|
case 2: // Operate on accumulator and register/memory location
|
||||||
@ -436,6 +445,7 @@ namespace EightBit
|
|||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Tick(4);
|
this.Tick(4);
|
||||||
if (z == 6)
|
if (z == 6)
|
||||||
{
|
{
|
||||||
@ -477,10 +487,12 @@ namespace EightBit
|
|||||||
this.Tick(4);
|
this.Tick(4);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2: // Conditional jump
|
case 2: // Conditional jump
|
||||||
this.JumpConditionalFlag(y);
|
this.JumpConditionalFlag(y);
|
||||||
@ -518,6 +530,7 @@ namespace EightBit
|
|||||||
this.Tick(4);
|
this.Tick(4);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 4: // Conditional call: CALL cc[y], nn
|
case 4: // Conditional call: CALL cc[y], nn
|
||||||
if (this.CallConditionalFlag(y))
|
if (this.CallConditionalFlag(y))
|
||||||
@ -542,10 +555,12 @@ namespace EightBit
|
|||||||
this.Tick(17);
|
this.Tick(17);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 6: // Operate on accumulator and immediate operand: alu[y] n
|
case 6: // Operate on accumulator and immediate operand: alu[y] n
|
||||||
switch (y)
|
switch (y)
|
||||||
@ -577,6 +592,7 @@ namespace EightBit
|
|||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Tick(7);
|
this.Tick(7);
|
||||||
break;
|
break;
|
||||||
case 7: // Restart: RST y * 8
|
case 7: // Restart: RST y * 8
|
||||||
@ -586,6 +602,7 @@ namespace EightBit
|
|||||||
default:
|
default:
|
||||||
throw new NotSupportedException("Invalid operation mode");
|
throw new NotSupportedException("Invalid operation mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -776,11 +793,13 @@ namespace EightBit
|
|||||||
{
|
{
|
||||||
addition = 0x6;
|
addition = 0x6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((this.F & (byte)StatusBits.CF) != 0) || HighNibble(before) > 9 || (HighNibble(before) >= 9 && LowNibble(before) > 9))
|
if (((this.F & (byte)StatusBits.CF) != 0) || HighNibble(before) > 9 || (HighNibble(before) >= 9 && LowNibble(before) > 9))
|
||||||
{
|
{
|
||||||
addition |= 0x60;
|
addition |= 0x60;
|
||||||
carry = true;
|
carry = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Add(addition);
|
this.Add(addition);
|
||||||
this.F = SetFlag(this.F, StatusBits.CF, carry);
|
this.F = SetFlag(this.F, StatusBits.CF, carry);
|
||||||
}
|
}
|
||||||
|
@ -34,12 +34,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Disassembler.cs" />
|
<Compile Include="Disassembler.cs" />
|
||||||
@ -53,5 +47,13 @@
|
|||||||
<Name>EightBit</Name>
|
<Name>EightBit</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<AdditionalFiles Include="stylecop.json" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
||||||
|
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
5
Intel8080/packages.config
Normal file
5
Intel8080/packages.config
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="StyleCop.Analyzers" version="1.1.1-rc.108" targetFramework="net472" developmentDependency="true" />
|
||||||
|
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.108" targetFramework="net472" developmentDependency="true" />
|
||||||
|
</packages>
|
19
Intel8080/stylecop.json
Normal file
19
Intel8080/stylecop.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
// ACTION REQUIRED: This file was automatically added to your project, but it
|
||||||
|
// will not take effect until additional steps are taken to enable it. See the
|
||||||
|
// following page for additional information:
|
||||||
|
//
|
||||||
|
// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md
|
||||||
|
|
||||||
|
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
||||||
|
"settings": {
|
||||||
|
"documentationRules": {
|
||||||
|
"documentInterfaces": false,
|
||||||
|
"documentExposedElements": false,
|
||||||
|
"documentInternalElements": false,
|
||||||
|
"documentPrivateElements": false,
|
||||||
|
"documentPrivateFields": false,
|
||||||
|
"companyName": "Adrian Conlon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -34,7 +34,8 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@ -69,8 +70,8 @@
|
|||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.101\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
||||||
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.101\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="StyleCop.Analyzers" version="1.1.1-rc.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers" version="1.1.1-rc.108" targetFramework="net472" developmentDependency="true" />
|
||||||
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.108" targetFramework="net472" developmentDependency="true" />
|
||||||
</packages>
|
</packages>
|
@ -34,7 +34,7 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@ -64,11 +64,11 @@
|
|||||||
<AdditionalFiles Include="stylecop.json" />
|
<AdditionalFiles Include="stylecop.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.101\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
<None Include="packages.config" />
|
||||||
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.101\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
||||||
|
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="StyleCop.Analyzers" version="1.1.1-rc.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers" version="1.1.1-rc.108" targetFramework="net472" developmentDependency="true" />
|
||||||
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.108" targetFramework="net472" developmentDependency="true" />
|
||||||
</packages>
|
</packages>
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
namespace Z80.Test
|
namespace Z80.Test
|
||||||
{
|
{
|
||||||
using System.Text;
|
|
||||||
using EightBit;
|
using EightBit;
|
||||||
|
|
||||||
internal class Board : Bus
|
internal class Board : Bus
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
@ -32,8 +33,10 @@
|
|||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject />
|
<StartupObject />
|
||||||
@ -41,12 +44,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Board.cs" />
|
<Compile Include="Board.cs" />
|
||||||
@ -56,7 +53,6 @@
|
|||||||
<Compile Include="TestHarness.cs" />
|
<Compile Include="TestHarness.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
|
||||||
<AdditionalFiles Include="stylecop.json" />
|
<AdditionalFiles Include="stylecop.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -69,5 +65,12 @@
|
|||||||
<Name>Z80</Name>
|
<Name>Z80</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
||||||
|
<Analyzer Include="..\..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="StyleCop.Analyzers" version="1.1.1-rc.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers" version="1.1.1-rc.108" targetFramework="net472" developmentDependency="true" />
|
||||||
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.108" targetFramework="net472" developmentDependency="true" />
|
||||||
</packages>
|
</packages>
|
@ -7,7 +7,7 @@
|
|||||||
<ProjectGuid>{C00648C1-BAC1-4EFB-816F-E87C091619D7}</ProjectGuid>
|
<ProjectGuid>{C00648C1-BAC1-4EFB-816F-E87C091619D7}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Z80</RootNamespace>
|
<RootNamespace>EightBit</RootNamespace>
|
||||||
<AssemblyName>Z80</AssemblyName>
|
<AssemblyName>Z80</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
@ -32,17 +32,11 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Disassembler.cs" />
|
<Compile Include="Disassembler.cs" />
|
||||||
@ -62,11 +56,11 @@
|
|||||||
<AdditionalFiles Include="stylecop.json" />
|
<AdditionalFiles Include="stylecop.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.101\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
<None Include="packages.config" />
|
||||||
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.101\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
|
||||||
|
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.108\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="StyleCop.Analyzers" version="1.1.1-rc.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers" version="1.1.1-rc.108" targetFramework="net472" developmentDependency="true" />
|
||||||
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.101" targetFramework="net472" developmentDependency="true" />
|
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.108" targetFramework="net472" developmentDependency="true" />
|
||||||
</packages>
|
</packages>
|
Loading…
x
Reference in New Issue
Block a user