rayzor
diff src/dosemu/dosemu.c @ 9:70e332156d02
moving along
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 10 Apr 2014 02:31:31 +0300 |
parents | fcd06a15dfdd |
children | d94a69933a71 |
line diff
1.1 --- a/src/dosemu/dosemu.c Mon Apr 07 08:46:06 2014 +0300 1.2 +++ b/src/dosemu/dosemu.c Thu Apr 10 02:31:31 2014 +0300 1.3 @@ -10,10 +10,11 @@ 1.4 #include "keyb.h" 1.5 #include "timer.h" 1.6 1.7 +static void cleanup(void); 1.8 static void proc_events(void); 1.9 static void capture_frame(unsigned char *frame); 1.10 1.11 -static void init_sdl() 1.12 +static void init_sdl(void) 1.13 { 1.14 const SDL_version *ver; 1.15 1.16 @@ -23,9 +24,15 @@ 1.17 if((ver = SDL_Linked_Version())) { 1.18 printf("SDL %d.%d.%d initialized\n", ver->major, ver->minor, ver->patch); 1.19 } 1.20 + atexit(cleanup); 1.21 } 1.22 } 1.23 1.24 +static void cleanup(void) 1.25 +{ 1.26 + SDL_Quit(); 1.27 +} 1.28 + 1.29 /* ----- graphics (gfx.c (vbe) implementation) ----- */ 1.30 static SDL_Surface *fbsurf; 1.31 static int scale = 1; 1.32 @@ -74,7 +81,6 @@ 1.33 { 1.34 SDL_ShowCursor(1); 1.35 SDL_EnableKeyRepeat(0, 0); 1.36 - SDL_Quit(); 1.37 return 0; 1.38 } 1.39 1.40 @@ -178,7 +184,7 @@ 1.41 } 1.42 1.43 /* also print fps every second ... */ 1.44 - { 1.45 + /*{ 1.46 static long prev_fps, num_frames; 1.47 long msec, dt; 1.48 1.49 @@ -193,7 +199,7 @@ 1.50 } else { 1.51 num_frames++; 1.52 } 1.53 - } 1.54 + }*/ 1.55 } 1.56 1.57 #define spin_delay(ms) \ 1.58 @@ -206,14 +212,15 @@ 1.59 1.60 void wait_vsync(void) 1.61 { 1.62 - static int prev_msec; 1.63 - int msec, dt, tleft; 1.64 + /*static int prev_msec; 1.65 + int msec, dt, tleft;*/ 1.66 1.67 if(!copy_frame_called) { 1.68 copy_frame(0); 1.69 copy_frame_called = 0; 1.70 } 1.71 1.72 + /* 1.73 msec = SDL_GetTicks(); 1.74 1.75 dt = msec - prev_msec; 1.76 @@ -234,6 +241,7 @@ 1.77 } else { 1.78 prev_msec = msec; 1.79 } 1.80 + */ 1.81 } 1.82 1.83 static int cap_count = 0;