Classic Computer Magazine Archive COMPUTE! ISSUE 73 / JUNE 1986 / PAGE 112

INSIGHT: Atari

Bill Wilkinson

Atari Printer Trivia

This month's COMPUTE! is a printer issue, so I decided to break with (my) tradition and write a column on printers. Before we start, though, an erratum: My April column listed a program designed to "unify" a machine language file on disk. But when I sent the column to COMPUTE!, I accidentally included a couple of older versions of the program on the same disk. Guess which version got published? Anyway, COMPUTE! listed a corrected version in the article entitled "Custom Characters for Atari SpeedScript" in the May issue. (By coincidence, it happens that my program is needed to unify the COMPUTE! DISK version of SpeedScript before installing a custom character set.) On to the printers.

Number, Please
John Skruch at Atari gets credit for revealing this first tidbit. You are all aware that disk drives can be assigned device numbers (from D1: to D8:, though Atari drives can only go to D4:), but did you know that printers can have numbers, also? If you have an 800XL, 65XE, or 130XE, you may connect two or more printers at the same time and direct output to one or the other. From BASIC, for example, it's as simple as typing

LIST "P2:"

or

LIST "P5:"

    Two major drawbacks: all printers still respond as P1:, so using P1: or just P: when two printers are attached leads to humorous and/or disastrous results. Since many programs always address printers as P:, this trick may be useful only in your own programs. Also, only the following printers have these secondary numbers:


Printer
Secondary
Number
850
P2:
1025
P3:
1020
P4:
1027
P5:
1029
P6:

 (The 850 refers to any printer attached via an 850 Interface Module. The 1029 printer is rare in the U.S.)
    The fact that the 850 can handle different printer numbers indicates that provision for this feature was included as far back as 1979 (when the 850 was first made). Do you wonder why nothing was said sooner? Why don't the 400, 800, and 1200XL work with multiple printers? Do any other interface modules (from third-party vendors) have secondary device numbers? A prize for the best answer.

The Nine-Minute Nap
If you have a 1027 printer which is not lucky enough to be hooked up to an XE computer, you've probably experienced the infamous sleeping printer bug. Sometimes the 1027 just suddenly stops printing. Many people believe they need to reboot their system to wake the printer up. Actually, after about nine minutes, the printer just as suddenly springs to life again. The reasons for this are too strange and lengthy to go into here. Suffice it to say that the problem has existed since the first Atari computer was built and is related to the (also infamous) sleeping disk drive phenomenon-though the drive only sleeps about five seconds. You'll be pleased to know that Atari's newest operating system ROMs in the XE computers finally fix the problem.
    If you do have a 1027, but don't have an XE, and still want to fix this problem, type in, save, and run the accompanying program. It automatically seeks out the LOMEM value for your system and then creates an AUTORUN.SYS file to patch the timeout problem. The AUTORUN.SYS file will load at that LOMEM point and then move LOMEM above itself. Since it reads the current LOMEM, be sure to create the AUTORUN.SYS file on the same disk, booted in the same fashion, that you later want to use. This means, for example, that any special drivers (RAM disk, RS-232, and so on) must be installed before you run this BASIC program.
    For a more specific example, let's say you intend to use the 850's R: driver with AtariWriter and the 1027. You must start by booting the 850's AUTORUN.SYS file to install the R: driver in memory, then run the program below.
    Also, if you have true doubledensity drives (not "enhanced density" 1050s), boot with double density disks inserted. This patch should work with almost any DOS, such as DOS XL, SpartaDOS, DOS 2.5, or whatever-but I wasn't able to test them all.
    Two final points: If an AUTORUN.SYS file already exists on the disk when this program is run, the 1027 patch is appended to that file. Again, using the 850 as an example, this means you'll have a single file which serves two purposes: It boots the R: driver and makes the 1027 patch. Finally, line 170 of the listing is a REMark; if you delete the REM to enable this line, it reserves two pages (512 bytes) of extra memory. If you have any trouble running this patch, try deleting the REM. For instance, if your system has more than one disk drive, you might want to make this change.
    Obviously, I did not develop this program by arbitrarily typing in funny numbers for my DATA statements. I started with a program written by Joe Miller (formerly of Atari), then fixed it so that it survives SYSTEM RESET, is relocatable, moves LOMEM if appropriate, and does not install itself twice. If you're interested in studying the source code for this program, you can download it from CompuServe. Look in the Atari eight-bit SIG's. DL (DownLoad) section under utiities. The filename is P1027.FIX, and it's a document (ASCII) file.


1027 Printer Timeout Fixer

DD 140 REM first, find where
        LOMEM is now
KA 150 LOPAGE-PEEK(744)
BH 160 IF PEEK(743)<>0 THEN
       LOPAGE-LOPAGE+1
NJ 170 REM (see text) LOPAGE
       =LOPAGE+2
DG 180 MODE=B:TRAP 200
PM 190 OPEN #3,4,0,"D:AUTORU
       N.SYS":MODE=9
FO 260 CLOSE #3
GB 210 OPEN #3,MODE,0,"D2:AU
       TOTEST"
FE 220 IF MODE=0 THEN PUT #3
       ,255:PUT #3,255
DO 230 READ BYTE:IF BYTE<-1
       THEN 300
EM 240 IF BYTE=-1 THEN BYTE=
       LOPAGE
EO 250 PUT #3,BYTE:GOTO 230
BK 290 REM (all data in file
       )
FP 300 CLOSE #3
GL 310 END
JD 890 DATA
CC 900 DATA 163,49,208,19,10
       4,133,49,140
ND 910 DATA 81,-1,160,1,24,1
       77,50,161
FD 920 DATA 49,105,0,72,172,
       81,-1,76
DJ 930 DATA 80,-1,8,120,162,
       0,160,-1
BS 940 DATA 236,12,2,208,3,2
       04,13,2
NF 950 DATA 240,18,173,12,2,
       141,24,-1
ND 960 DATA 173,13,2,141,23,
       -1,142,12
NK 970 DATA 2,140,13,2,40,32
       ,86,-1
KH 980 DATA 160,-1,204,232,2
       ,144,9,200
HM 990 DATA 140,232,2,169,0,
       141,231,2
EK 1000 DATA 96
NA 1005 DATA 0,64,33,64
AL 1010 DATA 169,-1,203,232,
        2,144,26,208
MD 1020 DATA 3,173,231,2,208
        ,21,32,26
ML 1030 DATA -1,163,12,141,6
        2,-1,165,13
DC 1040 DATA 141,63,-1,169,2
        6,133,12,169
CN 1050 DATA -1,133,13,96
PA 1060 DATA 226,2,227,2,0,6
        4
PD 1070 DATA -9999