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.
I have searched for seting palette when running in 32 bit based modem but does not find nothing good for me.
could someone put here some link about understanding palette.
I have a small BMP file, which I want to draw it. the problem it is 8 bit BMP. every byte is an index on the palette. when plotting the bitmap I convert the index to its color, but I see the picture not as origin.
amirsadig wrote:
I have a small BMP file, which I want to draw it. the problem it is 8 bit BMP. every byte is an index on the palette. when plotting the bitmap I convert the index to its color, but I see the picture not as origin.
What sort of BMP file? What code do you use to read it? (the full code with surrounding calls etc) How do you convert from index to palette color? What do you get?
it is a windows BMP. I load the file with my FAT driver.
I have found how to change 8 bit BMB to 32 bit.
you know 8 bit BMP has 255 color each color has R G B. those color included in palette table on file, which normal I can send it VGA register via IO Port. but because I run 32 bit Video Mode, I save the palette on an array of [256][4]. every pixel saved on file, tell us which color of the 256 to use.
you may like "www.wotsit.org" for any file format information and the HardWareVga category in the FAQ should point you towards VGA information repository that will provide you all the theory about VGA registers and palette setting.
Very basically, you can see the palette as a collection of colors which you will refer to in your picture (using a 4 or 8 bits index), much in the way of colours[] array in our previous discussion, except that it's performed in hardware.