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@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)