Full Screen Dump on Your 2040 Printer

Author(s): Syd Wyncoop
Publication: The Plotter
Pub Details: The Plotter v4 n11 (Volume 4, Issue 11)
Date: November 1986
Pages: 5

Have you ever wished you could copy a full screen to your 2040 printer? I have.

It is not very difficult to generate print on the lower screen however, the ROM copy routine only dumps the first 22 lines to the printer. As I have created many worls of art that I wished to save, I have found the copy command very unsatisfactory.

The fix is simple. The full disassembly is in figure 1 and is almost an exact copy of the ROM routine. If you have HOT-Z, you can save some typing by copying the routine from 2562 (0A02h) to 2592 (0A20h) and patching it. Otherwise, you will need to enter the entire hex dump in figure 2. If you are using the Aerco disc drive, you need only POKE 2564,192 and you are in business! (you must be in bank switched RAM, i.e. OUT 244,1).

The new routine can be located anywhere you can find 37 unused bytes. It is called with a RANDOMIZE USR address where address is the location of the first byte in our new routine.

You can also copy only a portion of the screen by adjusting the number at your address plus 2 (the third byte of the routine). The number should be evenly divisable by eight to avoid problems as it is only convenient to copy full character lines with this routine.

For those of you you who understand machine code, the LD HL, 4000h instruction can be replaced with a JP 0A05h. For the rest of us, I have included the full annotated routine. That’s enough explanation, here it is….

Figure 1

;************************
;* *
;* Revised Copy Command *
;* *
;************************
;
copy_line equ 0A4Ah
;
Org equ ????? ;????? = your address
;
Enter DI ;we prefer no
;interruptions
LD B, C0h ;# of pixel lines to
;copy
LD HL, 4000h ;start of display
;file
Loop PUSH HL ;save them
PUSH BC ; CALL copy_line
;send pixel line to
;printer
POP BC ;retrieve line # and
POP HL ;d_file address
INC H ;update d-file
;address and
LD A,H ;check if in same
AND 07 ;third of screen
JR NZ,NxtLn ;loop back if so
LD A,L ;else update address
ADD A,20h ;to next character
LD L,A ;line or next third
;of screen
CCF ;check if left last
SBC A,A ;third of screen
AND F8h ;A=F8h or 00h
ADD A,H ;complete updating
LD H,A ;of address
NxtLn DJNX,Loop ;loop until B lines
;are copied
LD A,04 ;turn off printer
OUT (FBh),A ;motor
EI ;now accepting
;interruptions
RET ;done, return to
;Basic

Figure 2

Hex Dump

F3 06 C0 21 00 40 E5 C5
CD 4A 0A C1 E1 24 7C E6
07 20 0A 7D C6 20 6F 3F
9F E6 F8 84 67 10 E7 3E
04 D3 FB FB CD

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.