Kernel 0.92

This commit is contained in:
Rémy GIBERT 2018-12-14 08:32:20 +01:00
parent 15942f7f07
commit 69ea50ba1a
5 changed files with 44 additions and 360 deletions

View File

@ -224,325 +224,6 @@ DRV.NULL.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DIB.S.OPENED
.DA #0
.DA K.VER
*--------------------------------------
* SYS DEVICE
*--------------------------------------
DRV.SYS cld
>STYA pIOCTL
jmp (.1,x)
.1 .DA DRV.SYS.STATUS
.DA A2osX.BADCALL READBLOCK
.DA A2osX.BADCALL WRITEBLOCK
.DA A2osX.BADCALL FORMAT
.DA DRV.SYS.Control
.DA A2osX.BADCALL INIT
.DA DRV.SYS.OPEN
.DA DRV.SYS.CLOSE
.DA DRV.SYS.Read
.DA DRV.SYS.Write
*--------------------------------------
DRV.SYS.STATUS >LDYAI DRV.SYS.DIB
jmp DRV.STATUS.YA
*--------------------------------------
DRV.SYS.Open ldx #0
.1 ldy A2osX.SCRNDEVS,x
beq .2
inx
cpx #K.SCR.MAX
bne .1
lda #E.OOH
sec
rts
.2 sta A2osX.SCRNDEVS,x DEV.ID in A
sta DRV.SYS.DEVID
jsr DRV.SYS.FF
*--------------------------------------
DRV.SYS.Control sta SETTEXT
sta SETALTCHAR
sta SET80DISP
sta CLR80STORE
sta SETPAGE2
lda DRV.SYS.DEVID
sta A2osX.ASCREEN
DRV.SYS.CLOSE
clc
rts
*--------------------------------------
DRV.SYS.Read lda A2osX.ASCREEN
cmp DRV.SYS.DEVID is screen active?
bne .9
lda OPENAPPLE
bmi .9 Open apple key, not for us...
lda KBD
bpl .9
sta KBDSTROBE
and #$7F
tax
jmp DRV.READ.X
.9 lda #0 Error = no event
sec
rts
*--------------------------------------
DRV.SYS.WRITE ldy #S.IOCTL.BUFPTR
lda (pIOCTL),y
sta ZPDRV+4
iny
lda (pIOCTL),y
sta ZPDRV+5
ldy #S.IOCTL.BYTECNT
lda (pIOCTL),y
eor #$ff
tax
iny
lda (pIOCTL),y
eor #$ff
tay
.2 inx
bne .3
iny
bne .3
clc
rts
.3 lda (ZPDRV+4)
inc ZPDRV+4
bne .4
inc ZPDRV+5
.4 jsr DRV.SYS.COUT
.5 bra .2
*--------------------------------------
DRV.SYS.COUT phx
phy
cmp #' '
bcs .1
jsr DRV.SYS.CTRL
bra .8
.1 ora #$80
ldy DRV.SYS.CH
ldx DRV.SYS.CV
jsr DRV.SYS.SetCharAtYX
jsr DRV.SYS.FS
.8 ply
plx
clc
rts
*--------------------------------------
DRV.SYS.CTRL ldx #DRV.SYS.CTRLCNT-1
.1 cmp DRV.SYS.CTRLS,x
beq .2
dex
bpl .1
clc
rts
.2 txa
asl
tax
jmp (.3,x)
.3 .DA DRV.SYS.ENQ 5
.DA DRV.SYS.BS 8
.DA DRV.SYS.LF 10
.DA DRV.SYS.FF 12
.DA DRV.SYS.CR 13
.DA DRV.SYS.FS 21
.DA DRV.SYS.ESC 27
*--------------------------------------
DRV.SYS.ENQ clc
rts
*--------------------------------------
DRV.SYS.BS ldx DRV.SYS.CH
beq .1
dec DRV.SYS.CH
bra .3
.1 ldy DRV.SYS.CV
cpy #1
bne .2
clc
rts
.2 lda #79
sta DRV.SYS.CH
dec DRV.SYS.CV
.3 clc
rts
*--------------------------------------
DRV.SYS.LF ldx DRV.SYS.CV
cpx #23
beq DRV.SYS.Scroll
inc DRV.SYS.CV
rts
*--------------------------------------
DRV.SYS.FF ldx #23
.1 jsr DRV.SYS.ClrLineAtX
dex
bne .1
stz DRV.SYS.CH
lda #1
sta DRV.SYS.CV
rts
*--------------------------------------
DRV.SYS.CR jsr DRV.SYS.ClrEOL
stz DRV.SYS.CH
rts
*--------------------------------------
DRV.SYS.FS lda DRV.SYS.CH
cmp #79
bne .1
stz DRV.SYS.CH
bra DRV.SYS.LF
.1 inc DRV.SYS.CH
rts
*--------------------------------------
DRV.SYS.ESC
clc
rts
*--------------------------------------
DRV.SYS.ClrEOL ldx DRV.SYS.CV
lda #$A0
ldy DRV.SYS.CH
.1 cpy #79
beq .2
jsr DRV.SYS.SetCharAtYX
iny
bne .1
.2 rts
*--------------------------------------
DRV.SYS.ScrollAux
sta SETREADAUX
.1 lda (ZPDRV+2),y
sta (ZPDRV),y
dey
bpl .1
sta CLRREADAUX
rts
*--------------------------------------
DRV.SYS.Scroll ldx #DRV.SYS.Scroll-DRV.SYS.ScrollAux-1
.1 lda DRV.SYS.ScrollAux,x
sta $102,x
dex
bpl .1
ldx #1
.2 jsr DRV.SYS.SetBaseX
inx
lda DRV.SYS.BASEL,x
sta ZPDRV+2
lda DRV.SYS.BASEH,x
sta ZPDRV+3
ldy #39
sta SETWRITEAUX
jsr $102
sta CLRWRITEAUX
ldy #39
.3 lda (ZPDRV+2),y
sta (ZPDRV),y
dey
bpl .3
cpx #23
bne .2 Fall in ClrLineAtX for last line
*--------------------------------------
DRV.SYS.ClrLineAtX
jsr DRV.SYS.SetBaseX
lda #$A0
ldy #39
.1 sta SETWRITEAUX
sta (ZPDRV),y
sta CLRWRITEAUX
sta (ZPDRV),y
dey
bpl .1
rts
*--------------------------------------
DRV.SYS.SetCharAtYX
cmp #$40
bcc .1
cmp #$5F
bcs .1
and #$3F
.1 phy
pha
jsr DRV.SYS.SetBaseX
tya
lsr
tay
pla
bcs .2
sta SETWRITEAUX
sta (ZPDRV),y
sta CLRWRITEAUX
ply
rts
.2 sta (ZPDRV),y
ply
rts
*--------------------------------------
DRV.SYS.SetBaseX
lda DRV.SYS.BASEL,x
sta ZPDRV
lda DRV.SYS.BASEH,x
sta ZPDRV+1
rts
*--------------------------------------
DRV.SYS.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ
.DA #0,#0,#0
>PSTR "A2osX VT100 TERM"
.DA #S.DIB.T.CHAR
.DA #0
.DA K.VER
*--------------------------------------
DRV.SYS.DEVID .BS 1
DRV.SYS.CH .BS 1
DRV.SYS.CV .BS 1
*--------------------------------------
DRV.SYS.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
DRV.SYS.BASEH .HS 08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B
DRV.SYS.CTRLCNT .EQ 7
DRV.SYS.CTRLS .HS 05080A0C0D151B
*--------------------------------------
DRV.STATUS.YA >STYA .2+1
ldy #S.IOCTL.STATCODE

View File

@ -101,6 +101,12 @@ Kernel.Init3 sta SETALTZP
lda #$ff Make sure we are in Kernel Mode during setup
sta IRQ.InKernel
sta CLRMIXED
sta CLRHIRES
sta SET80STORE
sta CLRPAGE2
sta SETALTCHAR
jsr MemMgrInit
>PUSHWI FD.NULL.NAME

View File

@ -6,7 +6,6 @@ CURSOR.BLINK.SPEED .EQ 2
*--------------------------------------
ZPIOCTL .EQ ZPDRV
ZPDCBPtr .EQ ZPDRV+2
ZPTTYBufPtr .EQ ZPDRV+4
ZPBufPtr .EQ ZPDRV+10
ZPCount .EQ ZPDRV+12
ZPBufBaseL1 .EQ ZPDRV+14
@ -19,7 +18,7 @@ ZPTmpBool .EQ ZPDRV+24
DRV.TERM cld
>STYA pIOCTL
ldy #S.FD.DEV.BUFPTR
ldy #S.FD.DEV.DCBPTR
lda (pFD),y
sta ZPDCBPtr
iny
@ -65,12 +64,13 @@ DRV.TERM.STATUS ldy #S.IOCTL.BUFPTR
.1 ldy #3
.2 lda DRV.TERM.DIB,y
.3 sta (ZPBufPtr),y SELF MODIFIED
.3 sta (ZPBufPtr),y
dey
bne .2
ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y
sta (ZPBufPtr)
clc
rts
@ -113,10 +113,7 @@ DRV.TERM.OPEN ldx #0
*--------------------------------------
DRV.TERM.CONTROL
sta SETTEXT
sta SETALTCHAR
sta SET80DISP
sta CLR80STORE
sta CLRPAGE2
ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y
sta A2osX.ASCREEN
@ -1111,6 +1108,27 @@ GetPtrsAndCnt ldy #S.IOCTL.BUFPTR
sta ZPCount+1
rts
*--------------------------------------
SETUP.L1X clc
ldy #S.FD.DEV.BUFPTR
lda SCR.BASEL,x
adc (pFD),y
sta ZPBufBaseL1
iny
lda SCR.BASEH,x
adc (pFD),y
sta ZPBufBaseL1+1
bit bActive
bpl .8
lda SCR.BASEL,x
sta ZPScrBaseL1
lda SCR.BASEH,x
sta ZPScrBaseL1+1
.8 rts
*--------------------------------------
DRV.CS.END
*--------------------------------------
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

View File

@ -11,7 +11,7 @@ ClrScr ldx #23
bit bActive
bpl .4
sta SETWRITEAUX
sta SETPAGE2
ldy #39
@ -19,7 +19,7 @@ ClrScr ldx #23
dey
bpl .2
sta CLRWRITEAUX
sta CLRPAGE2
ldy #39
@ -61,58 +61,39 @@ SetCharAtYX cmp #$40
and #$3F
.10 pha
phy
jsr SETUP.L1X
tya
pla
lsr
tay
pla
bcs .1
sta SETWRITEAUX
sta SETPAGE2
.1 sta (ZPScrBaseL1),y
sta CLRWRITEAUX
sta CLRPAGE2
rts
*--------------------------------------
GetCharAtCurPos ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
tax
dey
lda (ZPDCBPtr),y
tay
jsr SETUP.L1X
tya
ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
lsr
tay
bcs .1
sta SETREADAUX
sta SETPAGE2
.1 lda (ZPScrBaseL1),y
sta CLRREADAUX
sta CLRPAGE2
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
@ -134,13 +115,11 @@ COPY.XtoL1 ldy #79
lda SCR.BASEH,x
sta ZPScrBaseL2+1
sta SETWRITEAUX
sta SETREADAUX
sta SETPAGE2
jsr .6
sta CLRWRITEAUX
sta CLRREADAUX
sta CLRPAGE2
.6 ldy #39

View File

@ -25,7 +25,7 @@ A2osX.MAIN .PH $1100
.INB USR/SRC/SYS/KERNEL.S.CORE
.INB USR/SRC/SYS/KERNEL.S.DRV
.EP
A2osX.AUX .PH $0C00
A2osX.AUX .PH $0800
.INB USR/SRC/SYS/KERNEL.S.OSD
.INB USR/SRC/SYS/KERNEL.S.SLIST
.EP