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

Comparing vt102/vt102 (file contents):
Revision 1.23 by root, Wed Dec 3 11:09:51 2014 UTC vs.
Revision 1.25 by root, Thu Dec 4 04:36:11 2014 UTC

109# 8080/8085 registers 109# 8080/8085 registers
110my ($A, $B, $C, $D, $E, $H, $L); # 8 bit general purpose 110my ($A, $B, $C, $D, $E, $H, $L); # 8 bit general purpose
111my ($PC, $SP, $IFF); # program counter, stack pointer, interrupt flag 111my ($PC, $SP, $IFF); # program counter, stack pointer, interrupt flag
112my ($FA, $FZ, $FS, $FP, $FC); # condition codes (psw) 112my ($FA, $FZ, $FS, $FP, $FC); # condition codes (psw)
113 113
114my $RST = 0; # pending interrupts (8259 interrupt controller) 114my $RST = 0; # pending interrupts (external interrupt logic)
115my $INTMASK = 7; # 8085 half interrupt mask 115my $INTMASK = 7; # 8085 half interrupt mask
116my $INTPEND = 0; # 8085 half interrupts pending 116my $INTPEND = 0; # 8085 half interrupts pending
117 117
118my $CLK; # rather inexact clock, counts extended basic blocks 118my $CLK; # rather inexact clock, counts extended basic blocks
119 119
765 unless ($CLK & 0xf) { 765 unless ($CLK & 0xf) {
766 # do I/O 766 # do I/O
767 767
768 unless ($CLK & 0xfff) { 768 unless ($CLK & 0xfff) {
769 if (select $x = $RIN, undef, undef, $POWERSAVE < 100 ? 0 : 0.2) { 769 if (select $x = $RIN, undef, undef, $POWERSAVE < 100 ? 0 : 0.2) {
770
770 # pty/serial I/O 771 # pty/serial I/O
771 if ($PTY && (vec $x, fileno $PTY, 1) && (@PUSARTRECV < 128) && !@KQUEUE) { 772 if ($PTY && (vec $x, fileno $PTY, 1) && (@PUSARTRECV < 128) && !@KQUEUE) {
772 sysread $PTY, my $buf, 256; 773 sysread $PTY, my $buf, 256;
773 774
774 # linux don't do cs7 and/or parity anymore, so we need to filter 775 # linux don't do cs7 and/or parity anymore, so we need to filter
787 788
788 stdin_parse if length $STDIN_BUF; 789 stdin_parse if length $STDIN_BUF;
789 } 790 }
790 791
791 $POWERSAVE = 0; # activity 792 $POWERSAVE = 0; # activity
793 } elsif (@PUSARTRECV || @KQUEUE) {
794 $POWERSAVE = 0;
792 } else { 795 } else {
793 ++$POWERSAVE unless @PUSARTRECV || @KQUEUE; 796 ++$POWERSAVE;
794 } 797 }
795 } 798 }
796 799
797 # kick off serial input interrupt quite often 800 # kick off serial input interrupt quite often
798 $RST |= 2 if @PUSARTRECV && $XON; # VT100, but works on vt102, too (probably not used on real hardware though) 801 $RST |= 2 if @PUSARTRECV && $XON; # VT100, but works on vt102, too (probably not used on real hardware though)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines