1 'Rodos Catalogue
2 'Richard Jones
3 'Amstrad Action July 88
10 PEN 1:PAPER 0:MODE 1:BORDER 0:INK 0,0:INK 1,26:INK 2,6:INK 3,24:WIDTH 40
20 REM
30 |PRINT,0:REM Change this line to |RINT,2 to send the data to the printer.
50 DIM t%(40),s%(40),p%(40):tr=0:t%(0)=0:s%(0)=&81:p%(0)=&104:MEMORY &7FFF
60 PEN 1:PRINT"         RODOS disc tree reader         ":PEN 2:PRINT"         ----------------------         ":PEN 3:PRINT"by Richard Jones":PEN 1
70 |READSECT,&8000,0,0,&81:PRINT:PRINT"Title: ";:FOR f=&8002 TO &8011:PRINT CHR$(1);CHR$ (PEEK(f));:NEXT:PRINT:PRINT
80 GOSUB 130
90 END
100 REM
110 REM MAIN LOOP - the program calls this subroutine to print out a directory full of data
120 REM
130 |READSECT,&8000,0,t%(tr),s%(tr)
140 pn=p%(tr)
150 IF pn>=&1E0 THEN 300
160 IF PEEK(&8000+pn)>&7F THEN GOTO 190
170 PRINT SPACE$(tr*2);:FOR f=&8000+pn+1 TO &8000+pn+&10:PRINT CHR$(1);CHR$(PEEK(f));:NEXT:PRINT "  ";:IF PEEK(&8000+pn)=&2C THEN PRINT"Dir" ELSE PRINT"Data"
180 IF PEEK(&8000+pn)=&2C THEN GOSUB 240
190 pn=pn+32:GOTO 150
200 RETURN
210 REM
220 REM This routine is called to drop down further into the directory tree.
230 REM
240 p%(tr)=pn:tr=tr+1:t%(tr)=PEEK(&8000+pn+&12):s%(tr)=PEEK(&8000+pn+&13):p%(tr)=&4
250 GOSUB 130
260 tr=tr-1:|READSECT,&8000,0,t%(tr),s%(tr):pn=p%(tr):RETURN
270 REM
280 REM This routine deals with the RODOS extended directory system.
290 REM
300 IF PEEK(&81E4)<>&2 THEN GOTO 200
310 t%(tr)=PEEK(&81E5):s%(tr)=PEEK(&81E6):p%(tr)=&4:GOTO 130
340 END