Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Video display memory 1

Status
Not open for further replies.

modalman

Programmer
Feb 14, 2001
156
0
0
GB
Hi. I have written a short program using nasm to draw to the screen. It first changes the screen mode to 640x480x16bit and then it attempts to copy a buffer to the video ram at segment 0A000H. However the screen only shows the 1st 64k of the buffer. I presume this is because of the way I am using the segments. Could anyone point me in the right direction on how to copy my buffer to the rest of the video ram. Am I also right in presuming that the video ram in this screen mode uses the next 614400 bytes (640x480x2) directly after 0A0000H. Many thanks in advance. ASCII silly question, get a silly ANSI
 
I would recommend you first read up on a couple of books on SVGA programming.

It is NOT in the next segment after a000h (seg).

It's because the memory is BANKED. That is, the memory in a0000h (abs) to affffh (abs) represents a PORTION of the entire SVGA screen memory. By default, it represents 0000h (scrn) to ffffh (scrn) of the SVGA memory. To load the next 64Kbytes of screen data, you first need to set or bank the memory area in a0000h (abs) to the screen memory 10000h (scrn) to 1ffffh (scrn) of the SVGA memory. Then, bank it to the next 64K of the SVGA memory again and again until you load the entire screen.

UNFORTUNATELY, SVGA's are not made alike and the process of switching the banks is different for each card. Luckily, VESA defines a way of switching banks, but not all cards implement this properly.

The way most programmers do (did?) this was to write different versions of the Bank Switch code to work with different cards, then detect the card used, and use the proper version of the Bank Switch code.

If you were using a 32-bit code (you're doing 16-bit, right?) some newer SVGA cards would be able to bank the entire screen memory to the top 16 Megs of the processor memory area, but again the process is different for each SVGA card and to handle 32-bit code without Windows you need to write your own DOS extender! "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Many thanks AmkG. Extremely clear and just the information I needed. I think I will try the VESA way of switching banks. Do you know of any snippets of code that do this? Thanks again. ASCII silly question, get a silly ANSI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top