[movitz-cvs] CVS update: movitz/losp/x86-pc/vga.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Fri Apr 16 19:17:55 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/x86-pc
In directory common-lisp.net:/tmp/cvs-serv13495

Modified Files:
	vga.lisp 
Log Message:
Added some VGA register accessors.

Date: Fri Apr 16 15:17:55 2004
Author: ffjeld

Index: movitz/losp/x86-pc/vga.lisp
diff -u movitz/losp/x86-pc/vga.lisp:1.3 movitz/losp/x86-pc/vga.lisp:1.4
--- movitz/losp/x86-pc/vga.lisp:1.3	Mon Jan 19 06:23:52 2004
+++ movitz/losp/x86-pc/vga.lisp	Fri Apr 16 15:17:55 2004
@@ -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.3 2004/01/19 11:23:52 ffjeld Exp $
+;;;; $Id: vga.lisp,v 1.4 2004/04/16 19:17:55 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -19,18 +19,18 @@
 
 (in-package muerte.x86-pc)
 
-(defun (setf vga-crt-controller-register) (value register)
-  (let* ((address-register (if (logbitp 0 (io-port #x3cc :unsigned-byte8)) #x3d4 #x3b4))
-	 (data-register (1+ address-register)))
-    (setf (io-port address-register :unsigned-byte8) register
-	  (io-port data-register :unsigned-byte8) value)))
-
 (defun vga-crt-controller-register (register)
   (let* ((address-register (if (logbitp 0 (io-port #x3cc :unsigned-byte8)) #x3d4 #x3b4))
 	 (data-register (1+ address-register)))
     (setf (io-port address-register :unsigned-byte8) register)
     (io-port data-register :unsigned-byte8)))
 
+(defun (setf vga-crt-controller-register) (value register)
+  (let* ((address-register (if (logbitp 0 (io-port #x3cc :unsigned-byte8)) #x3d4 #x3b4))
+	 (data-register (1+ address-register)))
+    (setf (io-port address-register :unsigned-byte8) register
+	  (io-port data-register :unsigned-byte8) value)))
+
 (defun vga-graphics-register (register)
   (setf (io-port #x3ce :unsigned-byte8) register)
   (io-port #x3cf :unsigned-byte8))
@@ -60,3 +60,17 @@
     (#b01 (values #xa0000 #xaffff))
     (#b10 (values #xb0000 #xb7fff))
     (#b11 (values #xb8000 #xbffff))))
+
+(defun vga-horizontal-display-end ()
+  (1+ (vga-crt-controller-register 1)))
+
+(defun vga-vertical-display-end ()
+  (let ((overflow (vga-crt-controller-register 7)))
+    (+ 1
+       (vga-crt-controller-register #x12)
+       (if (logbitp 1 overflow) #x100 0)
+       (if (logbitp 6 overflow) #x200 0))))
+
+(defun vga-character-height ()
+  (1+ (ldb (byte 5 0)
+	   (vga-crt-controller-register 9))))





More information about the Movitz-cvs mailing list