Mail Archives: djgpp/1996/06/23/11:02:30
richard 725 AT denver DOT email DOT com was wondering about mode 13:
Take a butchers at the following code, which sets the mode as 320 by 200 =
with 256 colours, and then uses the screen buffer to plot a pixel:
union REGS r;
char *scrptr;
char ScreenBuffer[64000]; // 320 * 200 =3D 64000, which is the memory =
we must // allocate
void set320x200(void)
{
r.h.ah =3D 0; // Clears previous values for ah
r.h.al =3D 13; // Video mode required
int86(0x10, &r, &r); // Interrupt 10 is the video card. Simple, eh?
}
void drawbufferpixel(long x, long y, char colour)
{
*((char *) Screen Buffer + ((y<<*)+(y<<6))+x)=3Dcolour; // Calculates =
the location =
=
=
//of the pixel on a 300 by =
=
=
memcpy(scrptr,ScreenBuffer,64000); //200 screen, =
and sets=20
memset(ScreenBuffer,0,64000); //that value =
within the =
=
=20
=
//screen buffer to the colour =
=
//specified
}
----------------------
David L Clayton
----------------------
- Raw text -