[OpenBIOS] [PATCHv2 12/20] display.fs: Fix fb8 routines to work with bit depths > 8.

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun May 26 15:02:32 CEST 2013


The IEEE1275 specification suggests that the fb8-* routines can be coerced
into working for framebuffers with greater bit depths. Make sure that we
also support this.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/forth/device/display.fs |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/openbios-devel/forth/device/display.fs b/openbios-devel/forth/device/display.fs
index 969e13a..d6fcb02 100644
--- a/openbios-devel/forth/device/display.fs
+++ b/openbios-devel/forth/device/display.fs
@@ -169,20 +169,20 @@ defer fb8-invertrect
 
 : fb8-line2addr ( line -- addr )
   window-top +
-  screen-width * 
+  screen-width * depth-bytes *
   frame-buffer-adr + 
-  window-left +
+  window-left depth-bytes * +
 ;
   
 : fb8-copy-line ( from to -- )
   fb8-line2addr swap 
   fb8-line2addr swap 
-  #columns char-width * move
+  #columns char-width * depth-bytes * move
 ;
 
 : fb8-clear-line ( line -- )
   fb8-line2addr 
-  #columns char-width * 
+  #columns char-width * depth-bytes *
   background-color fill
 \ 0 fill
 ;
@@ -190,8 +190,9 @@ defer fb8-invertrect
 : fb8-draw-character ( char -- )
   \ draw the character:
   >font  
-  line# char-height * window-top + screen-width *
-  column# char-width * window-left + + frame-buffer-adr +
+  line# char-height * window-top + screen-width * depth-bytes *
+  column# char-width * depth-bytes *
+  window-left depth-bytes * + + frame-buffer-adr +
   swap char-width char-height
   \ normal or inverse?
   foreground-color background-color
-- 
1.7.10.4




More information about the OpenBIOS mailing list