This project is read-only.

Limit On VGAScreen.SetPaletteEntry???

Jun 24, 2011 at 11:49 PM

Hey Guys, I was building my Os today And when A Set a PalettEntry to 10 or 11 my system colors get messed up. Heres the code 

Now is there a limit on the amount in MS4? Thanks - Matt


  VGAScreen.SetPaletteEntry(4, 0, 255, 0);//Green
            VGAScreen.SetPaletteEntry(0, 0x00, 0x00, 0x00); //Black          
            VGAScreen.SetPaletteEntry(1, 0xFF, 0xFF, 0xFF); //White            
            VGAScreen.SetPaletteEntry(2, 0x3C, 0x00, 0x00);//Red                                  
            VGAScreen.SetPaletteEntry(3, 74, 137, 240);//Blue          
            VGAScreen.SetPaletteEntry(5, 50, 50, 50);//Grey
            VGAScreen.SetPaletteEntry(6, 236, 233, 216);//window color
            VGAScreen.SetPaletteEntry(7, 128, 128, 128);//light yellow
            VGAScreen.SetPaletteEntry(8, 0, 90, 0);//Dark Green
            VGAScreen.SetPaletteEntry(9, 168, 168, 168);//Dark white
            VGAScreen.SetPaletteEntry(10, 180, 130, 120);
            VGAScreen.SetPaletteEntry(11, 168, 130, 168);//Dark white

Jun 25, 2011 at 12:49 AM

There is a limit of 256 colors in the palette with VGA. Look at my VGADriver.Initialize code for a simple mathmatical loop that will set the palette to an evenly distributed set of colors.

Jun 25, 2011 at 4:22 AM

Ok oh thanks blah38621. That really really helped me. I really appreciate you helping me and others. I'm not sure what we would do with out you. Thanks for all you do. - Matt