; INTPATCH.Z80, Version 3 - 2/3/86 ; ; This version adds two features, it undoes INTTERM's munging of ; the Kaypro SIO channels (no philanthropy there - I had to do it ; to get XMDM-86X and SNDOUT81 to work after exiting INTTERM) and ; optionally uses a direct call (code's Kaypro-specific, it's OK) ; to the Advent/Plu*Perfect Turbo-ROM to shut down the disk drive ; motors immediately rather than waiting around for the drives ; to deselect (and typing a dummy character) before going to work. ; I also (finally) changed the sign-on to reflect the patching. ; - b/m ; ; INTPATCH.Z80, Version 2 - 1/26/86 ; ; Corrected absolute jump addresses so patch will execute in high ; memory like rest of the program, patched init routine to move ; it there. Patched INTTERM no longer crashes intermittently when ; typing at high speed. Both patch and programmer are now a bit ; less naive - I think it's AOK now (note crossed fingers). - b/m ; ; INTPATCH.Z80 - 1/20/86 - Exit-To-System patch for INTTERM.COM ; ; The Robert Philip/Micro-C program, INTTERM.COM, is a very useful ; high speed terminal handler. Found in a library variously named ; KPINTERM.LBR and FAST.LBR (or who knows what else...), it does ; high speed (2400 baud+) terminal chores much better than Kaypro's ; TERM.COM or even MEX. For some reason, the program did not allow ; exit to system level. This is a (probably naive - improve it if ; you can!) patch to allow the numeric keypad hyphen key to trigger ; such an exit via the standard warm boot vector. BAUD.COM or ; equivalent is still required to set port speed. To install: ; ZASM INTPATCH.AAZ HEX (or) ZAS INTPATCH H (followed by) ; MLOAD NEWTERM=INTTERM.COM,INTPATCH (MLOAD 2.1 or newer required) ; Enjoy - and fix it if it's wrong, O.K.? - Bruce Morgen ; FALSE EQU 0 TRUE EQU NOT FALSE CR EQU 0DH LF EQU 0AH SIGNON EQU 116H ; INTTERM sign-on message ASCII PATCH EQU 0E72H ; Patch our code here in COM file JMPOFF EQU 0BA7H ; Divert INTTERM here in COM file NUBCLD EQU 03E6H ; New byte count for 2nd LDIR ; sequence in INTTERM init code NUINIT EQU 1A6H ; Init patch point for above TPORT EQU 6H ; Kaypro's SIO status port TRIG EQU 0E4H ; Raw port input from Kaypro's ; numeric keypad hyphen key OFFSET EQU 7E48H ; Relocation offset value KBDQ EQU 8874H ; Address of INTTERM's ; keyboard input queue TROM EQU FALSE ; Got a Turbo-ROM? XDSKOF EQU 27H ; ROM function for disks off ROMCAL EQU 0FFFCH ; ROM call vector TRMPAT EQU 1B3H ; Patch point for disks-off code ; ORG SIGNON DB 'INTTERM, Version 1.23 (2/3/86) -',CR,LF IF NOT TROM DB '[WAIT] for drive deselect,',CR,LF DB 'then Strike Any Key to begin.',CR,LF ENDIF ;NOT TROM DB 'Numeric Keypad `-'' key exits.',CR,LF DB '$' ; ORG NUINIT ; Alter number of bytes to move LD BC,NUBCLD ; LDIR to high RAM follows ; IF TROM ORG TRMPAT LD L,XDSKOF CALL ROMCAL ENDIF ; ORG JMPOFF ; Follows IN operation from key port JP OFFSET+PATCH ; We branch fast to our patch RETNOP: NOP ; nop out extra byte ; (we've replaced 4 bytes w/3) ORG PATCH ; Test for trigger byte CP TRIG ; Do it JR Z,GETOUT ; JR is faster if no branch LD IX,KBDQ ; Moved here from JMPOFF JP OFFSET+RETNOP+1 ; Resume INTTERM routine ; (JP is a cycle faster here) GETOUT: LD HL,OFFSET+BGTABL; HL points to table LD B,ENTABL-BGTABL ; B has byte count LD C,TPORT ; C has modem control port address OTIR ; Do it (B is zeroed when done) INC C ; C has keyboard control port address LD A,00010000B ; Ext status reset in A OUT (C),A ; Send it INC B ; 00000001B (WR1 select) in B OUT (C),B ; Send it XOR A ; 00000000B (no interrupts) in A OUT (C),A ; Send it EI ; Interrupts OK now RST 0 ; Exit via warm boot vector ; BGTABL: DB 00011000B ; Channel reset DB 00000001B ; Select WR1 DB 00000000B ; Disable ALL interrupts DB 00010100B ; Select WR4 & reset ext stat DB 01000100B ; X16, async 1 stop,no parity DB 00010011B ; Select WR3 & reset ext stat DB 11100001B ; Rx 8 bits,yes hshak,enab rx DB 00000101B ; Select WR5 DB 11101000B ; Tx 8 bits,DTR assert,enab tx ENTABL: ; END