From 25228d8927af801667d4be2ea85ee517d1916fc7 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 30 Jun 2017 20:45:37 +0200 Subject: almost got a complete mode switch (vga graphics back to text) working some cleanup in VGA driver code --- src/drivers/video/vga.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/video/vga.c b/src/drivers/video/vga.c index 647456b..5a53870 100644 --- a/src/drivers/video/vga.c +++ b/src/drivers/video/vga.c @@ -375,26 +375,12 @@ void vga_draw_char( vga_t *vga, const unsigned char c, const int x, const int y, memset( data, bg_color_idx, sizeof( data ) ); for( int xx = 0; xx < vga_font.Width; xx++ ) { if( bmap[yy] & mask[xx] ) { - data[7-xx] = fg_color_idx; + data[vga_font.Width-1-xx] = fg_color_idx; } } uint8_t *addr = vga->base_addr + vga->mode.x * ( y + yy ) + x; - memcpy( addr, data, 8 ); + memcpy( addr, data, vga_font.Width ); } - -// amazingly slow -/* - for( int xx = 0; xx < vga_font.Width; xx++ ) { - for( int yy = 0; yy < vga_font.Height; yy++ ) { - if( bmap[yy] & mask[xx] ) { - vga_set_pixel( vga, x + 10 - xx, y + yy, foreground ); - } else { -// drawing only what's needed, the background is done by the widget -// vga_set_pixel( vga, x + 10 - xx, y + yy, background ); - } - } - } -*/ } void vga_wait_for_retrace( vga_t *vga ) -- cgit v1.2.3-54-g00ecf