SVGA Test

new topic     » goto parent     » topic index » view thread      » older message » newer message

On second thought, I'm gonna backtrack here.  :)  Instead of expanding
my function, I chopped out all the other data.  It's simpler this way, and
it ought to work for the problem.  Note that it only checks for
VBE-compliant cards, proprietary SVGAs won't be recognized.

--------------------------------------------------------------
include machine.e

global function Video_Check()
   --Check for presence of VESA VBE compatible/compliant video card
   --Return 1 if it exists, 0 if it doesn't.
   sequence registers        -- The DOS registers
   object dataaddr           -- Address of the result data structure

   registers = repeat(0,10)           --clear registers
   dataaddr = allocate_low(512)   --allocate 512 bytes for data
   registers[REG_DI] = dataaddr  --tell it where to put the data
   registers[REG_AX] = #4F00   --tell it to use the data-retrieval functi

   registers = dos_interrupt( #10, registers )

   free_low( dataaddr )              --free up the memory it was in

   if registers[REG_AX] = #004F then
      return( 1 )
   else
      return( 0 )
   end if

end function
-----------------------------------------------------------

    Just call that before you attempt to set the video mode.

if Video_Check() then
   if graphics_mode( 257 ) then
      puts( 1, "Mode 257 not supported on this SVGA card." )
      abort( 1 )
   end if
else
   if graphics_mode( 18 ) then
      puts( 1, "Mode 18 not supported on this VGA(?) card." )
      abort(1)
   end if
end if

     Let me know if that crashes your computer, David.  If so, I may have to
expand it after all...
Falkon
PS, if you want it to look less confusing, you could set it to return 0 on
success and 1 on failure like graphics_mode does...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu