[Commits] SDL: atari:xbios: Call NOVA routines in supervisor mode

libsdl.org revision control commits-owner at libsdl.org
Sun Dec 3 09:11:19 PST 2017


details:   https://hg.libsdl.org/SDL/rev/d1eed22a751d
changeset: 11717:d1eed22a751d
user:      Patrice Mandin <patmandin at gmail.com>
date:      Sun Dec 03 18:11:12 2017 +0100
description:
atari:xbios: Call NOVA routines in supervisor mode

diffstat:

 src/video/xbios/SDL_xbios_nova.c |  17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diffs (66 lines):

diff -r 193b23fb2bd7 -r d1eed22a751d src/video/xbios/SDL_xbios_nova.c
--- a/src/video/xbios/SDL_xbios_nova.c	Wed Nov 08 20:41:07 2017 +0100
+++ b/src/video/xbios/SDL_xbios_nova.c	Sun Dec 03 18:11:12 2017 +0100
@@ -257,10 +257,14 @@
 
 static void NOVA_SetMode(_THIS, int num_mode)
 {
+	void *oldstack;
+
 	if ((num_mode<0) || (num_mode>=NOVA_modecount)) {
 		return;
 	}
 
+	oldstack = (void *)Super(NULL);
+
 	__asm__ __volatile__ (
 			"moveql	#0,d0\n\t"
 			"movel	%0,a0\n\t"
@@ -272,10 +276,16 @@
 		: /* clobbered registers */
 			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
 	);
+
+	SuperToUser(oldstack);
 }
 
 static void NOVA_SetScreen(_THIS, void *screen)
 {
+	void *oldstack;
+
+	oldstack = (void *)Super(NULL);
+
 	__asm__ __volatile__ (
 			"movel	%0,a0\n\t"
 			"movel	%1,a1\n\t"
@@ -286,16 +296,21 @@
 		: /* clobbered registers */
 			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
 	);
+
+	SuperToUser(oldstack);
 }
 
 static void NOVA_SetColor(_THIS, int index, int r, int g, int b)
 {
 	Uint8 color[3];
+	void *oldstack;
 
 	color[0] = r;
 	color[1] = g;
 	color[2] = b;
 
+	oldstack = (void *)Super(NULL);
+
 	__asm__ __volatile__ (
 			"movel	%0,d0\n\t"
 			"movel	%1,a0\n\t"
@@ -307,6 +322,8 @@
 		: /* clobbered registers */
 			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
 	);
+
+	SuperToUser(oldstack);
 }
 
 static nova_resolution_t *NOVA_LoadModes(int *num_modes)


More information about the commits mailing list