Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!oakhill!val!ben From: ben@val.uucp (Ben Thornton) Newsgroups: comp.sys.ibm.pc Subject: Re: VGA problems Message-ID: <1989Nov3.050919.22774@val.uucp> Date: 3 Nov 89 05:09:19 GMT References: <2256@draken.nada.kth.se> Organization: Video Associates Labs, Inc. Lines: 37 d86-tpl@nada.kth.se (Tomas Prybil) writes: >Hi netlanders! >I'm trying to write a piece of code that would dump a VGA (640*480) >picture to disk as fast as possible. Im interested to do the opposite >as well. >The video buffer according to detecting software starts at 0xB000:8000. >I thought that it would be possible to set up a pointer to the adress >and then write from the starting adress + 64k out to disk. This was >apparently NOT the way to do it! But how should I do? First of all, if you are referring to 640x480x16 color GRAPHICS mode, (mode 12H), then the display buffer starts at A000:0. Further: The display memory in 640x480x16 is split into 4 separate planes. It takes 4 bits of information to determine the color of each displayed pixel, and each plane provides 1 bit each of that information. However, when reading and writing to the display memory, you have to set up the plane enable bits (I forget the register name) to determine which plane you wish to read from or write to. In write mode, you can enable ALL of them if you want all the planes to contain the same pattern of bits. In this case, a 1 would make color 15 while a 0 would make color 0. In read mode you can enable only 1 plane at a time (for obvious reasons). The easiest thing to do is enable plane 0, read 64k starting at A000:0 enable plane 1, read 64k starting again at A000:0, etc. for all 4 planes. > tomas prybil > student of above org. -- Ben Thornton packet: WD5HLS @ KB5PM Video Associates Labs uucp: ...!cs.utexas.edu!oakhill!val!ben Austin, TX fidonet: 1:382/40 - The Antenna Farm BBS