home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.lbl.gov
/
2014.05.ftp.ee.lbl.gov.tar
/
ftp.ee.lbl.gov
/
mtrek.shar.Z
/
mtrek.shar
/
watch.ftt
< prev
next >
Wrap
Text File
|
1990-04-02
|
3KB
|
158 lines
PROGRAM WATCH
INCLUDE 'LEDFORD.COM/-LI'
INCLUDE 'COMMND.COM/-LI'
INCLUDE 'BUFFER.COM/-LI'
LOGICAL*1 OK,YES,WARN
BYTE OLDBUF(40,24),NEWBUF(40,24)
LOGICAL*1 RESET
BYTE TMP
DATA OK/.FALSE./
DATA RESET/.TRUE./
CALL ERRSET(24,,.FALSE.,,.FALSE.)
CALL ERRSET(39,,.FALSE.,,.FALSE.)
CALL ERRSET(64,,.FALSE.,.TRUE.,.FALSE.)
CALL RDAST
I=INT(ZX)
J=INT(ZY)
C
C **** TOP OF LOOP ****
C
1000 CONTINUE
IF(CMD(1).NE.' ')GOTO 2000
RESET=.TRUE.
CALL CLEAR
ENCODE(35,100,IBUF)I,J
100 FORMAT('Current X =',I3,' Y =',I3)
CALL WRITE(10,20,IBUF,35)
CALL WRITE(12,28,'New X ? ')
CALL GETINT(K,OK,1,90)
IF(OK)I=K
CALL WRITE(12,45,'New Y ? ')
CALL GETINT(K,OK,1,90)
IF(OK)J=K
CMD(1)=0
GOTO 2500
2000 CONTINUE
I=INT(ZX)
J=INT(ZY)
CMD(1)=0
GOTO 2500
2010 CONTINUE
IF((CMD(1).LT.'1').OR.(CMD(1).GT.'8'))GOTO 2100
I=INT(XCORD(CMD(1)-'0'))
J=INT(YCORD(CMD(1)-'0'))
CMD(1)=0
GOTO 2500
2100 CONTINUE
IF((CMD(1).EQ.'Q').OR.(CMD(1).EQ."32))GOTO 10200
2200 CONTINUE
IF(CMD(1).EQ.0)GOTO 2500
C
C SHIFT DISPLAY ON COMMAND
C
IF(CMD(1).EQ.0)GOTO 10132
IF(CMD(1).EQ.'R')GOTO 2010
IF(CMD(1).EQ.'U')GOTO 10XXX
IF(CMD(1).EQ.'D')GOTO 10XXX
IF(CMD(1).EQ.'L')GOTO 10XXX
IF(CMD(1).EQ.'R')GOTO 10XXX
IF(CMD(1).EQ.'C')GOTO 10XXX
IF(CMD(1).EQ.'F')GOTO 10XXX
IF(CMD(1).EQ."15)GOTO 10138
;
; NOT A VALID COMMAND
;
CALL OUT(7,1)
GOTO 10138
;
; RESET COMMAND
;
10137 RESET=.TRUE.
CALL CLREF(25)
GOTO 10021
IF(I.LT.1)I=I+100
IF(I.GT.100)I=I-100
IF(J.LT.1)J=J+100
IF(J.GT.100)J=J-100
CMD(1)=0
C
C GENERATE NEW NEWBUF
C
2500 CONTINUE
DO 10046 IX=1,40
DO 10049 IY=1,24
NEWBUF(IX,IY)=' '
10049 CONTINUE
10046 CONTINUE
IXB=0
IXLEF=I-19
IXRIG=I+20
IYBOT=J-11
IYTOP=J+12
DO 10052 IX=IXLEF,IXRIG
IXB=IXB+1
IOFF=IX
IF(IX.LT.1)IOFF=IX+100
IF(IX.GT.100)IOFF=IX-100
IYB=0
DO 10054 IY=IYTOP,IYBOT,-1
IYB=IYB+1
JOFF=IY
IF(IY.LT.1)JOFF=IY+100
IF(IY.GT.100)JOFF=IY-100
NEWBUF(IXB,IYB)=UNIV(IOFF,JOFF)
TMP=NEWBUF(IXB,IYB)
IF(((IX.EQ.1).OR.(IY.EQ.1)).AND.(TMP.EQ.'.'))NEWBUF(IXB,IYB)=' '
IF((TMP.LT.'1').OR.(TMP.GT.'8'))GOTO 10054
IF(CLOAK(TMP-'0'))NEWBUF(IXB,IYB)='~'
10054 CONTINUE
10052 CONTINUE
C
C OUTPUT NEW DISPLAY
C
IF(.NOT. RESET)GOTO 3000
CALL CLEAR
DO 10072 IY=1,24
ENCODE(80,10074,IBUF) (NEWBUF(IX,IY),IX=1,40)
10074 FORMAT(40(A1,1X))
CALL WRITE(IY,1,IBUF,80)
10072 CONTINUE
DO 6000 IY=1,24
DO 7000 IX=1,40
OLDBUF(IX,IY)=NEWBUF(IX,IY)
7000 CONTINUE
6000 CONTINUE
RESET=.FALSE.
3000 CONTINUE
C
C COMPARE AND UPDATE DISPLAY
C
10098 CONTINUE
DO 10102 IY=1,24
DO 10104 IX=1,40
IF(NEWBUF(IX,IY).EQ.OLDBUF(IX,IY))GOTO 10104
CALL WRITE(IY,2*(IX-1)+1,NEWBUF(IX,IY),1)
OLDBUF(IX,IY)=NEWBUF(IX,IY)
10104 CONTINUE
10102 CONTINUE
CALL MARK(24,60,1)
CALL CLREF(25)
CALL STLOR(24,25)
GOTO 1000
10200 CONTINUE
CALL WRITE(23,1,0)
CALL EXIT
END