main()
{
    void interrupt(*oldTimer)();
    oldTimer=getvect(0X1c);
    setvect(0X1c,beNoisy);
    playtune(song);
    DoSomething();
    setvect(0X1c,oldTimer);
    nosound();
}
Пример #2
0
void main(void)
{
	//int LEDS[] = { LED1, LED2, LED3, LED4 };
	init();
	//int *p = LED1;
	getready();
	playtune();
	while(1){
		for( int i=0;i<4;i++ ){
			//*p = 1;
			//LED4 = 1;
			//LED3 = 1;
			__delay_ms(200);
			//LED1 + 1 = 1;
			//beep();
		}
	}
}
Пример #3
0
void main()
{
int gd=VGA,gm=VGAHI,errorcode,area,i,j,play=1,rndplay,rac,r,ch,chh,n=1,speed=151,sp=1,si=1,carx,cary,gear=0,aspeed,booster=100,drumx,drumy,drumv,drumx1,drumy1,spp,coin=200;
int life_=10;
int fire=20;
char info[4];
int soun;
char *buff;
char *fir;
char *boost;
int mouse=23;
int x,y,button;


char *tyre1;
float feul=100;
char *car1buf;
char *pcar4buf;
char *fcar5buf;

int recsize;
FILE *fp;
struct record
{
int coins;
int lifes;
float feuls;
int speeds;
int boosters;
int gear_;
int fire_;
}rec;

recsize=sizeof(rec);

initgraph(&gd,&gm,"c:\bagger");
errorcode = graphresult();
if (errorcode != grOk)
{
   printf("Graphics error: %s\n", grapherrormsg(errorcode));
   printf("Press any key to halt:");
   getch();

   exit(1);
}
	start=ptr=tune;
	sp_off=inportb(97);
	sp_on=sp_off|3;
	duration=0;

setcolor(YELLOW);
settextstyle(7,0,15);
outtextxy(100-20,100,"R");

settextstyle(7,0,15);
outtextxy(495-20,100,"E");

setcolor(LIGHTBLUE);
settextstyle(7,0,7);
outtextxy(198-20,130,"UN   LIF");

setcolor(BLUE);
setlinestyle(0,0,3);
line(275,155,385,155);
line(275-2,160,385-2,160);
line(275-4,165,385-4,165);
line(275-6,170,385-6,170);
line(275-8,175,385-8,175);
line(275-9,180,385-9,180);
line(275-10,185,385-10,185);
line(275-12,190,385-12,190);

setcolor(YELLOW);
settextstyle(10,0,7);
outtextxy(295,95,"4");


setcolor(LIGHTBLUE);
for(i=1;i<=465;i++)
{
line(80,228,80+i,228);
delay(5);
}
for(i=1;i<20;i++)
{
line(80,228+i,545,228+i);
delay(7);
}
delay(500);
setcolor(LIGHTRED);
settextstyle(8,0,5);
setusercharsize(2,1,1,2);
textdisp1(80,225,"Run For Life",RED,LIGHTRED);


settextstyle(8,0,6);
setusercharsize(2,1,1,1);
setcolor(YELLOW);
outtextxy(235,285,"_By_");
setcolor(LIGHTRED);
textdisp1(10,325,"Rishabh Tripathi",LIGHTBLUE,BLUE);

cleardevice();
setcolor(LIGHTRED);
settextstyle(8,0,5);
textdisp(10,200,"What happened next...?");
settextstyle(8,0,5);
setusercharsize(2,1,1,1);
textdisp(15,250,"...Comming Soon");
textdisp1(15,250,"...Comming Soon",RED,LIGHTRED);
delay(2000);
cleardevice();
settextstyle(2,0,5);
outtextxy(100,50,"Programmed by : Rishabh Tripathi");
outtextxy(100,70,"Dedicated to my family...");
outtextxy(100,90,"Specially thanks to Shishir, Anurag and Neeraj");
outtextxy(100,120,"Your feedback are neccessary for us...");
outtextxy(100,150,"Contect me on...");
outtextxy(100,170,"*****@*****.**");
outtextxy(100,200,"Thanks for playing...");
	playtune();
      nosound();
delay(1000);
cleardevice();
}