Add a video_clear() routine

This commit is contained in:
Aaron Culliney 2015-08-20 22:12:54 -07:00
parent 85407cfabb
commit a031a23999
2 changed files with 13 additions and 1 deletions

View File

@ -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();
}
// ----------------------------------------------------------------------------

View File

@ -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