TITLE 'LP: Device Driver for Epson via ECS PC-12A' * * This driver is based on a reverse engineering of the * SCS "two thirds" device driver available on koyado.com * * Printer is connected to the first 8255 on the board * (PA1 and PB1 connectors) addressed at base port 0. * * G. Roberts 26 February 2021 * PORT EQU 0 PORTA EQU PORT PORTB EQU PORT+1 PORTC EQU PORT+2 PCTRL EQU PORT+3 * * Port C manages I/O control for the printer interface * * STROBEL (PC7) is the active LOW strobe sent TO the * printer indicating that data are ready and * present on the DATA lines (Port A). * * ACKNOWLEDGEL (PC2) is the active LOW signal sent FROM the * printer indicating that the data have been accepted. * * BUSY (PC3) is the active HIGH signal sent FROM the printer * indicating that the printer is busy and cannot accept * data. * * INITL (PC4)is the active LOW signal sent TO the printer * to reset it to a power-up configuration * STRL EQU 10000000B ACKL EQU 00000100B BUSY EQU 00001000B INIL EQU 00010000B CCINT EQU 040334A S.CAADR+1 SPACE 4 STL 'System equates' XTEXT HOSEQU HDOS system equivalences XTEXT ASCII ASCII character equivalences XTEXT DDDEF Device driver communucation flags XTEXT ECDEF System error codes XTEXT PICDEF PIC format equivalences (bytes 0-5) XTEXT DEVDEF Device table entries XTEXT DVDDEF Device driver equivalences XTEXT SETCAL Fixed address routines in SET XTEXT TBRA Branch relative thru table (in ROM) XTEXT TYPTX Type text to console (in ROM) * * ----- Begin position independent code * CODE PIC * * ----- Device header (bytes 6-21) * DB DVDFLV Flag as a Device Driver DB DT.CW Device capability: Write DB 00000001B Mounted unit mask DB 1 Only one unit (unit 0) DB DT.CW Unit 0 : capable of write DS 7 Units 1-7 : don't exist DB DVDFLV Unit capable of SET options DW 0 Pointer to INIT code . SET 025Q Header must be exactly 21 bytes ERRNZ *-. * * ----- Heath reserved area * DS DVD.STE-. Reserve through SeT Entry point EJECT STL 'Flags and assembly constants' EJECT STL 'SET processing' *** SET processing entry point * * SET commands enter code here * * ENTRY: (DE) = line pointer * (A) = unit number * * EXIT: 'C' clear : no error * 'C' set : error * (A) = error code * * USES: ALL * SETNTR EQU * ERRNZ *-DVD.STE Must be at SET entry point ANA A Must call unit 0 (only one) JNZ SET1 if not, then return with error MOV B,D else MOV C,E (BC) = parameter list address LXI D,PRCTAB (DE) = processor table address LXI H,OPTTAB (HL) = option table address CALL $SOP Call Set Option Processor RC If error, return CALL $SNA Else Scan for Next Argument RZ if none, then return normally MVI A,EC.ILO Else flag error for ILlegal Option STC and set carry to flag error. RET Return. SET1 MVI A,EC.UUN Unknown Unit Number error STC set carry to flag error. RET Return. SPACE 4,10 *** FLAG * * Process Byte Flag * * ENTRY: (HL) = address of table vector * * EXIT: 'C' clear : no error * 'C' set : error * * USES: ALL * * FLAG EQU $PBF SPACE 4,10 *** VAL * * Process Value Flag option specification * * ENTRY: (BC) = next character address * (HL) = table vector index * * EXIT: (BC) updated * 'C' clear : no error * 'C' set : error * * USES: ALL * * VAL EQU $PBV * * unreferenced ?? * UNK52 MVI A,EC.ILV STC RET SPACE 4,10 ** HELP * * Type help (list valid options) on colsole * HELP CALL $TYPTX DB ESC,'E' Clear H19/89 screen DB ESC,'Y',37,60 Goto Row 37, Col. 60 DB 'SET OPTIONS' DB ESC,'Y',38,57 Goto Row 38, Col. 57 DB '90-1001-700 REV. 1',NL,NL DB TAB,TAB,'MX80' DB TAB,TAB,'SELECT MX80',NL DB TAB,TAB,'NOMX80' DB TAB,TAB,'DESELECT MX80',NL DB TAB,TAB,'WIDTH n' DB TAB,TAB,'CHAR./LINE 1 continue looping MVI A,0 Zero STA TLP.CX Column Index * * Check if need new page * LPWR9 LDA TLP.LPP A = lines per page ANA A Check for 0 JZ LPWR10 Don't care, continue the loop... LDA TLP.LX A = Line Index PUSH H LXI H,TLP.LPP (HL) = Lines per Page INR A Next line STA TLP.LX save it CMP M at max? POP H JNZ LPWR10 no, continue the loop... MVI A,FF yes! Form Feed CALL LPOUTC output the character JMP LPWR5 and reset LX and CX LPWR10 INX D DCX B JMP LPWR1 LPWR11 PUSH H PUSH PSW CALL LPCLOSE POP PSW POP H RET * * MXHELP - features only on MX80 * MXHELP CALL $TYPTX DB TAB,TAB,'LPI n',TAB,TAB DB 'LINES/INCH (=216/n) 1