(FILECREATED "30-Aug-85 18:19:34" {DSK}<LISPFILES>MATT>FASTBITMAPBIT.;4 2895   

      changes to:  (MACROS FBITMAPBIT)
		   (FNS FBITMAPBIT)

      previous date: " 1-Jun-84 12:31:12" {DSK}<LISPFILES>MATT>FASTBITMAPBIT.;3)


(* Copyright (c) 1984, 1985 by Matt Heffron. All rights reserved.)

(PRETTYCOMPRINT FASTBITMAPBITCOMS)

(RPAQQ FASTBITMAPBITCOMS ((MACROS FBITMAPBIT)
			  (FNS FBITMAPBIT)
			  (ADDVARS (GLOBALVARS BITMASKARRAY))))
(DECLARE: EVAL@COMPILE 

(PUTPROPS FBITMAPBIT DMACRO [LAMBDA (bitmap x y newvalue)
				    (* Don't forget to keep the EXPR code the same as this code, so 
				       it will compile as the same thing)
				    (DECLARE (LOCALVARS bitmap x y newvalue bm.base oldword oldvalue 
							bmask wordindex))
				    (PROG ((bm.base (fetch BITMAPBASE of bitmap))
					   oldword oldvalue (bmask (\WORDELT BITMASKARRAY
									     (LOGAND 15 x)))
					   wordindex)
					  (SETQ wordindex
						(IPLUS (ITIMES (IDIFFERENCE (SUB1 (fetch BITMAPHEIGHT 
											 of bitmap))
									    y)
							       (fetch BITMAPRASTERWIDTH of bitmap))
						       (LRSH x 4)))
					  (SETQ oldword (\GETBASE bm.base wordindex))
					  (SETQ oldvalue (LOGAND oldword bmask))
					  (COND ((ZEROP oldvalue)
						 [COND (newvalue (COND ((EQ newvalue 1)
									(\PUTBASE bm.base wordindex
										  (LOGOR oldword 
											 bmask]
						 (RETURN 0))
						(T [COND (newvalue (COND ((ZEROP newvalue)
									  (\PUTBASE bm.base wordindex
										    (LOGXOR oldword 
											    bmask]
						   (RETURN 1])
)
(DEFINEQ

(FBITMAPBIT
  [LAMBDA (bitmap x y newvalue)                              (* mth: "30-Aug-85 18:18")
                                                             (* Don't forget to keep the DMACRO property IDENTICAL 
							     with this code!!)
    (DECLARE (LOCALVARS bitmap x y newvalue bm.base oldword oldvalue bmask wordindex))
    (PROG ((bm.base (fetch BITMAPBASE of bitmap))
	   (bmask (\WORDELT BITMASKARRAY (LOGAND 15 x)))
	   oldword oldvalue wordindex)
          (SETQ wordindex (IPLUS (ITIMES (IDIFFERENCE (SUB1 (fetch BITMAPHEIGHT of bitmap))
						      y)
					 (fetch BITMAPRASTERWIDTH of bitmap))
				 (LRSH x 4)))
          (SETQ oldword (\GETBASE bm.base wordindex))
          (SETQ oldvalue (LOGAND oldword bmask))
          (COND
	    ((ZEROP oldvalue)
	      [COND
		(newvalue (COND
			    ((EQ newvalue 1)
			      (\PUTBASE bm.base wordindex (LOGOR oldword bmask]
	      (RETURN 0))
	    (T [COND
		 (newvalue (COND
			     ((ZEROP newvalue)
			       (\PUTBASE bm.base wordindex (LOGXOR oldword bmask]
	       (RETURN 1])
)

(ADDTOVAR GLOBALVARS BITMASKARRAY)
(PUTPROPS FASTBITMAPBIT COPYRIGHT ("Matt Heffron" 1984 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1556 2771 (FBITMAPBIT 1566 . 2769)))))
STOP