********* Welcome to Project 64! The goal of Project 64 is to preserve Commodore 64 related documents in electronic text format that might otherwise cease to exist with the rapid advancement of computer technology and declining interest in 8- bit computers on the part of the general population. If you would like to help by converting C64 related hardcopy documents to electronic texts please contact the manager of Project 64, Cris Berneburg, at 74171.2136@compuserve.com. Extensive efforts were made to preserve the contents of the original document. However, certain portions, such as diagrams, program listings, and indexes may have been either altered or sacrificed due to the limitations of plain vanilla text. Diagrams may have been eliminated where ASCII-art was not feasible. Program listings may be missing display codes where substitutions were not possible. Tables of contents and indexes may have been changed from page number references to section number references. Please accept our apologies for these limitations, alterations, and possible omissions. Document names are limited to the 8.3 file convention of DOS. The first characters of the file name are an abbreviation of the original document name. The version number of the etext follows next. After that a letter may appear to indicate the particular source of the document. Finally, the document is given a .TXT extension. The author(s) of the original document and members of Project 64 make no representations about the accuracy or suitability of this material for any purpose. This etext is provided "as-is". Please refer to the warantee of the original document, if any, that may included in this etext. No other warantees, express or implied, are made to you as to the etext or any medium it may be on. Neither the author(s) nor the members of Project 64 will assume liability for damages either from the direct or indirect use of this etext or from the distribution of or modification to this etext. ********* The Project 64 etext of the W&T Parallel-Interface manual. Converted to etext by by "Frank" Jeno E. Kontros , the Non Stop Cracker. WTPARA10.TXT, September 1996, etext #75. ********* W & T INTERFACES EAN 40 10344 92000 7 ---------------------------------------------------------------- C64/C128 Parallel-Interface ---------------------------------------------------------------- For: BMC, Brother, Centronics, Copal, CTI, Epson, Itoh, Mannesmann, Microscan, NEC, Oki, Panasonic, Quen Data, Robotron, Sakata, SCM Seikosha, Siber Kikai, Star, ...(trademarks) Manual --------------------------------------------------------------- INSTRUCTIONS - C64/PARALLEL INTERFACE Type 92008/G 1. FUNCTION The C64/Parallel printer interface model 92008/G was designed to connect almost any parallel printer to your VIC 20 or C64 computer (CBM, VIC 20 and C64 are trademarks of Commodore Business Machines International). The 92008/G will also operate with the C16, Plus 4 and C128. Together with most types of printers, the interface will be fully compatible with the CBM printer MPS 801. Other printer types (e.g. daisy wheel printers or printers that do not have graphics capability or have an unusual kind of graphics) will be able to print all ASCII characters and all printer functions will be available. It is necessary for the connected printer to have an interface to the Centronics standard. Most printers are offered with this interface as the principal, lowest cost, option. As the printer will not be modified it can be used with its original Centronics interface at any time. Thus if you change your computer system later you will be able to keep your printer and connect it to the other computer by simply changing the interface/cable. 2. SET UP As different printer types need different commands, the interface must know which kind of printer is connected in order to supply the correct commands. For this reason we have provided small switches, hidden inside of the interface in order to prevent them from being accidentally changed. These switches have to be configured once for your particular type of printer. 2.1. Opening the interface The interface must not be connected to the printer or the computer while it is being opened. a. The housing of the interface is held by four clips. One after the other must be lifted carefully and the two parts of the housing disengaged. Be careful not to break the clips! Do not use any tools! b. Afterwards the top cover can be easily removed. c. The PC board inside the interface can easily be removed from the bottom part of the housing. d. You will find 8 small switches on the component side of the PC board. Each switch is numbered and one position of the switches is marked "ON". The other position is the "OFF" position. e. Please configure the switches according to the table below (check your printer type and look for the correct switch setting). * The function of switch S1 is described under f. in this section. You should set switch S1 to "ON" initially. S7 does not have any function S8 is described under g. The following table shows how to switch the interface to various printer types. In the right hand column you will find whether this particular printer will be able to print the entire special character set of CBM and make screen dumps and so on. Only printers that are marked "full" in this column will be able to do print all ASCII characters and perform all normal printer functions. Switch # 1 2 3 4 5 6 compatible ----------------------------------------------------------------- BMC BX80 * ON ON OFF OFF OFF full BMC BX100 * OFF ON OFF OFF OFF full Brother HR5, HR10, HR15 * OFF OFF OFF OFF OFF partly Brother HR 25 * OFF OFF OFF OFF OFF partly Brother M1009 * OFF ON OFF OFF OFF full Centronics 150, 154, 7xx * OFF OFF OFF OFF OFF partly Centronics GLP * OFF ON OFF OFF OFF full Copal SC1000, SC1200 * OFF ON OFF OFF OFF full CTI CP80, CPA80 * ON ON OFF OFF OFF full Epson MX80, MX82, RX80 * OFF ON OFF OFF OFF full Epson FX80 * OFF ON OFF OFF OFF full Itoh 1550, 8510, 8600 * ON OFF ON OFF OFF full Inforunner Riteman * OFF ON OFF OFF OFF full Juki 6100 * OFF OFF OFF OFF OFF partly KG DP165 * OFF ON OFF OFF OFF full Mannesmann MT80 * ON ON OFF OFF OFF full Microscan MS15 * OFF OFF OFF OFF OFF partly NEC 8023 * OFF OFF ON OFF OFF full NEC P2, P3 * ON OFF ON OFF OFF full NEC Spinwriter * OFF OFF OFF OFF OFF partly Oki 80, 82, 83 * OFF OFF OFF OFF OFF partly Oki 84 * OFF OFF OFF ON OFF full Oki 92, 93 * ON OFF OFF ON OFF full Panasonic KX-P1090 * OFF ON OFF OFF OFF full Panasonic KX-P1091 * OFF ON OFF OFF OFF full Quen Data DMP1100,DMP1180 * ON ON OFF OFF OFF full Rikadenki Plotter * OFF OFF OFF OFF OFF - Robotron K6311, K6312 * OFF OFF OFF OFF OFF partly Sakata SP1000, SP1200 * OFF ON OFF OFF OFF full SCM D100 * OFF ON OFF OFF OFF full SCM Fastext 80 * ON OFF OFF OFF ON full Seikosha GP700 * OFF OFF OFF OFF ON full Siber Kikai SP80 * ON ON OFF OFF OFF full Silver Reed EXP400 * OFF OFF OFF OFF OFF partly Speedy 80 * ON ON OFF OFF OFF full Star Gemini, Delta, Radix * OFF ON OFF OFF OFF full As new models of printers appear at frequent intervals and "old" printers are often modified, we reserve the right to change this table at any time without notice. If your printer model is not included in the above table, please check whether it is compatible with one of the printers listed and try to use this switch setting. You may have to experiment with some settings - you cannot damage anything if you choose a wrong setting. f. * Switch S1 is used to select the device number of the interface. If switch S1 = ON the device number is 4, if it is OFF the number is 5. The function of device numbers will be explained later in this manual. You should set switch S1 to "ON" initially. g. Switch S8 = ON selects "Auto Line Feed" functions with some printers. This is the standard selection when using this interface. (For those who are technically interested: S8 = ON will connect pin 14 of the Centronics interface to ground. Some printers recognize this as "External Auto Line Feed On".) 2.2. Closing the interface After the switches have been set correctly the interface can be closed again. Be sure that the cable to the computer leaves the interface at the rear end of the housing. The top part of the housing can be simply plugged into the bottom. Do not force the two parts together! If it will not fit easily, you are doing something wrong. 2.3. Printer set up Before you use your printer the first time, you must be sure that it is switched to "Auto Line Feed" mode. Please check how your printer can be switched to this mode. Some printer manufacturers call this mode "AUTO FEED XT signal... fixed", others use "Function of CR code: CR + LF" or "Auto Line Feed = ON". Please refer to your printer's manual. In case a program has a superfluous line feed, disconnect Pin 14 of the Centronics plug. Be sure that the printer is switched off before you change any switch settings. Most printers will ignore the change of a switch until they are powered up with this new setting. 3. CONNECTIONS Before connecting anything, be sure that all devices are OFF! 3.1. Connecting the interface to the computer 3.1.1. If you don't use a disk drive: The small round plug on the cable coming from the rear of the interface must be plugged into the serial output of the computer. 3.1.2. If you are using one or more disk drives: The small round plug on the cable coming from the rear of the interface must be plugged into the free socket on your last disk drive. 3.2. Connecting the interface to the printer The interface can simply be plugged into the Centronics input of your printer. The interface can be secured by using the metal snaps on either side of the connector. 3.3. Power Supplies The interface can take its power from any one of three sources, as follows: 3.3.1. Pin 18 of the printer Many printers, but not all, provide a +5 volt supply on Pin 18 of the Centronics connector. If your printer provides this supply (please check your printer manual) it is not necessary to plug anything into the small jack socket on the side of the interface. Simply connect to the computer and printer as described above. 3.2.2. Cassette port On the VIC 20, Commodore 64 and Commodore 128 the cassette port takes the form of a small edge connector. A small lead is supplied with the interface which plugs into the 2.5mm jack socket on the side of the interface box and onto the cassette port edge connector. The small printed circuit board attached to this edge connector socket allows the cassette unit to be connected as well. Both connectors are polarized and will fit only one way round. Don't force them in. Be sure the computer is switched off before connecting anything. 3.3.3. External power supply If the interface is to be used with either a C16 or Plus 4 computer and the printer does not provide a 5 volt supply it will be necessary to plug an external +5 volt regulated supply into the jack socket on the interface. FCC Systems Ltd Part No 030/002 is suitable. NOTES: Most power supplies of the 'plug-in adapter' type supply an unregulated voltage of (nominally) 9 volts. Such devices MUST NOT be connected to the 92008/G interface under any circumstances. Inserting the 2.5mm jack plug in the socket on the interface automatically disconnects the 5 volt supply from the printer if this is present on Pin 18 of the Centronics connector. 3.4. Initial Check To be sure that everything is OK up to now, you should switch your disk drive, computer and printer on now (in that order). Be sure that your printer is "selected". Most printers have a light labeled "SELECT", "SEL", "PRINT ON" or "ON-LINE". This light must be on at any time you are using your printer. Please enter the following commands on your computer. Be sure to make each keystroke exactly as shown. Please press these keys one after the other. Explanation O Letter O P Letter P E Letter E N Letter N 1 Number 1 , ,-key 4 Number 4 RETURN The large key labeled "RETURN" P Letter P R Letter R I Letter I N Letter N T Letter T SHIFT-3 First press the SHIFT-key, hold it and press the 3 simultaneously 1 Number 1 , ,-key SHIFT-2 First press the SHIFT-key, hold it and press the 2 simultaneously T Letter T E Letter E S Letter S T Letter T SHIFT-2 First press the SHIFT-key, hold it and press the 2 simultaneously RETURN The large key labeled "RETURN" Now your printer should print "TEST" and the paper should be advanced one line. If this does not work: a. Is there a light on the printer labeled "PAPER EMPTY", "PE", "OUT OF PAPER"? If so you should check whether the paper is inserted properly. b. The light "SELECT", "SEL", "ON LINE" or "PRINT ON" must be on. If it is not, the printer will not do anything. If you cannot switch this on, check whether the printer case is closed and whether the ribbon is installed properly. Some printers do not work until their case is fully closed. c. Be sure that the power supply to the printer is connected properly (see 3.3). d. If your computer responds with "SYNTAX ERROR" you have made a mistake while keying the command in. Try again. If the paper is not advanced one line, the printer is not set to "auto line feed" mode. Check your printer's manual. 4. PRINT COMMANDS All printer functions can be controlled by simple BASIC commands. After each command you must press the "RETURN" key (the large key with this label). The computer uses four different commands to control printer functions: OPEN, CMD, PRINT#, CLOSE 4.1. Open command Function: This command tells the computer that there is a printer connected, which device number it has, what you want to call it and in which mode it is going to work. As the computer needs to know this before you address the printer for the first time, you must use this command once before printing anything. This one command will be valid until you "reset" it using the CLOSE command. The CLOSE command will be described later. An OPEN command may not be repeated unless it has been previously CLOSED. Format: OPEN lfn, dn, mo Explanation: lfn: Logical filenumber. Every time you wish to address the printer in your BASIC program, you will have to tell your computer which device number should get the printer data. For this function you could use the "device number" and tell your computer "send this data to device number 4". This approach will not work! Commodore has decided to use a somewhat indirect method of addressing the devices. The OPEN command will assign a logical filenumber to each device number you are using. Afterwards you must not use the device number any more but use the logical filenumber instead. This logical filenumber can be chosen at random or to your preference between 1 and 255. Thereafter, each time you us the logical filenumber, the computer automatically translates this to the device number that has been assigned in the OPEN command. Thus it is obvious that you can make such an assignment only once. You can't tell your computer "device number 4 is logical number 1" and then say "device number 5 is logical number 1" unless you have reset the first setting (CLOSE command). This way of handling the I/O operations might seem complicated but has a great advantage. You use the (hardware dependent) device number only once in your program (in the OPEN command). Afterwards you always address the peripheral devices by their logical numbers. Thus if you buy another printer and want to redirect the printing data to this new printer, which is to be given device number 5, you will have to change nothing but the OPEN command. dn: Device number. Normally you will use 4 here (as long as you have switch S1 = ON inside the interface). As it is possible to connect several devices simultaneously to one computer, these devices need to be numbered to make them addressable individually. mo: Mode. The interface can work in five operating modes - which differ in their character and command set: 0 = Cursor up mode 1 = Printer original mode 2 = Printer upper/lower case mode 3 = Fix previous mode 4 = Cursor down mode mo = 0 or 7 Cursor up and cursor down modes are special modes in which your printer will be fully or partly CBM compatible (depending on your printer type - see Section 2.1). The commands found in your printer's manual cannot be used in these two modes, instead you can use the special CBM commands described in Section 5.2. Cursor up mode: In this mode you can print capital letters and CBM graphic symbols. You can't use lower case letters. This is the mode which your computer will be in after power on. Cursor down mode: Here you can use upper and lower case letters but not all CBM graphic symbols. This mode is the same as the one into which you can put your computer by pressing "SHIFT -CBM-key" after power on. (CBM-key is the key with the Commodore logo on it) mo = 1 This mode will not change any character codes. Your printer will get all characters exactly the same as they are sent by your computer. You will need this mode if you want to use the commands that appear in your printer's manual (See 5.1). It is not possible to use any special CBM function in this mode, nor can you print lower case letters or CBM graphic symbols. mo = 2 Mode 2 is nearly the same as mode 1 except that the interface will convert upper and lower case characters to normal ASCII codes. mo = 3 Sending at least one character in mode 3 to the interface will fix the mode which was valid immediately prior to mode 3. You can reset this fixed mode only by switching the computer off. After you have fixed one mode, the interface will ignore all subsequent modes and will print anything using this fixed mode. There is one other way to fix operating mode which is described is Section 5.2.7. Examples: OPEN 1,4,0 Device number 4 is assigned to logical filenumber 1 and will work in mode 0 (cursor up). Note. You can omit the 0 - mode number. OPEN 1,4 is the same as OPEN 1,4,0 OPEN 3,4,7 Device number 4 is assigned to logical filenumber 3 and will work in mode 7 Example of how to fix a mode: (suppose you want to fix mode 1) OPEN 1,4,1 Select mode 1 PRINT#1 Print at least one time in mode 1 CLOSE 1 Reset mode 1 OPEN 1,4,3 Fix the previous mode (mode 1) by printing PRINT#1 at least one time in mode 3. CLOSE 1 Reset mode 3 4.2. The CMD command Function: Redirect all output data that normally appear on the screen to the printer instead. Format: CMD lfn Explanation: You must use the logical filenumber (lfn) that has been assigned to the printer in the previous OPEN command. Don't forget the open command! The CMD command can be used to make program listings for example. Once you have directed the output to your printer, you can redirect the output to the screen by using the PRINT# command which will be described in 4.3. Example: How to make a program listing. (Suppose you have already entered the program.) OPEN 1,4,0 CMD 1 Direct data to printer LIST Make program listing PRINT#1 Redirect output to screen CLOSE 1 4.3. The PRINT# command Function: Print any data to the printer in the same way you normally print to the screen. Format: PRINT#lfn, data Explanation: lfn: Logical filenumber - use the one you gave previously assigned in the OPEN command. Don't forget the OPEN command! data:Any data you want to be printed. You can print in the same way as on the screen with one exception. The PRINT TAB(...) command will not work on the printer. You have to use the POS-command instead (see 5.2.7). Examples: OPEN 2,4,7 PRINT#2, "FCC INTERFACE" CLOSE 2 Note: All entries will appear in capital letters on the screen as long as your computer is in cursor up mode but "fcc interface" will be in lower case on the printer. This is due to the mode you have selected in OPEN command (here: mode 7 = cursor down). Thus you can have the printer in cursor up and the computer in the cursor down mode or vice versa. OPEN 2,4,7 PRINT#2, A, B, C CLOSE 2 will print the contents of variables A, B, C. Please find further explanations in your computer's manual (see under "PRINT-command"). 4.4. The CLOSE command Function: After you have used the OPEN command once, you can make any number of print commands (either PRINT# or CMD) but you can't use the OPEN command again if you want to change the mode. You can reset the OPEN command by using CLOSE. Format: CLOSE lfn Explanation: lfn: Logical filenumber. You have to use the logical filenumber of the corresponding OPEN command. There is another reason for using the CLOSE command. Your computer can handle only a limited number of valid OPEN commands at one time. Thus, it might be necessary to reset one OPEN command before you can use a new one. Example: OPEN 1,4,1 PRINT#1, "YOU CAN USE ANY PRINTING DATA" PRINT#1, "ANY NUMBER OF PRINT# COMMANDS" ... CLOSE 1 5. SPECIAL PRINTING COMMANDS 5.1. Use of commands from the printer's manual NOTE: This chapter will be useful to experienced programmers. Normally you will not need these functions and should proceed to Chapter 5.2. You can use all the commands that are found in your printer's manual. Please read the printer manual carefully, as we can tell you only how to use these functions in general. The specific functions depend on your printer and are not described here. In each case you can use the original printer commands only in mode 1 of the interface (OPEN 1,4,1). As the interface passes all codes without any changes in this mode, you can use the commands as they are printed in your manual with some minor changes. Please observe the following rules if you want to use your printer's original functions. a. Don't forget the OPEN 1,4,1 command before sending anything to your printer. b. Some printer manufacturers use LPRINT commands instead of PRINT#1,... . Please replace LPRINT by PRINT#1. c. You should pass all commands (e.g. ESC sequence) only with CHR$(...) commands in order to prevent problems that arise from the fact that CBM does not use ASCII characters in all cases. Example: In your printer's manual you might find the following command in order to switch your printer to emphasized printing. ESC E You can't use this command in this way. Later in the printer's manual you might find as an example: 300 LPRINT CHR$(27);"E";"TEST" Even if this format you can't use it but if you observe the three above rules you will find the following: a. First you have to include the OPEN command 300 OPEN 1,4,1 b. Then you have to change LPRINT to PRINT#1 300 OPEN 1,4,1: PRINT#1 (":" separates two commands in one line) c. All commands should be passed using CHR$(...). O.K. The first argument already uses CHR$(27): 300 OPEN 1,4,1: PRINT#1, CHR$(27); But what to do with "E"? You have to change "E" to the CHR$(...) code that is the ASCII code for "E". You will find that this code is CHR$(69). Therefore: 300 OPEN 1,4,1: PRINT#1, CHR$(27);CHR$(69);"TEST" You don't have to change "TEST" to CHR$(...) codes as this is not a command for the printer but is the effective printing data. Summary: The command: 300 LPRINT CHR$(27);"E";"TEST" which you may find in your printer's manual has to be changed to: 300 OPEN 1,4,1: PRINT#1, CHR$(27);CHR$(69);"TEST" to make it work on computer. 5.2. Use of special CBM commands If you are using only those commands that are described in Section 4 you will be able to perform all usual printing tasks. Additionally the interface offers several special commands that are compatible to CBM printers and that can be used in mode 0 and mode 7 (only!). - Different character sizes - High resolution graphics, CBM compatible - Reverse printing - Print position - And so on... Some of these commands do not work with printers that are marked "partly" compatible in Section 2.1. 5.2.1. Summary of control codes Code How to enter Function the code NL CHR$(10) New line CR CHR$(13) New line BS CHR$(8) Set graphics mode SO CHR$(14) Double width characters and reset graphics mode SI CHR$(15) Single width characters and reset graphics mode POS CHR$(16) Define print character position. ESC CHR$(27) Define print dot position or fix secondary address SUB CHR$(26) Repeat graphic bytes CSDWN CHR$(17) Set cursor down mode CSUP CHR$(145) Set cursor up mode RVSON CHR$(18) Reverse characters on RVSOFF CHR$(146) Reverse characters off 6-DOT CHR$(22) Select 6 dot/character mode 8-DOT CHR$(23) Select 8 dot/character mode 5.2.2. NL and CR code Commodore computers generate a CR code (Carriage Return) at the end of each PRINT command unless the command is terminated with a ";". In order to make the printer perform an automatic line feed (paper feed) on receiving a CR code the printer must be switched to "auto line feed" mode (see Section 2.3). There are three ways to make the printer perform line feeds: a. Make "empty" PRINT#1 commands (no arguments): OPEN 1,4 PRINT#1 CLOSE 1 will generate one line feed b. Use the NL code (CHR$(10)): OPEN 1,4 PRINT#1, CHR$(10) CLOSE 1 will generate two line feeds (one due to CHR$(10) and the other will automatically be generated at the end of the PRINT# command). c. Use the CR code (CHR$(13)): OPEN 1,4 PRINT#1, CHR$(13) CLOSE 1 same as b. There is no difference between b and c. 5.2.3. BS code This code will initialize the graphics mode. Each character that is subsequently sent to the printer and whose code is greater than 127 will be printed as one column of dot graphics. By sending several columns you can generate any graphics pattern. Each dot column will be sent using the CHR$(...) command, whose argument must be calculated in the following way: Significance 1 x x x x of the 2 . x x x printer dots 4 . . x x 8 . . . x 16 . . x x 32 . x x x 64 x x x x constant + 128 1 2 2 2 sum in each column 9 2 4 5 3 7 7 5 The topmost wire in your printer's print head has the significance 1, the wire bellow it is 2, the next 4 and so on. The lowest wire has the significance 64. If you want to print a certain pattern you have to calculate the column sum of those wires that are to be fired to form your pattern. Then you must add 128 to this sum and pass the result in one CHR$(...) command for each column you want to be printed. See the above example. In this case you will have to enter the following command to create the above pattern: PRINT#1, CHR$(8);CHR$(193);CHR$(227);CHR$(247);CHR$(255) Explanation: CHR$(8) Initiate graphics rest four column graphics data Even after you have entered this command the graphics mode is still valid and you won't be able to print any characters. Before you can proceed printing normal characters you have to reset the graphics mode. This can be done by either selecting normal or double width characters. Either: PRINT#1, CHR$(15) or: PRINT#1, CHR$(14) will reset graphics mode. While in graphics mode the line feed width is fixed to 9 lines/inch (as opposed to 6 lines/inch in text mode). With this line feed width the printer will print subsequent graphics lines without any space between them. Thus, you can generate graphics of any size by simply sending several lines of graphics. You will also need this line feed width (9 lines/inch) when you try to create graphics using the CBM graphic symbols (as opposed to dot graphics). In this case you have to send the graphic symbols either in single or double width mode and then switch to graphics mode (CHR$(8)) at the end of your PRINT# command in order to make a 9 line/inch line feed. Then, in the next PRINT# command you have to switch to single or double width again, in order to leave the graphics mode. Example: How to print graphics symbols without spaces between the lines: OPEN 1,4,0 PRINT#1, "..(include graphic symbols here)";CHR$(8) PRINT#1, CHR$(15);"(graphic symbols again)";CHR$(8) PRINT#1, CHR$(15);"(...)";CHR$(8) ... CLOSE 1 5.2.4. SI/SO - Double width/single width characters The command CHR$(14) will select double width for characters sent subsequently. Example: OPEN 1,4 PRINT#1, "SINGLE";CHR$(14);"DOUBLE";CHR$(15);"SINGLE" 5.2.5. RVSON and RVSOFF code The interface allows you to print reverse characters. This mode is selected by sending CHR$(18) and deselected by sending CHR$(146). It is also automatically reset at the end of each line. Example: PRINT#1, "NORMAL";CHR$(18);"REVERSE";CHR$(146);"NORMAL" 5.2.6. POS - Define print character position It is possible to define at which character position within a line subsequent print data is to be printed. After you have sent CHR$(16) the following two digits will define the starting position of subsequent printing data within this PRINT# command. Print positions are numbered from 00 to 79 starting at the left margin of your printer. Example: OPEN 1,4 PRINT#1, CHR$(16);"15TEST" will result in: 111111111122222222223333333333* 0123456789012345678901234567890123456789* TEST * These numbers are not printed on your printer. 5.2.7. ESC - Define print dot position The command CHR$(27);CHR$(16) allows you to define the dot position at which subsequent data is to be printed. As CBM printers have 6 dots/character and 80 characters/line, the dot position must be in the range 0 to 479 (6*80=480). The leftmost position is number 0. Format: CHR$(27);CHR$(16);CHR$(hp);CHR$(lp) Explanation: Dot positions must be entered in binary form with (hp) being the high byte and (lp) being the low byte. Example: You want to print "TEST" starting at dot position 100: 10 OPEN 1,4 20 PRINT#1, CHR$(27);CHR$(16);CHR$(0);CHR$(100);"TEST" 30 CLOSE 1 How to calculate (hp) and (lp): Dot positions between 0 and 255 will be passed simply in (lp) with the (hp) being 0 (see example above). Dot positions that are between 256 and 479 will be passed with (hp) = 1 and (lp) must be the difference between dot position and 256. Example: Dot position 258: as 258 is more than 255, we must set (hp) to 1 and calculate (lp): (lp) = 258 -256 = 2 therefore: PRINT#1, CHR$(27);CHR$(16);CHR$(1);CHR$(2) 5.2.8. SUB - Repetition of graphics data By using CHR$(26) you can repeat any graphics code up to 256 times. Format: CHR$(26);CHR$(repetition);CHR$(code) Explanation: (code) is the graphics code that is to be repeated (repetition) times. Example: 10 OPEN 1,4 20 PRINT#1, CHR$(8);CHR$(26);CHR$(20);CHR$(255) 30 CLOSE 1 Note: You can use this command only if you have previously selected graphics mode. 5.2.9. CSUP - CURSOR UP mode CHR$(145) allows to select cursor up mode if you have earlier selected cursor down mode by using the OPEN command. CHR$(145) will be effective only for printing data that is sent after this code and it will be automatically reset at the end of PRINT# command. Example: 10 OPEN 1,4,7 20 PRINT#1, CHR$(145);"CURSOR-UP" 30 CLOSE 1 5.2.10. CSDWN - CURSOR DOWN mode CHR$(17) selects cursor down mode if you have previously initialized cursor up mode. See 5.2.9. 5.2.11. 8-DOT and 6-DOT mode This section applies only to some printer types that do not have 480 dots per line. This section is valid only if you have configured the interface in one of the following settings: Switch number 1 2 3 4 5 6 * OFF OFF ON OFF OFF or * ON ON OFF OFF OFF or * ON OFF ON OFF OFF After power on the interface will be in 8 dot mode - i.e. each character is 8 dots wide and one line is 80 characters = 640 dots wide. If you send CHR$(22) you will enter 6 dot mode - i.e. each character is 6 dots wide. Therefore one line will contain more than 80 characters and each character will be smaller than in 8 dot mode. You will be need 6 dot mode if you are using programs that are written for CBM printers and you want to mix text and graphics. By using CHR$(23) you can switch to 8 dot again. 5.2.12. Combinations of print modes You can combine all CBM modes that are described in Section 5.2 even within one line. Depending on your printer type and your application it may not be possible combine original printer functions (Section 5.1) with CBM functions. Additional Information 1. Double Line Feed Some programs generate two line feeds. You can solve this problem by setting S8 = OFF and selecting "No Auto Line Feed" on your printer (see printer manual). 2. Power Supply First, please try to use your interface without connecting the enclosed Cassette Port Cable. If it works, you don't need this cable. 3. Connecting C128 The interface is 100% compatible to C128. Please connect it as described in Chapter 3. 4. Some printers can be switched to Epson- or IBM-character set. Be sure to use only Epson-character set when using the interface. 5. Using Vizawrite and other programs Be sure to fix secondary address 1: OPEN 1,4,1:PRINT#1:CLOSE 1 OPEN 1,4,3:PRINT#1:CLOSE 1 ********* End of the Project 64 etext of the W&T Parallel-Interface manual. *********