8-Bit Software Online Conversion

Cut - Listing

10REM CUT Utility 20REM by M.Bobrowski 3'93 30REM for 8-BS PD 40: 50MODE7:PRINTTAB(8,0)CHR$141"CUT & PA STE UTILITY"TAB(8,1)CHR$141"CUT & PASTE UTILITY"TAB(9,2)"Save Cutout Program" 60PRINT''"Enter screen MODE (0-3 or 4 or 5) ";:REPEAT:M%=GET-48:UNTIL(M%>=0AN DM%<3)ORM%=4ORM%=5:PRINT;M%:step%=-16*(M %=0)-32*(M%=1ORM%=4)-64*(M%=2ORM%=5):IFM %<3 A$=" 3000":S%=&3000:L%=&280:H%=16 EL SE A$=" 5800":S%=&5800:L%=&140:H%=32 70INPUT'"From which file to you wish to take a"'"cutout? "screen$ 80INPUT'"Please enter cutout filename ? "cut$ 90MODE M%:OSCLI"LOAD "+screen$+A$ 100PROCgetbox 110PROCsave 120MODE 7:*FX15,1 130PRINT'"Another cut (Y/N) ";:REPEAT: G$=GET$:UNTIL INSTR("YyNn",G$):PRINTG$:I F INSTR("Yy",G$) THEN 50 140END 150: 160DEF PROCgetbox 170x%=480:y%=576:xsize%=128:ysize%=128 180REPEAT 190IF INKEY(-1) THEN PROCsize ELSE PRO Cmove 200IF xsize%<step% THEN xsize%=step% 210IF ysize%<step% THEN ysize%=step% 220IF x%<0 THEN x%=0 230IF (x%+xsize%)>1280 THEN x%=1280-xs ize% 240IF (y%-ysize%)<0 THEN y%=ysize% 250IF y%>1024 THEN y%=1024 260PROCbox:PROCbox 270UNTIL INKEY(-106) 280xpos%=x%/H%:ypos%=256-(y%/4) 290offset%=S%+(xpos%*8)+L%*(ypos%DIV 8 )+(ypos% MOD 8) 300ENDPROC 310: 320DEF PROCmove 330IF INKEY(-98) THEN x%=x%-step% 340IF INKEY(-67) THEN x%=x%+step% 350IF INKEY(-73) THEN y%=y%+4 360IF INKEY(-105) THEN y%=y%-4 370ENDPROC 380: 390DEF PROCsize 400IF INKEY(-98) THEN xsize%=xsize%-st ep% 410IF INKEY(-67) THEN xsize%=xsize%+st ep% 420IF INKEY(-73) THEN ysize%=ysize%-4 430IF INKEY(-105) THEN ysize%=ysize%+4 440ENDPROC 450: 460DEF PROCbox 470MOVE x%,y%:PLOT 6,x%+xsize%,y%:PLOT 6,x%+xsize%,y%-ysize%:PLOT 6,x%,y%-ysiz e%:PLOT 6,x%,y% 480ENDPROC 490: 500DEF PROCsave 510cutout%=OPENOUT("C."+cut$) 520BPUT# cutout%,xsize% MOD 256:BPUT# cutout%,xsize% DIV 256 530BPUT# cutout%,ysize% MOD 256:BPUT# cutout%,ysize% DIV 256 540FOR X%=1 TO xsize%/H% 550addr%=offset%+8*(X%-1) 560FOR Y%=1 TO ysize%/4 570BPUT# cutout%,?addr% 580addr%=addr%+1 590IF addr% MOD 8=0 THEN addr%=addr%+L %-8 600NEXT Y%:NEXT X% 610CLOSE #cutout% 620VDU7 630ENDPROC