[OpenBIOS] [commit] r1155 - trunk/openbios-devel/forth/device

repository service svn at openbios.org
Sun Jun 9 14:25:44 CEST 2013


Author: mcayland
Date: Sun Jun  9 14:25:43 2013
New Revision: 1155
URL: http://tracker.coreboot.org/trac/openbios/changeset/1155

Log:
display.fs: add implementation of fb8-insert-characters and fb8-delete-characters.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/forth/device/display.fs

Modified: trunk/openbios-devel/forth/device/display.fs
==============================================================================
--- trunk/openbios-devel/forth/device/display.fs	Sun Jun  9 14:25:39 2013	(r1154)
+++ trunk/openbios-devel/forth/device/display.fs	Sun Jun  9 14:25:43 2013	(r1155)
@@ -175,7 +175,12 @@
   frame-buffer-adr + 
   window-left depth-bytes * +
 ;
-  
+
+: fb8-curpos2addr ( col line -- addr )
+  char-height * fb8-line2addr
+  swap char-width * depth-bytes * +
+;
+
 : fb8-copy-lines ( count from to -- )
   fb8-line2addr swap
   fb8-line2addr swap
@@ -253,9 +258,41 @@
   ;
   
 : fb8-insert-characters ( n -- )
-  ;
+  \ numcopy = ( #columns - column# - n )
+  #columns over - column# -
+  char-width * depth-bytes * ( n numbytescopy )
+
+  over column# + line# fb8-curpos2addr
+  column# line# fb8-curpos2addr ( n numbytescopy destaddr srcaddr )
+  char-height 0 do
+    3dup swap rot move
+    line-bytes + swap line-bytes + swap
+  loop 3drop
   
+  background-color
+  column# char-width * window-left + line# char-height * window-top +
+  3 pick char-width * char-height
+  fb8-fillrect
+  drop
+  ;
+
 : fb8-delete-characters ( n -- )
+  \ numcopy = ( #columns - column# - n )
+  #columns over - column# -
+  char-width * depth-bytes * ( n numbytescopy )
+
+  over column# + line# fb8-curpos2addr
+  column# line# fb8-curpos2addr swap ( n numbytescopy destaddr srcaddr )
+  char-height 0 do
+    3dup swap rot move
+    line-bytes + swap line-bytes + swap
+  loop 3drop
+
+  background-color
+  over #columns swap - char-width * window-left + line# char-height * window-top +
+  3 pick char-width * char-height
+  fb8-fillrect
+  drop
   ;
 
 : fb8-insert-lines ( n -- )



More information about the OpenBIOS mailing list