From 7867cfa3f4a95c277de4142fa0ff9abad8653452 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Sat, 14 Oct 2017 17:54:44 +0200 Subject: [PATCH] atari:gem: Do not call appl_exit after testing if AES available, and keep generated application id --- src/video/gem/SDL_gemvideo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/video/gem/SDL_gemvideo.c b/src/video/gem/SDL_gemvideo.c index c31dbc389..d90c3d444 100644 --- a/src/video/gem/SDL_gemvideo.c +++ b/src/video/gem/SDL_gemvideo.c @@ -68,6 +68,8 @@ /* Variables */ +static short internal_ap_id; + static unsigned char vdi_index[256] = { 0, 2, 3, 6, 4, 7, 5, 8, 9, 10, 11, 14, 12, 15, 13, 255 @@ -110,10 +112,10 @@ static void GEM_GL_SwapBuffers(_THIS); static int GEM_Available(void) { /* Test if AES available */ - if (appl_init() == -1) + internal_ap_id = appl_init(); + if (internal_ap_id == -1) return 0; - appl_exit(); return 1; } @@ -302,7 +304,7 @@ int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat) short work_in[12], work_out[272], dummy; /* Open AES (Application Environment Services) */ - GEM_ap_id = appl_init(); + GEM_ap_id = internal_ap_id; if (GEM_ap_id == -1) { fprintf(stderr,"Can not open AES\n"); return 1;