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