Hi, I am working on Vga mode 0x12, write-mode 0. I know each byte I wrote is mapped to 8 pixels on screen, but It only represent 0 / 1.
assume that I want to draw a white-background black-foreground character box, I can set the white-background with Set/Reset register. But how can I set the black-foreground color? I don't know which register I should set.
Yours
blackoil
VGA mode 0x12 input content?
- 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: VGA mode 0x12 input content?
er, the BIOS is hardly involved in here.
If you want to draw white-on-black (or black-on-white), you can get away with a special case write - every set of bits over the four planes will share the same value:
w-b-w-w-w-b-w-b:
plane 0: 10111010
plane 1: 10111010
plane 2: 10111010
plane 3: 10111010
since you're effectively setting all planes to the same value, you can get away with the easiest trick in the book: just write all planes at once (write mask = 1111) and don't bother with all the other crazy ideas
If you want to draw white-on-black (or black-on-white), you can get away with a special case write - every set of bits over the four planes will share the same value:
w-b-w-w-w-b-w-b:
plane 0: 10111010
plane 1: 10111010
plane 2: 10111010
plane 3: 10111010
since you're effectively setting all planes to the same value, you can get away with the easiest trick in the book: just write all planes at once (write mask = 1111) and don't bother with all the other crazy ideas
Re: VGA mode 0x12 input content?
it works for black-on-white. Is it possible for any fore-back ground combinations of 16 colors with write once?
Set/Reset will replace any respective bits with Map Mask off. The wiki does't mention which register to be set for the foreground color. Is it the map mask register?
I can write any 16 colors combinations with twice drawings. The background with bitmask 0xFF, then the foreground with character pattern bitmask on, both with respective map mask value.
Set/Reset will replace any respective bits with Map Mask off. The wiki does't mention which register to be set for the foreground color. Is it the map mask register?
I can write any 16 colors combinations with twice drawings. The background with bitmask 0xFF, then the foreground with character pattern bitmask on, both with respective map mask value.
- 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: VGA mode 0x12 input content?
Write mode 3 will probably solve that problem. It allows the user to choose between two sets of bytes, one from the Set/Reset, and the other from the latches, depending on the data written. If you can load the background in one register, and foreground in the other, then you can write 8 pixels at once in any combination of the two colors.
http://www.byte.com/abrash/chapters/gpbb26.pdf
http://www.byte.com/abrash/chapters/gpbb26.pdf
Re: VGA mode 0x12 input content?
oops, sorry for my misunderstanding
. At present I am playing with VGA only via BIOS.

