anchor.diff:  (defconstant +vbe-dispi-ioport-index+          #x01CE)
   (defconstant +vbe-dispi-ioport-data+           #x01CF)
   
  -(defconstant +vbe-dispi-index-id+              0)
  -(defconstant +vbe-dispi-index-xres+            1)
  -(defconstant +vbe-dispi-index-yres+            2)
  -(defconstant +vbe-dispi-index-bpp+             3)
  -(defconstant +vbe-dispi-index-enable+          4)
  -(defconstant +vbe-dispi-index-bank+            5)
  -(defconstant +vbe-dispi-index-virt-width+      6)
  -(defconstant +vbe-dispi-index-virt-height+     7)
  -(defconstant +vbe-dispi-index-x-offset+        8)
  -(defconstant +vbe-dispi-index-y-offset+        9)
  -(defconstant +vbe-dispi-index-video-memory+    10)
  +(defconstant +vbe-dispi-index-id+              0) ; id0
  +(defconstant +vbe-dispi-index-xres+            1) ; id0
  +(defconstant +vbe-dispi-index-yres+            2) ; id0
  +(defconstant +vbe-dispi-index-bpp+             3) ; id0
  +(defconstant +vbe-dispi-index-enable+          4) ; id0
  +(defconstant +vbe-dispi-index-bank+            5) ; id0
  +(defconstant +vbe-dispi-index-virt-width+      6) ; id1
  +(defconstant +vbe-dispi-index-virt-height+     7) ; id1
  +(defconstant +vbe-dispi-index-x-offset+        8) ; id1
  +(defconstant +vbe-dispi-index-y-offset+        9) ; id1
  +(defconstant +vbe-dispi-index-video-memory+    10) ; id5
   
   (defconstant +vbe-dispi-id0+                   #xB0C0)
   (defconstant +vbe-dispi-id1+                   #xB0C1)
  
positive.code:   (write-vbe-reg +vbe-dispi-index-xres+ xres)
    (write-vbe-reg +vbe-dispi-index-yres+ yres)
    (write-vbe-reg +vbe-dispi-index-bpp+ bpp)
    (write-vbe-reg +vbe-dispi-index-enable+ (logior +vbe-dispi-enabled+ +vbe-dispi-lfb-enabled+)))
  
  (defun pci-get-lfb-addr (vendor-id device-id)
    (dolist (dev *pci-devices*)
  
negative.code:     (dotimes (i 8)
        (setf (aref *bochs-framebuffer* 0 i) (ldb (byte 24 0) (lognot (aref *bochs-framebuffer* 0 i)))))))
  
  (defun bochs-vbe-early-initialize ()
    (setf *bochs-framebuffer* nil
          *bochs-vbe-version* nil))
  (add-hook '*early-initialize-hook* 'bochs-vbe-early-initialize)
  
  (defun bochs-change-res (width height)
    (when (null *bochs-vbe-version*)
      (error "Bochs VBE device not present."))
    (when (or (> width *bochs-max-x-res*)
              (> height *bochs-max-y-res*))
      (error "Requested size ~Dx~D exceeds maximum ~Dx~D~%"
             width height
             *bochs-max-x-res* *bochs-max-y-res*))
    (when (> (* width height 4 2) *bochs-vram-size*)
      (error "Requested size ~Dx~D does not fit in video memory. Wanted ~DMB, ~DMB available."
             (/ (* width height 4 2) 1024 1024)
             (/ *bochs-vram-size* 1024 1024)))
    (set-bochs-vbe-mode width height 32)
    (setf *bochs-framebuffer* (make-array (list height width)
                                          :element-type '(unsigned-byte 32)
                                          :memory (+ #x8000000000 *bochs-vbe-framebuffer-address*))
          *bochs-back-buffer* (make-array (list height width)
                                          :element-type '(unsigned-byte 32)
                                          :memory (+ #x8000000000 *bochs-vbe-framebuffer-address* (* width height 4)))
          *bochs-flip-mode* nil)
    (setf *terminal-io* (make-instance 'framebuffer-stream
                                            :framebuffer *bochs-framebuffer*)))
  
  (defun bochs-flip-buffer ()
    (rotatef *bochs-framebuffer* *bochs-back-buffer*)
    (setf *bochs-flip-mode* (not *bochs-flip-mode*))
    (write-vbe-reg +vbe-dispi-index-y-offset+
                   (if *bochs-flip-mode*
                       (array-dimension *bochs-framebuffer* 0)
                       0))
    (write-vbe-reg +vbe-dispi-index-virt-width+ (array-dimension *bochs-framebuffer* 1)))
  
  (defun bochs-vbe-initialize ()
    (when (probe-bochs-vbe)
      (bochs-change-res 1024 768)
      #+nil(sys.graphics:register-screen "Bochs" *bochs-framebuffer*)))
  (add-hook '*initialize-hook* 'bochs-vbe-initialize)
  