Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
The 16-color lookup table mentioned is an poorly documented and a hardly used thing. If you keep out of it, colors 0-255 will always map to the corresponding DAC entry. If you're serious about it, read "Graphics Programming Black Book", which documents this feature properly. If you want the default values, send 0 to index 0, 1 to index 1, 2 to index 2 etc.
EDIT: removed the code you quoted because of license violations.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]