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

Comparing vt102/vt102 (file contents):
Revision 1.16 by root, Wed Dec 3 02:15:18 2014 UTC vs.
Revision 1.17 by root, Wed Dec 3 02:16:30 2014 UTC

105 105
106my $RST = 0; # 8080 pending interrupts 106my $RST = 0; # 8080 pending interrupts
107my $INTMASK = 7; # 8085 half interrupts 107my $INTMASK = 7; # 8085 half interrupts
108my $INTPEND = 0; # 8085 half interrupts 108my $INTPEND = 0; # 8085 half interrupts
109 109
110my $x; # dummy temp for instructions
111
112my $CLK; # rather inexact clock 110my $CLK; # rather inexact clock
113 111
114############################################################################# 112#############################################################################
115# the dreaded NVR1400 chip. not needed to get it going, but provided anyway 113# the dreaded NVR1400 chip. not needed to get it going, but provided anyway
116 114
291sub in_17 { 0xff } # vt102 unknown, printer status clear by reading? 289sub in_17 { 0xff } # vt102 unknown, printer status clear by reading?
292sub in_1b { 0xff } # vt102 unknown 290sub in_1b { 0xff } # vt102 unknown
293 291
294############################################################################# 292#############################################################################
295# 8085 cpu opcodes and flag handling 293# 8085 cpu opcodes and flag handling
294
295my $x; # dummy scratchpad for opcodes
296 296
297sub sf { # set flags (ZSC - AP not implemented) 297sub sf { # set flags (ZSC - AP not implemented)
298 $FS = $_[0] & 0x080; 298 $FS = $_[0] & 0x080;
299 $FZ = !($_[0] & 0x0ff); 299 $FZ = !($_[0] & 0x0ff);
300 $FC = $_[0] & 0x100; 300 $FC = $_[0] & 0x100;
800 # 6.5 vt125 mb7 read ready (something modem?) 800 # 6.5 vt125 mb7 read ready (something modem?)
801 # 7.5 vt125 mb7 vblank h(?) 801 # 7.5 vt125 mb7 vblank h(?)
802 # trap vt125 mbi init h(?) 802 # trap vt125 mbi init h(?)
803 my $vec; 803 my $vec;
804 804
805 $x = $INTPEND & ~$INTMASK; 805 my $pend = $INTPEND & ~$INTMASK;
806 806
807 if ($x & 1) { $vec = 0x2c; $INTPEND &= ~1; 807 if ($pend & 1) { $vec = 0x2c; $INTPEND &= ~1;
808 } elsif ($x & 2) { $vec = 0x34; $INTPEND &= ~2; 808 } elsif ($pend & 2) { $vec = 0x34; $INTPEND &= ~2;
809 } elsif ($x & 4) { $vec = 0x3c; $INTPEND &= ~4; 809 } elsif ($pend & 4) { $vec = 0x3c; $INTPEND &= ~4;
810# } elsif ($RST ) { $vec = $RST * 8; $RST = 0; # the vt102 firmware doesn't like combined interrupts 810# } elsif ($RST ) { $vec = $RST * 8; $RST = 0; # the vt102 firmware doesn't like combined interrupts
811 } elsif ($RST & 1) { $vec = 0x08; $RST &= ~1; # separate is better for vt102 811 } elsif ($RST & 1) { $vec = 0x08; $RST &= ~1; # separate is better for vt102
812 } elsif ($RST & 2) { $vec = 0x10; $RST &= ~2; 812 } elsif ($RST & 2) { $vec = 0x10; $RST &= ~2;
813 } elsif ($RST & 4) { $vec = 0x20; $RST &= ~4; 813 } elsif ($RST & 4) { $vec = 0x20; $RST &= ~4;
814 } else { 814 } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines