home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exbas.arj / TEMP / 05-16.BAS < prev    next >
BASIC Source File  |  1995-01-31  |  1KB  |  71 lines

  1. REM $INCLUDE: 'fastgraf.bi'
  2.  
  3. DEFINT A-Z
  4.  
  5. REM Ask for the video mode number
  6.  
  7. INPUT "Which video mode"; Mode
  8.  
  9. REM Make sure the entered value is valid
  10.  
  11. IF Mode < 0 OR Mode > 29 THEN
  12.    PRINT Mode; "is not a valid video mode number."
  13.    STOP
  14. END IF
  15.  
  16. REM Make sure the requested video mode is available
  17.  
  18. IF Mode > 23 THEN Status = FGsvgainit(0)
  19. IF FGtestmode(mode,1) = 0 THEN
  20.    PRINT "Mode"; Mode; "is not available on this system."
  21.    STOP
  22. END IF
  23.  
  24. REM Establish the video mode
  25.  
  26. OldMode = FGgetmode
  27. FGsetmode Mode
  28.  
  29. REM Perform mode-specific initializations
  30.  
  31. IF Mode <= 3 OR Mode = 7  THEN    ' text modes
  32.    FGcursor 0
  33.  
  34. ELSEIF Mode = 4 OR Mode = 5 THEN ' CGA color modes
  35.    FGpalette 0, 0
  36.    FGdefcolor 14, 3
  37.  
  38. ELSEIF Mode = 6 THEN             ' CGA two-color mode
  39.    FGpalette 0, 14
  40.    FGdefcolor 14, 1
  41.  
  42. ELSEIF Mode = 11 THEN            ' Hercules mode
  43.    FGdefcolor 14, 1
  44.  
  45. ELSEIF Mode = 12 THEN            ' Hercules low-res mode
  46.    FGdefcolor 14, 3
  47.  
  48. ELSEIF Mode = 17 THEN            ' VGA two-color mode
  49.    FGpalette 1, 14
  50.    FGsetrgb 14, 63, 63, 21
  51.    FGdefcolor 14, 1
  52. END IF
  53.  
  54. REM Display a message that includes the video mode number
  55.  
  56. FGsetcolor 14
  57. FGtext "I'm running in mode", 19
  58. FGtext STR$(Mode), LEN(STR$(Mode))
  59. FGtext ".", 1
  60.  
  61. REM Wait for a keystroke
  62.  
  63. FGwaitkey
  64.  
  65. REM Restore the original video mode and screen attributes
  66.  
  67. FGsetmode OldMode
  68. FGreset
  69.  
  70. END
  71.