10REM" Prevue7
20REM J.Davis '96.
30MODE7
40*FX202,32
50M$=" * P R E V U E
7 *"
60PRINTM$:PRINT
70PRINT" This is a utility for prev
iewing and printing a mode 7 screen wit
hin a program. It's been extracted
from the program LOTGOOD and arranged
so that it can be used in any program.
The routine";
80PRINT" is marked inside the Print p
rocedure. As the Demo shows, it can be
called at any time while the program i
s running, with the option to then carr
y on with the program."
90PRINT" It works by first shovelli
ng all the screen information into abou
t 1K of adjacent memory, meanwhile s
tripping out any teletext codes, repl
acing them"
100PRINT" with spaces, and keeping onl
y the printable ASCII characters f
rom 32 to 126. This produces a screen
display of what will be sent to the pri
nter, with the option of printing it at
the same"
110PRINT" time. It then restores the o
riginal screen."
120PRINTCHR$(145)STRING$(39,",");
130PRINTSPC(26)"Press SPACE";
140G=GET:CLS
150PRINTM$:PRINT
160PRINTTAB(14)" "CHR$(157)" DEMO "CH
R$(156)
170PRINT'" Let the demo screen build
up for a few seconds, then just foll
ow the prompts."
180PRINT" In screen only mode, the p
rogram stops before restoring the s
creen to allow previewing of printing
. You can also play with this program
without using the printer at all."
190PRINT'CHR$(145)STRING$(39,",");
200PRINT" This routine also keeps th
e elusive £ sign intact on both the sc
reen and the printer."
210PRINT" Some ¶'s are included in t
he demo to show that, as graphic charac
ters, they don't print, but are restore
d to the screen after printing."
220PRINTCHR$(145)STRING$(39,",");
230PRINTSPC(17)"Press SPACE for Demo";
240G=GET:CLS
250ONERROR VDU3:F%=0:VDU23,1,1;0;0;0;:
PRINTTAB(0,24)SPC(39);:PRINTTAB(0,24);:E
ND
260VDU23,1,0;0;0;0;
270S$=" ** * * * * * * * * * * * * * *
* * * **"
280PRINT" "CHR$(157)" Demo Screen - Mo
de 7 Preview/Print."
290PRINTS$;
300FORN%=2TO22
310PRINTTAB(0,N%)" £ ";TAB(38,N%)" £";
320NEXT
330PRINTTAB(0,23)S$;
340PROCinfoline
350G$=INKEY$(0)
360IF G$="P" F%=0:PROCprint:PROCinfoli
ne
370IF G$="S" F%=1:PROCprint:PROCinfoli
ne
380IF RND(1)>.6 FORN%=8TO16 STEP4:PRIN
TTAB(10,N%)" EIGHT BIT SOFTWARE ":NEXT:P
RINTTAB(3,RND(19)+2)" "
390PRINTTAB(RND(31)+2,RND(19)+2);CHR$(
128+RND(6));"8BS ";
400IF RND(1)>.7 PRINTTAB(RND(33)+2,RND
(19)+2);CHR$(128+RND(6));CHR$(32+(223AND
RND(1)>.7))" ";
410GOTO350
420" Demo Screen ^
430" **
440DEFPROCinfoline
450PRINTTAB(0,24)" P Print- screen+pri
nter S Screen only";
460ENDPROC
470" **
480DEFPROCprint
490REM" Start Routine
500IF F%=0 VDU2 ELSE VDU3
510PRINTTAB(0,0);
520FORN%=31744TO32703 STEP40
530FORM%=0TO39
540Z%=?(N%+M%)
550?(N%+M%-1200)=Z%
560IF Z%<32 OR Z%>126 Z%=32
570PRINTCHR$(Z%);
580IF Z%=35 ?(N%+M%)=35
590REM" Gives £ on screen and printer
600NEXT
610VDU13
620NEXT
630VDU13:VDU13
640VDU3
650IF F%=1 PRINTTAB(0,24)SPC(39);:PRIN
TTAB(0,24)" Note that this line doesn't
print.";:FOR D=1TO4000:NEXT:PRINTTAB(0,2
4)" Press SPACE to restore. "
;:G=GET
660PRINTTAB(0,24)" C Continue R Repri
nt N New ESC Quit";
670FORN%=30544TO31503
680?(N%+1200)=?N%
690NEXT
700REM" End Routine
710G$=GET$
720IF G$="C" ENDPROC
730IF G$="R" PROCprinter:GOTO500
740IF G$="N" CLS:GOTO280
750GOTO710
760" **
770DEFPROCprinter
780PRINTTAB(0,24)SPC(39);
790VDU23,1,1;0;0;0;
800PRINTTAB(0,24)" To Printer? (Y/N)";
810G$=GET$
820IF G$="Y" F%=0:GOTO850
830IF G$="N" F%=1:GOTO850
840GOTO810
850VDU23,1,0;0;0;0;
860ENDPROC