… | |
… | |
23 | my $VT102 = 1; |
23 | my $VT102 = 1; |
24 | my $VT131 = 0; |
24 | my $VT131 = 0; |
25 | my $AVO = 1; |
25 | my $AVO = 1; |
26 | my $KBD = 1; |
26 | my $KBD = 1; |
27 | |
27 | |
28 | if ($ARGV[0] =~ /^-?-vt100$/) { |
28 | shift, ($VT102 = 0), ($AVO = 0) if $ARGV[0] =~ /^-?-vt100$/; |
29 | shift; $VT102 = 0; $AVO = 0; |
29 | shift, ($VT102 = 0) if $ARGV[0] =~ /^-?-vt100\+avo$/; |
30 | } |
30 | shift if $ARGV[0] =~ /^-?-vt102$/; |
31 | |
31 | shift, ($VT131 = 1) if $ARGV[0] =~ /^-?-vt131$/; |
32 | if ($ARGV[0] =~ /^-?-vt100\+avo$/) { |
|
|
33 | shift; $VT102 = 0; $AVO = 1; |
|
|
34 | } |
|
|
35 | |
|
|
36 | if ($ARGV[0] =~ /^-?-vt102$/) { |
|
|
37 | shift; # default |
|
|
38 | } |
|
|
39 | |
|
|
40 | if ($ARGV[0] =~ /^-?-vt131$/) { |
|
|
41 | shift; $VT131 = 1; |
|
|
42 | } |
|
|
43 | |
32 | |
44 | if ($ARGV[0] =~ /^-/) { |
33 | if ($ARGV[0] =~ /^-/) { |
45 | die <<EOF; |
34 | die <<EOF; |
46 | |
35 | |
47 | VT102, A VT100/101/102/131 SIMULATOR |
36 | VT102, A VT100/101/102/131 SIMULATOR |
… | |
… | |
91 | local $/; |
80 | local $/; |
92 | <DATA> |
81 | <DATA> |
93 | }; |
82 | }; |
94 | |
83 | |
95 | 0x6801 == length $ROMS or die "corrupted rom image"; |
84 | 0x6801 == length $ROMS or die "corrupted rom image"; |
96 | |
|
|
97 | binmode STDOUT; |
|
|
98 | |
85 | |
99 | my @M = (0xff) x 65536; # main memory, = (0xff) x 65536; |
86 | my @M = (0xff) x 65536; # main memory, = (0xff) x 65536; |
100 | |
87 | |
101 | # populate mem with rom contents |
88 | # populate mem with rom contents |
102 | if ($VT102) { |
89 | if ($VT102) { |
… | |
… | |
498 | $M[$PC], $op[$M[$PC]]; |
485 | $M[$PC], $op[$M[$PC]]; |
499 | } |
486 | } |
500 | |
487 | |
501 | ############################################################################# |
488 | ############################################################################# |
502 | # video emulation |
489 | # video emulation |
|
|
490 | |
|
|
491 | binmode STDOUT; |
503 | |
492 | |
504 | my @CHARMAP = ( |
493 | my @CHARMAP = ( |
505 | " " , "\x{29eb}", "\x{2592}", "\x{2409}", |
494 | " " , "\x{29eb}", "\x{2592}", "\x{2409}", |
506 | "\x{240c}", "\x{240d}", "\x{240a}", "\x{00b0}", |
495 | "\x{240c}", "\x{240d}", "\x{240a}", "\x{00b0}", |
507 | "\x{00b1}", "\x{2424}", "\x{240b}", "\x{2518}", |
496 | "\x{00b1}", "\x{2424}", "\x{240b}", "\x{2518}", |