Neither PR# nor IN# commands in Applesoft and Integer Basic initialize the Parallel Interface. This situation can cause problems if you need to modify the parameters of the interface for your application.
The ROM on the Parallel Interface card, upon receiving the first character, sets all parameters to their default settings. After you POKE the parameter you want, the first character you send causes the ROM to overwrite all the parameter locations you have set up.
To correct this, send a character through the card and then change the parameter locations by means of the following POKEs. (Please refer to the Parallel Interface Card manual for additional information about what each POKE does.)
Replace all occurrences of "s" in the BASIC program below with the number of the slot the Parallel Interface Card is plugged into.
10 POKE 1400+s,80 carriage width
20 POKE 1656+s,0 character counter
30 POKE 1784+s,137 set command prefix to CTRL-I
40 POKE 1912+s,0 no video, no linefeed
or ,1 no video, enable linefeed
or ,128 enable video, no linefeed
or ,129 enable video, enable linefeed
The next list of POKEs replace the PR# and IN# commands and they must be used to benefit from the previous POKEs. Use "Call 1002" to execute DOS commands while the interface is enabled. However, if speed is of the essence, use the "Call 1002" after the data transfer has been made since DOS slows down I/O. All of these POKEs must be on one command line separated by colons to work in command mode; in a program, they may have separate line numbers.
50 POKE 54,2 PR#s
60 POKE 55,192+s
70 Call 1002
The normal way to reset the I/O back to the Apple video and keyboard is:
900 D$ = CHR$ (4): Rem CTRL-D
910 Print D$;"PR#0"
920 Print D$;"IN#0"
This only works after a Print and it is ignored after a Get or Print terminated with a comma or semicolon.
To avoid entering an extra Print statement, you can use the following:
900 Call -375 : Rem this is IN#0
910 Call -365 : Rem this is PR#0
920 Call 1002 : Rem this reconnects DOS
Tthe Parallel Printer Interface Card can echo characters to the Apple's video output, disable the video out while printing lines more that 40 characters long. Please refer to the Parallal Printer Interface manual for more information on what each POKE does.
Article Change History:
19 Nov 1996 - Reviewed for technical accuracy, revised formatting.