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