summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2020-10-13 21:40:47 -0700
committerH. Peter Anvin <hpa@zytor.com>2020-10-13 21:40:47 -0700
commit36b5d47212ebd9b7adac82770831c2a3d7d7a458 (patch)
treeb1f88dab7e23773105220dc63e51842c4b65ccf3
parent7b698e06e89f1edc6881c22a5864b1bc69797ce9 (diff)
downloadabc80sim-sdl2.tar.gz
abc80sim-sdl2.tar.xz
abc80sim-sdl2.zip
sdlscrn: move atexit(SDL_Quit) above SDL_Init()sdl2
-rw-r--r--sdlscrn.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sdlscrn.c b/sdlscrn.c
index 13d927d..770ee53 100644
--- a/sdlscrn.c
+++ b/sdlscrn.c
@@ -19,6 +19,11 @@
#define FONT_XSIZE 6
#define FONT_YSIZE 10
+/*
+ * The ABC80/800 screen pixels have a 4:3 aspect ratio in 40-column
+ * mode and 2:3 in 80-column mode. This reflects 80-column mode, with
+ * 40 columns simply being duplicated pixels thereof.
+ */
#define FONT_XDUP 2 /* For 80-column mode */
#define FONT_YDUP 3
@@ -344,12 +349,13 @@ void screen_init(bool width40, bool color)
int debug = 1; /* False = force clean shutdown */
int i, x, y;
+
+ atexit(SDL_Quit);
+
if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO
| (debug ? SDL_INIT_NOPARACHUTE : 0)))
return;
- atexit(SDL_Quit);
-
assert((int)UEV_END <= (int)SDL_NUMEVENTS);
rscreen.surf = SDL_SetVideoMode(PX_WIDTH, PX_HEIGHT, 32,