[Open-graphics] Sample VGA translation code, for nanocontroller
Jared Putnam
putnam_jared at yahoo.com
Wed Sep 5 21:30:28 EDT 2007
--- Mark <mark at jarvin.net> wrote:
> Could you be more specific about how VGA graphics mode memory
> accesses
> aren't standard reads and writes? I'm reading up on VGA, but I
> haven't
> got there yet.
VGA video memory is arranged into four 64k banks, called planes. When
you read from video memory, (depending on the read mode) the card only
gives you one value, it latches data on every active plane. There's a
four-bit bitmask that determines this. When it writes memory, it
writes from the latches to every active plane. Most modes just leave
the latches on one setting; I think only Mode X lets you take advantage
of this, though.
If you look around the block diagrams that Patrick posted, you'll see
that a lot of things are in groups of four and you'll also see a read
latch. This is why. There are other strange things, but this is the
only one I remember.
> Up to now, my impression was that, e.g., 320x200x256 VGA was just a
> linear array of 64000 bytes that was accessed using standard memory
> reads & writes. Then, (traditionally), the VGA hardware driving the
> display would read from that linear array and do some translation on
> the
> value read (basically a table lookup to the palette). Are the
> 320x200x16 and 640x480x16 modes also laid out as linear arrays of
> bytes?
Mode 13, which is the 320x200 mode you're thinking of, did that. It
was about the only graphics mode that provided that simple of an
interface.
> Is the 80x25 screen laid out as a linear array of 2000 16-bit words?
Yes, but there is more than one screen, and you can switch between
them.
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/
More information about the Open-graphics
mailing list