(FILECREATED "15-Sep-85 17:31:03" {ERIS}<LISPCORE>SOURCES>DOVEDISPLAY.;18 9922   

      changes to:  (VARS DOVEDISPLAYCOMS)

      previous date: "13-Sep-85 01:53:05" {ERIS}<LISPCORE>SOURCES>DOVEDISPLAY.;17)


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

(PRETTYCOMPRINT DOVEDISPLAYCOMS)

(RPAQQ DOVEDISPLAYCOMS ((FNS \DoveDisplay.GetBorderPattern \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: DONTCOPY (ADDVARS (INEWCOMS (ALLOCAL (ADDVARS (LOCKEDVARS \DoveDisplay.FCBPointer)
								(LOCKEDFNS \DoveDisplay.TurnOn 
								      \DoveDisplay.SetCursorShape 
								   \DoveDisplay.SetCursorPosition 
								 \DoveDisplay.GetCursorBitmapBase 
									\DoveDisplay.SetCursorMix 
									 \DoveDisplay.ScreenWidth 
									\DoveDisplay.ScreenHeight)))))
		  )))
(DEFINEQ

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

(\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: DONTCOPY 

(ADDTOVAR INEWCOMS (ALLOCAL (ADDVARS (LOCKEDVARS \DoveDisplay.FCBPointer)
				     (LOCKEDFNS \DoveDisplay.TurnOn \DoveDisplay.SetCursorShape 
						\DoveDisplay.SetCursorPosition 
						\DoveDisplay.GetCursorBitmapBase 
						\DoveDisplay.SetCursorMix \DoveDisplay.ScreenWidth 
						\DoveDisplay.ScreenHeight))))
)
(PUTPROPS DOVEDISPLAY COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1366 6582 (\DoveDisplay.GetBorderPattern 1376 . 1583) (\DoveDisplay.ScreenHeight 1585
 . 1809) (\DoveDisplay.ScreenWidth 1811 . 2033) (\DoveDisplay.SetBorderPattern 2035 . 2471) (
\DoveDisplay.SetCursorMix 2473 . 3025) (\DoveDisplay.SetCursorPosition 3027 . 3612) (
\DoveDisplay.SetCursorShape 3614 . 4401) (\DoveDisplay.SetVideoColor 4403 . 5200) (\DoveDisplay.TurnOn
 5202 . 6369) (\DoveDisplay.GetCursorBitmapBase 6371 . 6580)))))
STOP