Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-11-14 15:48:12 +01:00
parent 081190214b
commit 786a283d88
2 changed files with 107 additions and 55 deletions

Binary file not shown.

View File

@ -51,30 +51,33 @@ DRV.TERM.STATUS jsr DRV.TERM.GetIOCTLBufCntDCB
sta (ZPBufPtr),y sta (ZPBufPtr),y
dey dey
bne .2 bne .2
ldy #S.DCB.TTY.STATUS ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
sta (ZPBufPtr) sta (ZPBufPtr)
clc clc
rts rts
.3 cmp #S.IOCTL.STATCODE.EOF .3 cmp #S.IOCTL.STATCODE.EOF
bne .9 bne .9
ldy #S.DCB.TTY.STATUS jsr DRV.TERM.ISOPENED
lda (ZPDCBPtr),y
and #S.DIB.S.OPENED
beq DRV.TERM.OPEN.E beq DRV.TERM.OPEN.E
jsr DRV.TERM.CURBLNK jsr DRV.TERM.CURBLNK
ldy #S.DCB.TTY.OUTTAIL ldy #S.DCB.TTY.OUTTAIL
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
iny iny
sec * sec
eor (ZPDCBPtr),y OUTHEAD eor (ZPDCBPtr),y OUTHEAD
bne .8 bne .8
bit bActive bit bActive
bpl .7 bpl .7
bit OPENAPPLE bit OPENAPPLE
bmi .7 bmi .7
bit KBD bit KBD
bmi .8 bmi .8
@ -83,7 +86,10 @@ DRV.TERM.STATUS jsr DRV.TERM.GetIOCTLBufCntDCB
.8 lda #0 .8 lda #0
clc clc
rts rts
.9 lda #MLI.E.BADCTL .9 lda #MLI.E.BADCTL
.HS 2C BIT ABS
DRV.TERM.OPEN.E lda #MLI.E.OPEN
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -91,23 +97,23 @@ DRV.TERM.OPEN tax DEV.ID in A
jsr DRV.TERM.GetDCB jsr DRV.TERM.GetDCB
ldy #S.DCB.TTY.STATUS jsr DRV.TERM.ISOPENED
lda (ZPDCBPtr),y bne DRV.TERM.OPEN.E
bit #S.DIB.S.OPENED
beq DRV.TERM.OPEN.1
DRV.TERM.OPEN.E lda #MLI.E.OPEN
sec
rts
DRV.TERM.OPEN.1 txa DRV.TERM.OPEN.1 txa
ldx #0 ldx #0
.2 ldy A2osX.SCRNDEVS,x .2 ldy A2osX.SCRNDEVS,x
beq .3 beq .3
inx inx
cpx #K.SCR.MAX cpx #K.SCR.MAX
bne .2 bne .2
lda #E.OOH lda #E.OOH
sec sec
rts rts
.3 sta A2osX.SCRNDEVS,x .3 sta A2osX.SCRNDEVS,x
ldy #S.DCB.TTY.DEVID ldy #S.DCB.TTY.DEVID
@ -140,10 +146,9 @@ DRV.TERM.CONTROL
*-------------------------------------- *--------------------------------------
DRV.TERM.CLOSE jsr DRV.TERM.GetDCB DRV.TERM.CLOSE jsr DRV.TERM.GetDCB
ldy #S.DCB.TTY.STATUS jsr DRV.TERM.ISOPENED
lda (ZPDCBPtr),y
bit #S.DIB.S.OPENED
beq .9 beq .9
lda DRV.TERM.DIB+S.DIB.S lda DRV.TERM.DIB+S.DIB.S
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
ldx #0 ldx #0
@ -162,6 +167,12 @@ DRV.TERM.CLOSE jsr DRV.TERM.GetDCB
sec sec
rts rts
*-------------------------------------- *--------------------------------------
DRV.TERM.ISOPENED
ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y
bit #S.DIB.S.OPENED
rts
*--------------------------------------
DRV.TERM.READ jsr DRV.TERM.GetIOCTLBufCntDCB DRV.TERM.READ jsr DRV.TERM.GetIOCTLBufCntDCB
bit bActive is screen active? bit bActive is screen active?
bpl .6 no....go check flush... bpl .6 no....go check flush...
@ -239,10 +250,13 @@ DRV.TERM.READ jsr DRV.TERM.GetIOCTLBufCntDCB
DRV.TERM.WRITE jsr DRV.TERM.GetIOCTLBufCntDCB DRV.TERM.WRITE jsr DRV.TERM.GetIOCTLBufCntDCB
jsr DRV.TERM.CUROFF jsr DRV.TERM.CUROFF
.1 inc ZPCount .1 inc ZPCount
bne .2 bne .2
inc ZPCount+1 inc ZPCount+1
beq .8 beq .8
.2 ldy #S.DCB.TTY.MODE .2 ldy #S.DCB.TTY.MODE
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
tax tax
@ -261,6 +275,7 @@ DRV.TERM.WRITE jsr DRV.TERM.GetIOCTLBufCntDCB
.DA DRV.TERM.IAC .DA DRV.TERM.IAC
.DA DRV.TERM.G0 .DA DRV.TERM.G0
.DA DRV.TERM.G1 .DA DRV.TERM.G1
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
@ -268,20 +283,27 @@ DRV.TERM.COUT lda (ZPBufPtr)
cmp #IAC cmp #IAC
bne .1 bne .1
lda #S.DCB.TTY.MODE.IAC lda #S.DCB.TTY.MODE.IAC
jmp DRV.TERM.SETMODE jmp DRV.TERM.SETMODE
.1 cmp #C.DEL .1 cmp #C.DEL
beq DRV.TERM.COUT.DEL beq DRV.TERM.COUT.DEL
cmp #C.SPACE cmp #C.SPACE
bcs .8 bcs .8
ldx #CtrlChars.Cnt-1 ldx #CtrlChars.Cnt-1
.2 cmp CtrlChars,x .2 cmp CtrlChars,x
beq .3 beq .3
dex dex
bpl .2 bpl .2
clc clc
rts rts
.3 txa .3 txa
asl asl
tax tax
@ -309,9 +331,9 @@ DRV.TERM.COUT.FS
ldy #S.DCB.TTY.bLINEWRAP ldy #S.DCB.TTY.bLINEWRAP
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
bpl DRV.TERM.COUT.BS.8 bpl DRV.TERM.COUT.BS.8
ldy #S.DCB.TTY.CH
lda #0 jsr DRV.TERM.COUT.CR
sta (ZPDCBPtr),y
jmp DRV.TERM.COUT.LF.1 jmp DRV.TERM.COUT.LF.1
*-------------------------------------- *--------------------------------------
DRV.TERM.COUT.BS DRV.TERM.COUT.BS
@ -344,6 +366,7 @@ DRV.TERM.COUT.DEL
ldy #S.DCB.TTY.CH ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
beq .1 beq .1
dec dec
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
bra .3 bra .3
@ -357,7 +380,7 @@ DRV.TERM.COUT.DEL
dey dey
lda #79 lda #79
sta (ZPDCBPtr),y S.DCB.TTY.CH sta (ZPDCBPtr),y S.DCB.TTY.CH
.3 lda #$20 .3 lda #C.SPACE
jmp SetCharAtCurPos jmp SetCharAtCurPos
*-------------------------------------- *--------------------------------------
DRV.TERM.COUT.FF DRV.TERM.COUT.FF
@ -655,36 +678,46 @@ Csi.EraseLine ldx CsiParamCnt
*-------------------------------------- *--------------------------------------
Csi.Home lda CsiParamCnt Csi.Home lda CsiParamCnt
bne .1 bne .1
ldy #S.DCB.TTY.CH ldy #S.DCB.TTY.CH
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
iny S.DCB.TTY.CV iny S.DCB.TTY.CV
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
clc clc
rts rts
.1 ldx #1 .1 ldx #1
lda CsiParams lda CsiParams
beq .2 beq .2
ldx #24 ldx #24
cmp #24 cmp #24
bcs .2 bcs .2
tax tax
.2 dex .2 dex
txa txa
ldy #S.DCB.TTY.CV ldy #S.DCB.TTY.CV
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
dec CsiParamCnt dec CsiParamCnt
beq Csi.Home.8 beq Csi.Home.8
ldx #1 ldx #1
lda CsiParams+1 lda CsiParams+1
beq .3 beq .3
ldx #80 ldx #80
cmp #80 cmp #80
bcs .3 bcs .3
tax tax
.3 dex .3 dex
txa txa
ldy #S.DCB.TTY.CH ldy #S.DCB.TTY.CH
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
Csi.Home.8 clc Csi.Home.8 clc
rts rts
*-------------------------------------- *--------------------------------------
@ -855,6 +888,44 @@ DRV.TERM.COUT.LF.1
clc clc
rts rts
*-------------------------------------- *--------------------------------------
CLRSOL ldy #S.DCB.TTY.CH End
lda (ZPDCBPtr),y
cmp #80
bcc CLRLINE.1
CLRLINE lda #80 End
CLRLINE.1 ldy #0 Start
bra CLR
CLREOL ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
tay Start
cpy #80
bcs CLR.8
lda #80 End
CLR sty .1+1 Save Start
sta .2+1 Save End
ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
tax
.1 ldy #$ff SELF MODIFIED
.2 cpy #$ff SELF MODIFIED
bcs CLR.8
lda #" "
jsr SetCharAtYX X unmodified
inc .1+1
bra .1
CLR.8 clc
rts
*--------------------------------------
SCROLL.UP ldy #S.DCB.TTY.SCROLLTOP SCROLL.UP ldy #S.DCB.TTY.SCROLLTOP
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
@ -869,44 +940,13 @@ SCROLL.UP ldy #S.DCB.TTY.SCROLLTOP
ldy #S.DCB.TTY.SCROLLBOT ldy #S.DCB.TTY.SCROLLBOT
cmp (ZPDCBPtr),y cmp (ZPDCBPtr),y
bne .1 bne .1
*-------------------------------------- bra CLRLINE
CLRLINE ldy #0 Start
ldx #80 End
bra CLR
CLRSOL ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
tax End
ldy #0 Start
bra CLR
CLREOL ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
tay Start
ldx #80 End
CLR stx .1+1 Save End
phy
ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
tax
ply
.1 cpy #$ff Self Modified
beq .8
phy
lda #" "
jsr SetCharAtYX X unmodified
ply
iny
bra .1
.8 clc
rts
*-------------------------------------- *--------------------------------------
SCROLL.DN ldy #S.DCB.TTY.SCROLLBOT SCROLL.DN ldy #S.DCB.TTY.SCROLLBOT
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
tax tax
.1 jsr DRV.TERM.SETUP.L1X .1 jsr DRV.TERM.SETUP.L1X
dex dex
@ -923,6 +963,7 @@ SCROLL.DN ldy #S.DCB.TTY.SCROLLBOT
DRV.TERM.CURBLNK DRV.TERM.CURBLNK
bit bActive bit bActive
bpl .9 bpl .9
lda A2osX.TIMER16 lda A2osX.TIMER16
and #CURSOR.BLINK.SPEED and #CURSOR.BLINK.SPEED
ldy #S.DCB.TTY.bCURON ldy #S.DCB.TTY.bCURON
@ -936,6 +977,7 @@ DRV.TERM.CUROFF bit bActive
ldy #S.DCB.TTY.bCURON ldy #S.DCB.TTY.bCURON
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
beq DRV.TERM.CURBLNK.RTS beq DRV.TERM.CURBLNK.RTS
DRV.TERM.CURBLNK.1 DRV.TERM.CURBLNK.1
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
bne DRV.TERM.CURBLNK.OFF bne DRV.TERM.CURBLNK.OFF
@ -945,16 +987,18 @@ DRV.TERM.CURBLNK.1
and #$80 and #$80
eor #" " eor #" "
bra DRV.TERM.CURBLNK.SET
DRV.TERM.CURBLNK.OFF
jsr GetCharAtCurPos
bcs DRV.TERM.CURBLNK.RTS Out of screen
DRV.TERM.CURBLNK.SET DRV.TERM.CURBLNK.SET
jsr SetCharAtY.SCR jsr SetCharAtY.SCR
ldy #S.DCB.TTY.bCURON ldy #S.DCB.TTY.bCURON
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
eor #CURSOR.BLINK.SPEED eor #CURSOR.BLINK.SPEED
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
rts
DRV.TERM.CURBLNK.OFF
jsr GetCharAtCurPos
bcc DRV.TERM.CURBLNK.SET if not Out of screen
DRV.TERM.CURBLNK.RTS DRV.TERM.CURBLNK.RTS
rts rts
*-------------------------------------- *--------------------------------------
@ -1050,8 +1094,10 @@ DRV.TERM.Title.ON
ldy #S.DCB.TTY.bTITLE ldy #S.DCB.TTY.bTITLE
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
bmi DRV.TERM.Title.RTS bmi DRV.TERM.Title.RTS
lda #$ff lda #$ff
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
ldy #S.DCB.TTY.DEVID ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
tax tax
@ -1063,11 +1109,15 @@ DRV.TERM.Title.ON
adc /S.FD.DEV adc /S.FD.DEV
>STYA ZPTmpWord >STYA ZPTmpWord
ldx #0 ldx #0
jsr DRV.TERM.SETUP.L1X.SCR jsr DRV.TERM.SETUP.L1X.SCR
ldy #0 ldy #0
.1 lda (ZPTmpWord),y .1 lda (ZPTmpWord),y
beq .3 beq .3
cmp #$40 cmp #$40
bcc .2 bcc .2
cmp #$60 cmp #$60
@ -1079,6 +1129,7 @@ DRV.TERM.Title.ON
ply ply
iny iny
bne .1 bne .1
.3 lda #C.SPACE .3 lda #C.SPACE
.4 phy .4 phy
@ -1108,6 +1159,7 @@ DRV.TERM.SETUP.L1X
lda (pFD),y lda (pFD),y
adc BUF.BASEH,x adc BUF.BASEH,x
sta ZPBufBaseL1+1 sta ZPBufBaseL1+1
bit bActive bit bActive
bpl DRV.TERM.SETUP.L1X.8 bpl DRV.TERM.SETUP.L1X.8