From f4f4357a3e19082e9027b7290651fbb5a2100eae Mon Sep 17 00:00:00 2001 From: Adrian Conlon <98398945+AdrianConlon@users.noreply.github.com> Date: Sat, 3 May 2025 00:51:20 +0100 Subject: [PATCH] More z80 timing fixes, 261 errors --- Z80/Z80.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Z80/Z80.cs b/Z80/Z80.cs index 7ff2603..4d25aa9 100644 --- a/Z80/Z80.cs +++ b/Z80/Z80.cs @@ -771,11 +771,19 @@ namespace Z80 { this.Bus.Address.Assign(this.HL); } - if (access == AccessLevel.ReadOnly) + + switch (access) { - _ = this.MemoryRead(); + case AccessLevel.ReadOnly: + this.MemoryRead(); + break; + case AccessLevel.WriteOnly: + this.Tick(); + break; + default: + throw new NotSupportedException("Invalid access level"); } - this.Tick(); + // Will need a post-MemoryWrite return ref this.Bus.Data; case 7: