瀏覽代碼

* getVESAInfo (real mode) would always return TRUE, this would crash
windowed VESA modes.
* getVESAInfo (protected mode) would still continue on with
setting up the VESA structure, even if VESA was not
detected!

carl 26 年之前
父節點
當前提交
1bca153f22
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      rtl/inc/graph/vesa.inc

+ 6 - 4
rtl/inc/graph/vesa.inc

@@ -162,7 +162,11 @@ end;
     regs.edi := $00;
     RealIntr($10, regs);
     if VESAPtr^.Signature <> 'VESA' then
-      getVesaInfo := FALSE
+     begin
+         getVesaInfo := FALSE;
+         GlobalDosFree(word(longint(VESAPtr) shr 16));
+         exit;
+     end
     else
       getVesaInfo := TRUE;
     { The mode pointer buffer points to a real mode memory }
@@ -232,8 +236,7 @@ end;
    end;
 
 {$ELSE}
-  function getVESAInfo(var VESAInfo: TVESAInfo) : boolean;
-  begin
+  function getVESAInfo(var VESAInfo: TVESAInfo) : boolean; assembler;
   asm
        mov ax,4F00h
        les di,VESAInfo
@@ -248,7 +251,6 @@ end;
      @@ERR:
        mov al,0
      @@X:
-    end;
   end;