Here's a simple hardcopy program for MG pictures on MPS 801 (and compatibles): (
download)
Code: Select all
10 INPUT"FILE";N$
11 INPUT"INVERT N{3 LEFT}";YN$
12 DN=PEEK(186):@LOADN$,DN
13 POKE36879,27:FORT=0TO239:POKE37888+T,0:NEXT
14 IFYN$="Y"THENFORT=4352TO8191:POKET,255-PEEK(T):NEXT
15 OPEN4,4
16 PRINT#4,CHR$(8)
17 FORY=0TO191STEP7
18 P$=""
19 FORX=0TO159
20 P=128+@(X,Y)+2*@(X,Y+1)+4*@(X,Y+2):IFY=189THEN22
21 P=P+8*@(X,Y+3)+16*@(X,Y+4)+32*@(X,Y+5)+64*@(X,Y+6)
22 P$=P$+CHR$(P)
23 NEXT
24 PRINT#4,P$
25 NEXT
26 PRINT#4,CHR$(15)
27 CLOSE4
28 @RETURN
As could be expected, it requires MINIGRAFIK to be loaded and started first. Some explanations:
Line 10: a filename of a valid MG picture file (as, for example, saved by MINIPAINT) is entered. If you mistype the name, the @LOAD command in line 12 won't stop, and the hardcopy prints whatever else there is in memory instead.
Lines 13 and 14: force the loaded screen to B/W (eventually leading to funny results with multi-colour parts of the picture), and optionally invert the picture: you possibly won't want to print just a few white lines on black background.
Lines 15 and 16: open printer channel, set printer to graphics mode
Lines 20 to 22 collect a single graphics column (7 pixels) into a byte with the @() function of MINIGRAFIK. As the height of the graphics mode (192 pixels) is not divisible by 7 without remainder, line 21 is skipped for the last row.
Lines 26 to 28: set printer to text mode again, close printer channel, return VIC to text mode.
It's not especially fast, the aspect ratio most probably is wrong, but it should work.
Greetings,
Michael