Hi,
I used the table at http://en.wikipedia.org/wiki/BIOS_color_attributes as a reference for text colour.
When I tried to use it for the background colour, I found out that there are some differences. So I made up an image, top row is text colour and bottom row is background colour.
Is there a reference somewhere describing the background colours?
In case it matters, the code switches to mode 0x12 (VGA 640x480 with 16 colours).
Background colour codes
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Background colour codes
There's a problem with that - there are 16 colours possible in that mode and your image lists more than 16 colours. Therefore your observations are not correct.
Please demonstrate how you got those results, maybe we can figure out what went wrong.
Please demonstrate how you got those results, maybe we can figure out what went wrong.
Re: Background colour codes
Arent these colour attributes for text modes only, as opposed to the 640x480 graphics mode you said you selected? ... that is unless you have your own code that maps the behaviour of a text mode screen onto a graphical interface in which case how the colours appear would be entirely up to you...Stijn wrote:Hi,
I used the table at http://en.wikipedia.org/wiki/BIOS_color_attributes as a reference for text colour.
When I tried to use it for the background colour, I found out that there are some differences. So I made up an image, top row is text colour and bottom row is background colour.
Is there a reference somewhere describing the background colours?
In case it matters, the code switches to mode 0x12 (VGA 640x480 with 16 colours).
Re: Background colour codes
I've commented my code and put it up at http://pastebin.com/uj1uKjLu
If you require more comments just let me know.
I got the results displayed in the colour chart by trying all colours one by one, taking screenshots and copying the colour.
If you require more comments just let me know.
I got the results displayed in the colour chart by trying all colours one by one, taking screenshots and copying the colour.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Background colour codes
Since I haven't been using bios interrupts in graphics modes much (mainly because they are epicly slow), I modified the code a bit to render all foreground colours to check the actual effect - which is that that BIOS call simply replaces colour zero with a new colour. Which means that you lose black for a different colour, in several cases a duplicate of one of the other fifteen colours.
It's an effective way of changing colours, but it's usually not what you want.
You can find your colours back in the EGA palette as 0-7 and 16-23.
It's an effective way of changing colours, but it's usually not what you want.
You can find your colours back in the EGA palette as 0-7 and 16-23.
Re: Background colour codes
I've done the modification you said and can see the effect it has now.
Thanks for the explanation.
Thanks for the explanation.