10 REM PASTE Utility 20 REM by M.Bobrowski 3'93 30 REM for 8-BS PD 40 : 50 MODE7:OSCLI"*CAT":REM MODE7:*CAT C : REM for DFS users:REM MODE7:*CAT only 60 V%=VPOS+1:VDU30:PRINTSPC120;TAB(8,0)CHR$141"CUT & PASTE UTILITY"TAB(8,1)CHR$141"CUT & PASTE UTILITY"TAB(12,2)"Paste Program"TAB(0,V%)"Which cutout do you wish to load" 70 INPUT""F$:VDU28,0,24,39,4 80 PRINT'"Enter screen MODE (0-3 or 4 or 5) ";:REPEAT:M%=GET-48:UNTIL(M%>=0ANDM%<3)ORM%=4ORM%=5:PRINT;M%:step%=-16*(M%=0)-32*(M%=1ORM%=4)-64*(M%=2ORM%=5) 90 IFM%<3 A$=" 3000":S%=&3000:L%=&280:H%=16:B$=A$+"+5000 FFFF3000 FFFF3000" ELSE A$=" 5800":S%=&5800:L%=&140:H%=32:B$=A$+"+2800 FFFF5800 FFFF5800" 100 PRINT'"Do you wish to load a background screen as well (Y/N) ";:B%=INSTR("NnYy",GET$)DIV3:IF B%=0 PRINT"No" ELSE PRINT"Yes":INPUT'"Enter its filename : "L$ 110 INPUT'"Enter a name for the screen file to be"'"saved : "S$ 120 MODE M%:VDU23;8202;0;0;0;:IF B% OSCLI"L."+L$+A$ 130 cutout%=OPENIN("C."+F$) 140 xsize%=(BGET# cutout%+256*BGET #cutout%) 150 ysize%=(BGET# cutout%+256*BGET #cutout%) 160 : 170 xo%=0:yo%=1024:x%=xo%:y%=yo% 180 GCOL4,0:MOVE x%,y%:DRAW x%+xsize%,y%:DRAW x%+xsize%,y%-ysize%:DRAW x%,y%-ysize%:DRAW x%,y% 190 REPEAT:PROCcheck_keys:PROCmove:UNTIL INKEY(-106):*FX15,1 200 xpos%=x%/H%:ypos%=256-(y%/4) 210 offset%=S%+(xpos%*8)+L%*(ypos%DIV 8)+(ypos% MOD 8) 220 MOVE x%,y%:DRAW x%+xsize%,y%:DRAW x%+xsize%,y%-ysize%:DRAW x%,y%-ysize%:DRAW x%,y% 230 GCOL0,7 240 PROCload_cutout 250 VDU30:IF S$<>"" THEN OSCLI"SA."+S$+B$ 260 END 270 : 280 DEF PROCcheck_keys:move%=FALSE:*FX21,0 290 IF INKEY-73 AND y%<=1024 y%=y%+4-(INKEY-1)*28:move%=TRUE 300 IF INKEY-105 AND y%>=ysize% y%=y%-4+(INKEY-1)*28:move%=TRUE 310 IF INKEY-98 AND x%>=0 x%=x%-step%:move%=TRUE 320 IF INKEY-67 AND x%<=1280-xsize% x%=x%+step%:move%=TRUE 330 ENDPROC 340 : 350 DEF PROCmove:IF NOT move% ENDPROC 360 MOVE xo%,yo%:DRAW xo%+xsize%,yo%:DRAW xo%+xsize%,yo%-ysize%:DRAW xo%,yo%-ysize%:DRAW xo%,yo% 370 MOVE x%,y%:DRAW x%+xsize%,y%:DRAW x%+xsize%,y%-ysize%:DRAW x%,y%-ysize%:DRAW x%,y% 380 xo%=x%:yo%=y% 390 ENDPROC 400 : 410 DEF PROCload_cutout 420 FOR X%=1 TO xsize%/H% 430 addr%=offset%+8*(X%-1) 440 FOR Y%=1 TO ysize%/4 450 ?addr%=BGET# cutout% 460 addr%=addr%+1 470 IF addr% MOD 8=0 THEN addr%=addr%+L%-8 480 NEXT Y%:NEXT X% 490 CLOSE #cutout% 500 ENDPROC