Reserve space in system buffer to call XBIOS from interrupt
authorPatrice Mandin <patmandin@gmail.com>
Wed, 20 Jul 2005 17:40:58 +0000
changeset 1096 37b766becf3b
parent 1095 f10892fa2e48
child 1097 c83fa1c650dd
Reserve space in system buffer to call XBIOS from interrupt
src/audio/mint/SDL_mintaudio_it.S
--- a/src/audio/mint/SDL_mintaudio_it.S	Wed Jul 20 17:39:10 2005 +0000
+++ b/src/audio/mint/SDL_mintaudio_it.S	Wed Jul 20 17:40:58 2005 +0000
@@ -53,6 +53,9 @@
 	- Then we swap the buffers
 */
 
+#define	savptr	0x4a2
+#define	savamt	0x46
+
 /*--- GSXB interrupt vector ---*/
 
 	.text
@@ -130,6 +133,9 @@
 	/* Callback */
 	jsr	_SDL_MintAudio_Callback
 
+	/* Reserve space for registers */
+	subl	#savamt,savptr
+
 	/* Set new buffer */
 
 	moveq	#0,d0
@@ -149,6 +155,9 @@
 	trap	#14
 	lea	sp@(12),sp
 
+	/* Restore registers space */
+	addl	#savamt,savptr
+
 	moveml	sp@+,d0-d7/a0-a6
 
 	clrw	_SDL_MintAudio_mutex