Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Also save/restore fpu register in vbl interrupt
  • Loading branch information
pmandin committed Oct 21, 2006
1 parent 85d55a3 commit 11ef95a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/timer/mint/SDL_systimer.c
Expand Up @@ -48,6 +48,9 @@

#include "SDL_vbltimer_s.h"

/* from audio/mint */
void SDL_MintAudio_CheckFpu(void);

/* The first ticks value of the application */
static Uint32 start;
static SDL_bool supervisor;
Expand Down Expand Up @@ -124,6 +127,8 @@ SDL_SYS_TimerInit(void)

supervisor = SDL_FALSE;

SDL_MintAudio_CheckFpu();

/* Install RunTimer in vbl vector */
oldpile = (void *) Super(0);
timer_installed = !SDL_AtariVblInstall(RunTimer);
Expand Down
24 changes: 24 additions & 0 deletions src/timer/mint/SDL_vbltimer.S
Expand Up @@ -33,6 +33,8 @@
.globl _SDL_AtariVblInstall
.globl _SDL_AtariVblUninstall

.globl _SDL_MintAudio_hasfpu

/*--- Vector installer ---*/

_SDL_AtariVblInstall:
Expand Down Expand Up @@ -113,8 +115,30 @@ _my_vbl:
notw vbl_mutex

moveml d0-d7/a0-a6,sp@-

/* Save FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_AtariVbl_nofpu1
.chip 68060
fsave sp@-
fmoveml fpcr/fpsr/fpiar,sp@-
fmovemx fp0-fp7,sp@-
.chip 68000
SDL_AtariVbl_nofpu1:

movel my_vector,a0
jsr a0@

/* Restore FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_AtariVbl_Xbios_nofpu2
.chip 68060
fmovemx sp@+,fp0-fp7
fmoveml sp@+,fpcr/fpsr/fpiar
frestore sp@+
.chip 68000
SDL_AtariVbl_Xbios_nofpu2:

moveml sp@+,d0-d7/a0-a6

clrw vbl_mutex
Expand Down

0 comments on commit 11ef95a

Please sign in to comment.