[PATCH 09/20] Add a cycInt handler that can be used to break out of m68k_go()

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


---
 src/cycInt.c          | 9 ++++++++-
 src/includes/cycInt.h | 1 +
 src/jaguar/jaguar.c   | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/cycInt.c b/src/cycInt.c
index 62b5f273..666143b7 100644
--- a/src/cycInt.c
+++ b/src/cycInt.c
@@ -79,6 +79,12 @@ int PendingInterruptCount;
 
 static int CycInt_DelayedCycles;
 
+static void CycInt_InterruptHandler_End_M68kGo(void)
+{
+	CycInt_AcknowledgeInterrupt();
+	M68000_EndTimeSlice();
+}
+
 /* List of possible interrupt handlers to be stored in 'InterruptHandlers[]'
  * The list should be in the same order than the enum type 'interrupt_id' */
 static void (* const pIntHandlerFunctions[MAX_INTERRUPTS])(void) =
@@ -109,7 +115,8 @@ static void (* const pIntHandlerFunctions[MAX_INTERRUPTS])(void) =
 	SCC_InterruptHandler_RX_A,
 	SCC_InterruptHandler_BRG_B,
 	SCC_InterruptHandler_TX_RX_B,
-	SCC_InterruptHandler_RX_B
+	SCC_InterruptHandler_RX_B,
+	CycInt_InterruptHandler_End_M68kGo,
 };
 
 /* Event timer structure - keeps next timer to occur in structure so don't need
diff --git a/src/includes/cycInt.h b/src/includes/cycInt.h
index 3dfb9293..b466773c 100644
--- a/src/includes/cycInt.h
+++ b/src/includes/cycInt.h
@@ -39,6 +39,7 @@ typedef enum
   INTERRUPT_SCC_BRG_B,
   INTERRUPT_SCC_TX_RX_B,
   INTERRUPT_SCC_RX_B,
+  INTERRUPT_M68K_GO,
 
   MAX_INTERRUPTS
 } interrupt_id;
diff --git a/src/jaguar/jaguar.c b/src/jaguar/jaguar.c
index 9a400b9f..06621ae5 100644
--- a/src/jaguar/jaguar.c
+++ b/src/jaguar/jaguar.c
@@ -1533,6 +1533,8 @@ void JaguarReset(void)
 	SetCallbackTime(ScanlineCallback, 31.77775);
 //	SetCallbackTime(RenderCallback, 33303.082);	// # Scanlines * scanline time
 //	SetCallbackTime(RenderCallback, 16651.541);	// # Scanlines * scanline time
+
+	CycInt_Reset();
 }
 
 void JaguarDone(void)
-- 
2.48.1


--MP_/VkVZp1l8MIESxWVe2vPSxV2
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=0010-Add-the-possibility-to-raise-an-interrupt-on-the-m68.patch



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/