C***   XSPEAK
C  UTILITY ROUTINES FOR CREATING A READABLE CAVE MAP. (XSPEAK, XMAP)

       SUBROUTINE XSPEAK(LOC)

C  PRINT LOCATION DESCRIPTIONS.  WORKS JUST LIKE SPEAK, EXCEPT THAT
C  LOCATION NUMBER IS PREFIXED TO EACH LINE.

       IMPLICIT INTEGER(A-Z)
      INTEGER*4 RTEXT,PTEXT,MTEXT
      INTEGER*4 LINES
       COMMON /TXTCOM/ LINES(25000),RTEXT(400),PTEXT(150),MTEXT(45)
      INTEGER*4 LTEXT,STEXT,K,L
       COMMON /LTXCOM/ LTEXT(250),STEXT(250),KEY(250),ABB(250),LOCSIZ
       COMMON /PLACOM/ ATLOC(250),LINK(300),PLACE(150),
     1          FIXED(150),MAXOBJ
      INTEGER*4 POINTS,OLINE
       COMMON /OBJCOM/ PLAC(150),FIXD(150),WEIGHT(150),PROP(150),
     1          POINTS(150)
       DIMENSION OLINE(18)

       K=STEXT(LOC)
      IF(K.EQ.0.OR.LINES(K+1).EQ.XOR('>$< ','CLYD'))K=LTEXT(LOC)
C       WRITE (22,5)
      WRITE(5,5)
C       WRITE (22,5)
      WRITE(5,5)
5       FORMAT (1H )
1       L=IABS(LINES(K))-K-1
       DO 2 I=1,L
2     OLINE(I)=XOR(LINES(K+I),'CLYD')
C       WRITE (22,3),LOC,(OLINE(I),I=1,L)
      WRITE(5,3)LOC,(OLINE(I),I=1,L)
3       FORMAT (1X,I3,'  ',18A4)
       K=K+L+1
       IF(LINES(K).GE.0)GOTO 1
       DO 7 OBJ=1,MAXOBJ
       IF(LOC.NE.PLAC(OBJ).AND.LOC.NE.FIXD(OBJ))GOTO 7
       K=PTEXT(OBJ)
       L=IABS(LINES(K))-K-1
       DO 6 I=1,L
6     OLINE(I)=XOR(LINES(K+I),'CLYD')
C       WRITE (22,9),(OLINE(J),J=1,L)
      WRITE(5,9)(OLINE(J),J=1,L)
7       CONTINUE
C       WRITE (22,5)
      WRITE(5,5)
       RETURN

9       FORMAT (8X,18A4)
       END
