8-Bit Software Online Conversion
Paste - Listing
10REM PASTE Utility
20REM by M.Bobrowski 3'93
30REM for 8-BS PD
40:
50MODE7:OSCLI"*CAT":REM MODE7:*CAT C
: REM for DFS users:REM MODE7:*CAT onl
y
60V%=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 w
ish to load"
70INPUT""F$:VDU28,0,24,39,4
80PRINT'"Enter screen MODE (0-3 or 4
or 5) ";:REPEAT:M%=GET-48:UNTIL(M%>=0AND
M%<3)ORM%=4ORM%=5:PRINT;M%:step%=-16*(M%
=0)-32*(M%=1ORM%=4)-64*(M%=2ORM%=5)
90IFM%<3 A$=" 3000":S%=&3000:L%=&280:
H%=16:B$=A$+"+5000 FFFF3000 FFFF3000" EL
SE A$=" 5800":S%=&5800:L%=&140:H%=32:B$=
A$+"+2800 FFFF5800 FFFF5800"
100PRINT'"Do you wish to load a backgr
ound screen as well (Y/N) ";:B%=INSTR("N
nYy",GET$)DIV3:IF B%=0 PRINT"No" ELSE PR
INT"Yes":INPUT'"Enter its filename : "L$
110INPUT'"Enter a name for the screen
file to be"'"saved : "S$
120MODE M%:VDU23;8202;0;0;0;:IF B% OSC
LI"L."+L$+A$
130cutout%=OPENIN("C."+F$)
140xsize%=(BGET# cutout%+256*BGET #cut
out%)
150ysize%=(BGET# cutout%+256*BGET #cut
out%)
160:
170xo%=0:yo%=1024:x%=xo%:y%=yo%
180GCOL4,0:MOVE x%,y%:DRAW x%+xsize%,y
%:DRAW x%+xsize%,y%-ysize%:DRAW x%,y%-ys
ize%:DRAW x%,y%
190REPEAT:PROCcheck`keys:PROCmove:UNTI
L INKEY(-106):*FX15,1
200xpos%=x%/H%:ypos%=256-(y%/4)
210offset%=S%+(xpos%*8)+L%*(ypos%DIV 8
)+(ypos% MOD 8)
220MOVE x%,y%:DRAW x%+xsize%,y%:DRAW x
%+xsize%,y%-ysize%:DRAW x%,y%-ysize%:DRA
W x%,y%
230GCOL0,7
240PROCload`cutout
250VDU30:IF S$<>"" THEN OSCLI"SA."+S$+
B$
260END
270:
280DEF PROCcheck`keys:move%=FALSE:*FX2
1,0
290IF INKEY-73 AND y%<=1024 y%=y%+4-(I
NKEY-1)*28:move%=TRUE
300IF INKEY-105 AND y%>=ysize% y%=y%-4
+(INKEY-1)*28:move%=TRUE
310IF INKEY-98 AND x%>=0 x%=x%-step%:m
ove%=TRUE
320IF INKEY-67 AND x%<=1280-xsize% x%=
x%+step%:move%=TRUE
330ENDPROC
340:
350DEF PROCmove:IF NOT move% ENDPROC
360MOVE xo%,yo%:DRAW xo%+xsize%,yo%:DR
AW xo%+xsize%,yo%-ysize%:DRAW xo%,yo%-ys
ize%:DRAW xo%,yo%
370MOVE x%,y%:DRAW x%+xsize%,y%:DRAW x
%+xsize%,y%-ysize%:DRAW x%,y%-ysize%:DRA
W x%,y%
380xo%=x%:yo%=y%
390ENDPROC
400:
410DEF PROCload`cutout
420FOR X%=1 TO xsize%/H%
430addr%=offset%+8*(X%-1)
440FOR Y%=1 TO ysize%/4
450?addr%=BGET# cutout%
460addr%=addr%+1
470IF addr% MOD 8=0 THEN addr%=addr%+L
%-8
480NEXT Y%:NEXT X%
490CLOSE #cutout%
500ENDPROC