From 969dbb48dcffcb973d6d6fc4b937dc8b5e7ed2fb Mon Sep 17 00:00:00 2001 From: ffjeld Date: Fri, 13 Apr 2007 22:59:26 +0000 Subject: [PATCH] Tweaked (setf pixel). --- losp/x86-pc/vga.lisp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/losp/x86-pc/vga.lisp b/losp/x86-pc/vga.lisp index 838915c..a146b84 100644 --- a/losp/x86-pc/vga.lisp +++ b/losp/x86-pc/vga.lisp @@ -10,7 +10,7 @@ ;;;; Author: Frode Vatvedt Fjeld ;;;; 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 -- 2.11.4.GIT