A large commit.
[pdp8.git] / sw / adventure / src / IO.FT
1 SUBROUTINE IO(RECORD)
2 C
3 C
4 C This function reads the direct access file and unpacks it.
5 C we put 6 13-character records into a single direct access record
6 C because OS/8 FORTRAN puts every record into a single block.
7 C Packing this saves one-sixth the space.
8 C
9 COMMON /TXTCOM/ RTEXT,LINES,ASCVAR,TXTLOC,DATA
10 INTEGER RTEXT(205),LINES(12),DATA(78),RECORD
11 INTEGER OLDREC,TXTLOC
12 DATA OLDREC/-1/
13
14 IREC = RECORD/6 + 1
15 IF (IREC .NE. OLDREC)READ(8'IREC)DATA
16 OLDREC = IREC
17 N = 13 * (MOD(RECORD-1,6)) + 1
18 TXTLOC = DATA(N)
19 DO 10 I = 1, 12
20 10 LINES(I) = DATA(N+I)
21 RETURN
22 END