/TOC /X 70 /Y 55 /M 5 /L 10 /c *************************** /c * Generic Printer Drivers * /c *************************** /c User's Manual /c Revision 1.0 /l 20 /C Double-D Software Services /c 4924 Chantilly /c Las Vegas, Nevada 89110 /c Dave Drake /c (702) 438-2173 /P /NMB /hl 1 Overview The 'Generic' Printer driver was born when one of my customers wanted to use some of the fancy features of his new printers using AlphaBase. Unfortunately, AlphaBase only allows for defining 4 printer control sequences in its printer definition file. The customer wanted to use more than that. The original driver was written to only translate the 6 or 7 functions that the customer wanted at that time. However, shortly the code was expanded to be able to translate approxiamtely 90 generalized commands. Manuals for dozens of printers were examined and tables of common functions and how they were implemented were built. From this came the 'Standardized' functions that are implemented in Table 1 (see Appendix). Table 2 was designed for implementing color control on those printers that are capable of it. Table 2 has both foreground and background color definitions. Tables 3 and 4 were defined for future expansion (and because there are 4 DCx codes and that seemed like an elegant match). The major enhancement from the initial release is the implementation of 'PX.LIT'. PX (for Printer Xlation) allows the translation that takes place in the drivers to be turned off and back on. This was primarily implemented so that the translation could be turned off when graphics commands were sent to the printer. Graphics characters may have any value, and if the translation is not bypassed, could cause strange output. At the same time, a means of turning the translation off by means of a 'generic' control sequence was implemented. Sending the sequence DC1,DC1 to the printer will turn the translation off. Currently translation can only be turned back on through the use of the PX program. If any one knows of a sure-fire way to do this internally, I would be most happy to hear about it. /p /hl 1 The Future As I stated, these programs were originally written for one of my customers. However, as they grew and became more general purpose, I came to realize the value of the overall concept. Thus I decided to make them available to everyone. Please feel free to use these programs in any way you wish. I place no restrictions on copying or distribution other than you may not charge for their use and you always include the source code. You may include them with any software package that you sell and distribute as long as you include the source code. However, I would not reject any offers of appreciation that are freely given. If you make a driver for a printer not previously supported, please upload it to the AMUS network, or send me the source and I will upload it. Hopefully, in the future AlphaMicro will address this problem and come up with a more elegant solution. But until then...... If you have any comments or suggestions, please contact me. /p /hl 1 AMUS Article /c Text of article printed in September 1987 AMUS.LOG Near the beginning, there were only hardcopy terminals. A little later, someone attached a CRT, and thus was born the modern era of eyestrain. as time went by these CRT terminals got more and more sophisticated, adding features in the blink of an eye. Half-intensity, Reverse Video, Underlining, blinking, combinations of all the above, and most recently COLOR! Through all this Alpha Micro kept pace, with improvements to the operating system and associated software. Today the Alpha Micro is virtually terminal independent. Slap nearly any terminal onto it, install, or write the appropriate terminal driver (TDV) and away we go. (Pause for Breath.) Near the beginning, there were Printers. They didn't do anything but print line after of line of whatever was sent to them (generally only in uppercase). A little later, the dot matrix printer was born. As time went by printers got more sophisticated, adding underlining, boldface, multistrike, expanded print, compressed print, draft quality, correspondence quality, letter quality....Well, you get the idea. Through all this Alpha Micro ...... ??? Strange, but true. Alpha Micro makes connecting nearly any terminal almost painless, but provides no equivelent framework of generic commands and translation software (TCRT calls and Terminal Drivers) for printers. Wouldn't it be nice if you could code report output using generic commands for character spacing, line spacing, underline, boldface, etc; and have a printer driver translate these generic commands to the specific control sequences needed by the printer you are using? Darn right it would! I propose the first small step towards that end. I have developed a terminal (printer) driver that can be setup to just as described above. You specify the printer control sequences for all of the 'standard' functions, install the driver through the trmdef statement, code the generic function codes into your output file. and viola...instant features, and on any printer on the system. The driver (MODEL.TDV) is simply a modified terminal driver. It traps the the generic function calls and inserts the appropriate control sequence to set the printer into the desired mode. There are four function translation tables currently defined. The first table contains the standard set of printer functions. The second, functions for controlling color on printers with color capabilities. The Third is available for anything you might want to do(user defined). And the fourth is currently undefined but could be used for graphics commands. Additional tables may be defined. The generic function call is defined as the leadin character followed by a printable character(except space). This yields 94 functions per table. The leadin characters have been defined to be DC1,DC2,DC3, and DC4 for tables 1 to 4 respectively. MODEL.TDV works with the old memory-based spooler and with the new task manager spooler. The source code for MODEL.TDV is available on the AMUS network for all to use and enjoy. ...The Beginning End of ARTICLE for AMUS Newsletter /P /hl 1 The PX Program and DC1,DC1 sequence The program PX.LIT (source included) is used to enable, disable, and query the translation status of any DDSS compatible driver. /u Useage: PX Trmnam {Option} Trmnam is Terminal Name. Option is (Y)es, Translations On (N)o, Translations Off (S)how, Show Current Status Option is Optional, Defaults to (S) /f All Revision [103] and later drivers also have the capability to disable the translation by sending the 'generic' sequence of "DC1 DC1". (ie. two sequential Control-Qs). The PX program must be used to turn translation bak on. /p /hl 1 Instructions for Making a driver for your printer Lets assume you have an AM-304 printer. /ls /le Copy MODEL.M68 to AM304.M68 /le Copy MODEL.TB? to AM304.TB? /le Vue AM304.TB1 - This is the table of standard functions /lsal /le Make the table entries for each of the standard functions the AM304 is capable of. Table Entries have the general form of: /u Ann: Byte length,code,...,code,0 Where: nn = the fucntion number length = the length of the command sequence (Don't include the Length byte or terminating null byte in the length) code = the list of characters that perform the function for the printer. 0 = Null byte terminating the entry. (The Null byte must be there even if the code ends in a null byte) For Example: A00: Byte 3,$Esc,'R,0,0 /f Note: All of the control characters have symbols defined for them in MODEL.M68, so you may use those symbols. /le If a function is not supported by the printer, use the following: /u A24: Byte 0 /f /le If several functions in a row are not supported, only the last one needs to have the terminating null byte. For Example: /u A11: A12: A13: A14: Byte 0 /f /els /le Vue AM304.M68 and change all occurrences of 'MODEL' to 'AM304' /u >GLOBAL MODEL AM304 /f /le If you wish to use tables #2,3,or 4, follow step 1 above to setup the tables and change the appropriate line in the conditional assembly equates area to allow the table to by included in the driver. (See OKI32X.TB3 for use of user defined tables.) /le compile - If any errors occur, you probably made an error in setting up the table. Since the compiler does not show errors in COPY files, the easiest way to find out what is wrong is to comment out the copy statement and yank the table into the .M68 and compile again. This will show you the errors. /le copy AM304.TDV to 1,6 /le Change the TRMDEF statement for the printer to use AM304 as the terminal driver. /le reboot and start using /els Note: Only Tables #1 and #2 have been setup with predefined commands. If you wish to define other commands, use tables #3 or #4 or use any undefined entries in tables #1 and #2. /p /hl 1 Sample Program /c Sample program to demonstrate useage of generic function calls. /c generates a test print file /u Map1 Leadin,s,1 Map1 Ulon,s,2 !underline on command Map1 Ulof,s,2 !underline off command Map1 Exon,s,2 !Expanded on command Map1 Exof,s,2 !Expanded off command Map1 Dson,s,2 !DoubleStrike on command Map1 Dsof,s,2 !DoubleStrike off command Map1 Ulon,s,2 !underline on command Map1 Ulof,s,2 !underline off command Map1 Spon,s,2 !Superscript on command Map1 Spof,s,2 !Superscript off command Map1 Sbon,s,2 !Subscript on command Map1 Sbof,s,2 !Subscript off command ! Leadin = Chr$(17) !DC1 Ulon = Leadin+"B" Ulof = Leadin+"C" Exon = Leadin+"6" Exof = Leadin+"7" Dson = Leadin+"@" Dsof = Leadin+"A" Spon = Leadin+"D" Spof = Leadin+"E" Sbon = Leadin+"F" Sbof = Leadin+"G" ! Open #1,"Test.Prt",Output Print #1,"This is a test of the Generic Printer Driver" Print #1,Exon;"This line should be in Expanded Print";Exof Print #1,Dson;"This line should be in Doublestrike Mode";Dsof Print #1,Ulon;"This line should be Underlined";Ulof Print #1,"This ";Ulon;"word";Ulof;" should be Underlined" Print #1,"This is an example of ";Spon;"superscripts";Spof;"." Print #1,"this is an example of ";Sbon;"subscripts";Sbof;"." Close #1 End /f /p /hl 1 TB1 - Standard Function Definitions The following is the list of function codes and their corresponding functions. Remember the complete function call consists of the character DC1 immediately followed by the appropriate character. /u '!' - Select Character Set #1 (Standard) '"' - Select Character Set #2 (Alternate) '#' - Select Character Set #3 (USA) '$' - Select Character Set #4 (French) '%' - Select Character Set #5 (German) '&' - Select Character Set #6 (British) ''' - Select Character Set #7 (Danish) '(' - Select Character Set #8 (Swedish) ')' - Select Character Set #9 (Italian) '*' - Select Character Ser #10 (Spanish) '+' - Select Character Set #11 (Norwegian) ',' - Select Character Ser #12 (Dutch) '-' - Select Character Set #13 (French Canadian) '.' - Select Character Set #14 (Graphics) '/' - Select Character Set #15 (IBM) '0' - /Select Italics Character Set '1' - \Cancel Italics Character Set (set standard) '2' - /Select NLQ Character Set '3' - \Cancel NLQ Character Set '4' - /Select Porportional Pitch '5' - \Cancel Porportional Pitch '6' - /Select Expanded Print (Continous) '7' - \Cancel Expanded print '8' - /Select Double Height Characters (Continous) '9' - \Cancel Double Height Characters ':' - /Select Condensed Print Mode ';' - \Cancel Condensed Print Mode '<' - /Select Enhanced Print Mode '=' - \Cancel Enhanced Print Mode '>' - /Select Emphasized Print Mode (Shadow) '?' - \Cancel Emphasized Print Mode (Shadow) '@' - /Select Double Strike Mode (Bold) 'A' - \Cancel Double Strike Mode (Bold) 'B' - /Select Underlined Print Mode 'C' - \Cancel Underlined Print Mode 'D' - /Select Superscripts 'E' - \Cancel Superscripts 'F' - /Select Subscripts 'G' - \Cancel Subscripts 'H' - /Select No Print Mode 'I' - \Cancel No Print Mode 'J' - /Select Backward Printing 'K' - \Cancel Backward Printing 'L' - Select Double Height Characters (One Line) 'M' - Select Expanded Print (One Line ) 'N' - Select 10 CPI (Pica) Draft 'O' - Select 12 CPI (Elite) Draft 'P' - Select 17 CPI (Cond.) Draft 'Q' - Select 10 CPI (Pica) Correspondence 'R' - Select 12 CPI (Elite) Correspondence 'S' - Select 17 CPI (Cond.) Correspondence 'T' - Select 10 CPI (Pica) Letter Quality 'U' - Select 12 CPI (Elite) Letter Quality 'V' - Select 17 CPI (Cond.) Letter Quality 'W' - Select 6 Lines Per Inch Mode 'X' - Select 8 Lines Per Inch Mode 'Y' - Select 66 Lines Per Page Mode (6lpi x 11 in) 'Z' - Select 88 Lines Per Page Mode (8lpi x 11 in) '[' - Select 11 inch form length '\' - Select 1 inch form length (Labels) ']' - /Enable Perf Skip '^' - \Disable Perf Skip '_' - /Enable Paper out Detect '`' - \Disable Paper out Detect 'a' - /Enable Printer 'b' - \Disable Printer 'c' - Set Uni-Directional Print 'd' - Set Bi-Directional Print 'e' - Print Zero with Slash 'f' - Print Zero W/o Slash 'g' - Set Bit 8 to 1 'h' - Set Bit 8 to 0 'i' - Set bit 8 to passed value 'j' - Cancel Print Line 'k' - Reverse Line Feed 'l' - Reverse Form Feed 'm' - Bell 'n' - Init/Reset Printer 'o' - Set Top Margin at Current Line 'p' - Set Bottom Margin at Current Line 'q' - Set Left Margin at current position 'r' - Set Right Margin at current position 's' - Set Horizontal tab at curr pos 't' - Set Vertical tab at curr pos 'u' - Clear Horizontal tab at curr pos 'v' - Clear Vertical tab at curr pos 'w' - Clear all Horizontal Tabs 'x' - Clear all Vertival Tabs 'y' - UNDEFINED 'z' - UNDEFINED '{' - UNDEFINED '|' - UNDEFINED '}' - UNDEFINED '~' - UNDEFINED /f /app Revision History /hl 1 Initial Release [100] The initial release was made in July 1987 /hl 1 Release [101] Revision 101 was an internal bug fix made before programs released. /hl 1 Release [102] - 5-4-88 /ls /le All drivers now include signature in impure area. This was needed to allow the PX.LIT program to recognize the driver as a DDSS driver and so it wouldn't do nastys to other drivers. /le All drivers now include translation on/off switch in the impure area. This was needed for the implementation of the PX.LIT program. /le PX.LIT/M68 program implemented. This program allows the use to turn the translation done by the driver on and off, and also allows the current status of the translation to be shown. /els /hl 1 Release [103] - 08/03/88 /ls /le All drivers modified to allow control sequence of Dc1,Dc1 to disable translation. You Must use PX.LIT to turn translation back on. /le All drivers have had code rearranged to eliminate problems with branch range errors when more than one table used. /le Minor bugs with translation on/off in drivers/PX fixed /le -1) mod to Olympa driver to pass vertical line correctly on some printwheels. /els /app Currently Supported Printers /u Driver Make/Model Date Rel Srce Notes ------ ------------------------- -------- ---- --------------- AM306 Alpha Micro AM-306 07/12/87 DDSS DPL24C Fujitsu DPL-24C 07/12/87 DDSS Note 1 DX2000 Fujitsu DX-2000 07/12/87 DDSS SG10 Star SG-10 07/12/87 DDSS SWNTEC Swintec Typewriter 03/01/88 DDSS OLYMPA Olympia Typewriter 05/03/88 DDSS Note 2 IN1000 Infoscribe 1000 05/05/88 DDSS C715F C.Itoh C-715F 08/02/88 DDSS Note 1 OKI19X Okidata 19x Series 08/09/88 DDSS HPPJET H-P Paint Jet 08/10/88 DDSS Note 1 TI810 Texas Inst. 810 09/22/88 DDSS TI855 Texas Inst. 855 09/22/88 DDSS OKI32X Okidata 32x Series 11/30/88 DDSS /f NOTES /ls /le Color table [TB2] implemented. /le Special translation to print characters only available by escape codes. Also uses IFO 1.1 RS-232 Communications adapter. Diablo Emulation only. /els .