8-Bit Software Online Conversion
Teletext Page Grabber - Listing
10REM >GetPages 1.21
20REM About '86 V0.10 JGH: Initial ve
rsion at Myers Grove
30REM Early '88 V1.00 JGH: Tidied ver
sion for Micro User
40REM 20-Apr-97 V1.10 JGH: Selects ma
gazine, looks on every line for subpage
50REM 21-Jun-98 V1.20 JGH: Can do ran
ge of pages
60REM 30-Jul-98 V1.21 JGH: Better ind
ex match, doesn't miss last page
70:
80MODE7:DIMctrl%20,mcode%60,pf%(99):X
%=ctrl%:Y%=X%DIV256:ver$="1.21":PROCtitl
e
90A%=130:IF(USR&FFF4 AND&FFFF00)<>&FF
FF00:PRINT"Program must run in the I/O p
rocessor.":END
100IFHIMEM<>&7C00:OSCLI"SHADOW 1":MODE
7:IFHIMEM<>&7C00:PRINT"Please turn shad
ow screen off.":END
110VDU23;2,53;0;0;0:PROCassem:ON ERROR
PROCerr
120*HON
130INPUT"Channel: "C:OSCLI"CH"+STR$C:O
SCLI"MAGAZINE "+STR$C
140INPUT"Enter Start Page: "P0:OSCLI"P
AGE "+STR$P0
150OSCLI"MAGAZINE "+LEFT$(STR$P0,1)
160PRINT"Enter End Page"'"(or RETURN f
or just P";P0;:INPUT"): "P1
170PRINT"Save name";:IFP1<>0:PRINT" pr
efix";
180INPUT": "SP$
190:
200P=P0:REPEAT:CLS:PRINT''"Searching f
or P";P;:OSCLI"PAGE "+STR$P
210FORlp%=1 TO 99:pf%(lp%)=0:NEXT
220REPEATpg%=FNpage:UNTIL(pg%AND&FF00)
:pages%=pg%DIV256
230S$=SP$+LEFT$(STR$P,P1<>0)
240OSCLI"SAVE "+S$+" 0+"+STR$รท(pages%*
1024)+" FFFF7C28 FFFF7C28"
250pg%=pg%AND&FF:out%=OPENOUT(S$):PTR#
out%=935:BPUT#out%,pages%:PROCsave(pg%)
260REPEAT:CLS:VDU23;2,53;0;0;0
270PRINT"P";P:PROCtitle:FORlp%=1 TO pa
ges%:IFpf%(lp%):VDU146 ELSE VDU151
280VDU47:IF(lp%MOD20)=0:PRINT'
290NEXT:VDU31,(2*pg%-1)MOD40,7+2*(pg%-
1)DIV20,94,8
300IFpages%>1:REPEATpg%=FNpage AND&FF:
UNTILpg%:IFpf%(pg%)=0:PROCsave(pg%)
310f%=0:FORlp%=1 TO pages%:f%=f%+pf%(l
p%):NEXT
320UNTILf%>=pages%:PROCCloseOut:P=P+1:
UNTILP>P1
330CLS:PROCtitle:PRINT'"Finished"
340*HOFF
350END
360:
370DEFFNpage
380*TRANSFER 7000
390*DISPLAY 7000
400REM VDU23;2,53;0;0;0
410add%=&7C49:REPEAT:!ctrl%=!add%:ctrl
%!4=add%!4
420FORlp%=ctrl%TOctrl%+6:?lp%=?lp%AND1
27:IF((?lp%+1)AND127)<33:?lp%=32
430NEXT:ctrl%?7=13:A$=$ctrl%:add%=add%
+40
440I%=INSTR(A$,"/"):UNTILadd%>&8000 OR
(I% AND (VALMID$(A$,I%-2)+VALMID$(A$,I%
+1)<>0))
450IFadd%>&8000:PRINTTAB(0,24);"Can't
find page index.";:=&101:REM :=0
460p%=VALMID$(A$,I%+1):IFp%=0 OR p%>99
:PRINTTAB(0,24);"Invalid magazine size."
;:=&101:REM :=0
470=p%*256+VALMID$(A$,I%-2)
480:
490DEFPROCsave(p%)
500PRINTTAB(0,0);P;"/";p%:CALL mcode%
510?X%=out%:X%!1=&FFFF7C28:X%!5=920:X%
!9=1024*(p%-1):A%=1:CALL &FFD1
520FORM%=&7000 TO &7067 STEP4:!M%=0:NE
XT
530?X%=out%:X%!1=&FFFF7000:X%!5=104:X%
!9=1024*(p%-1)+920
540CALL &FFD1:pf%(p%)=1:ENDPROC
550:
560DEFPROCCloseOut:out%=out%:IFout%:A%
=out%:out%=0:CLOSE#A%
570ENDPROC
580:
590DEFPROCtitle
600PRINTTAB(0,1);CHR$132;CHR$157;CHR$1
31;CHR$141;SPC(5)"Teletext Page Download
er"'CHR$132;CHR$157;CHR$131;CHR$141;SPC(
5)"Teletext Page Downloader"
610PRINT" "CHR$157;CHR$132;SPC3"(C)198
8,98 J.G.Harston. V"ver$''
620ENDPROC
630:
640DEFPROCassem
650FOR pass%=0 TO 1
660P%=mcode%
670[OPT pass%*2
680LDA #0:STA &70:TAY
690LDA #&7C:STA &71
700.loop
710LDA (&70),Y
720CMP #163:BEQ stay
730CMP #223:BEQ stay
740CMP #224:BEQ stay
750CMP #255:BEQ stay
760AND #&7F:CMP #32:BCS stay
770ORA #&80
780.stay
790STA (&70),Y:INY:BNE loop
800INC &71:LDA &71:CMP #&80:BNE loop
810RTS
820]NEXT:ENDPROC
830:
840DEFPROCerr:PRINTTAB(0,24)SPC(39);
850PRINTTAB(0,23);:REPORT:ON ERROR REP
ORT:PRINT" at line ";ERL;:END
860PROCCloseOut:*HOFF
870END