diff options
Diffstat (limited to 'src/ppu.c')
-rw-r--r-- | src/ppu.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -22,12 +22,17 @@ | |||
22 | WITH REGARD TO THIS SOFTWARE. | 22 | WITH REGARD TO THIS SOFTWARE. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | // Parameters. | ||
26 | static int zoom = 2; | ||
27 | static int frames_per_update = 5; | ||
28 | static int blits_per_refresh = 60 * 5; | ||
29 | |||
25 | static size_t screen_width = 0; | 30 | static size_t screen_width = 0; |
26 | static size_t screen_height = 0; | 31 | static size_t screen_height = 0; |
27 | static size_t bpp = 0; | 32 | static size_t bpp = 0; |
28 | static int fb_file = 0; | 33 | static int fb_file = 0; |
29 | static int refresh_file = 0; | 34 | static int refresh_file = 0; |
30 | static int zoom = 2; | 35 | static frames_refresh = 0; |
31 | 36 | ||
32 | static u8 *framebuffer = 0; | 37 | static u8 *framebuffer = 0; |
33 | 38 | ||
@@ -242,5 +247,12 @@ blit_framebuffer(void) { | |||
242 | } | 247 | } |
243 | dirty_lines[j] = 0; | 248 | dirty_lines[j] = 0; |
244 | } | 249 | } |
250 | // NOTE: Maybe this should happen on blit_framebuffer depending on | ||
251 | // the number of actual updates (uxn applications that don't modify | ||
252 | // the framebuffer shouldn't have to blink). | ||
253 | if (++frames_refresh > blits_per_refresh) { | ||
254 | write(refresh_file, "1", 1); | ||
255 | frames_refresh = 0; | ||
256 | } | ||
245 | reqdraw = 0; | 257 | reqdraw = 0; |
246 | } | 258 | } |