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

      PROGRAM MAIN

      INTEGER OLD_MODE, STATUS
      INTEGER FG_GETMODE, FG_MEMORY, FG_SVGAINIT, FG_SVGASTAT

      CALL FG_INITPM
      STATUS = FG_SVGAINIT(0)
      IF (IAND(FG_SVGASTAT(),4) .EQ. 0) THEN
         STOP 'Extended pages are not supported.'
      END IF
      IF (FG_MEMORY() .LT. 512) THEN
         STOP '512K video memory required.'
      END IF

      OLD_MODE = FG_GETMODE()
      CALL FG_SETMODE(13)

      CALL FG_SETCOLOR(9)
      CALL FG_FILLPAGE
      CALL FG_SETCOLOR(15)
      CALL FG_TEXT('Page 0',6)

      CALL FG_SETPAGE(15)
      CALL FG_SETCOLOR(10)
      CALL FG_FILLPAGE
      CALL FG_SETCOLOR(15)
      CALL FG_LOCATE(0,0)
      CALL FG_TEXT('Page 15',7)
      CALL FG_WAITKEY

      CALL FG_SETVPAGE(15)
      CALL FG_WAITKEY

      CALL FG_SETVPAGE(0)
      CALL FG_WAITKEY

      CALL FG_DEFPAGES(15,0)
      CALL FG_COPYPAGE(15,0)
      CALL FG_WAITKEY

      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
      END
