diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-06-30 20:45:37 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-06-30 20:45:37 +0200 |
commit | 25228d8927af801667d4be2ea85ee517d1916fc7 (patch) | |
tree | aa5932cfec8b95acdf978e459c9850d1b4a11678 /src/drivers/video/vga.c | |
parent | c1bbac52d78b2e3e93fa43a5a7b3907073493216 (diff) | |
download | abaos-25228d8927af801667d4be2ea85ee517d1916fc7.tar.gz abaos-25228d8927af801667d4be2ea85ee517d1916fc7.tar.bz2 |
almost got a complete mode switch (vga graphics back to text) working
some cleanup in VGA driver code
Diffstat (limited to 'src/drivers/video/vga.c')
-rw-r--r-- | src/drivers/video/vga.c | 18 |
1 files changed, 2 insertions, 16 deletions
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 ) |