Kernel 0.92

This commit is contained in:
Rémy GIBERT 2018-12-17 08:02:03 +01:00
parent 95a10cbd54
commit 2120025d9f
12 changed files with 381 additions and 313 deletions

View File

@ -3,7 +3,8 @@ PREFIX
AUTO 4,1
#!/BIN/SHELL
ECHO *** A2osX INIT Script ***
SET PS1='$PWD'
SET PS1 = '$PWD'
SET PATH = ${PATH}BIN/DEV/
# Main Screen
GETTY /DEV/TTY1 ${ROOT}SBIN/LOGIN &
GETTY /DEV/TTY2 ${ROOT}SBIN/LOGIN &

View File

@ -3,30 +3,25 @@ PREFIX
AUTO 4,1
.LIST OFF
*--------------------------------------
*** $3F0-$3FF IRQ Handler.... ***
Dev.Table.hPath .EQ $1300 K.Dev.MAX
Dev.Table.hFD .EQ $1320 K.Dev.MAX
*--------------------------------------
* Main/Aux $400 -> $7FF : TXT PAGE1 Console Screen
* Main/Aux $800 -> $BFF : TXT PAGE2 System Screen
Nod.Table.hPath .EQ $1340 K.NOD.MAX
Nod.Table.hFD .EQ $1360 K.NOD.MAX
*--------------------------------------
* free $0C00->$17FF = $C00 (3072) Aux
PS.Table.PID .EQ $1380 K.PS.MAX
PS.Table.hPS .EQ $13A0 K.PS.MAX
PS.Table.Hits .EQ $13C0 K.PS.MAX
PS.Table.Stats .EQ $13E0 K.PS.MAX
*--------------------------------------
Dev.Table.hPath .EQ $0C00 K.Dev.MAX
Dev.Table.hFD .EQ $0C20 K.Dev.MAX
OF.Table.hPath .EQ $1400 K.OF.MAX
OF.Table.hFD .EQ $1420 K.OF.MAX
*--------------------------------------
Nod.Table.hPath .EQ $0C40 K.NOD.MAX
Nod.Table.hFD .EQ $0C60 K.NOD.MAX
Evt.Table .EQ $1440 K.EVT.MAX*S.EVT=4*8=32b
*--------------------------------------
PS.Table.PID .EQ $0C80 K.PS.MAX
PS.Table.hPS .EQ $0CA0 K.PS.MAX
PS.Table.Hits .EQ $0CC0 K.PS.MAX
PS.Table.Stats .EQ $0CE0 K.PS.MAX
Flt.Table .EQ $1460 K.FLT.MAX*S.FLT=4*32=128b
*--------------------------------------
OF.Table.hPath .EQ $0D00 K.OF.MAX
OF.Table.hFD .EQ $0D20 K.OF.MAX
*--------------------------------------
Evt.Table .EQ $0D40 K.EVT.MAX*S.EVT=4*8=32b
*--------------------------------------
Flt.Table .EQ $0D60 K.FLT.MAX*S.FLT=4*32=128b
*--------------------------------------
MAN
SAVE INC/KERNEL.I

View File

@ -163,11 +163,17 @@ CORE.GetEvents lda #Evt.Table
dec CORE.TickSec
bne .3 not yet One Sec
lda SYS.BASL0+38
lda IRQ.Mode
eor #$C0
sta IRQ.Mode
ldx A2osX.ASCREEN
cpx #1 /DEV/CONSOLE
bne .22
sta SYS.BASL0+38
ldx CORE.TickPerSec
.22 ldx CORE.TickPerSec
stx CORE.TickSec
lda #S.EVT.F.T1SEC

View File

@ -14,12 +14,12 @@ A2osX.D2.S .EQ A2osX.E0-A2osX.D2
A2osX.E0.S .EQ A2osX.E0.E-A2osX.E0
*--------------------------------------
.LIST OFF
.DO A2osX.MAIN.S>$700
.DO Mem.MLoMem>$1fff
.LIST ON
* ERROR:MAIN too big
.LIST OFF
.FIN
.DO A2osX.AUX.S>$C00
.DO Mem.XLoMem>$1fff
.LIST ON
* ERROR:AUX too big
.LIST OFF

View File

@ -91,30 +91,31 @@ K.MLI.PARAMS .EQ $03AA Main, 18 bytes min for GetFileInfo (ATLK needs MORE!!!
*--------------------------------------
K.STACKTOP .EQ $03ED XFer !!! down to $3E0
*--------------------------------------
K.Buf256 .EQ $0E00
*** $3F0-$3FF IRQ Handler.... ***
*--------------------------------------
K.IOBuf .EQ $0F00
* Main/Aux $400 -> $7FF : TXT PAGE1 Screens
*--------------------------------------
* MemMgr : $0800->$0FFF MAIN/AUX (2 kBytes)
*--------------------------------------
Mem.Table .EQ $0800 Slot 0 is Reserved
Mem.LoMem .EQ $0800
Mem.Free .EQ $0802
Mem.HiMem .EQ $0804
Mem.LastSlot .EQ $0806
*--------------------------------------
* free $1000->$1FFF = $1000 (4096) Aux
*--------------------------------------
*** Z80 Reserved $1000-10FF***
*--------------------------------------
Z80CODE .EQ $1000 (00000h) Up To $10FF
Z80STACK .EQ $10FF (000FFh) Down to $1000
*--------------------------------------
* CORE $1100->$17FF = $700 Main
K.Buf256 .EQ $1100
*--------------------------------------
* MemMgr : $1800->$1FFF MAIN/AUX (2 kBytes)
K.IOBuf .EQ $1200
*--------------------------------------
Mem.Table .EQ $1800 Slot 0 is Reserved
Mem.LoMem .EQ $1800
Mem.Free .EQ $1802
Mem.HiMem .EQ $1804
Mem.LastSlot .EQ $1806
*--------------------------------------
Mem.MLoMem .EQ $2000
Mem.MHiMem .EQ $BD00
Mem.XLoMem .EQ $2000
Mem.XHiMem .EQ $C000
*--------------------------------------
DevMgr.HiMem .EQ $FFFA Protect IRQ vectors in Aux LC
*--------------------------------------
H.BIN.T .EQ 0

View File

@ -322,6 +322,7 @@ GP.IrqH.Exit stz IRQ.SkipA2osX reset flag
sec
rts
*--------------------------------------
IRQ.Mode .BS 1
IRQ.SkipA2osX .BS 1
IRQ.Tick .BS 1
IRQ.InKernel .BS 1

View File

@ -309,7 +309,7 @@ MemMgrInit >LDYAI Mem.MHiMem
rts
*--------------------------------------
SysScrInit jsr SysScrInit.EnvBuf
SysScrInit jsr SysScrInit.DCBBuf
>PUSHWI FD.CONSOLE.NAME
>LDYAI FD.TTY
@ -326,7 +326,7 @@ SysScrInit jsr SysScrInit.EnvBuf
sbc /2048
sta FD.TTY+S.FD.DEV.BUFPTR+1
jsr SysScrInit.EnvBuf
jsr SysScrInit.DCBBuf
>PUSHWI FD.TTY.NAME
>LDYAI FD.TTY
@ -339,7 +339,7 @@ SysScrInit jsr SysScrInit.EnvBuf
clc
.9 rts
*--------------------------------------
SysScrInit.EnvBuf
SysScrInit.DCBBuf
clc
lda DevMgr.Free
@ -587,7 +587,7 @@ IrqMgrInit >LDYAI MSG.IRQ
bcs .1
lda #"C"
sta SYS.BASL0+38
sta IRQ.Mode
>LDYAI K.IrqH.TCLOCK
>STYA K.IrqHAuxLC.JSR+1
@ -603,7 +603,7 @@ IrqMgrInit >LDYAI MSG.IRQ
bcs .8
lda #"V"
sta SYS.BASL0+38
sta IRQ.Mode
>LDYAI K.IrqH.VBL
>STYA K.IrqHAuxLC.JSR+1
@ -618,7 +618,7 @@ IrqMgrInit >LDYAI MSG.IRQ
.8 jsr IrqMgrInit.HZ2Tick
lda #"P"
sta SYS.BASL0+38
sta IRQ.Mode
>LDYAI MSG.IRQ.POLL
>SYSCALL puts

View File

@ -33,6 +33,10 @@ K.IrqHAuxLC cld
lda $ff
pha
lda RDPAGE2
pha
sta CLRPAGE2
lda RDREADAUX
pha
sta CLRREADAUX Make sure we can access FD.Table
@ -79,6 +83,11 @@ K.IrqHAuxLC.3 pla Must keep Carry
sta SETREADAUX
.2 pla
bpl .3
sta SETPAGE2
.3 pla
sta $ff
pla
sta $fe
@ -96,10 +105,10 @@ K.IrqHAuxLC.3 pla Must keep Carry
tsx
lda $104,x get RTI PC LO
bne .3
bne .4
dec $105,x adjust RTI PC HI
.3 dec $104,x back one byte, to make it a "RTS" return adddress
.4 dec $104,x back one byte, to make it a "RTS" return adddress
lda $103,x get IRQ pushed P
sta $101,x down 2 bytes
@ -110,8 +119,8 @@ K.IrqHAuxLC.3 pla Must keep Carry
sta $103,x
lda #$A0+'S
eor SYS.BASL0+37
sta SYS.BASL0+37
eor SYS.BASL0+39
sta SYS.BASL0+39
K.IrqHAuxLC.4 ldy #$ff Self Modified
K.IrqHAuxLC.5 ldx #$ff Self Modified

View File

@ -347,7 +347,7 @@ K.FreeMem tay
* Mem.Table is page aligned at $1800
* S.MEM is 8 bytes
*--------------------------------------
.DO Mem.Table=$1800
.DO Mem.Table=$800
.ELSE
!!!!!WARNING!!!!!
.FIN

View File

@ -36,9 +36,7 @@ DRV.TERM cld
.DA DRV.TERM.READ
.DA DRV.TERM.WRITE
*--------------------------------------
DRV.TERM.STATUS >STYA ZPIOCTL
jsr DRV.TERM.GetIOCTLBuf
DRV.TERM.STATUS jsr DRV.TERM.GetIOCTLBufAndCnt
ldy #S.IOCTL.STATCODE
lda (ZPIOCTL),y
@ -118,6 +116,14 @@ DRV.TERM.CONTROL
jsr DRV.TERM.SCRCPY
lda #0
ldy #S.DCB.TTY.bCURON
sta (ZPDCBPtr),y
ldy #S.DCB.TTY.bTITLE
sta (ZPDCBPtr),y
clc
rts
*--------------------------------------
@ -151,13 +157,8 @@ DRV.TERM.CLOSE jsr DRV.TERM.GetDCB
sec
rts
*--------------------------------------
DRV.TERM.READ >STYA ZPIOCTL
jsr DRV.TERM.GetIOCTLBufAndCnt
DRV.TERM.READ jsr DRV.TERM.GetIOCTLBufAndCnt
jsr DRV.TERM.GetDCB
jsr DRV.TERM.GetActive
bit bActive is screen active?
bpl .6 no....go check flush...
@ -168,11 +169,19 @@ DRV.TERM.READ >STYA ZPIOCTL
eor (ZPDCBPtr),y
beq .1
jsr CURBLNK
jsr DRV.TERM.CURBLNK
.1 lda OPENAPPLE
bpl .11
lda KBD
bmi .6 Open apple key, not for us...
jsr DRV.TERM.Title.ON
bra .6
.11 jsr DRV.TERM.Title.OFF
lda KBD
bpl .6
sta KBDSTROBE
@ -233,20 +242,17 @@ DRV.TERM.READ >STYA ZPIOCTL
sec
rts
*--------------------------------------
DRV.TERM.WRITE >STYA ZPIOCTL
jsr DRV.TERM.GetIOCTLBufAndCnt
DRV.TERM.WRITE jsr DRV.TERM.GetIOCTLBufAndCnt
jsr DRV.TERM.GetDCB
jsr DRV.TERM.GetActive
.1 inc ZPCount
bne .2
inc ZPCount+1
beq .8
beq FS.8
.2 ldy #S.DCB.TTY.MODE
.2 jsr DRV.TERM.CUROFF
ldy #S.DCB.TTY.MODE
lda (ZPDCBPtr),y
tax
@ -258,13 +264,11 @@ DRV.TERM.WRITE >STYA ZPIOCTL
bra .1
.3 jmp (.4,x)
.4 .DA DRV.TERM.COUT
.DA DRV.TERM.ESC
.DA DRV.TERM.CSI
.DA DRV.TERM.IAC
.8 clc
rts
*--------------------------------------
DRV.TERM.COUT lda (ZPBufPtr)
@ -272,21 +276,12 @@ DRV.TERM.COUT lda (ZPBufPtr)
bne .1
lda #S.DCB.TTY.MODE.IAC
sta (ZPDCBPtr),y
bra DRV.TERM.SETMODE
ldy #S.DCB.TTY.INBUFFER
lda #S.DCB.TTY.INBUFFER
sta (ZPDCBPtr),y
clc
rts
.1 pha
jsr CUROFF
pla
cmp #C.DEL
beq DEL
.1 cmp #C.DEL
beq DRV.TERM.COUT.DEL
cmp #C.SPACE
bcc COUT.Ctrl
bcc DRV.TERM.COUT.Ctrl
ldy #S.DCB.TTY.bINVERSE
ora (ZPDCBPtr),y
@ -313,7 +308,8 @@ FS ldy #S.DCB.TTY.CH
FS.8 clc
rts
*--------------------------------------
DEL ldy #S.DCB.TTY.CH
DRV.TERM.COUT.DEL
ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
beq .1
dec
@ -336,7 +332,8 @@ DEL ldy #S.DCB.TTY.CH
ora (ZPDCBPtr),y
jmp SetCharAtCurPos
*--------------------------------------
COUT.Ctrl ldx #CtrlChars.Cnt-1
DRV.TERM.COUT.Ctrl
ldx #CtrlChars.Cnt-1
.1 cmp CtrlChars,x
beq .2
@ -348,14 +345,27 @@ COUT.Ctrl ldx #CtrlChars.Cnt-1
.2 txa
asl
tax
jmp (J.CtrlChars,x)
jmp (.8,x)
.8 .DA ENQ 5
.DA BS 8
.DA LF 10
.DA FF 12
.DA CROUT 13
.DA FS 21
.DA ESC 27
*--------------------------------------
ESC lda #S.DCB.TTY.MODE.ESC
bra DRV.TERM.SETMODE
*--------------------------------------
DRV.TERM.ESC lda (ZPBufPtr)
cmp #'['
bne .1
bne DRV.TERM.ESC1
lda #S.DCB.TTY.MODE.CSI
DRV.TERM.SETMODE
sta (ZPDCBPtr),y
ldy #S.DCB.TTY.INBUFFER
lda #S.DCB.TTY.INBUFFER
@ -363,7 +373,7 @@ DRV.TERM.ESC lda (ZPBufPtr)
clc
rts
.1 lda #0 y = #S.DCB.TTY.MODE
DRV.TERM.ESC1 lda #0 y = #S.DCB.TTY.MODE
sta (ZPDCBPtr),y
ldx #EscCodes.Cnt-1
@ -802,36 +812,29 @@ RESET.MODE lda #0
clc
rts
*--------------------------------------
RESET jsr RESET.MODE
RESET.VALUES .DA #0 S.DCB.TTY.MODE
.DA #0 S.DCB.TTY.CH
.DA #0 S.DCB.TTY.CV
.DA #0 S.DCB.TTY.SCROLLTOP
.DA #23 S.DCB.TTY.SCROLLBOT
.DA #0 S.DCB.TTY.bCURON
.DA #0 S.DCB.TTY.CURCHAR
.DA #$80 S.DCB.TTY.bINVERSE
.DA #$80 S.DCB.TTY.bLINEWRAP
.DA #0 S.DCB.TTY.bTITLE
.DA #S.DCB.TTY.OUTBUFFER S.DCB.TTY.OUTTAIL
.DA #S.DCB.TTY.OUTBUFFER S.DCB.TTY.OUTHEAD
.DA #S.DCB.TTY.INBUFFER S.DCB.TTY.INBUFFER
*--------------------------------------
RESET ldy #1
ldy #S.DCB.TTY.OUTTAIL
sta (ZPDCBPtr),y
iny
sta (ZPDCBPtr),y
ldy #S.DCB.TTY.bCURON
sta (ZPDCBPtr),y
dec
ldy #S.DCB.TTY.bLINEWRAP
.1 iny
lda RESET.VALUES-2,y
sta (ZPDCBPtr),y
cpy #S.DCB.TTY.INBUFFER
bne .1
lda #0
ldy #S.DCB.TTY.SCROLLTOP
sta (ZPDCBPtr),y
iny
lda #23
sta (ZPDCBPtr),y
lda #S.DCB.TTY.OUTBUFFER
ldy #S.DCB.TTY.OUTTAIL
sta (ZPDCBPtr),y
iny
sta (ZPDCBPtr),y
jsr DRV.TERM.CLRSCR
jmp DRV.TERM.CLRSCR
*--------------------------------------
RESETATTR lda #$80
ldy #S.DCB.TTY.bINVERSE
@ -839,14 +842,6 @@ RESETATTR lda #$80
clc
rts
*--------------------------------------
J.CtrlChars .DA ENQ 5
.DA BS 8
.DA LF 10
.DA DRV.TERM.CLRSCR 12
.DA CROUT 13
.DA FS 21
.DA ESC 27
*--------------------------------------
ENQ ldx #0
.1 lda ENQ.String,x
@ -881,6 +876,13 @@ BS ldy #S.DCB.TTY.CH
.2 clc
rts
*--------------------------------------
FF lda #0
ldy #S.DCB.TTY.CV
sta (ZPDCBPtr),y
dey
sta (ZPDCBPtr),y
jmp DRV.TERM.CLRSCR
*--------------------------------------
CROUT lda #0
ldy #S.DCB.TTY.CH
sta (ZPDCBPtr),y
@ -900,13 +902,6 @@ LF ldy #S.DCB.TTY.CV
clc
rts
*--------------------------------------
ESC lda #S.DCB.TTY.MODE.ESC
ldy #S.DCB.TTY.MODE
sta (ZPDCBPtr),y
clc
rts
*--------------------------------------
SCROLL.UP ldy #S.DCB.TTY.SCROLLTOP
lda (ZPDCBPtr),y
@ -916,7 +911,7 @@ SCROLL.UP ldy #S.DCB.TTY.SCROLLTOP
inx
jsr COPY.XtoL1
jsr DRV.TERM.COPY.XtoL1
txa
ldy #S.DCB.TTY.SCROLLBOT
@ -969,7 +964,7 @@ SCROLL.DN ldy #S.DCB.TTY.SCROLLBOT
dex
jsr COPY.XtoL1
jsr DRV.TERM.COPY.XtoL1
txa
ldy #S.DCB.TTY.SCROLLTOP
@ -979,40 +974,37 @@ SCROLL.DN ldy #S.DCB.TTY.SCROLLBOT
clc
rts
*--------------------------------------
CUROFF ldy #S.DCB.TTY.bCURON
DRV.TERM.CUROFF ldy #S.DCB.TTY.bCURON
lda (ZPDCBPtr),y
beq CUREXIT.RTS
CURBLNK bit bActive
bmi CURBLNK1
beq DRV.TERM.CURBLNK.RTS
DRV.TERM.CURBLNK
bit bActive
bpl DRV.TERM.CURBLNK.RTS do not Light if screen is not active
ldy #S.DCB.TTY.bCURON
lda (ZPDCBPtr),y
bne CURBLNK.OFF
rts do not Light if screen is not active
CURBLNK1 ldy #S.DCB.TTY.bCURON
lda (ZPDCBPtr),y
bne CURBLNK.OFF
bne DRV.TERM.CURBLNK.OFF
jsr GetCharAtCurPos
ldy #S.DCB.TTY.CURCHAR
sta (ZPDCBPtr),y
and #$80
eor #" "
bra CUREXIT
bra DRV.TERM.CURBLNK.SET
CURBLNK.OFF ldy #S.DCB.TTY.CURCHAR
DRV.TERM.CURBLNK.OFF
ldy #S.DCB.TTY.CURCHAR
lda (ZPDCBPtr),y
CUREXIT jsr SetCharAtCurPos
DRV.TERM.CURBLNK.SET
jsr SetCharAtCurPos
ldy #S.DCB.TTY.bCURON
lda (ZPDCBPtr),y
eor #CURSOR.BLINK.SPEED
sta (ZPDCBPtr),y
CUREXIT.RTS rts
DRV.TERM.CURBLNK.RTS
rts
*--------------------------------------
Decimal.Out stz ZPTmpWord
stz ZPTmpWord+1
@ -1125,9 +1117,7 @@ DRV.TERM.GetDCB ldy #S.FD.DEV.DCBPTR
iny
lda (pFD),y
sta ZPDCBPtr+1
rts
*--------------------------------------
DRV.TERM.GetActive
ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y
cmp A2osX.ASCREEN
@ -1138,7 +1128,16 @@ DRV.TERM.GetActive
rts
*--------------------------------------
DRV.TERM.GetIOCTLBufAndCnt
ldy #S.IOCTL.BYTECNT
>STYA ZPIOCTL
ldy #S.IOCTL.BUFPTR
lda (ZPIOCTL),y
sta ZPBufPtr
iny
lda (ZPIOCTL),y
sta ZPBufPtr+1
iny #S.IOCTL.BYTECNT
lda (ZPIOCTL),y
eor #$ff
@ -1148,88 +1147,62 @@ DRV.TERM.GetIOCTLBufAndCnt
eor #$ff
sta ZPCount+1
DRV.TERM.GetIOCTLBuf
ldy #S.IOCTL.BUFPTR
lda (ZPIOCTL),y
sta ZPBufPtr
iny
lda (ZPIOCTL),y
sta ZPBufPtr+1
rts
*--------------------------------------
DRV.TERM.SETUP.L1X
ldy #S.FD.DEV.BUFPTR
lda (pFD),y
clc
adc BUF.BASEL,x
sta ZPBufBaseL1
*--------------------------------------
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
lda Dev.Table.hPath,x
jsr K.GetMemPtr
>STYA ZPTmpWord
ldx #0
jsr DRV.TERM.SETUP.L1X.SCR
ldy #0
.1 lda (ZPTmpWord),y
beq .2
cmp #$40
bcc .10
cmp #$5F
bcs .10
and #$3F
.10 phy
jsr SetCharAtY.SCR
ply
iny
lda (pFD),y
adc BUF.BASEH,x
sta ZPBufBaseL1+1
bne .1
bit bActive
bpl .8
.2 lda #C.SPACE
lda SCR.BASEL,x
sta ZPScrBaseL1
lda SCR.BASEH,x
sta ZPScrBaseL1+1
.8 rts
*--------------------------------------
SCR.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
SCR.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07
*--------------------------------------
BUF.BASEL .DA #S.TTYBUF.SCRBUF
.DA #S.TTYBUF.SCRBUF+80
.DA #S.TTYBUF.SCRBUF+160
.DA #S.TTYBUF.SCRBUF+240
.DA #S.TTYBUF.SCRBUF+320
.DA #S.TTYBUF.SCRBUF+400
.DA #S.TTYBUF.SCRBUF+480
.DA #S.TTYBUF.SCRBUF+560
.DA #S.TTYBUF.SCRBUF+640
.DA #S.TTYBUF.SCRBUF+720
.DA #S.TTYBUF.SCRBUF+800
.DA #S.TTYBUF.SCRBUF+880
.DA #S.TTYBUF.SCRBUF+960
.DA #S.TTYBUF.SCRBUF+1040
.DA #S.TTYBUF.SCRBUF+1120
.DA #S.TTYBUF.SCRBUF+1200
.DA #S.TTYBUF.SCRBUF+1280
.DA #S.TTYBUF.SCRBUF+1360
.DA #S.TTYBUF.SCRBUF+1440
.DA #S.TTYBUF.SCRBUF+1520
.DA #S.TTYBUF.SCRBUF+1600
.DA #S.TTYBUF.SCRBUF+1680
.DA #S.TTYBUF.SCRBUF+1760
.DA #S.TTYBUF.SCRBUF+1840
BUF.BASEH .DA /S.TTYBUF.SCRBUF
.DA /S.TTYBUF.SCRBUF+80
.DA /S.TTYBUF.SCRBUF+160
.DA /S.TTYBUF.SCRBUF+240
.DA /S.TTYBUF.SCRBUF+320
.DA /S.TTYBUF.SCRBUF+400
.DA /S.TTYBUF.SCRBUF+480
.DA /S.TTYBUF.SCRBUF+560
.DA /S.TTYBUF.SCRBUF+640
.DA /S.TTYBUF.SCRBUF+720
.DA /S.TTYBUF.SCRBUF+800
.DA /S.TTYBUF.SCRBUF+880
.DA /S.TTYBUF.SCRBUF+960
.DA /S.TTYBUF.SCRBUF+1040
.DA /S.TTYBUF.SCRBUF+1120
.DA /S.TTYBUF.SCRBUF+1200
.DA /S.TTYBUF.SCRBUF+1280
.DA /S.TTYBUF.SCRBUF+1360
.DA /S.TTYBUF.SCRBUF+1440
.DA /S.TTYBUF.SCRBUF+1520
.DA /S.TTYBUF.SCRBUF+1600
.DA /S.TTYBUF.SCRBUF+1680
.DA /S.TTYBUF.SCRBUF+1760
.DA /S.TTYBUF.SCRBUF+1840
.3 phy
jsr SetCharAtY.SCR
ply
iny
cpy #80
bne .3
DRV.TERM.Title.RTS
rts
DRV.TERM.Title.OFF
ldy #S.DCB.TTY.bTITLE
lda (ZPDCBPtr),y
bpl DRV.TERM.Title.RTS
lda #$0
sta (ZPDCBPtr),y
jmp DRV.TERM.LINE0CPY
*--------------------------------------
CtrlChars .HS 05080A0C0D151B
CtrlChars.Cnt .EQ *-CtrlChars

View File

@ -2,6 +2,80 @@ NEW
PREFIX
AUTO 4,1
*--------------------------------------
DRV.TERM.SETUP.L1X
ldy #S.FD.DEV.BUFPTR
lda (pFD),y
clc
adc BUF.BASEL,x
sta ZPBufBaseL1
iny
lda (pFD),y
adc BUF.BASEH,x
sta ZPBufBaseL1+1
bit bActive
bpl DRV.TERM.SETUP.L1X.8
DRV.TERM.SETUP.L1X.SCR
lda SCR.BASEL,x
sta ZPScrBaseL1
lda SCR.BASEH,x
sta ZPScrBaseL1+1
DRV.TERM.SETUP.L1X.8
rts
*--------------------------------------
SCR.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
SCR.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07
*--------------------------------------
BUF.BASEL .DA #S.TTYBUF.SCRBUF
.DA #S.TTYBUF.SCRBUF+80
.DA #S.TTYBUF.SCRBUF+160
.DA #S.TTYBUF.SCRBUF+240
.DA #S.TTYBUF.SCRBUF+320
.DA #S.TTYBUF.SCRBUF+400
.DA #S.TTYBUF.SCRBUF+480
.DA #S.TTYBUF.SCRBUF+560
.DA #S.TTYBUF.SCRBUF+640
.DA #S.TTYBUF.SCRBUF+720
.DA #S.TTYBUF.SCRBUF+800
.DA #S.TTYBUF.SCRBUF+880
.DA #S.TTYBUF.SCRBUF+960
.DA #S.TTYBUF.SCRBUF+1040
.DA #S.TTYBUF.SCRBUF+1120
.DA #S.TTYBUF.SCRBUF+1200
.DA #S.TTYBUF.SCRBUF+1280
.DA #S.TTYBUF.SCRBUF+1360
.DA #S.TTYBUF.SCRBUF+1440
.DA #S.TTYBUF.SCRBUF+1520
.DA #S.TTYBUF.SCRBUF+1600
.DA #S.TTYBUF.SCRBUF+1680
.DA #S.TTYBUF.SCRBUF+1760
.DA #S.TTYBUF.SCRBUF+1840
BUF.BASEH .DA /S.TTYBUF.SCRBUF
.DA /S.TTYBUF.SCRBUF+80
.DA /S.TTYBUF.SCRBUF+160
.DA /S.TTYBUF.SCRBUF+240
.DA /S.TTYBUF.SCRBUF+320
.DA /S.TTYBUF.SCRBUF+400
.DA /S.TTYBUF.SCRBUF+480
.DA /S.TTYBUF.SCRBUF+560
.DA /S.TTYBUF.SCRBUF+640
.DA /S.TTYBUF.SCRBUF+720
.DA /S.TTYBUF.SCRBUF+800
.DA /S.TTYBUF.SCRBUF+880
.DA /S.TTYBUF.SCRBUF+960
.DA /S.TTYBUF.SCRBUF+1040
.DA /S.TTYBUF.SCRBUF+1120
.DA /S.TTYBUF.SCRBUF+1200
.DA /S.TTYBUF.SCRBUF+1280
.DA /S.TTYBUF.SCRBUF+1360
.DA /S.TTYBUF.SCRBUF+1440
.DA /S.TTYBUF.SCRBUF+1520
.DA /S.TTYBUF.SCRBUF+1600
.DA /S.TTYBUF.SCRBUF+1680
.DA /S.TTYBUF.SCRBUF+1760
.DA /S.TTYBUF.SCRBUF+1840
*--------------------------------------
DRV.TERM.CLRSCR ldx #23
sta SET80STORE
@ -16,7 +90,7 @@ DRV.TERM.CLRSCR ldx #23
ldy #39
.2 sta (ZPScrBaseL1),y
.2 sta (ZPScrBaseL1),y
dey
bpl .2
@ -24,7 +98,7 @@ DRV.TERM.CLRSCR ldx #23
ldy #39
.3 sta (ZPScrBaseL1),y
.3 sta (ZPScrBaseL1),y
dey
bpl .3
@ -32,7 +106,7 @@ DRV.TERM.CLRSCR ldx #23
ldy #79
.5 sta (ZPBufBaseL1),y
.5 sta (ZPBufBaseL1),y
dey
bpl .5
@ -48,21 +122,23 @@ DRV.TERM.CLRSCR ldx #23
sta (ZPDCBPtr),y
rts
*--------------------------------------
DRV.TERM.SCRCPY ldx #0
DRV.TERM.LINE0CPY
ldx #0
.HS 2C BIT ABS
DRV.TERM.SCRCPY ldx #23
sta SET80STORE
.1 ldy #S.FD.DEV.BUFPTR
lda (pFD),y
clc
adc BUF.BASEL,x
sta .2+1
sta .3+1
sta .80+1
iny
lda (pFD),y
adc BUF.BASEH,x
sta .2+2
sta .3+2
sta .80+2
lda SCR.BASEL,x
sta ZPScrBaseL1
@ -74,94 +150,39 @@ DRV.TERM.SCRCPY ldx #0
sta SETREADAUX
ldx #78
ldy #39
sta SETPAGE2
.2 lda $ffff,x SELF MODIFIED
sta (ZPScrBaseL1),y
dex
dex
dey
bpl .2
ldy #39
jsr .8
ldx #79
ldy #39
sta CLRPAGE2
ldy #39
.3 lda $ffff,x SELF MODIFIED
sta (ZPScrBaseL1),y
dex
dex
dey
bpl .3
jsr .8
sta CLRREADAUX
plx
inx
cpx #24
bne .1
dex
bpl .1
rts
*--------------------------------------
SetCharAtCurPos pha
ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
tax
.8 ldy #39
.80 lda $ffff,x SELF MODIFIED
sta (ZPScrBaseL1),y
dex
dex
dey
lda (ZPDCBPtr),y
tay
pla
*--------------------------------------
SetCharAtYX cmp #$40
bcc .1
cmp #$5F
bcs .1
and #$3F
.1 pha
phy
jsr DRV.TERM.SETUP.L1X
ply
pla
sta SETWRITEAUX
sta (ZPBufBaseL1),y
sta CLRWRITEAUX
bit bActive
bpl .8
pha
tya
lsr
tay
pla
bcs .2
sta SET80STORE
sta SETPAGE2
.2 sta (ZPScrBaseL1),y
sta CLRPAGE2
.8 rts
*--------------------------------------
GetCharAtCurPos ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
tax
jsr DRV.TERM.SETUP.L1X
ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
tay
sta SETREADAUX
lda (ZPBufBaseL1),y
sta CLRREADAUX
bpl .80
rts
*--------------------------------------
COPY.XtoL1 ldy #79
DRV.TERM.COPY.XtoL1
ldy #79
sta SETWRITEAUX
sta SETREADAUX
@ -196,6 +217,65 @@ COPY.XtoL1 ldy #79
bpl .7
.8 rts
*--------------------------------------
SetCharAtCurPos pha
ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
tax
dey
lda (ZPDCBPtr),y
tay
pla
*--------------------------------------
SetCharAtYX cmp #$40
bcc .1
cmp #$5F
bcs .1
and #$3F
.1 pha
phy
jsr DRV.TERM.SETUP.L1X
ply
pla
sta SETWRITEAUX
sta (ZPBufBaseL1),y
sta CLRWRITEAUX
bit bActive
bpl SetCharAtYX.8
SetCharAtY.SCR
pha
tya
lsr
tay
pla
sta SET80STORE
bcs .2
sta SETPAGE2
.2 sta (ZPScrBaseL1),y
sta CLRPAGE2
SetCharAtYX.8 rts
*--------------------------------------
GetCharAtCurPos ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
tax
jsr DRV.TERM.SETUP.L1X
ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
tay
sta SETREADAUX
lda (ZPBufBaseL1),y
sta CLRREADAUX
rts
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.TERMLC
LOAD USR/SRC/SYS/KERNEL.S

View File

@ -21,13 +21,16 @@ AUTO 4,1
.INB USR/SRC/SYS/KERNEL.S.INIT
.INB USR/SRC/X.PRINTF.S
A2osX.MAIN .PH $1100
A2osX.MAIN .PH $1480
.INB USR/SRC/SYS/KERNEL.S.CORE
.INB USR/SRC/SYS/KERNEL.S.DRV
.INB USR/SRC/SYS/KERNEL.S.TERM
Mem.MLoMem .EQ *
.EP
A2osX.AUX .PH $0800
A2osX.AUX .PH $1000
.INB USR/SRC/SYS/KERNEL.S.OSD
.INB USR/SRC/SYS/KERNEL.S.SLIST
Mem.XLoMem .EQ *
.EP
A2osX.GP .PH $BD00
.INB USR/SRC/SYS/KERNEL.S.GP
@ -53,7 +56,6 @@ A2osX.E0 .PH $E000
.INB USR/SRC/SYS/KERNEL.S.JMP
.INB USR/SRC/SYS/KERNEL.S.IRQ
.INB USR/SRC/SYS/KERNEL.S.MEM
.INB USR/SRC/SYS/KERNEL.S.TERM
.INB USR/SRC/SYS/KERNEL.S.TERMLC
********* TMP ***** go to A2osX.D1
.INB USR/SRC/SYS/KERNEL.S.PFT