atari:xbios: Call NOVA routines in supervisor mode SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sun, 03 Dec 2017 18:11:12 +0100
branchSDL-1.2
changeset 11717d1eed22a751d
parent 11695 193b23fb2bd7
atari:xbios: Call NOVA routines in supervisor mode
src/video/xbios/SDL_xbios_nova.c
     1.1 --- a/src/video/xbios/SDL_xbios_nova.c	Wed Nov 08 20:41:07 2017 +0100
     1.2 +++ b/src/video/xbios/SDL_xbios_nova.c	Sun Dec 03 18:11:12 2017 +0100
     1.3 @@ -257,10 +257,14 @@
     1.4  
     1.5  static void NOVA_SetMode(_THIS, int num_mode)
     1.6  {
     1.7 +	void *oldstack;
     1.8 +
     1.9  	if ((num_mode<0) || (num_mode>=NOVA_modecount)) {
    1.10  		return;
    1.11  	}
    1.12  
    1.13 +	oldstack = (void *)Super(NULL);
    1.14 +
    1.15  	__asm__ __volatile__ (
    1.16  			"moveql	#0,d0\n\t"
    1.17  			"movel	%0,a0\n\t"
    1.18 @@ -272,10 +276,16 @@
    1.19  		: /* clobbered registers */
    1.20  			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
    1.21  	);
    1.22 +
    1.23 +	SuperToUser(oldstack);
    1.24  }
    1.25  
    1.26  static void NOVA_SetScreen(_THIS, void *screen)
    1.27  {
    1.28 +	void *oldstack;
    1.29 +
    1.30 +	oldstack = (void *)Super(NULL);
    1.31 +
    1.32  	__asm__ __volatile__ (
    1.33  			"movel	%0,a0\n\t"
    1.34  			"movel	%1,a1\n\t"
    1.35 @@ -286,16 +296,21 @@
    1.36  		: /* clobbered registers */
    1.37  			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
    1.38  	);
    1.39 +
    1.40 +	SuperToUser(oldstack);
    1.41  }
    1.42  
    1.43  static void NOVA_SetColor(_THIS, int index, int r, int g, int b)
    1.44  {
    1.45  	Uint8 color[3];
    1.46 +	void *oldstack;
    1.47  
    1.48  	color[0] = r;
    1.49  	color[1] = g;
    1.50  	color[2] = b;
    1.51  
    1.52 +	oldstack = (void *)Super(NULL);
    1.53 +
    1.54  	__asm__ __volatile__ (
    1.55  			"movel	%0,d0\n\t"
    1.56  			"movel	%1,a0\n\t"
    1.57 @@ -307,6 +322,8 @@
    1.58  		: /* clobbered registers */
    1.59  			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
    1.60  	);
    1.61 +
    1.62 +	SuperToUser(oldstack);
    1.63  }
    1.64  
    1.65  static nova_resolution_t *NOVA_LoadModes(int *num_modes)