= 0 AND $num <= 8) { $i = $num; $f = 39; $b = 49; } elseif ($num >= 30 AND $num <= 39) $f = $num; elseif ($num >= 40 AND $num <= 49) $b = $num; } break; // Advance characters case 'C': $x += $matches[1]; // Advance our position break; default: dump('Unhandled CSI: '.$matches[2]); } break; case ' ': dump(['l'=>__LINE__,'LOOSE ESC?']); break; default: // Allow for the original ESC $c--; $advance++; $fieldtype = ord($nextbyte); $fieldlength = $this->findEOF(chr($fieldtype),$c+2,$content)+1; $byte = ''; $this->fields->push(new FrameFields([ 'type'=>chr($fieldtype), 'length'=>$fieldlength, 'x'=>$x, // Adjust for the ESC char 'y'=>$y, ])); Log::debug(sprintf('Field found at [%s,%s], Type: %s, Length: %s',$x-1,$y,$fieldtype,$fieldlength)); $advance += $fieldlength-2; $x += $fieldlength; $chars = $this->fields->last()->output(AnsiFrame::$if_filler); } break; default: $this->frame_data[$y][$x] = ['i'=>$i,'f'=>$f,'b'=>$b]; $this->frame_content[$y][$x] = $byte; $x++; } $output .= $byte; if ($advance) { $output .= $chars; $c += $advance; } if ($x > $width) { $x = 1; $y++; } } return $output; } }