Mode 12h
Re:Mode 12h
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
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
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:
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
1. Yes I used the BIOS while I was in real modeCandy 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
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
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.REV wrote: 3. What year is this? (in short yes)
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).I assume 4 and 5 are my proublem.
What can I do to fix this?
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
http://my.execpc.com/~geezer/osd/graphics/modes.c
works fine on all the machines i tried [VGA compat].
works fine on all the machines i tried [VGA compat].
Re:Mode 12h
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.
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
hope their video driver never crashes or anything because windows actually relies on vga as a backup video driverthere (I have heard) are cards that aren't VGA compatible anymore
Re:Mode 12h
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?Jordan3 wrote:hope their video driver never crashes or anything because windows actually relies on vga as a backup video driverthere (I have heard) are cards that aren't VGA compatible anymore
Re:Mode 12h
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 defaulthope their video driver never crashes or anything because windows actually relies on vga as a backup video driver