Xref: news-dnh.mv.net comp.os.msdos.djgpp:4058 Path: news-dnh.mv.net!mv!barney.gvi.net!news.netrail.net!news.sprintlink.net!newsfeed.internetmci.com!news.mel.aone.net.au!newshost.pcug.org.au!e5.pcug.org.au!eyal From: eyal AT ise DOT canberra DOT edu DOT au (Eyal Lebedinsky) Newsgroups: comp.os.msdos.djgpp Subject: graphics in v2: some answers Date: 29 Dec 1995 12:19:25 GMT Organization: Eyal at home Lines: 46 Sender: eyal AT e5 DOT pcug DOT org DOT au (Eyal Lebedinsky) Message-ID: <4c0mcd$dev@supreme.pcug.org.au> NNTP-Posting-Host: ts109.pcug.org.au To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp I was asking a few questions while I worked my way through the maze. I now got my program working rather well. I learnt a few things on the way, and I will post a demo program extracted from my code to demonstrate it. v2 does not support banked video memory automatically, but I already had the program take care of that. Now I needed to get fast access to the video bank memory (normally at real address 0xa0000). I decided to map it the near data so that I can access like normal memory without the special far memory macros. This worked very well. I then grabbed the VBE 2.0 spec and had a quick read (this spec is not that hard to read). I then proceeded to verify what it says - I used univbe 51a (I think a beta release?) and found that it did not follow some of the rules. So one must be careful not to trust what the doco says at every step. Check the situation each time. I calles VBE function 0x4f0a (get protected mode table) which gave me the address of a table and it's size. I then grabbed it into my nead memory (this time copied with dosmemget()) and inside there are found the magical routines to do banks switching, page flipping (set screen start) and more. I then wrote a tiny asm stub to handle the call (they are not C callable) and presto, it worked (well, after many frustrating, hair tairing faults and what not, but who remembers?). I now managed to do bank swapping in three ways: 1) in10 function 0x4f05 (VBE standard). This is time consuming due to the need to real/prot switching. 2) call the VBE1.2 realMode function. This is only marginally faster that using the interrupt. 3) call the VBE 2.0 prot mode function. This is blazingly fast. So far, the set-screed-start prot mode function does not seem to function as documented (either I call it wrongly or it does not work for my card with this version of univbe). The above stuff will be soon in the beta Fly8 relaese on: csc.canberra.edu/pub/ise/eyal/fly8/beta in the sources archive, under fly8/djgpp/grvbe.c -- Eyal Lebedinsky (eyal AT ise DOT canberra DOT edu DOT au, eyal AT pcug DOT org DOT au)