rust-osdev/vga

the coloring of DEFAULT_PALETTE seems wrong

swnakamura opened this issue · 3 comments

Hello! I'm a newbie user of this crate and have a question.
In src/colors.rs, the DEFAULT_PALETTE for 256 colors are defined. However, The coloring after 65th color is always 0x3f, 0x3f, 0x3f.
I think this is some kind of mistake, and we can improve it, for example, by conforming to one of the standards like mode 13h.
Since I'm quite new to this project, my opinion may be wrong. If so, please give me any feedback.

@woodyzootopia Sorry for the delay in responding to this. I'm fine with setting values for the colors after 64 based on that article. Do you want to update those hex values for the colors and create a pull request?

I tried to conform to mode 13h, but it seems like the colors before 64 is also different from those of mode 13h.
@RKennedy9064 What color palette standard did you used for the DEFAULT_PALETTE implementation, and why is the colors after 64 always white? It seems like you implemented the palette part.

From what I remember the palette was taken from this file http://ftp.lanet.lv/ftp/mirror/x2ftp/msdos/programming/hardware/modes.asm, but I'm not sure why all the values after 64 0x3f3f3f. I'm guessing I messed up something when I was converting it over.

It would probably make sense to use the same palette dosbox does as the default palette. It looks like these are the values they use for the palette https://github.com/joncampbell123/dosbox-x/blob/b605671eb2d45b2a23eb08492b8bef87f5d7b287/src/ints/int10_modes.cpp#L567