Added ANSI parsers and rendering ANSI frames
This commit is contained in:
@@ -19,26 +19,32 @@ class Videotex extends AbstractFrame
|
||||
|
||||
public static $if_filler = '.';
|
||||
|
||||
public function fields($startline=0)
|
||||
public function __construct(\App\Models\Frame $o,string $msg='')
|
||||
{
|
||||
parent::__construct($o);
|
||||
|
||||
// If we have a message to display on the bottom line.
|
||||
if ($msg)
|
||||
$this->output .= HOME.UP.$msg.HOME;
|
||||
}
|
||||
|
||||
public function fields($startline=1)
|
||||
{
|
||||
$infield = FALSE; // In a field
|
||||
$fieldtype = NULL; // Type of field
|
||||
$fieldlength = 0; // Length of field
|
||||
|
||||
if ($startline)
|
||||
$this->output .= str_repeat(DOWN,$startline);
|
||||
|
||||
// $fieldadrline = 1;
|
||||
|
||||
// Scan the frame for a field start
|
||||
for ($y=$startline;$y<=static::$frame_length;$y++)
|
||||
for ($y=$startline-1;$y<=static::$frame_length;$y++)
|
||||
{
|
||||
// Fields can only be on a single line
|
||||
$fieldx = $fieldy = FALSE;
|
||||
|
||||
for ($x=0;$x<static::$frame_width;$x++)
|
||||
{
|
||||
$posn = $y*40+$x;
|
||||
$posn = $y*static::$frame_width+$x;
|
||||
|
||||
// If the frame is not big enough, fill it with spaces.
|
||||
$byte = ord(isset($this->frame->content{$posn}) ? $this->frame->content{$posn} : ' ')%128;
|
||||
@@ -62,7 +68,6 @@ class Videotex extends AbstractFrame
|
||||
}
|
||||
|
||||
// Is this a magic field?
|
||||
// @todo For page redisplay *00, we should show entered contents - for refresh *09 we should show updated contents
|
||||
if (array_get($this->fieldmap,chr($fieldtype)) ) {
|
||||
$field = $this->fieldmap[chr($fieldtype)];
|
||||
//dump(['infield','byte'=>$byte,'fieldtype'=>$fieldtype,'field'=>$field,'strpos'=>strpos($field,'#')]);
|
||||
|
Reference in New Issue
Block a user