src/video/ataricommon/SDL_xbiosevents.c
changeset 820 0b9b4bf3c1e7
parent 769 b8d311d90021
child 1237 a8068adf156b
     1.1 --- a/src/video/ataricommon/SDL_xbiosevents.c	Sat Feb 14 06:04:41 2004 +0000
     1.2 +++ b/src/video/ataricommon/SDL_xbiosevents.c	Sat Feb 14 10:12:27 2004 +0000
     1.3 @@ -31,8 +31,10 @@
     1.4   *	Patrice Mandin
     1.5   */
     1.6  
     1.7 +#include <stdio.h>
     1.8  #include <stdlib.h>
     1.9  #include <string.h>
    1.10 +
    1.11  #include <mint/osbind.h>
    1.12  
    1.13  #include "SDL_events_c.h"
    1.14 @@ -43,10 +45,13 @@
    1.15  
    1.16  int SDL_AtariXbios_enabled=0;
    1.17  
    1.18 -static _KBDVECS *kbdvecs;		/* Pointer to access vectors */
    1.19 -static _KBDVECS sys_kbdvecs;	/* Backup of system vectors */
    1.20 +/* Local variables */
    1.21 +
    1.22 +static _KBDVECS *kbdvecs;		/* Pointer to access system vectors */
    1.23  static Uint16 atari_prevmouseb;	/* buttons */
    1.24  
    1.25 +/* Functions */
    1.26 +
    1.27  void SDL_AtariXbios_InstallVectors(int vectors_mask)
    1.28  {
    1.29  	void *oldpile;
    1.30 @@ -64,10 +69,7 @@
    1.31  	/* Go to supervisor mode */
    1.32  	oldpile=(void *)Super(0);
    1.33  
    1.34 -	/* Backup system vectors */
    1.35 -	memcpy(&sys_kbdvecs, kbdvecs, sizeof(_KBDVECS));
    1.36 -
    1.37 -	/* Install our vector */
    1.38 +	/* Install our vectors */
    1.39  	SDL_AtariXbios_Install(
    1.40  		kbdvecs,
    1.41  		(vectors_mask & ATARI_XBIOS_MOUSEEVENTS) ? SDL_AtariXbios_MouseVector : NULL,
    1.42 @@ -84,11 +86,14 @@
    1.43  {
    1.44  	void *oldpile;
    1.45  
    1.46 +	/* Read IKBD vectors base */
    1.47 +	kbdvecs=Kbdvbase();
    1.48 +
    1.49  	/* Go to supervisor mode */
    1.50  	oldpile=(void *)Super(NULL);
    1.51  
    1.52  	/* Reinstall system vector */
    1.53 -	SDL_AtariXbios_Install(kbdvecs,sys_kbdvecs.mousevec,sys_kbdvecs.joyvec);
    1.54 +	SDL_AtariXbios_Restore(kbdvecs);
    1.55  
    1.56  	/* Back to user mode */
    1.57  	Super(oldpile);