Category : Files from Magazines
Archive   : PJ-VGA.ZIP
Filename : CIRCLE2.C

 
Output of file : CIRCLE2.C contained in archive : PJ-VGA.ZIP
/* *** Listing 2 ***
*
* Draws a series of concentric circles.
* For VGA only, because mode 12h is unique to VGA.
* Compile and link with listingX.c (where X is 1 or 3) with:
* tcc listingX listing2 (Turbo C)
* cl listingX.c listing2.c (MSC)
*/

#include

main() {
int Radius, Temp, Color;
union REGS Regs;

/* Select VGA's hi-res 640x480 graphics mode, mode 12h */
Regs.x.ax = 0x0012;
int86(0x10, &Regs, &Regs);

/* Draw concentric circles */
for ( Radius = 10, Color = 7; Radius < 240; Radius += 2 ) {
DrawCircle(640/2, 480/2, Radius, Color);
Color = (Color + 1) & 0x0F; /* cycle through 16 colors */
}

/* Wait for a key, restore text mode, and done */
scanf("%c", &Temp);
Regs.x.ax = 0x0003;
int86(0x10, &Regs, &Regs);
}



  3 Responses to “Category : Files from Magazines
Archive   : PJ-VGA.ZIP
Filename : CIRCLE2.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/