subroutine COMGO(ISTAT) C C the above are LUN numbers, BM: uses 10 & 11 ISTAT = 1 return end subroutine COMEX return end subroutine COMST(ISTAT) C C code to get status of Comtal display C ISTAT=0 return end subroutine COM0(MODE) C C code to send single word control cmds to display monitor C integer*2 IFUNC,PRL(6) integer iosb(2) byte isb equivalence (iosb,isb) C data IOINL /"002400/ data PRL /6*0/ data ISPECL /"15/ !special functions unit-could be any data LUN /4/ C IUNIT = ISPECL call ASNLUN(LUN,'CD',IUNIT,ids ) if(ids .gt.0)goto 5 call ASNERR(LUN,IUNIT) return 5 continue C iretry = 0 C 10 IFUNC = IOINL C PRL(1) = MODE C 20 call WTQIO(IFUNC,LUN,LUN,,iosb,PRL,IDS) C call wait qio specify lun # as wait flag # C if( IDS.gt.0)goto 30 type 22,LUN,IDS 22 format(' COM0:LUN=',i2,' QIO ERR=',i5) return 30 continue if( isb .gt. 0 )return if(isb .ne. -03)goto 50 iretry = iretry + 1 call COMERR(MODE,0,0,lun,isb,ifunc) read(5,39)iflag 39 format(i5) goto 10 50 call COMERR(MODE,0,0,lun,isb,ifunc) return end subroutine COM1XX(MODE,IUNIT,LINE,IBUF,NWRDS) C THIS IS IDENTICAL TO COM1 but is designed to be used IN C overlapped reads/writes in double buffered mode. C HIGH SPEED C C code to xfer with image & graphics Comtal memories C integer*2 IFUNC(18),PRL(6) integer iosb(2) byte isb equivalence (iosb,isb) C C parameter IOWLB="000400 , IORLB="001000 C data PRL /6*0/ C hopefully 3,4,6 are never altered C C C IFUNC conatins QIO function,IORLB/IOWLB plus subfunction byte C sub function byte stores 8 bits actually used in comtal bit pattern C this low byte of IFUNC becomes the HIGH byte in Comtal command word. C data IFUNC /"400,"400,0,0,"1000,"1000,0,0 x ,"404,"500,"1100,"500,"540,"440,"440,"0,"1040,"1040/ C these functions include the special sub-function codes: C they are defined in COM1 not here but are identical C C PRL(3) = 0 C PRL(4) = 0 C PRL(6) = 0 C data LUN /4/ C ITMP = IUNIT C goto (20,10,20,10,20,10,20,10,20,20,20,10,10,20,10,30,20,10) x ,MODE+1 10 ITMP = ITMP + 3 C add offset to address graphics memories C 20 continue C call GETADR(PRL,IBUF) C PRL(2) = 2*(-NWRDS) C call ASNLUN(LUN,'CD',ITMP,ids ) if(ids .gt.0)goto 5 call ASNERR(LUN,ITMP) return 5 continue PRL(5) = LINE C 25 call QIO(IFUNC(MODE+1),LUN,LUN,,iosb,PRL,IDS) C call qio specify lun # as wait flag # RETURN END subroutine COM1(MODE,IUNIT,LINE,IBUF,NWRDS) C C SUPPORT COMTAL MODE 1 xfers C code to xfer with image & graphics Comtal memories C integer*2 IFUNC(18),PRL(6) C 18 function codes MODE=0 thru 17 integer iosb(2) byte isb equivalence (iosb,isb) C C parameter IOWLB="000400 , IORLB="001000 C data PRL /6*0/ C hopefully 3,4,6 are never altered C C IFUNC conatins QIO function,IORLB/IOWLB plus subfunction byte C sub function byte stores 8 bits actually used in comtal bit pattern C this low byte of IFUNC becomes the HIGH byte in Comtal command word. C the most significant bit of the sub-function byte is not used C in the IFUNC words because it is explicitly set by code that C tsts the IORLB/IOWLB function code and sets the msb of the C xfer cmd word. C data IFUNC /"400,"400,0,0,"1000,"1000,0,0 x ,"404,"500,"1100,"500,"540,"440,"440,"0,"1040,"1040/ C C these functions include the special sub-function codes: C sub mode =0 has sub function code = 0 C normal line xfer of 256 elements C C MODE=13 IMAGE pixel write,=14 GRAPHIC pixel write C MODE=16 IMAGE pixel READ,=17 GRAPHIC pixel READ C sub mode =1 has sub function code = "40 C word/pixel/point xfer C C sub mode =2 has sub function code = "100 C window xfer C C MODE=12 load (X,Y) coordintes for PIXEL or WINDOW xfer C sub mode =3 has sub function code = "140 C coordinate xfer for point + window C C sub mode =4 has sub function code = "4 C offset xfer, load start of scan regs C C sub mode =5 has sub function code = 44 C set memory acess priority C has no effect on COMTAL VISION ONE ALL ARE SLOW!!!!!!!!!!!!!!!!! C about 7 micro seconds per word avg memory speed. ANIMATION SUFFERS C C PRL(3) = 0 C PRL(4) = 0 C PRL(6) = 0 data LUN /4/ C ITMP = IUNIT goto (20,10,20,10,20,10,20,10,20,20,20,10,10,20,10,30,20,10) x ,MODE+1 10 ITMP = ITMP + 3 C add offset to address graphics memories C 20 continue C C call ASNLUN(LUN,'CD',ITMP,ids ) if(ids .gt.0)goto 5 call ASNERR(LUN,ITMP) return C 5 call GETADR(PRL,IBUF) C PRL(2) = 2*(-NWRDS) C PRL(5) = LINE C line in graphics is 0 to 511 ,each line is a raster line C compute using proper line + graphics number C 25 call WTQIO(IFUNC(MODE+1),LUN,LUN,,iosb,PRL,IDS) C call wait qio specify lun # as wait flag # C if( IDS.gt.0)goto 40 type 22,LUN,IDS 22 format(' COM1:LUN=',i2,' QIO ERR=',i5) return 40 if( isb .gt. 0 )return if(isb .ne. -03)goto 50 iretry = iretry + 1 call COMERR(MODE,ITMP,NWRDS,lun,isb,ifunc) read(5,39)iflag 39 format(i5) goto 5 C sit in this loop , trying to send to the comtal C 50 call COMERR(MODE,ITMP,NWRDS,lun,isb,ifunc) return 30 type 31 31 format(' you called COM1 with MODE=15 and I am not programmed') stop 'panic in COMTAL.ftn ,if use MODE=15' end subroutine COM2(MODE,IUNIT,LINE,IBUF,NWRDS) C C code to xfer with function & psuedo-color Comtal memories C modified 9-aug-79 to allow FM #4 ,it is 16x16 programmable target C integer*2 IFUNC(4),PRL(6) integer iosb(2) byte isb equivalence (iosb,isb) C C parameter IOWLB="000400 , IORLB="001000 C data IFUNC /"400,"400,"1000,"1000/ data PRL /6*0/ data LUN /4/ C C NOTE: this code does not use line # input C all data for function memories & psuedo-color C are expected to fall into 256 word blks on psuedo-disk C these blks are mapped using the unit # input. C C LUN = 4 C C PRL(3) = 0 C PRL(4) = 0 C ITMP = IUNIT C get offset from funtion or color membase C if(MODE.ne.1.and.MODE.ne.3)ITMP = ITMP + 11 C color memory base added C note FM#4 = is the Comtal way to read/write programmable target ! if(MODE.eq.1.or.MODE.eq.3)ITMP = ITMP + 7 C function memory base added C call ASNLUN(LUN,'CD',ITMP,ids ) if(ids .gt.0)goto 5 call ASNERR(LUN,ITMP) return 5 continue 10 PRL(6) = LINE C REMEMBER I.PRM+14 IS DIVIDED BY 2 INIITALLY /************* C call GETADR(PRL,IBUF) C PRL(2) = 2*(-NWRDS) PRL(5) = 0 C C C 20 call WTQIO(IFUNC(MODE+1),LUN,LUN,,iosb,PRL,IDS) C call wait qio specify lun # as wait flag # C if( IDS.gt.0)goto 30 type 22,IDS 22 format(' COM2:LUN=4 QIO ERR=',i5) return 30 if( isb .gt. 0 )return if(isb .ne. -03)goto 50 iretry = iretry + 1 call COMERR(MODE,ITMP,NWRDS,LUN,isb,ifunc) read(5,39)iflag 39 format(i5) goto 10 50 call COMERR(MODE,ITMP,NWRDS,LUN,isb,ifunc) return end subroutine COM3(MODE,IBUF,NWRDS) C C code to xfer with MODE 3 data xfers C INTEGER IBUF(2) integer*2 IFUNC(9),PRL(6) integer iosb(2) byte isb equivalence (iosb,isb) C C parameter IOWLB="000400 , IORLB="001000 C data PRL /6*0/ C C IFUNC conatins QIO function,IORLB/IOWLB plus subfunction byte C sub function byte stores 8 bits actually used in comtal bit pattern C this low byte of IFUNC becomes the HIGH byte in Comtal command word. C data IFUNC /"400,"500,"1000 x ,"440,"1040,"540,"1140,"460,"1060/ data LUN /4/ data ISPECL /"16/ !special funcions unit C C the below are definitions of sub-funtion byte for MODE 3 C C SEND MODE FROM CALLER AS MODE=0,1,2,...,8 C THIS CODE ADDS ONE TO MODE BEFORE CALLING !!!!!!!!!!!!!! C C USER SENDS MODE=0 FOR 1=000 wrt X target addr C USER SENDS MODE=1 FOR 2=100 wrt Y taget addr C 3=200 read X,Y target and last char C 4=040 wrt comtal cmd blk C 5=240 read comtal cmd blk C 6=140 wrt LSI-11 code blk C USER SENDS MODE=6 FOR 7=340 read LSI-11 code blk C USER SENDS MODE=7 FOR 8=060 wrt data blk (16) C USER SENDS MODE=8 FOR 9=260 read data blk (16) C C the most significant bit of the sub-function byte is not used C in the IFUNC words because it is explicitly set by code that C tsts the IORLB/IOWLB function code and sets the msb of the C xfer cmd word. C C LUN = 4 C C PRL(3) = 0 C PRL(4) = 0 C PRL(5) = 0 IUNIT = ISPECL call ASNLUN(LUN,'CD',IUNIT,ids ) if(ids .gt.0)goto 5 call ASNERR(LUN,IUNIT) return 5 continue C iretry = 0 C 10 PRL(6) = 0 IF(MODE .LE. 1)PRL(6) = IBUF(1) IF((MODE .EQ. 5).OR.(MODE.EQ.6))PRL(6) = IBUF(1) C ENCODE THE 9 BIT ADDR IN 1ST WORD OF BUFFER & BREAK IT OUT HERE C C call GETADR(PRL,IBUF) C PRL(2) = 2*(-NWRDS) C C 20 call WTQIO(IFUNC(MODE+1),LUN,LUN,,iosb,PRL,IDS) C call wait qio specify lun # as wait flag # C if( IDS.gt.0)goto 30 type 22,IDS 22 format(' COM3:LUN=4 QIO ERR=',i6) return 30 if( isb .gt. 0 )return if(isb .ne. -03)goto 50 iretry = iretry + 1 call COMERR(MODE,0,NWRDS,LUN,isb,ifunc) read(5,39)iflag 39 format(i5) goto 10 50 call COMERR(MODE,0,NWRDS,LUN,isb,ifunc) return end subroutine COMERR(MODE,IUNIT,NWRDS,lun,isb,ifunc) C byte isb C 30 if( isb .gt. 0 )return if( isb .eq. -59 )goto 159 if( isb .eq. -03 )goto 103 if( isb .eq. -74 )goto 174 if( isb .le. 0 )type 32,lun ,isb,ifunc,MODE,IUNIT,NWRDS 32 format(' CD: lun=',i2,' i/o status err byte=',i3,' ifunc=',o6,/ X ,' MODE OF XFER=',I5,' CD UNIT=',I5,' # WORDS=',I5) return C C error comments C C C this error is sent when COMTAL is in a command and a PDP-11 task C tries to send a block of data to the COMTAL. The COMTAL has a BIT C that says not busy -- even though it is --- this bit is not set C until the second block is sent. The 1st block sent corrupts the COMATL C in some way depending on the type of XFER used. XFER to imge will C corrupt the 15 GRAY keys, xfer to graphics will corrupt memory offsets C other will destroy the cursor pattern ........... C COMTAL needs a firmware MODIFICATION TO set busy when ever in a C command to aviod the problem. 103 type 03 03 format(' I am trying to send data to the COLOR DISPLAY but its ' x ,'busy.' / x ' When you have completed your operation on it press the "ESC"' x ,' key on' / x ' the biege COMTAL keyboard and then the carriage return on my' x ,' keyboard. ') return 159 type 59,lun ,ifunc 59 format(' CD: lun=',i2,' HARDWARE ERR ifunc=',i3) return 174 type 74,lun ,ifunc 74 format(' CD: lun=',i2,' TIME OUT ifunc=',i3) return end subroutine ASNERR(LUN,IUNIT) C type 10,LUN,IUNIT 10 format(' ASN LUN =',i3,' to CD',O2,': WAS IN ERROR') return end