aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gui.c b/gui.c
index cd98a38..4879581 100644
--- a/gui.c
+++ b/gui.c
@@ -182,12 +182,16 @@ guiemu(unsigned short *m, unsigned short *r)
scratch = SDL_CreateRGBSurface(SDL_HWSURFACE, scr.w, scr.h, 8, 0, 0, 0, 0);
SDL_SetColors(scratch, color, 0, 16);
+ atexit(SDL_Quit);
+
loadfont(m, "font.xpm");
while ((c = step(m, r)) != -1) {
if ((n += c) < 100)
continue;
+ n = 0;
+
if (SDL_MUSTLOCK(screen) && SDL_LockSurface(screen))
continue;
@@ -204,7 +208,6 @@ guiemu(unsigned short *m, unsigned short *r)
if (SDL_MUSTLOCK(screen))
SDL_UnlockSurface(screen);
- n = 0;
if (keyboard(m) == -1)
break;
}