(FILECREATED " 8-Aug-85 21:50:15" {ERIS}<LISPCORE>SOURCES>DOVEMISC.;9 9094   

      changes to:  (VARS DOVEMISCCOMS)

      previous date: " 2-Aug-85 13:39:53" {ERIS}<LISPCORE>SOURCES>DOVEMISC.;8)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT DOVEMISCCOMS)

(RPAQQ DOVEMISCCOMS ((DECLARE: DONTCOPY (RECORDS Dove.BeepFCB Dove.KeyboardFCB Dove.ProcessorFCB 
						 Dove.TODFormat))
		     (FNS \DoveMisc.BeepOff \DoveMisc.BeepOn \DoveMisc.BootButton 
			  \DoveMisc.DoProcessorCommand \DoveMisc.GetKBDBase \DoveMisc.GetMouseXBase 
			  \DoveMisc.GetMouseYBase \DoveMisc.ReadEEProm \DoveMisc.ReadGMT 
			  \DoveMisc.ReadHostID \DoveMisc.SetMousePosition \DoveMisc.WriteGMT)
		     [DECLARE: DONTEVAL@LOAD DOCOPY
			       (P (MAPC (QUOTE (\DoveMisc.GetKBDBase \DoveMisc.GetMouseXBase 
								     \DoveMisc.GetMouseYBase 
								     \DoveMisc.BeepOff 
								     \DoveMisc.SetMousePosition 
								     \DoveMisc.DoProcessorCommand 
								     \DoveMisc.ReadGMT 
								     \DoveMisc.ReadHostID 
								     \DoveMisc.BootButton))
					(FUNCTION \LOCKFN]
		     (DECLARE: DONTCOPY (CONSTANTS \DoveMisc.BootButton \DoveMisc.ReadEEProm 
						   \DoveMisc.ReadGMT \DoveMisc.ReadHostID 
						   \DoveMisc.WriteGMT))))
(DECLARE: DONTCOPY 
[DECLARE: EVAL@COMPILE 

(BLOCKRECORD Dove.BeepFCB ((BeepTCB 15 WORD)
			   (BeepCondition WORD)
			   (BeepMask WORD)
			   (Frequency.BS WORD)))

(BLOCKRECORD Dove.KeyboardFCB ((KeyboardTCB 15 WORD)
			       (KeyBitsBase 9 WORD)
			       (MouseX WORD)
			       (MouseY WORD)))

(BLOCKRECORD Dove.ProcessorFCB ((ProcessorTCB 15 WORD)
				(TODValid BYTE)
				(Command BYTE)
				(Data 3 WORD)))

(BLOCKRECORD Dove.TODFormat ((ClockLow.BS WORD)
			     (ClockHigh.BS WORD)))
]
)
(DEFINEQ

(\DoveMisc.BeepOff
  [LAMBDA NIL                                                (* mpl "23-Jul-85 23:32")
    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.BeepFCBOffset))
    (replace (Dove.BeepFCB Frequency.BS) of (\DoveFCBAt \Dove.BeepFCBOffset) with 0)
    (\DoveIO.NotifyIOP (fetch (Dove.BeepFCB BeepMask) of (\DoveFCBAt \Dove.BeepFCBOffset])

(\DoveMisc.BeepOn
  [LAMBDA (FREQ)                                             (* mpl " 2-Aug-85 13:39")
    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.BeepFCBOffset))
    [replace (Dove.BeepFCB Frequency.BS) of (\DoveFCBAt \Dove.BeepFCBOffset)
       with (\DoveIO.ByteSwap (FIX (QUOTIENT 900000 (IMAX FREQ 14]
    (\DoveIO.NotifyIOP (fetch (Dove.BeepFCB BeepMask) of (\DoveFCBAt \Dove.BeepFCBOffset])

(\DoveMisc.BootButton
  [LAMBDA NIL                                                (* mpl "23-Jul-85 23:46")

          (* * This fn re-boots the machine)


    (DECLARE (CONSTANTS \DoveMisc.BootButton))
    (\DoveMisc.DoProcessorCommand \DoveMisc.BootButton)
    (until NIL do (NILL])

(\DoveMisc.DoProcessorCommand
  [LAMBDA (CMD)
    (DECLARE (GLOBALVARS \DoveIORegion \Dove.ProcessorFCBOffset))
                                                             (* mpl "23-Jul-85 23:43")

          (* * This fn stuffs commands at the mesa processor task)


    (replace (Dove.ProcessorFCB Command) of (\DoveFCBAt \Dove.ProcessorFCBOffset) with CMD)
    (\DoveIO.NotifyIOP 0)
    (until (EQ 0 (fetch (Dove.ProcessorFCB Command) of (\DoveFCBAt \Dove.ProcessorFCBOffset])

(\DoveMisc.GetKBDBase
  [LAMBDA NIL                                                (* mpl "19-Jun-85 20:10")
    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.Keyboard&MouseFCBOffset))
    (\ADDBASE \DoveIORegion (IPLUS \Dove.Keyboard&MouseFCBOffset (INDEXF (fetch (Dove.KeyboardFCB
										  KeyBitsBase])

(\DoveMisc.GetMouseXBase
  [LAMBDA NIL
    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.Keyboard&MouseFCBOffset))      (* mpl "19-Jun-85 20:10")
    (\ADDBASE \DoveIORegion (IPLUS \Dove.Keyboard&MouseFCBOffset (INDEXF (fetch (Dove.KeyboardFCB
										  MouseX])

(\DoveMisc.GetMouseYBase
  [LAMBDA NIL                                                (* mpl "19-Jun-85 20:10")
    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.Keyboard&MouseFCBOffset))
    (\ADDBASE \DoveIORegion (IPLUS \Dove.Keyboard&MouseFCBOffset (INDEXF (fetch (Dove.KeyboardFCB
										  MouseY])

(\DoveMisc.ReadEEProm
  [LAMBDA (OFFSET)                                           (* mpl "23-Jul-85 23:38")

          (* * This fn reads a word out of the EEProm)


    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.ProcessorFCBOffset \DoveMisc.ReadEEProm))
    (replace (Dove.ProcessorFCB Data) of (\DoveFCBAt \Dove.ProcessorFCBOffset) with (\DoveIO.ByteSwap
										      OFFSET))
    (\DoveMisc.DoProcessorCommand \DoveMisc.ReadEEProm)
    (\DoveIO.ByteSwap (fetch (Dove.ProcessorFCB Data) of (\DoveFCBAt \Dove.ProcessorFCBOffset])

(\DoveMisc.ReadGMT
  [LAMBDA (CLOCKLOC)
    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.ProcessorFCBOffset \DoveIO.ByteTRUE \DoveMisc.ReadGMT))
                                                             (* mpl "24-Jul-85 00:08")
    (COND
      [(EQ (fetch (Dove.ProcessorFCB TODValid) of (\DoveFCBAt \Dove.ProcessorFCBOffset))
	   \DoveIO.ByteTRUE)                                 (* Set clock)
	(\DoveMisc.DoProcessorCommand \DoveMisc.ReadGMT)
	[\PUTBASE CLOCKLOC 0 (\DoveIO.ByteSwap (fetch (Dove.TODFormat ClockLow.BS)
						  of (LOCF (fetch (Dove.ProcessorFCB Data)
							      of (\DoveFCBAt \Dove.ProcessorFCBOffset]
	(\PUTBASE CLOCKLOC 1 (\DoveIO.ByteSwap (fetch (Dove.TODFormat ClockHigh.BS)
						  of (LOCF (fetch (Dove.ProcessorFCB Data)
							      of (\DoveFCBAt \Dove.ProcessorFCBOffset]
      (T                                                     (* zero clock)
	 (\PUTBASE CLOCKLOC 0 0)
	 (\PUTBASE CLOCKLOC 1 0])

(\DoveMisc.ReadHostID
  [LAMBDA (HOSTLOC)                                          (* mpl "24-Jul-85 00:10")

          (* * Reads host id of this machine and smashes 3 words at HOSTLOC)


    (DECLARE (CONSTANTS \DoveMisc.ReadHostID))
    (\DoveMisc.DoProcessorCommand \DoveMisc.ReadHostID)
    (\BLT HOSTLOC (LOCF (fetch (Dove.ProcessorFCB Data) of (\DoveFCBAt \Dove.ProcessorFCBOffset)))
	  3)
    NIL])

(\DoveMisc.SetMousePosition
  [LAMBDA (X Y)                                              (* mpl "19-Jun-85 20:09")
    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.Keyboard&MouseFCBOffset))
    (do (replace (Dove.KeyboardFCB MouseX) of (\ADDBASE \DoveIORegion \Dove.Keyboard&MouseFCBOffset)
	   with X)
	(replace (Dove.KeyboardFCB MouseY) of (\ADDBASE \DoveIORegion \Dove.Keyboard&MouseFCBOffset)
	   with Y)
       repeatuntil (AND (EQ X (fetch (Dove.KeyboardFCB MouseX) of (\ADDBASE \DoveIORegion 
								    \Dove.Keyboard&MouseFCBOffset)))
			(EQ Y (fetch (Dove.KeyboardFCB MouseY) of (\ADDBASE \DoveIORegion 
								    \Dove.Keyboard&MouseFCBOffset])

(\DoveMisc.WriteGMT
  [LAMBDA (CLOCKLOC)
    (DECLARE (GLOBALVARS \DoveIORegion)
	     (CONSTANTS \Dove.ProcessorFCBOffset \DoveIO.ByteTRUE \DoveMisc.WriteGMT))
                                                             (* mpl "24-Jul-85 22:56")
                                                             (* Set clock)
    (replace (Dove.TODFormat ClockLow.BS) of (LOCF (fetch (Dove.ProcessorFCB Data)
						      of (\DoveFCBAt \Dove.ProcessorFCBOffset)))
       with (\DoveIO.ByteSwap (\GETBASE CLOCKLOC 0)))
    (replace (Dove.TODFormat ClockHigh.BS) of (LOCF (fetch (Dove.ProcessorFCB Data)
						       of (\DoveFCBAt \Dove.ProcessorFCBOffset)))
       with (\DoveIO.ByteSwap (\GETBASE CLOCKLOC 1)))
    (\DoveMisc.DoProcessorCommand \DoveMisc.WriteGMT)
    (replace (Dove.ProcessorFCB TODValid) of (\DoveFCBAt \Dove.ProcessorFCBOffset) with 
										 \DoveIO.ByteTRUE])
)
(DECLARE: DONTEVAL@LOAD DOCOPY 
(MAPC (QUOTE (\DoveMisc.GetKBDBase \DoveMisc.GetMouseXBase \DoveMisc.GetMouseYBase \DoveMisc.BeepOff 
				   \DoveMisc.SetMousePosition \DoveMisc.DoProcessorCommand 
				   \DoveMisc.ReadGMT \DoveMisc.ReadHostID \DoveMisc.BootButton))
      (FUNCTION \LOCKFN))
)
(DECLARE: DONTCOPY 
(DECLARE: EVAL@COMPILE 

(RPAQQ \DoveMisc.BootButton 5)

(RPAQQ \DoveMisc.ReadEEProm 4)

(RPAQQ \DoveMisc.ReadGMT 1)

(RPAQQ \DoveMisc.ReadHostID 3)

(RPAQQ \DoveMisc.WriteGMT 2)

(CONSTANTS \DoveMisc.BootButton \DoveMisc.ReadEEProm \DoveMisc.ReadGMT \DoveMisc.ReadHostID 
	   \DoveMisc.WriteGMT)
)
)
(PUTPROPS DOVEMISC COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1790 8379 (\DoveMisc.BeepOff 1800 . 2200) (\DoveMisc.BeepOn 2202 . 2672) (
\DoveMisc.BootButton 2674 . 2995) (\DoveMisc.DoProcessorCommand 2997 . 3525) (\DoveMisc.GetKBDBase 
3527 . 3880) (\DoveMisc.GetMouseXBase 3882 . 4191) (\DoveMisc.GetMouseYBase 4193 . 4544) (
\DoveMisc.ReadEEProm 4546 . 5144) (\DoveMisc.ReadGMT 5146 . 6192) (\DoveMisc.ReadHostID 6194 . 6636) (
\DoveMisc.SetMousePosition 6638 . 7406) (\DoveMisc.WriteGMT 7408 . 8377)))))
STOP