################################################################## MZ80PAT.TXT Purpose.: Patches for MZ-80K Applications The Sharp applications do not work with the I/O interface and the Epson printer. This is because the printer driver sends a 05 and a 06 prior to every character, the send routine must return with C=0, otherwise no real character will print. That's why only 05s are seen on the printer with unpatched driver. Also, a 07 and a 08 is sent after each character. This routine must return with CY=1, oherwise a printer alarm or paper empty is assumed, no further printing. LastEdit: 25.04.2023 ############################################################################## ===================================================== SP-2001 Machine Language Supress printing 05 & 06, prevent error Original code: 190A LD A,05 190C CALL 191B ; print 05 190F RET C ; error 1910 LD A,06 1912 CALL 191B ; print 06 1915 JR NC,1919 ; error 1917 XOR A ; ok, CY=0 1918 RET 1919 SCF ; error, CY=1 191A RET Patch to apply: 190A-B916 NOPs 1917 AF XOR A ; make sure CY is 0 1918 RET Supress printing 07 & 08, prevent error: Original code: 195D LD A,07 195F CALL 191B ; print 07 1962 JR NC,196F ; error 1964 LD A,08 1966 CALL 191B ; print 08 1969 RET C ; ok Patch to apply: 195D-1967 NOPs 1968 37 SCF ; make sure CY is 1 1969 C9 RET =============================================================== SP-2201 Editor Uses same original code as SP-2001 Supress printing 05 & 06, prevent error Patch to apply: 183F-184B NOPs 184C AF XOR A ; make sure CY is 0 184D RET Supress printing 07 & 08, prevent error: Patch to apply 1892-189C NOPs 189D 37 SCF ; make sure CY is 1 189E C9 RET ===================================================== SP-2202 Editor/Assembler Uses same original code as SP-2001 Supress printing 05 & 06, prevent error Patch to apply: 2B2F-2B3B NOPs 2B3C AF XOR A ; make sure CY is 0 2B3D RET Supress printing 07 & 08, prevent error: Patch to apply: 2B89-2B93 NOPs 2B94 37 SCF ; make sure CY is 1 2B95 C9 RET Formfeed at start of assembler pass 3 Patch to apply for regular formfeed Change 2B4C 3E 0F LD A,0F To 2B4C 3E 0C LD A,0C Patch to apply to supress formfeed Change 2B4C 3E 0F LD A,0F To 2B4C 3E 00 LD A,00 =================================================== SP-2301 Relocatable Loader Uses same original code as SP-2001 Supress printing 05 & 06, prevent error Patch to apply: 1C62-1C6F NOPs 1C70 AF XOR A ; make sure CY is 0 1C71 RET Supress printing 07 & 08, prevent error: Patch to apply: 1CBA-1CC5 NOPs 1CC6 37 SCF ; make sure CY is 1 1CC7 C9 RET ==================================================== SP-2401 Symbolic Debugger Uses same original code as SP-2001 Supress printing 05 & 06, prevent error Patch to apply: 1BA7-1BB3 NOPs 1BB4 AF XOR A ; make sure CY is 0 1BB5 RET Supress printing 07 & 08, prevent error: Patch to apply: 1BFE-1C08 NOPs 1C09 37 SCF ; make sure CY is 1 1C0A C9 RET =============================================================== PASCAL SP-4015 Uses different code than SP-2001 Supress printing 05 & 06: Patch to apply: 18B4-18C0 00 NOPs 18C1 AF XOR A 18C2 C9 RET Supress printing 07 & 08: Patch to apply: 193F-194E 00 NOPs 194F F1 POP AF 1950 C9 RET Regular formfeed at start of H command Change 18E7 3E 0F LD A,0F To 18E7 3E 0C LD A,0C Supress formfeed at start of H command Change 18E7 3E 0F LD A,0F To 18E7 3E 00 LD A,00 ================================================================ Basic SP-5025 05 & 06 are not printed Supress printing 07 & 08, prevent error: Original code: 3CB6 3E 07 LD A,07 3CB8 CD 68 3C CALL 3C68 3CBB D2 CA 3C JP NC,3CCA ; error 3CBE 3E 08 LD A,08 3CC0 CD 68 3C CALL 3C68 3CC3 D8 RET C ; CY=1, no error ... error handler ... Patch to apply: 3CB6-3CC1 NOPs 3CC2 SCF 3CC3 RET Regular formfeed at start of LIST/P command Change 3C75 3E 0F LD A,0F To 3C75 3E 0C LD A,0C Supress formfeed at start of LIST/P command Change 3C75 3E 0F LD A,0F To 3C75 3E 00 LD A,00 ================================================================ Basic SA-5510 Only 05 is printed at end of line Original code: 32C2 3E 05 LD A,05 32C4 CD 84 32 CALL 3284 32C7 D2 F3 13 JP NC,13F3 ; error handler 32CA 00.. NOP 5x 32CF D8 RET C 32D0 C3 F0 13 JP 13F0 ; error handler Patch to apply: 32C2 37 SCF ; CY=1, no error 32C3 C9 RET =================================================================== ZEN MZ-80K Uses SystemMonitor print routine at 00B5 (will not print with original monitor ROM SP-1002). There is a patch area for external output at 197B, here is the call to the monitor print routine. At start of every listing to printer a form feed is sent to the printer. Changing LD A, 0C at 1B7C to LD A,00 supresses the formfeed but also the clear-screen on a simple CR. So we use the patch area to add the code to ignore form feeds: 197B PUSH BC 197C PUSH DE 197C CP 0C ; formfeed? 197E JR Z,1984 ; yes, skip print 1980 CALL 00B5 ; no, monitor print 1984 POP DE 1985 POP BC 1986 RET It is not possible to get a proper assembly listing on the printer with single sheets on the FX80. There is another patch which waits for the space key to pressed on every formfeed, so the paper can be inserted. 197B PUSH BC 197C PUSH DE 197D CP 0C ; form feed? 197F JR NZ,1993 ; no, go and print 1981 LD DE,1999 ; address of message 1984 CALL 0015 ; display it 1987 CALL 0006 ; line feed on display 198A CALL 001B ; get key 198D CP 20 ; space? 198F JR NZ,198A ; no, reread 1991 JR 1996 ; yes, return, skip print 1993 CALL 00B5 ; character to printer 1996 POP DE 1997 POP BC 1998 RET 1999 DB "SPACE KEY" 19A2 DB 0D With this patch, the patch aread is full, 0 bytes left. ============================================================== Sub-Monitor 48k Works out-of-the-box ======================================== Disassembler (aka Super-Disassembler) No original version was available, only the Centronincs-patched version. The original driver had to be re-inserted and patched. Fortunately it is built like the original Sharp driver. Supress printing 05 & 06, prevent error Patch to apply: B90A-B917 NOPs B918 AF XOR A ; make sure CY is 0 B919 RET Supress printing 07 & 08, prevent error: Patch to apply: B95D-B967 NOPs B968 37 SCF ; make sure CY is 1 B969 C9 RET All other programs require the auto-LF on the printer to be active (they only send a CR at end of line). Disassembler sends CR-LF, which results in double line feeds. Change CD13 LD A,0D To CD13 LD A,00 ############################################################## EOF MZ80PAT.TXT