"Egan Ford" <
data...@gmail.com> wrote:
>Well there is one idea you could try. Write your own. To speed up
>development you could use Aztec C or cc65. I do not think it'd take a lot
>of effort.
Hi Egan,
"You can lead a man to slaughter but you can't make him think":)
I have skirted the issue to this point preferring to have the op take
another closer look. However that was the wrong approach considering he had
already taken as close a look as his tunnel allowed. My cyncism has blinded
me... I have no excuse. Only forgiveness is left for me:)
Also I admire your directness as always. Skirters sometimes get their skirts
torn off. My is completely at my feet now and my butt is freezing:)
I pointed him to the Aztec C Source and the manual (rtfm) very early in this
thread. Keep in mind that I am a net fisherman and not an angler and I don't
troll... I set a net and wait for the fish to come.
When he didn't take the bait I emailed him the fully functional Aztec C tty
terminal program in 80 column mode on a disk yesterday. But he didn't bother
with it until last evening.
The Atzec C tty's terminal module is written in 6502 and is included at the
end of this post.
The pure emulation for vt100 must also be considered:
Ivanx wrote: "I no longer consider usable any non-vt100 derived termcaps.
The Aztec C tty program supports only some of the features of the earlier
ADM-3A terminal. The ADM-3A does not support more advanced codes of the
later vt100.
Here is what Aztec C's tty supports out of the box. Completely self
explanatory and to some the comments are already included. Cover your little
eyes Yacky. You shouldn't oughta see this!" (Chopper):
The 80 column card firmware locations are accessed directly of course. I
have refrained from posting the serial IO module which is also in 6502.
All the best,
Bill
x--- snip ---x
*:ts=8
*
* APPLE //e TERMINAL
*
*
instxt <zpage.h>
HEAD EQU $65
TAIL EQU $67
STACK EQU $68
*
*
*
DATREG EQU $C088
STAREG EQU $C089
CMDREG EQU $C08A
CTLREG EQU $C08B
RMASK EQU $08
TMASK EQU $10
*
*
*
global slot_,2
*
cseg
public dumb_
dumb_ tsx
stx STACK
jsr INIT
; jsr outinit_
cli
LOOP jsr GETC
jsr PUTC
jmp LOOP
*
public EXIT
EXIT sei
sta R0
lda #0
sta R0+1
ldx slot_
lda #$0B
sta CMDREG,X
ldx STACK
txs
rts
*
INIT sei
ldx slot_
lda #$09 ;transmit, recieve enabled, irq on recv enabled
sta CMDREG,X
ldy #2
lda (SP),Y ;get baud rate
ora #$10 ;1 stop, 8 data, internal clock
sta CTLREG,X
lda DATREG,X
lda #<SERVICE
sta $3fe
lda #>SERVICE
sta $3ff
lda #0
sta HEAD
sta TAIL
rts
*
SERVICE tya
pha
txa
pha
ldx slot_
lda STAREG,X
and #RMASK
beq SKIP
lda DATREG,X
and #$7f
ldy HEAD
sta $200,y
inc HEAD
SKIP pla
tax
pla
tay
lda $45
rti
*
*
GETC ldx $C000
bpl GETC24
GETC20 cpx =$80 ;CTRL 2 _ -> exit
bne GETC21
jsr curs
lda $C010
lda =1
jmp EXIT
GETC21 cpx =$ff
bne GETC22
ldx =$88
bne GETC23
GETC22 cpx =$88
bne GETC23
ldx =$ff
GETC23 ldy slot_
lda STAREG,Y
and =TMASK
beq GETC24
sta $C010
txa
and =$7F
sta DATREG,Y
GETC24 rts
*
*
PUTC ldx TAIL
cpx HEAD
bne PUTC0
rts
PUTC0 ldy TAIL
lda $200,Y
inc TAIL
jmp outch
*
*
*
ALTCHRON EQU $C00F
ALTCHROFF EQU $C00E
ALTCHRRD EQU $C01E
PAGE2ON EQU $C055
PAGE2OFF EQU $C054
PAGE2RD EQU $C01C
COL80ON EQU $C00D
COL80OFF EQU $C00C
COL80RD EQU $C01F
STOR80ON EQU $C001
STOR80OFF EQU $C000
STOR80RD EQU $C018
SPKR EQU $C030
*
*
TP EQU $EA
BP EQU $EC
CHX EQU $FA
CHY EQU $FB
TMPY EQU $FC
TMPA EQU $FD
INESC EQU $FE
TMPC EQU $FF
*
cseg
public outinit_
outinit_
sta COL80ON
sta STOR80ON
sta ALTCHRON
lda #0
sta INESC
sta CHX
sta CHY
jsr clear
jmp curs
*
*
public putchar_
putchar_
lda #0
sta INESC
ldy #2
lda (SP),Y
cmp #$0a
bne outch
lda #$0d
jsr outch
lda #$0a
*
public outch
outch
jsr curs
lda INESC
beq outch1
jsr doesc
jmp curs
outch1
lda TMPA
cmp #$20
bcc outch2
jsr store
jsr advanc
jmp curs
outch2
jsr chk
jmp curs
*
*
chk
cmp #$1a ;^Z
bne chk1
jmp clear
chk1
cmp #$08 ;^H
bne chk2
dec CHX
bpl chkd
lda #79
sta CHX
dec CHY
bpl chkd
lda #0
sta CHY
rts
chk2
cmp #$0C ;^L
bne chk3
advanc
inc CHX
lda CHX
cmp #80
bne chkd
lda #0
sta CHX
inc CHY
lda CHY
cmp #24
bne chkd
jmp lf
chk3
cmp #$0A ;^J
bne chk4
inc CHY
lda CHY
cmp #24
bne chkd
dec CHY
jmp lf
chk4 cmp #$0B ;^K
bne chk5
dec CHY
bpl chkd
inc CHY
rts
chk5
cmp #$1B ;ESC
bne chk6
lda #1
sta INESC
rts
chk6
cmp #$0D ;^M
bne chk7
lda #$0
sta CHX
rts
chk7
cmp #$07 ;^G
bne chk8
jmp bell
chk8
cmp #$1E ;^^
bne chkd
lda #0
sta CHX
sta CHY
chkd
rts
*
*
doesc
tax
lda TMPA
cpx #$4
bne doesc1
sec
sbc #$20
sta CHX
lda TMPC
sta CHY
lda #0
sta INESC
rts
doesc1
cpx #$2
bne doesc2
sec
sbc #$20
sta TMPC
lda #$4
sta INESC
rts
doesc2
cmp #'=
bne doesc3
lda #$2
sta INESC
rts
doesc3
cmp #'T ;clear to EOL
bne doesc6
lda CHX
pha
doesc4
lda #$20
jsr store
lda CHX
cmp #79
beq doesc5
jsr advanc
jmp doesc4
doesc5
pla
sta CHX
jmp escdon
doesc6
cmp #'Q ;char insert
bne doesc9
lda CHX
sta TMPC
lda #79
sta CHX
doesc7
lda CHX
cmp TMPC
beq doesc8
dec CHX
jsr calc
lda CHX
lsr A
tay
lda (TP),Y
eor #$80
inc CHX
jsr store
dec CHX
bpl doesc7
doesc8
lda #$20
jsr store
jmp escdon
doesc9
cmp #'W ;char delete
bne doesc12
lda CHX
pha
doesc10
lda CHX
cmp #79
beq doesc11
inc CHX
jsr calc
lda CHX
lsr A
tay
lda (TP),Y
eor #$80
dec CHX
jsr store
inc CHX
bne doesc10
doesc11
lda #$20
jsr store
pla
sta CHX
jmp escdon
doesc12
cmp #'E ;line insert
bne doesc13
jsr inslin
jmp escdon
doesc13
cmp #'R ;line delete
bne doesc14
jsr dellin
jmp escdon
doesc14
cmp #$02
beq doesc15
cmp #$03
bne escdon
doesc15
lda #0
jmp EXIT
escdon
lda #0
sta INESC
rts
*
*
clear
ldx #47
clear1
lda STAB,X
sta TP+1
dex
lda STAB,X
sta TP
jsr clrlin
dex
bpl clear1
lda #0
sta CHX
sta CHY
rts
*
clrlin
sta PAGE2OFF
clrlin1
ldy #39
lda #$a0
clrlin2
sta (TP),Y
dey
bpl clrlin2
lda PAGE2RD
bmi clrlin3
sta PAGE2ON
jmp clrlin1
clrlin3
rts
*
store
pha
jsr calc
lda CHX
lsr A
tay
pla
eor #$80
sta (TP),Y
rts
*
lf
lda CHX
pha
lda #0
sta CHX
sta CHY
jsr dellin
pla
sta CHX
lda #23
sta CHY
jsr calc
rts
*
inslin
lda #0
sta CHX
lda CHY
sta TMPC
lda #23
sta CHY
inslin1
lda CHY
cmp TMPC
beq inslin2
jsr calc
lda TP
sta BP
lda TP+1
sta BP+1
dec CHY
jsr calc
jsr cpylin
jmp inslin1
inslin2
jsr calc
jsr clrlin
rts
*
dellin
lda #0
sta CHX
lda CHY
pha
dellin1
lda CHY
cmp #23
beq dellin2
jsr calc
lda TP
sta BP
lda TP+1
sta BP+1
inc CHY
jsr calc
jsr cpylin
jmp dellin1
dellin2
jsr calc
jsr clrlin
pla
sta CHY
rts
*
cpylin
sta PAGE2OFF
cpylin1
ldy #39
cpylin2
lda (TP),Y
sta (BP),Y
dey
bpl cpylin2
lda PAGE2RD
bmi cpylin3
sta PAGE2ON
jmp cpylin1
cpylin3
rts
*
curs
sty TMPY
sta TMPA
jsr calc
lda CHX
lsr A
tay
lda (TP),Y
cmp #$20
bcs curs1
ora #$40
curs1
eor #$80
cmp #$40
bcc curs2
cmp #$60
bcs curs2
and #$bf
curs2
sta (TP),Y
ldy TMPY
lda TMPA
rts
*
calc
lda CHY
asl A
tay
lda STAB,Y
sta TP
lda STAB+1,Y
sta TP+1
lda CHX
and #1
beq calc1
sta PAGE2OFF
rts
calc1
sta PAGE2ON
rts
*
bell
lda #$20
sta TMPC
bell1
lda #$2
jsr delay
sta SPKR
lda #$24
jsr delay
sta SPKR
dec TMPC
bne bell1
rts
*
delay
sec
delay1
pha
delay2
sbc #1
bne delay2
pla
sbc #1
bne delay1
rts
*
STAB fdb $400,$480,$500,$580,$600,$680,$700,$780
fdb $428,$4a8,$528,$5a8,$628,$6a8,$728,$7a8
fdb $450,$4d0,$550,$5d0,$650,$6d0,$750,$7d0
*