Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen 12 drawing graphics

Status
Not open for further replies.

KenshinHimura

Programmer
May 8, 2003
91
US
How would you do that? All I get is white pixels put randomly when I use the method of drawing pixels in screen 13. I know why that happens and all, but then how would you draw graphics using the memory at A000:0000. Are the colors stored somewhere else in memory? thx :)
 
I believe mode 12 is either CGA or EGA graphics. If thats the case, the 16kb buffer would be at b000:8000h. Writing screen code for CGA or EGA differs from VGA. They have levels of screens rather then 1 pixel per color.

Thaz
 
On VGA cards and upwards, text modes start at b800, graphics modes at A000.

If you want to write pixels, you need a good intro to the VGA card. The colours are stored in the same place as the rest, but in 16-colour modes the VGA card addresses 4 memory planes on top of each other! When you write to a single byte, you actually write to any/all of 4 bytes of VGA memory, each containing 8 pixels. Which planes (which bytes) are affected depends on what else you've set up in the VGA's own registers, which you do by IN and OUT instructions. The 4 bytes/planes deal with colour; between them they make for the 16 combinations of colour. In the original colour scheme you could look on the planes as R/G/B/brightness, but now they just create a look-up into a colour table, so they can correspond to anything you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top