From c7c9963db3e528740a170f2e7bbb76b40eb23c41 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sat, 16 Nov 2019 22:29:42 +0000 Subject: [PATCH] Actually, the refresh register is incremented halfway through M1, as the M1 pin is raised. i.e. just before the refresh phase of the M1 cycle. Signed-off-by: Adrian Conlon --- Z80/Z80.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Z80/Z80.cs b/Z80/Z80.cs index b6bcb39..7877333 100644 --- a/Z80/Z80.cs +++ b/Z80/Z80.cs @@ -442,15 +442,15 @@ namespace EightBit protected virtual void OnRaisingM1() => this.RaisingM1?.Invoke(this, EventArgs.Empty); - protected virtual void OnRaisedM1() => this.RaisedM1?.Invoke(this, EventArgs.Empty); + protected virtual void OnRaisedM1() + { + ++this.REFRESH; + this.RaisedM1?.Invoke(this, EventArgs.Empty); + } protected virtual void OnLoweringM1() => this.LoweringM1?.Invoke(this, EventArgs.Empty); - protected virtual void OnLoweredM1() - { - ++this.REFRESH; - this.LoweredM1?.Invoke(this, EventArgs.Empty); - } + protected virtual void OnLoweredM1() => this.LoweredM1?.Invoke(this, EventArgs.Empty); protected virtual void OnRaisingRFSH() => this.RaisingRFSH?.Invoke(this, EventArgs.Empty);