173 lines
3.4 KiB
Plaintext
173 lines
3.4 KiB
Plaintext
; QT2014.Z - QTerm patch for RC2014 with VT 100 terminal
|
||
;
|
||
; September 2019, Anna Christina Nass
|
||
; based on IMSAI8080 patch: September 2019, Udo Munk
|
||
;
|
||
;.var SIOC 0x82 ;sio control port (2nd port)
|
||
;.var SIOD 0x83 ;sio data port (2nd port)
|
||
;.var SDEV 1 ;RomWBW device number
|
||
.var SIOC 0x84 ;sio control port (3rd port)
|
||
.var SIOD 0x85 ;sio data port (3rd port)
|
||
.var SDEV 2 ;RomWBW device number
|
||
|
||
.var RXRDY 1 ;receiver ready
|
||
.var TXRDY 4 ;transmitter ready
|
||
|
||
.org 0x0110 ; modem input status
|
||
modist: in a,(SIOC)
|
||
and RXRDY
|
||
ret
|
||
|
||
.org 0x0120 ; modem input
|
||
modin: in a,(SIOD)
|
||
ret
|
||
|
||
.org 0x0130 ; modem output status
|
||
modost: in a,(SIOC)
|
||
and TXRDY
|
||
ret
|
||
|
||
.org 0x0140 ; modem output
|
||
modout: out (SIOD),a
|
||
ret
|
||
|
||
.org 0x0150 ; start break
|
||
sbreak: ret
|
||
|
||
.org 0x0160 ; stop break
|
||
ebreak: ret
|
||
|
||
.org 0x0170 ; drop DTR
|
||
dtroff: ret
|
||
db 0x0c ;length of modem hang up string
|
||
db 0xfe,0xfe ;two delays
|
||
db 0x2b,0x2b,0x2b ;+++
|
||
db 0xfe,0xfe ;two delays
|
||
db 'ATH0',0x0d ;ATH0 <return>
|
||
|
||
.org 0x0180 ; restore DTR
|
||
dtron: ret
|
||
|
||
.org 0x0190 ; set baud rate
|
||
setbd: ret
|
||
|
||
.org 0x01a0 ; baud rate table
|
||
baudtb:
|
||
db 0,0,0,0,0,0,0,0
|
||
db 0,0,0,0,0,0,0,0
|
||
|
||
.org 0x01b0 ; set communication mode
|
||
setmod: ret
|
||
|
||
.org 0x01c0 ; communication mode table
|
||
modetb:
|
||
db 0,0,0,0,0,0,0,0
|
||
db 0,0,0,0
|
||
|
||
.org 0x01cc
|
||
resrvd: db 0 ; reserved for later use
|
||
|
||
.org 0x01cd ; protocol transfer size
|
||
xfersz: db 8
|
||
|
||
.org 0x01ce ; processor speed
|
||
speed: db 8 ; cpu speed in Mhz;
|
||
|
||
.org 0x01cf ; escape character
|
||
escape: db 0x19 ; 0x19: ^Y
|
||
|
||
.org 0x01d0 ; signon message
|
||
signon: db 'RC2014 SIO/2 - VT100\0'
|
||
|
||
.org 0x01f0 ; clear screen
|
||
clrs: db '\e[2J'
|
||
db '\e[1;1H\0'
|
||
|
||
.var scrout 0x0109 ; print character in C
|
||
.var decout 0x010c ; print string of value in HL
|
||
|
||
.org 0x0200 ; moveto routine
|
||
moveto: push HL
|
||
ld C,'\e'
|
||
call scrout
|
||
ld C,'['
|
||
call scrout
|
||
pop HL
|
||
push HL
|
||
ld L,H
|
||
ld H,00
|
||
inc L
|
||
call decout
|
||
ld C,';'
|
||
call scrout
|
||
pop HL
|
||
ld H,00
|
||
inc L
|
||
call decout
|
||
ld C,'H'
|
||
jp scrout
|
||
|
||
.org 0x022f
|
||
tcbits: db 0b11000011 ;terminal capabilities
|
||
|
||
.org 0x0230
|
||
;brites: db '\e[1m\0' ;bright
|
||
brites: db '\0' ;bright
|
||
|
||
.org 0x0238
|
||
;dims: db '\e[0m\0' ;dim
|
||
dims: db '\0' ;dim
|
||
|
||
.org 0x0240
|
||
dlstr: db '\0' ;delete line
|
||
|
||
.org 0x0248
|
||
ilstr: db '\0' ;insert line
|
||
|
||
.org 0x0250
|
||
dcstr: db '\0' ;Delete character
|
||
|
||
.org 0x0258
|
||
icstr: db '\0' ;Insert character
|
||
|
||
.org 0x0260
|
||
ceol: db '\e[K\0' ;Clear to end of line
|
||
|
||
.org 0x0268
|
||
ceos: db '\e[J\0' ;Clear to end of screen
|
||
|
||
.org 0x0270 ;entry subroutine
|
||
entry: jp init
|
||
|
||
.org 0x0273 ;exit subroutine
|
||
exit: jp uninit
|
||
|
||
.org 0x0276 ;user subroutine
|
||
user: ret
|
||
|
||
.org 0x0279 ;keyboard map subroutine
|
||
kbmap: ret
|
||
|
||
.org 0x0280 ; user patch area
|
||
init: ld hl,SIOINI
|
||
ld B,9
|
||
ld C,SIOC
|
||
otir
|
||
ret
|
||
SIOINI: db 0b00011000 ; Wr0 Channel reset
|
||
db 0b00010100 ; Wr0 Pointer R4 + reset ex st int
|
||
db 0b11000100 ; Wr4 /64, async mode, no parity
|
||
db 0b00000011 ; Wr0 Pointer R3
|
||
db 0b11000001 ; Wr3 Receive enable, 8 bit
|
||
db 0b00000101 ; Wr0 Pointer R5
|
||
db 0b11101010 ; Wr5 Transmit enable, 8 bit, flow ctrl
|
||
db 0b00010001 ; Wr0 Pointer R1 + reset ex st int
|
||
db 0b00000000 ; Wr1 No Tx interrupts
|
||
uninit: ld B,4 ; HBIOS CIOINIT function 0x04
|
||
ld C,SDEV ; device number (0,1,2,3)
|
||
ld DE,-1 ; "Reset with current settings"
|
||
rst 8 ; do it
|
||
ret ; not initialized, so no un-initialize
|
||
|
||
|