]> xenbits.xensource.com Git - seabios.git/commitdiff
vgabios: Fix preserve memory flag in handle_1000
authorKevin O'Connor <kevin@koconnor.net>
Mon, 13 Jul 2020 22:50:52 +0000 (18:50 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 13 Jul 2020 22:50:52 +0000 (18:50 -0400)
Commit 5108c69c made a change to the ordering of some code which broke
the check for the MF_NOCLEARMEM flag.

Reported by felix.von.s@posteo.de

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgasrc/vgabios.c

index 3b9694c69c4bce372467bda059d27ae400154a29..198ee5555584385e19a5ee6db4672f89dd0021a9 100644 (file)
@@ -336,6 +336,9 @@ static void
 handle_1000(struct bregs *regs)
 {
     int mode = regs->al & 0x7f;
+    int flags = MF_LEGACY | (GET_BDA(modeset_ctl) & (MF_NOPALETTE|MF_GRAYSUM));
+    if (regs->al & 0x80)
+        flags |= MF_NOCLEARMEM;
 
     // Set regs->al
     if (mode > 7)
@@ -345,10 +348,6 @@ handle_1000(struct bregs *regs)
     else
         regs->al = 0x30;
 
-    int flags = MF_LEGACY | (GET_BDA(modeset_ctl) & (MF_NOPALETTE|MF_GRAYSUM));
-    if (regs->al & 0x80)
-        flags |= MF_NOCLEARMEM;
-
     vga_set_mode(mode, flags);
 }