From 821d6b410e02897f84c4b732f3678f64e396c9cf Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 31 Dec 2011 18:19:22 -0500 Subject: vgabios: Refactor vga_set_mode and stdvga_set_mode. Split out the BDA setup part of vga_set_mode to new function modeswitch_set_bda. Move the remaining parts (palette loading, screen clearing, font loading) of vga_set_mode into stdvga_set_mode. Add new mode switching flags and pass them to stdvga_set_mode, so it does not need to inspect modeset_ctl directly. Move code needed by stdvga_set_mode (perform_gray_scale_summing, clear_screen) to stdvga.c. Signed-off-by: Kevin O'Connor --- vgasrc/vgafb.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'vgasrc/vgafb.c') diff --git a/vgasrc/vgafb.c b/vgasrc/vgafb.c index 19ab1df..38ed070 100644 --- a/vgasrc/vgafb.c +++ b/vgasrc/vgafb.c @@ -158,24 +158,6 @@ vgafb_scroll(int nblines, int attr, struct cursorpos ul, struct cursorpos lr) } } -void -clear_screen(struct vgamode_s *vmode_g) -{ - switch (GET_GLOBAL(vmode_g->memmodel)) { - case CTEXT: - case MTEXT: - memset16_far(GET_GLOBAL(vmode_g->sstart), 0, 0x0720, 32*1024); - break; - case CGA: - memset16_far(GET_GLOBAL(vmode_g->sstart), 0, 0x0000, 32*1024); - break; - default: - // XXX - old code gets/sets/restores sequ register 2 to 0xf - - // but it should always be 0xf anyway. - memset16_far(GET_GLOBAL(vmode_g->sstart), 0, 0x0000, 64*1024); - } -} - /**************************************************************** * Read/write characters to screen -- cgit v1.2.1