From 44e308f030351e8102dd73d2a9e7766dd801d951 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Fri, 29 May 2020 20:57:57 -0700 Subject: [PATCH] GR adjusts text window. Fixes #33 GR now adjusts the text window to the bottom four lines of the display. A unit test is added to verify. --- basic.js | 7 +++++++ samples/sample.unittests.txt | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/basic.js b/basic.js index e2162bd..e73bea7 100644 --- a/basic.js +++ b/basic.js @@ -849,6 +849,13 @@ this.basic = (function() { env.display.setState("lores", true, "full", false, "graphics", true); env.lores.clear(); + if (env.tty.textWindow) { + env.tty.textWindow.left = 0; + env.tty.textWindow.width = env.tty.getScreenSize().width; + env.tty.textWindow.top = env.tty.getScreenSize().height - 4; + env.tty.textWindow.height = 4; + } + env.tty.setCursorPosition(0, env.tty.getScreenSize().height); }, diff --git a/samples/sample.unittests.txt b/samples/sample.unittests.txt index 2ee73a6..50bb95f 100644 --- a/samples/sample.unittests.txt +++ b/samples/sample.unittests.txt @@ -402,9 +402,10 @@ 7000 PRINT : PRINT "Lo-Res Graphics "; 7001 IF NOT LR THEN PRINT "" : GOTO 8000 -7010 REM ************************************************************ -7010 REM Test GR as part of I/O (sets cursor to window bottom) -7010 REM ************************************************************ +7010 T$ = "GR" +: U = PEEK(36) : V = PEEK(37) +: GR : S = (PEEK(37) = 23) : TEXT : POKE 36,U : POKE 37,V : GOSUB 1 +: GR : S = (PEEK(34) = 20) : TEXT : POKE 36,U : POKE 37,V : GOSUB 1 7011 POKE 49232,0 : POKE 49234,0 : POKE 49238,0