Correctly handle switches between graphics and text mode
authorH. Peter Anvin <hpa@zytor.com>
Wed, 25 Jul 2007 00:25:57 +0000 (17:25 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 25 Jul 2007 00:25:57 +0000 (17:25 -0700)
com32/lib/sys/ansicon_write.c
com32/modules/menumain.c

index 4f8eaee..338bc4b 100644 (file)
@@ -88,15 +88,15 @@ int __ansicon_open(struct file_info *fp)
     if ( (signed char)oreg.ebx.b[1] < 0 ) {
       ti.disabled = 1;
     } else {
+      /* Force text mode */
+      ireg.eax.w[0] = 0x0005;
+      __intcall(0x22, &ireg, NULL);
+
       /* Initial state */
       ti.rows = BIOS_ROWS ? BIOS_ROWS+1 : 25;
       ti.cols = BIOS_COLS;
       __ansi_init(&ti);
 
-      /* Force text mode */
-      ireg.eax.w[0] = 0x0005;
-      __intcall(0x22, &ireg, NULL);
-
       /* Get cursor shape and position */
       ireg.eax.b[1] = 0x03;
       ireg.ebx.b[1] = BIOS_PAGE;
index 73082f7..257477b 100644 (file)
@@ -761,6 +761,8 @@ do_hidden_menu(void)
   int key;
   int timeout_left, this_timeout;
 
+  clear_screen();
+
   if ( !setjmp(timeout_jump) ) {
     timeout_left = timeout;