[movitz-cvs] CVS movitz/losp/x86-pc

ffjeld ffjeld at common-lisp.net
Fri Apr 13 22:59:26 UTC 2007


Update of /project/movitz/cvsroot/movitz/losp/x86-pc
In directory clnet:/tmp/cvs-serv7718

Modified Files:
	vga.lisp 
Log Message:
Tweaked (setf pixel).


--- /project/movitz/cvsroot/movitz/losp/x86-pc/vga.lisp	2007/04/07 08:04:51	1.13
+++ /project/movitz/cvsroot/movitz/losp/x86-pc/vga.lisp	2007/04/13 22:59:26	1.14
@@ -10,7 +10,7 @@
 ;;;; Author:        Frode Vatvedt Fjeld <frodef at acm.org>
 ;;;; Created at:    Tue Sep 25 14:08:20 2001
 ;;;;                
-;;;; $Id: vga.lisp,v 1.13 2007/04/07 08:04:51 ffjeld Exp $
+;;;; $Id: vga.lisp,v 1.14 2007/04/13 22:59:26 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -1131,20 +1131,23 @@
 
 ;; set a pixel to a colour of our choice
 ;; write to the NEXT page
-(defun (setf pixel) (col x y)
-  (cond ((< x (nth 0 (viewport))) (return-from pixel nil))
-		((> x (nth 1 (viewport))) (return-from pixel nil))
-		((< y (nth 2 (viewport))) (return-from pixel nil))
-		((> y (nth 3 (viewport))) (return-from pixel nil))
-		(t (set-plane (logand x 3))
-		   (setf (memref-int (vga-memory-map)
-							 :index (+ (* (truncate *vga-width* 4) y) ; pixel
-									   (truncate x 4)
-									   (* (truncate *vga-width* 2) ; page
-										  *vga-height*
-										  *vga-current-page*))
-							 :type :unsigned-byte8)
-				 col))))
+(defun (setf pixel) (color x y)
+  (cond
+    ((< x (nth 0 (viewport))))
+    ((>= x (nth 1 (viewport))))
+    ((< y (nth 2 (viewport))))
+    ((>= y (nth 3 (viewport))))
+    (t (set-plane (logand x 3))
+       (setf (memref-int (vga-memory-map)
+              :index (+ (* (truncate *vga-width* 4) y) ; pixel
+                        (truncate x 4)
+                        (* (truncate *vga-width* 2) ; page
+                           *vga-height*
+                           *vga-current-page*))
+              :type :unsigned-byte8)
+             color)))
+  color)
+
 
 
 ; return the current viewport as a list




More information about the Movitz-cvs mailing list