[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbios
Subject:    [OpenBIOS] [PATCH 15/16] display.fs: Add vertical font-spacing as per the existing C console impleme
From:       Mark Cave-Ayland <mark.cave-ayland () ilande ! co ! uk>
Date:       2013-03-10 16:50:45
Message-ID: 1362934246-14027-16-git-send-email-mark.cave-ayland () ilande ! co ! uk
[Download RAW message or body]

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

diff --git a/openbios-devel/forth/device/display.fs b/openbios-devel/forth/device/display.fs
index a0a182c..3b6e3fa 100644
--- a/openbios-devel/forth/device/display.fs
+++ b/openbios-devel/forth/device/display.fs
@@ -44,6 +44,7 @@ hex
 0 value foreground-color
 0 value background-color
 
+2 value font-spacing
 0 value depth-bytes
 
 \ internal values read from QEMU firmware interface
@@ -81,7 +82,7 @@ defer fb-emit ( x -- )
   to char-num
   to char-min
   to fontbytes
-  to char-height
+  font-spacing + to char-height
   to char-width
   to font
   ;
@@ -191,12 +192,17 @@ defer fb8-invertrect
 ;
   
 : fb8-draw-character ( char -- )
+  \ erase the current character
+  background-color
+  column# char-width * window-left +
+  line# char-height * window-top +
+  char-width char-height fb8-fillrect
   \ draw the character:
   >font  
   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
+  swap char-width char-height font-spacing -
   \ normal or inverse?
   foreground-color background-color
   inverse? if
@@ -233,7 +239,7 @@ defer fb8-invertrect
 : fb8-toggle-cursor ( -- )
   column# char-width * window-left +
   line# char-height * window-top +
-  char-width char-height
+  char-width char-height font-spacing -
   foreground-color background-color
   fb8-invertrect
   ;
-- 
1.7.10.4


-- 
OpenBIOS                 http://openbios.org/
Mailinglist:  http://lists.openbios.org/mailman/listinfo
Free your System - May the Forth be with you
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic