(FILECREATED "16-Sep-85 13:07:26" {ERIS}<LISPCORE>SOURCES>DOVEDISPLAY.;19 9859   

      changes to:  (VARS DOVEDISPLAYCOMS)
		   (FNS \DoveDisplay.Init)

      previous date: "15-Sep-85 17:31:03" {ERIS}<LISPCORE>SOURCES>DOVEDISPLAY.;18)


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

(PRETTYCOMPRINT DOVEDISPLAYCOMS)

(RPAQQ DOVEDISPLAYCOMS ((FNS \DoveDisplay.GetBorderPattern \DoveDisplay.Init 
			     \DoveDisplay.ScreenHeight \DoveDisplay.ScreenWidth 
			     \DoveDisplay.SetBorderPattern \DoveDisplay.SetCursorMix 
			     \DoveDisplay.SetCursorPosition \DoveDisplay.SetCursorShape 
			     \DoveDisplay.SetVideoColor \DoveDisplay.TurnOn 
			     \DoveDisplay.GetCursorBitmapBase)
			(VARS (\DoveDisplay.FCBPointer))
			(GLOBALVARS \DoveDisplay.FCBPointer)
			(DECLARE: EVAL@COMPILE DONTCOPY (FILES (SOURCE)
							       DOVEDECLS)
				  (RECORDS DoveDisplay.CursorBitmap Dove.DisplayDCtlRegister 
					   Dove.DisplayFCB)
				  (CONSTANTS * DoveDisplay.ChangeMasks)
				  (CONSTANTS * DoveDisplay.CursorDisplayMixRules))
			(DECLARE: DONTEVAL@LOAD DOCOPY (P (\DoveDisplay.Init)))))
(DEFINEQ

(\DoveDisplay.GetBorderPattern
  (LAMBDA NIL                                                (* ejs: "12-Sep-85 20:25")
    (fetch (Dove.DisplayFCB BorderPattern) of \DoveDisplay.FCBPointer)))

(\DoveDisplay.Init
  (LAMBDA NIL                                                (* ejs: "16-Sep-85 13:05")
    (MAPC (QUOTE (\DoveDisplay.FCBPointer))
	  (FUNCTION \LOCKVAR))
    (MAPC (QUOTE (\DoveDisplay.TurnOn \DoveDisplay.SetCursorShape \DoveDisplay.SetCursorPosition 
				      \DoveDisplay.GetCursorBitmapBase \DoveDisplay.SetCursorMix 
				      \DoveDisplay.ScreenWidth \DoveDisplay.ScreenHeight))
	  (FUNCTION \LOCKFN))))

(\DoveDisplay.ScreenHeight
  (LAMBDA NIL                                                (* ejs: "12-Sep-85 20:26")
    (\DoveIO.ByteSwap (fetch (Dove.DisplayFCB ScreenHeight.BS) of \DoveDisplay.FCBPointer))))

(\DoveDisplay.ScreenWidth
  (LAMBDA NIL                                                (* ejs: "12-Sep-85 20:26")
    (\DoveIO.ByteSwap (fetch (Dove.DisplayFCB ScreenWidth.BS) of \DoveDisplay.FCBPointer))))

(\DoveDisplay.SetBorderPattern
  (LAMBDA (SHADE)                                            (* ejs: "12-Sep-85 20:29")
    (replace (Dove.DisplayFCB BorderPattern) of \DoveDisplay.FCBPointer with SHADE)
    (\DoveIO.LockMem \DoveIO.OR (IPLUS (\DoveIO.IORegionOffset \DoveDisplay.FCBPointer)
				       (INDEXF (fetch (Dove.DisplayFCB DisplayChangedInfo))))
		     \DoveDisplay.BorderPatternChangedMask NIL)))

(\DoveDisplay.SetCursorMix
  (LAMBDA (MIX)                                              (* ejs: "12-Sep-85 20:29")
    (replace (Dove.DisplayDCtlRegister dataCursor) of (LOCF (fetch (Dove.DisplayFCB 
									   DisplayControlRegister)
							       of \DoveDisplay.FCBPointer))
       with MIX)
    (\DoveIO.LockMem \DoveIO.OR (IPLUS (\DoveIO.IORegionOffset \DoveDisplay.FCBPointer)
				       (INDEXF (fetch (Dove.DisplayFCB DisplayChangedInfo)
						  of T)))
		     \DoveDisplay.DisplayInfoChangedMask NIL)))

(\DoveDisplay.SetCursorPosition
  (LAMBDA (X Y)                                              (* ejs: "12-Sep-85 20:29")
    (replace (Dove.DisplayFCB CursorXCoord.BS) of \DoveDisplay.FCBPointer with (\DoveIO.ByteSwap
										 X))
    (replace (Dove.DisplayFCB CursorYCoord.BS) of \DoveDisplay.FCBPointer with (\DoveIO.ByteSwap
										 Y))
    (\DoveIO.LockMem \DoveIO.OR (IPLUS (\DoveIO.IORegionOffset \DoveDisplay.FCBPointer)
				       (INDEXF (fetch (Dove.DisplayFCB DisplayChangedInfo))))
		     \DoveDisplay.CursorPosChangedMask NIL)))

(\DoveDisplay.SetCursorShape
  (LAMBDA (BITMAP)                                           (* ejs: "13-Sep-85 00:53")

          (* * This makes some assumptions about the bitmap passed to it...)



          (* * Unless it's NIL, then we just tell the IOP the bitmap changed.)



          (* * This functions runs locked down, unless referencing the bitmap makes it page fault.)


    (COND
      (BITMAP (\BLT (fetch (Dove.DisplayFCB CursorBitmap) of \DoveDisplay.FCBPointer)
		    (fetch (BITMAP BITMAPBASE) of BITMAP)
		    16)))
    (\DoveIO.LockMem \DoveIO.OR (IPLUS (\DoveIO.IORegionOffset \DoveDisplay.FCBPointer)
				       (INDEXF (fetch (Dove.DisplayFCB DisplayChangedInfo))))
		     \DoveDisplay.CursorMapChangedMask NIL)))

(\DoveDisplay.SetVideoColor
  (LAMBDA (INVERSE?)                                         (* ejs: "12-Sep-85 20:29")
    (LET ((FCB \DoveDisplay.FCBPointer))
         (COND
	   (INVERSE? (replace (Dove.DisplayDCtlRegister dataCursor)
			of (LOCF (fetch (Dove.DisplayFCB DisplayControlRegister) of FCB))
			with DoveDisplay.CursorORScreenInverted))
	   (T (replace (Dove.DisplayDCtlRegister dataCursor) of (LOCF (fetch (Dove.DisplayFCB 
									   DisplayControlRegister)
									 of FCB))
		 with DoveDisplay.CursorORScreenNormal))))
    (\DoveIO.LockMem \DoveIO.OR (IPLUS (\DoveIO.IORegionOffset \DoveDisplay.FCBPointer)
				       (INDEXF (fetch (Dove.DisplayFCB DisplayChangedInfo))))
		     \DoveDisplay.BackgroundChangedMask NIL)))

(\DoveDisplay.TurnOn
  (LAMBDA NIL                                                (* ejs: "12-Sep-85 20:29")
    (SETQ \DoveDisplay.FCBPointer (\DoveIO.GetHandlerIORegionPtr DoveIO.displayHandler))
    (replace (Dove.DisplayFCB CursorXCoord.BS) of \DoveDisplay.FCBPointer with 0)
    (replace (Dove.DisplayFCB CursorYCoord.BS) of \DoveDisplay.FCBPointer with 0)
    (replace (Dove.DisplayFCB BorderPattern) of \DoveDisplay.FCBPointer with (CONSTANT 
									    WINDOWBACKGROUNDSHADE))
    (replace (Dove.DisplayDCtlRegister dataCursor) of (LOCF (fetch (Dove.DisplayFCB 
									   DisplayControlRegister)
							       of \DoveDisplay.FCBPointer))
       with DoveDisplay.DefaultMixRule)
    (replace (Dove.DisplayDCtlRegister picture) of (LOCF (fetch (Dove.DisplayFCB 
									   DisplayControlRegister)
							    of \DoveDisplay.FCBPointer))
       with T)
    (\DoveIO.LockMem \DoveIO.OR (IPLUS (\DoveIO.IORegionOffset \DoveDisplay.FCBPointer)
				       (INDEXF (fetch (Dove.DisplayFCB DisplayChangedInfo))))
		     \DoveDisplay.AllInfoChangedMask NIL)))

(\DoveDisplay.GetCursorBitmapBase
  (LAMBDA NIL                                                (* ejs: "13-Sep-85 00:31")
    (fetch (Dove.DisplayFCB CursorBitmap) of \DoveDisplay.FCBPointer)))
)

(RPAQQ \DoveDisplay.FCBPointer NIL)
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS \DoveDisplay.FCBPointer)
)
(DECLARE: EVAL@COMPILE DONTCOPY 
(FILESLOAD (SOURCE)
	   DOVEDECLS)

[DECLARE: EVAL@COMPILE 

(MESATYPE DoveDisplay.CursorBitmap (16 WORD))

(BLOCKRECORD Dove.DisplayDCtlRegister ((dataCursor BITS 4)
				       (picture FLAG)
				       (NIL BITS 1)
				       (dontUse BITS 2)))

(MESARECORD Dove.DisplayFCB ((DisplayTCB DoveIO.TaskContextBlock)
			     (DisplayLOCK.BS WORD)
			     (DisplayChangedInfo WORD)
			     (VerticalRetraceEvent DoveIO.ClientCondition)
			     (CursorXCoord.BS WORD)
			     (CursorYCoord.BS WORD)
			     (BorderPattern WORD)
			     (CursorBitmap DoveDisplay.CursorBitmap)
			     (DisplayControlRegister BYTE)
			     (CursorMixRule BITS 4)
			     (NIL BITS 4)
			     (ScreenWidth.BS WORD)
			     (ScreenHeight.BS WORD)
			     (DisplayConfig BYTE)
			     (NIL BYTE)
			     (ColorParams.BS WORD)
			     (CursorXCoordOffset.BS WORD)
			     (CursorYCoordOffset.BS WORD)
			     (PixelsPerInch BYTE)
			     (RefreshRate BYTE)))
]


(RPAQQ DoveDisplay.ChangeMasks ((\DoveDisplay.AllInfoChangedMask 248)
				(\DoveDisplay.BackgroundChangedMask 16)
				(\DoveDisplay.BorderPatternChangedMask 32)
				(\DoveDisplay.CursorMapChangedMask 64)
				(\DoveDisplay.CursorPosChangedMask 128)
				(\DoveDisplay.DisplayInfoChangedMask 8)
				(\DoveDisplay.PictureBorderPatternChangedMask 40)))
(DECLARE: EVAL@COMPILE 

(RPAQQ \DoveDisplay.AllInfoChangedMask 248)

(RPAQQ \DoveDisplay.BackgroundChangedMask 16)

(RPAQQ \DoveDisplay.BorderPatternChangedMask 32)

(RPAQQ \DoveDisplay.CursorMapChangedMask 64)

(RPAQQ \DoveDisplay.CursorPosChangedMask 128)

(RPAQQ \DoveDisplay.DisplayInfoChangedMask 8)

(RPAQQ \DoveDisplay.PictureBorderPatternChangedMask 40)

(CONSTANTS (\DoveDisplay.AllInfoChangedMask 248)
	   (\DoveDisplay.BackgroundChangedMask 16)
	   (\DoveDisplay.BorderPatternChangedMask 32)
	   (\DoveDisplay.CursorMapChangedMask 64)
	   (\DoveDisplay.CursorPosChangedMask 128)
	   (\DoveDisplay.DisplayInfoChangedMask 8)
	   (\DoveDisplay.PictureBorderPatternChangedMask 40))
)


(RPAQQ DoveDisplay.CursorDisplayMixRules ((DoveDisplay.DefaultMixRule 1)
					  (DoveDisplay.CursorORScreenNormal 1)
					  (DoveDisplay.CursorORScreenInverted 14)
					  (DoveDisplay.CursorXORScreenNormal 9)
					  (DoveDisplay.CursorXORScreenInverted 6)))
(DECLARE: EVAL@COMPILE 

(RPAQQ DoveDisplay.DefaultMixRule 1)

(RPAQQ DoveDisplay.CursorORScreenNormal 1)

(RPAQQ DoveDisplay.CursorORScreenInverted 14)

(RPAQQ DoveDisplay.CursorXORScreenNormal 9)

(RPAQQ DoveDisplay.CursorXORScreenInverted 6)

(CONSTANTS (DoveDisplay.DefaultMixRule 1)
	   (DoveDisplay.CursorORScreenNormal 1)
	   (DoveDisplay.CursorORScreenInverted 14)
	   (DoveDisplay.CursorXORScreenNormal 9)
	   (DoveDisplay.CursorXORScreenInverted 6))
)
)
(DECLARE: DONTEVAL@LOAD DOCOPY 
(\DoveDisplay.Init)
)
(PUTPROPS DOVEDISPLAY COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1123 6807 (\DoveDisplay.GetBorderPattern 1133 . 1340) (\DoveDisplay.Init 1342 . 1808) (
\DoveDisplay.ScreenHeight 1810 . 2034) (\DoveDisplay.ScreenWidth 2036 . 2258) (
\DoveDisplay.SetBorderPattern 2260 . 2696) (\DoveDisplay.SetCursorMix 2698 . 3250) (
\DoveDisplay.SetCursorPosition 3252 . 3837) (\DoveDisplay.SetCursorShape 3839 . 4626) (
\DoveDisplay.SetVideoColor 4628 . 5425) (\DoveDisplay.TurnOn 5427 . 6594) (
\DoveDisplay.GetCursorBitmapBase 6596 . 6805)))))
STOP