$INCLUDE: 'C:\FG\FASTGRAF.FI'

      PROGRAM MAIN

      CHARACTER*4 STRING
      INTEGER OLD_MODE
      INTEGER STATUS
      INTEGER FG_GETMODE, FG_SVGAINIT, FG_TESTMODE

      CALL FG_INITPM
      OLD_MODE = FG_GETMODE()
      STATUS = FG_SVGAINIT(1)

      IF (FG_TESTMODE(27,1) .EQ. 1) THEN
         CALL FG_SETMODE(27)
      ELSE IF (FG_TESTMODE(26,1) .EQ. 1) THEN
         CALL FG_SETMODE(26)
      ELSE IF (FG_TESTMODE(25,1) .EQ. 1) THEN
         CALL FG_SETMODE(25)
      ELSE
         STOP 'This program requires an SVGA with at least 512K.'
      END IF

      CALL FG_SETCOLOR(15)
      CALL FG_TEXT('I''m running in mode ',20)
      WRITE(STRING,1000) FG_GETMODE()
      CALL FG_TEXT(STRING,3)
      CALL FG_WAITKEY

      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
1000  FORMAT(I2,'.')
      END
