
/*
 *  This function prompts for options and runs the appropriate program.
 *  The programs are in simulated ROM
 *
 */

 void demo(void) 
 {
  char ch;
  static char *options="\
#YOU ARE IN DEMO MODE:\n\
#ENTER YOUR OPTION TO OBSERVE THE O/P OF DIFFERENT PROGRAMS\n\
# 1->UP RAMP\n\
# 2->DOWN RAMP\n\
# 3->TRIANGULAR\n\
# 4->SQUARE WAVE\n\
# 5->TRIANGULAR & SQUARE WAVE MIXED\n";


  if(window_flag == 1) {
	window_flag  = 0;
	initgraph(&gdriver, &gmode,  ""); 
  }
  while(1) {
	clrscr();
	gotoxy(1, 16);  
	write(1, options, 180);
	ch = getch();
	if(ch == 'y'|| ch == 'Y') return;
	if(ch > '5' || ch < '0') ch = '1';
	switch(ch) {
	case '1':romw(0x2c04, 0x3c); 
		run(0x2c00, DEMO_MODE_ONE); 
		break;
	case '2': romw(0x2c04, 0x3d); 
		run(0x2c00, DEMO_MODE_ONE); 
		break;
	case '3': run(0x2c10, DEMO_MODE_ONE); 
		break;
	case '4': run(0x2c30, DEMO_MODE_ONE); 
		break;
	case '5': run(0x2c50, DEMO_MODE_TWO);
	}
  }
 }/*close of demo*/ 
