changeset 2412:ed7b4d869989

Fix nmi_start not getting adjusted during a cycle adjustment
author Michael Pavone <pavone@retrodev.com>
date Thu, 04 Jan 2024 22:14:29 -0800
parents efd2242c2c23
children 64cf80e683aa
files z80_to_x86.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/z80_to_x86.c	Thu Jan 04 22:13:46 2024 -0800
+++ b/z80_to_x86.c	Thu Jan 04 22:14:29 2024 -0800
@@ -3787,6 +3787,13 @@
 			}
 		}
 	}
+	if (context->nmi_start != CYCLE_NEVER) {
+		if (context->nmi_start < deduction) {
+			context->nmi_start = 0;
+		} else {
+			context->nmi_start -= deduction;
+		}
+	}
 }
 
 uint32_t zbreakpoint_patch(z80_context * context, uint16_t address, code_ptr dst)