atari:gem: Do not call appl_exit after testing if AES available, and keep generated application id SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sat, 14 Oct 2017 17:54:44 +0200
branchSDL-1.2
changeset 116245de87f16eda5
parent 11609 3d3ad743ac60
child 11680 9517c54ab59c
atari:gem: Do not call appl_exit after testing if AES available, and keep generated application id
src/video/gem/SDL_gemvideo.c
     1.1 --- a/src/video/gem/SDL_gemvideo.c	Thu Oct 12 23:11:02 2017 +0200
     1.2 +++ b/src/video/gem/SDL_gemvideo.c	Sat Oct 14 17:54:44 2017 +0200
     1.3 @@ -68,6 +68,8 @@
     1.4  
     1.5  /* Variables */
     1.6  
     1.7 +static short internal_ap_id;
     1.8 +
     1.9  static unsigned char vdi_index[256] = {
    1.10  	0,  2,  3,  6,  4,  7,  5,   8,
    1.11  	9, 10, 11, 14, 12, 15, 13, 255
    1.12 @@ -110,10 +112,10 @@
    1.13  static int GEM_Available(void)
    1.14  {
    1.15  	/* Test if AES available */
    1.16 -	if (appl_init() == -1)
    1.17 +	internal_ap_id = appl_init();
    1.18 +	if (internal_ap_id == -1)
    1.19  		return 0;
    1.20  
    1.21 -	appl_exit();
    1.22  	return 1;
    1.23  }
    1.24  
    1.25 @@ -302,7 +304,7 @@
    1.26  	short work_in[12], work_out[272], dummy;
    1.27  
    1.28  	/* Open AES (Application Environment Services) */
    1.29 -	GEM_ap_id = appl_init();
    1.30 +	GEM_ap_id = internal_ap_id;
    1.31  	if (GEM_ap_id == -1) {
    1.32  		fprintf(stderr,"Can not open AES\n");
    1.33  		return 1;