char *a_cmd[] = {"sdb","-sbarchart","-mbc.r","bc",0};
char *b_cmd[] = {"sdb","-mcount.r","count","count.txt",0};
char *c_cmd[] = {"sdb","-mpi.r","pi","50",0};

main()
{
	char a[10];
	int invalid;

	setenv("SDBOPT", "-cs1,3,2,0 -cc0,0,1,2 -cd1,2");
	scr_clear();
	printf("\n\n         Welcome to the Aztec C68K SDB debugger demo!\n");
	printf("          --------------------------------------------\n\n");
#ifdef DEMO
	printf("        This disk may be freely copied and distributed.\n\n");
#endif
	printf("        Manx software users now have access to the first\n");
	printf("        true source level debugger for the Amiga computer.\n\n");
	printf("       As you'll soon see, SDB for the Amiga not only gives\n");
	printf("       you access to your C source, but is a multi-windowed\n");
	printf("       debugger with many powerful yet user friendly features.\n\n");
#if 0
	printf("The windows may be resized and their contents scrolled\n");
	printf("using either the mouse or keyboard equivalents.  Keyboard\n");
	printf("commands entered in the command window may be recalled and\n");
	printf("edited using an inteligent command history.\n\n");
#endif
	printf("       Several demonstration programs are included on this disk.\n");
	printf("       Before actually running them you may want to look at\n");
	printf("       the documentation found in the file named sdb.doc\n\n");
	printf("       Would you like to exit to view the documentation?");
	gets(a);
	if (a[0] == 'y' || a[0] == 'Y') {
		printf("\nReturning to Amiga DOS.\n\n");
		exit(0);
	}
	while (1) {
		scr_clear();
		printf("\n\n\n\n                   Available Demonstration Programs\n");
		printf("                   --------------------------------\n\n\n");
		printf("                   1) Draw a bar chart in a window.\n\n");
		printf("                   2) Count characters in a file.\n\n");
		printf("                   3) Calculate the value of pi.\n\n");
		printf("                   4) Exit to Amiga DOS.\n\n\n");
		do {
			invalid = 0;
			printf("                Enter selection:");
			gets(a);
			switch(atoi(a)) {
				case 1:	scr_clear();
						fexecv(a_cmd[0],a_cmd);
						break;
				case 2:	scr_clear();
						fexecv(b_cmd[0],b_cmd);
						break;
				case 3:	scr_clear();
						fexecv(c_cmd[0],c_cmd);
						break;
				case 4:	scr_clear();
						exit(0);
				default:
						printf("Invalid option, please try again.\n");
						invalid = 1;
			}
#if 0
			scr_clear();
#endif
		} while(invalid);
	}
}
