From a031a23999e4c7f8a03536635bb6f1271993d9b7 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Thu, 20 Aug 2015 22:12:54 -0700 Subject: [PATCH] Add a video_clear() routine --- src/display.c | 9 ++++++++- src/video/video.h | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/display.c b/src/display.c index 0069d7c8..7409840b 100644 --- a/src/display.c +++ b/src/display.c @@ -1097,10 +1097,16 @@ void video_setpage(int p) { video__current_page = p; } -const uint8_t * const video_current_framebuffer() { +const uint8_t * const video_current_framebuffer(void) { return !video__current_page ? video__fb1 : video__fb2; } +void video_clear(void) { + uint8_t *current_fb = video_current_framebuffer(); + memset(current_fb, 0x0, sizeof(uint8_t)*SCANWIDTH*SCANHEIGHT); + video_setDirty(); +} + void video_redraw(void) { // temporarily reset softswitches @@ -1153,6 +1159,7 @@ void video_redraw(void) { } softswitches = softswitches_save; + video_setDirty(); } // ---------------------------------------------------------------------------- diff --git a/src/video/video.h b/src/video/video.h index 7e216aa2..86fcc072 100644 --- a/src/video/video.h +++ b/src/video/video.h @@ -117,6 +117,11 @@ void video_loadfont(int first, int qty, const uint8_t *data, int mode); */ void video_redraw(void); +/* + * Clear the current display. + */ +void video_clear(void); + /* * Change the displayed video page to PAGE * 0 - Page 1: $400-$7ff/$2000-$3fff