A2osX/SYS/KERNEL.S.TERMLC.txt
2018-12-12 17:32:33 +01:00

157 lines
2.3 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
PREFIX
AUTO 4,1
*--------------------------------------
ClrScr ldx #23
.1 jsr SETUP.L1X
lda #" "
bit bActive
bpl .4
sta SETWRITEAUX
ldy #39
.2 sta (ZPScrBaseL1),y
dey
bpl .2
sta CLRWRITEAUX
ldy #39
.3 sta (ZPScrBaseL1),y
dey
bpl .3
.4 sta SETWRITEAUX
ldy #79
.5 sta (ZPBufBaseL1),y
dey
bpl .5
dex
bpl .1
lda #0
ldy #S.TTY.CV
sta (ZPTTYEnvPtr),y
dey
sta (ZPTTYEnvPtr),y
rts
*--------------------------------------
SetCharAtCurPos pha
ldy #S.TTY.CV
lda (ZPTTYEnvPtr),y
tax
dey
lda (ZPTTYEnvPtr),y
tay
pla
*--------------------------------------
SetCharAtYX cmp #$40
bcc .10
cmp #$5F
bcs .10
and #$3F
.10 pha
jsr SETUP.L1X
tya
lsr
tay
pla
bcs .1
sta SETWRITEAUX
.1 sta (ZPScrBaseL1),y
sta CLRWRITEAUX
rts
*--------------------------------------
GetCharAtCurPos ldy #S.TTY.CV
lda (ZPTTYEnvPtr),y
tax
dey
lda (ZPTTYEnvPtr),y
tay
jsr SETUP.L1X
tya
lsr
tay
bcs .1
sta SETREADAUX
.1 lda (ZPScrBaseL1),y
sta CLRREADAUX
rts
*--------------------------------------
SETUP.L1X lda SCR.BASEL,x
clc
adc ZPTTYBufPtr
sta ZPBufBaseL1
lda SCR.BASEH,x
adc ZPTTYBufPtr+1
sta ZPBufBaseL1+1
bit bActive
bpl .8
lda SCR.BASEL,x
sta ZPScrBaseL1
lda SCR.BASEH,x
sta ZPScrBaseL1+1
.8 rts
*--------------------------------------
COPY.XtoL1 ldy #79
sta SETWRITEAUX
sta SETREADAUX
.1 lda (ZPBufBaseL2),y
sta (ZPBufBaseL1),y
dey
bpl .1
sta CLRWRITEAUX
sta CLRREADAUX
bit bActive
bpl .8
lda SCR.BASEL,x
sta ZPScrBaseL2
lda SCR.BASEH,x
sta ZPScrBaseL2+1
sta SETWRITEAUX
sta SETREADAUX
jsr .6
sta CLRWRITEAUX
sta CLRREADAUX
.6 ldy #39
.7 lda (ZPScrBaseL2),y
sta (ZPScrBaseL1),y
dey
bpl .7
.8 rts
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.TERMLC
LOAD USR/SRC/SYS/KERNEL.S
ASM