Page 1 of 1

VGA mode 0x12 input content?

Posted: Tue Jul 01, 2008 7:14 am
by blackoil
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

Re: VGA mode 0x12 input content?

Posted: Tue Jul 01, 2008 11:10 am
by devel
Hi,
maybe this helps BIOS VGA services.
Regards,
devel.

Re: VGA mode 0x12 input content?

Posted: Tue Jul 01, 2008 1:39 pm
by Combuster
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 :)

Re: VGA mode 0x12 input content?

Posted: Tue Jul 01, 2008 9:13 pm
by blackoil
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.

Re: VGA mode 0x12 input content?

Posted: Wed Jul 02, 2008 12:44 am
by Combuster
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

Re: VGA mode 0x12 input content?

Posted: Wed Jul 02, 2008 3:20 am
by devel
oops, sorry for my misunderstanding :| . At present I am playing with VGA only via BIOS.