… | |
… | |
66 | SET UP Home |
66 | SET UP Home |
67 | BACKSPACE Rubout |
67 | BACKSPACE Rubout |
68 | CAPS LOCK Prior/PgUp |
68 | CAPS LOCK Prior/PgUp |
69 | NO SCROLL Next/PgDown |
69 | NO SCROLL Next/PgDown |
70 | BREAK End |
70 | BREAK End |
|
|
71 | CTRL-C Insert |
71 | |
72 | |
72 | Set-Up Guide: |
73 | Set-Up Guide: |
73 | |
74 | |
74 | http://vt100.net/docs/vt102-ug/chapter3.html#S3.6 |
75 | http://vt100.net/docs/vt102-ug/chapter3.html#S3.6 |
75 | |
76 | |
… | |
… | |
547 | |
548 | |
548 | $scr .= "\e[?5" . ($DC11_REVERSE ? "h" : "l"); |
549 | $scr .= "\e[?5" . ($DC11_REVERSE ? "h" : "l"); |
549 | |
550 | |
550 | line: |
551 | line: |
551 | for my $y (0 .. 25) { # ntsc, two vblank delay lines, up to 24 text lines |
552 | for my $y (0 .. 25) { # ntsc, two vblank delay lines, up to 24 text lines |
552 | my $prev_sgr; |
553 | my $prev_attr; |
|
|
554 | my ($c, $attr); # declare here for speedup |
553 | |
555 | |
554 | $scr .= sprintf "%2d \xe2\x94\x82", $y; |
556 | $scr .= sprintf "%2d \xe2\x94\x82", $y; |
555 | |
557 | |
556 | for (0..139) { |
558 | for (0..139) { |
557 | my $c = $M[$i]; |
559 | $c = $M[$i]; |
558 | |
560 | |
559 | if ($c == 0x7f) { # also 0xff, but the firmware avoids that |
561 | if ($c == 0x7f) { # also 0xff, but the firmware avoids that |
560 | $scr .= "\e[m\xe2\x94\x82\e[K\n"; |
562 | $scr .= "\e[m\xe2\x94\x82\e[K\n"; |
561 | |
563 | |
562 | my $a1 = $M[$i + 1]; |
564 | my $a1 = $M[$i + 1]; |
… | |
… | |
565 | $i = 0x2000 + (($a1 * 256 + $a0) & 0xfff); |
567 | $i = 0x2000 + (($a1 * 256 + $a0) & 0xfff); |
566 | |
568 | |
567 | next line; |
569 | next line; |
568 | } |
570 | } |
569 | |
571 | |
|
|
572 | $scr .= $SGR[$prev_attr = $attr] |
570 | my $sgr = $SGR[ ($M[$i++ + 0x1000] & 15) | ($c & 0x80)]; |
573 | if $prev_attr != ($attr = ($M[$i++ + 0x1000] & 15) | ($c & 0x80)); |
571 | |
|
|
572 | $scr .= $prev_sgr = $sgr if $sgr ne $prev_sgr; |
|
|
573 | |
574 | |
574 | $scr .= $CHARMAP[$c & 0x7f]; |
575 | $scr .= $CHARMAP[$c & 0x7f]; |
575 | } |
576 | } |
576 | |
577 | |
577 | $scr .= "\e[K\nvideo overflow\e[K\n"; |
578 | $scr .= "\e[K\nvideo overflow\e[K\n"; |
… | |
… | |
598 | "\x1e" => 0x24 | 0x100, # CTRL-~ |
599 | "\x1e" => 0x24 | 0x100, # CTRL-~ |
599 | "\x1f" => 0x75 | 0x100, # CTRL-? |
600 | "\x1f" => 0x75 | 0x100, # CTRL-? |
600 | |
601 | |
601 | # hardcoded rxvt keys |
602 | # hardcoded rxvt keys |
602 | "\e" => 0x2a, # ESC |
603 | "\e" => 0x2a, # ESC |
|
|
604 | "\e[2~" => 0x79 | 0x100, # CTRL-C (insert) |
603 | "\e[3~" => 0x03, # DC |
605 | "\e[3~" => 0x03, # DC |
604 | "\e[5~" => 0x7e, # CAPS LOCK (prior) |
606 | "\e[5~" => 0x7e, # CAPS LOCK (prior) |
605 | "\e[6~" => 0x6a, # NO SCROLL (next) |
607 | "\e[6~" => 0x6a, # NO SCROLL (next) |
606 | "\e[A" => 0x30, # UP |
608 | "\e[A" => 0x30, # UP |
607 | "\e[B" => 0x22, # DOWN |
609 | "\e[B" => 0x22, # DOWN |
… | |
… | |
783 | |
785 | |
784 | # pty/serial I/O |
786 | # pty/serial I/O |
785 | if ($PTY && (vec $x, fileno $PTY, 1) && (@PUSARTRECV < 128) && !@KQUEUE) { |
787 | if ($PTY && (vec $x, fileno $PTY, 1) && (@PUSARTRECV < 128) && !@KQUEUE) { |
786 | sysread $PTY, my $buf, 256; |
788 | sysread $PTY, my $buf, 256; |
787 | |
789 | |
788 | # linux don't do cs7 and/or parity anymore, so we need to filter # out xoff characters to avoid freezes. |
790 | # linux don't do cs7 and/or parity anymore, so we need to filter |
|
|
791 | # out xoff characters to avoid freezes. |
789 | push @PUSARTRECV, grep { ($_ & 0x7f) != 0x13 } unpack "C*", $buf; |
792 | push @PUSARTRECV, grep { ($_ & 0x7f) != 0x13 } unpack "C*", $buf; |
790 | } |
793 | } |
791 | |
794 | |
792 | # keyboard input |
795 | # keyboard input |
793 | if ($KBD && (vec $x, 0, 1)) { |
796 | if ($KBD && (vec $x, 0, 1)) { |