#include "screen.h"
#define TRUE   1
#define FALSE  0
char *malloc();

main()
{
   char  *scrnsave;

   del_cur();                       /* get rid of cursor */
   scrnsave = malloc(4000);         /* allocate screen save buffer */
   border(0);                       /* set border to black */
   getscrn(scrnsave, 0);            /* save page 0 */
   putscrn(screen, 0);              /* put our screen up */
   stand_by(TRUE, 0);               /* put up stand by message */
   whelp();                         /* make funny noise */
   wait(2);                         /* wait 2 seconds */
   stand_by(FALSE, 0);              /* remove stand by request */
   put_screen(" Press SPACE to quit ", 0x1f, 22, 27, 0);   /* put message */
   getch();                         /* get any key */
   putscrn(scrnsave, 0);            /* restore original screen */
   restor_cur();                    /* turn cursor back on */
   free(scrnsave);
}

whelp()   /* makes a funny noise */
{
   int i, j;

   for(j = 0; j < 3; j++) {
      for(i = 100; i < 650; i += 25)
         sound(25, i);
      for(i = 650; i > 99; i -= 25)
         sound(25, i);
      }
}

stand_by(ch, page)   /* set up small window to flash 'stand by' */
int ch, page;
{
   static char *scn;
   if(ch) {
        scn = malloc(4000);
        getscrn(scn, page);
        put_screen("                     ", 0xf4, 18, 27, page);
        put_screen("   Please Stand By   ", 0xf4, 19, 27, page);
        put_screen("                     ", 0xf4, 20, 27, page);
     } else {
        putscrn(scn, page);
        free(scn);
        }

}



