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).
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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
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).
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...
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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]