Page 2 of 2

Re:Mode 12h

Posted: Sat Jun 03, 2006 12:08 pm
by REV
This is what I got. Still I'm getting no pixel at posy and posx!

pixeladdress = (char *)0xA0000;
pixeladdress = pixeladdress + ((640 * posy) + posx) / 8;
bitoffs = ((640 * posy) + posx) % 8;
bitoffs &= 0x7;
*pixeladdress = (1 << bitoffs);

I have a feeling Ive done something stupid :(

Re:Mode 12h

Posted: Sat Jun 03, 2006 1:56 pm
by Candy
I get the feeling something else is wrong. Are you sure that:

1. Mode 12h is actually enabled
2. You have mapped 0xA0000 to the physical 0xA0000
3. Your video card is VGA compatible
4. The two colors you're using are actually distinguishable (you're not trying to see the difference between two blacks, should normally not be a problem)
5. You're writing to a valid bit plane
?

Also, you're using a write which overwrites the other 7 bits with zeroes. You could replace that with:

Code: Select all

*pointer = (*pointer) & (~(1<<shift)) | (newval << shift)

Re:Mode 12h

Posted: Sat Jun 03, 2006 2:01 pm
by REV
Candy wrote: 1. Mode 12h is actually enabled
2. You have mapped 0xA0000 to the physical 0xA0000
3. Your video card is VGA compatible
4. The two colors you're using are actually distinguishable (you're not trying to see the difference between two blacks, should normally not be a problem)
5. You're writing to a valid bit plane
1. Yes I used the BIOS while I was in real mode
2. I have a global varible: unsigned char *pixeladdress = (char *)0xA0000;

3. What year is this? (in short yes)
I assume 4 and 5 are my proublem.
What can I do to fix this?

Re:Mode 12h

Posted: Mon Jun 05, 2006 4:02 am
by Candy
REV wrote: 3. What year is this? (in short yes)
The question wasn't as cynical as it seemed. Since about 99% of all video cards will not be used as VGA card anymore, there (I have heard) are cards that aren't VGA compatible anymore, since it isn't used and just about all customers don't care.
I assume 4 and 5 are my proublem.
What can I do to fix this?
You can solve nr 4 by writing all colors to be very different. However, if you haven't written any colors, they should be distinguishable in any case (iirc, they are the full color spectrum you map with RGB + brightness, each either off or on).
Nr 5 is harder and I myself don't know how. You could ask Dex4U, he seems to know the actual implementation of Mode12 stuff a lot better.

Re:Mode 12h

Posted: Mon Jun 05, 2006 9:39 am
by dc0d32
http://my.execpc.com/~geezer/osd/graphics/modes.c

works fine on all the machines i tried [VGA compat].

Re:Mode 12h

Posted: Mon Jun 05, 2006 12:38 pm
by REV
http://mcs.uwsuper.edu/sb/324/Intro/vga.html

I found that. Too bad it uses inline assembly. (Not that I hate assembly I don't like mixing it with C). Oh well. It looks good for me to start figuring this out.

Re:Mode 12h

Posted: Mon Jun 05, 2006 1:30 pm
by earlz
there (I have heard) are cards that aren't VGA compatible anymore
hope their video driver never crashes or anything because windows actually relies on vga as a backup video driver

Re:Mode 12h

Posted: Mon Jun 05, 2006 2:03 pm
by Candy
Jordan3 wrote:
there (I have heard) are cards that aren't VGA compatible anymore
hope their video driver never crashes or anything because windows actually relies on vga as a backup video driver
Still an "I've heard", not an "I've seen"... Am going to be looking out for those cards actively now. AFAIK, the PC text output was more like the Hercules cards, using int10 in textmode only. Windows uses this text output doesn't it?

Re:Mode 12h

Posted: Mon Jun 05, 2006 5:22 pm
by earlz
iirc no except for in their little boot thingy(hold F8)

Re:Mode 12h

Posted: Tue Jun 06, 2006 8:16 am
by JAAman
hope their video driver never crashes or anything because windows actually relies on vga as a backup video driver
actually, this is only true for win9x -- winXP safe mode (and with no drivers installed) uses 800x600x16bit (iirc) (prob vbe3 if its availible, though i dont know that for certain -- winXP is capable of using higher modes without drivers also -- that is why i asume it falls back on vbe) -- though it is possible to enable VGA mode, its a separate option -- not default