VOGONS


First post, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

I found out yesterday that with all standard machine types in DOSBox, color is output and recorded in an 8-bit palettized format except for vgaonly, which is 16-bit RGB. 16-bit RGB per pixel only covers 1/4 of the colors standard VGA can display. Standard VGA allows the Red, Green and Blue levels of a pixel to be independently selected with 6-bits for each color component. This gives 18-bits of RGB color information in total for each pixel. 18-bit gives 262,144 color choices whereas 16-bit gives only 65,536 colors.

vgaonly is typically used when you need to display video that can alter display parameters by scanline. Games that need it to display correctly are Lemmings/Oh No More Lemmings and Pinball Fantasies. Some demos like Copper will break without it. But the colors produced are not necessarily accurate to the hardware. The standard machine types should transform 18-bit RGB to 24-bit RGB for accurate color display.

Can vgaonly be displayed in 24-bit RGB? I understand that when vgaonly was created back in the mid-2000s, PCs weren't quite as powerful as they are today. But they should be sufficiently powerful in 2019 to manage the extra overhead. Is there another reason for the limitation?

http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog

Reply 1 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It might actually simplify some parts of the code to use 32-bit (DOSBox doesn't really deal with 24-bit, AFAIK) output instead; but vgaonly is useful for some games as well as demos, so the volume of data for image and video capture probably is/was a consideration. The RGB565 (human eyesight is more sensitive to green so it is given the full 6 bits) transform is probably not easy to notice except in gradients where banding might be slightly more evident; but 256-color palette modes don't do smooth gradients very well, anyway.

Reply 2 of 4, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

16 bit must have been faster back in the day maybe?
But seems like you waste a lot of time later during the blitter stage to convert it to 32bit again there.

Reply 3 of 4, by Scali

User metadata
Rank l33t
Rank
l33t
ripsaw8080 wrote:

It might actually simplify some parts of the code to use 32-bit (DOSBox doesn't really deal with 24-bit, AFAIK) output instead;

To get into the confusion of 24 vs 32-bit colour:
I think there are two separate meanings of 24-bit colour:
1) Any pixel format that uses RGB data, where each component is 8-bit.
2) Storing pixels of the form 1) in a format that actually takes 24-bits in memory, so 3 bytes per pixel (usually RGB or BGR).

In theory, there are also different kinds of 32-bit pixel formats (such as 10-bit per component RGB), but in practice everyone seems to mean a format with 8-bit per component, where the extra 8-bits are either for a 4th component used for alpha, or are just padding. So for example, you can have ARGB, RGBA, BGRA, XRGB, RGBX etc.

Meaning 1) is often interchangeable with 32-bit pixelformats with 8-bit per component.
There has only been a very short period of time where hardware actually supported 24-bit truecolour as in meaning 2). This was in the very early days of truecolour, where 24-bit packing of pixel data would make the most efficient use of memory, which was still a scarce resource.
The obvious disadvantage is that you are working with unaligned pixel data, which is inefficient to manipulate with the CPU. So as memory became cheaper, these 24-bit formats were abandoned, in favour of the more performance-efficient 32-bit formats.
Modern graphics APIs and drivers do not even support such 3-byte formats anymore.

As for 16-bit colour, this can also be somewhat confusing. Some vendors chose a 5:6:5 format, where others used a 1:5:5:5 format instead.

But yea, it should be reasonably trivial to make vgaonly work with 8-bit RGB components, and I see no reason why not.

Personally I think the scanline rendering of vgaonly should be applied everywhere (including Hercules, which can do raster effects, because you can switch memory banks mid-frame).
So if the scanline rendering and perhaps some other tweaks are migrated to the svga modes, I suppose vgaonly no longer has a real purpose (aside perhaps from emulating a machine that is 'strictly' VGA, no extra memory or other features).

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 4 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
Great Hierophant wrote:

Games that need it to display correctly are Lemmings/Oh No More Lemmings and Pinball Fantasies.

For mid-screen palette changes in those cases; however, vgaonly is also useful with games that use video blanking for various reasons, e.g. Alien Carnage / Halloween Harry.