VGA mode 0x12 input content?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
blackoil
Member
Member
Posts: 148
Joined: Mon Feb 12, 2007 4:45 am

VGA mode 0x12 input content?

Post 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
User avatar
devel
Member
Member
Posts: 62
Joined: Wed Nov 28, 2007 4:15 am
Contact:

Re: VGA mode 0x12 input content?

Post by devel »

Hi,
maybe this helps BIOS VGA services.
Regards,
devel.
User avatar
Combuster
Member
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?

Post 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 :)
"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 ]
blackoil
Member
Member
Posts: 148
Joined: Mon Feb 12, 2007 4:45 am

Re: VGA mode 0x12 input content?

Post 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.
User avatar
Combuster
Member
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?

Post 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
"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 ]
User avatar
devel
Member
Member
Posts: 62
Joined: Wed Nov 28, 2007 4:15 am
Contact:

Re: VGA mode 0x12 input content?

Post by devel »

oops, sorry for my misunderstanding :| . At present I am playing with VGA only via BIOS.
Post Reply