home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / SUPER_C.ZIP / SHOWEQ2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-01  |  2.0 KB  |  57 lines

  1. #include "eqlib.h"
  2.  
  3. /*      main()
  4.  
  5.         Function: Get and display the system memory size and the
  6.         equipment configuration.
  7.  
  8.         Algorithm: Call the ROM BIOS interface routines memSz and
  9.         getEq. Then interpret their replies and display the results.
  10. */
  11.  
  12. main()
  13.  
  14. {
  15.         int theEq;      /* The equipment configuration. */
  16.         int i;
  17.  
  18.         /* Clear the display. */
  19.         scrUp(0,0,0,24,79,0);
  20.  
  21.         /* Display the memory size at the bottom of the screen. */
  22.         setPos(0,15,30);
  23.         printf("Memory size is %dK.",memSz());
  24.  
  25.         /* Display the equipment configuration at the top of the screen. */
  26.         setPos(0,0,0);
  27.         printf("Equipment present:\n   ");
  28.         /* Get the equipment configuration. */
  29.         theEq = getEq();
  30.         /* Get the number of printers. */
  31.         i = (theEq & prtnMask) >> prtnShft;
  32.         /* If there are any at all, show how many. */
  33.         if (i != 0) printf("%d printer(s).\n   ",i);
  34.         /* If there's a game I/O interface present, say so. */
  35.         if (theEq & gioMask) printf("1 game I/O.\n   ");
  36.         /* Get the number of serial ports. */
  37.         i = (theEq & RS232Mask) >> RS232Shft;
  38.         /* If there are any, show how many. */
  39.         if (i != 0) printf("%d serial port(s).\n   ",i);
  40.         /* If there are any diskette drives present, show how many. */
  41.         if (theEq & diskMask) printf("%d diskette drive(s).\n   ",
  42.                                      ((theEq & dsknMask) >> dsknShft)+1);
  43.         /* Show the initial video mode. */
  44.         printf("Initial video mode: ");
  45.         i = theEq & vmodeMask;
  46.         if (i == CO40) printf("40x25 color");
  47.         else if (i == CO80) printf("80x25 color");
  48.         else if (i == MONO) printf("80x25 monochrome");
  49.         /* Show the system board RAM size. */
  50.         printf(".\n   System board RAM size: %dK bytes.\n",
  51.                16*(((theEq & sbramMask) >> sbramShft)+1));
  52.  
  53.         /* Return the cursor to the bottom of the page. */
  54.         setPos(0,23,0);
  55. }
  56.  
  57.