home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / bas / hanlin3 / pbback20 / demo.bas < prev    next >
BASIC Source File  |  1994-11-04  |  6KB  |  184 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |       PBBack  Copyright (c) 1990-1994  Thomas G. Hanlin III          |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7. '   For QuickBASIC 1.x, you can convert this to DEMO.EXE as follows:
  8. '      BASCOM DEMO/O;
  9. '      LINK DEMO/EX,,NUL,PBBACK;
  10.  
  11. '   For QuickBASIC 2.0-3.x, you can convert this to DEMO.EXE as follows:
  12. '      QB DEMO/O;
  13. '      LINK DEMO/EX,,NUL,PBBACK;
  14.  
  15. '   For QuickBASIC 4.x and BASCOM 6.x, convert this to DEMO.EXE as follows:
  16. '      BC DEMO/O;
  17. '      LINK DEMO/EX,,NUL,PBBACK;
  18.  
  19.  
  20.  
  21.    DEFINT A-Z
  22.  
  23.  
  24. '  ----- Pick the colors to use -----------------------------------------------
  25.  
  26.  
  27.    CALL GetCRT (Colour)
  28.  
  29.    IF Colour THEN _
  30.       CALL CalcAttr (7, 1, Attr): _
  31.       COLOR 7, 1 _
  32.    ELSE _
  33.       CALL CalcAttr (7, 0, Attr): _
  34.       COLOR 7, 0
  35.    CLS
  36.  
  37.  
  38. '  ----- Display a brief explanation ------------------------------------------
  39.  
  40.  
  41.    Row = 3
  42.    CALL XQPrint ("This is an admittedly trivial demo for the PBBack library.  It provides", Row, 3, Attr, 0, 1)
  43.    Row = Row + 1
  44.    CALL XQPrint ("an example of how to access the PBBack routines.", Row, 3, Attr, 0, 1)
  45.    Row = Row + 2
  46.  
  47.  
  48. '  ----- Display processor and coprocessor types ------------------------------
  49.  
  50.  
  51.    CALL Processor (CPU)
  52.    CALL NumProc (NDP)
  53.  
  54.    IF CPU = 0 THEN _
  55.       St$ = "NEC V20" _
  56.    ELSE IF CPU = 1 THEN _
  57.       St$ = "8088" _
  58.    ELSE IF CPU = 2 THEN _
  59.       St$ = "80186" _
  60.    ELSE IF CPU = 3 THEN _
  61.       St$ = "80286" _
  62.    ELSE IF CPU = 4 THEN _
  63.       St$ = "80386" _
  64.    ELSE IF CPU = 5 THEN _
  65.       St$ = "80486" _
  66.    ELSE _
  67.       St$ = "80?86"
  68.  
  69.    IF NDP = 1 THEN _
  70.       St$ = St$ + " with 8087 math support" _
  71.    ELSE IF NDP = 2 THEN _
  72.       St$ = St$ + " with 80287 math support" _
  73.    ELSE IF NDP = 3 THEN _
  74.       St$ = St$ + " with 80387 math support"
  75.  
  76.    CALL XQPrint ("Processor: " + St$, Row, 3, Attr, 0, 1)
  77.    Row = Row + 1
  78.  
  79.  
  80. '  ----- Display DOS version --------------------------------------------------
  81.  
  82.  
  83.    CALL GetDOSv (MajorV, MinorV)
  84.    DOSv$ = MID$(STR$(MajorV), 2) + "." + RIGHT$("0" + MID$(STR$(MinorV), 2), 2)
  85.    IF MajorV > 9 THEN _
  86.       St$ = "   OS/2 Compatibility Box" _
  87.    ELSE _
  88.       St$ = ""
  89.    CALL XQPrint ("DOS version: " + DOSv$ + St$, Row, 3, Attr, 0, 1)
  90.    Row = Row + 1
  91.  
  92.  
  93. '  ----- Display basic equipment info -----------------------------------------
  94.  
  95.  
  96.    CALL Equipment (Memory, Parallel, Serial, Game)
  97.    CALL XQPrint ("Base memory: " + MID$(STR$(Memory), 2) + " Kbytes", Row, 3, Attr, 0, 1)
  98.    Row = Row + 1
  99.    CALL XQPrint ("Parallel ports: " + MID$(STR$(Parallel), 2), Row, 3, Attr, 0, 1)
  100.    Row = Row + 1
  101.    CALL XQPrint ("Serial ports: " + MID$(STR$(Serial), 2), Row, 3, Attr, 0, 1)
  102.    Row = Row + 1
  103.    REM we'll leave out game ports, since that's not always reliable
  104.  
  105.    CALL Floppies (FloppyDrives)
  106.    CALL XQPrint ("Floppy drives: " + MID$(STR$(FloppyDrives), 2), Row, 3, Attr, 0, 1)
  107.    Row = Row + 1
  108.  
  109.  
  110. '  ----- Display video adapter type -------------------------------------------
  111.  
  112.  
  113.    CALL GetVGA (IsVGA)
  114.    CALL GetEGA (EGA, Memory)
  115.    IF IsVGA THEN _
  116.       St$ = "VGA" _
  117.    ELSE IF EGA THEN _
  118.       St$ = "EGA" _
  119.    ELSE IF Colour THEN _
  120.       St$ = "CGA" _
  121.    ELSE _
  122.       St$ = "MDA"
  123.    CALL XQPrint ("Display: " + St$, Row, 3, Attr, 0, 1)
  124.    Row = Row + 1
  125.  
  126.  
  127. '  ----- Display BIOS date and type -------------------------------------------
  128.  
  129.  
  130.    PCDat$ = SPACE$(8)      ' init string to right size
  131.    CALL PCDate (PCDat$)    ' fill it in
  132.    CALL XQPrint ("ROM BIOS date: " + PCDat$, Row, 3, Attr, 0, 1)
  133.    Row = Row + 1
  134.  
  135.    CALL PCType (MachineID)
  136.    IF MachineID = 251 OR MachineID = 254 OR MachineID = 255 THEN _
  137.       St$ = "PC/XT" _
  138.    ELSE IF MachineID = 253 THEN _
  139.       St$ = "PCjr" _
  140.    ELSE IF MachineID = 252 THEN _
  141.       St$ = "PC AT": _
  142.       ATtype = -1 _
  143.    ELSE IF MachineID = 250 THEN _
  144.       St$ = "PS/2 Model 30" _
  145.    ELSE IF MachineID = 249 THEN _
  146.       St$ = "PC Convertible" _
  147.    ELSE IF MachineID = 248 THEN _
  148.       St$ = "PS/2 Model 70 or 80": _
  149.       ATtype = -1 _
  150.    ELSE IF MachineID = 45 OR MachineID = 154 THEN _
  151.       St$ = "Compaq Portable" _
  152.    ELSE _
  153.       St$ = "unknown"
  154.    CALL XQPrint ("Computer type: " + St$, Row, 3, Attr, 0, 1)
  155.    Row = Row + 1
  156.  
  157.  
  158. '  ----- Display extended and expanded memory info ----------------------------
  159.  
  160.  
  161.    IF ATtype THEN _
  162.       CALL ExtMem (Memory): _
  163.       CALL XQPrint ("Extended memory (BIOS): " + MID$(STR$(Memory), 2) + " Kbytes", Row, 3, Attr, 0, 1): _
  164.       Row = Row + 1
  165.  
  166.    CALL GetLIMM (TotalPages, FreePages)
  167.    IF TotalPages THEN _
  168.       CALL GetLIMV (MajorV, MinorV): _
  169.       St$ = MID$(STR$(MajorV), 2) + "." + RIGHT$("0" + MID$(STR$(MinorV), 2), 2): _
  170.       CALL XQPrint ("Expanded memory:", Row, 3, Attr, 0, 1): _
  171.       Row = Row + 1: _
  172.       CALL XQPrint ("   Version: " + St$, Row, 3, Attr, 0, 1): _
  173.       Row = Row + 1: _
  174.       CALL XQPrint ("   Total  : " + MID$(STR$(TotalPages * 16), 2) + " Kbytes", Row, 3, Attr, 0, 1): _
  175.       Row = Row + 1: _
  176.       CALL XQPrint ("   Free   : " + MID$(STR$(FreePages * 16), 2) + " Kbytes", Row, 3, Attr, 0, 1): _
  177.       Row = Row + 1
  178.  
  179.  
  180. '  ----- Make sure the DOS prompt doesn't get in the way ----------------------
  181.  
  182.  
  183.    LOCATE 23, 1, 1
  184.