Added ANSI parsers and rendering ANSI frames

This commit is contained in:
Deon George
2018-12-14 00:02:42 +11:00
parent e0306908bd
commit 6cc793c47f
14 changed files with 333 additions and 119 deletions

View File

@@ -48,6 +48,22 @@ class Videotex extends AbstractServer {
parent::__construct($o);
}
public function outputPosition($x,$y) {
// Take the shortest path.
if ($y < 12) {
return HOME.
(($x < 21)
? str_repeat(DOWN,$y).str_repeat(RIGHT,$x)
: str_repeat(DOWN,$y+1).str_repeat(LEFT,40-$x));
} else {
return HOME.str_repeat(UP,24-$y).
(($x < 21)
? str_repeat(RIGHT,$x)
: str_repeat(LEFT,40-$x));
}
}
public function sendBaseline($client,$text,$reposition=FALSE) {
$client->send(HOME.UP.$text.
($this->blp > $this->strlenv($text)