From 7a2e9a06e2d57b738361419d131ed9ace9333c24 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 15 Jun 2017 21:42:55 +0200 Subject: added a clear screen method to graphics mode VGA driver --- src/drivers/video/vga.c | 7 +++++-- src/drivers/video/vga.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/video/vga.c b/src/drivers/video/vga.c index 83b3578..c385bea 100644 --- a/src/drivers/video/vga.c +++ b/src/drivers/video/vga.c @@ -262,7 +262,10 @@ void vga_draw_rectangle( vga_t *vga, const int x, const int y, const int w, cons vga_set_pixel( vga, xx, yy, color ); } } -// memset( vga->mode.segment, get_color_index( color ), -// vga->mode.x * vga->mode.y ); } +void vga_clear_screen( vga_t *vga, const vga_color_t color ) +{ + memset( vga->mode.segment, get_color_index( color ), + vga->mode.x * vga->mode.y ); +} diff --git a/src/drivers/video/vga.h b/src/drivers/video/vga.h index 6f70afa..69b4591 100644 --- a/src/drivers/video/vga.h +++ b/src/drivers/video/vga.h @@ -62,5 +62,6 @@ vga_color_t vga_make_RGB( int R, int G, int B ); void vga_set_pixel( vga_t *vga, const int x, const int y, const vga_color_t color ); void vga_draw_rectangle( vga_t *vga, const int x, const int y, const int w, const int h, const vga_color_t color ); +void vga_clear_screen( vga_t *vga, const vga_color_t color ); #endif // VGA_H -- cgit v1.2.3-54-g00ecf