X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=seabios.git;a=blobdiff_plain;f=vgasrc%2Fvgabios.c;h=31636cc04ec3f6a863320f6ea733e541b5379d1a;hp=7bed069556cbaa61d1093f7fe9377aacb2cca51b;hb=80da87da8db00f7e5a88aeae7f17dbbb074518b8;hpb=2c8ba89aab21dcd400a923887843696dc00a9645 diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c index 7bed069..31636cc 100644 --- a/vgasrc/vgabios.c +++ b/vgasrc/vgabios.c @@ -329,18 +329,26 @@ void modeswitch_set_bda(int mode, int flags, struct vgamode_s *vmode_g) { // Set the BIOS mem - u16 cheight = GET_GLOBAL(vmode_g->cheight); + int width = GET_GLOBAL(vmode_g->width); + int height = GET_GLOBAL(vmode_g->height); + int cheight = GET_GLOBAL(vmode_g->cheight); SET_BDA(video_mode, mode); - SET_BDA(video_cols, GET_GLOBAL(vmode_g->twidth)); + if (GET_GLOBAL(vmode_g->memmodel) == MM_TEXT) { + SET_BDA(video_cols, width); + SET_BDA(video_rows, height-1); + SET_BDA(cursor_type, 0x0607); + } else { + int cwidth = GET_GLOBAL(vmode_g->cwidth); + SET_BDA(video_cols, width / cwidth); + SET_BDA(video_rows, (height / cheight) - 1); + SET_BDA(cursor_type, 0x0000); + } SET_BDA(video_pagesize, GET_GLOBAL(vmode_g->slength)); SET_BDA(crtc_address, stdvga_get_crtc()); - SET_BDA(video_rows, GET_GLOBAL(vmode_g->theight)-1); SET_BDA(char_height, cheight); SET_BDA(video_ctl, 0x60 | (flags & MF_NOCLEARMEM ? 0x80 : 0x00)); SET_BDA(video_switches, 0xF9); SET_BDA(modeset_ctl, GET_BDA(modeset_ctl) & 0x7f); - SET_BDA(cursor_type - , GET_GLOBAL(vmode_g->memmodel) == MM_TEXT ? 0x0607 : 0x0000); int i; for (i=0; i<8; i++) SET_BDA(cursor_pos[i], 0x0000);