10REM Mode 0 Portrait Dump (Dark)
20REM after W.Trevelyan
30REM by M.Bobrowski 5'94
40:
45MODE0
50x=&70:z=&72:pix=&74:count=&75
60octet=&76:y=&7E:flag=&80
70osword=&FFF1:oswrch=&FFEE:osbyte=&F
FF4
80FOR pass=0 TO 2 STEP 2
90P%=&900
100[OPT pass
110LDA #26:JSR oswrch
120LDA #3:LDX #10:JSR osbyte ½ output
to printer
130LDA #0:STA flag
140.begin
150LDA #252:STA y
160LDA #3:STA y+1 ½ Y=1020
170.newline
180LDA #0:STA x:STA x+1 ½ X=0
190.bit
200JSR esc
210LDA #90:JSR oswrch
220LDA #128:JSR oswrch
230LDA #7:JSR oswrch ½ 1920 dots per l
ine
240.start
250LDA #4:STA count
260LDA y:STA z:LDA y+1:STA z+1
270.readpix
280LDX #&70:LDY #0:LDA #9
290JSR osword ½ logical colour return
ed in &74
300LDA pix:AND #7:TAY ½ logical colou
r used as index to pattern
310.byte
320LDX #0
330LDA pattern,Y
340.loop1
350LSR A:ROL octet,X
360LSR A:ROL octet,X ½ 2 bits transfe
rred from pattern to each byte in turn
370INX:CPX #3
380BNE loop1
390.loop2
400DEC count
410BEQ print
420SEC:LDA z:SBC #4:STA z
430BCS carryset:DEC z+1
440.carryset
450JMP readpix
460.print
470LDX #0
480.loop3
490LDA octet,X:JSR oswrch
500INX:CPX #3:BNE loop3
510½ increase X
520CLC:LDA x:ADC #2:STA x
530LDA x+1:ADC #0:STA x+1
540CMP #5 ½ end of line? (X=1280)
550BNE start
560LDA flag:EOR #255:STA flag ½ toggl
e flag
570BEQ nextline ½ if flag=0 go to nex
t line
580JSR esc ½ if flag=-1 print again t
he same line
590LDA #51:JSR oswrch
600LDA #1:JSR oswrch
610LDA #13:JSR oswrch
620JMP newline
630.nextline
640JSR spacing
650½ go down 4 pixels
660SEC:LDA y:SBC #16:STA y
670LDA y+1:SBC #0:STA y+1
680BCC end ½ finish when Y=0
690JMP newline ½ otherwise continue
700.end
710LDA #7:JSR oswrch ½ beep
720JSR esc
730LDA #64:JSR oswrch ½ return printe
r to default setting
740LDA #3:LDX #0:JMP osbyte ½ output
to screen
750.esc
760LDA #27:JMP oswrch
770.spacing
780JSR esc
790LDA #51:JSR oswrch
800LDA #23:JSR oswrch
810LDA #13:JMP oswrch
820.pattern
830EQUD &FFFFFF00:EQUD &FFFFFF00
840]
850NEXT pass
860PRINT'"To save code press COPY ";:R
EPEAT UNTIL INKEY-106:PRINT
870OSCLI"SA.SDump0D 900 "+STR$÷P%
880END