home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / QBAS / PBBACK10.ZIP / DEMO.BAS < prev    next >
BASIC Source File  |  1992-11-08  |  6KB  |  186 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |       PBBack  Copyright (c) 1990-1992  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.  I'll improve", Row, 3, Attr, 0, 1)
  43.    Row = Row + 1
  44.    CALL XQPrint ("it drastically in later versions.  However, for now it will provide an", Row, 3, Attr, 0, 1)
  45.    Row = Row + 1
  46.    CALL XQPrint ("example of how to access the PBBack routines.", Row, 3, Attr, 0, 1)
  47.    Row = Row + 2
  48.  
  49.  
  50. '  ----- Display processor and coprocessor types ------------------------------
  51.  
  52.  
  53.    CALL Processor (CPU)
  54.    CALL NumProc (NDP)
  55.  
  56.    IF CPU = 0 THEN _
  57.       St$ = "NEC V20" _
  58.    ELSE IF CPU = 1 THEN _
  59.       St$ = "8088" _
  60.    ELSE IF CPU = 2 THEN _
  61.       St$ = "80186" _
  62.    ELSE IF CPU = 3 THEN _
  63.       St$ = "80286" _
  64.    ELSE IF CPU = 4 THEN _
  65.       St$ = "80386" _
  66.    ELSE IF CPU = 5 THEN _
  67.       St$ = "80486" _
  68.    ELSE _
  69.       St$ = "80?86"
  70.  
  71.    IF NDP = 1 THEN _
  72.       St$ = St$ + " with 8087 math support" _
  73.    ELSE IF NDP = 2 THEN _
  74.       St$ = St$ + " with 80287 math support" _
  75.    ELSE IF NDP = 3 THEN _
  76.       St$ = St$ + " with 80387 math support"
  77.  
  78.    CALL XQPrint ("Processor: " + St$, Row, 3, Attr, 0, 1)
  79.    Row = Row + 1
  80.  
  81.  
  82. '  ----- Display DOS version --------------------------------------------------
  83.  
  84.  
  85.    CALL GetDOSv (MajorV, MinorV)
  86.    DOSv$ = MID$(STR$(MajorV), 2) + "." + RIGHT$("0" + MID$(STR$(MinorV), 2), 2)
  87.    IF MajorV > 9 THEN _
  88.       St$ = "   OS/2 Compatibility Box" _
  89.    ELSE _
  90.       St$ = ""
  91.    CALL XQPrint ("DOS version: " + DOSv$ + St$, Row, 3, Attr, 0, 1)
  92.    Row = Row + 1
  93.  
  94.  
  95. '  ----- Display basic equipment info -----------------------------------------
  96.  
  97.  
  98.    CALL Equipment (Memory, Parallel, Serial, Game)
  99.    CALL XQPrint ("Base memory: " + MID$(STR$(Memory), 2) + " Kbytes", Row, 3, Attr, 0, 1)
  100.    Row = Row + 1
  101.    CALL XQPrint ("Parallel ports: " + MID$(STR$(Parallel), 2), Row, 3, Attr, 0, 1)
  102.    Row = Row + 1
  103.    CALL XQPrint ("Serial ports: " + MID$(STR$(Serial), 2), Row, 3, Attr, 0, 1)
  104.    Row = Row + 1
  105.    REM we'll leave out game ports, since that's not always reliable
  106.  
  107.    CALL Floppies (FloppyDrives)
  108.    CALL XQPrint ("Floppy drives: " + MID$(STR$(FloppyDrives), 2), Row, 3, Attr, 0, 1)
  109.    Row = Row + 1
  110.  
  111.  
  112. '  ----- Display video adapter type -------------------------------------------
  113.  
  114.  
  115.    CALL GetVGA (IsVGA)
  116.    CALL GetEGA (EGA, Memory)
  117.    IF IsVGA THEN _
  118.       St$ = "VGA" _
  119.    ELSE IF EGA THEN _
  120.       St$ = "EGA" _
  121.    ELSE IF Colour THEN _
  122.       St$ = "CGA" _
  123.    ELSE _
  124.       St$ = "MDA"
  125.    CALL XQPrint ("Display: " + St$, Row, 3, Attr, 0, 1)
  126.    Row = Row + 1
  127.  
  128.  
  129. '  ----- Display BIOS date and type -------------------------------------------
  130.  
  131.  
  132.    PCDat$ = SPACE$(8)      ' init string to right size
  133.    CALL PCDate (PCDat$)    ' fill it in
  134.    CALL XQPrint ("ROM BIOS date: " + PCDat$, Row, 3, Attr, 0, 1)
  135.    Row = Row + 1
  136.  
  137.    CALL PCType (MachineID)
  138.    IF MachineID = 251 OR MachineID = 254 OR MachineID = 255 THEN _
  139.       St$ = "PC/XT" _
  140.    ELSE IF MachineID = 253 THEN _
  141.       St$ = "PCjr" _
  142.    ELSE IF MachineID = 252 THEN _
  143.       St$ = "PC AT": _
  144.       ATtype = -1 _
  145.    ELSE IF MachineID = 250 THEN _
  146.       St$ = "PS/2 Model 30" _
  147.    ELSE IF MachineID = 249 THEN _
  148.       St$ = "PC Convertible" _
  149.    ELSE IF MachineID = 248 THEN _
  150.       St$ = "PS/2 Model 70 or 80": _
  151.       ATtype = -1 _
  152.    ELSE IF MachineID = 45 OR MachineID = 154 THEN _
  153.       St$ = "Compaq Portable" _
  154.    ELSE _
  155.       St$ = "unknown"
  156.    CALL XQPrint ("Computer type: " + St$, Row, 3, Attr, 0, 1)
  157.    Row = Row + 1
  158.  
  159.  
  160. '  ----- Display extended and expanded memory info ----------------------------
  161.  
  162.  
  163.    IF ATtype THEN _
  164.       CALL ExtMem (Memory): _
  165.       CALL XQPrint ("Extended memory (BIOS): " + MID$(STR$(Memory), 2) + " Kbytes", Row, 3, Attr, 0, 1): _
  166.       Row = Row + 1
  167.  
  168.    CALL GetLIMM (TotalPages, FreePages)
  169.    IF TotalPages THEN _
  170.       CALL GetLIMV (MajorV, MinorV): _
  171.       St$ = MID$(STR$(MajorV), 2) + "." + RIGHT$("0" + MID$(STR$(MinorV), 2), 2): _
  172.       CALL XQPrint ("Expanded memory:", Row, 3, Attr, 0, 1): _
  173.       Row = Row + 1: _
  174.       CALL XQPrint ("   Version: " + St$, Row, 3, Attr, 0, 1): _
  175.       Row = Row + 1: _
  176.       CALL XQPrint ("   Total  : " + MID$(STR$(TotalPages * 16), 2) + " Kbytes", Row, 3, Attr, 0, 1): _
  177.       Row = Row + 1: _
  178.       CALL XQPrint ("   Free   : " + MID$(STR$(FreePages * 16), 2) + " Kbytes", Row, 3, Attr, 0, 1): _
  179.       Row = Row + 1
  180.  
  181.  
  182. '  ----- Make sure the DOS prompt doesn't get in the way ----------------------
  183.  
  184.  
  185.    LOCATE 23, 1, 1
  186.