Reaper Grimm
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom General > PLAYPAL and VGA technical question
 
Author
All times are GMT. The time now is 02:21. Post New Thread    Post A Reply
Stilgar
Junior Member


Posts: 105
Registered: 07-06


Unofficial Doom Specs, describing the PLAYPAL lump:

There are 14 palettes here, each is 768 bytes = 256 rgb triples. That is, the first three bytes of a palette are the red, green, and blue portions of color 0. And so on. Note that the values use the full range (0..255), while standard VGA digital-analog converters use values 0-63.

I've read the same about the VGA color range elsewhere, too... so my question is, did the original engine use some video mode that supported a full 0-255 range for the RGB color components, or did it crush the values down to an 0-63 range before using them? If it crushed the values to the 0-63 range, what was the reason for storing them in an 0-255 range?

Old Post 08-29-08 06:43 #
Stilgar is offline Profile || Blog || PM || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
GreyGhost
Senior Member


Posts: 1079
Registered: 01-08


According to the specifications a full 0-255 range for any component colour isn't possible - I expect the two least significant digits for each colour was ignored by the D-A converters. The use of 8-bit colour values is simply a matter of convenience. While in theory you could fit VGA colour data into 25% less RAM - having to bit-shift the data before it could be displayed would slow things down.

Old Post 08-29-08 11:07 #
GreyGhost is online now Profile || Blog || PM || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
CODOR
Member


Posts: 333
Registered: 02-06


From what I can tell, a plain VGA reads each entry in the color table as three bytes -- except each individual color component is in the range 0-63 (6-bits, with the two most significant ones zeroed). So Doom has to shift the entries in its palettes right by two bits before sending them to the VGA.

Did the NeXT systems that id used have a 24-bit DAC? I suppose in the interest of making the game portable to both that and DOS (and whatever other systems they might have had in mind while creating it), and since it was going to take up one byte per component anyways, it was easiest to just store it full-range...

Old Post 08-29-08 16:41 #
CODOR is online now Profile || Blog || PM || Email || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
GreyGhost
Senior Member


Posts: 1079
Registered: 01-08



CODOR said:
So Doom has to shift the entries in its palettes right by two bits before sending them to the VGA.
VGA has a built-in Barrel Shifter - probably for that very purpose.


Did the NeXT systems that id used have a 24-bit DAC?
Depends on the model/s they were using. The NeXTstation Color's integrated video has a 12-bit colour palette + 4-bit alpha. The more expensive NeXT Cube accepts an optional 32-bit colour card which cost nearly as much as a workstation.

Old Post 08-30-08 08:09 #
GreyGhost is online now Profile || Blog || PM || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
CODOR
Member


Posts: 333
Registered: 02-06



GreyGhost said:
VGA has a built-in Barrel Shifter - probably for that very purpose.
Does that operate on data being sent to the DAC register, too? I thought it was only on data sent to the framebuffer, but seeing that it's been over a decade since I've played around with programming a VGA (and at that point I wasn't even this advanced into it) I can't be certain...



The NeXTstation Color's integrated video has a 12-bit colour palette + 4-bit alpha. The more expensive NeXT Cube accepts an optional 32-bit colour card which cost nearly as much as a workstation.
Ah... I remember something about it using 12-bit colour now. According to Wikipedia, Carmack had a Cube, but it doesn't say what video card it used. There's the following snippet of text included with the NeXT port of Doom (which unfortunately isn't credited anywhere that I can see):

Someone at id wrote:
There is built in support for two-bit gray, eight-bit gray, and twelve-bit rgb bitmaps. I did not include twenty-four-bit color support, because the blit rate on a NeXT DIMENSION is really not sufficient for the game. You can run it on a dimmension in either the twelve-bit-color (default) mode, or manually set it down to two-bit gray where it plays at an ok rate. (Doom -NXWindowDepthLimit TwoBitGray from the command line). When I get a twenty-four-bit HP system, I will write the native code. :-)

Old Post 08-30-08 20:53 #
CODOR is online now Profile || Blog || PM || Email || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
All times are GMT. The time now is 02:21. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom General > PLAYPAL and VGA technical question

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory