[OpenBIOS] [PATCH 02/16] display.fs: Fix fb8-delete-lines within the inbuilt Forth terminal emulator.

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Mar 10 17:50:32 CET 2013


This enables us to provide a basic scrolling console terminal.

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

diff --git a/openbios-devel/forth/device/display.fs b/openbios-devel/forth/device/display.fs
index d85ac85..bbd2b13 100644
--- a/openbios-devel/forth/device/display.fs
+++ b/openbios-devel/forth/device/display.fs
@@ -226,12 +226,12 @@ defer fb-emit ( x -- )
   dup #columns = if
     drop 0 to column#
     line# 1+ 
-    dup #lines = if
-      drop 
-      \ FIXME move up screen (and keep position)
-    else
-      to #lines 
+    dup #lines >= if
+      line#
+      0 to line#
+      1 delete-lines
     then
+    to line#
   else
     to column#
   then
@@ -295,12 +295,12 @@ defer fb-emit ( x -- )
   
 : fb8-delete-lines ( n -- )
   \ numcopy = ( #lines - ( line# + n )) * char-height
-  #lines over #line + - char-height *
+  #lines over line# + - char-height *
 
   ( numcopy ) 0 ?do
     dup line# + char-height * i +
     line# char-height * i +
-    swap fb8-copy-line
+    fb8-copy-line
   loop
 
   #lines over - char-height *
-- 
1.7.10.4




More information about the OpenBIOS mailing list