[OpenBIOS] [PATCHv2 17/20] terminal.fs: Fix CSI n; mH and CSI n; mf control sequences.

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


Fix an off-by-one error in the lines/columns calculations and also ensure that
we correctly interpret control sequences when not all of the optional
parameters are present.

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

diff --git a/openbios-devel/forth/device/terminal.fs b/openbios-devel/forth/device/terminal.fs
index e41e973..54e2745 100644
--- a/openbios-devel/forth/device/terminal.fs
+++ b/openbios-devel/forth/device/terminal.fs
@@ -97,17 +97,39 @@
     endof
     ascii f of
       2 (esc-number) 
-      2 = if
-        #columns 1- min to column#
-        #lines 1- min to line#
-      then
+      case 
+        2 of
+          1- #columns 1- min to column#
+          1- #lines 1- min to line#
+        endof
+        1 of
+          0 to column#
+          1- #lines 1- min to line#
+        endof
+        0 of
+          0 to column#
+          0 to line#
+          drop
+        endof
+      endcase
     endof
     ascii H of
-      2 (esc-number) 
-      2 = if
-        #columns 1- min to column#
-        #lines 1- min to line#
-      then
+      2 (esc-number)
+      case 
+        2 of
+          1- #columns 1- min to column#
+          1- #lines 1- min to line#
+        endof
+        1 of
+          0 to column#
+          1- #lines 1- min to line#
+        endof
+        0 of
+          0 to column#
+          0 to line#
+          drop
+        endof
+      endcase
     endof
     ascii J of
       0 to (escseq)
-- 
1.7.10.4




More information about the OpenBIOS mailing list