I was wondering how I could display more than 256 colors with the VGA color palette. correct me if I'm wrong, but the reason that you can't display more than 256 colors at once is because each byte in video memory corresponds to one pixel on the screen. But because each byte can only hold a number up to 255 (not including 0) you can't reference a color past 256 (the maximum number combinations). Assuming that this is correct, is there a way to extend the video memory so that each pixel uses 2 bytes (video memory size * 2) or one word of memory each? :icon_question:

> I was wondering how I could display more than 256 colors with the VGA color palette

You can not. It is a fundamental limitation of the VGA architecture. VGA may hold just that many colors at a time.

> the reason that you can't display more than 256 colors at once is because each byte in video memory corresponds to one pixel on the screen

The reason is that the VGA palette has 256 entries.

To achieve true color you must go beyond VGA modes.

>> To achieve true color you must go beyond VGA modes. <<

So how would I go beyond VGA modes?

I just found out that the newer way to display graphics is through DVI or HDMI, but I can't find a tutorial on how to program the DVI. So if anyone knows a tutorial or can tell me how that would be helpful.

Edited 5 Years Ago by ThatGuy2244: n/a

A couple of (or a few) questions:

1. What video hardware (video board) are you using?
2. What kind of display?
3. How are you trying to program the display?

Modern cards are 24-bit or 32-bit color capable. There is a standard api interface that most all modern cards support called VESA. If you aren't using a card more than, say 15 or 20 years old, then they have VESA support, which will handle 24-32bit color pallets quite nicely. NO ONE uses VGA direct framebuffer I/O any more except possibly for raw console/BIOS output.

As for the display that I'm trying to program, I don't know since I am trying to get it to work in a virtual box. For VESA is that the only way to program for DVI?

DVI is just an interface. You really don't need to concern yourself with that. It is the video card (physical or virtual) that you need to communicate with. For VirtualBox, using VESA API's in the client would be appropriate, or normal system graphic API's, such as Qt, OpenGL, DX10, etc.

The video card is virtual, but I'm doing this in DOS so OpenGL and DirectX aren't really an option, I'm trying to do this as close to hardware level as possible.

Edited 5 Years Ago by ThatGuy2244: n/a

Then the question nails down to what exactly is the virtual spec of that virtual card.

All cards are really different. They all support the lowest common hardware denominator (that is is VGA), and their drivers support the lowest common sofrware denominator (that is, DX/OGL standard). Programming registers of GeForce has absolutely nothing in common with programming registers of Radeon, or Larrabee, or Integrated Graphics, or whatever else.

So, how does your card operate?

Thanks, for your help, but I found a tutorial on how to program for VESA. Thanks

This question has already been answered. Start a new discussion instead.