home *** CD-ROM | disk | FTP | other *** search
- ; QTERM Version 4.x Patch Area for Apple II w/ super serial card
-
- ; This is a ZSM version of patch, created by disassembling QT-PCPI.COM
- ; as provided by Tom Bopp.
-
- ; The overlay assumes that you have selected either Soroc or TVI software
- ; codes for your video driver, so that <ESC>-* will clear the screen and
- ; <ESC>-= is the leadin for cursor addressing. You can check this by typing
- ; <ESC>* at the CP/M prompt and see if your screen clears. If your screen
- ; does not clear, either change your driver using CONFIGSV and INSTALL, or
- ; use DDT to change the code in the overlay to the appropriate screen codes.
- ; See PATCH.DOC for details on patching QTERM.
-
- ; The overlay contains code to allow you to set the baud rate and
- ; communications mode, as well as send a break and drop DTR (hang up).
- ; Inverse video is disabled because I find it distracting; you may reenable
- ; it by changing the byte at 022FH from C0H to C3H. You should also check
- ; the other video strings and 0230H and 0238H for your terminal.
-
- ; Since the Apple video system does not have hardware insert/delete for lines
- ; or characters, you cannot use the Split-Screen option of QTERM. However the
- ; VT-100 emulation will work.
-
- ; PATCHING FOR APPLE II+
-
- ; I have used QTERM with this overlay on my Apple II+, with only one change
- ; needed. This is to change the byte at 01CFH, which specifies the escape
- ; character. The Apple II+ keyboard does not have the \ symbol, so ^\
- ; cannot be typed. I would suggest a change to either 1BH (ESC) or 1EH(^^).
-
- ; PATCHING FOR OTHER SLOTS
-
- ; To use a Super Serial Card in some slot other than slot 2, some of the
- ; addresses used in the overlay have to be changed. In particular, all
- ; routines that access the serial card (addresses C0A8, C0A9, C0AA, and C0AB)
- ; will need to refer to offset addresses. These one-for-one substitutions
- ; depend on the slot used, and can be made easily with DDT. For example, if
- ; slot 1 is used, the addresses are C098, 99, 9A, and 9B; for slot 4 they
- ; would be C0C8, C9, CA, and CB.
-
- ; This has now been automated by selection of the slot number with the
- ; variable slot - D. Goodenough 7-22-89
-
- .var slot 2 ; stick your slot number here
-
- .var base 0xc088 + 16 * slot
- ; base address to access super serial card
-
- .var data base ; serial card data port
- .var status base + 1 ; serial card status port
- .var control base + 2 ; serial card control port
- .var modep base + 3 ; serial card mode port
-
- .var yes 0xff ; true value
- .var no 0 ; false value
-
- .org 0x0110
- modist:
- push de
- ld de,status
- call MODGET
- and 8
- pop de
- ret
-
- .org 0x0120
- modin:
- push de
- ld de,data
- call MODGET
- pop de
- ret
-
- .org 0x0130
- modost:
- push de
- ld de,status
- call MODGET
- and 0x10
- pop de
- ret
-
- .org 0x0140
- modout:
- push de
- ld de,data
- call MODPUT
- pop de
- ret
-
- .org 0x0150
- sbreak:
- push de
- ld de,control
- push de
- call MODGET
- set 2,a
- pop de
- call MODPUT
- pop de
- ret
-
- ;.org 0x0160 ; not needed - the above is 16 bytes
- ebreak:
- push de
- ld de,control
- push de
- call MODGET
- res 2,a
- pop de
- call MODPUT
- pop de
- ret
-
- ;.org 0x0170 ; not needed - the above is 16 bytes
- dtroff:
- push de
- ld de,control
- push de
- call MODGET
- res 0,a
- pop de
- call MODPUT
- pop de
- ret
-
- ;.org 0x0180 ; not needed - the above is 16 bytes
- dtron:
- push de
- ld de,control
- push de
- call MODGET
- set 0,a
- pop de
- call MODPUT
- pop de
- ret
-
- ;.org 0x0190 ; not needed - the above is 16 bytes
- setbd:
- push de
- push hl
- ld de,modep
- push de
- push af
- call MODGET ; 0x0280
- jp FINBD ; 0x02a0
-
- .org 0x01a0
- baudtb:
- b38400: db 0,no
- b19200: db 0,no
- b9600: db 0x0e,yes
- b4800: db 0x0c,yes
- b2400: db 0x0a,yes
- b1200: db 8,yes
- b600: db 7,yes
- b300: db 6,yes
-
- ;.org 0x01b0
- setmod:
- ld (MODSAV),a
- push de
- ld de,modep
- push de
- call MODGET
- jp FINMOD
-
- MODSAV:
- db 0x96
-
- .org 0x01c0
- modtab:
- n17: db 0b00110000 ;0x30, 7n1
- n18: db 0b00010000 ;0x10, 8n1
- n27: db 0b10110000 ;0xb0, 7n2
- n28: db 0b10010000 ;0x90, 8n2
- e17: db 0b00110110 ;0x36, 7e1
- e18: db 0b00010110 ;0x16, 8e1
- e27: db 0b10110110 ;0xb6, 7e2
- e28: db 0b10010110 ;0x96, 8e2
- o17: db 0b00110010 ;0x32, 7o1
- o18: db 0b00010010 ;0x12, 8o1
- o27: db 0b10110010 ;0xb2, 7o2
- o28: db 0b10010010 ;0x92, 8o2
-
- ;.org 0x01cc ; don't need this - we're contiguous
- resrvd: db 0 ; reserved for future use
-
- ;.org 0x01cd
- xfersz: db 8 ;number of K to read/write during file xfers
-
- ;.org 0x01ce
- speed: db 6 ;cpu speed
-
- ;.org 0x01cf
- escape: db '\e' ;escape character
-
- ;.org 0x01d0
- signon: ;signon message
- db 'Apple II/PCPI/SSC\0'
-
- .org 0x01f0
- clrs: ; string to clear the screen
- db '\e*\0'
-
- .var scrout 0x0109 ;(a routine to print to CON: the
- ; character in C)
- .var decout 0x010c ;(a routine to print to CON: a decimal value
- ; in HL. Is available for VT100 and the like.)
-
- .org 0x0200
- moveto:
- push hl ;move cursor to position in HL (Row,Col)
- ld c,'\e' ; lead-in with Esc (the ASCII one; not QTERM's)
- call scrout
- ld c,'=' ; 2nd lead-in is '='
- call scrout
- pop hl
- push hl
- ld a,h ; row value (top row is 0.)
- call poff ; add offset and send it to screen
- pop hl
- ld a,l ; col value (leftmost col is 0.)
- poff: add a,' ' ; (adds 20h)
- ld c,a
- jp scrout ; (scrout returns from 'moveto's call)
-
-
- ; Terminal Capability Bits. The eight bits stand for each of the following
- ; strings. They count from 01h=bright to 80h=clear-to-end-of-screen.
-
- .var b_brit 0b00000001 ; 0: bright (1.) -- NOT mandatory
- .var b_dim 0b00000010 ; 1: dim (2.) -- NOT mandatory
- .var b_dlln 0b00000100 ; 2: delete line (4.) -- important
- .var b_inln 0b00001000 ; 3: insert line (8.) -- important
- .var b_dlch 0b00010000 ; 4: delete character (16.)-- unused by QTERM
- .var b_inch 0b00100000 ; 5: insert character (32.)-- NOT mandatory
- .var b_clel 0b01000000 ; 6: clear to end-of-line(64.) -- important
- .var b_cles 0b10000000 ; 7: clear to end-of-screen(128.)-- important
-
- .org 0x022f
- tcbits: db b_clel + b_cles ; capability bits
-
- ;.org 0x0230
- brites: db '\e(\0' ;bright string
-
- .org 0x0238
- dims: db '\e)\0' ;dim string
-
- .org 0x0240
- dlstr: db 0 ;delete line - not available
-
- .org 0x0248
- ilstr: db 0 ;insert line - not available
-
- .org 0x0250
- dcstr: db 0 ;delete character - not available
-
- .org 0x0258
- icstr: db 0 ;insert character - not available
-
- .org 0x0260
- ceol: db '\eT\0' ;clear to end of line
-
- .org 0x0268
- ceos: db '\eY\0' ;clear to end-of-screen
-
- ; Entry and Exit hooks. These are provided to perform custom initialisation
- ; on startup and on exit from QTERM. They are invoked before any use is made
- ; of the screen or the port hardware.
-
- .org 0x0270
- entry: ret ; entry hook (270h .. 272h)
-
- .org 0x0273
- exit: ret ; exit hook (273h .. 275h)
-
- .org 0x0276
- db 'PATCH AREA'
-
- .org 0x280
- MODGET:
- push bc
- ld c,6
- call 0xffe3
- call 0xffe9
- call 0xffe0
- pop bc
- ret
-
- .org 0x290
- MODPUT:
- push bc
- ld b,a
- ld c,7
- call 0xffe3
- call 0xffe9
- ld c,b
- call 0xffe3
- pop bc
- ret
-
- .org 0x2a0
- FINBD:
- and 0xf0
- pop hl
- or h
- pop de
- call MODPUT
- pop hl
- pop de
- ret
-
- .org 0x2b0
- FINMOD:
- and 0x0f
- push hl
- ld h,a
- ld a,(MODSAV)
- and 0xf0
- or h
- pop hl
- pop de
- call MODPUT
- ld a,(MODSAV)
- and 0x0f
- rlca
- rlca
- rlca
- rlca
- or 0x0b
- ld de,control
- call MODPUT
- pop de
- ret