×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Video display memory

Video display memory

Video display memory

(OP)
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

RE: Video display memory

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."

RE: Video display memory

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close