shithub: m8c

Download patch

ref: f6c4e47132704827ca1eaf1f6d28e6e7e19da5d1
parent: 1987da19bdc4a3d1763ab486e02ccd3cee8f5810
author: Jonne Kokkonen <jonne.kokkonen@gmail.com>
date: Wed May 11 16:56:02 EDT 2022

initialize sdl before resetting display, add sdl_quit() to exit

--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
 .DS_Store
 m8c
 .vscode
+.cache/
 font.c
 build/
 compile_commands.json
--- a/main.c
+++ b/main.c
@@ -61,10 +61,10 @@
   if (port == NULL)
     return -1;
 
-  if (enable_and_reset_display(port) == -1)
+  if (initialize_sdl(conf.init_fullscreen, conf.init_use_gpu) == -1)
     run = 0;
 
-  if (initialize_sdl(conf.init_fullscreen, conf.init_use_gpu) == -1)
+  if (enable_and_reset_display(port) == -1)
     run = 0;
 
   #ifdef DEBUG_MSG
@@ -151,6 +151,6 @@
   sp_close(port);
   sp_free_port(port);
   free(serial_buf);
-
+  SDL_Quit();
   return 0;
 }
--