troubleshooting Question

256 Color in 'char Image[]' array

Avatar of tppramod
tppramodFlag for India asked on
Game Programming
3 Comments1 Solution988 ViewsLast Modified:
i have a sprite (4 x 4 pixels) defined in a char array "char Image[]" as given below for example, having colors Red (Value 12) and Yellow (Value 14).  I am writing directly to VGA memory in Mode 13h which can support upto 256 colors.  I know the colors having values from 1 to 16 which can be used in this array.  The question is if i want to choose any other color (other than 16 colours) from the range of 256 colors, then what value should i give it in the array so that i can get that displayed on the screen.  any lookup table? or something. pls. note that all of my sprites are defined using char arrays.  I am using Turbo C 3.0 DOS complier.

char Image[] =

T. P. Pramod Kumar
New Delhi
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros