From a0d45eace122de62b652dac67ca2052f59bcce4e Mon Sep 17 00:00:00 2001 From: Adrian Conlon <98398945+AdrianConlon@users.noreply.github.com> Date: Sat, 3 May 2025 19:18:03 +0100 Subject: [PATCH] Fix display of registers (from alternate set) when viewing z80 problems --- Z80/Z80.HarteTest/Checker.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Z80/Z80.HarteTest/Checker.cs b/Z80/Z80.HarteTest/Checker.cs index 5425470..a62b927 100644 --- a/Z80/Z80.HarteTest/Checker.cs +++ b/Z80/Z80.HarteTest/Checker.cs @@ -2,7 +2,6 @@ { using EightBit; using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; using System.Diagnostics; internal sealed class Checker @@ -246,6 +245,9 @@ var de_a_good = this.Check("'DE", final.DE_, cpu.DE); var hl_a_good = this.Check("'HL", final.HL_, cpu.HL); + cpu.ExxAF(); + cpu.Exx(); + var i_good = this.Check("I", final.I, cpu.IV); var r_good = this.Check("R", final.R, cpu.REFRESH); @@ -415,7 +417,7 @@ private void AddActualCycle(ushort address, byte value, string action) => this.ActualCycles.Add(new Cycle(address, value, action)); - private string ExpandCycle(string prefix, ushort address, byte? value, string? action) + private static string ExpandCycle(string prefix, ushort address, byte? value, string? action) { ArgumentNullException.ThrowIfNull(action); return value is null @@ -423,7 +425,7 @@ : $"{prefix}: Address: {address:X4}, value: {value:X2}, action: {action}"; } - private string ExpandCycle(string prefix, Cycle cycle) => this.ExpandCycle(prefix, cycle.Address, cycle.Value, cycle.Type); + private static string ExpandCycle(string prefix, Cycle cycle) => ExpandCycle(prefix, cycle.Address, cycle.Value, cycle.Type); private void DumpCycles(IEnumerable expected, IEnumerable actual) { @@ -438,7 +440,7 @@ var message = ""; if (expectedCycle is not null) { - message += this.ExpandCycle("Expected", expectedCycle); + message += ExpandCycle("Expected", expectedCycle); message += " "; } if (actualCycle is not null) @@ -447,7 +449,7 @@ { actualCycle.Value = null; } - var actualMessage = this.ExpandCycle("Actual ", actualCycle); + var actualMessage = ExpandCycle("Actual ", actualCycle); var messagePrefix = expectedCycle is null ? new string(' ', actualMessage.Length + 4) : string.Empty; message += messagePrefix + actualMessage; }