changeset 1778:30b5952fd32e mame_interp

Get latency between interrupt latch and interrupt acceptance working with Musashi
author Michael Pavone <pavone@retrodev.com>
date Wed, 13 Mar 2019 22:01:22 -0700
parents 5358a7126b96
children 0c6d07f91346
files m68k_core.c musashi/m68kcpu.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/m68k_core.c	Wed Mar 13 20:34:24 2019 -0700
+++ b/m68k_core.c	Wed Mar 13 22:01:22 2019 -0700
@@ -1287,6 +1287,7 @@
 	
 #endif
 	context->int_cycle = CYCLE_NEVER;
+	context->int_pending = 255;
 	context->status = 0x27;
 	context->reset_handler = (code_ptr)reset_handler;
 	return context;
--- a/musashi/m68kcpu.c	Wed Mar 13 20:34:24 2019 -0700
+++ b/musashi/m68kcpu.c	Wed Mar 13 22:01:22 2019 -0700
@@ -898,9 +898,17 @@
 	/* If we are halted, don't do anything */
 	if(this->stopped)
 		return;
+		
+	if (this->c.int_pending == 255) {
+		this->c.int_pending = int_level;
+		return;
+	} else {
+		int_level = this->c.int_pending;
+	}
 
 	/* Acknowledge the interrupt */
 	this->c.int_ack = int_level;
+	this->c.int_pending = 255;
 	
 	vector = M68K_INT_ACK_AUTOVECTOR;//int_ack_callback(*this, int_level);