Skip to content

Commit

Permalink
Optimise the print statements in loader.txt a bit
Browse files Browse the repository at this point in the history
SPC(x) is a lot more efficient than a string of spaces...
  • Loading branch information
James Churchill committed Nov 20, 2020
1 parent 2d8a6c1 commit 92eab9d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/loader.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
20 MODE 2
30 PRINT CHR$(150)+STRING$(78,154)+CHR$(156);
40 PRINT CHR$(149)+" DSK2CDT2DISC - Silly disc image tool "+CHR$(149);
50 PRINT CHR$(151)+STRING$(78,154)+CHR$(157);
60 PRINT CHR$(149)+" By James Churchill pelrun@gmail.com "+CHR$(149);
70 PRINT CHR$(151)+STRING$(78,154)+CHR$(157);
80 PRINT CHR$(149)+" Please wait - loading M/C segment. "+CHR$(149);
90 PRINT CHR$(147)+STRING$(78,154)+CHR$(153);
30 PRINT CHR$(150);STRING$(78,154);CHR$(156);
40 PRINT CHR$(149);SPC(21);"DSK2CDT2DISC - Silly disc image tool";SPC(21);CHR$(149);
50 PRINT CHR$(151);STRING$(78,154);CHR$(157);
60 PRINT CHR$(149);SPC(21);"By James Churchill pelrun@gmail.com";SPC(21);CHR$(149);
70 PRINT CHR$(151);STRING$(78,154);CHR$(157);
80 PRINT CHR$(149);SPC(22);"Please wait - loading M/C segment.";SPC(22);CHR$(149);
90 PRINT CHR$(147);STRING$(78,154);CHR$(153);
100 :
110 MEMORY &1FFF:DEFINT a-z
120 code=&9000:dib=&8E00:blkload=&2000:tib=&6000:dpb!=PEEK(&BE43)*256+PEEK(&BE42)
130 LOAD "!RSX",code
140 CALL code
150 LOCATE 1,6
160 PRINT CHR$(149)+" Number of tracks: 00"+CHR$(149);
170 PRINT CHR$(151)+STRING$(78,154)+CHR$(157);
180 PRINT CHR$(149)+" Track: 00 "+CHR$(149);
190 PRINT CHR$(149)+" Sector: 00 "+CHR$(149);
200 PRINT CHR$(147)+STRING$(78,154)+CHR$(153);
160 PRINT CHR$(149);SPC(58);"Number of tracks: 00";CHR$(149);
170 PRINT CHR$(151);STRING$(78,154);CHR$(157);
180 PRINT CHR$(149);SPC(35);"Track: 00";SPC(34);CHR$(149);
190 PRINT CHR$(149);SPC(34);"Sector: 00";SPC(34);CHR$(149);
200 PRINT CHR$(147);STRING$(78,154);CHR$(153);
210 :
220 LOCATE 2,8:PRINT "Loading Disk Information Block..."
230 ret=0:|CALLBCA1,@ret,dib,&100,&16
240 LOCATE 2,8:PRINT " "
240 LOCATE 2,8:PRINT SPC(33)
250 chk$=CHR$(PEEK(dib))+CHR$(PEEK(dib+1))
260 IF chk$<>"EX" THEN LOCATE 1,11:PRINT "Invalid DIB - read error!":END
270 numtracks=PEEK(dib+&30):heads=PEEK(dib+&31):LOCATE 78,6:PRINT USING "##";numtracks
Expand All @@ -42,8 +42,8 @@
430 |DEEXO,blkload+trkload,tib
440 trknum=PEEK(tib+&10)
450 LOCATE 44,8:PRINT USING "##";trknum
460 LOCATE 17,13:PRINT" "
470 LOCATE 2,8:PRINT" "
460 LOCATE 17,13:PRINT SPC(43)
470 LOCATE 2,8:PRINT SPC(23)
480 :
490 bps=PEEK(tib+&14):rbps=bps*&100:spt=PEEK(tib+&15):gap=PEEK(tib+&16):fil=PEEK(tib+&17)
500 firstnum=&100:FOR i=0 TO spt-1:firstnum=MIN(firstnum,PEEK(tib+&1A+(8*i))):NEXT
Expand All @@ -56,7 +56,7 @@
570 hdr$=hdr$+CHR$(trknum)+CHR$(0)+CHR$(PEEK(tib+&1A+(8*hdrloop)))+CHR$(logbps)
580 NEXT hdrloop
590 |FORMAT,trknum,@hdr$
600 LOCATE 25,8:PRINT" "
600 LOCATE 25,8:PRINT SPC(10)
610 :
620 LOCATE 28,9:PRINT"Writing":LOCATE 44,9
630 sct=tib+&100
Expand All @@ -65,7 +65,7 @@
660 |WRITESCTR,trknum,sctrnum,sct
670 sct=sct+PEEK(tib+&1E+(8*sctloop))+(PEEK(tib+&1F+(8*sctloop))*&100)
680 NEXT sctloop
690 LOCATE 28,9:PRINT" "
690 LOCATE 28,9:PRINT SPC(7)
700 :
710 trkindex=trkindex+1
720 GOTO 390
Expand Down

0 comments on commit 92eab9d

Please sign in to comment.