From f9754dd62fa1fe86f7fccd5997fbe0e5af52e6a9 Mon Sep 17 00:00:00 2001 From: Adrian Conlon <98398945+AdrianConlon@users.noreply.github.com> Date: Sat, 3 May 2025 13:54:18 +0100 Subject: [PATCH] Fix some z80 eight-bit load timing issues. 58 issues remaining --- Z80/Z80.HarteTest/Checker.cs | 5 ++++- Z80/Z80.HarteTest/ProcessorTestSuite.cs | 4 ++-- Z80/Z80.cs | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Z80/Z80.HarteTest/Checker.cs b/Z80/Z80.HarteTest/Checker.cs index cfc791a..5425470 100644 --- a/Z80/Z80.HarteTest/Checker.cs +++ b/Z80/Z80.HarteTest/Checker.cs @@ -2,6 +2,7 @@ { using EightBit; using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; using System.Diagnostics; internal sealed class Checker @@ -446,7 +447,9 @@ { actualCycle.Value = null; } - message += this.ExpandCycle("Actual ", actualCycle); + var actualMessage = this.ExpandCycle("Actual ", actualCycle); + var messagePrefix = expectedCycle is null ? new string(' ', actualMessage.Length + 4) : string.Empty; + message += messagePrefix + actualMessage; } Debug.Assert(!string.IsNullOrEmpty(message), "Message should not be empty"); this.Messages.Add(message); diff --git a/Z80/Z80.HarteTest/ProcessorTestSuite.cs b/Z80/Z80.HarteTest/ProcessorTestSuite.cs index 26c1ea3..bddc40d 100644 --- a/Z80/Z80.HarteTest/ProcessorTestSuite.cs +++ b/Z80/Z80.HarteTest/ProcessorTestSuite.cs @@ -6,8 +6,8 @@ public IEnumerable OpcodeTests() { - //var pattern = "fd 7e.json"; - //var pattern = "7e.json"; + //var pattern = "dd 66.json"; + //var pattern = "06.json"; var pattern = "*.json"; foreach (var filename in Directory.EnumerateFiles(this.Location, pattern)) { diff --git a/Z80/Z80.cs b/Z80/Z80.cs index c3da440..85a9191 100644 --- a/Z80/Z80.cs +++ b/Z80/Z80.cs @@ -1377,6 +1377,7 @@ namespace Z80 if (memoryZ || memoryY) { this.FetchDisplacement(); + this.Tick(5); } if (memoryZ)