ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/vt102/vt102
(Generate patch)

Comparing vt102/vt102 (file contents):
Revision 1.3 by root, Mon Dec 1 18:26:20 2014 UTC vs.
Revision 1.4 by root, Mon Dec 1 18:31:02 2014 UTC

727 eval "use integer; sub { $insn }" or die "$insn: $@" 727 eval "use integer; sub { $insn }" or die "$insn: $@"
728 })->(); 728 })->();
729 729
730 ++$CLK; 730 ++$CLK;
731 731
732 #TODO: just check on ret instructions or so 732 # things we do from time too time only
733 unless ($CLK & 0xf) {
734 # do I/O
735
736 unless ($CLK & 0x7ff) {
737
738 # pty/serial I/O
739 unless (@PUSARTRECV || @KQUEUE || !$PTY) {
740 my $rin = ""; (vec $rin, fileno $PTY, 1) = 1;
741
742 if (select $rin, undef, undef, 0) {
743 sysread $PTY, my $buf, 256;
744 push @PUSARTRECV, unpack "C*", $buf;
745 }
746 }
747
748 # keyboard input
749 if ($KBD) {
750 while (select my $rin = "\x01", undef, undef, 0) {
751 sysread STDIN, $STDIN_BUF, 1, length $STDIN_BUF
752 or last;
753 }
754
755 stdin_parse if length $STDIN_BUF;
756 }
757 }
758
759 # kick off various interrupts
760
761 $RST |= 2 if @PUSARTRECV && $XON; # VT100, but works on vt102, too (probably not used on real hardware though)
762 #$INTPEND |= 2 if @PUSARTRECV && $XON; # VT102, 6.5 rxrdy
763
764 # kick off vertical retrace form time to time
765 unless ($CLK & 0x3ff) {
766 $RST |= 4; # vertical retrace
767 }
768
769 # handle video hardware
770
771 unless ($CLK & 0x1fff) {
772 prscr;
773 }
774 }
775
733 # the interrupt logic 776 # the interrupt logic
734 $x = $INTPEND & ~$INTMASK; 777 $x = $INTPEND & ~$INTMASK;
735
736 if (($RST || $x) && $IFF) { 778 if (($RST || $x) && $IFF) {
737 # rst 1 kbd data available 779 # rst 1 kbd data available
738 # rst 2 pusart xmit+recv flag 780 # rst 2 pusart xmit+recv flag
739 # rst 4 vertical retrace 781 # rst 4 vertical retrace
740 # 5.5 vt125 mb7 trans ready (serial send?) 782 # 5.5 vt125 mb7 trans ready (serial send?)
757 $M[--$SP] = $PC >> 8; 799 $M[--$SP] = $PC >> 8;
758 $M[--$SP] = $PC & 0xff; 800 $M[--$SP] = $PC & 0xff;
759 $PC = $vec; 801 $PC = $vec;
760 802
761 $IFF = 0; 803 $IFF = 0;
762 }
763
764 # things we do from time too time only
765 unless ($CLK & 0xf) {
766 # do I/O
767
768 unless ($CLK & 0x7ff) {
769
770 # pty/serial I/O
771 unless (@PUSARTRECV || @KQUEUE || !$PTY) {
772 my $rin = ""; (vec $rin, fileno $PTY, 1) = 1;
773
774 if (select $rin, undef, undef, 0) {
775 sysread $PTY, my $buf, 256;
776 push @PUSARTRECV, unpack "C*", $buf;
777 }
778 }
779
780 # keyboard input
781 if ($KBD) {
782 while (select my $rin = "\x01", undef, undef, 0) {
783 sysread STDIN, $STDIN_BUF, 1, length $STDIN_BUF
784 or last;
785 }
786
787 stdin_parse if length $STDIN_BUF;
788 }
789 }
790
791 # kick off various interrupts
792
793 $RST |= 2 if @PUSARTRECV && $XON; # VT100, but works on vt102, too (probably not used on real hardware though)
794 #$INTPEND |= 2 if @PUSARTRECV && $XON; # VT102, 6.5 rxrdy
795
796 # kick off vertical retrace form time to time
797 unless ($CLK & 0x3ff) {
798 $RST |= 4; # vertical retrace
799 }
800
801 # handle video hardware
802
803 unless ($CLK & 0x1fff) {
804 prscr;
805 }
806 } 804 }
807} 805}
808 806
809__DATA__ 807__DATA__
8101N ;0>b/BWog<Gӂ,O$ O[xI,ڥ#€€yOtͤ[zW>/2!b>>g$>% !h w-!h >-4!j pO:{ y:! u:x!_yA[>y >yA[>?y@ :x!žyA[P>>O[>>[Î:!ʵyA>>OlyAPÇ!:!S!h ~ ~ : O͓: Ô!20!2!!!yAG~"&=w< w:!/!!A:!Ey2!~1N ! ~eBi<2!͢:P =2S!~6ʘ!!6 8081N ;0>b/BWog<Gӂ,O$ O[xI,ڥ#€€yOtͤ[zW>/2!b>>g$>% !h w-!h >-4!j pO:{ y:! u:x!_yA[>y >yA[>?y@ :x!žyA[P>>O[>>[Î:!ʵyA>>OlyAPÇ!:!S!h ~ ~ : O͓: Ô!20!2!!!yAG~"&=w< w:!/!!A:!Ey2!~1N ! ~eBi<2!͢:P =2S!~6ʘ!!6

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines