*     This program demonstartes how the Atari XBIOS and BIOS routines
*     can be accessed from Prospero Fortran
*
*     Date: 29 Oct 1987
*     Copyright (c) 1987 Prospero Software
*

      PROGRAM xBiosDemo
      INTEGER*2 parmblock(0:2)
      INTEGER*4 xbios, bios
      INTEGER oldvals, dummy

      parmblock(0) = 35              ! XBIOS keyboard repeat function
      parmblock(1) = -1              ! Get old keyboard repeats
      parmblock(2) = -1       
      oldvals = xbios(parmblock)

      parmblock(1) = 1               ! delay before first repeat
      parmblock(2) = 1               ! delay before re-repeat
      dummy = xbios(parmblock)       ! set new values

      print *, 'Try typing something'
      read (*,*,err=10) i
10    CONTINUE

*     Restore old keyboard repeat values

      parmblock(0) = 35
      parmblock(1) = (oldvals .AND. $FF00)/256
      parmblock(2) = oldvals .AND. $FF
      oldvals = xbios(parmblock)       ! Put it back to normal

      END 


    
