Also save/restore fpu register in vbl interrupt SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sat, 21 Oct 2006 18:53:33 +0000
branchSDL-1.2
changeset 3883cfe850b334e7
parent 3882 842b03d703c5
child 3884 dba874934f0c
Also save/restore fpu register in vbl interrupt
src/timer/mint/SDL_systimer.c
src/timer/mint/SDL_vbltimer.S
     1.1 --- a/src/timer/mint/SDL_systimer.c	Sun Oct 01 02:30:03 2006 +0000
     1.2 +++ b/src/timer/mint/SDL_systimer.c	Sat Oct 21 18:53:33 2006 +0000
     1.3 @@ -48,6 +48,9 @@
     1.4  
     1.5  #include "SDL_vbltimer_s.h"
     1.6  
     1.7 +/* from audio/mint */
     1.8 +void SDL_MintAudio_CheckFpu(void);
     1.9 +
    1.10  /* The first ticks value of the application */
    1.11  static Uint32 start;
    1.12  static SDL_bool supervisor;
    1.13 @@ -119,6 +122,8 @@
    1.14  
    1.15  	supervisor=SDL_FALSE;
    1.16  
    1.17 +	SDL_MintAudio_CheckFpu();
    1.18 +
    1.19  	/* Install RunTimer in vbl vector */
    1.20  	oldpile=(void *)Super(0);
    1.21  	timer_installed = !SDL_AtariVblInstall(RunTimer);
     2.1 --- a/src/timer/mint/SDL_vbltimer.S	Sun Oct 01 02:30:03 2006 +0000
     2.2 +++ b/src/timer/mint/SDL_vbltimer.S	Sat Oct 21 18:53:33 2006 +0000
     2.3 @@ -33,6 +33,8 @@
     2.4  	.globl	_SDL_AtariVblInstall
     2.5  	.globl	_SDL_AtariVblUninstall
     2.6  
     2.7 +	.globl	_SDL_MintAudio_hasfpu
     2.8 +
     2.9  /*--- Vector installer ---*/
    2.10  
    2.11  _SDL_AtariVblInstall:
    2.12 @@ -113,8 +115,30 @@
    2.13  	notw	vbl_mutex
    2.14  
    2.15  	moveml	d0-d7/a0-a6,sp@-
    2.16 +
    2.17 +	/* Save FPU if needed */
    2.18 +	tstw	_SDL_MintAudio_hasfpu
    2.19 +	beqs	SDL_AtariVbl_nofpu1
    2.20 +	.chip	68060
    2.21 +	fsave	sp@-
    2.22 +	fmoveml fpcr/fpsr/fpiar,sp@-
    2.23 +	fmovemx	fp0-fp7,sp@-
    2.24 +	.chip	68000
    2.25 +SDL_AtariVbl_nofpu1:
    2.26 +
    2.27  	movel	my_vector,a0
    2.28  	jsr		a0@
    2.29 +
    2.30 +	/* Restore FPU if needed */
    2.31 +	tstw	_SDL_MintAudio_hasfpu
    2.32 +	beqs	SDL_AtariVbl_Xbios_nofpu2
    2.33 +	.chip	68060
    2.34 +	fmovemx	sp@+,fp0-fp7
    2.35 +	fmoveml	sp@+,fpcr/fpsr/fpiar
    2.36 +	frestore	sp@+
    2.37 +	.chip	68000
    2.38 +SDL_AtariVbl_Xbios_nofpu2:
    2.39 +
    2.40  	moveml	sp@+,d0-d7/a0-a6
    2.41  
    2.42  	clrw	vbl_mutex