[net.micro.apple] new videx termcap & pieterm

morgan@ucbcad.UUCP (07/14/83)

#N:ucbcad:2800004:000:8336
ucbcad!morgan    Jul 13 20:09:00 1983

     My apologies to all of you for the incorrect termcap posted here
a few weeks ago. It was my original scratch version which refused to 
work with vi. Herein you will find the corrected, updated version.

     For those of you with either Programma's Pie or Hayden's Pie, I'm
including a patch for DOS which allows them to function interactively
as a terminal, with data transfer.

-------------------------------------------------------------------------

#The following termcap entry works only with an Apple ][+ that is
# equipped with a Videx 80 collumn card in slot 3. A special routine
# must be installed at the apple end to enable scroll down, here
# indicated with a ^U. The Videx card must have inverse char set.
qa|apple|apple-v80|Apple][+ w/Videx80 & custom scroll down:co#80:li#24:\
        :bs:ae=^z2:as=^z3:cm=6\015\036%r%+ %+ :\
        :ce=6\035:ho=50\031:so=^z3:se=^z2:nd=\034:\
        :do=\012:up=\037:cl=40*\014:dB=10:xn:am:dF=50:sr=\020:cd=20*\013:

-------------------------------------------------------------------------

     Pieterm is written using Lisa 2.5. If any of the opcodes used are
confusing, refer to hex values in the left most collumn.


    1           TTL "PIETERM 1.0
    2           NLS
    3  ;
    4  ; PIETERM: A program which patches 48k DOS 3.3 to allow
    5  ;          Programma Pie, and Hayden Pie to function in
    6  ;          a terminal mode.
    7  ;
    8  ; ASSUMES: Videx 80 collumn Videoterm in slot 3.
    9  ;          1200 baud Serial Card in slot 2.
   10  ;          DOS 3.3 unmodified at $9D00 (master or slave)
   11  ;
   12  ; TO USE:  Either from the Command level of Pie, or in a
   13  ;          "HELLO" program, "BRUN PIETERM,A$6000".
   14  ;          To enter terminal mode, from the Command level
   15  ;          of Pie, enter "TERM" or "TERM ".
   16  ; "TERM"   Sends a carriage return before entering terminal
   17  ;          mode. Best for reentering csh.
   18  ; "TERM "  Sends a ^D character before entering
   19  ;          terminal mode. For example, "TERM " should be
   20  ;          entered if returning to a cat>filename.
   21  ;
   22  ; RETURN:  To return to the command level of Pie from the
   23  ;          terminal mode, enter "^@". With an upper case
   24  ;          locked keyboard, that is control-shift-P. With
   25  ;          and Enhanser II lower case keyboard, that is ^0.
   26  ;
   27  ; SENDING: From the Command level of Pie, indicated by
   28  ;          "Command:" (csh indicated by %), enter:
   29  ;
   30  ;                 Command:TERM
   31  ;                 % stty -echo;cat>filename;stty echo
   32  ;                 % ^@
   33  ;                 Command:>#2
   34  ;                 Command:TERM 
   35  ;                             ^__space
   36  ;
   37  ; RECEIVING:      % wc filename
   38  ;                 46 123 4567 filename
   39  ;                 % sleep 20;cat filename
   40  ;                 ^@
   41  ;                 Command:(1,46)<#2
   42  ;
   43  ; BUGS:    Extra linefeeds are sent both ways. A filter program
   44  ;          at the UN*X end is required to strip every other \n.
   45  ;          Arg "^J" Arg "" ^W^X will globally illiminate them
   46  ;          within Pie.
   47  ;
   48  ;          Since the Patch program overwrites the INIT portion
   49  ;          of DOS, it must be brun every boot. A zap utility
   50  ;          may be used to modify DOS directly on the disk.
   51  ;
   52  ;          Pie gives no indication of what is going on. This
   53  ;          takes a little getting used to. It is possible to
   54  ;          get so involved with what you are doing in Pie, that
   55  ;          you forget you are logged on.
   56  ;
   57  ;          Because of the limitation of Pie's buffer, large
   58  ;          file need to be transfered in chunks.
   59  ;
   60  ;          --------------------------------
   61  ;
   62  ;
0800             63  ;
06F8             64  NO       EQU $6F8            ; address specific to videx
0638             65  START    EQU NO-$C0          ; card in slot 3. See
C080             66  DEV0     EQU $C080           ; reference manual.
C081             67  DEV1     EQU $C081
03B8             68  BASEL    EQU $478-$C0
CA2E             69  BASCLC1  EQU $CA2E
0438             70  BASEH    EQU $4F8-$C0
0800             71  ;
C0AE             72  STATUS   EQU $C0AE           ; Serial card specific to
C0AF             73  DATAPORT EQU $C0AF           ; slot 2. Adjust as needed.
0800             74  ;
FDED             75  COUT     EQU $FDED           ; Stdout
0800             76  ;
A884             77  PUTNAME  EQU $A884           ; DOS patch addresses
A909             78  PUTTOKEN EQU $A909
9D1E             79  PUTADR   EQU $9D1E
AE8E             80  PUTPATCH EQU $AE8E
0800             81  ;
6000             82           ORG $6000
6000             83           OBJ $800
6000             84  ;
6000 4C 0B 60    85           JMP MAIN
6003             86  ;
6003 54 45 52    87  NAME     DCI 'TERM'          ; hi-bit off except last
6006 CD 
6007 40 70       88  TOKEN    HEX 4070            ; need-filename optional
6009 8D AE       89  ADRESS   ADR PUTPATCH-1
600B             90  ;
600B             91  MAIN:
600B A2 04       92           LDX 4
600D BD 02 60    93  ^1       LDA NAME-1,X
6010 9D 83 A8    94           STA PUTNAME-1,X
6013 CA          95           DEX 
6014 D0 F7       96           BNE <1
6016 E8          97           INX 
6017 BD 07 60    98  ^2       LDA TOKEN,X
601A 9D 09 A9    99           STA PUTTOKEN,X
601D BD 09 60   100           LDA ADRESS,X
6020 9D 1E 9D   101           STA PUTADR,X
6023 CA         102           DEX 
6024 10 F1      103           BPL <2
6026 A2 73      104           LDX #ENDPATCH-PATCH+1
6028 BD 32 60   105  ^3       LDA PATCH,X
602B 9D 8E AE   106           STA PUTPATCH,X
602E CA         107           DEX 
602F 10 F7      108           BPL <3
6031 60         109           RTS 
6032            110  ;
6032            111  PATCH:
6032            112           PHS PUTPATCH
AE8E            113  ;
AE8E A2 8D      114           LDX #$8D
AE90 AD 04 02   115           LDA INBUFF+4
AE93 C9 A0      116           CMP #" "
AE95 D0 02      117           BNE >0
AE97 A2 84      118           LDX #$84
AE99 8A         119  ^0       TXA 
AE9A 4C BD AE   120           JMP SENDIT
AE9D AD AE C0   121  RECEIVE  LDA STATUS
AEA0 29 01      122           AND #$01
AEA2 F0 0C      123           BEQ SEND
AEA4 AD AF C0   124           LDA DATAPORT
AEA7 29 7F      125           AND #$7F
AEA9 C9 10      126           CMP #$10
AEAB F0 1F      127           BEQ SCROLLD
AEAD 20 ED FD   128  PRINTIT  JSR COUT
AEB0 AD 00 C0   129  SEND     LDA $C000
AEB3 10 E8      130           BPL RECEIVE
AEB5 8D 10 C0   131           STA $C010
AEB8 29 7F      132           AND #$7F
AEBA D0 01      133           BNE SENDIT
AEBC 60         134           RTS 
AEBD 48         135  SENDIT   PHA 
AEBE AD AE C0   136  S0       LDA STATUS
AEC1 29 02      137           AND #$02
AEC3 F0 F9      138           BEQ S0
AEC5 68         139           PLA 
AEC6 8D AF C0   140           STA DATAPORT
AEC9 4C 9D AE   141           JMP RECEIVE
AECC 38         142  SCROLLD  SEC 
AECD A2 C3      143           LDX #$C3            ; for slot 3
AECF AC F8 06   144           LDY NO
AED2 BD 38 06   145           LDA START,X
AED5 E9 05      146           SBC #$05
AED7 29 7F      147           AND #$7F
AED9 9D 38 06   148           STA START,X
AEDC 20 2E CA   149           JSR BASCLC1
AEDF A9 0D      150           LDA #$0D
AEE1 99 80 C0   151           STA DEV0,Y
AEE4 BD B8 03   152           LDA BASEL,X
AEE7 99 81 C0   153           STA DEV1,Y
AEEA A9 0C      154           LDA #$0C
AEEC 99 80 C0   155           STA DEV0,Y
AEEF BD 38 04   156           LDA BASEH,X
AEF2 99 81 C0   157           STA DEV1,Y
AEF5 A9 19      158           LDA #$19            ; home cursor
AEF7 20 ED FD   159           JSR COUT
AEFA A9 1D      160           LDA #$1D            ; ceol
AEFC 20 ED FD   161           JSR COUT
AEFF 4C 9D AE   162           JMP RECEIVE
AF02            163  ;
AF02            164           DPH 
60A6            165           ORG $6000+*-$800
60A6            166           OBJ *
60A6            167  ;
60A6            168  ENDPATCH:
60A6            169           END