5MODE1
6*LO. FIN
10REM All-mode dump
20REM for Epson/Epson compatible prin
ters
30REM by George Hill
40REM (c) Acorn User Sept. 1983
50:
60DIM S% &FF
70passnumber=S%
80pattern0=S%+1
90!pattern0=&0300
100pattern4=S%+3
110!pattern4=&3F00
120pattern1=S%+5
130!pattern1=&3F260400
140pattern2=S%+9
150!pattern2=&49841000
160!(pattern2+4)=&FF6FB966
170S%=S%+17
180PROClimits
190IF NOT graphics THEN PRINT"Not a gr
aphics MODE. Can't dump.":VDU7:END
200PROCassemble
210REM enable printer, set linefeed (E
SC A B)
220VDU2,1,27,1,65,1,8
230REM clear paper
240VDU1,10,1,10,1,10
250FOR Y%=1023 TO 0 STEP -16
260REM send bit code (ESC L 192 3 - 96
0 dots per line, 640 dots for mode 0)
270VDU1,27,1,76,1,n1,1,n2
280FOR X%=0 TO 1279 STEP stepsize
290!Xlo=X%+Y%*&10000
300?pass=0
310CALL pixel
320NEXT
330VDU1,10
340NEXT
350REM reset linefeed & disable printe
r
360VDU1,27,1,65,1,12,1,12,3
370END
380DEFPROClimits
390DIM user 3
400A%=&87
410!user=USR(&FFF4)
420mode=user?2
430IF mode>5 OR mode=3 THEN graphics=F
ALSE ELSE graphics=TRUE
440IF mode=0 THEN n1=128:n2=2 ELSE n1=
192:n2=3
450IF mode=0 THEN stepsize=2:?passnumb
er=1:?&80=pattern0 MOD 256:?&81=pattern0
DIV 256
460IF mode=4 THEN stepsize=4:?passnumb
er=3:?&80=pattern4 MOD 256:?&81=pattern4
DIV 256
470IF mode=1 OR mode=5 THEN stepsize=4
:?passnumber=3:?&80=pattern1 MOD 256:?&8
1=pattern1 DIV 256
480IF mode=2 THEN stepsize=8:?passnumb
er=6:?&80=pattern2 MOD 256:?&81=pattern2
DIV 256
490ENDPROC
500DEFPROCassemble
510osword=&FFF1
520oswrch=&FFEE
530Xlo=S%
540Xhi=S%+1
550Ylo=S%+2
560Yhi=S%+3
570value=S%+4
580byte=S%+5
590pass=S%+6
600count4=S%+7
610S%=S%+8
620FOR opt=0 TO 2 STEP 2
630P%=S%
640[OPT opt
650½ Subroutines
660½ to calculate POINT(X,Y)
670.point
680LDX #Xlo MOD 256
690LDY #Xlo DIV 256
700LDA #9
710JSR osword
720RTS
730½ to print a character
740.printchar
750LDA #1
760JSR oswrch
770LDA byte
780JSR oswrch
790RTS
800½ to decrement Y by 4
810.decy4
820SEC
830LDA Ylo
840SBC #4
850STA Ylo
860BCC decYhi
870RTS
880.decYhi
890DEC Yhi
900RTS
910½ increment Y by 16
920.incy16
930CLC
940LDA Ylo
950ADC #16
960STA Ylo
970BCS incYhi
980RTS
990.incYhi
1000INC Yhi
1010RTS
1020½ to rotate in two bits. Enter wit
h X=pass, Y=colour.
1030.twobits
1040LDA (&80),Y
1050CPX #0
1060BEQ rotatein
1070.rotateout
1080ROR A
1090ROR A
1100DEX
1110BNE rotateout
1120.rotatein
1130ROR A
1140ROL byte
1150ROR A
1160ROL byte
1170RTS
1180½ to calculate a whole byte
1190.onebyte
1200JSR point
1210LDY value
1220LDA pass
1230AND #3
1240TAX
1250JSR twobits
1260JSR decy4
1270DEC count4
1280BNE onebyte
1290JSR printchar
1300RTS
1310½ Main program
1320½ to calculate and print the patter
n for one pixel
1330.pixel
1340LDA #4
1350STA count4
1360JSR onebyte
1370JSR incy16
1380INC pass
1390LDA pass
1400CMP passnumber
1410BNE pixel
1420RTS
1430]
1440NEXT
1450ENDPROC