mirror of
https://github.com/A2osX/A2osX.git
synced 2025-04-06 18:37:12 +00:00
0.9
This commit is contained in:
parent
a90fd1ffa9
commit
bae3f91aab
BIN
A2OSX.BOOT.po
BIN
A2OSX.BOOT.po
Binary file not shown.
BIN
A2OSX.DEV.po
BIN
A2OSX.DEV.po
Binary file not shown.
BIN
A2OSX.SRC.po
BIN
A2OSX.SRC.po
Binary file not shown.
@ -151,7 +151,7 @@ MLIOPEN00 .DA #3
|
||||
MLIREAD00 .DA #4
|
||||
.BS 1
|
||||
.DA MLIREAD00.ADDR
|
||||
.DA $2FFA
|
||||
.DA $8000
|
||||
.BS 2
|
||||
MLICLOSE00 .DA #1
|
||||
.BS 1
|
||||
|
@ -17,20 +17,20 @@ STARTPROC GETTY CON ${A2OSX}SBIN/LOGIN
|
||||
#STARTPROC GETTY COM2 ${A2OSX}SBIN/LOGIN
|
||||
#INSDRV PIC.DRV
|
||||
# Network Section
|
||||
INSDRV UTHERNET.DRV 000E3A123456
|
||||
#INSDRV UTHERNET.DRV 000E3A123456
|
||||
#INSDRV UTHERNET2.DRV 0008DC123456
|
||||
#INSDRV UTHER2.AI.DRV 0008DC123456
|
||||
#INSDRV LANCEGS.DRV
|
||||
STARTPROC TCPIP
|
||||
STARTPROC DHCPCLNT
|
||||
#STARTPROC TCPIP
|
||||
#STARTPROC DHCPCLNT
|
||||
#STARTPROC HTTPD
|
||||
#TELNETD
|
||||
#NFSMOUNT 192.168.1.5:/A2OSX /MNT/A2OSX
|
||||
#CIFSMOUNT 192.168.1.5:/MSSHARE /MNT/MSSHARE
|
||||
# End Network Section
|
||||
# GUI Section
|
||||
INSDRV MOUSE.DRV
|
||||
INSDRV DHGR.DRV
|
||||
#INSDRV MOUSE.DRV
|
||||
#INSDRV DHGR.DRV
|
||||
#STARTPROC DESKTOP
|
||||
# End GUI Section
|
||||
ECHO *** End A2osX Startup file ***
|
||||
|
@ -170,7 +170,7 @@ CS.DOEVENT lda (pEvent)
|
||||
|
||||
ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -71,7 +71,7 @@ FIO.OpenFileA sta FIO.hFileName
|
||||
|
||||
.10 >PUSHWI 0
|
||||
>PUSHBI 4
|
||||
>PUSHBI SYS.FOPEN.R+SYS.FOPEN.T
|
||||
>PUSHBI SYS.FOpen.R+SYS.FOpen.T
|
||||
lda FIO.hFileName
|
||||
>SYSCALL GetMemPtrA
|
||||
>PUSHYA
|
||||
@ -270,7 +270,7 @@ FIO.LOAD.ASM.T ldy #ASM.T.hMem
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 6 S.FILEINFO.TYPE.BIN
|
||||
>PUSHBI SYS.FOPEN.R
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHW L.ASM.T.FILENAME
|
||||
>SYSCALL LoadFile
|
||||
bcs .9
|
||||
|
@ -32,14 +32,14 @@ SRC.PrintLineErr ldx #0
|
||||
.1 lda UsrBuf256,x
|
||||
beq .2
|
||||
phx
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
plx
|
||||
inx
|
||||
bcc .1
|
||||
rts
|
||||
|
||||
.2 lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
bcs .9
|
||||
|
||||
ldx #0
|
||||
@ -50,19 +50,19 @@ SRC.PrintLineErr ldx #0
|
||||
beq .4
|
||||
phx
|
||||
lda #'-'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
plx
|
||||
bcs .9
|
||||
bra .3
|
||||
|
||||
.4 lda #'^'
|
||||
phx
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
plx
|
||||
bcs .9
|
||||
|
||||
.5 lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
.9 rts
|
||||
*---------------------------------------
|
||||
SRC.ParseLine ldx UsrBuf256
|
||||
@ -326,12 +326,12 @@ SRC.ParseLine.OpCode
|
||||
.21 inx
|
||||
lda SRC.AM.StrBuf,x
|
||||
phx
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
plx
|
||||
cpx SRC.AM.StrBuf
|
||||
bne .21
|
||||
lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
|
||||
|
||||
.20 ldy #ASM.PC
|
||||
|
@ -121,7 +121,7 @@ SYM.Dump >LDYA L.MSG.SYMBOLS
|
||||
rts
|
||||
|
||||
.5 lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
|
||||
ldy #SYM.DumpCount
|
||||
lda (pData),y
|
||||
|
@ -258,7 +258,7 @@ CS.RUN ldy #bCANCEL
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
lda (pEvent)
|
||||
|
@ -236,7 +236,7 @@ CS.RUN.PRINT sty BytesRead Y,A = Bytes read
|
||||
|
||||
bra .7
|
||||
|
||||
.6 >SYSCALL COutA
|
||||
.6 >SYSCALL PutCA
|
||||
bcs .9
|
||||
|
||||
.7 inc ByteIndex
|
||||
@ -272,11 +272,11 @@ CS.RUN.OPEN >SYSCALL GetFullPathYA
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FILEINFO.TYPE.TXT
|
||||
>PUSHBI SYS.FOPEN.R+SYS.FOPEN.T
|
||||
>PUSHBI SYS.FOpen.R+SYS.FOpen.T
|
||||
|
||||
pla
|
||||
>PUSHYA
|
||||
>SYSCALL FOPEN
|
||||
>SYSCALL FOpen
|
||||
bcs .99
|
||||
|
||||
jsr .99
|
||||
@ -299,7 +299,7 @@ CS.RUN.OPEN >SYSCALL GetFullPathYA
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -187,7 +187,7 @@ CS.RUN ldy #bCANCEL
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -48,11 +48,11 @@ CS.INIT >SYSCALL GetArgC
|
||||
|
||||
>STYA pDev
|
||||
txa
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
sta (pPs),y
|
||||
* ldy #S.PS.hOUTDEV
|
||||
* ldy #S.PS.hStdOut
|
||||
* sta (pPs),y
|
||||
* ldy #S.PS.hERRDEV
|
||||
* ldy #S.PS.hStdErr
|
||||
* sta (pPs),y
|
||||
|
||||
ldx #DEVMGR.OPEN
|
||||
@ -76,7 +76,7 @@ CS.RUN clc
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .99
|
||||
|
||||
|
@ -56,7 +56,7 @@ Ctrl.A ldy #PromptMode
|
||||
>SYSCALL CPrintFYA
|
||||
bcs .9
|
||||
lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
|
||||
sec
|
||||
lda (ZPPTR1)
|
||||
|
@ -13,7 +13,7 @@ SCRN.Init ldy #ScreenH
|
||||
>SYSCALL CPrintFYA
|
||||
bcs .9
|
||||
lda #12
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
bcs .9
|
||||
|
||||
lda #0
|
||||
@ -160,7 +160,7 @@ SCRN.UpdateLineAtALenY
|
||||
pla
|
||||
bcs .11
|
||||
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
.11 ply
|
||||
plx
|
||||
bcs .9
|
||||
@ -412,10 +412,10 @@ SCRN.UpdateViewPort
|
||||
.9 jmp Ctrl.Q
|
||||
*--------------------------------------
|
||||
SCRN.scrollUp lda #$1B
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
bcs .9
|
||||
lda #'M'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
bcs .9
|
||||
|
||||
ldy #ScreenY+1
|
||||
@ -439,10 +439,10 @@ SCRN.scrollUp lda #$1B
|
||||
.9 jmp Ctrl.Q
|
||||
*--------------------------------------
|
||||
SCRN.scrollDn lda #$1B
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
bcs .9
|
||||
lda #'D'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
bcs .9
|
||||
|
||||
ldy #ScreenY+1
|
||||
|
@ -168,7 +168,7 @@ CS.RUN ldy #bCancel
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
@ -345,12 +345,12 @@ CS.QUIT ldy #hBuffer
|
||||
>SYSCALL CPrintFYA
|
||||
bcs .9
|
||||
lda #12
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
LoadFile >PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FILEINFO.TYPE.TXT
|
||||
>PUSHBI SYS.FOPEN.R
|
||||
>PUSHBI SYS.FOpen.R
|
||||
ldy #hFileName
|
||||
lda (pData),y
|
||||
|
||||
@ -426,7 +426,7 @@ SaveFile ldy #hBuffer
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FILEINFO.TYPE.TXT
|
||||
>PUSHBI SYS.FOPEN.X+SYS.FOPEN.W
|
||||
>PUSHBI SYS.FOpen.X+SYS.FOpen.W
|
||||
ldy #hFileName
|
||||
lda (pData),y
|
||||
|
||||
|
@ -141,7 +141,7 @@ CS.RUN ldy #bCANCEL
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -146,7 +146,7 @@ CS.INIT.LINK >PUSHW L.MSG1.LINK.OK
|
||||
|
||||
.4 phx
|
||||
lda #'0'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
plx
|
||||
dex
|
||||
bne .4
|
||||
|
@ -227,7 +227,7 @@ CS.RUN.DIR ldy #bAllmostAll
|
||||
|
||||
.1 lda #' '
|
||||
phx
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
plx
|
||||
bcs .9
|
||||
dex
|
||||
@ -377,7 +377,7 @@ CS.RUN.NewLine ldy #ColCount
|
||||
beq CS.RUN.NewLine.8
|
||||
CS.RUN.NewLine.1
|
||||
lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
rts
|
||||
CS.RUN.NewLine.8
|
||||
clc
|
||||
@ -394,7 +394,7 @@ CS.RUN.ENTER.MSG
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
242
BIN/LSDEV.S.txt
242
BIN/LSDEV.S.txt
@ -35,251 +35,81 @@ CS.START cld
|
||||
.DA CS.QUIT
|
||||
L.MSG0 .DA MSG0
|
||||
L.MSG1 .DA MSG1
|
||||
L.MSG2 .DA MSG2
|
||||
L.MSG3 .DA MSG3
|
||||
L.RAM .DA RAM
|
||||
L.DISK2 .DA DISK2
|
||||
L.GENERIC .DA GENERIC
|
||||
L.DEV.NAME .DA DEV.NAME
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
CS.INIT jsr DumpA2osXDev
|
||||
bcs .9
|
||||
|
||||
jsr DumpProDOSDev
|
||||
bcs .9
|
||||
|
||||
lda #0 tell TSKMGR that all done ok, but
|
||||
.9 sec we do not want to stay in memory
|
||||
CS.INIT clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
DumpA2osXDev >LDYA L.MSG0
|
||||
CS.RUN >LDYA L.MSG0
|
||||
>SYSCALL CPrintFYA
|
||||
|
||||
>LDYAI DevMgr.Table
|
||||
>STYA ZPPTR1
|
||||
stz DEV.ID
|
||||
|
||||
.2 lda (ZPPTR1)
|
||||
cmp #$D8
|
||||
bne .8
|
||||
.1 lda DEV.ID
|
||||
|
||||
>SYSCALL GetDevByIDA
|
||||
bcs .8
|
||||
>STYA ZPPTR1
|
||||
|
||||
ldy #S.DEV.JMP+1
|
||||
>PUSHB (ZPPTR1),y
|
||||
dey
|
||||
>PUSHB (ZPPTR1),y
|
||||
|
||||
lda ZPPTR1
|
||||
clc
|
||||
adc #S.DEV.NAME
|
||||
tay
|
||||
lda ZPPTR1+1
|
||||
adc #0
|
||||
>PUSHYA
|
||||
ldy #S.DEV.F
|
||||
lda (ZPPTR1),y
|
||||
and #S.DEV.F.LEN
|
||||
sta DEV.NAME
|
||||
tax
|
||||
iny
|
||||
|
||||
.2 lda (ZPPTR1),y
|
||||
sta DEV.NAME-S.DEV.F,y
|
||||
iny
|
||||
dex
|
||||
bne .2
|
||||
|
||||
>PUSHW L.DEV.NAME
|
||||
|
||||
ldy #S.DEV.F
|
||||
>PUSHB (ZPPTR1),y
|
||||
ldy #S.DEV.ID
|
||||
|
||||
ldy #S.DEV.S
|
||||
>PUSHB (ZPPTR1),y
|
||||
|
||||
>PUSHB DEV.ID
|
||||
|
||||
>LDYA L.MSG1
|
||||
>SYSCALL CPrintFYA
|
||||
|
||||
inc DEV.ID
|
||||
|
||||
lda ZPPTR1
|
||||
clc
|
||||
adc #S.DEV
|
||||
sta ZPPTR1
|
||||
bcc .3
|
||||
bcc .1
|
||||
inc ZPPTR1+1
|
||||
bra .1
|
||||
|
||||
.3 inc DEV.ID
|
||||
lda DEV.ID
|
||||
cmp #K.DEV.MAX
|
||||
bne .2
|
||||
|
||||
.8 clc
|
||||
.8 lda #0 tell TSKMGR that all done ok, but
|
||||
.9 sec we do not want to stay in memory
|
||||
rts
|
||||
*--------------------------------------
|
||||
DumpProDOSDev >LDYA L.MSG2
|
||||
>SYSCALL CPrintFYA
|
||||
|
||||
stz BLKCALL.PARAMS CmdNum = 0, STATUS Call
|
||||
stz BLKCALL.PARAMS+4 ask for Block 0
|
||||
stz BLKCALL.PARAMS+5 (in case driver check block validity before checking CmdNum)
|
||||
|
||||
ldx DEVCNT
|
||||
stx DEV.ID
|
||||
|
||||
.1 ldx DEV.ID
|
||||
|
||||
ldy #1
|
||||
|
||||
lda DEVLST,x
|
||||
bpl .2
|
||||
|
||||
iny
|
||||
|
||||
.2 sty Drive
|
||||
|
||||
and #$F0
|
||||
sta BLKCALL.PARAMS+1 UnitNum for BLKCALL, if needed
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
tay Y = DSSS*2
|
||||
|
||||
lsr
|
||||
and #$7
|
||||
sta Slot
|
||||
|
||||
stz ZPPTR1 make Ptr1 = Cn00
|
||||
lda DEVPTRS,y
|
||||
sta ZPPTR2 make Ptr2 = Cnxx (prodos BLK entry point)
|
||||
|
||||
lda DEVPTRS+1,y
|
||||
sta ZPPTR1+1
|
||||
sta ZPPTR2+1
|
||||
|
||||
cmp #$C1
|
||||
bcc .6 3rd Party Driver loaded in RAM...
|
||||
|
||||
cmp #$C8
|
||||
bcs .4 In ProDOS Space.../RAM or DisK II
|
||||
|
||||
ldx #SmartPort.SIG-SmartPort.OFS
|
||||
|
||||
.3 ldy SmartPort.OFS-1,x Check if there is a smartport firmware
|
||||
lda (ZPPTR1),y
|
||||
cmp SmartPort.SIG-1,x
|
||||
bne .6 not a smartport...go check $CnFE
|
||||
dex
|
||||
bne .3
|
||||
|
||||
jsr GO.SmartPort Perform a Smartpot STATUS call
|
||||
bcs .8
|
||||
|
||||
jsr PrintDevStatus
|
||||
|
||||
bra .8
|
||||
|
||||
.4 cmp #$ff RAM ?
|
||||
bne .5
|
||||
>LDYA L.RAM
|
||||
bra .7
|
||||
|
||||
.5 >LDYA L.DISK2
|
||||
bra .7
|
||||
|
||||
.6 >LDYA L.GENERIC
|
||||
|
||||
.7 >STYA .71+1
|
||||
ldy #16
|
||||
.71 lda $ffff,y
|
||||
sta UsrBuf256+S.SPSTAT.NAME,y
|
||||
dey
|
||||
bpl .71
|
||||
|
||||
>LDYA ZPPTR2 Get Block device PTR
|
||||
jsr A2osX.BLKCALL
|
||||
|
||||
bcs .8
|
||||
stx UsrBuf256+S.SPSTAT.BLKNUM
|
||||
sty UsrBuf256+S.SPSTAT.BLKNUM+1
|
||||
stz UsrBuf256+S.SPSTAT.BLKNUM+2
|
||||
|
||||
jsr PrintDevStatus
|
||||
|
||||
.8 dec DEV.ID
|
||||
bmi .9
|
||||
jmp .1
|
||||
|
||||
.9 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
S.SPSTAT.STATUS .EQ 0
|
||||
S.SPSTAT.STATUS.BLK .EQ %10000000
|
||||
S.SPSTAT.STATUS.WRT .EQ %01000000
|
||||
S.SPSTAT.STATUS.RD .EQ %00100000
|
||||
S.SPSTAT.STATUS.ONL .EQ %00010000
|
||||
S.SPSTAT.STATUS.FMT .EQ %00001000
|
||||
S.SPSTAT.STATUS.WRP .EQ %00000100
|
||||
S.SPSTAT.STATUS.IRQ .EQ %00000010
|
||||
S.SPSTAT.STATUS.OPN .EQ %00000001
|
||||
S.SPSTAT.BLKNUM .EQ 1
|
||||
S.SPSTAT.NAME .EQ 4
|
||||
S.SPSTAT.TYPE .EQ 21
|
||||
S.SPSTAT.SUBTYP .EQ 22
|
||||
S.SPSTAT.VER .EQ 23
|
||||
S.SPSTAT .EQ 25
|
||||
*--------------------------------------
|
||||
GO.SmartPort ldy #$ff
|
||||
lda (ZPPTR1),y
|
||||
|
||||
inc
|
||||
inc
|
||||
inc
|
||||
sta .2+1 Entrypoint Offset=+3
|
||||
|
||||
lda ZPPTR1+1 Get $Cn
|
||||
sta .2+2
|
||||
|
||||
and #$0f
|
||||
cmp Slot Driver Slot match Dev Slot ?
|
||||
beq .1 yes...
|
||||
|
||||
inc Slot
|
||||
inc Slot
|
||||
inc Slot
|
||||
inc Drive no...
|
||||
inc Drive Must have been remapped by ProDOS
|
||||
|
||||
.1 stz .3 CMD=Status
|
||||
lda Drive
|
||||
sta SMP.Params+1 UnitNum
|
||||
|
||||
.2 jsr $ffff
|
||||
.3 lda SMP.Params will be relocated
|
||||
rts
|
||||
*--------------------------------------
|
||||
PrintDevStatus >PUSHW UsrBuf256+S.SPSTAT.BLKNUM
|
||||
|
||||
ldy #S.SPSTAT.NAME
|
||||
lda /UsrBuf256
|
||||
>PUSHYA
|
||||
|
||||
>PUSHB Drive
|
||||
>PUSHB Slot
|
||||
>PUSHB UsrBuf256 STATUS
|
||||
>PUSHB Dev.ID
|
||||
|
||||
>LDYA L.MSG3
|
||||
>SYSCALL CPrintFYA
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.RUN
|
||||
CS.EVENT
|
||||
CS.QUIT clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.END
|
||||
SmartPort.OFS .HS 01030507
|
||||
SmartPort.SIG .HS 20000300
|
||||
DiskII.OFS .HS 010305FF
|
||||
DiskII.SIG .HS 20000300
|
||||
MSG0 >CSTR "ID Flags Name Address\n"
|
||||
MSG1 >CSTR "%03d %b %4S $%H\n"
|
||||
MSG2 >CSTR "ID Flags Name Description Size\n"
|
||||
MSG3 >CSTR "%03d %b S%dD%d %S %05D\n"
|
||||
RAM >PSTR "ProDOS Ram Disk "
|
||||
DISK2 >PSTR "Apple Disk ][ "
|
||||
GENERIC >PSTR "Generic Blk Dev "
|
||||
*--------------------------------------
|
||||
SMP.Params .DA #3 Param Count
|
||||
.BS 1 unitNumber
|
||||
.DA UsrBuf256
|
||||
.DA #3 Return DIB
|
||||
MSG0 >CSTR "ID Status Flags Name Address\n"
|
||||
MSG1 >CSTR "%03d %b %b %4S $%H\n"
|
||||
*--------------------------------------
|
||||
DEV.ID .BS 1
|
||||
Slot .BS 1
|
||||
Drive .BS 1
|
||||
DEV.NAME .BS 5
|
||||
MAN
|
||||
SAVE BIN/LSDEV.S
|
||||
ASM
|
||||
|
@ -248,7 +248,7 @@ CS.RUN.PRINTMEM ldy #S.MEM.LEN
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -287,11 +287,11 @@ NSC.Dump ldx #1
|
||||
lda DS1216E.DATA+2
|
||||
jsr PrintBCD
|
||||
lda #'/'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
lda DS1216E.DATA+1
|
||||
jsr PrintBCD
|
||||
lda #'/'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
lda DS1216E.DATA
|
||||
jsr PrintBCD
|
||||
|
||||
@ -304,15 +304,15 @@ NSC.Dump ldx #1
|
||||
.4 and #$3F
|
||||
jsr PrintBCD
|
||||
lda #':'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
lda DS1216E.DATA+5
|
||||
jsr PrintBCD
|
||||
lda #':'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
lda DS1216E.DATA+6
|
||||
jsr PrintBCD
|
||||
lda #'.'
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
lda DS1216E.DATA+7
|
||||
jsr PrintBCD
|
||||
rts
|
||||
@ -323,12 +323,12 @@ PrintBCD pha
|
||||
lsr
|
||||
lsr
|
||||
ora #$30
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
bcs .9
|
||||
pla
|
||||
and #$0f
|
||||
ora #$30
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
GetBCD lda (ZPPtr1),y
|
||||
|
@ -272,7 +272,7 @@ CS.DOEVENT lda (pEvent)
|
||||
|
||||
ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -269,7 +269,7 @@ CS.RUN.PRINT.RC pha
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -171,7 +171,7 @@ CS.DOEVENT lda (pEvent)
|
||||
|
||||
ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -346,7 +346,7 @@ CS.RUN.PRINT.RC pha
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -11,6 +11,7 @@ AUTO 6
|
||||
.INB /A2OSX.DEV/INC/MACROS.I
|
||||
.INB /A2OSX.DEV/INC/A2OSX.I
|
||||
.INB /A2OSX.DEV/INC/IO.I
|
||||
.INB /A2OSX.DEV/INC/PRODOS.I
|
||||
*--------------------------------------
|
||||
CURSOR.BLINK.SPEED .EQ 8
|
||||
ESCSEQ.MAXLEN .EQ 16
|
||||
@ -45,25 +46,27 @@ MSG.DETECT >CSTR "Apple IIe/IIc 80 Col Driver.\n"
|
||||
*--------------------------------------
|
||||
* Device Header (16 Bytes)
|
||||
*--------------------------------------
|
||||
DEV.HEADER cld
|
||||
jmp (DRV.CS.START,x)
|
||||
.HS 00 DevID
|
||||
.DA #S.DEV.F.EVENT+S.DEV.F.COUT+S.DEV.F.CHAR
|
||||
>PSTR "CON" NAME
|
||||
DEV.HEADER .DA DRV.CS.START
|
||||
.DA #S.DEV.S.WRITE+S.DEV.S.READ
|
||||
.DA #3
|
||||
.AS "CON" NAME
|
||||
.HS 00 NAME must Be 5 bytes long
|
||||
.HS 00
|
||||
.HS 00.00.00.00
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
DRV.CS.START .DA OPEN
|
||||
.DA GETEVENT
|
||||
.DA COUT
|
||||
DRV.CS.START cld
|
||||
jmp (.1,x)
|
||||
.1 .DA STATUS
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA CONTROL
|
||||
.DA BADCALL
|
||||
.DA OPEN
|
||||
.DA CLOSE
|
||||
.DA GETINFO
|
||||
.DA IRQ
|
||||
.DA SELECT
|
||||
L.DEVINFO .DA DEVINFO
|
||||
.DA READ
|
||||
.DA WRITE
|
||||
L.STAT .DA STAT
|
||||
*--------------------------------------
|
||||
J.CtrlChars .DA BS 8
|
||||
.DA LF 10
|
||||
@ -82,6 +85,14 @@ J.EscSequences .DA Esc.DispAttr m
|
||||
.DA Esc.Home H
|
||||
.DA 0 end of relocation
|
||||
*--------------------------------------
|
||||
BADCALL lda #MLI.ERR.BADCALL
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
STATUS >LDYA L.STAT
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
OPEN stz CURON
|
||||
|
||||
stz bEscMode
|
||||
@ -90,20 +101,27 @@ OPEN stz CURON
|
||||
stz OutPtr
|
||||
stz OutCnt
|
||||
|
||||
ldy #S.DEV.ID
|
||||
lda (pDev),y
|
||||
sta A2osX.SCRNDEVS
|
||||
sta A2osX.SCRNDEVS DEV.ID in A
|
||||
|
||||
jsr SELECT
|
||||
lda #1
|
||||
sta A2osX.ASCREEN
|
||||
jsr RESET
|
||||
jsr HOME
|
||||
*--------------------------------------
|
||||
CONTROL sta SETTEXT
|
||||
sta SETALTCHAR
|
||||
sta SET80DISP
|
||||
sta CLR80STORE
|
||||
sta CLRPAGE2
|
||||
lda #1
|
||||
sta A2osX.ASCREEN
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
GETEVENT jsr Char.Out.Get
|
||||
bcc .7 no char in output buffer...
|
||||
CLOSE stz A2osX.SCRNDEVS
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
READ jsr Char.Out.Get
|
||||
bcc .8 IF cs,no char in output buffer...
|
||||
|
||||
lda A2osX.ASCREEN
|
||||
cmp #1 is CON active?
|
||||
@ -129,7 +147,7 @@ GETEVENT jsr Char.Out.Get
|
||||
beq .3
|
||||
dex
|
||||
bne .2
|
||||
bra .7
|
||||
bra .8
|
||||
|
||||
.3 lda KeyRemappedIdx,x
|
||||
tay
|
||||
@ -141,23 +159,15 @@ GETEVENT jsr Char.Out.Get
|
||||
bra .4
|
||||
|
||||
.6 jsr Char.Out.Get
|
||||
|
||||
.7 ldy #S.EVT.DATALO
|
||||
sta (pEvent),y
|
||||
iny S.EVT.DATAHI
|
||||
lda #0
|
||||
sta (pEvent),y
|
||||
lda #S.EVT.F.KEY
|
||||
sta (pEvent)
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.9 lda #0 Error = no event
|
||||
.9 lda #0 Error = char
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
COUT bit bEscMode
|
||||
WRITE bit bEscMode
|
||||
bmi COUT.EscMode
|
||||
|
||||
pha
|
||||
@ -172,14 +182,6 @@ COUT bit bEscMode
|
||||
jsr SetCharAtXY
|
||||
jmp FSOUT
|
||||
*--------------------------------------
|
||||
SELECT sta SETTEXT
|
||||
sta SETALTCHAR
|
||||
sta SET80DISP
|
||||
sta CLR80STORE
|
||||
sta CLRPAGE2
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
COUT.Ctrl ldy #0
|
||||
ldx #0
|
||||
|
||||
@ -308,14 +310,6 @@ COUT.ExecEscSeq stz EscSeqParamCnt
|
||||
|
||||
.5 jmp (J.EscSequences,x)
|
||||
*--------------------------------------
|
||||
CLOSE stz A2osX.SCRNDEVS
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
GETINFO >LDYA L.DEVINFO
|
||||
IRQ clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
* PRIVATE
|
||||
*--------------------------------------
|
||||
RESET lda #0
|
||||
@ -394,9 +388,6 @@ FSOUT ldx CH
|
||||
rts
|
||||
*--------------------------------------
|
||||
CROUT jsr CLREOL
|
||||
stz CH
|
||||
clc
|
||||
rts
|
||||
CROUT1 stz CH
|
||||
LF ldy CV
|
||||
cpy #23
|
||||
@ -804,7 +795,12 @@ EscSeqParamTmp .BS 2
|
||||
EscSeqParamCnt .BS 1
|
||||
EscSeqParam .BS 4
|
||||
*--------------------------------------
|
||||
DEVINFO .DA #S.DEVINFO.TYPE.CHAR
|
||||
STAT .DA #S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
|
||||
.DA #0,#0,#0
|
||||
>PSTR "ANSI 80c Console"
|
||||
.DA #0
|
||||
.DA #0
|
||||
.DA 0900
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE DRV/CONSOLE.DRV.S
|
||||
|
@ -11,8 +11,19 @@ AUTO 6
|
||||
.INB /A2OSX.DEV/INC/MACROS.I
|
||||
.INB /A2OSX.DEV/INC/A2OSX.I
|
||||
.INB /A2OSX.DEV/INC/LIBTCPIP.I
|
||||
.INB /A2OSX.DEV/INC/PRODOS.I
|
||||
*--------------------------------------
|
||||
ZPTmpPTR .EQ ZPDRV
|
||||
*--------------------------------------
|
||||
*S.DEVINFO.NET.FLAGS.ARPOFFLOAD .EQ %00000001
|
||||
*S.DEVINFO.NET.FLAGS.IPOFFLOAD .EQ %00000010
|
||||
*S.DEVINFO.NET.MAC .EQ 2
|
||||
*S.DEVINFO.NET.STATUS .EQ 8
|
||||
*S.DEVINFO.NET.STATUS.OK .EQ $80
|
||||
*S.DEVINFO.NET.STATUS.FD .EQ $40
|
||||
*S.DEVINFO.NET.STATUS.10 .EQ $01
|
||||
*S.DEVINFO.NET.STATUS.100 .EQ $02
|
||||
*S.DEVINFO.NET.STATUS.1000 .EQ $03
|
||||
*--------------------------------------
|
||||
.INB DRV/X.NET.8900A.S
|
||||
*--------------------------------------
|
||||
@ -60,7 +71,7 @@ Dev.Detect >STYA ARGS
|
||||
>LDYA L.MSG.DETECT.KO
|
||||
>SYSCALL CPrintFYA
|
||||
|
||||
lda #DEVMGR.ERRNOHW
|
||||
lda #MLI.ERR.NODEV
|
||||
sec
|
||||
rts
|
||||
|
||||
@ -108,67 +119,68 @@ ARGS .BS 2
|
||||
*--------------------------------------
|
||||
* Device Header (16 Bytes)
|
||||
*--------------------------------------
|
||||
DEV.HEADER cld
|
||||
jmp (DRV.CS.START,x)
|
||||
.HS 00
|
||||
.DA #S.DEV.F.SHARE+S.DEV.F.EVENT
|
||||
DEV.HEADER.NAME >PSTR "ETH1" NAME
|
||||
.HS 00
|
||||
.HS 00.00.00.00
|
||||
DEV.HEADER .DA DRV.CS.START
|
||||
.DA #S.DEV.S.BLOCK+S.DEV.S.WRITE+S.DEV.S.READ
|
||||
DEV.HEADER.NAME .DA #4
|
||||
.AS "ETHx" NAME
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
DRV.CS.START .DA OPEN
|
||||
.DA GETEVENT
|
||||
.DA COUT
|
||||
DRV.CS.START .DA STATUS
|
||||
.DA READBLOCK
|
||||
.DA WRITEBLOCK
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
.DA OPEN
|
||||
.DA CLOSE
|
||||
.DA GETINFO
|
||||
.DA IRQ
|
||||
.DA SEND
|
||||
.DA SETIPCFG
|
||||
L.DEVINFO .DA DEVINFO
|
||||
.DA BADCALL
|
||||
.DA BADCALL
|
||||
L.DEVSTAT .DA DEVSTAT
|
||||
.DA 0 end or relocation
|
||||
*--------------------------------------
|
||||
OPEN jsr Reset
|
||||
>LDYAI PP.RxCTL
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYAI PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA
|
||||
>STYA PacketPageDATA,x
|
||||
BADCALL lda #MLI.ERR.BADCALL
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
STATUS lda #S.DEVINFO.NET.STATUS.10
|
||||
sta LINK.STATUS
|
||||
|
||||
>LDYAI PP.MAC
|
||||
ldx DEVSLOTx0
|
||||
>LDYAI PP.LineST
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA MAC
|
||||
>STYA PacketPageDATA,x
|
||||
>LDYAI PP.MAC+2
|
||||
>LDYA PacketPageDATA,x
|
||||
tya
|
||||
and #PP.LineST.LinkOK
|
||||
bne .1
|
||||
lda LINK.STATUS
|
||||
ora #S.DEVINFO.NET.STATUS.OK
|
||||
sta LINK.STATUS
|
||||
|
||||
.1 >LDYAI PP.TestCTL
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA MAC+2
|
||||
>STYA PacketPageDATA,x
|
||||
>LDYAI PP.MAC+4
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA MAC+4
|
||||
>STYA PacketPageDATA,x
|
||||
>LDYA PacketPageDATA,x
|
||||
and /PP.TestCTL.FDX
|
||||
bne .2
|
||||
lda LINK.STATUS
|
||||
ora #S.DEVINFO.NET.STATUS.FD
|
||||
sta LINK.STATUS
|
||||
|
||||
>LDYAI PP.LineCTL
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYAI PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.Auto
|
||||
>STYA PacketPageDATA,x
|
||||
.2 >LDYA L.DEVSTAT
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
GETEVENT ldx DEVSLOTx0
|
||||
READBLOCK ldx DEVSLOTx0
|
||||
>LDYAI PP.RxEvent
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA PacketPageDATA,x
|
||||
and /PP.RxEvent.RxOK+PP.RxEvent.Brdcast+PP.RxEvent.IA
|
||||
bne GETEVENT.RxOK
|
||||
bne READBLOCK.RxOK
|
||||
lda #ERR.DEV.NOFRAME
|
||||
COUT
|
||||
IRQ
|
||||
SETIPCFG
|
||||
GETEVENT.Err sec
|
||||
READBLOCK.Err sec
|
||||
rts
|
||||
|
||||
GETEVENT.RxOK and /PP.RxEvent.Brdcast
|
||||
READBLOCK.RxOK and /PP.RxEvent.Brdcast
|
||||
beq .10
|
||||
lda #$80
|
||||
.10 ldy #S.EVT.DATAHI
|
||||
@ -190,7 +202,7 @@ GETEVENT.RxOK and /PP.RxEvent.Brdcast
|
||||
.11 >PUSHYA Size+2
|
||||
>PUSHBI 0
|
||||
>SYSCALL GetMem
|
||||
bcs GETEVENT.Err
|
||||
bcs READBLOCK.Err
|
||||
>STYA ZPTmpPTR
|
||||
txa
|
||||
ldy #S.EVT.DATALO
|
||||
@ -239,38 +251,7 @@ GETEVENT.RxOK and /PP.RxEvent.Brdcast
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CLOSE jsr Reset
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
GETINFO lda #S.DEVINFO.NET.STATUS.10
|
||||
sta LINK.STATUS
|
||||
|
||||
ldx DEVSLOTx0
|
||||
>LDYAI PP.LineST
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA PacketPageDATA,x
|
||||
tya
|
||||
and #PP.LineST.LinkOK
|
||||
bne .1
|
||||
lda LINK.STATUS
|
||||
ora #S.DEVINFO.NET.STATUS.OK
|
||||
sta LINK.STATUS
|
||||
|
||||
.1 >LDYAI PP.TestCTL
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA PacketPageDATA,x
|
||||
and /PP.TestCTL.FDX
|
||||
bne .2
|
||||
lda LINK.STATUS
|
||||
ora #S.DEVINFO.NET.STATUS.FD
|
||||
sta LINK.STATUS
|
||||
|
||||
.2 >LDYA L.DEVINFO
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
SEND >PULLW ZPTmpPTR
|
||||
WRITEBLOCK >PULLW ZPTmpPTR
|
||||
|
||||
lda (ZPTmpPTR)
|
||||
sta Size
|
||||
@ -296,7 +277,7 @@ SEND >PULLW ZPTmpPTR
|
||||
bne .9
|
||||
lda PacketPageDATA+1,x
|
||||
and /PP.BusST.Rdy4TxNOW
|
||||
bne SENDPREADY
|
||||
bne WRITEBLOCK.1
|
||||
lda #0
|
||||
|
||||
.2 dec
|
||||
@ -309,7 +290,7 @@ SEND >PULLW ZPTmpPTR
|
||||
sec
|
||||
rts
|
||||
|
||||
SENDPREADY ldy #S.ETH.SRCMAC+5
|
||||
WRITEBLOCK.1 ldy #S.ETH.SRCMAC+5
|
||||
ldx #5
|
||||
.10 lda MAC,x
|
||||
sta (ZPTmpPTR),y
|
||||
@ -346,6 +327,36 @@ SENDPREADY ldy #S.ETH.SRCMAC+5
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
OPEN jsr Reset
|
||||
>LDYAI PP.RxCTL
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYAI PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA
|
||||
>STYA PacketPageDATA,x
|
||||
|
||||
>LDYAI PP.MAC
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA MAC
|
||||
>STYA PacketPageDATA,x
|
||||
>LDYAI PP.MAC+2
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA MAC+2
|
||||
>STYA PacketPageDATA,x
|
||||
>LDYAI PP.MAC+4
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYA MAC+4
|
||||
>STYA PacketPageDATA,x
|
||||
|
||||
>LDYAI PP.LineCTL
|
||||
>STYA PacketPagePTR,x
|
||||
>LDYAI PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.Auto
|
||||
>STYA PacketPageDATA,x
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CLOSE jsr Reset
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
Reset ldx DEVSLOTx0
|
||||
>LDYAI PP.SelfCTL
|
||||
>STYA PacketPagePTR,x
|
||||
@ -357,8 +368,7 @@ DRV.CS.END
|
||||
DEVSLOTx0 .BS 1
|
||||
Size .BS 2
|
||||
Counter .BS 2
|
||||
DEVINFO .DA #S.DEVINFO.TYPE.NET
|
||||
DEVFLAGS .DA #0
|
||||
DEVSTAT .BS S.DEVSTAT
|
||||
MAC .BS 6
|
||||
LINK.STATUS .BS 1 OK/DUPLEX/SPEED
|
||||
MAN
|
||||
|
320
INC/A2osX.I.txt
320
INC/A2osX.I.txt
@ -33,7 +33,7 @@ pEvent .EQ $2E
|
||||
ZPDRV .EQ $30
|
||||
ZPBIN .EQ $40
|
||||
*--------------------------------------
|
||||
* $3A-$3F ProDOS Block Device Drivers Main
|
||||
* $42-$47 ProDOS Block Device Drivers Main
|
||||
*--------------------------------------
|
||||
* $5E-$C8 RESERVED APPLESOFT Main/Aux (ROM Call, no need to switch back MainZP)
|
||||
*--------------------------------------
|
||||
@ -77,7 +77,7 @@ Z80JMP .EQ $1000 (00000h) Up To $10FF
|
||||
*--------------------------------------
|
||||
EvtMgr.Table .EQ $1100 K.EVT.MAX*S.EVT.SIZE=32*8=256b
|
||||
*--------------------------------------
|
||||
DevMgr.Table .EQ $1200 K.DEV.MAX*S.DEV.SIZE=16*16=256b
|
||||
DevMgr.Table .EQ $1200 K.DEV.MAX*S.DEV.SIZE=32*8=256b
|
||||
*--------------------------------------
|
||||
FltMgr.Table .EQ $1300 K.FLT.MAX*S.FLT.SIZE=8*32=256b
|
||||
*--------------------------------------
|
||||
@ -129,7 +129,7 @@ A2osX.RANDOM16 .EQ $BEEE
|
||||
* $BEF0->$BEFF : Kernel Config Block
|
||||
*--------------------------------------
|
||||
A2osX.HZ .EQ $BEF0
|
||||
A2osX.RAMDRVDIS .EQ $BEF8 If $80, prevent CHrooting to /RAMx
|
||||
A2osX.RAMDRVDIS .EQ $BEF8 If $80, prevent ChRooting to /RAMx
|
||||
A2osX.SLOTS .EQ $BEF8 $BEF9->$BEFF, 7 slots
|
||||
*--------------------------------------
|
||||
H.BIN.HEADER .EQ 0
|
||||
@ -149,7 +149,7 @@ H.BIN.EXE.REL.TABLE .EQ 16
|
||||
H.BIN.DRV.HEADER.O .EQ 10
|
||||
H.BIN.DRV.CODE.O .EQ 12
|
||||
H.BIN.DRV.CODE.LEN .EQ 14
|
||||
H.BIN.DRV.REL.TABLE .EQ 0
|
||||
H.BIN.DRV.REL.TABLE .EQ 2
|
||||
*--------------------------------------
|
||||
* A2osX.SYSCALL Functions Indexes
|
||||
*--------------------------------------
|
||||
@ -167,56 +167,49 @@ SYS.LoadDrvYA .EQ $10
|
||||
SYS.LoadLibYA .EQ $12
|
||||
SYS.UnloadLibA .EQ $14
|
||||
SYS.LoadExeYA .EQ $16
|
||||
|
||||
SYS.TimeYA .EQ $18
|
||||
SYS.CTime2Time .EQ $1A
|
||||
SYS.PTime2Time .EQ $1C
|
||||
* .EQ $1E
|
||||
*--------------------------------------
|
||||
SYS.FOPEN .EQ $20
|
||||
SYS.FOPEN.R .EQ $01 Open For Read
|
||||
SYS.FOPEN.W .EQ $02 Open For Write
|
||||
SYS.FOPEN.A .EQ $04 Append
|
||||
SYS.FOPEN.T .EQ $08 Open/Append in Text mode
|
||||
SYS.FOPEN.X .EQ $80 Create if not exists
|
||||
|
||||
SYS.FOpen .EQ $20
|
||||
SYS.FOpen.R .EQ $01 Open For Read
|
||||
SYS.FOpen.W .EQ $02 Open For Write
|
||||
SYS.FOpen.A .EQ $04 Append
|
||||
SYS.FOpen.T .EQ $08 Open/Append in Text mode
|
||||
SYS.FOpen.X .EQ $80 Create if not exists
|
||||
SYS.FCloseA .EQ $22
|
||||
SYS.FREAD .EQ $24
|
||||
SYS.FWRITE .EQ $26
|
||||
|
||||
SYS.FFLUSH .EQ $28
|
||||
SYS.FSEEK .EQ $2A
|
||||
SYS.FSEEK.SET .EQ $00
|
||||
SYS.FSEEK.CUR .EQ $01
|
||||
SYS.FSEEK.END .EQ $02
|
||||
SYS.FTELL .EQ $2C
|
||||
SYS.FRead .EQ $24
|
||||
SYS.FWrite .EQ $26
|
||||
SYS.FFlush .EQ $28
|
||||
SYS.FSeek .EQ $2A
|
||||
SYS.FSeek.SET .EQ $00
|
||||
SYS.FSeek.CUR .EQ $01
|
||||
SYS.FSeek.END .EQ $02
|
||||
SYS.FTell .EQ $2C
|
||||
SYS.FEOF .EQ $2E
|
||||
|
||||
SYS.RemoveYA .EQ $30
|
||||
SYS.Rename .EQ $32
|
||||
SYS.STAT .EQ $34
|
||||
* .EQ $36
|
||||
|
||||
SYS.OPENDIRYA .EQ $38
|
||||
SYS.OpenDirYA .EQ $38
|
||||
SYS.ReadDirA .EQ $3A
|
||||
SYS.CloseDirA .EQ $3C
|
||||
SYS.MKDirYA .EQ $3E
|
||||
*--------------------------------------
|
||||
SYS.COutA .EQ $40
|
||||
* .EQ $40
|
||||
SYS.SScanF .EQ $42
|
||||
SYS.PPrintFYA .EQ $44
|
||||
SYS.CPrintFYA .EQ $46
|
||||
|
||||
SYS.FPUTCA .EQ $48
|
||||
SYS.FGETC .EQ $4A
|
||||
SYS.FPUTSYA .EQ $4C
|
||||
SYS.FGETS .EQ $4E
|
||||
* .EQ $48
|
||||
* .EQ $4A
|
||||
* .EQ $4C
|
||||
* .EQ $4E
|
||||
*--------------------------------------
|
||||
SYS.NewPStrYA .EQ $50
|
||||
SYS.PStrCpy .EQ $52
|
||||
SYS.PStrCat .EQ $54
|
||||
SYS.PStrMatch .EQ $56
|
||||
|
||||
SYS.PStrUprYA .EQ $58
|
||||
SYS.PStrLwrYA .EQ $5A
|
||||
SYS.PStrFTime .EQ $5C
|
||||
@ -226,7 +219,6 @@ SYS.ExecProcessNewEnvYA .EQ $60
|
||||
SYS.ExecProcessYA .EQ $62
|
||||
SYS.CreateProcessNewEnvYA .EQ $64
|
||||
SYS.CreateProcessYA .EQ $66
|
||||
|
||||
SYS.GetPSByIDA .EQ $68
|
||||
* .EQ $6A
|
||||
SYS.Sleep .EQ $6C
|
||||
@ -236,7 +228,6 @@ SYS.GetArgC .EQ $70
|
||||
SYS.GetArgA .EQ $72
|
||||
SYS.ExpandPStrYA .EQ $74
|
||||
* .EQ $76
|
||||
|
||||
SYS.PutEnvYA .EQ $78
|
||||
SYS.SetEnv .EQ $7A
|
||||
SYS.GetEnvYA .EQ $7C
|
||||
@ -244,9 +235,8 @@ SYS.UnsetEnvYA .EQ $7E
|
||||
*--------------------------------------
|
||||
SYS.GetDevByIDA .EQ $80
|
||||
SYS.GetDevByNameYA .EQ $82
|
||||
SYS.GetDevInfoA .EQ $84
|
||||
SYS.GetDevStatusA .EQ $84
|
||||
* .EQ $86
|
||||
*--------------------------------------
|
||||
SYS.MKNodYA .EQ $88
|
||||
SYS.MKNodA .EQ $8A
|
||||
SYS.MKFIFO .EQ $8C
|
||||
@ -256,14 +246,28 @@ SYS.GetMem .EQ $90
|
||||
SYS.FreeMemA .EQ $92
|
||||
SYS.GetMemPtrA .EQ $94
|
||||
SYS.GetMemByIDA .EQ $96
|
||||
|
||||
* .EQ $98
|
||||
SYS.LoadStockObjectYA .EQ $9A
|
||||
SYS.GetStockObjectA .EQ $9C
|
||||
SYS.FreeStockObject .EQ $9E
|
||||
SYS.LoadStkObjYA .EQ $9A
|
||||
SYS.GetStkObjA .EQ $9C
|
||||
SYS.FreeStkObjA .EQ $9E
|
||||
*--------------------------------------
|
||||
SYS.SetLoMem .EQ $A0
|
||||
SYS.GetMemStatYA .EQ $A2
|
||||
* .EQ $A4
|
||||
* .EQ $A6
|
||||
* .EQ $A8
|
||||
* .EQ $AA
|
||||
* .EQ $AC
|
||||
* .EQ $AE
|
||||
*--------------------------------------
|
||||
SYS.FPutCAY .EQ $B0
|
||||
SYS.PutCA .EQ $B2
|
||||
SYS.FGetCA .EQ $B4
|
||||
SYS.GetC .EQ $B6
|
||||
SYS.FPutS .EQ $B8
|
||||
SYS.PutSYA .EQ $BA
|
||||
SYS.FGetS .EQ $BC
|
||||
SYS.GetSYA .EQ $BE
|
||||
*--------------------------------------
|
||||
* ProDOS ERROR CODES : $00->$5F
|
||||
* Lib ERROR CODES : $80->$BF
|
||||
@ -275,9 +279,6 @@ MEMMGR.ERROOH .EQ $FE Out Of Handle Error
|
||||
DEVMGR.ERROOM .EQ $EF Out Of Memory Error
|
||||
DEVMGR.ERROOH .EQ $EE Out Of Handle Error
|
||||
DEVMGR.ERRICL .EQ $ED Invalid Command Line
|
||||
DEVMGR.ERRNOHW .EQ $EC No Hardware
|
||||
DEVMGR.ERRDNF .EQ $EB Device Not Found Error
|
||||
DEVMGR.ERRUNSUP .EQ $EA Unsupported Function
|
||||
*--------------------------------------
|
||||
TSKMGR.ERROOH .EQ $DF Out Of Handle Error
|
||||
TSKMGR.ERRNSP .EQ $DD No Such Process Error
|
||||
@ -319,107 +320,140 @@ S.MEMSTAT.DH .EQ 20
|
||||
*
|
||||
S.MEMSTAT .EQ 24
|
||||
*--------------------------------------
|
||||
S.DEVINFO.TYPE .EQ 0
|
||||
S.DEVINFO.TYPE.CHAR .EQ %00000001
|
||||
S.DEVINFO.TYPE.XY .EQ %00000010
|
||||
S.DEVINFO.TYPE.NET .EQ %00000011
|
||||
S.DEVINFO.TYPE.GFX .EQ %00000100
|
||||
S.DEVINFO.FLAGS .EQ 1
|
||||
S.DEVINFO.NET.FLAGS.ARPOFFLOAD .EQ %00000001
|
||||
S.DEVINFO.NET.FLAGS.IPOFFLOAD .EQ %00000010
|
||||
S.DEVINFO.NET.MAC .EQ 2
|
||||
S.DEVINFO.NET.STATUS .EQ 8
|
||||
S.DEVINFO.NET.STATUS.OK .EQ $80
|
||||
S.DEVINFO.NET.STATUS.FD .EQ $40
|
||||
S.DEVINFO.NET.STATUS.10 .EQ $01
|
||||
S.DEVINFO.NET.STATUS.100 .EQ $02
|
||||
S.DEVINFO.NET.STATUS.1000 .EQ $03
|
||||
* DEVMGR (old API)
|
||||
*--------------------------------------
|
||||
*S.DEV.CODE .EQ 0 cld,jmp...
|
||||
*S.DEV.JMP .EQ 2 ...(code,x)
|
||||
*S.DEV.ID .EQ 4
|
||||
*S.DEV.F .EQ 5
|
||||
*S.DEV.F.INUSE .EQ %10000000
|
||||
*S.DEV.F.BUSY .EQ %01000000
|
||||
*S.DEV.F.SHARE .EQ %00100000 Device is shareable
|
||||
*S.DEV.F.IRQ .EQ %00010000 Device is irq driven
|
||||
*S.DEV.F.EVENT .EQ %00001000 Device is event driven
|
||||
*S.DEV.F.COUT .EQ %00000100 Device supports Char OUT
|
||||
*S.DEV.F.BLOCK .EQ %00000010
|
||||
*S.DEV.F.CHAR .EQ %00000001
|
||||
*S.DEV.NAME .EQ 6 5 Bytes : LEN+NUL KBD CON COMx LPTx ETHx
|
||||
*
|
||||
*S.DEV .EQ 16
|
||||
*--------------------------------------
|
||||
*S.DEVINFO.TYPE .EQ 0
|
||||
*S.DEVINFO.TYPE.CHAR .EQ %00000001
|
||||
*S.DEVINFO.TYPE.XY .EQ %00000010
|
||||
*S.DEVINFO.TYPE.NET .EQ %00000011
|
||||
*S.DEVINFO.TYPE.GFX .EQ %00000100
|
||||
*S.DEVINFO.FLAGS .EQ 1
|
||||
*S.DEVINFO.NET.FLAGS.ARPOFFLOAD .EQ %00000001
|
||||
*S.DEVINFO.NET.FLAGS.IPOFFLOAD .EQ %00000010
|
||||
*S.DEVINFO.NET.MAC .EQ 2
|
||||
*S.DEVINFO.NET.STATUS .EQ 8
|
||||
*S.DEVINFO.NET.STATUS.OK .EQ $80
|
||||
*S.DEVINFO.NET.STATUS.FD .EQ $40
|
||||
*S.DEVINFO.NET.STATUS.10 .EQ $01
|
||||
*S.DEVINFO.NET.STATUS.100 .EQ $02
|
||||
*S.DEVINFO.NET.STATUS.1000 .EQ $03
|
||||
*--------------------------------------
|
||||
* Generic Driver Functions
|
||||
*--------------------------------------
|
||||
DEVMGR.OPEN .EQ 0
|
||||
DEVMGR.GETEVENT .EQ 2
|
||||
DEVMGR.COUT .EQ 4
|
||||
DEVMGR.CLOSE .EQ 6
|
||||
DEVMGR.GETINFO .EQ 8
|
||||
DEVMGR.IRQ .EQ 10
|
||||
*DEVMGR.OPEN .EQ 0
|
||||
*DEVMGR.GETEVENT .EQ 2
|
||||
*DEVMGR.COUT .EQ 4
|
||||
*DEVMGR.CLOSE .EQ 6
|
||||
*DEVMGR.GETINFO .EQ 8
|
||||
*DEVMGR.IRQ .EQ 10
|
||||
*--------------------------------------
|
||||
DEVMGR.SELECT .EQ 12
|
||||
*DEVMGR.SELECT .EQ 12
|
||||
*--------------------------------------
|
||||
* 'NET' Class Driver Functions
|
||||
*--------------------------------------
|
||||
DEVMGR.NET.SEND .EQ 12
|
||||
DEVMGR.SETIPCFG .EQ 14
|
||||
*DEVMGR.NET.SEND .EQ 12
|
||||
*DEVMGR.SETIPCFG .EQ 14
|
||||
*--------------------------------------
|
||||
* 'GFX' Class Driver Functions
|
||||
*--------------------------------------
|
||||
DEVMGR.GFX.SETPIXEL .EQ 14
|
||||
DEVMGR.GFX.GETPIXEL .EQ 16
|
||||
DEVMGR.GFX.HLINE .EQ 18
|
||||
DEVMGR.GFX.VLINE .EQ 20
|
||||
DEVMGR.GFX.BITBLT .EQ 22
|
||||
*--------------------------------------
|
||||
* DEVMGR (old API)
|
||||
*--------------------------------------
|
||||
S.DEV.CODE .EQ 0 cld,jmp...
|
||||
S.DEV.JMP .EQ 2 ...(code,x)
|
||||
S.DEV.ID .EQ 4
|
||||
S.DEV.F .EQ 5
|
||||
S.DEV.F.INUSE .EQ %10000000
|
||||
S.DEV.F.BUSY .EQ %01000000
|
||||
S.DEV.F.SHARE .EQ %00100000 Device is shareable
|
||||
S.DEV.F.IRQ .EQ %00010000 Device is irq driven
|
||||
S.DEV.F.EVENT .EQ %00001000 Device is event driven
|
||||
S.DEV.F.COUT .EQ %00000100 Device supports Char OUT
|
||||
S.DEV.F.BLOCK .EQ %00000010
|
||||
S.DEV.F.CHAR .EQ %00000001
|
||||
S.DEV.NAME .EQ 6 5 Bytes : LEN+NUL KBD CON COMx LPTx ETHx
|
||||
*
|
||||
S.DEV .EQ 16
|
||||
*DEVMGR.GFX.SETPIXEL .EQ 14
|
||||
*DEVMGR.GFX.GETPIXEL .EQ 16
|
||||
*DEVMGR.GFX.HLINE .EQ 18
|
||||
*DEVMGR.GFX.VLINE .EQ 20
|
||||
*DEVMGR.GFX.BITBLT .EQ 22
|
||||
*--------------------------------------
|
||||
* DEVMGR (new API) = Smartport
|
||||
*--------------------------------------
|
||||
* JMP :
|
||||
* DEVID :
|
||||
* JMP : (A=Device)
|
||||
* DRV : AUXLC entry point
|
||||
* BLK : ROM Entry point Cn($Cnff)
|
||||
* PRT : ROM Entry point Cn($Cnff)+3
|
||||
* ID :
|
||||
* 00->0F : NUL,SYS & loadable drivers
|
||||
* X0 : X=Slot : Controller
|
||||
* XY : X=Slot, Y=Device (<$80)
|
||||
* > $80 : IDs for PIPE,SOCK....
|
||||
* X0 : X=Slot (Controller board)
|
||||
* XY : X=Slot, Y=Device
|
||||
* NAME:
|
||||
*
|
||||
*--------------------------------------
|
||||
*S.DEV.JMP .EQ 0
|
||||
*S.DEV.DEVID .EQ 2
|
||||
*S.DEV.F .EQ 3
|
||||
*S.DEV.F.BLOCK .EQ %10000000
|
||||
*S.DEV.F.WRITE .EQ %01000000
|
||||
*S.DEV.F.READ .EQ %00100000
|
||||
*S.DEV.F.ONLINE .EQ %00010000
|
||||
*S.DEV.F.NOFMT .EQ %00001000
|
||||
*S.DEV.F.WENABL .EQ %00000100
|
||||
*S.DEV.F.IRQ .EQ %00000010
|
||||
*S.DEV.F.OPENED .EQ %00000001
|
||||
|
||||
*S.DEV.NAME .EQ 4
|
||||
*S.DEV .EQ 8
|
||||
S.DEV.JMP .EQ 0
|
||||
S.DEV.S .EQ 2
|
||||
S.DEV.S.BLOCK .EQ %10000000
|
||||
S.DEV.S.WRITE .EQ %01000000
|
||||
S.DEV.S.READ .EQ %00100000
|
||||
S.DEV.S.ONLINE .EQ %00010000
|
||||
S.DEV.S.NOFMT .EQ %00001000
|
||||
S.DEV.S.WENABL .EQ %00000100
|
||||
S.DEV.S.IRQ .EQ %00000010
|
||||
S.DEV.S.OPENED .EQ %00000001
|
||||
S.DEV.F .EQ 3
|
||||
S.DEV.F.IRQ .EQ %10000000 Device is irq driven
|
||||
S.DEV.F.EVENT .EQ %01000000 Device is event driven
|
||||
S.DEV.F.LEN .EQ %00000111 Len
|
||||
S.DEV.NAME .EQ 4 4 MAX
|
||||
*
|
||||
S.DEV .EQ 8
|
||||
*----------- Smartport ----------------
|
||||
DEVMGR.STATUS .EQ 0
|
||||
DEVMGR.READBLOCK .EQ 2
|
||||
DEVMGR.WRITEBLOCK .EQ 4
|
||||
DEVMGR.FORMAT .EQ 6
|
||||
DEVMGR.CONTROL .EQ 8
|
||||
DEVMGR.INIT .EQ 10
|
||||
DEVMGR.OPEN .EQ 12
|
||||
DEVMGR.CLOSE .EQ 14
|
||||
DEVMGR.READ .EQ 16
|
||||
DEVMGR.WRITE .EQ 18
|
||||
*--------------------------------------
|
||||
*DEVMGR..STATUS .EQ 0
|
||||
*DEVMGR..READBLOCK .EQ 1
|
||||
*DEVMGR..WRITEBLOCK .EQ 2
|
||||
*DEVMGR..FORMAT .EQ 3
|
||||
*DEVMGR..CONTROL .EQ 4
|
||||
*DEVMGR..INIT .EQ 5
|
||||
*DEVMGR..OPEN .EQ 6
|
||||
*DEVMGR..CLOSE .EQ 7
|
||||
*DEVMGR..READ .EQ 8
|
||||
*DEVMGR..WRITE .EQ 9
|
||||
*--------------------------------------
|
||||
*S.DEVSTAT.F .EQ 0 same as S.DEV.F.* bitmasks
|
||||
*S.DEVSTAT.SIZE .EQ 1 3 bytes
|
||||
*S.DEVSTAT.IDSTRING .EQ 4 1 (LEN) + 16 MAX
|
||||
*S.DEVSTAT.TYPE .EQ 21
|
||||
*S.DEVSTAT.SUBTYPE .EQ 22
|
||||
*S.DEVSTAT.VERSION .EQ 23
|
||||
*--------------------------------------
|
||||
|
||||
S.DEVSTAT.S .EQ 0
|
||||
S.DEVSTAT.S.BLOCK .EQ %10000000
|
||||
S.DEVSTAT.S.WRITE .EQ %01000000
|
||||
S.DEVSTAT.S.READ .EQ %00100000
|
||||
S.DEVSTAT.S.ONLINE .EQ %00010000
|
||||
S.DEVSTAT.S.NOFMT .EQ %00001000
|
||||
S.DEVSTAT.S.WENABL .EQ %00000100
|
||||
S.DEVSTAT.S.IRQ .EQ %00000010
|
||||
S.DEVSTAT.S.OPENED .EQ %00000001
|
||||
S.DEVSTAT.SIZE .EQ 1 3 bytes
|
||||
S.DEVSTAT.IDSTRING .EQ 4 1 (LEN) + 16 MAX
|
||||
S.DEVSTAT.TYPE .EQ 21
|
||||
* $00: Memory Expansion Card (RAM disk)
|
||||
* $01: 3.5" disk
|
||||
* $02: ProFile-type hard disk
|
||||
* $03: Generic SCSI
|
||||
* $04: ROM disk
|
||||
* $05: SCSI CD-ROM
|
||||
* $06: SCSI tape or other SCSI sequential device
|
||||
* $07: SCSI hard disk
|
||||
* $08: Reserved
|
||||
* $09: SCSI printer
|
||||
* $0A: 5-1/4" disk
|
||||
* $0B: Reserved
|
||||
* $0C: Reserved
|
||||
* $0D: Printer
|
||||
* $0E: Clock
|
||||
* $0F: Modem
|
||||
S.DEVSTAT.SUBTYPE .EQ 22
|
||||
S.DEVSTAT.SUBTYPE.EXT .EQ $80
|
||||
S.DEVSTAT.SUBTYPE.DSKSW .EQ $40
|
||||
S.DEVSTAT.SUBTYPE.NOREM .EQ $20
|
||||
S.DEVSTAT.VERSION .EQ 23
|
||||
S.DEVSTAT .EQ 25
|
||||
*--------------------------------------
|
||||
* PS STRUCT
|
||||
*--------------------------------------
|
||||
@ -430,21 +464,18 @@ S.PS.F.HOLD .EQ %00100000
|
||||
S.PS.F.SLEEP .EQ %00010000
|
||||
S.PS.F.EVENT .EQ %00001000
|
||||
S.PS.F.ENV .EQ %00000100
|
||||
S.PS.PID .EQ 1
|
||||
S.PS.PPID .EQ 2
|
||||
S.PS.hCS .EQ 3
|
||||
S.PS.hDS .EQ 4
|
||||
S.PS.hPREFIX .EQ 5
|
||||
S.PS.hENV .EQ 6
|
||||
S.PS.hCMDLINE .EQ 7
|
||||
S.PS.UID .EQ 8
|
||||
S.PS.hINDEV .EQ 9
|
||||
S.PS.hStdIn .EQ 9
|
||||
S.PS.hOUTDEV .EQ 10
|
||||
S.PS.hStdOut .EQ 10
|
||||
S.PS.hERRDEV .EQ 11
|
||||
S.PS.hStdErr .EQ 11
|
||||
S.PS.CPID .EQ 12
|
||||
S.PS.PPID .EQ 1
|
||||
S.PS.PID .EQ 2
|
||||
S.PS.CPID .EQ 3
|
||||
S.PS.hCS .EQ 4
|
||||
S.PS.hDS .EQ 5
|
||||
S.PS.hPREFIX .EQ 6
|
||||
S.PS.hENV .EQ 7
|
||||
S.PS.hCMDLINE .EQ 8
|
||||
S.PS.UID .EQ 9
|
||||
S.PS.hStdIn .EQ 10
|
||||
S.PS.hStdOut .EQ 11
|
||||
S.PS.hStdErr .EQ 12
|
||||
S.PS.RC .EQ 13
|
||||
S.PS.PC .EQ 14
|
||||
*
|
||||
@ -572,8 +603,9 @@ S.NODE.DIR.FC .EQ 6 word
|
||||
S.NODE.DIR .EQ 8
|
||||
*--------------------------------------
|
||||
S.NODE.DEV.ID .EQ 2
|
||||
S.NODE.DEV.JMP .EQ 3 word
|
||||
*
|
||||
S.NODE.DEV .EQ 3
|
||||
S.NODE.DEV .EQ 5
|
||||
*--------------------------------------
|
||||
* S.NODE.LNK
|
||||
*--------------------------------------
|
||||
@ -584,7 +616,7 @@ S.NODE.FIFO.hMem .EQ 3
|
||||
S.NODE.FIFO.Tail .EQ 4
|
||||
S.NODE.FIFO.Head .EQ 5
|
||||
*
|
||||
S.NODE.FIFO .EQ 5
|
||||
S.NODE.FIFO .EQ 6
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE /A2OSX.DEV/INC/A2OSX.I
|
||||
|
@ -11,11 +11,13 @@ AUTO 6
|
||||
SIGNFLG .EQ $16 FLAGS SIGN IN TAN
|
||||
INDEX .EQ $5E Ptr Used by Math routines
|
||||
RESULT .EQ $62 -> $66, RESULT OF LAST * OR /
|
||||
EXPSGN .EQ $9C
|
||||
FAC .EQ $9D -> $A1 (5 bytes)
|
||||
FAC.SIGN .EQ $A2
|
||||
ARG .EQ $A5 -> $A9 (5 bytes)
|
||||
ARG.SIGN .EQ $AA
|
||||
SGNCPR .EQ $AB FLAGS OPP SIGN IN FP ROUT
|
||||
FAC.EXTENSION .EQ $AC FAC EXTENSION BYTE
|
||||
CHRGET .EQ $B1 -> $C8
|
||||
CHRGOT .EQ $B7
|
||||
TXTPTR .EQ $B8
|
||||
|
48
INC/IO.I.txt
48
INC/IO.I.txt
@ -14,12 +14,12 @@ CLRREADAUX .EQ $C002 W
|
||||
SETREADAUX .EQ $C003 W
|
||||
CLRWRITEAUX .EQ $C004 W
|
||||
SETWRITEAUX .EQ $C005 W
|
||||
CLRCXROM .EQ $C006 W
|
||||
SETCXROM .EQ $C007 W
|
||||
*CLRCXROM .EQ $C006 W
|
||||
*SETCXROM .EQ $C007 W
|
||||
CLRALTZP .EQ $C008 W
|
||||
SETALTZP .EQ $C009 W
|
||||
CLRC3ROM .EQ $C00A W
|
||||
SETC3ROM .EQ $C00B W
|
||||
*CLRC3ROM .EQ $C00A W
|
||||
*SETC3ROM .EQ $C00B W
|
||||
CLR80DISP .EQ $C00C W
|
||||
SET80DISP .EQ $C00D W
|
||||
CLRALTCHAR .EQ $C00E W
|
||||
@ -29,9 +29,9 @@ RDLCBNK2 .EQ $C011 R
|
||||
RDLCRAM .EQ $C012 R
|
||||
RDREADAUX .EQ $C013 R
|
||||
RDWRITEAUX .EQ $C014 R
|
||||
RDCXROM .EQ $C015 R
|
||||
*RDCXROM .EQ $C015 R
|
||||
RDALTZP .EQ $C016 R
|
||||
RDC3ROM .EQ $C017 R
|
||||
*RDC3ROM .EQ $C017 R
|
||||
RD80STORE .EQ $C018 R
|
||||
VBL .EQ $C019 R
|
||||
RDTEXT .EQ $C01A R
|
||||
@ -40,9 +40,9 @@ RDPAGE2 .EQ $C01C R
|
||||
RDHIRES .EQ $C01D R
|
||||
RDALTCHAR .EQ $C01E R
|
||||
RD80DISP .EQ $C01F R
|
||||
TAPEOUT .EQ $C020 W
|
||||
*TAPEOUT .EQ $C020 W
|
||||
SPEAKER .EQ $C030 W, toggle speaker diaphragm
|
||||
STROBE .EQ $C040 R, generate .5 uS low pulse @ Game pin 5
|
||||
*STROBE .EQ $C040 R, generate .5 uS low pulse @ Game pin 5
|
||||
|
||||
EMUBYTE .EQ $C04F WRR, Write once then Read EMUL, Read Version
|
||||
|
||||
@ -55,29 +55,29 @@ SETPAGE2 .EQ $C055 W
|
||||
CLRHIRES .EQ $C056 W
|
||||
SETHIRES .EQ $C057 W
|
||||
|
||||
SETAN0 .EQ $C058 W, Set annunciator-0 output to 0
|
||||
CLRAN0 .EQ $C059 W, Set annunciator-0 output to 1
|
||||
SETAN1 .EQ $C05A W, Set annunciator-1 output to 0
|
||||
CLRAN1 .EQ $C05B W, Set annunciator-1 output to 1
|
||||
*SETAN0 .EQ $C058 W, Set annunciator-0 output to 0
|
||||
*CLRAN0 .EQ $C059 W, Set annunciator-0 output to 1
|
||||
*SETAN1 .EQ $C05A W, Set annunciator-1 output to 0
|
||||
*CLRAN1 .EQ $C05B W, Set annunciator-1 output to 1
|
||||
ENBVBLIIC .EQ $C05B W, Enable VBL switch (IIc)
|
||||
SETAN2 .EQ $C05C W, Set annunciator-2 output to 0
|
||||
CLRAN2 .EQ $C05D W, Set annunciator-2 output to 1
|
||||
SETAN3 .EQ $C05E W, Set annunciator-3 output to 0
|
||||
*SETAN2 .EQ $C05C W, Set annunciator-2 output to 0
|
||||
*CLRAN2 .EQ $C05D W, Set annunciator-2 output to 1
|
||||
*SETAN3 .EQ $C05E W, Set annunciator-3 output to 0
|
||||
SETDHIRES .EQ $C05E W, if IOUDIS Set, turn on double-hires
|
||||
CLRAN3 .EQ $C05F W, Set annunciator-3 output to 1
|
||||
*CLRAN3 .EQ $C05F W, Set annunciator-3 output to 1
|
||||
CLRDHIRES .EQ $C05F W, if IOUDIS Set, turn off double-hires
|
||||
|
||||
TAPEIN .EQ $C060 R
|
||||
*TAPEIN .EQ $C060 R
|
||||
|
||||
OPENAPPLE .EQ $C061 R
|
||||
SOLIDAPPLE .EQ $C062 R
|
||||
PB2 .EQ $C063 R
|
||||
*PB2 .EQ $C063 R
|
||||
|
||||
PADDLE0 .EQ $C064 R, bit 7 = status of pdl-0 timer
|
||||
PADDLE1 .EQ $C065 R, bit 7 = status of pdl-1 timer
|
||||
PADDLE2 .EQ $C066 R, bit 7 = status of pdl-2 timer
|
||||
PADDLE3 .EQ $C067 R, bit 7 = status of pdl-3 timer
|
||||
PDLTRIG .EQ $C070 W, trigger paddles
|
||||
*PADDLE0 .EQ $C064 R, bit 7 = status of pdl-0 timer
|
||||
*PADDLE1 .EQ $C065 R, bit 7 = status of pdl-1 timer
|
||||
*PADDLE2 .EQ $C066 R, bit 7 = status of pdl-2 timer
|
||||
*PADDLE3 .EQ $C067 R, bit 7 = status of pdl-3 timer
|
||||
*PDLTRIG .EQ $C070 W, trigger paddles
|
||||
|
||||
SETIOUDIS .EQ $C07E W, enable DHIRES & disable $C058-5F
|
||||
RDIOUDIS .EQ $C07E R, bit 7 = IOUDIS status
|
||||
@ -92,6 +92,6 @@ RROMWRAMBNK1 .EQ $C089 RR
|
||||
RROMBNK1 .EQ $C08A R
|
||||
RRAMWRAMBNK1 .EQ $C08B RR
|
||||
*--------------------------------------
|
||||
CLRC8ROM .EQ $CFFF R, Release C800-CFFF Rom Space for all cards
|
||||
*CLRC8ROM .EQ $CFFF R, Release C800-CFFF Rom Space for all cards
|
||||
MAN
|
||||
SAVE /A2OSX.DEV/INC/IO.I
|
||||
|
@ -47,7 +47,7 @@ AUTO 6
|
||||
.DO ]1=MLIDESTROY
|
||||
lda #1
|
||||
.FIN
|
||||
.DO ]1=MLIRENAME
|
||||
.DO ]1=MLIRename
|
||||
lda #2
|
||||
.FIN
|
||||
.DO ]1=MLISETFILEINFO
|
||||
|
@ -10,8 +10,8 @@ AUTO 1000
|
||||
BRKVECT .EQ $3F0
|
||||
POWERUP .EQ $3F2
|
||||
POWERUPBYTE .EQ $3F4
|
||||
USRJMP .EQ $3F8 jmp $xxxx
|
||||
NMIJMP .EQ $3FB jmp $xxxx
|
||||
*USRJMP .EQ $3F8 jmp $xxxx
|
||||
*NMIJMP .EQ $3FB jmp $xxxx
|
||||
IRQVECT .EQ $3FE
|
||||
*--------------------------------------
|
||||
COL80FIRM .EQ $C300
|
||||
|
@ -20,7 +20,7 @@ MLIWRITEBLOCK .EQ $81
|
||||
MLIGETTIME .EQ $82
|
||||
MLICREATE .EQ $C0
|
||||
MLIDESTROY .EQ $C1
|
||||
MLIRENAME .EQ $C2
|
||||
MLIRename .EQ $C2
|
||||
MLISETFILEINFO .EQ $C3
|
||||
MLIGETFILEINFO .EQ $C4
|
||||
MLIONLINE .EQ $C5
|
||||
@ -71,6 +71,7 @@ S.FILEINFO .EQ $12
|
||||
*$28 - No Device Connected
|
||||
*$2B - Write Protected
|
||||
*$2E - Disk Switched
|
||||
*$2F - Device Offline
|
||||
*$40 - Invalid Pathname
|
||||
*$42 - Maximum Number of Files Open
|
||||
*$43 - Invalid Reference Number
|
||||
@ -94,8 +95,8 @@ S.FILEINFO .EQ $12
|
||||
*$5A - File Structure Damaged
|
||||
*--------------------------------------
|
||||
MLI.ERR.BADCALL .EQ $01
|
||||
MLI.ERR.BADCNT .EQ $04
|
||||
MLI.ERR.IRQFULL .EQ $25
|
||||
*MLI.ERR.BADCNT .EQ $04
|
||||
*MLI.ERR.IRQFULL .EQ $25
|
||||
MLI.ERR.IO .EQ $27
|
||||
MLI.ERR.NODEV .EQ $28
|
||||
MLI.ERR.WRTPROT .EQ $2B
|
||||
@ -152,15 +153,15 @@ TIMELO .EQ $BF92
|
||||
*SPARE1 .EQ $BF96
|
||||
MACHID .EQ $BF98
|
||||
MACHID.TYPE .EQ %11001000
|
||||
MACHID.TYPE.II .EQ %00000000
|
||||
MACHID.TYPE.IIp .EQ %01000000
|
||||
*MACHID.TYPE.II .EQ %00000000
|
||||
*MACHID.TYPE.IIp .EQ %01000000
|
||||
MACHID.TYPE.IIe .EQ %10000000
|
||||
MACHID.TYPE.IIc .EQ %10001000
|
||||
MACHID.TYPE.III .EQ %11000000
|
||||
*MACHID.TYPE.III .EQ %11000000
|
||||
MACHID.RAM .EQ %00110000
|
||||
MACHID.RAM.128 .EQ %00110000
|
||||
MACHID.RAM.64 .EQ %00100000
|
||||
MACHID.RAM.48 .EQ %00010000
|
||||
*MACHID.RAM.64 .EQ %00100000
|
||||
*MACHID.RAM.48 .EQ %00010000
|
||||
*MACHID.SPARE .EQ %00000100
|
||||
MACHID.COL80 .EQ %00000010
|
||||
MACHID.CLK .EQ %00000001
|
||||
@ -176,10 +177,10 @@ MACHID.CLK .EQ %00000001
|
||||
*BNKBYT1 .EQ $BFF4
|
||||
*BNKBYT2 .EQ $BFF5
|
||||
*SYS.RTS .EQ $BFF6 code -> $BFFB
|
||||
IBAKVER .EQ $BFFC
|
||||
IVERSION .EQ $BFFD
|
||||
KBAKVER .EQ $BFFE
|
||||
KVERSION .EQ $BFFF
|
||||
*IBAKVER .EQ $BFFC
|
||||
*IVERSION .EQ $BFFD
|
||||
*KBAKVER .EQ $BFFE
|
||||
*KVERSION .EQ $BFFF
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE /A2OSX.DEV/INC/PRODOS.I
|
||||
|
10
INC/ZP.I.txt
10
INC/ZP.I.txt
@ -28,15 +28,5 @@ KSWH .EQ $39 INPUT CHARACTER HOOK HIGH
|
||||
RNDL .EQ $4E RANDOM NUMBER LOW
|
||||
RNDH .EQ $4F RANDOM NUMBER HIGH
|
||||
*--------------------------------------
|
||||
* Applesoft FP Registers
|
||||
*--------------------------------------
|
||||
EXPSGN .EQ $9C
|
||||
FAC .EQ $9D -> A1, MAIN FLT PT ACCUMULATOR
|
||||
FAC.SIGN .EQ $A2 HOLDS UNPACKED SIGN
|
||||
ARG .EQ $A5 -> A9, SECONDARY FP ACC
|
||||
ARG.SIGN .EQ $AA
|
||||
SGNCPR .EQ $AB FLAGS OPP SIGN IN FP ROUT.
|
||||
FAC.EXTENSION .EQ $AC FAC EXTENSION BYTE
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE /A2OSX.DEV/INC/ZP.I
|
||||
|
@ -236,7 +236,7 @@ CS.DOEVENT lda (pEvent)
|
||||
|
||||
ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
|
@ -47,51 +47,37 @@ CS.INIT >SYSCALL GetArgC
|
||||
|
||||
.1 lda #1
|
||||
>SYSCALL GetArgA
|
||||
>SYSCALL GetDevByNameYA
|
||||
bcs .98
|
||||
|
||||
>SYSCALL MkNodYA
|
||||
bcs .9
|
||||
|
||||
>STYA pDev
|
||||
|
||||
txa
|
||||
ldy #S.PS.hINDEV
|
||||
ldy #S.PS.hStdIn
|
||||
sta (pPs),y
|
||||
ldy #S.PS.hOUTDEV
|
||||
ldy #S.PS.hStdOut
|
||||
sta (pPs),y
|
||||
ldy #S.PS.hERRDEV
|
||||
ldy #S.PS.hStdErr
|
||||
sta (pPs),y
|
||||
|
||||
ldx #DEVMGR.OPEN
|
||||
jsr pDevJmp
|
||||
bcs .99
|
||||
|
||||
lda #2
|
||||
>SYSCALL GetArgA
|
||||
bcs .99
|
||||
bcs .9
|
||||
|
||||
>SYSCALL ExpandPStrYA
|
||||
bcs .99
|
||||
bcs .9
|
||||
|
||||
txa
|
||||
|
||||
ldy #hBinName
|
||||
sta (pData),y
|
||||
clc
|
||||
rts
|
||||
|
||||
.98 sec
|
||||
.99 rts
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CS.RUN lda #13 try send a CR...
|
||||
>SYSCALL COutA Device Is Ready ?
|
||||
>SYSCALL PutCA Device Is Ready ?
|
||||
|
||||
bcs .8 no..loop...
|
||||
|
||||
lda pDev
|
||||
clc
|
||||
adc #S.DEV.NAME
|
||||
tay
|
||||
lda pDev+1
|
||||
adc /S.DEV.NAME
|
||||
>PUSHYA
|
||||
>LDYA L.MSG.GREETINGS
|
||||
>SYSCALL CPrintFYA
|
||||
@ -123,7 +109,7 @@ CS.QUIT ldy #hBinName
|
||||
*--------------------------------------
|
||||
CS.END
|
||||
MSG.USAGE >CSTR "GETTY <DEV> <PROGRAM>"
|
||||
MSG.GREETINGS >CSTR "\e[12h\nA2osX-GeTTY on Dev=%S\n"
|
||||
MSG.GREETINGS >CSTR "\e[12h\nA2osX-GeTTY\n"
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
|
@ -58,6 +58,9 @@ CS.RUN lda #0
|
||||
jsr INPUT.RESET
|
||||
|
||||
.1 >SYSCALL Sleep
|
||||
>SYSCALL GetC
|
||||
bcs .1 no char
|
||||
jsr INPUT.CHARIN
|
||||
jsr INPUT.LINEIN
|
||||
bcc .1
|
||||
|
||||
@ -69,11 +72,14 @@ CS.RUN lda #0
|
||||
jsr INPUT.RESET
|
||||
|
||||
.2 >SYSCALL Sleep
|
||||
>SYSCALL GetC
|
||||
bcs .2 no char
|
||||
jsr INPUT.CHARIN
|
||||
jsr INPUT.LINEIN
|
||||
bcc .2
|
||||
|
||||
lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
bcs .9
|
||||
|
||||
>LDYA L.SHELL
|
||||
@ -94,27 +100,8 @@ CS.RUN lda #0
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
cmp (pPs),y
|
||||
bne .99
|
||||
|
||||
lda (pEvent)
|
||||
and #S.EVT.F.KEY
|
||||
beq .99
|
||||
|
||||
ldy #S.EVT.DATAHI
|
||||
lda (pEvent),y
|
||||
bne .99
|
||||
|
||||
ldy #S.EVT.DATALO
|
||||
lda (pEvent),y
|
||||
jsr INPUT.CHARIN
|
||||
clc
|
||||
rts
|
||||
|
||||
.99 sec
|
||||
CS.DOEVENT
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.QUIT clc
|
||||
@ -131,7 +118,7 @@ INPUT.RESET ldy #INPUT.PassChar
|
||||
sta (pData),y
|
||||
rts
|
||||
*--------------------------------------
|
||||
INPUT.CHARIN tax saver char...
|
||||
INPUT.CHARIN tax save char...
|
||||
ldy #INPUT.Status
|
||||
lda (pData),y
|
||||
bmi .9
|
||||
@ -163,7 +150,7 @@ INPUT.CHARIN tax saver char...
|
||||
lda (pData),y
|
||||
bne .1
|
||||
txa
|
||||
.1 >SYSCALL COutA
|
||||
.1 >SYSCALL PutCA
|
||||
rts
|
||||
|
||||
.2 cpx #13 CR
|
||||
|
@ -197,7 +197,7 @@ Cmd.Exec.PWD ldy #S.PS.hPREFIX
|
||||
>SYSCALL PPrintFYA
|
||||
bcs .9
|
||||
lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
.9 rts
|
||||
|
||||
Cmd.Exec.CD1 stz UsrBuf256
|
||||
@ -424,7 +424,7 @@ Cmd.Exec.TIME clc
|
||||
>SYSCALL PPrintFYA
|
||||
bcs .9
|
||||
lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
Cmd.Exec.ECHO lda ARGS
|
||||
@ -435,7 +435,7 @@ Cmd.Exec.ECHO lda ARGS
|
||||
bcs .9
|
||||
|
||||
.1 lda #13
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
|
@ -8,11 +8,11 @@ AUTO 6
|
||||
TXT.OpenFileYA pha
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FILEINFO.TYPE.TXT
|
||||
>PUSHBI SYS.FOPEN.R+SYS.FOPEN.T
|
||||
>PUSHBI SYS.FOpen.R+SYS.FOpen.T
|
||||
pla
|
||||
|
||||
>PUSHYA
|
||||
>SYSCALL FOPEN
|
||||
>SYSCALL FOpen
|
||||
bcs .9
|
||||
|
||||
ldy #hInputFile
|
||||
@ -24,7 +24,7 @@ TXT.ReadFile >PUSHWI UsrBuf256+1
|
||||
ldy #hInputFile
|
||||
lda (pData),y
|
||||
>PUSHA
|
||||
>SYSCALL FREAD
|
||||
>SYSCALL FRead
|
||||
bcs .9
|
||||
|
||||
tya
|
||||
|
@ -88,9 +88,6 @@ CS.INIT.INTERACTIVE
|
||||
jsr HIS.Init
|
||||
bcs .9
|
||||
|
||||
ldy #S.PS.hINDEV
|
||||
lda (pPs),y
|
||||
>PUSHA
|
||||
>LDYA L.MSG.GREETINGS
|
||||
>SYSCALL CPrintFYA
|
||||
|
||||
@ -124,9 +121,14 @@ CS.RUN lda #0
|
||||
bcs .99
|
||||
|
||||
.1 >SYSCALL Sleep
|
||||
>SYSCALL GetC
|
||||
bcs .1 no char
|
||||
|
||||
jsr CS.CHARIN
|
||||
|
||||
lda (pData)
|
||||
bpl .1
|
||||
|
||||
|
||||
and #$7F
|
||||
sta (pData)
|
||||
bra .3
|
||||
@ -170,37 +172,11 @@ CS.RUN lda #0
|
||||
.99 sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
lda (pEvent),y
|
||||
ldy #S.PS.hINDEV
|
||||
cmp (pPs),y
|
||||
bne .9
|
||||
|
||||
lda (pEvent)
|
||||
and #S.EVT.F.KEY is it a KEY event?
|
||||
beq .9
|
||||
|
||||
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
|
||||
lda (pEvent),y
|
||||
bne .9
|
||||
|
||||
ldy #S.EVT.DATALO
|
||||
lda (pEvent),y
|
||||
tax
|
||||
|
||||
ldy #bPause
|
||||
lda (pData),y
|
||||
bpl .11
|
||||
|
||||
lda #0
|
||||
sta (pData),y
|
||||
clc
|
||||
CS.DOEVENT sec
|
||||
rts
|
||||
|
||||
.9 sec
|
||||
rts
|
||||
|
||||
.11 ldy #hInputFile Batch mode ?
|
||||
*--------------------------------------
|
||||
CS.CHARIN tax
|
||||
ldy #hInputFile Batch mode ?
|
||||
lda (pData),y
|
||||
beq .10
|
||||
* Batch Mode
|
||||
@ -248,7 +224,7 @@ CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
|
||||
.13 cpx #$20
|
||||
bcs .1
|
||||
jsr CS.EVENT.CTRL.CHAR
|
||||
jsr CS.CHARIN.CTRL
|
||||
bra .8
|
||||
|
||||
.1 cpx #$7f
|
||||
@ -268,16 +244,15 @@ CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
||||
txa
|
||||
sta (pData),y
|
||||
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.EVENT.CTRL.CHAR
|
||||
cpx #13 CR
|
||||
CS.CHARIN.CTRL cpx #13 CR
|
||||
bne .10
|
||||
txa
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
lda (pData) CmdBuffer
|
||||
ora #$80
|
||||
sta (pData)
|
||||
@ -418,7 +393,7 @@ CmdBuffer.Normalize.Next
|
||||
CmdBuffer.PRINT ldy #0
|
||||
.1 iny
|
||||
lda (pData),y
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
tya
|
||||
cmp (pData)
|
||||
bne .1
|
||||
@ -431,7 +406,7 @@ CmdBuffer.CLR jsr CmdBuffer.DEL
|
||||
CmdBuffer.DEL lda (pData)
|
||||
beq .9
|
||||
lda #8
|
||||
>SYSCALL COutA
|
||||
>SYSCALL PutCA
|
||||
lda (pData)
|
||||
dec
|
||||
sta (pData)
|
||||
@ -459,7 +434,7 @@ CMDS >PSTR "CD"
|
||||
>PSTR "TIME"
|
||||
.HS 00
|
||||
*--------------------------------------
|
||||
MSG.GREETINGS >CSTR "\nA2osX-Shell on Dev=%h\n\n"
|
||||
MSG.GREETINGS >CSTR "\nA2osX-Shell\n\n"
|
||||
MSG.PROMPT >CSTR "%S$ "
|
||||
MSG.ECHO >CSTR ">%S\n"
|
||||
MSG.ERROR >CSTR "%S ($%h)\n"
|
||||
|
@ -56,7 +56,7 @@ CFG.Read.HOSTNAME
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FILEINFO.TYPE.TXT
|
||||
>PUSHBI SYS.FOPEN.R
|
||||
>PUSHBI SYS.FOpen.R
|
||||
pla
|
||||
>PUSHYA
|
||||
>SYSCALL LoadFile
|
||||
@ -111,7 +111,7 @@ CFG.Read.TCPIP.CONF
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FILEINFO.TYPE.TXT
|
||||
>PUSHBI SYS.FOPEN.R
|
||||
>PUSHBI SYS.FOpen.R
|
||||
pla
|
||||
>PUSHYA
|
||||
>SYSCALL LoadFile
|
||||
@ -179,7 +179,7 @@ CFG.Read.TCPIP.CONF
|
||||
*--------------------------------------
|
||||
CFG.Read.HOSTS >PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FILEINFO.TYPE.TXT
|
||||
>PUSHBI SYS.FOPEN.R
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHW L.HOSTS
|
||||
>SYSCALL LoadFile
|
||||
bcs .99
|
||||
|
@ -16,7 +16,7 @@ K.GetArgC jsr ARG.InitArgPtr1
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 lda (ZPQuickPtr1)
|
||||
.1 lda (ZPPtr1)
|
||||
beq .8
|
||||
|
||||
jsr ARG.NextArgPtr1
|
||||
@ -42,7 +42,7 @@ K.GetArgA sta .2+1
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 lda (ZPQuickPtr1)
|
||||
.1 lda (ZPPtr1)
|
||||
beq .9
|
||||
|
||||
.2 cpx #$ff Self Modified
|
||||
@ -52,7 +52,7 @@ K.GetArgA sta .2+1
|
||||
inx
|
||||
bra .1
|
||||
|
||||
.8 >LDYA ZPQuickPtr1
|
||||
.8 >LDYA ZPPtr1
|
||||
clc
|
||||
rts
|
||||
|
||||
@ -62,15 +62,15 @@ K.GetArgA sta .2+1
|
||||
ARG.InitArgPtr1 ldy #S.PS.hCMDLINE
|
||||
lda (pPs),y
|
||||
jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
rts
|
||||
*--------------------------------------
|
||||
ARG.NextArgPtr1 lda ZPQuickPtr1
|
||||
ARG.NextArgPtr1 lda ZPPtr1
|
||||
sec
|
||||
adc (ZPQuickPtr1)
|
||||
sta ZPQuickPtr1
|
||||
adc (ZPPtr1)
|
||||
sta ZPPtr1
|
||||
bcc .8
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPPtr1+1
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -17,11 +17,11 @@ K.LoadEXEYA >STYA K.LoadEXEYA.Filename
|
||||
jsr MEM.GetMemByNameYA
|
||||
bcs K.LoadEXEYA.1 not already loaded
|
||||
|
||||
>STYA ZPQuickPtr1 Save base address
|
||||
>STYA ZPPtr1 Save base address
|
||||
ldy #S.MEM.REFCNT
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
inc
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
txa
|
||||
jmp K.GetMemPtrA X=hMem from K.GetMemByNameA
|
||||
@ -36,7 +36,7 @@ K.LoadEXEYA.1 >PUSHWI KrnBuf256
|
||||
|
||||
>PUSHYA Push AUXTYPE
|
||||
>PUSHBI 6 S.FILEINFO.TYPE.BIN
|
||||
>PUSHBI SYS.FOPEN.R
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHW K.LoadEXEYA.Filename
|
||||
|
||||
jsr K.LoadFile
|
||||
@ -56,26 +56,26 @@ K.LoadEXEYA.1 >PUSHWI KrnBuf256
|
||||
|
||||
txa
|
||||
jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr1 set ZPQuickPtr1 -> Code start
|
||||
>STYA ZPPtr1 set ZPPtr1 -> Code start
|
||||
|
||||
pha YA = actual load address
|
||||
tya
|
||||
sec
|
||||
sbc BIN.Relocate.Start
|
||||
sta BIN.Relocate.Offset Offset=ZPQuickPtr1-AUXTYPE
|
||||
sta BIN.Relocate.Offset Offset=ZPPtr1-AUXTYPE
|
||||
pla
|
||||
sbc BIN.Relocate.Start+1
|
||||
sta BIN.Relocate.Offset+1
|
||||
|
||||
ldy #H.BIN.CODE.LEN get Code Len
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
clc
|
||||
adc ZPQuickPtr1
|
||||
sta ZPQuickPtr2 Make ZPQuickPtr2 = ZPQuickPtr1 + CodeLen
|
||||
adc ZPPtr1
|
||||
sta ZPPtr2 Make ZPPtr2 = ZPPtr1 + CodeLen
|
||||
iny
|
||||
lda (ZPQuickPtr1),y
|
||||
adc ZPQuickPtr1+1
|
||||
sta ZPQuickPtr2+1
|
||||
lda (ZPPtr1),y
|
||||
adc ZPPtr1+1
|
||||
sta ZPPtr2+1
|
||||
|
||||
jsr BIN.RelocateEXE
|
||||
|
||||
@ -85,15 +85,15 @@ K.LoadEXEYA.1 >PUSHWI KrnBuf256
|
||||
|
||||
lda K.LoadEXEYA.hMem Keep X=hMem
|
||||
jsr K.GetMemByIDA X unmodified
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
lda (ZPQuickPtr1)
|
||||
lda (ZPPtr1)
|
||||
ora #S.MEM.F.CODE This is a code segment
|
||||
sta (ZPQuickPtr1)
|
||||
sta (ZPPtr1)
|
||||
|
||||
txa Get Back hMem
|
||||
ldy #S.MEM.BIN
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
lda K.LoadEXEYA.hMem
|
||||
tax return hMEM to Caller...
|
||||
@ -164,8 +164,7 @@ BIN.InstallDRV ldy #H.BIN.DRV.CODE.O
|
||||
sbc /DevMgr.HiMem
|
||||
bcs .9 No More Room to load Driver....
|
||||
|
||||
lda DevMgr.LastDevID
|
||||
inc
|
||||
lda DevMgr.Count
|
||||
cmp #K.DEV.MAX
|
||||
bne .10 No Device Handle Left
|
||||
|
||||
@ -177,53 +176,48 @@ BIN.InstallDRV ldy #H.BIN.DRV.CODE.O
|
||||
sec
|
||||
rts
|
||||
|
||||
.10 sta DevMgr.LastDevID
|
||||
|
||||
.10 inc DevMgr.Count
|
||||
>SYSCALL GetDevByIDA
|
||||
>STYA ZPQuickPtr2 setup Ptr2 to dest HEADER
|
||||
>STYA ZPPtr2 setup Ptr2 to dest HEADER
|
||||
|
||||
ldy #H.BIN.DRV.HEADER.O
|
||||
lda (pDrv),y
|
||||
clc
|
||||
adc pDrv
|
||||
sta ZPQuickPtr1
|
||||
sta ZPPtr1
|
||||
iny
|
||||
lda (pDrv),y
|
||||
adc pDrv+1
|
||||
sta ZPQuickPtr1+1 set Ptr1 to Src HEADER
|
||||
sta ZPPtr1+1 set Ptr1 to Src HEADER
|
||||
|
||||
ldy #S.DEV-1
|
||||
|
||||
.1 lda (ZPQuickPtr1),y copy header to DevMgr.Table
|
||||
sta (ZPQuickPtr2),y
|
||||
.1 lda (ZPPtr1),y copy header to DevMgr.Table
|
||||
sta (ZPPtr2),y
|
||||
dey
|
||||
bpl .1
|
||||
|
||||
ldy #S.DEV.ID
|
||||
lda DevMgr.LastDevID
|
||||
sta (ZPQuickPtr2),y
|
||||
|
||||
dey #S.DEV.JMP+1 Setup Main JMP
|
||||
ldy #S.DEV.JMP+1 Setup Main JMP
|
||||
lda DevMgr.Free+1
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
tax
|
||||
|
||||
dey #S.DEV.JMP
|
||||
dey #S.DEV.JMP
|
||||
lda DevMgr.Free
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
sta ZPQuickPtr2 set Ptr2 to Dest CODE
|
||||
stx ZPQuickPtr2+1
|
||||
sta ZPPtr2 set Ptr2 to Dest CODE
|
||||
stx ZPPtr2+1
|
||||
|
||||
ldy #H.BIN.DRV.CODE.O
|
||||
lda (pDrv),y
|
||||
clc
|
||||
adc pDrv
|
||||
sta ZPQuickPtr1
|
||||
sta ZPPtr1
|
||||
iny
|
||||
lda (pDrv),y
|
||||
adc pDrv+1
|
||||
sta ZPQuickPtr1+1 set Ptr1 to Src CODE
|
||||
sta ZPPtr1+1 set Ptr1 to Src CODE
|
||||
|
||||
lda BIN.InstallDRV.DrvLen+1
|
||||
eor #$ff
|
||||
@ -241,31 +235,32 @@ BIN.InstallDRV ldy #H.BIN.DRV.CODE.O
|
||||
beq .4
|
||||
pha
|
||||
|
||||
.3 lda (ZPQuickPtr1),y
|
||||
sta (ZPQuickPtr2),y
|
||||
.3 lda (ZPPtr1),y
|
||||
sta (ZPPtr2),y
|
||||
iny
|
||||
bne .2
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPQuickPtr2+1
|
||||
inc ZPPtr1+1
|
||||
inc ZPPtr2+1
|
||||
bra .2
|
||||
|
||||
.4 ldy #H.BIN.DRV.CODE.LEN
|
||||
lda DevMgr.Free Make Ptr1 = code start
|
||||
sta ZPQuickPtr1
|
||||
sta ZPPtr1
|
||||
clc
|
||||
adc (pDrv),y
|
||||
sta ZPQuickPtr2
|
||||
sta ZPPtr2
|
||||
|
||||
iny
|
||||
lda DevMgr.Free+1
|
||||
sta ZPQuickPtr1+1
|
||||
sta ZPPtr1+1
|
||||
adc (pDrv),y
|
||||
sta ZPQuickPtr2+1 Make ZPQuickPtr2 = ZPQuickPtr1 + CodeLen
|
||||
sta ZPPtr2+1 Make ZPPtr2 = ZPPtr1 + CodeLen
|
||||
|
||||
jsr BIN.RelocateDRV
|
||||
|
||||
>LDYA BIN.InstallDRV.DrvEnd
|
||||
>STYA DevMgr.Free
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -274,15 +269,15 @@ BIN.InstallDRV.DrvEnd .BS 2
|
||||
*--------------------------------------
|
||||
* BIN.Relocate___ :
|
||||
* In :
|
||||
* ZPQuickPtr1 = Ptr to Code
|
||||
* ZPQuickPtr2 = End Of Code
|
||||
* ZPPtr1 = Ptr to Code
|
||||
* ZPPtr2 = End Of Code
|
||||
*--------------------------------------
|
||||
BIN.Relocate.Start .BS 2
|
||||
BIN.Relocate.End .BS 2
|
||||
BIN.Relocate.Offset .BS 2
|
||||
*--------------------------------------
|
||||
BIN.RelocateEXE ldy #H.BIN.HEADER+1
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
cmp /H.BIN.HEADER.BIN65
|
||||
beq .1
|
||||
cmp /H.BIN.HEADER.DRV65
|
||||
@ -293,15 +288,15 @@ BIN.RelocateEXE ldy #H.BIN.HEADER+1
|
||||
rts
|
||||
|
||||
.1 ldy #H.BIN.JMP relocate Main JMP
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
clc
|
||||
adc BIN.Relocate.Offset
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
iny
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
adc BIN.Relocate.Offset+1
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
ldy #H.BIN.EXE.REL.TABLE skip Header, CS.SIZE & DS.SIZE... (16 bytes)
|
||||
|
||||
@ -309,22 +304,22 @@ BIN.RelocateEXE ldy #H.BIN.HEADER+1
|
||||
*--------------------------------------
|
||||
BIN.RelocateDRV ldy #H.BIN.DRV.REL.TABLE
|
||||
|
||||
.1 lda (ZPQuickPtr1),y Start Relocate JMP table
|
||||
.1 lda (ZPPtr1),y Start Relocate JMP table
|
||||
tax LO in X
|
||||
iny
|
||||
ora (ZPQuickPtr1),y ORA with HI
|
||||
ora (ZPPtr1),y ORA with HI
|
||||
beq .2 $0000 = end of table
|
||||
|
||||
dey
|
||||
txa get back LO
|
||||
clc
|
||||
adc BIN.Relocate.Offset
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
iny
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
adc BIN.Relocate.Offset+1
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
iny
|
||||
|
||||
@ -334,12 +329,12 @@ BIN.RelocateDRV ldy #H.BIN.DRV.REL.TABLE
|
||||
|
||||
sec + 1 to skip last 00 from beq .2
|
||||
|
||||
adc ZPQuickPtr1
|
||||
sta ZPQuickPtr1
|
||||
adc ZPPtr1
|
||||
sta ZPPtr1
|
||||
bcc .3
|
||||
inc ZPQuickPtr1+1 ZPQuickPtr1=Current Code PTR
|
||||
inc ZPPtr1+1 ZPPtr1=Current Code PTR
|
||||
|
||||
.3 lda (ZPQuickPtr1) get OPCODE
|
||||
.3 lda (ZPPtr1) get OPCODE
|
||||
lsr /2
|
||||
tax
|
||||
lda BIN.OPCODES,x get OPCODE definition
|
||||
@ -357,19 +352,19 @@ BIN.RelocateDRV ldy #H.BIN.DRV.REL.TABLE
|
||||
pha
|
||||
|
||||
ldy #1
|
||||
lda (ZPQuickPtr1),y Get LO
|
||||
lda (ZPPtr1),y Get LO
|
||||
tax save LO in X
|
||||
|
||||
iny make Y point to HI
|
||||
|
||||
cpx BIN.Relocate.Start
|
||||
lda (ZPQuickPtr1),y Get HI
|
||||
lda (ZPPtr1),y Get HI
|
||||
sbc BIN.Relocate.Start+1
|
||||
bcc .5 addr < BIN.Relocate.Start, out of range
|
||||
|
||||
txa Get back LO
|
||||
cpx BIN.Relocate.End
|
||||
lda (ZPQuickPtr1),y Get HI
|
||||
lda (ZPPtr1),y Get HI
|
||||
sbc BIN.Relocate.End+1
|
||||
bcs .5 addr > BIN.Relocate.End, out of range
|
||||
|
||||
@ -377,24 +372,24 @@ BIN.RelocateDRV ldy #H.BIN.DRV.REL.TABLE
|
||||
* clc CC from bcs .6
|
||||
adc BIN.Relocate.Offset add Offset to abs address
|
||||
dey
|
||||
sta (ZPQuickPtr1),y store relocated addr LO
|
||||
sta (ZPPtr1),y store relocated addr LO
|
||||
iny
|
||||
lda (ZPQuickPtr1),y Get HI
|
||||
lda (ZPPtr1),y Get HI
|
||||
adc BIN.Relocate.Offset+1
|
||||
sta (ZPQuickPtr1),y store relocated addr HI
|
||||
sta (ZPPtr1),y store relocated addr HI
|
||||
|
||||
.5 pla get back Opcode length...
|
||||
|
||||
.6 clc A = OPCODE length
|
||||
adc ZPQuickPtr1
|
||||
sta ZPQuickPtr1
|
||||
adc ZPPtr1
|
||||
sta ZPPtr1
|
||||
bcc .7
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPPtr1+1
|
||||
|
||||
.7 eor ZPQuickPtr2 A = ZPQuickPtr1
|
||||
.7 eor ZPPtr2 A = ZPPtr1
|
||||
bne .3
|
||||
lda ZPQuickPtr1+1
|
||||
eor ZPQuickPtr2+1
|
||||
lda ZPPtr1+1
|
||||
eor ZPPtr2+1
|
||||
bne .3 next opcode....
|
||||
|
||||
.8 rts
|
||||
|
203
SYS/KERNEL.S.CHR.txt
Normal file
203
SYS/KERNEL.S.CHR.txt
Normal file
@ -0,0 +1,203 @@
|
||||
PR#3
|
||||
PREFIX /A2OSX.SRC
|
||||
NEW
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*/--------------------------------------
|
||||
* #FPutCAY
|
||||
* Print A (char) to File
|
||||
* ##In:
|
||||
* A : char to print
|
||||
* Y = hFILE
|
||||
* ##Out:
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.FPutCAY sta K.PutC.Char
|
||||
sty K.PutC.Node
|
||||
tya
|
||||
phy
|
||||
bne K.PutCA.1
|
||||
K.PutCA.8 ply
|
||||
clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* #PutCA
|
||||
* Print A (char) to StdOut
|
||||
* ##In:
|
||||
* A : char to print
|
||||
* ##Out:
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.PutCA sta K.PutC.Char
|
||||
phy
|
||||
ldy #S.PS.hStdOut
|
||||
lda (pPs),y
|
||||
beq K.PutCA.8 NUL
|
||||
|
||||
phx
|
||||
|
||||
K.PutCA.1 sta K.PutC.Node
|
||||
jsr K.GetMemPtrA
|
||||
>STYA pDev
|
||||
|
||||
ldy #S.NODE.T
|
||||
lda (pDev),y
|
||||
asl
|
||||
tax
|
||||
jsr K.PutCA.Jmp
|
||||
|
||||
plx
|
||||
ply
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.PutCA.Jmp jmp (.1,x)
|
||||
.1 .DA K.PutCA.REG
|
||||
.DA K.CHR.IOERR DIR
|
||||
.DA K.PutCA.CDEV
|
||||
.DA K.CHR.IOERR BDEV
|
||||
.DA K.CHR.IOERR LNK
|
||||
.DA K.CHR.IOERR DSOCK
|
||||
.DA K.PutCA.SSOCK
|
||||
.DA K.PutCA.FIFO
|
||||
*--------------------------------------
|
||||
K.PutCA.REG lda K.PutC.Node
|
||||
ldy K.PutC.Char
|
||||
jmp K.FWriteAY
|
||||
*--------------------------------------
|
||||
K.PutCA.CDEV ldy #S.NODE.DEV.JMP
|
||||
lda (pDev),y
|
||||
sta .1+1
|
||||
iny
|
||||
lda (pDev),y
|
||||
sta .1+2
|
||||
lda K.PutC.Char
|
||||
ldx #DEVMGR.WRITE
|
||||
.1 jmp $ffff
|
||||
*--------------------------------------
|
||||
K.PutCA.SSOCK sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.PutCA.FIFO ldy #S.NODE.FIFO.S
|
||||
lda (pDev),y
|
||||
beq .9 Remote PS did not opened yet the pipe
|
||||
cmp #S.NODE.FIFO.S.Closed
|
||||
beq .99 Remote PS closed the Pipe
|
||||
|
||||
ldy #S.NODE.FIFO.hMem
|
||||
lda (pDev),y
|
||||
jsr K.GetMemPtrA
|
||||
>STYA .1+2
|
||||
|
||||
ldy #S.NODE.FIFO.Head
|
||||
lda (pDev),y
|
||||
inc
|
||||
dey #S.NODE.FIFO.Tail
|
||||
cmp (pDev),y
|
||||
beq .9 FIFO is full
|
||||
iny
|
||||
sta (pDev),y
|
||||
tay
|
||||
lda K.PutC.Char
|
||||
.1 sta $ffff,y
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #MLI.ERR.VOLFULL
|
||||
sec
|
||||
rts
|
||||
|
||||
.99 lda #MLI.ERR.EOF
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.PutC.Char .BS 1
|
||||
K.PutC.Node .BS 1
|
||||
*/--------------------------------------
|
||||
* #FGetCA
|
||||
* Get char from File
|
||||
* ##In:
|
||||
* A = hFILE
|
||||
* ##Out:
|
||||
* CC = success
|
||||
* A = char
|
||||
*\--------------------------------------
|
||||
K.FGetCA
|
||||
*/--------------------------------------
|
||||
* #GetC
|
||||
* Get char from StdIn
|
||||
* ##In:
|
||||
* none.
|
||||
* ##Out:
|
||||
* CC = success
|
||||
* A = char
|
||||
*\--------------------------------------
|
||||
K.GetC ldy #S.PS.hStdIn
|
||||
lda (pPs),y
|
||||
|
||||
sta K.PutC.Node
|
||||
jsr K.GetMemPtrA
|
||||
>STYA pDev
|
||||
|
||||
ldy #S.NODE.T
|
||||
lda (pDev),y
|
||||
asl
|
||||
tax
|
||||
jmp (.1,x)
|
||||
|
||||
.1 .DA K.GetC.REG
|
||||
.DA K.CHR.IOERR DIR
|
||||
.DA K.GetC.CDEV
|
||||
.DA K.CHR.IOERR BDEV
|
||||
.DA K.CHR.IOERR LNK
|
||||
.DA K.CHR.IOERR DSOCK
|
||||
.DA K.GetC.SSOCK
|
||||
.DA K.GetC.FIFO
|
||||
*--------------------------------------
|
||||
K.GetC.REG
|
||||
*--------------------------------------
|
||||
K.GetC.CDEV ldx #DEVMGR.READ
|
||||
ldy #S.NODE.DEV.JMP
|
||||
lda (pDev),y
|
||||
sta .1+1
|
||||
iny
|
||||
lda (pDev),y
|
||||
sta .1+2
|
||||
.1 jmp $ffff
|
||||
*--------------------------------------
|
||||
K.GetC.SSOCK
|
||||
*--------------------------------------
|
||||
K.GetC.FIFO
|
||||
*/--------------------------------------
|
||||
* #FPutS
|
||||
* Print String to FILE
|
||||
* ##In:
|
||||
* PUSHW : CPtr
|
||||
* PUSHB : hFILE
|
||||
* ##Out:
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.FPutS
|
||||
*/--------------------------------------
|
||||
* #PutSYA
|
||||
* Print String to StdOut
|
||||
* ##In:
|
||||
* Y,A : CPtr
|
||||
* ##Out:
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.PutSYA
|
||||
*--------------------------------------
|
||||
K.FGetS
|
||||
*--------------------------------------
|
||||
K.GetSYA
|
||||
bra *
|
||||
*--------------------------------------
|
||||
K.CHR.IOERR lda #MLI.ERR.IO
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE SYS/KERNEL.S.CHR
|
||||
LOAD SYS/KERNEL.S
|
||||
ASM
|
@ -18,23 +18,23 @@ K.SScanF jsr PullPtr1Ptr2Ptr3
|
||||
|
||||
ldy #0 Y = PTR in pattern
|
||||
|
||||
lda (ZPQuickPtr1)
|
||||
lda (ZPPtr1)
|
||||
beq .9
|
||||
tax X = COUNT to scan
|
||||
inc ZPQuickPtr1
|
||||
inc ZPPtr1
|
||||
bne .1
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPPtr1+1
|
||||
|
||||
.1 txa End Of String?
|
||||
beq .8
|
||||
tya
|
||||
cmp (ZPQuickPtr2) End of pattern?
|
||||
cmp (ZPPtr2) End of pattern?
|
||||
beq .8
|
||||
iny
|
||||
lda (ZPQuickPtr2),y
|
||||
lda (ZPPtr2),y
|
||||
cmp #'%' Escape?
|
||||
beq .2
|
||||
cmp (ZPQuickPtr1) Same char?
|
||||
cmp (ZPPtr1) Same char?
|
||||
bne .9
|
||||
jsr K.SScanF.IncPtr1
|
||||
bne .1
|
||||
@ -42,16 +42,16 @@ K.SScanF jsr PullPtr1Ptr2Ptr3
|
||||
rts
|
||||
|
||||
.2 tya
|
||||
cmp (ZPQuickPtr2) unexpected End of pattern after "%" ?
|
||||
cmp (ZPPtr2) unexpected End of pattern after "%" ?
|
||||
beq .9
|
||||
|
||||
iny
|
||||
lda (ZPQuickPtr2),y
|
||||
lda (ZPPtr2),y
|
||||
cmp #'d' BYTE ?
|
||||
bne .3
|
||||
|
||||
stz ASCBUF
|
||||
.20 lda (ZPQuickPtr1)
|
||||
.20 lda (ZPPtr1)
|
||||
jsr K.SScanF.IsDigit
|
||||
bcs .21
|
||||
phx
|
||||
@ -64,10 +64,10 @@ K.SScanF jsr PullPtr1Ptr2Ptr3
|
||||
|
||||
.21 jsr DEC2HEX
|
||||
lda HEXBUF
|
||||
sta (ZPQuickPtr3)
|
||||
inc ZPQuickPtr3
|
||||
sta (ZPPtr3)
|
||||
inc ZPPtr3
|
||||
bne .1
|
||||
inc ZPQuickPtr3+1
|
||||
inc ZPPtr3+1
|
||||
bra .1
|
||||
|
||||
.3 cmp #'D' WORD ?
|
||||
@ -89,9 +89,9 @@ K.SScanF jsr PullPtr1Ptr2Ptr3
|
||||
K.SScanF.IncPtr1
|
||||
dex
|
||||
beq .1
|
||||
inc ZPQuickPtr1
|
||||
inc ZPPtr1
|
||||
bne .1
|
||||
inc ZPQuickPtr1+1 never Zero
|
||||
inc ZPPtr1+1 never Zero
|
||||
.1 rts
|
||||
*--------------------------------------
|
||||
K.SScanF.IsDigit
|
||||
@ -144,7 +144,7 @@ K.SScanF.IsDigit
|
||||
K.PPrintFYA ldx #$01 PSTR
|
||||
.HS 2C bit abs
|
||||
K.CPrintFYA ldx #$00 CSTR
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
stx CIO.GetCharAtPtr1Y+1
|
||||
|
||||
ldy #0
|
||||
@ -218,7 +218,7 @@ K.CPrintFYA ldx #$00 CSTR
|
||||
|
||||
.13 lda PrintFTBL2.OUT,x
|
||||
|
||||
.20 jsr K.COutA
|
||||
.20 jsr K.PutCA
|
||||
bcc .1
|
||||
.99 rts
|
||||
*--------------------------------------
|
||||
@ -249,7 +249,7 @@ PrintF.A >PULLW HEXBUF
|
||||
lsr
|
||||
tax
|
||||
lda TYPES,x
|
||||
jsr K.COutA
|
||||
jsr K.PutCA
|
||||
bcs .9
|
||||
|
||||
ldx #0
|
||||
@ -259,7 +259,7 @@ PrintF.A >PULLW HEXBUF
|
||||
bcc .2
|
||||
lda ACCESS,x
|
||||
|
||||
.2 jsr K.COutA
|
||||
.2 jsr K.PutCA
|
||||
bcs .9
|
||||
|
||||
inx
|
||||
@ -271,7 +271,7 @@ PrintF.A >PULLW HEXBUF
|
||||
bcc .4
|
||||
lda ACCESS,x
|
||||
|
||||
.4 jmp K.COutA
|
||||
.4 jmp K.PutCA
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
@ -290,7 +290,7 @@ PrintF.B.1 ldx #8
|
||||
pha
|
||||
lda #'0'
|
||||
adc #0 add Carry
|
||||
jsr K.COutA
|
||||
jsr K.PutCA
|
||||
pla
|
||||
bcs PrintF.BB.RTS
|
||||
dex
|
||||
@ -306,10 +306,10 @@ PrintF.DD.1 stz HEXBUF+2
|
||||
stz HEXBUF+3
|
||||
bra PrintF.U.1
|
||||
|
||||
PrintF.U >PULLW ZPQuickPtr2
|
||||
PrintF.U >PULLW ZPPtr2
|
||||
ldy #3
|
||||
|
||||
.1 lda (ZPQuickPtr2),y
|
||||
.1 lda (ZPPtr2),y
|
||||
sta HEXBUF,y
|
||||
dey
|
||||
bpl .1
|
||||
@ -318,10 +318,10 @@ PrintF.U.1 stz SIGN
|
||||
jsr HEX2DEC
|
||||
jmp PrintDEC
|
||||
*--------------------------------------
|
||||
PrintF.E >PULLW ZPQuickPtr2
|
||||
PrintF.E >PULLW ZPPtr2
|
||||
rts
|
||||
*--------------------------------------
|
||||
PrintF.F >PULLW ZPQuickPtr2
|
||||
PrintF.F >PULLW ZPPtr2
|
||||
rts
|
||||
*--------------------------------------
|
||||
PrintF.HH >PULLA
|
||||
@ -367,10 +367,10 @@ PrintF.II.1 stz HEXBUF+2
|
||||
stz HEXBUF+3
|
||||
bra PrintF.L.1
|
||||
|
||||
PrintF.L >PULLW ZPQuickPtr2
|
||||
PrintF.L >PULLW ZPPtr2
|
||||
ldy #3
|
||||
|
||||
.1 lda (ZPQuickPtr2),y
|
||||
.1 lda (ZPPtr2),y
|
||||
sta HEXBUF,y
|
||||
dey
|
||||
bpl .1
|
||||
@ -378,227 +378,6 @@ PrintF.L >PULLW ZPQuickPtr2
|
||||
|
||||
PrintF.L.1 ror SIGN
|
||||
jsr HEX2DEC
|
||||
jmp PrintDEC
|
||||
*--------------------------------------
|
||||
PrintF.N >PULLA
|
||||
PrintF.N.1 and #$0F
|
||||
bra PrintF.NN.2
|
||||
|
||||
PrintF.NN >PULLA
|
||||
PrintF.NN.1 lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
|
||||
PrintF.NN.2 ora #$30
|
||||
cmp #$3A
|
||||
bcc .1
|
||||
adc #6
|
||||
.1 jmp K.COutA
|
||||
*--------------------------------------
|
||||
* CStr
|
||||
*--------------------------------------
|
||||
PrintF.S >PULLW ZPQuickPtr2
|
||||
|
||||
ldy #0
|
||||
|
||||
.1 lda (ZPQuickPtr2),y
|
||||
beq .2
|
||||
|
||||
jsr K.COutA
|
||||
bcs .9
|
||||
iny
|
||||
lda PADLEN
|
||||
|
||||
beq .1
|
||||
cpy PADLEN
|
||||
bne .1
|
||||
rts
|
||||
|
||||
.2 lda PADLEN
|
||||
beq .8
|
||||
|
||||
.3 lda PADCHAR
|
||||
jsr K.COutA
|
||||
bcs .9
|
||||
iny
|
||||
cpy PADLEN
|
||||
bne .3
|
||||
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
* PStr
|
||||
*--------------------------------------
|
||||
PrintF.SS >PULLW ZPQuickPtr2
|
||||
|
||||
ldy #0
|
||||
lda (ZPQuickPtr2),y
|
||||
tax
|
||||
beq .8
|
||||
|
||||
.1 iny
|
||||
lda (ZPQuickPtr2),y
|
||||
jsr K.COutA
|
||||
bcs .9
|
||||
lda PADLEN
|
||||
|
||||
beq .2
|
||||
cpy PADLEN
|
||||
beq .8
|
||||
|
||||
.2 dex
|
||||
bne .1
|
||||
|
||||
lda PADLEN
|
||||
beq .8
|
||||
|
||||
.3 lda PADCHAR
|
||||
jsr K.COutA
|
||||
bcs .9
|
||||
iny
|
||||
cpy PADLEN
|
||||
bne .3
|
||||
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CIO.GetCharAtPtr1Y
|
||||
lda #$ff Self Modified PSTR/CSTR
|
||||
bne .1
|
||||
|
||||
lda (ZPQuickPtr1),y CSTR
|
||||
beq .9
|
||||
iny advance to next char...
|
||||
bne .9
|
||||
inc ZPQuickPtr1+1 Allow >256 CStrings
|
||||
rts
|
||||
|
||||
|
||||
.1 tya PSTR
|
||||
cmp (ZPQuickPtr1)
|
||||
beq .9
|
||||
iny
|
||||
lda (ZPQuickPtr1),y NZ
|
||||
|
||||
.9 clc no error, but end of string
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.COutA phx
|
||||
phy
|
||||
cmp #13
|
||||
bne .1
|
||||
ldx #DEVMGR.COUT
|
||||
jsr pDevJmp
|
||||
bcs .2
|
||||
lda #10
|
||||
.1 ldx #DEVMGR.COUT
|
||||
jsr pDevJmp
|
||||
.2 ply
|
||||
plx
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* #FPutCAY
|
||||
* Print A (char) to File
|
||||
* ##In:
|
||||
* A : char to print
|
||||
* Y = hFILE
|
||||
* none.
|
||||
* ##Out:
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.FPutCAY sta K.PutC.Char
|
||||
sty K.PutC.Node
|
||||
tya
|
||||
bne K.PutCA.1
|
||||
K.PutCA.8 clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* #PutCA
|
||||
* Print A (char) to StdOut
|
||||
* ##In:
|
||||
* A : char to print
|
||||
* none.
|
||||
* ##Out:
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.PutCA sta K.PutC.Char
|
||||
ldy #S.PS.hStdOut
|
||||
lda (pPs),y
|
||||
beq K.PutCA.8 NUL
|
||||
|
||||
K.PutCA.1 sta K.PutC.Node
|
||||
jsr K.GetMemPtrA
|
||||
>STYA pNode
|
||||
|
||||
ldy #S.NODE.T
|
||||
lda (pNode),y
|
||||
asl
|
||||
tax
|
||||
jmp (K.PutCA.Jmp,x)
|
||||
*--------------------------------------
|
||||
K.PutCA.Jmp .DA K.PutCA.REG
|
||||
.DA K.PutCA.IOERR DIR
|
||||
.DA K.PutCA.CDEV
|
||||
.DA K.PutCA.IOERR BDEV
|
||||
.DA K.PutCA.IOERR LNK
|
||||
.DA K.PutCA.IOERR DSOCK
|
||||
.DA K.PutCA.SSOCK
|
||||
.DA K.PutCA.FIFO
|
||||
*--------------------------------------
|
||||
K.PutCA.REG lda K.PutC.Node
|
||||
ldy K.PutC.Char
|
||||
jmp K.FWriteAY
|
||||
*--------------------------------------
|
||||
K.PutCA.CDEV
|
||||
*--------------------------------------
|
||||
K.PutCA.SSOCK
|
||||
*--------------------------------------
|
||||
K.PutCA.FIFO ldy #S.NODE.FIFO.S
|
||||
lda (pNode),y
|
||||
beq .9 Remote PS did not opened yet the pipe
|
||||
cmp #S.NODE.FIFO.S.Closed
|
||||
beq .99 Remote PS closed the Pipe
|
||||
|
||||
ldy #S.NODE.FIFO.hMem
|
||||
lda (pNode),y
|
||||
jsr K.GetMemPtrA
|
||||
>STYA .1+2
|
||||
|
||||
ldy #S.NODE.FIFO.Head
|
||||
lda (pNode),y
|
||||
inc
|
||||
iny
|
||||
cmp (pNode),y
|
||||
beq .9 FIFO is full
|
||||
dey
|
||||
sta (pNode),y
|
||||
tay
|
||||
lda K.PutC.Char
|
||||
.1 sta $ffff,y
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #MLI.ERR.VOLFULL
|
||||
sec
|
||||
rts
|
||||
|
||||
.99 lda #MLI.ERR.EOF
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.PutCA.IOERR lda #MLI.ERR.IO
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.PutC.Char .BS 1
|
||||
K.PutC.Node .BS 1
|
||||
*--------------------------------------
|
||||
K.FGetC
|
||||
*--------------------------------------
|
||||
K.FPutSYA
|
||||
*--------------------------------------
|
||||
K.FGetS
|
||||
*--------------------------------------
|
||||
PRINTDEC lda PADLEN any Len format ?
|
||||
beq .1 no
|
||||
@ -630,11 +409,11 @@ PRINTDEC lda PADLEN any Len format ?
|
||||
bpl .5
|
||||
pha yes, save whatever we have to print....
|
||||
lda #'-'
|
||||
jsr K.COutA
|
||||
jsr K.PutCA
|
||||
stz SIGN reset flag for next char...
|
||||
pla
|
||||
|
||||
.5 jsr K.COutA
|
||||
.5 jsr K.PutCA
|
||||
bcs .9
|
||||
|
||||
.6 inx
|
||||
@ -644,6 +423,89 @@ PRINTDEC lda PADLEN any Len format ?
|
||||
clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
PrintF.N >PULLA
|
||||
PrintF.N.1 and #$0F
|
||||
bra PrintF.NN.2
|
||||
|
||||
PrintF.NN >PULLA
|
||||
PrintF.NN.1 lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
|
||||
PrintF.NN.2 ora #$30
|
||||
cmp #$3A
|
||||
bcc .1
|
||||
adc #6
|
||||
.1 jmp K.PutCA
|
||||
*--------------------------------------
|
||||
PrintF.S ldy #$ff CSTR
|
||||
.HS 2C bit abs
|
||||
PrintF.SS ldy #$00 PSTR
|
||||
|
||||
>PULLW ZPPtr2
|
||||
|
||||
lda (ZPPtr2) if CSTR:last char=0, if PSTR:len=0
|
||||
beq .8
|
||||
|
||||
sty .1+1
|
||||
|
||||
.1 lda #$ff Self Modified
|
||||
bne .11 CSTR
|
||||
|
||||
tya PSTR
|
||||
cmp (ZPPtr2) len check
|
||||
beq .2
|
||||
|
||||
.11 iny
|
||||
|
||||
lda (ZPPtr2),y
|
||||
beq .2
|
||||
|
||||
jsr K.PutCA
|
||||
bcs .9
|
||||
|
||||
lda PADLEN
|
||||
beq .1
|
||||
|
||||
cpy PADLEN
|
||||
bne .1
|
||||
rts
|
||||
|
||||
.2 lda PADLEN
|
||||
beq .8
|
||||
|
||||
.3 lda PADCHAR
|
||||
jsr K.PutCA
|
||||
bcs .9
|
||||
iny
|
||||
cpy PADLEN
|
||||
bne .3
|
||||
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CIO.GetCharAtPtr1Y
|
||||
lda #$ff Self Modified PSTR/CSTR
|
||||
bne .1
|
||||
|
||||
lda (ZPPtr1),y CSTR
|
||||
beq .9
|
||||
iny advance to next char...
|
||||
bne .9
|
||||
inc ZPPtr1+1 Allow >256 CStrings
|
||||
rts
|
||||
|
||||
|
||||
.1 tya PSTR
|
||||
cmp (ZPPtr1)
|
||||
beq .9
|
||||
iny
|
||||
lda (ZPPtr1),y NZ
|
||||
|
||||
.9 clc no error, but end of string
|
||||
rts
|
||||
*--------------------------------------
|
||||
TYPES .AS "-dbclssp"
|
||||
ACCESS .AS "rwxrwxrwx"
|
||||
SIGN .BS 1
|
||||
|
@ -17,10 +17,7 @@ HEX2DEC ldx #4
|
||||
|
||||
ldx #32 let's roll 32 bits
|
||||
|
||||
.2 asl HEXBUF
|
||||
rol HEXBUF+1
|
||||
rol HEXBUF+2
|
||||
rol HEXBUF+3
|
||||
.2 jsr HEXBUF.ROL
|
||||
|
||||
ldy #4
|
||||
|
||||
@ -75,19 +72,13 @@ DEC2HEX stz HEXBUF
|
||||
lda HEXBUF
|
||||
pha
|
||||
|
||||
asl HEXBUF HEXBUF * 2 -> HEXBUF
|
||||
rol HEXBUF+1
|
||||
rol HEXBUF+2
|
||||
rol HEXBUF+3
|
||||
jsr HEXBUF.ROL HEXBUF * 2 -> HEXBUF
|
||||
* bcs .9 overflow!!!
|
||||
|
||||
asl HEXBUF HEXBUF * 4 -> HEXBUF
|
||||
rol HEXBUF+1
|
||||
rol HEXBUF+2
|
||||
rol HEXBUF+3
|
||||
jsr HEXBUF.ROL HEXBUF * 4 -> HEXBUF
|
||||
* bcs .9 overflow!!!
|
||||
|
||||
pla HEXBUF * 4 + HEXBUF -> HEXBUF
|
||||
pla HEXBUF * 4 + HEXBUF -> HEXBUF
|
||||
adc HEXBUF
|
||||
sta HEXBUF
|
||||
pla
|
||||
@ -101,10 +92,7 @@ DEC2HEX stz HEXBUF
|
||||
sta HEXBUF+3
|
||||
* bcs .99 overflow!!!
|
||||
|
||||
asl HEXBUF HEXBUF * 10 -> HEXBUF
|
||||
rol HEXBUF+1
|
||||
rol HEXBUF+2
|
||||
rol HEXBUF+3
|
||||
jsr HEXBUF.ROL HEXBUF * 10 -> HEXBUF
|
||||
* bcs .99 overflow!!!
|
||||
|
||||
inx
|
||||
@ -130,6 +118,12 @@ DEC2HEX stz HEXBUF
|
||||
* pla
|
||||
*.99 rts
|
||||
*--------------------------------------
|
||||
HEXBUF.ROL asl HEXBUF
|
||||
rol HEXBUF+1
|
||||
rol HEXBUF+2
|
||||
rol HEXBUF+3
|
||||
rts
|
||||
*--------------------------------------
|
||||
HEXBUF .BS 4 32 bits max
|
||||
BCDBUF .BS 5 5, enough to handle 10 digits (32bits)
|
||||
ASCBUF .BS 12 LEN + sign + 10 digits ($FFFFFFFF=4.294.967.295)
|
||||
|
@ -5,31 +5,52 @@ INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
DevMgr.Count .EQ 2
|
||||
DevMgr.SYS.BASL0 .EQ $800
|
||||
*--------------------------------------
|
||||
DevMgr.NUL.Code .DA DevMgr.Unsup OPEN
|
||||
.DA DevMgr.Unsup GETEVENT
|
||||
.DA .8 COUT
|
||||
.DA DevMgr.Unsup CLOSE
|
||||
.DA DevMgr.Unsup GETINFO
|
||||
.DA DevMgr.Unsup IRQ
|
||||
.DA DevMgr.Unsup SELECT
|
||||
DevMgr.NUL.Code cld
|
||||
jmp (.1,x)
|
||||
.1 .DA DevMgr.BADCALL STATUS
|
||||
.DA DevMgr.BADCALL READBLOCK
|
||||
.DA DevMgr.BADCALL WRITEBLOCK
|
||||
.DA DevMgr.BADCALL FORMAT
|
||||
.DA DevMgr.BADCALL CONTROL
|
||||
.DA DevMgr.BADCALL INIT
|
||||
.DA DevMgr.BADCALL OPEN
|
||||
.DA DevMgr.BADCALL CLOSE
|
||||
.DA DevMgr.BADCALL READ
|
||||
.DA .8 WRITE
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.Code .DA DevMgr.SYS.Open
|
||||
.DA DevMgr.SYS.GetEvent
|
||||
.DA DevMgr.SYS.COut
|
||||
.DA DevMgr.Unsup CLOSE
|
||||
.DA DevMgr.Unsup GETINFO
|
||||
.DA DevMgr.Unsup IRQ
|
||||
.DA DevMgr.SYS.Select
|
||||
DevMgr.SYS.Code cld
|
||||
jmp (.1,x)
|
||||
.1 .DA DevMgr.SYS.Status
|
||||
.DA DevMgr.BADCALL READBLOCK
|
||||
.DA DevMgr.BADCALL WRITEBLOCK
|
||||
.DA DevMgr.BADCALL FORMAT
|
||||
.DA DevMgr.SYS.Control
|
||||
.DA DevMgr.BADCALL INIT
|
||||
.DA DevMgr.SYS.Open
|
||||
.DA DevMgr.BADCALL CLOSE
|
||||
.DA DevMgr.SYS.Read
|
||||
.DA DevMgr.SYS.Write
|
||||
*--------------------------------------
|
||||
DevMgr.Unsup lda #DEVMGR.ERRUNSUP
|
||||
DevMgr.BADCALL lda #MLI.ERR.BADCALL
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.Status
|
||||
>LDYA DevMgr.SYS.Stat
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
|
||||
.DA #0,#0,#0
|
||||
>PSTR "A2osX SYS Screen"
|
||||
.DA #0
|
||||
.DA #0
|
||||
.DA 0900
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.Open stz DevMgr.SYS.CPULOADI
|
||||
stz DevMgr.SYS.CH
|
||||
stz DevMgr.SYS.CV
|
||||
@ -53,9 +74,9 @@ DevMgr.SYS.Open stz DevMgr.SYS.CPULOADI
|
||||
jsr DevMgr.SYS.Home
|
||||
|
||||
lda #1
|
||||
sta A2osX.SCRNDEVS+1 fall in SELECT
|
||||
sta A2osX.SCRNDEVS+1 fall in Control
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.Select
|
||||
DevMgr.SYS.Control
|
||||
sta SETTEXT
|
||||
sta SETALTCHAR
|
||||
sta SET80DISP
|
||||
@ -66,8 +87,7 @@ DevMgr.SYS.Select
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.GetEvent
|
||||
lda A2osX.ASCREEN
|
||||
DevMgr.SYS.Read lda A2osX.ASCREEN
|
||||
cmp #2 is SYS active?
|
||||
bne .9
|
||||
|
||||
@ -102,7 +122,8 @@ DevMgr.SYS.GetEvent
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.COut phx
|
||||
DevMgr.SYS.Write
|
||||
phx
|
||||
phy
|
||||
cmp #' '
|
||||
bcc .1
|
||||
@ -141,8 +162,6 @@ DevMgr.SYS.FSOut
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.CROut
|
||||
jsr DevMgr.SYS.ClrEOL
|
||||
stz DevMgr.SYS.CH
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.LF1 stz DevMgr.SYS.CH
|
||||
DevMgr.SYS.LF ldx DevMgr.SYS.CV
|
||||
|
@ -8,9 +8,15 @@ AUTO 6
|
||||
DevMgr.Stat .DA DevMgr.LoMem Lomem
|
||||
DevMgr.Free .DA DevMgr.LoMem Free
|
||||
.DA DevMgr.HiMem
|
||||
DevMgr.LastDevID .DA #DevMgr.Count-1
|
||||
TSKMGR.SIZE .BS 1
|
||||
TSKMGR.LASTID .BS 1
|
||||
DevMgr.Count .DA #2 NUL,SYS
|
||||
*--------------------------------------
|
||||
EvtMgr.VBLState .BS 1
|
||||
EvtMgr.10TH.CNT .BS 1
|
||||
EvtMgr.HZ.CNT .BS 1
|
||||
EvtMgr.Count .BS 1
|
||||
*--------------------------------------
|
||||
TskMgr.Count .DA #1 One Slot Busy (Kernel PS=0)
|
||||
TskMgr.LastID .DA #0
|
||||
*--------------------------------------
|
||||
ENV.DRV >PSTR "DRV"
|
||||
ENV.LIB >PSTR "LIB"
|
||||
|
@ -13,29 +13,27 @@ AUTO 6
|
||||
* Y,A = DEVSLOT
|
||||
* note: X Unmodified
|
||||
*\--------------------------------------
|
||||
K.GetDevByIDA cmp DevMgr.LastDevID
|
||||
beq .1
|
||||
K.GetDevByIDA cmp DevMgr.Count
|
||||
bcs K.GetDevDNF
|
||||
|
||||
.1 pha save ID
|
||||
pha save ID
|
||||
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
adc #DevMgr.Table
|
||||
tay
|
||||
|
||||
pla
|
||||
php
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
plp
|
||||
adc /DevMgr.Table
|
||||
rts CC
|
||||
*/--------------------------------------
|
||||
* #GetDevIDByNameYA
|
||||
* #GetDevByNameYA
|
||||
* ##IN:
|
||||
* Y,A = Ptr to device name (PStr)
|
||||
* ##OUT:
|
||||
@ -44,71 +42,93 @@ K.GetDevByIDA cmp DevMgr.LastDevID
|
||||
* Y,A = DEVSLOT
|
||||
*\--------------------------------------
|
||||
K.GetDevByNameYA
|
||||
>STYA ZPQuickPtr1
|
||||
>LDYAI DevMgr.Table+S.DEV.NAME
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr1
|
||||
>LDYAI DevMgr.Table+S.DEV.F
|
||||
>STYA ZPPtr2
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 lda (ZPQuickPtr1)
|
||||
cmp (ZPQuickPtr2)
|
||||
.1 lda (ZPPtr2)
|
||||
and #S.DEV.F.LEN
|
||||
cmp (ZPPtr1)
|
||||
bne .3
|
||||
|
||||
tay
|
||||
|
||||
.2 lda (ZPQuickPtr1),y
|
||||
cmp (ZPQuickPtr2),y
|
||||
.2 lda (ZPPtr1),y
|
||||
cmp (ZPPtr2),y
|
||||
bne .3
|
||||
|
||||
dey
|
||||
bne .2
|
||||
|
||||
lda ZPQuickPtr2
|
||||
lda ZPPtr2
|
||||
sec
|
||||
sbc #S.DEV.NAME
|
||||
sbc #S.DEV.F
|
||||
tay
|
||||
lda ZPQuickPtr2+1
|
||||
sbc /S.DEV.NAME
|
||||
lda ZPPtr2+1
|
||||
sbc /S.DEV.F
|
||||
clc
|
||||
rts
|
||||
|
||||
.3 lda ZPQuickPtr2
|
||||
.3 lda ZPPtr2
|
||||
clc
|
||||
adc #S.DEV
|
||||
sta ZPQuickPtr2
|
||||
sta ZPPtr2
|
||||
bcc .4
|
||||
|
||||
inc ZPQuickPtr2+1
|
||||
inc ZPPtr2+1
|
||||
|
||||
.4 cpx DevMgr.LastDevID
|
||||
inx
|
||||
bcc .1
|
||||
.4 inx
|
||||
cpx DevMgr.Count
|
||||
bne .1
|
||||
|
||||
K.GetDevDNF lda #DEVMGR.ERRDNF
|
||||
K.GetDevDNF lda #MLI.ERR.NODEV CS from cpx/beq
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* #GetDevInfoA
|
||||
* #GetDevStatusA
|
||||
* ##IN:
|
||||
* A = DevID
|
||||
* ##OUT:
|
||||
* CC = OK, CS = ERROR
|
||||
* Y,A = Ptr to S.DEVINFO
|
||||
*\--------------------------------------
|
||||
K.GetDevInfoA jsr K.GetDevByIDA
|
||||
K.GetDevStatusA jsr K.GetDevByIDA
|
||||
bcs K.GetDevDNF
|
||||
>STYA ZPQuickPtr1
|
||||
ldx #DEVMGR.GETINFO
|
||||
jmp (ZPQuickPtr1)
|
||||
>STYA ZPPtr1
|
||||
ldx #DEVMGR.STATUS
|
||||
jmp (ZPPtr1)
|
||||
*/--------------------------------------
|
||||
* #MkNodYA
|
||||
* return a S.FILE from a given Device
|
||||
* return a S.FILE for a given Device NAME
|
||||
* ##IN:
|
||||
* Y,A=DevName
|
||||
* ##OUT:
|
||||
* CC = OK, CS = ERROR
|
||||
* A = hFILE
|
||||
*\--------------------------------------
|
||||
K.MkNodYA jsr K.GetDevByNameYA Ptr1=NAME,Ptr2=DEVSLOT
|
||||
K.MkNodYA jsr K.GetDevByNameYA Ptr1=NAME
|
||||
bcs .9
|
||||
>STYA pDev
|
||||
stx .1+1
|
||||
|
||||
ldy #S.DEV.S
|
||||
lda (pDev),y
|
||||
bit #S.DEV.S.BLOCK
|
||||
bne .99
|
||||
|
||||
lda (pDev)
|
||||
sta .2+1
|
||||
sta .4+1
|
||||
|
||||
ldy #1
|
||||
lda (pDev),y
|
||||
sta .3+1
|
||||
sta .4+2
|
||||
|
||||
txa Pass DEV.ID to OPEN
|
||||
ldx #DEVMGR.OPEN
|
||||
jsr .4
|
||||
bcs .9
|
||||
|
||||
>PUSHWI S.NODE.DEV
|
||||
@ -116,27 +136,43 @@ K.MkNodYA jsr K.GetDevByNameYA Ptr1=NAME,Ptr2=DEVSLOT
|
||||
jsr K.GetMem
|
||||
bcs .9
|
||||
|
||||
>STYA ZPQuickPtr3 Ptr3=S.NODE
|
||||
|
||||
ldy #S.DEV.DEVID
|
||||
lda (ZPQuickPtr2),y
|
||||
pha
|
||||
|
||||
iny #S.DEV.F
|
||||
lda (ZPQuickPtr2),y
|
||||
asl CS if Block device
|
||||
>STYA ZPPtr3 Ptr3=S.NODE
|
||||
|
||||
ldy #S.NODE.T
|
||||
lda #S.NODE.T.CDEV
|
||||
adc #0 add CS if blok
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
|
||||
iny #S.NODE.DEV.ID
|
||||
pla
|
||||
sta (ZPQuickPtr3),y
|
||||
|
||||
.1 lda #$ff Self Modified
|
||||
sta (ZPPtr3),y
|
||||
|
||||
iny #S.NODE.DEV.JMP
|
||||
.2 lda #$ff
|
||||
sta (ZPPtr3),y
|
||||
|
||||
iny ##S.NODE.DEV.JMP+1
|
||||
.3 lda #$ff
|
||||
sta (ZPPtr3),y
|
||||
txa
|
||||
clc
|
||||
.9 rts
|
||||
|
||||
.99 lda #MLI.ERR.IO
|
||||
sec
|
||||
rts
|
||||
.4 jmp $ffff
|
||||
*/--------------------------------------
|
||||
* #MkNodA
|
||||
* return a S.FILE for a given Socket
|
||||
* ##IN:
|
||||
* A=hSocket
|
||||
* ##OUT:
|
||||
* CC = OK, CS = ERROR
|
||||
* A = hFILE
|
||||
*\--------------------------------------
|
||||
K.MkNodA sec
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* #MKFIFO
|
||||
* return a S.FILE to a new FIFO
|
||||
@ -146,7 +182,7 @@ K.MkNodYA jsr K.GetDevByNameYA Ptr1=NAME,Ptr2=DEVSLOT
|
||||
* A = hFILE
|
||||
*\--------------------------------------
|
||||
K.MKFIFO >PUSHWI 256
|
||||
>PUSHBI S.MEM.F.INIT0
|
||||
>PUSHBI 0
|
||||
jsr K.GetMem
|
||||
bcs .99
|
||||
|
||||
@ -158,15 +194,15 @@ K.MKFIFO >PUSHWI 256
|
||||
|
||||
bcs .9
|
||||
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
ldy #S.NODE.T
|
||||
lda #S.NODE.T.FIFO
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
iny S.NODE.FIFO.hMem
|
||||
pla
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
txa
|
||||
clc
|
||||
rts
|
||||
|
@ -15,7 +15,7 @@ AUTO 6
|
||||
* A = EC
|
||||
*\--------------------------------------
|
||||
K.OpenDirYA jsr PFT.CheckPathYA
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
>STYA MLICALL.PARAMS+1 For GETFILEINFO,MLIOPEN
|
||||
|
||||
>PUSHWI S.NODE.DIR
|
||||
@ -23,14 +23,14 @@ K.OpenDirYA jsr PFT.CheckPathYA
|
||||
jsr K.GetMem
|
||||
bcs .9
|
||||
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
stx K.ReadDirA.hDir
|
||||
|
||||
lda (ZPQuickPtr2)
|
||||
lda (ZPPtr2)
|
||||
cmp #1 One char ?
|
||||
bne .7 No, Go open dir....
|
||||
tay Y=1
|
||||
lda (ZPQuickPtr2),y
|
||||
lda (ZPPtr2),y
|
||||
cmp #'/' Root required ?
|
||||
beq .8 Yes, Go for ONLINE Call (S.DIR.PRODOS.REF=0)
|
||||
|
||||
@ -44,22 +44,16 @@ K.OpenDirYA jsr PFT.CheckPathYA
|
||||
cmp #$0F Directory ?
|
||||
bne .98
|
||||
|
||||
>PUSHWI 1024 get a ProDOS IOBUF
|
||||
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOVE
|
||||
jsr K.GetMem
|
||||
jsr FILE.SetIOBUF
|
||||
|
||||
bcs .98
|
||||
|
||||
>STYA MLICALL.PARAMS+3 Save Ptr to IOBUF for MLIOPEN call
|
||||
txa
|
||||
ldy #S.NODE.DIR.IOBUF
|
||||
sta (ZPQuickPtr1),y
|
||||
|
||||
>MLICALL MLIOPEN
|
||||
bcs .98
|
||||
|
||||
lda MLICALL.PARAMS+5 get ref_num
|
||||
ldy #S.NODE.DIR.REF
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
.8 lda K.ReadDirA.hDir
|
||||
clc
|
||||
@ -95,10 +89,10 @@ K.ReadDirA.EC .BS 2
|
||||
K.ReadDirA jsr PFT.CheckNodeA
|
||||
sta K.ReadDirA.hDir
|
||||
jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
ldy #S.NODE.DIR.REF
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
beq K.ReadDirA.ROOT
|
||||
jmp K.ReadDirA.DIR
|
||||
|
||||
@ -108,14 +102,14 @@ K.ReadDirA.NoMore
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.ReadDirA.ROOT ldy #S.NODE.DIR.FC did we already returned something ?
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
bne K.ReadDirA.NoMore
|
||||
|
||||
stz MLICALL.PARAMS+1 All Volumes
|
||||
|
||||
>LDYAI KrnBuf256
|
||||
>STYA MLICALL.PARAMS+2
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
>MLICALL MLIONLINE
|
||||
bcc .10
|
||||
|
||||
@ -131,7 +125,7 @@ K.ReadDirA.ROOT ldy #S.NODE.DIR.FC did we already returned something ?
|
||||
|
||||
ldy #0
|
||||
|
||||
.1 lda (ZPQuickPtr2),y
|
||||
.1 lda (ZPPtr2),y
|
||||
and #$0F
|
||||
beq .2
|
||||
|
||||
@ -154,7 +148,7 @@ K.ReadDirA.ROOT ldy #S.NODE.DIR.FC did we already returned something ?
|
||||
jsr K.ReadDirA.GetBuf
|
||||
bcs .99
|
||||
|
||||
.3 lda (ZPQuickPtr2)
|
||||
.3 lda (ZPPtr2)
|
||||
and #$0F
|
||||
beq .88
|
||||
|
||||
@ -166,7 +160,7 @@ K.ReadDirA.ROOT ldy #S.NODE.DIR.FC did we already returned something ?
|
||||
sta KrnOut256+1
|
||||
ldy #1
|
||||
|
||||
.4 lda (ZPQuickPtr2),y
|
||||
.4 lda (ZPPtr2),y
|
||||
sta KrnOut256+1,y
|
||||
jsr K.ReadDirA.AddToBuf
|
||||
iny
|
||||
@ -175,7 +169,7 @@ K.ReadDirA.ROOT ldy #S.NODE.DIR.FC did we already returned something ?
|
||||
|
||||
jsr K.ReadDirA.ClrStat
|
||||
|
||||
lda (ZPQuickPtr2)
|
||||
lda (ZPPtr2)
|
||||
|
||||
asl DRIVE in Carry
|
||||
pha
|
||||
@ -205,21 +199,21 @@ K.ReadDirA.ROOT ldy #S.NODE.DIR.FC did we already returned something ?
|
||||
|
||||
.80 jsr K.ReadDirA.ADDSTAT
|
||||
|
||||
.88 lda ZPQuickPtr2
|
||||
.88 lda ZPPtr2
|
||||
clc
|
||||
adc #16
|
||||
sta ZPQuickPtr2
|
||||
sta ZPPtr2
|
||||
bcc .89
|
||||
inc ZPQuickPtr2+1
|
||||
inc ZPPtr2+1
|
||||
.89 dec K.ReadDirA.EC
|
||||
bne .3
|
||||
|
||||
* lda #0 done by S.MEM.F.INIT0
|
||||
* sta (ZPQuickPtr4) Ending 0
|
||||
* sta (ZPPtr4) Ending 0
|
||||
|
||||
ldy #S.NODE.DIR.FC
|
||||
lda #16
|
||||
sta (ZPQuickPtr1),y Flag that we returned somthing for next time
|
||||
sta (ZPPtr1),y Flag that we returned somthing for next time
|
||||
|
||||
lda K.ReadDirA.hDIRENT
|
||||
tax
|
||||
@ -239,13 +233,13 @@ K.ReadDirA.DIR sta MLICALL.PARAMS+1 A=#S.DIR.PRODOS.REF
|
||||
tya
|
||||
* clc CC from K.GetMem
|
||||
adc #4 Skip 4 bytes linked list
|
||||
sta ZPQuickPtr2 PTR to Buffer for PASS #1
|
||||
sta ZPQuickPtr3 PTR to Buffer for PASS #2
|
||||
sta ZPPtr2 PTR to Buffer for PASS #1
|
||||
sta ZPPtr3 PTR to Buffer for PASS #2
|
||||
|
||||
pla
|
||||
adc #0
|
||||
sta ZPQuickPtr2+1 PTR to Buffer for PASS #1
|
||||
sta ZPQuickPtr3+1 PTR to Buffer for PASS #2
|
||||
sta ZPPtr2+1 PTR to Buffer for PASS #1
|
||||
sta ZPPtr3+1 PTR to Buffer for PASS #2
|
||||
|
||||
>LDYAI 512
|
||||
>STYA MLICALL.PARAMS+4
|
||||
@ -253,13 +247,13 @@ K.ReadDirA.DIR sta MLICALL.PARAMS+1 A=#S.DIR.PRODOS.REF
|
||||
bcs .98
|
||||
|
||||
ldy #S.NODE.DIR.EL Check if first run....
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
bne .2 no, we have all we need....
|
||||
|
||||
ldy #$1f+3
|
||||
ldx #3
|
||||
|
||||
.1 lda (ZPQuickPtr2),y Get K.ReadDirA.EL.... From Block
|
||||
.1 lda (ZPPtr2),y Get K.ReadDirA.EL.... From Block
|
||||
sta K.ReadDirA.EL,x
|
||||
dey
|
||||
dex
|
||||
@ -277,7 +271,7 @@ K.ReadDirA.DIR sta MLICALL.PARAMS+1 A=#S.DIR.PRODOS.REF
|
||||
.2 ldy #S.NODE.DIR.EL+3
|
||||
ldx #3
|
||||
|
||||
.3 lda (ZPQuickPtr1),y get this session parameters from S.DIR
|
||||
.3 lda (ZPPtr1),y get this session parameters from S.DIR
|
||||
sta K.ReadDirA.EL,x
|
||||
dey
|
||||
dex
|
||||
@ -304,7 +298,7 @@ K.ReadDirA.DIR sta MLICALL.PARAMS+1 A=#S.DIR.PRODOS.REF
|
||||
sta K.ReadDirA.BufSize
|
||||
stz K.ReadDirA.BufSize+1
|
||||
|
||||
K.ReadDirA.DIR1 lda (ZPQuickPtr2) X = EntryCount In This Block
|
||||
K.ReadDirA.DIR1 lda (ZPPtr2) X = EntryCount In This Block
|
||||
beq .7 Free slot....goto next
|
||||
|
||||
and #$F0 get storage_type
|
||||
@ -314,7 +308,7 @@ K.ReadDirA.DIR1 lda (ZPQuickPtr2) X = EntryCount In This Block
|
||||
cmp #$E0 directory header ?
|
||||
beq .2
|
||||
|
||||
lda (ZPQuickPtr2) regular DIR or File, get LEN
|
||||
lda (ZPPtr2) regular DIR or File, get LEN
|
||||
|
||||
and #$F compute filename len
|
||||
sec add "#<filename>" + S.STAT
|
||||
@ -338,24 +332,24 @@ K.ReadDirA.DIR1 lda (ZPQuickPtr2) X = EntryCount In This Block
|
||||
iny
|
||||
bra K.ReadDirA.DIR2 we reached last entry in whole DIR
|
||||
|
||||
.7 lda ZPQuickPtr2
|
||||
.7 lda ZPPtr2
|
||||
clc
|
||||
adc K.ReadDirA.EL
|
||||
sta ZPQuickPtr2
|
||||
sta ZPPtr2
|
||||
bcc .8
|
||||
inc ZPQuickPtr2+1
|
||||
inc ZPPtr2+1
|
||||
|
||||
.8 dec K.ReadDirA.ECIB
|
||||
bne K.ReadDirA.DIR1
|
||||
|
||||
* pass #2 Fill Buffer...(ZPQuickPtr1 & Ptr2 can now be trashed)
|
||||
* pass #2 Fill Buffer...(ZPPtr1 & Ptr2 can now be trashed)
|
||||
K.ReadDirA.DIR2 jsr K.ReadDirA.GetBuf
|
||||
bcs .9
|
||||
|
||||
lda K.ReadDirA.EPB
|
||||
sta K.ReadDirA.ECIB
|
||||
|
||||
.1 lda (ZPQuickPtr3)
|
||||
.1 lda (ZPPtr3)
|
||||
beq .7 Empty slot, skip
|
||||
|
||||
and #$F0
|
||||
@ -373,7 +367,7 @@ K.ReadDirA.DIR2 jsr K.ReadDirA.GetBuf
|
||||
.3 jsr K.ReadDirA.AddFNToBuf
|
||||
jsr K.ReadDirA.ClrStat
|
||||
|
||||
lda (ZPQuickPtr3)
|
||||
lda (ZPPtr3)
|
||||
and #$F0
|
||||
cmp #$D0 Directory ?
|
||||
bne .5
|
||||
@ -396,12 +390,12 @@ K.ReadDirA.DIR2 jsr K.ReadDirA.GetBuf
|
||||
.7 dec K.ReadDirA.ECIB 0! no more file in block
|
||||
beq .8
|
||||
|
||||
lda ZPQuickPtr3
|
||||
lda ZPPtr3
|
||||
clc
|
||||
adc K.ReadDirA.EL
|
||||
sta ZPQuickPtr3
|
||||
sta ZPPtr3
|
||||
bcc .1
|
||||
inc ZPQuickPtr3+1
|
||||
inc ZPPtr3+1
|
||||
bra .1
|
||||
|
||||
.9 jsr K.ReadDirA.CLN
|
||||
@ -410,17 +404,17 @@ K.ReadDirA.DIR2 jsr K.ReadDirA.GetBuf
|
||||
|
||||
.8
|
||||
* lda #0 S.MEM.F.INIT0 already did this
|
||||
* sta (ZPQuickPtr4) Ending 0
|
||||
* sta (ZPPtr4) Ending 0
|
||||
|
||||
lda K.ReadDirA.hDir Restore ZPQuickPtr1 trashed by STR API calls
|
||||
lda K.ReadDirA.hDir Restore ZPPtr1 trashed by STR API calls
|
||||
jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
ldx #3
|
||||
ldy #S.NODE.DIR.EL+3
|
||||
|
||||
.81 lda K.ReadDirA.EL,x Store back this session prameters to S.DIR
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
dey
|
||||
dex
|
||||
bpl .81
|
||||
@ -443,7 +437,7 @@ K.ReadDirA.GetBuf
|
||||
jsr K.GetMem
|
||||
bcs .9
|
||||
stx K.ReadDirA.hDIRENT
|
||||
>STYA ZPQuickPtr4
|
||||
>STYA ZPPtr4
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
K.ReadDirA.ADD. ldx #1 filename="1."
|
||||
@ -461,10 +455,10 @@ K.ReadDirA.ADD..
|
||||
jsr K.ReadDirA.ClrStat
|
||||
|
||||
* ldy #$25 total_blocks
|
||||
* lda (ZPQuickPtr3),y
|
||||
* lda (ZPPtr3),y
|
||||
* sta KrnSTAT+S.STAT.BLOCKS
|
||||
* iny
|
||||
* lda (ZPQuickPtr3),y
|
||||
* lda (ZPPtr3),y
|
||||
* sta KrnSTAT+S.STAT.BLOCKS+1
|
||||
*--------------------------------------
|
||||
K.ReadDirA.ADDD lda #$0F
|
||||
@ -480,7 +474,7 @@ K.ReadDirA.ADDF lda /S.STAT.MODE.REG
|
||||
ldx #ADDF.DST-ADDF.SRC
|
||||
|
||||
.1 ldy ADDF.SRC-1,x
|
||||
lda (ZPQuickPtr3),y
|
||||
lda (ZPPtr3),y
|
||||
ldy ADDF.DST-1,x
|
||||
sta KrnSTAT,y
|
||||
dex
|
||||
@ -488,7 +482,7 @@ K.ReadDirA.ADDF lda /S.STAT.MODE.REG
|
||||
*--------------------------------------
|
||||
K.ReadDirA.AddAccess
|
||||
ldy #$1E ProDOS Access
|
||||
lda (ZPQuickPtr3),y
|
||||
lda (ZPPtr3),y
|
||||
|
||||
ldx #0
|
||||
bit #$01 ProDOS R
|
||||
@ -517,16 +511,16 @@ K.ReadDirA.AddStat
|
||||
ldy #S.STAT-1
|
||||
|
||||
.1 lda KrnSTAT,y
|
||||
sta (ZPQuickPtr4),y
|
||||
sta (ZPPtr4),y
|
||||
dey
|
||||
bpl .1
|
||||
|
||||
lda ZPQuickPtr4
|
||||
lda ZPPtr4
|
||||
clc
|
||||
adc #S.STAT
|
||||
sta ZPQuickPtr4
|
||||
sta ZPPtr4
|
||||
bcc .8
|
||||
inc ZPQuickPtr4+1
|
||||
inc ZPPtr4+1
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
K.ReadDirA.ClrStat
|
||||
@ -538,14 +532,14 @@ K.ReadDirA.ClrStat
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.ReadDirA.AddFNToBuf
|
||||
lda (ZPQuickPtr3)
|
||||
lda (ZPPtr3)
|
||||
and #$0F get filename len
|
||||
tax
|
||||
jsr K.ReadDirA.AddToBuf
|
||||
|
||||
ldy #1
|
||||
|
||||
.1 lda (ZPQuickPtr3),y
|
||||
.1 lda (ZPPtr3),y
|
||||
jsr K.ReadDirA.AddToBuf
|
||||
iny
|
||||
dex
|
||||
@ -553,17 +547,17 @@ K.ReadDirA.AddFNToBuf
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.ReadDirA.AddToBuf
|
||||
sta (ZPQuickPtr4)
|
||||
inc ZPQuickPtr4
|
||||
sta (ZPPtr4)
|
||||
inc ZPPtr4
|
||||
bne .8
|
||||
inc ZPQuickPtr4+1
|
||||
inc ZPPtr4+1
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
K.ReadDirA.ConvertTime
|
||||
clc
|
||||
adc ZPQuickPtr3
|
||||
adc ZPPtr3
|
||||
tay
|
||||
lda ZPQuickPtr3+1
|
||||
lda ZPPtr3+1
|
||||
adc #0
|
||||
>PUSHYA
|
||||
jmp K.PTime2Time Will destroy Ptr1 & Ptr2 !!!!
|
||||
@ -579,24 +573,28 @@ ADDF.DST .DA #S.STAT.P.TYPE,#S.STAT.BLOCKS,#S.STAT.BLOCKS+1
|
||||
* ##Out:
|
||||
* none, always succeed.
|
||||
*\-------------------------------------
|
||||
K.CloseDirA jsr PFT.CheckNodeA
|
||||
sta K.ReadDirA.hDir
|
||||
jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr1
|
||||
K.CloseDirA .EQ K.FCloseA
|
||||
|
||||
* jsr PFT.CheckNodeA
|
||||
* sta K.ReadDirA.hDir
|
||||
* jsr K.GetMemPtrA
|
||||
* >STYA ZPPtr1
|
||||
|
||||
K.CloseDirA.1 ldy #S.NODE.DIR.REF
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .1
|
||||
sta MLICALL.PARAMS+1
|
||||
>MLICALL MLICLOSE
|
||||
K.CloseDirA.1 .EQ K.FCloseA.1
|
||||
|
||||
.1 ldy #S.NODE.DIR.IOBUF
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .2
|
||||
jsr K.FreeMemA
|
||||
* ldy #S.NODE.DIR.REF
|
||||
* lda (ZPPtr1),y
|
||||
* beq .1
|
||||
* sta MLICALL.PARAMS+1
|
||||
* >MLICALL MLICLOSE
|
||||
|
||||
.2 ldaK.ReadDirA.hDir
|
||||
jmp K.FreeMemA
|
||||
*.1 ldy #S.NODE.DIR.IOBUF
|
||||
* lda (ZPPtr1),y
|
||||
* beq .2
|
||||
* jsr K.FreeMemA
|
||||
*
|
||||
*.2 lda K.ReadDirA.hDir
|
||||
* jmp K.FreeMemA
|
||||
*/-------------------------------------
|
||||
* #MKDirYA
|
||||
* ##In:
|
||||
|
@ -32,16 +32,16 @@ K.LoadDrvYA >STYA K.LoadDrv.CmdArray
|
||||
stx K.LoadDrv.hMem
|
||||
|
||||
>LDYA K.LoadDrv.CmdArray Advance to ARG[1]
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
lda ZPQuickPtr1
|
||||
lda ZPPtr1
|
||||
sec
|
||||
adc (ZPQuickPtr1)
|
||||
sta ZPQuickPtr1
|
||||
adc (ZPPtr1)
|
||||
sta ZPPtr1
|
||||
bcc .1
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPPtr1+1
|
||||
|
||||
.1 >LDYA ZPQuickPtr1
|
||||
.1 >LDYA ZPPtr1
|
||||
|
||||
jsr pDrvJmp call Dev.Detect
|
||||
|
||||
@ -50,10 +50,6 @@ K.LoadDrvYA >STYA K.LoadDrv.CmdArray
|
||||
jsr BIN.InstallDRV
|
||||
|
||||
bcs .97
|
||||
ldy #S.DEV.F
|
||||
lda (pDev),y
|
||||
ora #S.DEV.F.INUSE
|
||||
sta (pDev),y
|
||||
|
||||
jsr .97 Cleanup...
|
||||
|
||||
|
@ -14,7 +14,7 @@ AUTO 6
|
||||
*\--------------------------------------
|
||||
K.ExpandPStrYA stz K.ExpandPStr.hPStr Reset Intermediate string...
|
||||
|
||||
.11 >STYA ZPQuickPtr2
|
||||
.11 >STYA ZPPtr2
|
||||
|
||||
stz KrnBuf256 init Expanded String len=0
|
||||
stz K.ExpandPStr.bFound No var found yet
|
||||
@ -25,11 +25,11 @@ K.ExpandPStrYA stz K.ExpandPStr.hPStr Reset Intermediate string...
|
||||
.10 stz K.ExpandPStr.Start
|
||||
|
||||
.1 tya
|
||||
cmp (ZPQuickPtr2) End of PSTR?
|
||||
cmp (ZPPtr2) End of PSTR?
|
||||
beq .6
|
||||
|
||||
iny
|
||||
lda (ZPQuickPtr2),y
|
||||
lda (ZPPtr2),y
|
||||
|
||||
cmp #'''
|
||||
bne .21
|
||||
@ -111,15 +111,15 @@ K.ExpandPStr.AV lda K.ExpandPStr.End
|
||||
inx
|
||||
sta KrnBuf256,x
|
||||
|
||||
stx ZPQuickPtr1 Make Ptr1 -> Var NAME
|
||||
stx ZPPtr1 Make Ptr1 -> Var NAME
|
||||
lda /KrnBuf256
|
||||
sta ZPQuickPtr1+1
|
||||
sta ZPPtr1+1
|
||||
|
||||
ldy K.ExpandPStr.Start
|
||||
|
||||
.1 iny
|
||||
inx
|
||||
lda (ZPQuickPtr2),y
|
||||
lda (ZPPtr2),y
|
||||
sta KrnBuf256,x
|
||||
cpy K.ExpandPStr.End
|
||||
bne .1
|
||||
@ -132,19 +132,19 @@ K.ExpandPStr.AV lda K.ExpandPStr.End
|
||||
|
||||
jsr ENV.NextEnvPtr3 Skip NAME
|
||||
|
||||
.2 lda (ZPQuickPtr3)
|
||||
.2 lda (ZPPtr3)
|
||||
beq .9 in case CheckSysVarPtr1 returned a NUL string
|
||||
|
||||
ldy #0
|
||||
ldx KrnBuf256
|
||||
|
||||
.3 iny
|
||||
lda (ZPQuickPtr3),y
|
||||
lda (ZPPtr3),y
|
||||
inx
|
||||
sta KrnBuf256,x
|
||||
|
||||
tya
|
||||
cmp (ZPQuickPtr3) last char?
|
||||
cmp (ZPPtr3) last char?
|
||||
bne .3
|
||||
stx KrnBuf256
|
||||
|
||||
@ -179,14 +179,14 @@ K.ExpandPStr.hPStr .BS 1
|
||||
* Y,A = PTR to String NAME=VALUE (PSTR)
|
||||
* ##Out:
|
||||
*\--------------------------------------
|
||||
K.PutEnvYA >STYA ZPQuickPtr1 NAME=VALUE
|
||||
K.PutEnvYA >STYA ZPPtr1 NAME=VALUE
|
||||
|
||||
lda (ZPQuickPtr1)
|
||||
lda (ZPPtr1)
|
||||
beq .9
|
||||
sta KrnBuf256
|
||||
tay
|
||||
|
||||
.1 lda (ZPQuickPtr1),y copy PSTR to KrnBuf256
|
||||
.1 lda (ZPPtr1),y copy PSTR to KrnBuf256
|
||||
sta KrnBuf256,y
|
||||
dey
|
||||
bne .1
|
||||
@ -216,12 +216,12 @@ K.PutEnvYA >STYA ZPQuickPtr1 NAME=VALUE
|
||||
sbc KrnBuf256 VALUE len
|
||||
sta KrnBuf256,y save it at "=" POS
|
||||
|
||||
stz ZPQuickPtr1 #KrnBuf256
|
||||
sty ZPQuickPtr2
|
||||
stz ZPPtr1 #KrnBuf256
|
||||
sty ZPPtr2
|
||||
|
||||
lda /KrnBuf256
|
||||
sta ZPQuickPtr1+1
|
||||
sta ZPQuickPtr2+1
|
||||
sta ZPPtr1+1
|
||||
sta ZPPtr2+1
|
||||
|
||||
bra K.SetEnvPtr1Ptr2
|
||||
|
||||
@ -239,59 +239,59 @@ K.SetEnv jsr PullPtr1Ptr2 Ptr1=NAME,Ptr2=VALUE
|
||||
K.SetEnvPtr1Ptr2
|
||||
jsr S.UnsetEnvPtr1
|
||||
|
||||
jsr ENV.InitEnvPtr3 ZPQuickPtr3 -> Env
|
||||
jsr ENV.InitEnvPtr3 ZPPtr3 -> Env
|
||||
|
||||
lda ZPQuickPtr3 Compute ENV UPPER LIMIT in Ptr4
|
||||
lda ZPPtr3 Compute ENV UPPER LIMIT in Ptr4
|
||||
clc
|
||||
adc #K.ENV.SIZE
|
||||
sta ZPQuickPtr4
|
||||
sta ZPPtr4
|
||||
|
||||
lda ZPQuickPtr3+1
|
||||
lda ZPPtr3+1
|
||||
adc /K.ENV.SIZE
|
||||
sta ZPQuickPtr4+1
|
||||
sta ZPPtr4+1
|
||||
|
||||
ldy ZPQuickPtr3+1
|
||||
lda ZPQuickPtr3 Compute New Env Upper limit in A,Y
|
||||
ldy ZPPtr3+1
|
||||
lda ZPPtr3 Compute New Env Upper limit in A,Y
|
||||
sec
|
||||
adc (ZPQuickPtr1) add NAME len +1
|
||||
adc (ZPPtr1) add NAME len +1
|
||||
bcc .1
|
||||
iny
|
||||
|
||||
.1 sec
|
||||
adc (ZPQuickPtr2) add VALUE len +1
|
||||
adc (ZPPtr2) add VALUE len +1
|
||||
bcc .2
|
||||
iny
|
||||
|
||||
.2 cmp ZPQuickPtr4 GE than hMem Upper limit ?
|
||||
.2 cmp ZPPtr4 GE than hMem Upper limit ?
|
||||
tya
|
||||
sbc ZPQuickPtr4+1
|
||||
sbc ZPPtr4+1
|
||||
bcs .99
|
||||
|
||||
.3 lda (ZPQuickPtr3) Scan until ending 0...
|
||||
.3 lda (ZPPtr3) Scan until ending 0...
|
||||
beq .4
|
||||
|
||||
inc ZPQuickPtr3
|
||||
inc ZPPtr3
|
||||
bne .3
|
||||
inc ZPQuickPtr3+1
|
||||
inc ZPPtr3+1
|
||||
bne .3
|
||||
|
||||
.4 lda (ZPQuickPtr1)
|
||||
sta (ZPQuickPtr3)
|
||||
.4 lda (ZPPtr1)
|
||||
sta (ZPPtr3)
|
||||
tay
|
||||
|
||||
.5 lda (ZPQuickPtr1),y
|
||||
sta (ZPQuickPtr3),y
|
||||
.5 lda (ZPPtr1),y
|
||||
sta (ZPPtr3),y
|
||||
dey
|
||||
bne .5
|
||||
|
||||
jsr ENV.NextEnvPtr3
|
||||
|
||||
lda (ZPQuickPtr2)
|
||||
sta (ZPQuickPtr3)
|
||||
lda (ZPPtr2)
|
||||
sta (ZPPtr3)
|
||||
tay
|
||||
|
||||
.6 lda (ZPQuickPtr2),y
|
||||
sta (ZPQuickPtr3),y
|
||||
.6 lda (ZPPtr2),y
|
||||
sta (ZPPtr3),y
|
||||
dey
|
||||
bne .6
|
||||
|
||||
@ -299,7 +299,7 @@ K.SetEnvPtr1Ptr2
|
||||
|
||||
.8 lda #0
|
||||
|
||||
sta (ZPQuickPtr3)
|
||||
sta (ZPPtr3)
|
||||
clc
|
||||
rts
|
||||
|
||||
@ -314,14 +314,14 @@ K.SetEnvPtr1Ptr2
|
||||
* CC : Y,A = PTR to VALUE (PSTR)
|
||||
* CS : not found
|
||||
*\--------------------------------------
|
||||
K.GetEnvYA >STYA ZPQuickPtr1
|
||||
K.GetEnvYA >STYA ZPPtr1
|
||||
jsr ENV.CheckSysVarPtr1
|
||||
bcc .8
|
||||
|
||||
jsr ENV.FindVarPtr1
|
||||
bcs .9
|
||||
jsr ENV.NextEnvPtr3 Skip NAME
|
||||
>LDYA ZPQuickPtr3
|
||||
>LDYA ZPPtr3
|
||||
clc just in case ADC in NextEnvPtr1 disturb CC
|
||||
.8 rts
|
||||
|
||||
@ -333,7 +333,7 @@ K.GetEnvYA >STYA ZPQuickPtr1
|
||||
* Y,A = PTR To Name (PSTR)
|
||||
* ##Out:
|
||||
*\--------------------------------------
|
||||
K.UnsetEnvYA >STYA ZPQuickPtr1 Store VAR Name
|
||||
K.UnsetEnvYA >STYA ZPPtr1 Store VAR Name
|
||||
S.UnsetEnvPtr1 jsr ENV.FindVarPtr1
|
||||
bcs .8 not found, quit
|
||||
|
||||
@ -346,26 +346,26 @@ S.UnsetEnvPtr1 jsr ENV.FindVarPtr1
|
||||
*--------------------------------------
|
||||
* ENV.CheckSysVarPtr1
|
||||
* In:
|
||||
* ZPQuickPtr1 -> NAME
|
||||
* ZPPtr1 -> NAME
|
||||
* Out:
|
||||
* CC: Found
|
||||
* YA -> VALUE
|
||||
* CS: Not Found
|
||||
*--------------------------------------
|
||||
ENV.CheckSysVarPtr1
|
||||
lda (ZPQuickPtr1)
|
||||
lda (ZPPtr1)
|
||||
cmp #1 is name 1 char?
|
||||
bne .9
|
||||
|
||||
ldy #1
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
cmp #'0'-1 $0...$9 ??
|
||||
bcc .1
|
||||
cmp #'9'+1
|
||||
bcs .1
|
||||
and #$0F
|
||||
jsr K.GetArgA
|
||||
>STYA ZPQuickPtr3
|
||||
>STYA ZPPtr3
|
||||
rts
|
||||
|
||||
.1 ldx #ENV.SysVarsJmp-ENV.SysVars-1
|
||||
@ -398,23 +398,23 @@ ENV.SysVarsArgs lda #1
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 lda (ZPQuickPtr1)
|
||||
.1 lda (ZPPtr1)
|
||||
beq ENV.SysVarsExit
|
||||
|
||||
ldy #0
|
||||
|
||||
.2 iny
|
||||
inx
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
sta KrnOut256,x
|
||||
tya
|
||||
cmp (ZPQuickPtr1)
|
||||
cmp (ZPPtr1)
|
||||
bne .2
|
||||
|
||||
adc ZPQuickPtr1 CS from beq .2
|
||||
sta ZPQuickPtr1
|
||||
adc ZPPtr1 CS from beq .2
|
||||
sta ZPPtr1
|
||||
bcc .3
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPPtr1+1
|
||||
.3 lda #' '
|
||||
inx
|
||||
beq ENV.SysVarsExit make sure not overlapping buf 256
|
||||
@ -462,34 +462,34 @@ ENV.SysVarsA sta HEXBUF
|
||||
|
||||
ENV.SysVarsExit stx KrnOut256
|
||||
>LDYAI KrnOut256
|
||||
>STYA ZPQuickPtr3
|
||||
>STYA ZPPtr3
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
* ENV.FindVarPtr1
|
||||
* In:
|
||||
* ZPQuickPtr1 -> NAME
|
||||
* ZPPtr1 -> NAME
|
||||
* Out:
|
||||
* CC: Found
|
||||
* ZPQuickPtr1 -> NAME
|
||||
* ZPQuickPtr3 -> ENV.NAME
|
||||
* ZPPtr1 -> NAME
|
||||
* ZPPtr3 -> ENV.NAME
|
||||
* CS: Not Found
|
||||
* ZPQuickPtr1 -> NAME
|
||||
* ZPQuickPtr3 -> PTR to Ending 0
|
||||
* ZPPtr1 -> NAME
|
||||
* ZPPtr3 -> PTR to Ending 0
|
||||
*--------------------------------------
|
||||
ENV.FindVarPtr1 jsr ENV.InitEnvPtr3 Store ENV
|
||||
bcs .99
|
||||
|
||||
lda (ZPQuickPtr3)
|
||||
lda (ZPPtr3)
|
||||
beq .9 end of ENV
|
||||
|
||||
.1 cmp (ZPQuickPtr1) Same len as NAME?
|
||||
.1 cmp (ZPPtr1) Same len as NAME?
|
||||
bne .3
|
||||
|
||||
tay
|
||||
|
||||
.2 lda (ZPQuickPtr1),y
|
||||
cmp (ZPQuickPtr3),y
|
||||
.2 lda (ZPPtr1),y
|
||||
cmp (ZPPtr3),y
|
||||
bne .3
|
||||
dey
|
||||
bne .2
|
||||
@ -498,7 +498,7 @@ ENV.FindVarPtr1 jsr ENV.InitEnvPtr3 Store ENV
|
||||
|
||||
.3 jsr ENV.NextEnvPtr3 Skip NAME
|
||||
jsr ENV.NextEnvPtr3 Skip VALUE
|
||||
lda (ZPQuickPtr3)
|
||||
lda (ZPPtr3)
|
||||
bne .1
|
||||
|
||||
.9 sec
|
||||
@ -506,33 +506,33 @@ ENV.FindVarPtr1 jsr ENV.InitEnvPtr3 Store ENV
|
||||
*--------------------------------------
|
||||
* ENV.DiscardVarPtr3
|
||||
* In:
|
||||
* ZPQuickPtr3 -> ENV.NAME to Discard
|
||||
* ZPPtr3 -> ENV.NAME to Discard
|
||||
*--------------------------------------
|
||||
ENV.DiscardVarPtr3
|
||||
lda ZPQuickPtr3 Discard current NAME & VALUE definition
|
||||
sec ZPQuickPtr3 -> NAME
|
||||
adc (ZPQuickPtr3) add NAME+1 to ZPQuickPtr3
|
||||
sta ZPQuickPtr4 store it in ZPQuickPtr4
|
||||
lda ZPPtr3 Discard current NAME & VALUE definition
|
||||
sec ZPPtr3 -> NAME
|
||||
adc (ZPPtr3) add NAME+1 to ZPPtr3
|
||||
sta ZPPtr4 store it in ZPPtr4
|
||||
lda #0
|
||||
adc ZPQuickPtr3+1
|
||||
sta ZPQuickPtr4+1
|
||||
adc ZPPtr3+1
|
||||
sta ZPPtr4+1
|
||||
|
||||
lda ZPQuickPtr4 add VALUE+1 to ZPQuickPtr4
|
||||
lda ZPPtr4 add VALUE+1 to ZPPtr4
|
||||
sec
|
||||
adc (ZPQuickPtr4)
|
||||
sta ZPQuickPtr4
|
||||
adc (ZPPtr4)
|
||||
sta ZPPtr4
|
||||
bcc .1
|
||||
inc ZPQuickPtr4+1
|
||||
inc ZPPtr4+1
|
||||
|
||||
.1 ldy #0
|
||||
|
||||
.2 lda (ZPQuickPtr4),y Move back tail...
|
||||
sta (ZPQuickPtr3),y
|
||||
.2 lda (ZPPtr4),y Move back tail...
|
||||
sta (ZPPtr3),y
|
||||
beq .8 ...until we move ending 0
|
||||
iny
|
||||
bne .2
|
||||
inc ZPQuickPtr3+1
|
||||
inc ZPQuickPtr4+1
|
||||
inc ZPPtr3+1
|
||||
inc ZPPtr4+1
|
||||
bra .2
|
||||
|
||||
.8 rts
|
||||
@ -540,15 +540,15 @@ ENV.DiscardVarPtr3
|
||||
ENV.InitEnvPtr3 ldy #S.PS.hENV
|
||||
lda (pPs),y
|
||||
jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr3 Store ENV
|
||||
>STYA ZPPtr3 Store ENV
|
||||
rts
|
||||
*--------------------------------------
|
||||
ENV.NextEnvPtr3 lda ZPQuickPtr3
|
||||
ENV.NextEnvPtr3 lda ZPPtr3
|
||||
sec
|
||||
adc (ZPQuickPtr3)
|
||||
sta ZPQuickPtr3
|
||||
adc (ZPPtr3)
|
||||
sta ZPPtr3
|
||||
bcc .8
|
||||
inc ZPQuickPtr3+1
|
||||
inc ZPPtr3+1
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -13,15 +13,15 @@ AUTO 6
|
||||
* (pEvent)
|
||||
*--------------------------------------
|
||||
EVT.GetEvents stz pEvent point to start of event list
|
||||
stz EVTMGR.COUNT reset Size
|
||||
stz EvtMgr.Count reset Size
|
||||
|
||||
lda VBL get VLINE status
|
||||
tax
|
||||
eor EVTMGR.VBLSTATE
|
||||
bpl EVT.GetEvents.DEV no change,no tick
|
||||
eor EvtMgr.VBLState
|
||||
bpl EVT.GetEvents.DEV no change,no tick
|
||||
txa
|
||||
sta EVTMGR.VBLSTATE save new
|
||||
bpl EVT.GetEvents.DEV Up2down transition,no tick
|
||||
sta EvtMgr.VBLState save new
|
||||
bpl EVT.GetEvents.DEV Up2down transition,no tick
|
||||
|
||||
* sta PDLTRIG clr VBL (IIc)
|
||||
* lda RDIOUDIS clr VBL (IIc)
|
||||
@ -30,19 +30,19 @@ EVT.GetEvents stz pEvent point to start of event list
|
||||
bne .1
|
||||
inc A2osX.TIMER16+1
|
||||
|
||||
.1 dec EVTMGR.HZ.CNT
|
||||
.1 dec EvtMgr.HZ.CNT
|
||||
bne EVT.GetEvents.DEV not yet 100ms
|
||||
|
||||
ldx A2osX.HZ
|
||||
stx EVTMGR.HZ.CNT
|
||||
stx EvtMgr.HZ.CNT
|
||||
|
||||
lda #S.EVT.F.T10TH
|
||||
|
||||
dec EVTMGR.10TH.CNT
|
||||
dec EvtMgr.10TH.CNT
|
||||
bne .2
|
||||
|
||||
ldx #10
|
||||
stx EVTMGR.10TH.CNT
|
||||
stx EvtMgr.10TH.CNT
|
||||
|
||||
ora #S.EVT.F.T1SEC
|
||||
|
||||
@ -53,29 +53,25 @@ EVT.GetEvents.DEV
|
||||
>LDYAI DevMgr.Table
|
||||
>STYA pDev
|
||||
|
||||
stz EvtMgr.DevID
|
||||
stz EvtMgr.Idx
|
||||
|
||||
.1 ldy #S.DEV.F
|
||||
lda (pDev),y get S.DEV.F
|
||||
bit #S.DEV.F.EVENT
|
||||
beq .2 EVENT enabled ?
|
||||
* lda (pDev),y get S.DEV.F
|
||||
* bit #S.DEV.F.EVENT
|
||||
* beq .2 EVENT enabled ?
|
||||
|
||||
lda (pDev)
|
||||
cmp #H.BIN.HEADER.DRV65
|
||||
bne *
|
||||
* ldx #DEVMGR.GETEVENT
|
||||
|
||||
ldx #DEVMGR.GETEVENT
|
||||
|
||||
jsr pDevJmp Call DRV GetEvent function
|
||||
bcs .2 no event
|
||||
* jsr pDevJmp Call DRV GetEvent function
|
||||
* bcs .2 no event
|
||||
|
||||
ldy #S.EVT.hDEV
|
||||
lda EvtMgr.DevID
|
||||
sta (pEvent),y
|
||||
* ldy #S.EVT.hDEV
|
||||
* lda EvtMgr.Idx
|
||||
* sta (pEvent),y
|
||||
|
||||
jsr EVT.GetEvents.Add
|
||||
* jsr EVT.GetEvents.Add
|
||||
|
||||
bcs .8 Event Q is full, exit now with CC
|
||||
* bcs .8 Event Q is full, exit now with CC
|
||||
|
||||
.2 lda pDev
|
||||
clc
|
||||
@ -84,19 +80,19 @@ EVT.GetEvents.DEV
|
||||
bcc .3
|
||||
inc pDev+1
|
||||
|
||||
.3 lda EvtMgr.DevID
|
||||
inc EvtMgr.DevID
|
||||
cmp DevMgr.LastDevID
|
||||
.3 lda EvtMgr.Idx
|
||||
inc EvtMgr.Idx
|
||||
cmp DevMgr.Count
|
||||
bne .1
|
||||
|
||||
lda EVTMGR.COUNT if 0, exit with CS (from cmp), and A=0 "no event"
|
||||
lda EvtMgr.Count if 0, exit with CS (from cmp), and A=0 "no event"
|
||||
beq .9
|
||||
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
EVT.GetEvents.Add
|
||||
inc EVTMGR.COUNT Add one event to Queue
|
||||
inc EvtMgr.Count Add one event to Queue
|
||||
|
||||
lda pEvent
|
||||
clc
|
||||
@ -126,14 +122,10 @@ EVT.DestroyEvent
|
||||
|
||||
.2 lda #0
|
||||
sta (pEvent)
|
||||
dec EVTMGR.COUNT
|
||||
dec EvtMgr.Count
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
EVTMGR.VBLSTATE .BS 1
|
||||
EVTMGR.10TH.CNT .BS 1
|
||||
EVTMGR.HZ.CNT .BS 1
|
||||
EVTMGR.COUNT .BS 1
|
||||
EvtMgr.DevID .BS 1
|
||||
EvtMgr.Idx .BS 1
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE SYS/KERNEL.S.EVT
|
||||
|
@ -15,33 +15,33 @@ AUTO 6
|
||||
* PUSHW = AUXTYPE
|
||||
* PUSHB = TYPE
|
||||
* PUSHB = MODE
|
||||
* SYS.FOPEN.R : if R and !exists -> ERROR
|
||||
* SYS.FOPEN.W : if W and !exists -> CREATE
|
||||
* SYS.FOPEN.A : Append
|
||||
* SYS.FOPEN.T : Open/Append in Text mode
|
||||
* SYS.FOPEN.X : Create if not exists
|
||||
* SYS.FOpen.R : if R and !exists -> ERROR
|
||||
* SYS.FOpen.W : if W and !exists -> CREATE
|
||||
* SYS.FOpen.A : Append
|
||||
* SYS.FOpen.T : Open/Append in Text mode
|
||||
* SYS.FOpen.X : Create if not exists
|
||||
* PUSHW = PATH (PSTR)
|
||||
* ##Out :
|
||||
* CC : A = hFILE
|
||||
* CS : A = EC
|
||||
*\--------------------------------------
|
||||
K.FOPEN jsr PFT.CheckPathSTK
|
||||
K.FOpen jsr PFT.CheckPathSTK
|
||||
>PULLW MLICALL.PARAMS+1
|
||||
>PULLB K.FOPEN.MODE
|
||||
>PULLB K.FOPEN.TYPE
|
||||
>PULLW K.FOPEN.AUXTYPE
|
||||
>PULLB K.FOpen.MODE
|
||||
>PULLB K.FOpen.TYPE
|
||||
>PULLW K.FOpen.AUXTYPE
|
||||
|
||||
>MLICALL MLIGETFILEINFO
|
||||
bcc K.FOPEN.10 Already Exists
|
||||
bcc K.FOpen.10 Already Exists
|
||||
|
||||
bit K.FOPEN.MODE Create if not exists ?
|
||||
bpl K.FOPEN.9 No, return MLI error
|
||||
bit K.FOpen.MODE Create if not exists ?
|
||||
bpl K.FOpen.9 No, return MLI error
|
||||
|
||||
lda #S.FILEINFO.ACCESS.FULL Yes, Create...
|
||||
sta MLICALL.PARAMS+3 Access
|
||||
lda K.FOPEN.TYPE
|
||||
lda K.FOpen.TYPE
|
||||
sta MLICALL.PARAMS+4 File type
|
||||
>LDYA K.FOPEN.AUXTYPE
|
||||
>LDYA K.FOpen.AUXTYPE
|
||||
>STYA MLICALL.PARAMS+5 Aux type
|
||||
lda #S.FILEINFO.STORETYPE.STD
|
||||
sta MLICALL.PARAMS+7
|
||||
@ -55,41 +55,34 @@ K.FOPEN jsr PFT.CheckPathSTK
|
||||
bpl .1
|
||||
|
||||
>MLICALL MLICREATE
|
||||
bcc K.FOPEN.10
|
||||
K.FOPEN.9 rts
|
||||
bcc K.FOpen.10
|
||||
K.FOpen.9 rts
|
||||
|
||||
K.FOPEN.10 >PUSHWI S.NODE.REG
|
||||
K.FOpen.10 >PUSHWI S.NODE.REG
|
||||
>PUSHBI S.MEM.F.INIT0
|
||||
jsr K.GetMem
|
||||
bcs K.FOPEN.9
|
||||
bcs K.FOpen.9
|
||||
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
stx hFILE
|
||||
|
||||
>PUSHWI 1024 get a ProDOS IOBUF
|
||||
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOVE
|
||||
jsr K.GetMem
|
||||
jsr FILE.SetIOBUF
|
||||
bcs .98
|
||||
|
||||
>STYA MLICALL.PARAMS+3 Save Ptr to IOBUF for MLIOPEN call
|
||||
txa
|
||||
ldy #S.NODE.REG.IOBUF
|
||||
sta (ZPQuickPtr1),y
|
||||
|
||||
>MLICALL MLIOPEN
|
||||
bcs .98
|
||||
|
||||
lda MLICALL.PARAMS+5 get ref_num
|
||||
ldy #S.NODE.REG.REF
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
sta MLICALL.PARAMS+1 Next MLI Calls are REF_NUM based
|
||||
|
||||
lda K.FOPEN.MODE
|
||||
bit #SYS.FOPEN.W
|
||||
lda K.FOpen.MODE
|
||||
bit #SYS.FOpen.W
|
||||
beq .20 Write mode ?
|
||||
|
||||
and #SYS.FOPEN.A Append ?
|
||||
and #SYS.FOpen.A Append ?
|
||||
bne .11 yes, go to end of file
|
||||
|
||||
stz MLICALL.PARAMS+2
|
||||
@ -105,8 +98,8 @@ K.FOPEN.10 >PUSHWI S.NODE.REG
|
||||
>MLICALL MLISETMARK
|
||||
bcs .98
|
||||
|
||||
.20 lda K.FOPEN.MODE
|
||||
and #SYS.FOPEN.T Text Mode ?
|
||||
.20 lda K.FOpen.MODE
|
||||
and #SYS.FOpen.T Text Mode ?
|
||||
beq .30
|
||||
|
||||
lda #$FF
|
||||
@ -117,7 +110,7 @@ K.FOPEN.10 >PUSHWI S.NODE.REG
|
||||
|
||||
.30 ldy #S.NODE.T
|
||||
lda #S.NODE.T.REG
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
lda hFILE
|
||||
clc
|
||||
rts CC
|
||||
@ -128,9 +121,9 @@ K.FOPEN.10 >PUSHWI S.NODE.REG
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.FOPEN.MODE .BS 1
|
||||
K.FOPEN.TYPE .BS 1
|
||||
K.FOPEN.AUXTYPE .BS 2
|
||||
K.FOpen.MODE .BS 1
|
||||
K.FOpen.TYPE .BS 1
|
||||
K.FOpen.AUXTYPE .BS 2
|
||||
hFILE .BS 1
|
||||
*/--------------------------------------
|
||||
* #FCloseA
|
||||
@ -140,24 +133,23 @@ hFILE .BS 1
|
||||
* ##Out :
|
||||
*\--------------------------------------
|
||||
K.FCloseA jsr PFT.CheckNodeA
|
||||
sta hFILE
|
||||
sta K.FCloseA.2+1
|
||||
jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
K.FCloseA.1 ldy #S.NODE.REG.REF
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
beq .1
|
||||
sta MLICALL.PARAMS+1
|
||||
>MLICALL MLICLOSE
|
||||
|
||||
.1 ldy #S.NODE.REG.IOBUF
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .2
|
||||
lda (ZPPtr1),y
|
||||
beq K.FCloseA.2
|
||||
jsr K.FreeMemA
|
||||
|
||||
.2 lda hFILE
|
||||
jsr K.FreeMemA
|
||||
rts
|
||||
K.FCloseA.2 lda #$ff Self Modified
|
||||
jmp K.FreeMemA
|
||||
*/--------------------------------------
|
||||
* #FReadA
|
||||
* Read ONE byte from file
|
||||
@ -245,13 +237,13 @@ K.FFlushA jsr PFT.CheckNodeA
|
||||
K.FSeek jsr PFT.CheckNodeSTK
|
||||
>PULLA
|
||||
jsr FILE.SetupPrt1A
|
||||
>PULLB K.FSEEK.FROM
|
||||
>PULLW K.FSEEK.OFFSET
|
||||
>PULLW K.FSEEK.OFFSET+2
|
||||
>PULLB K.FSeek.FROM
|
||||
>PULLW K.FSeek.OFFSET
|
||||
>PULLW K.FSeek.OFFSET+2
|
||||
|
||||
lda K.FSEEK.FROM
|
||||
lda K.FSeek.FROM
|
||||
|
||||
* cmp #SYS.FSEEK.SET =0
|
||||
* cmp #SYS.FSeek.SET =0
|
||||
|
||||
bne .1
|
||||
stz MLICALL.PARAMS+2
|
||||
@ -259,25 +251,25 @@ K.FSeek jsr PFT.CheckNodeSTK
|
||||
stz MLICALL.PARAMS+4
|
||||
bra .8
|
||||
|
||||
.1 cmp #SYS.FSEEK.CUR
|
||||
.1 cmp #SYS.FSeek.CUR
|
||||
bne .2
|
||||
>MLICALL MLIGETMARK
|
||||
bcc .8
|
||||
rts
|
||||
|
||||
.2 cmp #SYS.FSEEK.END
|
||||
.2 cmp #SYS.FSeek.END
|
||||
bne .98
|
||||
>MLICALL MLIGETEOF
|
||||
bcs .9
|
||||
|
||||
.8 lda MLICALL.PARAMS+2
|
||||
adc K.FSEEK.OFFSET
|
||||
adc K.FSeek.OFFSET
|
||||
sta MLICALL.PARAMS+2
|
||||
lda MLICALL.PARAMS+3
|
||||
adc K.FSEEK.OFFSET+1
|
||||
adc K.FSeek.OFFSET+1
|
||||
sta MLICALL.PARAMS+3
|
||||
lda MLICALL.PARAMS+4
|
||||
adc K.FSEEK.OFFSET+2
|
||||
adc K.FSeek.OFFSET+2
|
||||
sta MLICALL.PARAMS+4
|
||||
bcs .99 Offset out of range!
|
||||
|
||||
@ -291,8 +283,8 @@ K.FSeek jsr PFT.CheckNodeSTK
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.FSEEK.FROM .BS 1
|
||||
K.FSEEK.OFFSET .BS 4
|
||||
K.FSeek.FROM .BS 1
|
||||
K.FSeek.OFFSET .BS 4
|
||||
*/--------------------------------------
|
||||
* #FTellA
|
||||
* ##In:
|
||||
@ -319,7 +311,7 @@ K.FTellA.1 jsr FILE.SetupPrt1A
|
||||
*\--------------------------------------
|
||||
K.FEOFA jsr PFT.CheckNodeA
|
||||
jsr FILE.SetupPrt1A
|
||||
jsr K.FTELLA.1
|
||||
jsr K.FTellA.1
|
||||
bcs .9
|
||||
>STYA K.FEOFA.MARK
|
||||
stx K.FEOFA.MARK+2
|
||||
@ -357,7 +349,7 @@ K.RemoveYA jsr PFT.CheckPathYA
|
||||
K.Rename jsr PFT.CheckPathSTK
|
||||
>PULLW MLICALL.PARAMS+1
|
||||
>PULLW MLICALL.PARAMS+3
|
||||
>MLICALL MLIRENAME
|
||||
>MLICALL MLIRename
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* #Stat
|
||||
@ -369,22 +361,32 @@ K.Rename jsr PFT.CheckPathSTK
|
||||
*\--------------------------------------
|
||||
K.Stat jsr PFT.CheckPathSTK
|
||||
>PULLW MLICALL.PARAMS+1
|
||||
>PULLW ZPQuickPtr2
|
||||
>PULLW ZPPtr2
|
||||
>MLICALL MLIGETFILEINFO
|
||||
bcs .9
|
||||
jsr FILE.MLI2STAT
|
||||
clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
FILE.SetIOBUF >PUSHWI 1024 get a ProDOS IOBUF
|
||||
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOVE
|
||||
jsr K.GetMem
|
||||
bcs .9
|
||||
|
||||
>STYA MLICALL.PARAMS+3 Save Ptr to IOBUF for MLIOPEN call
|
||||
txa
|
||||
ldy #S.NODE.REG.IOBUF
|
||||
sta (ZPPtr1),y
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
FILE.SetupPrt1A jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
ldy #S.NODE.REG.REF
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
sta MLICALL.PARAMS+1
|
||||
rts
|
||||
*--------------------------------------
|
||||
FILE.MLI2STAT
|
||||
lda MLICALL.PARAMS+S.FILEINFO.ACCESS
|
||||
FILE.MLI2STAT lda MLICALL.PARAMS+S.FILEINFO.ACCESS
|
||||
cmp #S.FILEINFO.ACCESS.FULL
|
||||
bne .1
|
||||
|
||||
@ -396,13 +398,13 @@ FILE.MLI2STAT
|
||||
lda #S.STAT.MODE.XO+S.STAT.MODE.RO
|
||||
|
||||
.2 ldy #S.STAT.MODE
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
ldx #2
|
||||
ldy #S.STAT.P.TYPE+2
|
||||
|
||||
.3 lda MLICALL.PARAMS+S.FILEINFO.TYPE,x
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
dey
|
||||
dex
|
||||
bpl .3
|
||||
|
@ -17,13 +17,13 @@ AUTO 6
|
||||
* X = hMem to FilePath
|
||||
* CS : not found
|
||||
*\--------------------------------------
|
||||
K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
|
||||
K.FileSearch >PULLW ZPPtr4 ZPPtr1 trashed by ExpandPStrYA
|
||||
>PULLYA Get Search list
|
||||
>SYSCALL ExpandPStrYA Expand it (SYSCALL to BNK1)
|
||||
bcs .99
|
||||
|
||||
stx K.FileSearch.hSrch
|
||||
>STYA ZPQuickPtr3 ZPQuickPtr2 trashed by K.STAT !!! expanded search list ;
|
||||
>STYA ZPPtr3 ZPPtr2 trashed by K.STAT !!! expanded search list ;
|
||||
|
||||
stz K.FileSearch.Index
|
||||
|
||||
@ -33,10 +33,10 @@ K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
|
||||
ldy K.FileSearch.Index
|
||||
|
||||
.2 tya
|
||||
cmp (ZPQuickPtr3) end of src string ?
|
||||
cmp (ZPPtr3) end of src string ?
|
||||
beq .3 end of string, try it....
|
||||
iny
|
||||
lda (ZPQuickPtr3),y
|
||||
lda (ZPPtr3),y
|
||||
cmp #';'
|
||||
beq .3
|
||||
inx
|
||||
@ -51,11 +51,11 @@ K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
|
||||
ldy #0
|
||||
|
||||
.4 iny
|
||||
lda (ZPQuickPtr4),y Append Fiename...
|
||||
lda (ZPPtr4),y Append Fiename...
|
||||
inx
|
||||
sta KrnBuf256,x
|
||||
tya
|
||||
cmp (ZPQuickPtr4)
|
||||
cmp (ZPPtr4)
|
||||
bne .4
|
||||
|
||||
stx KrnBuf256 set string length
|
||||
@ -88,14 +88,14 @@ K.FileSearch.Index .BS 1
|
||||
* X = hMem of FullPath
|
||||
* CS : A = Error Code
|
||||
*\--------------------------------------
|
||||
K.GetFullPathYA >STYA ZPQuickPtr3 Ptr1 & 2 used by StrCpy
|
||||
lda (ZPQuickPtr3)
|
||||
K.GetFullPathYA >STYA ZPPtr3 Ptr1 & 2 used by StrCpy
|
||||
lda (ZPPtr3)
|
||||
beq K.GetFullPathYA.9
|
||||
|
||||
stz KrnBuf256
|
||||
|
||||
ldy #1
|
||||
lda (ZPQuickPtr3),y
|
||||
lda (ZPPtr3),y
|
||||
cmp #'/' full path starting with '/'?
|
||||
beq .1 yes, do not append to current prefix
|
||||
|
||||
@ -106,7 +106,7 @@ K.GetFullPathYA >STYA ZPQuickPtr3 Ptr1 & 2 used by StrCpy
|
||||
>PUSHWI KrnBuf256
|
||||
>SYSCALL PStrCpy
|
||||
|
||||
.1 >PUSHW ZPQuickPtr3
|
||||
.1 >PUSHW ZPPtr3
|
||||
>PUSHWI KrnBuf256
|
||||
>SYSCALL PStrCat
|
||||
K.GetFullPathYA.NewStr
|
||||
@ -123,22 +123,22 @@ K.GetFullPathYA.9
|
||||
* PUSHW = AUXTYPE (Handled by....
|
||||
* PUSHB = TYPE ...
|
||||
* PUSHB = MODE ...
|
||||
* PUSHW = PATH ...FOPEN)
|
||||
* PUSHW = PATH ...FOpen)
|
||||
* ##Out:
|
||||
* Y,A = File Length
|
||||
* X = hMem of Loaded File
|
||||
*\--------------------------------------
|
||||
K.LoadFile jsr K.FOPEN
|
||||
K.LoadFile jsr K.FOpen
|
||||
bcs .9
|
||||
|
||||
sta K.LoadFile.hFile
|
||||
|
||||
ldx #SYS.FSEEK.END
|
||||
ldx #SYS.FSeek.END
|
||||
jsr K.LoadFile.Seek
|
||||
bcs .99
|
||||
|
||||
lda K.LoadFile.hFile
|
||||
jsr K.FTELLA
|
||||
jsr K.FTellA
|
||||
bcs .99
|
||||
>STYA K.LoadFile.Len
|
||||
phx
|
||||
@ -152,14 +152,14 @@ K.LoadFile jsr K.FOPEN
|
||||
>STYA K.LoadFile.Mem
|
||||
stx K.LoadFile.hMem
|
||||
|
||||
ldx #SYS.FSEEK.SET
|
||||
ldx #SYS.FSeek.SET
|
||||
jsr K.LoadFile.Seek
|
||||
bcs .97
|
||||
|
||||
>PUSHW K.LoadFile.Mem
|
||||
>PUSHW K.LoadFile.Len
|
||||
>PUSHB K.LoadFile.hFile
|
||||
jsr K.FREAD
|
||||
jsr K.FRead
|
||||
bcs .97
|
||||
|
||||
jsr .99
|
||||
@ -189,7 +189,7 @@ K.LoadFile.Seek >PUSHWI 0
|
||||
txa
|
||||
>PUSHA
|
||||
>PUSHB K.LoadFile.hFile
|
||||
jmp K.FSEEK
|
||||
jmp K.FSeek
|
||||
*/--------------------------------------
|
||||
* #SaveFile
|
||||
* ##In:
|
||||
@ -198,15 +198,15 @@ K.LoadFile.Seek >PUSHWI 0
|
||||
* PUSHW = AUXTYPE (Handled by....
|
||||
* PUSHB = TYPE ...
|
||||
* PUSHB = MODE ...
|
||||
* PUSHW = PATH ...FOPEN)
|
||||
* PUSHW = PATH ...FOpen)
|
||||
*\--------------------------------------
|
||||
K.SaveFile jsr K.FOPEN
|
||||
K.SaveFile jsr K.FOpen
|
||||
bcs .9
|
||||
|
||||
sta K.LoadFile.hFile
|
||||
|
||||
>PUSHB K.LoadFile.hFile
|
||||
jsr K.FWRITE
|
||||
jsr K.FWrite
|
||||
bcs .99
|
||||
|
||||
jsr .99
|
||||
|
@ -128,10 +128,19 @@ A2osX.BLKCALL1 >STYA .2+1 setup device entry point $Cnxx
|
||||
*--------------------------------------
|
||||
* Smartport Call
|
||||
*--------------------------------------
|
||||
A2osX.PRTCALL1
|
||||
|
||||
clc
|
||||
A2osX.PRTCALL1 >STYA .1+1
|
||||
txa
|
||||
lsr
|
||||
sta .2
|
||||
tax
|
||||
lda A2osX.PRTCALL.Cnt,x
|
||||
sta PRTCALL.PARAMS
|
||||
.1 jsr $ffff
|
||||
.2 .BS 1 CMD
|
||||
.DA PRTCALL.PARAMS
|
||||
rts
|
||||
A2osX.PRTCALL.Cnt
|
||||
.HS 03030301030101010404
|
||||
*--------------------------------------
|
||||
GO.ProDOS lda $D000 We re coming from AUXLC, saving bank...
|
||||
sta GO.A2osX.BNK+1
|
||||
|
@ -11,11 +11,11 @@ Kernel.Init2 sei
|
||||
jsr PrintCStrAX
|
||||
|
||||
>LDYAI A2osX.GP
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
>LDYAI A2osX.SYSCALL
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
>LDYAI A2osX.GP.SIZE^$FFFF
|
||||
>STYA ZPQuickPtr3
|
||||
>STYA ZPPtr3
|
||||
jsr Kernel.Move
|
||||
|
||||
sta CLRALTZP
|
||||
@ -29,11 +29,11 @@ Kernel.Init2 sei
|
||||
lda RRAMWRAMBNK2
|
||||
|
||||
>LDYAI A2osX.D002
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
>LDYAI $D000
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
>LDYAI A2osX.D002.SIZE^$FFFF
|
||||
>STYA ZPQuickPtr3
|
||||
>STYA ZPPtr3
|
||||
jsr Kernel.Move
|
||||
|
||||
sta CLRALTZP
|
||||
@ -47,11 +47,11 @@ Kernel.Init2 sei
|
||||
lda RRAMWRAMBNK1
|
||||
|
||||
>LDYAI A2osX.D001
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
>LDYAI $D000
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
>LDYAI A2osX.D001.SIZE^$FFFF
|
||||
>STYA ZPQuickPtr3
|
||||
>STYA ZPPtr3
|
||||
jsr Kernel.Move
|
||||
|
||||
sta CLRALTZP
|
||||
@ -65,11 +65,11 @@ Kernel.Init2 sei
|
||||
lda RRAMWRAMBNK1
|
||||
|
||||
>LDYAI A2osX.E000
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
>LDYAI $E000
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
>LDYAI A2osX.E000.SIZE^$FFFF
|
||||
>STYA ZPQuickPtr3
|
||||
>STYA ZPPtr3
|
||||
jsr Kernel.Move
|
||||
|
||||
>LDYAI D.STACK.TOP
|
||||
@ -239,15 +239,15 @@ DetectZ80 ldx #Z80Code.Size
|
||||
dex
|
||||
bne .1
|
||||
|
||||
stz ZPQuickPtr1
|
||||
stz ZPPtr1
|
||||
lda #$C1
|
||||
sta ZPQuickPtr1+1
|
||||
sta ZPPtr1+1
|
||||
|
||||
.2 sta (ZPQuickPtr1)
|
||||
.2 sta (ZPPtr1)
|
||||
lda $100D
|
||||
bmi .8
|
||||
inc ZPQuickPtr1+1
|
||||
lda ZPQuickPtr1+1
|
||||
inc ZPPtr1+1
|
||||
lda ZPPtr1+1
|
||||
cmp #$C8
|
||||
beq .9 CS
|
||||
clc
|
||||
@ -255,7 +255,7 @@ DetectZ80 ldx #Z80Code.Size
|
||||
sta $100A
|
||||
bra .2
|
||||
|
||||
.8 lda ZPQuickPtr1+1
|
||||
.8 lda ZPPtr1+1
|
||||
and #$0F
|
||||
clc
|
||||
.9 rts
|
||||
@ -289,18 +289,18 @@ MSG.Z80.OK >CSTR "Detected In Slot %d.\n"
|
||||
MSG.Z80.KO >CSTR "Not Detected.\n"
|
||||
*--------------------------------------
|
||||
Kernel.Move ldy #0
|
||||
.1 inc ZPQuickPtr3
|
||||
.1 inc ZPPtr3
|
||||
bne .2
|
||||
inc ZPQuickPtr3+1
|
||||
inc ZPPtr3+1
|
||||
beq .9
|
||||
|
||||
.2 lda (ZPQuickPtr1),y
|
||||
sta (ZPQuickPtr2),y
|
||||
.2 lda (ZPPtr1),y
|
||||
sta (ZPPtr2),y
|
||||
iny
|
||||
bne .1
|
||||
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPQuickPtr2+1
|
||||
inc ZPPtr1+1
|
||||
inc ZPPtr2+1
|
||||
bne .1
|
||||
.9 rts
|
||||
MAN
|
||||
|
@ -5,52 +5,36 @@ INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
Kernel.Init3 ldx #S.DEV*DevMgr.Count
|
||||
|
||||
.1 lda DevMgr.NUL-1,x
|
||||
sta DevMgr.Table-1,x
|
||||
dex
|
||||
bne .1
|
||||
|
||||
stz DevMgr.Table+S.DEV*DevMgr.Count
|
||||
Kernel.Init3 jsr MemMgrInit
|
||||
jsr PS0Init
|
||||
bcs *
|
||||
|
||||
lda #1 SYS device
|
||||
>SYSCALL GetDevByIDA
|
||||
>STYA pDev
|
||||
ldx #DEVMGR.OPEN
|
||||
jsr pDevJmp
|
||||
|
||||
>LDYAI MSG.Init3
|
||||
>SYSCALL CPrintFYA
|
||||
|
||||
>LDYAI MSG.IRQ
|
||||
>SYSCALL CPrintFYA
|
||||
jsr K.IrqMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.MEM
|
||||
>SYSCALL CPrintFYA
|
||||
jsr K.MemMgrInit
|
||||
* jsr IrqMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.DEV
|
||||
>SYSCALL CPrintFYA
|
||||
jsr K.DevMgrInit
|
||||
jsr DevMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.EVT
|
||||
>SYSCALL CPrintFYA
|
||||
jsr K.EvtMgrInit
|
||||
jsr EvtMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.FLT
|
||||
>SYSCALL CPrintFYA
|
||||
jsr K.FltMgrInit
|
||||
jsr FltMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.TSK
|
||||
>SYSCALL CPrintFYA
|
||||
jsr K.TskMgrInit
|
||||
jsr TskMgrInit
|
||||
bcs *
|
||||
|
||||
ldy #S.PS.hPREFIX
|
||||
@ -80,6 +64,7 @@ Kernel.Init3 ldx #S.DEV*DevMgr.Count
|
||||
>STYA pPs
|
||||
|
||||
>DEBUGOA
|
||||
|
||||
bit RRAMWRAMBNK2
|
||||
bit RRAMWRAMBNK2
|
||||
jmp K.KernelRun
|
||||
@ -89,23 +74,71 @@ Kernel.Init3 ldx #S.DEV*DevMgr.Count
|
||||
>SYSCALL CPrintFYA
|
||||
bra * No need to discard Expanded CMDLINE
|
||||
*--------------------------------------
|
||||
DevMgr.NUL cld
|
||||
jmp (DevMgr.NUL.Code,x)
|
||||
.DA #0 DevID=0
|
||||
.DA #S.DEV.F.INUSE+S.DEV.F.SHARE+S.DEV.F.COUT+S.DEV.F.CHAR
|
||||
>PSTR "NUL" NAME
|
||||
.HS 00 NAME must Be 5 bytes long
|
||||
.HS 00
|
||||
.HS 00.00.00.00
|
||||
MemMgrInit >LDYAI MemMgr.MHiMem
|
||||
>STYA MemMgr.HiMem
|
||||
>STYA MemMgr.Free
|
||||
>LDYAI MemMgr.MLoMem
|
||||
>STYA MemMgr.LoMem
|
||||
stz MemMgr.LastSlot Reserve Slot #0
|
||||
|
||||
sta SETWRITEAUX
|
||||
|
||||
>LDYAI MemMgr.XHiMem
|
||||
>STYA MemMgr.HiMem
|
||||
>STYA MemMgr.Free
|
||||
>LDYAI MemMgr.XLoMem
|
||||
>STYA MemMgr.LoMem
|
||||
stz MemMgr.LastSlot Reserve Slot #0
|
||||
|
||||
sta CLRWRITEAUX
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgr.SYS cld
|
||||
jmp (DevMgr.SYS.Code,x)
|
||||
.DA #1 DevID=1
|
||||
.DA #S.DEV.F.INUSE+S.DEV.F.EVENT+S.DEV.F.SHARE+S.DEV.F.COUT+S.DEV.F.CHAR
|
||||
>PSTR "SYS" NAME
|
||||
.HS 00 NAME must Be 5 bytes long
|
||||
.HS 00
|
||||
.HS 00.00.00.00
|
||||
PS0Init ldx #S.DEV*2 NUL,SYS
|
||||
|
||||
.1 lda DevMgr.NUL-1,x
|
||||
sta DevMgr.Table-1,x
|
||||
dex
|
||||
bne .1
|
||||
|
||||
lda #2
|
||||
sta DevMgr.Count
|
||||
|
||||
>LDYAI TskMgr.Table Select Process 0 (Kernel)
|
||||
>STYA pPs
|
||||
|
||||
ldy #S.PS-1
|
||||
lda #0
|
||||
|
||||
.2 sta (pPs),y Blank PS0
|
||||
dey
|
||||
bpl .2
|
||||
|
||||
>LDYAI DEV.SYS
|
||||
>SYSCALL MkNodYA
|
||||
bcs .9
|
||||
|
||||
ldy #S.PS.hStdIn
|
||||
sta (pPs),y
|
||||
ldy #S.PS.hStdOut
|
||||
sta (pPs),y
|
||||
ldy #S.PS.hStdErr
|
||||
sta (pPs),y
|
||||
|
||||
clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
DevMgr.NUL .DA DevMgr.NUL.Code
|
||||
.DA #S.DEV.S.WRITE+S.DEV.S.READ+S.DEV.S.OPENED
|
||||
.DA #3
|
||||
.AS "NUL" NAME
|
||||
.HS 00 NAME must Be 4 bytes long
|
||||
*--------------------------------------
|
||||
DevMgr.SYS .DA DevMgr.SYS.Code
|
||||
.DA #S.DEV.S.WRITE+S.DEV.S.READ+3
|
||||
.DA #3
|
||||
.AS "SYS" NAME
|
||||
.HS 00 NAME must Be 4 bytes long
|
||||
*--------------------------------------
|
||||
* Setup MainLC ($3FE)
|
||||
*
|
||||
@ -113,7 +146,7 @@ DevMgr.SYS cld
|
||||
* Setup AuxLC $FFFE->Kernel IRQ Handler
|
||||
* if irq not handled, jmp (S.IrqMgrOldFFFE)
|
||||
*--------------------------------------
|
||||
K.IrqMgrInit php
|
||||
IrqMgrInit php
|
||||
sei
|
||||
>LDYA $FFFE
|
||||
cpy #K.IrqHandlerAuxLC
|
||||
@ -134,83 +167,140 @@ K.IrqMgrInit php
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.MemMgrInit >LDYAI MemMgr.MHiMem
|
||||
>STYA MemMgr.HiMem
|
||||
>STYA MemMgr.Free
|
||||
>LDYAI MemMgr.MLoMem
|
||||
>STYA MemMgr.LoMem
|
||||
stz MemMgr.LastSlot Reserve Slot #0
|
||||
|
||||
sta SETWRITEAUX
|
||||
|
||||
>LDYAI MemMgr.XHiMem
|
||||
>STYA MemMgr.HiMem
|
||||
>STYA MemMgr.Free
|
||||
>LDYAI MemMgr.XLoMem
|
||||
>STYA MemMgr.LoMem
|
||||
stz MemMgr.LastSlot Reserve Slot #0
|
||||
|
||||
sta CLRWRITEAUX
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.DevMgrInit stz ZPQuickPtr1
|
||||
DevMgrInit stz ZPPtr1
|
||||
lda #$C1
|
||||
sta ZPQuickPtr1+1
|
||||
sta ZPPtr1+1
|
||||
lda #'1'
|
||||
sta SP.DEV+5 S1Dy
|
||||
|
||||
.1 ldx #SmartPort.SIG-SmartPort.OFS-1
|
||||
|
||||
.2 ldy SmartPort.OFS,x Check if there is a smartport firmware
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
cmp SmartPort.SIG,x
|
||||
bne .3 not a smartport...
|
||||
dex
|
||||
bpl .2
|
||||
*SmartPort!!!
|
||||
jsr K.DevMgrInit.AddDev
|
||||
|
||||
|
||||
jsr DevMgrInit.SP
|
||||
bra .7
|
||||
|
||||
* Disk II, or Block device ?
|
||||
.3 dex if x=0, only first SIG byte failed
|
||||
bpl .8
|
||||
|
||||
ldy #$ff
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .4 $0, Disk II, 16sect
|
||||
lda (ZPPtr1),y
|
||||
bne .4 $0, Disk II, 16sect
|
||||
|
||||
inc
|
||||
beq .8 $ff, Disk II, 13sect
|
||||
jsr DevMgrInit.DII
|
||||
bra .7
|
||||
|
||||
.4 inc
|
||||
beq .7 $ff, Disk II, 13sect, ignore
|
||||
dec
|
||||
|
||||
.4
|
||||
* Block device
|
||||
jsr DevMgrInit.BLK
|
||||
|
||||
.7 lda ZPQuickPtr1+1
|
||||
.7 lda ZPPtr1+1
|
||||
and #$0f
|
||||
tax
|
||||
lda #$80
|
||||
sta A2osX.SLOTS,x
|
||||
|
||||
.8 inc ZPQuickPtr1+1
|
||||
lda ZPQuickPtr1+1
|
||||
.8 inc SP.DEV+5
|
||||
inc ZPPtr1+1
|
||||
lda ZPPtr1+1
|
||||
cmp #$C8
|
||||
bne .1
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.DevMgrInit.AddCtrl
|
||||
DevMgrInit.SP ldy #$ff
|
||||
lda (ZPPtr1),y
|
||||
clc
|
||||
adc #3 Compute smartport entry point
|
||||
sta .1+1
|
||||
sta .3+1
|
||||
sta SP.DEV+S.DEV.JMP
|
||||
lda ZPPtr1+1
|
||||
sta .1+2
|
||||
sta .3+2
|
||||
sta SP.DEV+S.DEV.JMP+1
|
||||
|
||||
.1 jsr $ffff Self Modified
|
||||
.DA #0 Status
|
||||
.DA SP.CTRL.STATUS
|
||||
bcs .9
|
||||
lda SP.STATUS1
|
||||
beq .9 no device
|
||||
|
||||
.2 lda #1
|
||||
sta SP.DEV.STATUS+1
|
||||
lda #'1'
|
||||
sta SP.DEV+7 SxD1
|
||||
|
||||
.3 jsr $ffff Self Modified
|
||||
.DA #0 Status
|
||||
.DA SP.DEV.STATUS
|
||||
bcs .7
|
||||
lda SP.STATUS2+S.DEVSTAT.S
|
||||
sta SP.DEV+S.DEV.S
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.7 inc SP.DEV+7
|
||||
dec SP.STATUS1
|
||||
bne .3
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
DevMgrInit.DII
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.DevMgrInit.AddDev
|
||||
DevMgrInit.BLK
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgrInit.AddDev
|
||||
lda DevMgr.Count
|
||||
inc DevMgr.Count
|
||||
jsr K.GetDevByIDA
|
||||
>STYA ZPPtr1
|
||||
rts
|
||||
*--------------------------------------
|
||||
SmartPort.OFS .HS 07010305
|
||||
SmartPort.SIG .HS 00200003
|
||||
*--------------------------------------
|
||||
K.EvtMgrInit
|
||||
SP.CTRL.STATUS .DA #3
|
||||
.DA #0
|
||||
.DA SP.STATUS1
|
||||
.DA #0 return S only
|
||||
SP.DEV.STATUS .DA #3
|
||||
.BS 1
|
||||
.DA SP.STATUS2
|
||||
.DA #3 return DIB
|
||||
SP.STATUS1 .BS 4
|
||||
SP.STATUS2 .BS S.DEVSTAT
|
||||
*--------------------------------------
|
||||
SP.DEV .BS 2 JMP
|
||||
.BS 1 S
|
||||
>PSTR "S1D1" 5 bytes
|
||||
*--------------------------------------
|
||||
SP.DRV cld
|
||||
ldy #7
|
||||
lda (pDev),y
|
||||
and #$f
|
||||
sta PRTCALL.PARAMS+1 dev
|
||||
SP.DRV.lo ldy #$ff
|
||||
SP.DRV.hi lda #$ff
|
||||
jmp A2osX.PRTCALL
|
||||
*--------------------------------------
|
||||
BLK.DRV
|
||||
*--------------------------------------
|
||||
EvtMgrInit
|
||||
* lda #10
|
||||
* sta EVTMGR.10TH.CNT WARNING!!!! WRONG BANK!!!
|
||||
|
||||
@ -230,50 +320,35 @@ K.EvtMgrInit
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.FltMgrInit stz FltMgr.Table
|
||||
FltMgrInit stz FltMgr.Table
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.TskMgrInit stz TSKMGR.LASTID
|
||||
lda #1
|
||||
sta TSKMGR.SIZE One Slot Busy (Kernel PS=0)
|
||||
|
||||
>LDYAI TskMgr.Table Clear whole process table
|
||||
>STYA pPs
|
||||
TskMgrInit >LDYAI TskMgr.Table+S.PS Clear whole process table except PS0
|
||||
>STYA .2+1
|
||||
|
||||
ldx #K.PS.MAX
|
||||
ldx #K.PS.MAX-1
|
||||
|
||||
.1 lda #0
|
||||
ldy #S.PS-1
|
||||
|
||||
.2 sta (pPs),y
|
||||
.2 sta $ffff,y Self Modified
|
||||
dey
|
||||
bpl .2
|
||||
|
||||
lda pPs
|
||||
lda .2+1
|
||||
clc
|
||||
adc #S.PS
|
||||
sta pPs
|
||||
sta .2+1
|
||||
bcc .3
|
||||
|
||||
inc pPs+1
|
||||
inc .2+2
|
||||
.3 dex
|
||||
bne .1
|
||||
|
||||
>LDYAI TskMgr.Table Select Process 0 (Kernel)
|
||||
>STYA pPs
|
||||
|
||||
lda #1
|
||||
ldy #S.PS.hINDEV
|
||||
sta (pPs),y Make In DEV = SYS
|
||||
ldy #S.PS.hOUTDEV
|
||||
sta (pPs),y Make OUT DEV = SYS
|
||||
ldy #S.PS.hERRDEV
|
||||
sta (pPs),y Make ERR DEV = SYS
|
||||
|
||||
>PUSHWI K.ENV.SIZE get a buffer for ENV
|
||||
>PUSHBI S.MEM.F.INIT0 make sure blank
|
||||
>SYSCALL GetMem create it...
|
||||
>SYSCALL GetMem create it...
|
||||
bcs .9
|
||||
|
||||
txa
|
||||
@ -293,7 +368,7 @@ K.TskMgrInit stz TSKMGR.LASTID
|
||||
ldy #S.PS.hPREFIX
|
||||
sta (pPs),y
|
||||
|
||||
>PUSHWI UsrBuf256 push ENV value
|
||||
>PUSHWI UsrBuf256 push ENV value
|
||||
>PUSHWI I.ENV.A2osX push ENV name
|
||||
>SYSCALL SetEnv
|
||||
bcs .9
|
||||
@ -310,6 +385,7 @@ K.TskMgrInit stz TSKMGR.LASTID
|
||||
>SYSCALL PutEnvYA
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
DEV.SYS >PSTR "SYS"
|
||||
I.ENV.A2osX >PSTR "A2OSX"
|
||||
I.ENV.PATH >PSTR "PATH=${A2OSX}SBIN/;${A2OSX}BIN/"
|
||||
I.ENV.LIB >PSTR "LIB=${A2OSX}LIB/"
|
||||
@ -318,7 +394,6 @@ STARTUP.CMDLINE >PSTR "${A2OSX}SBIN/SHELL ${A2OSX}A2osX.STARTUP"
|
||||
*--------------------------------------
|
||||
MSG.Init3 >CSTR "A2osX[Stage3]:Init\n"
|
||||
MSG.IRQ >CSTR "-Interrupt Manager...\n"
|
||||
MSG.MEM >CSTR "-Memory Manager...\n"
|
||||
MSG.DEV >CSTR "-Device Manager...\n"
|
||||
MSG.EVT >CSTR "-Event Manager...\n"
|
||||
MSG.FLT >CSTR "-Path Filter...\n"
|
||||
|
@ -74,7 +74,7 @@ K.IrqHandlerAuxLC
|
||||
bcs .82
|
||||
rti
|
||||
|
||||
K.IrqHandlerJMP ldx #DEVMGR.IRQ
|
||||
K.IrqHandlerJMP ldx #DEVMGR.READ
|
||||
jmp ($fe)
|
||||
*--------------------------------------
|
||||
K.IrqMgrOldFFFE .BS 2
|
||||
|
@ -29,27 +29,27 @@ KERNEL.SYSCALL
|
||||
.DA K.PTime2Time
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
.DA K.FOPEN $20
|
||||
.DA K.FOpen $20
|
||||
.DA K.FCloseA
|
||||
.DA K.FREAD
|
||||
.DA K.FWRITE
|
||||
.DA K.FFLUSHA
|
||||
.DA K.FSEEK
|
||||
.DA K.FTELLA
|
||||
.DA K.FRead
|
||||
.DA K.FWrite
|
||||
.DA K.FFlushA
|
||||
.DA K.FSeek
|
||||
.DA K.FTellA
|
||||
.DA K.FEOFA
|
||||
*--------------------------------------
|
||||
.DA K.REMOVEYA $30
|
||||
.DA K.RENAME
|
||||
.DA K.RemoveYA $30
|
||||
.DA K.Rename
|
||||
.DA K.STAT
|
||||
.DA 0
|
||||
.DA K.OPENDIRYA
|
||||
.DA K.OpenDirYA
|
||||
.DA K.ReadDirA
|
||||
.DA K.CloseDirA
|
||||
.DA K.MKDirYA
|
||||
*--------------------------------------
|
||||
* Bank 2
|
||||
*--------------------------------------
|
||||
.DA K.COutA $40
|
||||
.DA 0 $40
|
||||
.DA K.SScanF
|
||||
.DA K.PPrintFYA
|
||||
.DA K.CPrintFYA
|
||||
@ -87,11 +87,11 @@ KERNEL.SYSCALL
|
||||
*--------------------------------------
|
||||
.DA K.GetDevByIDA $80
|
||||
.DA K.GetDevByNameYA
|
||||
.DA K.GetDevInfoA
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA K.GetDevStatusA
|
||||
.DA 0
|
||||
.DA K.MKNodYA
|
||||
.DA K.MKNodA
|
||||
.DA K.MKFIFO
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
* $E000
|
||||
@ -101,12 +101,27 @@ KERNEL.SYSCALL
|
||||
.DA K.GetMemPtrA
|
||||
.DA K.GetMemByIDA
|
||||
.DA 0
|
||||
.DA K.LoadStockObjectYA
|
||||
.DA K.GetStockObjectA
|
||||
.DA K.FreeStockObject
|
||||
.DA K.LoadStkObjYA
|
||||
.DA K.GetStkObjA
|
||||
.DA K.FreeStkObjA
|
||||
*--------------------------------------
|
||||
.DA K.SetLoMem $A0
|
||||
.DA K.GetMemStatYA
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
.DA K.FPutCAY
|
||||
.DA K.PutCA
|
||||
.DA K.FGetCA
|
||||
.DA K.GetC
|
||||
.DA K.FPutS
|
||||
.DA K.PutSYA
|
||||
.DA K.FGetS
|
||||
.DA K.GetSYA
|
||||
*--------------------------------------
|
||||
* LO Byte :
|
||||
* #RRAMWRAMBNK1 or #RRAMWRAMBNK2
|
||||
@ -286,11 +301,25 @@ KERNEL.SYSCALL.FLAGS
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
|
||||
*--------------------------------------
|
||||
.DA 0 $A0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
.DA 0 $B0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
|
||||
MAN
|
||||
SAVE SYS/KERNEL.S.JMP
|
||||
LOAD SYS/KERNEL.S
|
||||
|
@ -66,22 +66,22 @@ K.LoadLib.hMem .BS 1
|
||||
*--------------------------------------
|
||||
K.UnloadLibA pha
|
||||
jsr K.GetMemByIDA
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
ldy #S.MEM.REFCNT
|
||||
lda (ZPQuickPtr1),y Get count of those referencing this lib
|
||||
lda (ZPPtr1),y Get count of those referencing this lib
|
||||
dec only one left ?
|
||||
beq .1
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
pla
|
||||
clc
|
||||
rts
|
||||
|
||||
.1 ldy #S.MEM.PTR
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
sta pLib
|
||||
|
||||
iny
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
sta pLib+1
|
||||
|
||||
ldx #LIBMGR.UNLOAD
|
||||
|
@ -5,7 +5,7 @@ INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
* !!!!!! DO NOT USE ZPQuickPTRs !!!!!
|
||||
* !!!!!! DO NOT USE ZPPtrs !!!!!
|
||||
*--------------------------------------
|
||||
ZPMemMgrSPtr .EQ ZPMEMMGR Pointer To Slot selected
|
||||
ZPMemMgrTmp1 .EQ ZPMEMMGR+2
|
||||
@ -307,7 +307,7 @@ K.FreeMemA phy
|
||||
bit RRAMWRAMBNK2
|
||||
|
||||
jsr PS.Select0
|
||||
jsr DevMgr.SYS.Select
|
||||
jsr DevMgr.SYS.Control
|
||||
|
||||
pla Get PC and sub 2 for calling address
|
||||
sec
|
||||
@ -394,11 +394,11 @@ K.GetMemByIDA sta ZPMemMgrSPtr
|
||||
* sta ZPMemMgrSPtr+1
|
||||
* rts
|
||||
*--------------------------------------
|
||||
K.LoadStockObjectYA
|
||||
K.LoadStkObjYA
|
||||
*--------------------------------------
|
||||
K.GetStockObjectA
|
||||
K.GetStkObjA
|
||||
*--------------------------------------
|
||||
K.FreeStockObject
|
||||
K.FreeStkObjA
|
||||
*--------------------------------------
|
||||
K.SetLoMem
|
||||
clc
|
||||
|
@ -34,49 +34,49 @@ PFT.CheckPathSTK
|
||||
ply
|
||||
PFT.CheckPathYA
|
||||
stx S.PFT.SYSCALL save #SYSCALL
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
>LDYAI FltMgr.Table
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
|
||||
.1 lda (ZPQuickPtr2) Get Filter Len
|
||||
.1 lda (ZPPtr2) Get Filter Len
|
||||
beq .9 End Of Table, Exit
|
||||
tay
|
||||
lda (ZPQuickPtr1),y is there a "/" at this point in SRC path?
|
||||
lda (ZPPtr1),y is there a "/" at this point in SRC path?
|
||||
cmp #'/'
|
||||
bne .8
|
||||
|
||||
.2 lda (ZPQuickPtr1),y
|
||||
cmp (ZPQuickPtr2),y
|
||||
.2 lda (ZPPtr1),y
|
||||
cmp (ZPPtr2),y
|
||||
bne .8
|
||||
dey
|
||||
bne .2
|
||||
|
||||
ldy #S.PFT.HANDLER
|
||||
lda (ZPQuickPtr2),y get hLib
|
||||
lda (ZPPtr2),y get hLib
|
||||
jsr K.GetMemPtrA
|
||||
>STYA .3+1
|
||||
|
||||
lda S.PFT.SYSCALL getback #SYSCALL
|
||||
sec
|
||||
sbc #SYS.FOPEN-4 0=Lib.load, 2=Lib.Unload
|
||||
sbc #SYS.FOpen-4 0=Lib.load, 2=Lib.Unload
|
||||
tax
|
||||
|
||||
pla discard JSR return @
|
||||
pla
|
||||
|
||||
>LDYA ZPQuickPtr1 restore passed params
|
||||
>LDYA ZPPtr1 restore passed params
|
||||
.3 jmp $ffff
|
||||
|
||||
|
||||
.8 lda ZPQuickPtr2
|
||||
.8 lda ZPPtr2
|
||||
clc
|
||||
adc (ZPQuickPtr2) Add STR len
|
||||
adc (ZPPtr2) Add STR len
|
||||
adc #S.PFT
|
||||
sta ZPQuickPtr2
|
||||
sta ZPPtr2
|
||||
bcc .1
|
||||
|
||||
.9 >LDYA ZPQuickPtr1 restore passed params
|
||||
.9 >LDYA ZPPtr1 restore passed params
|
||||
ldx S.PFT.SYSCALL
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -90,8 +90,8 @@ PFT.CheckNodeSTK
|
||||
PFT.CheckNodeA stx S.PFT.SYSCALL save #SYSCALL
|
||||
sta S.PFT.hFILE
|
||||
jsr K.GetMemPtrA X = unmidified
|
||||
>STYA ZPQuickPtr1
|
||||
lda (ZPQuickPtr1)
|
||||
>STYA ZPPtr1
|
||||
lda (ZPPtr1)
|
||||
beq .9 Handler is 0, back to kernel....
|
||||
|
||||
jsr K.GetMemPtrA
|
||||
@ -99,7 +99,7 @@ PFT.CheckNodeA stx S.PFT.SYSCALL save #SYSCALL
|
||||
|
||||
lda S.PFT.SYSCALL getback #SYSCALL
|
||||
sec
|
||||
sbc #SYS.FOPEN-4 0=Lib.load, 2=Lib.Unload
|
||||
sbc #SYS.FOpen-4 0=Lib.load, 2=Lib.Unload
|
||||
tax
|
||||
|
||||
pla discard JSR return @
|
||||
|
@ -30,24 +30,23 @@ K.CreateProcessYA
|
||||
jsr PS.CreateChild
|
||||
bcs .9
|
||||
|
||||
sta K.CreateProcess.CPSID
|
||||
sta .8+1
|
||||
|
||||
jsr PS.Init
|
||||
bcc .8
|
||||
|
||||
pha save error code
|
||||
lda K.CreateProcess.CPSID
|
||||
lda .8+1
|
||||
jsr PS.FreeA
|
||||
pla get back error code
|
||||
sec
|
||||
rts
|
||||
|
||||
.8 lda K.CreateProcess.CPSID
|
||||
.8 lda #$ff self modified
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
K.CreateProcess.Flags .BS 1
|
||||
K.CreateProcess.CmdLine .BS 2
|
||||
K.CreateProcess.CPSID .BS 1
|
||||
*/--------------------------------------
|
||||
* #GetPSByIDA
|
||||
* ##In :
|
||||
@ -57,7 +56,7 @@ K.CreateProcess.CPSID .BS 1
|
||||
*\--------------------------------------
|
||||
K.GetPSByIDA pha
|
||||
>LDYAI TskMgr.Table
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
pla
|
||||
beq .8
|
||||
@ -65,29 +64,29 @@ K.GetPSByIDA pha
|
||||
ldx #0
|
||||
|
||||
.1 inx
|
||||
lda ZPQuickPtr1
|
||||
lda ZPPtr1
|
||||
clc
|
||||
adc #S.PS
|
||||
sta ZPQuickPtr1
|
||||
sta ZPPtr1
|
||||
bcc .2
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPPtr1+1
|
||||
|
||||
.2 lda (ZPQuickPtr1)
|
||||
.2 lda (ZPPtr1)
|
||||
bpl .3
|
||||
|
||||
ldy #S.PS.PID
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
.20 cmp #$ff Self Modified
|
||||
beq .8
|
||||
|
||||
.3 cpx TSKMGR.SIZE
|
||||
.3 cpx TskMgr.Count
|
||||
bne .1
|
||||
|
||||
.9 lda #TSKMGR.ERRNSP
|
||||
sec
|
||||
rts
|
||||
|
||||
.8 >LDYA ZPQuickPtr1
|
||||
.8 >LDYA ZPPtr1
|
||||
clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
@ -118,26 +117,26 @@ K.Sleep pla get PC LO
|
||||
* in :
|
||||
* out :
|
||||
* A = PSID
|
||||
* we cannot use ZPQuickPtrs1 & 2
|
||||
* we cannot use ZPPtrs1 & 2
|
||||
* because of calling K.NewPStrYA & S.DupEnvA
|
||||
*--------------------------------------
|
||||
PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
||||
>STYA ZPQuickPtr3
|
||||
>STYA ZPPtr3
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 inx
|
||||
cpx TSKMGR.SIZE
|
||||
cpx TskMgr.Count
|
||||
beq .2
|
||||
|
||||
lda (ZPQuickPtr3) Found an empty slot
|
||||
lda (ZPPtr3) Found an empty slot
|
||||
bpl .3
|
||||
lda ZPQuickPtr3
|
||||
lda ZPPtr3
|
||||
clc
|
||||
adc #S.PS
|
||||
sta ZPQuickPtr3
|
||||
sta ZPPtr3
|
||||
bcc .1
|
||||
inc ZPQuickPtr3+1
|
||||
inc ZPPtr3+1
|
||||
|
||||
bra .1
|
||||
|
||||
@ -148,7 +147,7 @@ PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
||||
sec
|
||||
rts
|
||||
|
||||
.3 inc TSKMGR.SIZE
|
||||
.3 inc TskMgr.Count
|
||||
|
||||
.4 inc TSKMGR.LASTID Get a PSID not alredy running
|
||||
beq .4 not = 0
|
||||
@ -158,12 +157,12 @@ PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
||||
|
||||
ldy #S.PS.PID
|
||||
lda TSKMGR.LASTID
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
|
||||
lda #0
|
||||
ldy #S.PS.hCS
|
||||
|
||||
.5 sta (ZPQuickPtr3),y Blank Everything in this S.PS
|
||||
.5 sta (ZPPtr3),y Blank Everything in this S.PS
|
||||
iny
|
||||
cpy #S.PS
|
||||
bne .5
|
||||
@ -172,7 +171,7 @@ PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
||||
bit K.CreateProcess.Flags need to create ENV & Prefix ?
|
||||
beq .6 no...
|
||||
|
||||
sta (ZPQuickPtr3) Mark this PS with ENV flag
|
||||
sta (ZPPtr3) Mark this PS with ENV flag
|
||||
|
||||
ldy #S.PS.hPREFIX copy hPREFIX...
|
||||
lda (pPs),y
|
||||
@ -182,7 +181,7 @@ PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
||||
|
||||
txa
|
||||
ldy #S.PS.hPREFIX
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
|
||||
ldy #S.PS.hENV ...and hENV from parent PS
|
||||
lda (pPs),y
|
||||
@ -190,34 +189,30 @@ PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
||||
bcs .9
|
||||
|
||||
ldy #S.PS.hENV
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
bra .8
|
||||
|
||||
.6 ldy #S.PS.hPREFIX reuse same hPREFIX...
|
||||
lda (pPs),y
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
|
||||
ldy #S.PS.hENV ...and hENV from parent PS
|
||||
lda (pPs),y
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
|
||||
.8 ldy #S.PS.hINDEV
|
||||
.8 ldy #S.PS.hStdIn
|
||||
|
||||
.81 lda (pPs),y
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
iny
|
||||
cpy #S.PS.hERRDEV+1
|
||||
cpy #S.PS.hStdErr+1
|
||||
bne .81
|
||||
|
||||
ldy #S.PS.PID
|
||||
lda (pPs),y
|
||||
|
||||
ldy #S.PS.PPID
|
||||
sta (ZPQuickPtr3),y
|
||||
|
||||
ldy #S.PS.CPID
|
||||
lda TSKMGR.LASTID
|
||||
sta (pPs),y
|
||||
sta (ZPPtr3),y
|
||||
|
||||
lda #S.PS.F.HOLD
|
||||
bit K.CreateProcess.Flags
|
||||
@ -227,9 +222,13 @@ PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
||||
sta (pPs) HOLD parent PS if ExecProcess
|
||||
|
||||
.82 lda #S.PS.F.INUSE+S.PS.F.INIT
|
||||
ora (ZPQuickPtr3)
|
||||
sta (ZPQuickPtr3) Make this PS Init....
|
||||
ora (ZPPtr3)
|
||||
sta (ZPPtr3) Make this PS Init....
|
||||
|
||||
ldy #S.PS.CPID
|
||||
lda TSKMGR.LASTID
|
||||
sta (pPs),y
|
||||
|
||||
clc Exit with A=PSID
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
@ -242,27 +241,27 @@ PS.Init >LDYA K.CreateProcess.CmdLine
|
||||
|
||||
txa
|
||||
ldy #S.PS.hCMDLINE
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
|
||||
pla Restore PTR...
|
||||
ply
|
||||
>SYSCALL LoadExeYA Y,A=filename full path
|
||||
>SYSCALL LoadExeYA Y,A=filename full path
|
||||
bcs .9
|
||||
|
||||
>STYA ZPQuickPtr4 save PTR to Code Segment
|
||||
>STYA ZPPtr4 save PTR to Code Segment
|
||||
txa
|
||||
ldy #S.PS.hCS
|
||||
sta (ZPQuickPtr3),y save CS hMem in TSKSLOT
|
||||
sta (ZPPtr3),y save CS hMem in TSKSLOT
|
||||
|
||||
ldy #H.BIN.EXE.DS.SIZE+1
|
||||
lda (ZPQuickPtr4),y Load DS.SIZE HI
|
||||
lda (ZPPtr4),y Load DS.SIZE HI
|
||||
tax
|
||||
dey
|
||||
ora (ZPQuickPtr4),y
|
||||
ora (ZPPtr4),y
|
||||
|
||||
beq .2 DS.SIZE=0...
|
||||
|
||||
lda (ZPQuickPtr4),y
|
||||
lda (ZPPtr4),y
|
||||
>PUSHAX Push DS.SIZE
|
||||
>PUSHBI S.MEM.F.INIT0 Clear DS
|
||||
jsr K.GetMem
|
||||
@ -270,7 +269,7 @@ PS.Init >LDYA K.CreateProcess.CmdLine
|
||||
|
||||
txa
|
||||
ldy #S.PS.hDS
|
||||
sta (ZPQuickPtr3),y save DS hMem in TSKSLOT
|
||||
sta (ZPPtr3),y save DS hMem in TSKSLOT
|
||||
|
||||
.2
|
||||
|
||||
@ -280,48 +279,35 @@ PS.Init >LDYA K.CreateProcess.CmdLine
|
||||
* PS.FreeA
|
||||
* In : A = PID to free
|
||||
*--------------------------------------
|
||||
PS.FreeA jsr K.GetPSByIDA
|
||||
bcs *
|
||||
* >STYA ZPQuickPtr1 Already in ZPQuickPtr1
|
||||
PS.FreeA jsr K.GetPSByIDA PS in ZPPtr1
|
||||
|
||||
ldy #S.PS.hCMDLINE
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .2
|
||||
|
||||
jsr K.FreeMemA
|
||||
jsr PS.FreeA.PsY
|
||||
|
||||
lda (ZPQuickPtr1) get S.PS.F
|
||||
lda (ZPPtr1) get S.PS.F
|
||||
and #S.PS.F.ENV do we have to discard duplicated env & prefix ?
|
||||
beq .4
|
||||
beq .1
|
||||
|
||||
.2 ldy #S.PS.hENV
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .3
|
||||
ldy #S.PS.hENV
|
||||
jsr PS.FreeA.PsY
|
||||
|
||||
jsr K.FreeMemA
|
||||
ldy #S.PS.hPREFIX
|
||||
jsr PS.FreeA.PsY
|
||||
|
||||
.3 ldy #S.PS.hPREFIX
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .4
|
||||
.1 ldy #S.PS.hDS
|
||||
jsr PS.FreeA.PsY
|
||||
|
||||
jsr K.FreeMemA
|
||||
ldy #S.PS.hCS
|
||||
jsr PS.FreeA.PsY
|
||||
|
||||
.4 ldy #S.PS.hDS
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .5
|
||||
|
||||
jsr K.FreeMemA
|
||||
|
||||
.5 ldy #S.PS.hCS
|
||||
lda (ZPQuickPtr1),y
|
||||
beq .8
|
||||
|
||||
jsr K.FreeMemA
|
||||
|
||||
.8 lda #0
|
||||
sta (ZPQuickPtr1) Mark TSKSLOT as free
|
||||
lda #0
|
||||
sta (ZPPtr1) Mark TSKSLOT as free
|
||||
clc
|
||||
rts
|
||||
PS.FreeA.RTS rts
|
||||
*--------------------------------------
|
||||
PS.FreeA.PsY lda (ZPPtr1),y
|
||||
beq PS.FreeA.RTS
|
||||
jmp K.FreeMemA
|
||||
*--------------------------------------
|
||||
* PS.SelectA
|
||||
* In : A=PSID
|
||||
@ -345,7 +331,7 @@ PS.Select ldy #S.PS.hCS
|
||||
jsr K.GetMemPtrA
|
||||
>STYA pData
|
||||
|
||||
.1 ldy #S.PS.hOUTDEV
|
||||
.1 ldy #S.PS.hStdOut
|
||||
lda (pPs),y
|
||||
beq .8
|
||||
|
||||
@ -362,23 +348,23 @@ PS.Select ldy #S.PS.hCS
|
||||
* A = hMem to new ENV
|
||||
*--------------------------------------
|
||||
PS.DupEnvA jsr K.GetMemPtrA
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
>PUSHWI K.ENV.SIZE
|
||||
>PUSHBI 0
|
||||
jsr K.GetMem
|
||||
bcs .9
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
|
||||
ldy #0
|
||||
|
||||
.1 lda (ZPQuickPtr1),y
|
||||
sta (ZPQuickPtr2),y
|
||||
.1 lda (ZPPtr1),y
|
||||
sta (ZPPtr2),y
|
||||
beq .8
|
||||
|
||||
iny
|
||||
bne .1
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPQuickPtr2+1
|
||||
inc ZPPtr1+1
|
||||
inc ZPPtr2+1
|
||||
bra .1
|
||||
|
||||
.8 txa
|
||||
|
@ -6,10 +6,10 @@ AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
K.KernelRun jsr TSK.TskMgrRun
|
||||
bcs .9
|
||||
bcs *
|
||||
|
||||
jsr EVT.GetEvents
|
||||
bcs K.KernelRun CS=no event
|
||||
bcs .4 CS=no event
|
||||
|
||||
jsr TSK.DispatchEvents
|
||||
bcc .4 CC=All Events Dispatched
|
||||
@ -45,8 +45,8 @@ K.KernelRun jsr TSK.TskMgrRun
|
||||
.4 bit OPENAPPLE
|
||||
bpl K.KernelRun
|
||||
|
||||
lda KBD
|
||||
inc A2osX.RANDOM16
|
||||
lda KBD
|
||||
sta A2osX.RANDOM16+1
|
||||
|
||||
bpl K.KernelRun
|
||||
@ -72,16 +72,22 @@ K.KernelRun jsr TSK.TskMgrRun
|
||||
stx A2osX.ASCREEN
|
||||
|
||||
>STYA pDev
|
||||
ldx #DEVMGR.SELECT
|
||||
jsr pDevJmp
|
||||
bra K.KernelRun
|
||||
lda (pDev)
|
||||
sta .5+1
|
||||
ldy #1
|
||||
lda (pDev),y
|
||||
sta .5+2
|
||||
ldx #DEVMGR.CONTROL
|
||||
jsr .5
|
||||
jmp K.KernelRun
|
||||
.5 jmp $ffff
|
||||
*--------------------------------------
|
||||
.9 jsr DevMgr.SYS.Select
|
||||
.9 jsr DevMgr.SYS.Control
|
||||
>LDYAI MSG.KRNLPANIC
|
||||
jsr K.CPrintFYA
|
||||
bra *
|
||||
*--------------------------------------
|
||||
MSG.DumpEvent >CSTR "!Unhandled Evt:F=%b,DevID=$%h,DATALO=$%h,DATAHI=$%h,W1=$%H,W2=$%H\n"
|
||||
MSG.DumpEvent >CSTR "!Evt:F=%b,Dev=$%h,LO=$%h,HI=$%h,W1=$%H,W2=$%H\n"
|
||||
MSG.KRNLPANIC >CSTR "\n!!!Kernel Panic!!!\n"
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -16,8 +16,8 @@ AUTO 6
|
||||
* CS : error
|
||||
* A = SYS error code
|
||||
*\--------------------------------------
|
||||
K.NewPStrYA >STYA ZPQuickPtr2
|
||||
lda (ZPQuickPtr2)
|
||||
K.NewPStrYA >STYA ZPPtr2
|
||||
lda (ZPPtr2)
|
||||
inc
|
||||
tay
|
||||
lda #0 Y,A = len of new string
|
||||
@ -26,11 +26,11 @@ K.NewPStrYA >STYA ZPQuickPtr2
|
||||
jsr K.GetMem
|
||||
bcs .9
|
||||
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
jsr K.PStrCpyPtr2Ptr1
|
||||
|
||||
>LDYA ZPQuickPtr1
|
||||
>LDYA ZPPtr1
|
||||
|
||||
clc
|
||||
.9 rts
|
||||
@ -46,13 +46,13 @@ K.NewPStrYA >STYA ZPQuickPtr2
|
||||
K.PStrCpy jsr PullPtr1Ptr2
|
||||
|
||||
K.PStrCpyPtr2Ptr1
|
||||
lda (ZPQuickPtr2)
|
||||
sta (ZPQuickPtr1)
|
||||
lda (ZPPtr2)
|
||||
sta (ZPPtr1)
|
||||
tay
|
||||
beq .2
|
||||
|
||||
.1 lda (ZPQuickPtr2),y
|
||||
sta (ZPQuickPtr1),y
|
||||
.1 lda (ZPPtr2),y
|
||||
sta (ZPPtr1),y
|
||||
dey
|
||||
bne .1
|
||||
|
||||
@ -69,10 +69,10 @@ K.PStrCpyPtr2Ptr1
|
||||
*\--------------------------------------
|
||||
K.PStrCat jsr PullPtr1Ptr2
|
||||
|
||||
lda (ZPQuickPtr2)
|
||||
lda (ZPPtr2)
|
||||
tax
|
||||
|
||||
lda (ZPQuickPtr1)
|
||||
lda (ZPPtr1)
|
||||
tay
|
||||
|
||||
.1 cpy #255
|
||||
@ -80,17 +80,17 @@ K.PStrCat jsr PullPtr1Ptr2
|
||||
|
||||
iny
|
||||
|
||||
inc ZPQuickPtr2
|
||||
inc ZPPtr2
|
||||
bne .2
|
||||
inc ZPQuickPtr1+1
|
||||
inc ZPPtr1+1
|
||||
|
||||
.2 lda (ZPQuickPtr2)
|
||||
sta (ZPQuickPtr1),y
|
||||
.2 lda (ZPPtr2)
|
||||
sta (ZPPtr1),y
|
||||
dex
|
||||
bne .1
|
||||
|
||||
.8 tya
|
||||
sta (ZPQuickPtr1)
|
||||
sta (ZPPtr1)
|
||||
clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
@ -105,59 +105,59 @@ K.PStrCat jsr PullPtr1Ptr2
|
||||
*\--------------------------------------
|
||||
K.PStrMatch jsr PullPtr1Ptr2
|
||||
|
||||
lda (ZPQuickPTR2) Keep Pattern Length in X
|
||||
lda (ZPPtr2) Keep Pattern Length in X
|
||||
tax
|
||||
beq .8 Match always if empty
|
||||
ldy #0
|
||||
|
||||
.1 inc ZPQuickPTR2 Make PTR1 advance to next char
|
||||
.1 inc ZPPtr2 Make PTR1 advance to next char
|
||||
bne .2
|
||||
inc ZPQuickPTR2+1
|
||||
inc ZPPtr2+1
|
||||
|
||||
.2 lda (ZPQuickPTR2) get pattern char
|
||||
.2 lda (ZPPtr2) get pattern char
|
||||
cmp #'*'
|
||||
beq .5
|
||||
|
||||
.3 tya we must match ? or regular char
|
||||
cmp (ZPQuickPTR1) check if at end of string
|
||||
cmp (ZPPtr1) check if at end of string
|
||||
beq .9 yes, no char left, exit with error
|
||||
|
||||
iny advance to next char to compare
|
||||
|
||||
lda (ZPQuickPTR2) get back pattern char
|
||||
lda (ZPPtr2) get back pattern char
|
||||
cmp #'?'
|
||||
beq .4 no need to compare, any char will match
|
||||
cmp (ZPQuickPTR1),y Regular Char, compare with string at Y
|
||||
cmp (ZPPtr1),y Regular Char, compare with string at Y
|
||||
bne .9 no match, exit
|
||||
|
||||
.4 dex char matched, check if end of pattern
|
||||
bne .1 continue if remaining char in pattern
|
||||
|
||||
tya end of pattern, but end of string ?
|
||||
cmp (ZPQuickPTR1) end of string ?
|
||||
cmp (ZPPtr1) end of string ?
|
||||
beq .8 yes, string matched entirely
|
||||
bra .9 no, remaining char in string, no match
|
||||
|
||||
.5 dex we have '*', last char of pattern ?
|
||||
beq .8 yes, match everything, including empty string
|
||||
|
||||
inc ZPQuickPTR2 Make PTR1 advance to next char
|
||||
inc ZPPtr2 Make PTR1 advance to next char
|
||||
bne .6
|
||||
inc ZPQuickPTR2+1
|
||||
inc ZPPtr2+1
|
||||
|
||||
.6 lda (ZPQuickPTR2) get next char of pattern
|
||||
.6 lda (ZPPtr2) get next char of pattern
|
||||
cmp #'*' another '*' ?
|
||||
beq .5 yes, '**' = '*', go next char
|
||||
cmp #'?' '*?' ??? we must match a least one char
|
||||
beq .3
|
||||
|
||||
.7 tya we need at least one remaining char in string,
|
||||
cmp (ZPQuickPTR1) check if at end of string
|
||||
cmp (ZPPtr1) check if at end of string
|
||||
beq .9 no chance to match ? or regular char
|
||||
|
||||
iny
|
||||
lda (ZPQuickPTR2) get again char in pattern
|
||||
cmp (ZPQuickPTR1),y compare with char in string
|
||||
lda (ZPPtr2) get again char in pattern
|
||||
cmp (ZPPtr1),y compare with char in string
|
||||
bne .7 not equal to next non wildcard in pattern
|
||||
|
||||
bra .4 go check remaining char in pattern...
|
||||
@ -178,21 +178,21 @@ K.PStrMatch jsr PullPtr1Ptr2
|
||||
K.PStrUprYA ldx #0
|
||||
.HS 2C bit abs
|
||||
K.PStrLwrYA ldx #2
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
|
||||
pha save Y,A to restore them at exit
|
||||
phy
|
||||
|
||||
lda (ZPQuickPtr1)
|
||||
lda (ZPPtr1)
|
||||
tay
|
||||
|
||||
.1 lda (ZPQuickPtr1),y
|
||||
.1 lda (ZPPtr1),y
|
||||
cmp K.PStrUprLwr,x
|
||||
bcc .2
|
||||
cmp K.PStrUprLwr+1,x
|
||||
bcs .2
|
||||
eor #$20
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
.2 dey
|
||||
bne .1
|
||||
|
||||
@ -229,12 +229,12 @@ K.PStrUprLwr .AS "azAZ"
|
||||
K.PStrFTime jsr PullPtr1Ptr2Ptr3
|
||||
|
||||
lda #0
|
||||
sta (ZPQuickPtr3) Reset target PSTR length
|
||||
sta (ZPPtr3) Reset target PSTR length
|
||||
|
||||
tay
|
||||
|
||||
.1 iny
|
||||
lda (ZPQuickPtr2),y
|
||||
lda (ZPPtr2),y
|
||||
cmp #'%'
|
||||
beq .2
|
||||
|
||||
@ -242,18 +242,18 @@ K.PStrFTime jsr PullPtr1Ptr2Ptr3
|
||||
jsr K.PStrFTime.addChar
|
||||
ply
|
||||
.10 tya
|
||||
cmp (ZPQuickPtr2)
|
||||
cmp (ZPPtr2)
|
||||
bne .1
|
||||
rts
|
||||
|
||||
.2 tya
|
||||
cmp (ZPQuickPtr2)
|
||||
cmp (ZPPtr2)
|
||||
beq .8
|
||||
|
||||
iny
|
||||
ldx #K.PStrFTime.JMPL-K.PStrFTime.Tbl-1
|
||||
|
||||
.3 lda (ZPQuickPtr2),y
|
||||
.3 lda (ZPPtr2),y
|
||||
cmp K.PStrFTime.Tbl,x
|
||||
beq .4
|
||||
dex
|
||||
@ -307,7 +307,7 @@ K.PStrFTime.A ldx #3 Short day of week, 3 chars...
|
||||
|
||||
K.PStrFTime.AA ldx #15 full DoW
|
||||
>LDYAI K.PStrFTime.DAY
|
||||
>STYA ZPQuickPtr4
|
||||
>STYA ZPPtr4
|
||||
ldy #S.Time.WDAY
|
||||
bra K.PStrFTime.STR
|
||||
|
||||
@ -316,31 +316,31 @@ K.PStrFTime.B ldx #3 Short Month, 3 chars....
|
||||
|
||||
K.PStrFTime.BB ldx #15 full Month....
|
||||
>LDYAI K.PStrFTime.MON
|
||||
>STYA ZPQuickPtr4
|
||||
>STYA ZPPtr4
|
||||
ldy #S.Time.MONTH
|
||||
|
||||
K.PStrFTime.STR lda (ZPQuickPtr1),y get required S.Time field value
|
||||
K.PStrFTime.STR lda (ZPPtr1),y get required S.Time field value
|
||||
tay
|
||||
beq .9 Illegal value
|
||||
|
||||
.1 dey range 0..x
|
||||
beq .2
|
||||
lda (ZPQuickPtr4)
|
||||
lda (ZPPtr4)
|
||||
sec
|
||||
adc ZPQuickPtr4
|
||||
sta ZPQuickPtr4
|
||||
adc ZPPtr4
|
||||
sta ZPPtr4
|
||||
bcc .1
|
||||
inc ZPQuickPtr4+1
|
||||
inc ZPPtr4+1
|
||||
bra .1
|
||||
|
||||
.2 ldy #0
|
||||
|
||||
.3 iny
|
||||
lda (ZPQuickPtr4),y
|
||||
lda (ZPPtr4),y
|
||||
phy
|
||||
jsr K.PStrFTime.addChar
|
||||
pla
|
||||
cmp (ZPQuickPtr4)
|
||||
cmp (ZPPtr4)
|
||||
beq .8
|
||||
|
||||
tay
|
||||
@ -360,7 +360,7 @@ K.PStrFTime.D ldy #S.Time.DAY
|
||||
K.PStrFTime.HH ldy #S.Time.HOUR
|
||||
bra K.PStrFTime.addDecPtr1Y
|
||||
K.PStrFTime.II ldy #S.Time.HOUR
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
cmp #12
|
||||
bcc .1
|
||||
sbc #12
|
||||
@ -370,7 +370,7 @@ K.PStrFTime.M ldy #S.Time.MONTH
|
||||
K.PStrFTime.MM ldy #S.Time.MINUTE
|
||||
bra K.PStrFTime.addDecPtr1Y
|
||||
K.PStrFTime.P ldy #S.Time.HOUR
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
cmp #12
|
||||
bcc .1
|
||||
lda #'p'
|
||||
@ -388,7 +388,7 @@ K.PStrFTime.YY ldy #S.Time.CENTURY
|
||||
K.PStrFTime.Y ldy #S.Time.YEAR
|
||||
*--------------------------------------
|
||||
K.PStrFTime.addDecPtr1Y
|
||||
lda (ZPQuickPtr1),y
|
||||
lda (ZPPtr1),y
|
||||
K.PStrFTime.addDecA
|
||||
sta K.PStrFTime.BIN
|
||||
stz K.PStrFTime.DEC
|
||||
@ -421,12 +421,12 @@ K.PStrFTime.addDecA
|
||||
*--------------------------------------
|
||||
K.PStrFTime.addChar
|
||||
pha
|
||||
lda (ZPQuickPtr3)
|
||||
lda (ZPPtr3)
|
||||
inc
|
||||
sta (ZPQuickPtr3)
|
||||
sta (ZPPtr3)
|
||||
tay
|
||||
pla
|
||||
sta (ZPQuickPtr3),y
|
||||
sta (ZPPtr3),y
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.PStrFTime.DAY >PSTR "Monday"
|
||||
@ -465,8 +465,8 @@ K.PStrFTime.DEC .BS 1 always < 100
|
||||
* A = SYS error code
|
||||
*\--------------------------------------
|
||||
K.PStr2StrArrayYA
|
||||
>STYA ZPQuickPtr1
|
||||
lda (ZPQuickPtr1) Get mem size STRLEN+1
|
||||
>STYA ZPPtr1
|
||||
lda (ZPPtr1) Get mem size STRLEN+1
|
||||
ldx #0
|
||||
inc
|
||||
bne .1
|
||||
@ -479,18 +479,18 @@ K.PStr2StrArrayYA
|
||||
phx save hMem
|
||||
phy save PTR.LO
|
||||
pha save PTR.HI
|
||||
>STYA ZPQuickPtr2
|
||||
>STYA ZPPtr2
|
||||
|
||||
lda (ZPQuickPtr1)
|
||||
lda (ZPPtr1)
|
||||
tax count in src string
|
||||
beq .8
|
||||
|
||||
ldy #0 reset index in dst token
|
||||
|
||||
.3 inc ZPQuickPtr1 get...
|
||||
.3 inc ZPPtr1 get...
|
||||
bne .4
|
||||
inc ZPQuickPtr1+1
|
||||
.4 lda (ZPQuickPtr1) ...next char
|
||||
inc ZPPtr1+1
|
||||
.4 lda (ZPPtr1) ...next char
|
||||
|
||||
cmp #' ' found a space ?
|
||||
bne .6
|
||||
@ -498,18 +498,18 @@ K.PStr2StrArrayYA
|
||||
tya in a token ?
|
||||
beq .7 no, skip & go to next char
|
||||
|
||||
sta (ZPQuickPtr2) yes, set this token len
|
||||
sta (ZPPtr2) yes, set this token len
|
||||
sec
|
||||
adc ZPQuickPtr2 advance to next token
|
||||
sta ZPQuickPtr2
|
||||
adc ZPPtr2 advance to next token
|
||||
sta ZPPtr2
|
||||
bcc .5
|
||||
inc ZPQuickPtr2+1
|
||||
inc ZPPtr2+1
|
||||
|
||||
.5 ldy #0 reset index in dst token
|
||||
bra .7
|
||||
|
||||
.6 iny add char to token
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
.7 dex end of src string?
|
||||
bne .3 no...next char...
|
||||
@ -517,15 +517,15 @@ K.PStr2StrArrayYA
|
||||
tya yes, are we in a token ?
|
||||
beq .8
|
||||
|
||||
sta (ZPQuickPtr2) yes, set last token len
|
||||
sta (ZPPtr2) yes, set last token len
|
||||
sec
|
||||
adc ZPQuickPtr2 advance to next token
|
||||
sta ZPQuickPtr2
|
||||
adc ZPPtr2 advance to next token
|
||||
sta ZPPtr2
|
||||
bcc .8
|
||||
inc ZPQuickPtr2+1
|
||||
inc ZPPtr2+1
|
||||
|
||||
.8 lda #0
|
||||
sta (ZPQuickPtr2) set Array Ending 0
|
||||
sta (ZPPtr2) set Array Ending 0
|
||||
|
||||
pla get back PTR.HI
|
||||
ply get back PTR.LO
|
||||
|
@ -18,10 +18,10 @@ DAY0 .EQ 4 day 0 was a thursday
|
||||
* Out :
|
||||
* S.TIME filled with System date/time
|
||||
*--------------------------------------
|
||||
K.TimeYA >STYA ZPQuickPtr2
|
||||
K.TimeYA >STYA ZPPtr2
|
||||
>MLICALL MLIGETTIME
|
||||
>LDYAI DATELO
|
||||
>STYA ZPQuickPtr1
|
||||
>STYA ZPPtr1
|
||||
bra K.PTime2Time.1
|
||||
*--------------------------------------
|
||||
* In :
|
||||
@ -31,13 +31,13 @@ K.TimeYA >STYA ZPQuickPtr2
|
||||
K.PTime2Time jsr PullPtr1Ptr2
|
||||
|
||||
K.PTime2Time.1 ldy #1
|
||||
lda (ZPQuickPtr1),y Get Year
|
||||
lda (ZPPtr1),y Get Year
|
||||
lsr C is high bit of month
|
||||
ldy #S.Time.YEAR
|
||||
sta (ZPQuickPtr2),y set year
|
||||
sta (ZPPtr2),y set year
|
||||
sta K.CTime.Year for conputing Century/WDAY later
|
||||
|
||||
lda (ZPQuickPtr1) Get Month/day
|
||||
lda (ZPPtr1) Get Month/day
|
||||
pha save Day
|
||||
ror
|
||||
lsr
|
||||
@ -45,12 +45,12 @@ K.PTime2Time.1 ldy #1
|
||||
lsr
|
||||
lsr
|
||||
ldy #S.Time.MONTH
|
||||
sta (ZPQuickPtr2),y set month
|
||||
sta (ZPPtr2),y set month
|
||||
|
||||
pla get back day
|
||||
and #$1F
|
||||
iny
|
||||
sta (ZPQuickPtr2),y set day
|
||||
sta (ZPPtr2),y set day
|
||||
|
||||
lda K.CTime.Year get back year
|
||||
|
||||
@ -59,23 +59,23 @@ K.PTime2Time.1 ldy #1
|
||||
rol get back C in bit 0
|
||||
eor #1 toggle C
|
||||
adc #19 set date before 1970 -> 20xx
|
||||
sta (ZPQuickPtr2) set Century
|
||||
sta (ZPPtr2) set Century
|
||||
sta K.CTime.Century for conputing WDAY later
|
||||
|
||||
ldy #2
|
||||
lda (ZPQuickPtr1),y Get Min
|
||||
lda (ZPPtr1),y Get Min
|
||||
tax
|
||||
iny
|
||||
lda (ZPQuickPtr1),y Get Hour
|
||||
lda (ZPPtr1),y Get Hour
|
||||
|
||||
ldy #S.Time.HOUR
|
||||
sta (ZPQuickPtr2),y set hour
|
||||
sta (ZPPtr2),y set hour
|
||||
iny
|
||||
txa
|
||||
sta (ZPQuickPtr2),y set min
|
||||
sta (ZPPtr2),y set min
|
||||
iny
|
||||
lda #0
|
||||
sta (ZPQuickPtr2),y set seconds (ProDOS does not provide it)
|
||||
sta (ZPPtr2),y set seconds (ProDOS does not provide it)
|
||||
|
||||
* 1/1/1970 was Thursday...if not leap, add one, if leap add 2
|
||||
|
||||
@ -117,7 +117,7 @@ K.ComputeWDAY lda #3 Thursday : 4 (-1 for mod 7)
|
||||
bra .1
|
||||
|
||||
.4 ldy #S.Time.MONTH
|
||||
lda (ZPQuickPtr2),y get month
|
||||
lda (ZPPtr2),y get month
|
||||
tax
|
||||
|
||||
.5 lda K.StrFTime.MDAY-1,x get day count in this month
|
||||
@ -144,7 +144,7 @@ K.ComputeWDAY lda #3 Thursday : 4 (-1 for mod 7)
|
||||
pla
|
||||
|
||||
ldy #S.Time.DAY
|
||||
adc (ZPQuickPtr2),y get month (1..31)
|
||||
adc (ZPPtr2),y get month (1..31)
|
||||
dec adjust range 0.31 for MOD 7
|
||||
|
||||
.8 cmp #7 MOD 7
|
||||
@ -154,7 +154,7 @@ K.ComputeWDAY lda #3 Thursday : 4 (-1 for mod 7)
|
||||
|
||||
.80 inc adjust range 1..7
|
||||
ldy #S.Time.WDAY
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
clc
|
||||
rts
|
||||
@ -168,7 +168,7 @@ K.CTime2Time jsr PullPtr1Ptr2
|
||||
|
||||
ldy #3
|
||||
|
||||
.1 lda (ZPQuickPtr1),y
|
||||
.1 lda (ZPPtr1),y
|
||||
sta K.CTime.DWORD,y
|
||||
dey
|
||||
bpl .1
|
||||
@ -245,7 +245,7 @@ K.CTime2Time jsr PullPtr1Ptr2
|
||||
pla
|
||||
lda K.CTime.Mod
|
||||
ldy #S.Time.SECOND
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
stz K.CTime.Div3600
|
||||
|
||||
@ -272,11 +272,11 @@ K.CTime2Time jsr PullPtr1Ptr2
|
||||
|
||||
lda K.CTime.Mod
|
||||
dey ldy #S.Time.MINUTE
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
lda K.CTime.Div3600
|
||||
dey ldy #S.Time.HOUR
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
lda K.CTime.DivDay WDAY computation : (DivDay + DAY0) mod 7
|
||||
clc
|
||||
@ -297,7 +297,7 @@ K.CTime2Time jsr PullPtr1Ptr2
|
||||
|
||||
lda K.CTime.Mod
|
||||
ldy #S.Time.WDAY
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
lda #CENTURY0
|
||||
sta K.CTime.Century
|
||||
@ -330,10 +330,10 @@ K.CTime2Time.Year
|
||||
.2 pla
|
||||
lda K.CTime.Century
|
||||
* ldy #S.Time.CENTURY
|
||||
sta (ZPQuickPtr2)
|
||||
sta (ZPPtr2)
|
||||
ldy #S.Time.YEAR
|
||||
lda K.CTime.Year
|
||||
sta (ZPQuickPtr2),y
|
||||
sta (ZPPtr2),y
|
||||
|
||||
clc
|
||||
rts
|
||||
|
@ -10,10 +10,10 @@ AUTO 6
|
||||
TSK.TskMgrRun >LDYAI TskMgr.Table+S.PS skip PS 0
|
||||
>STYA pPs
|
||||
|
||||
lda TSKMGR.SIZE
|
||||
sta TSKMGR.COUNT
|
||||
lda TskMgr.Count
|
||||
sta TskMgr.Idx
|
||||
|
||||
.1 dec TSKMGR.COUNT skip PS 0
|
||||
.1 dec TskMgr.Idx skip PS 0
|
||||
beq .8
|
||||
|
||||
lda (pPs) get S.PS.F
|
||||
@ -58,16 +58,16 @@ TSK.TskMgrRun >LDYAI TskMgr.Table+S.PS skip PS 0
|
||||
pha save RC
|
||||
ldy #S.PS.PPID Notify Parent Process for exit code...
|
||||
lda (pPs),y
|
||||
jsr K.GetPSByIDA will set ZPQuickPtr1 if success
|
||||
jsr K.GetPSByIDA will set ZPPtr1 if success
|
||||
bcs .5 parent is dead.....skipping...
|
||||
|
||||
lda (ZPQuickPtr1) Parent PS is HOLD?
|
||||
lda (ZPPtr1) Parent PS is HOLD?
|
||||
and #S.PS.F.HOLD
|
||||
beq .5 no...
|
||||
|
||||
pla yes, probably waiting for this PS to terminate....
|
||||
ldy #S.PS.RC
|
||||
sta (ZPQuickPtr1),y
|
||||
sta (ZPPtr1),y
|
||||
|
||||
.HS B0 BCS
|
||||
.5 pla
|
||||
@ -115,10 +115,10 @@ TSK.DispatchEvents
|
||||
>LDYAI TskMgr.Table+S.PS
|
||||
>STYA pPs
|
||||
|
||||
lda TSKMGR.SIZE Number of actual processes...
|
||||
sta TSKMGR.COUNT ...to give event list
|
||||
lda TskMgr.Count Number of actual processes...
|
||||
sta TskMgr.Idx ...to give event list
|
||||
|
||||
.1 dec TSKMGR.COUNT skip PS 0
|
||||
.1 dec TskMgr.Idx skip PS 0
|
||||
beq .9
|
||||
|
||||
lda (pPs) get S.PS.F
|
||||
@ -181,7 +181,7 @@ TSK.DispatchEvents
|
||||
TSK.TskMgrQuit clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
TSKMGR.COUNT .BS 1
|
||||
TskMgr.Idx .BS 1
|
||||
TSKMGR.EVENTCNT .BS 1
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -1,6 +1,6 @@
|
||||
PR#3
|
||||
PREFIX /A2OSX.SRC
|
||||
NEW
|
||||
LOMEM $A00
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
@ -14,10 +14,10 @@ AUTO 6
|
||||
.INB /A2OSX.DEV/INC/PRODOS.I
|
||||
*--------------------------------------
|
||||
TmpPtr1 .EQ $0 for X.PRINTF.S
|
||||
ZPQuickPtr1 .EQ ZPKERNEL Temp Ptrs for use in very limited scope
|
||||
ZPQuickPtr2 .EQ ZPKERNEL+2 (could be trashed by any JSR)
|
||||
ZPQuickPtr3 .EQ ZPKERNEL+4
|
||||
ZPQuickPtr4 .EQ ZPKERNEL+6
|
||||
ZPPtr1 .EQ ZPKERNEL Temp Ptrs for use in very limited scope
|
||||
ZPPtr2 .EQ ZPKERNEL+2 (could be trashed by any JSR)
|
||||
ZPPtr3 .EQ ZPKERNEL+4
|
||||
ZPPtr4 .EQ ZPKERNEL+6
|
||||
*--------------------------------------
|
||||
* Kernel Init Stage 2
|
||||
*--------------------------------------
|
||||
@ -93,21 +93,22 @@ A2osX.D002.END .EQ *
|
||||
*--------------------------------------
|
||||
* LC AUX $E000 API Calls $80-$FE
|
||||
*--------------------------------------
|
||||
A2osX.E000 .EQ *
|
||||
A2osX.E000 .EQ *
|
||||
.PH $E000
|
||||
.INB SYS/KERNEL.S.JMP
|
||||
.INB SYS/KERNEL.S.DAT
|
||||
.INB SYS/KERNEL.S.IRQ
|
||||
.INB SYS/KERNEL.S.MEM
|
||||
.INB SYS/KERNEL.S.CHR
|
||||
*--------------------------------------
|
||||
PullPtr1Ptr2Ptr3
|
||||
sec
|
||||
.HS 90 bcc
|
||||
PullPtr1Ptr2 clc
|
||||
>PULLW ZPQuickPtr1
|
||||
>PULLW ZPQuickPtr2
|
||||
>PULLW ZPPtr1
|
||||
>PULLW ZPPtr2
|
||||
bcc .9
|
||||
>PULLW ZPQuickPtr3
|
||||
>PULLW ZPPtr3
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
* Make sure KERNEL.S.D01 is the last one
|
||||
@ -128,17 +129,17 @@ A2osX.E000.SIZE .EQ A2osX.E000.END-A2osX.E000
|
||||
.LIST OFF
|
||||
.DO A2osX.GP.SIZE>$1E0
|
||||
.LIST ON
|
||||
* !!!!!!!!!!!!! ERROR:GP too big !!!!!!!!!!!!
|
||||
* !!!!!!!!! ERROR:GP too big !!!!!!!!!!
|
||||
.LIST OFF
|
||||
.FIN
|
||||
.DO A2osX.D001.SIZE>$1000
|
||||
.LIST ON
|
||||
* !!!!!!!!!!!!! ERROR:BNK1 too big !!!!!!!!!!
|
||||
* !!!!!!!!! ERROR:BNK1 too big !!!!!!!!
|
||||
.LIST OFF
|
||||
.FIN
|
||||
.DO A2osX.D002.SIZE>$1000
|
||||
.LIST ON
|
||||
* !!!!!!!!!!!!! ERROR:BNK2 too big !!!!!!!!!!
|
||||
* !!!!!!!!! ERROR:BNK2 too big !!!!!!!!
|
||||
.LIST OFF
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
|
@ -237,9 +237,19 @@ DRV .EQ *
|
||||
cld
|
||||
DRV.Slotn0 ldx #$ff Self Modified
|
||||
lda DRV.COMMAND S=0,R=1,W=2,F=3
|
||||
beq .8 Status
|
||||
cmp #3
|
||||
beq .81 Format ....
|
||||
bne .1
|
||||
|
||||
ldx #$ff return Status
|
||||
ldy #$ff
|
||||
.8 lda #0
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #MLI.ERR.IO
|
||||
rts
|
||||
|
||||
.1 cmp #3
|
||||
beq .8 Format ....
|
||||
bcs .9 more....IO error
|
||||
|
||||
ora #2 W=2,R=3
|
||||
@ -247,19 +257,7 @@ DRV.Slotn0 ldx #$ff Self Modified
|
||||
bpl .1
|
||||
adc #2 CC from bcs .9
|
||||
|
||||
.1 jsr DRV.DO.CMD
|
||||
bcs .9
|
||||
|
||||
.8 ldx #$ff return Status
|
||||
ldy #$ff
|
||||
.81 lda #0
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #MLI.ERR.IO
|
||||
rts
|
||||
*--------------------------------------
|
||||
DRV.DO.CMD sta DRV.CmdBuf.Cmd store cmd
|
||||
sta DRV.CmdBuf.Cmd store cmd
|
||||
eor #VS.CMD
|
||||
eor DRV.BLKNUM
|
||||
eor DRV.BLKNUM+1
|
||||
@ -280,103 +278,89 @@ DRV.DO.CMD sta DRV.CmdBuf.Cmd store cmd
|
||||
* send CMD+CS
|
||||
ldy #4 Send 5 bytes including Sum
|
||||
|
||||
.1 lda DRV.CmdBuf.Sum,y
|
||||
.2 lda DRV.CmdBuf.Sum,y
|
||||
jsr DRV.SSCSend
|
||||
bcs .9
|
||||
dey
|
||||
bpl .1
|
||||
bpl .2
|
||||
* read back CMD
|
||||
ldy #3 Read Back and check 4 bytes
|
||||
|
||||
.2 jsr DRV.SSCGet
|
||||
bcs .9
|
||||
cmp DRV.CmdBuf.BlkHi,y
|
||||
bne .9
|
||||
.3 jsr DRV.SSCGet
|
||||
eor DRV.CmdBuf.BlkHi,y
|
||||
bne DRV.DO.CMD.ERR
|
||||
dey
|
||||
bpl .2
|
||||
bpl .3
|
||||
|
||||
* Get ProDOS Date/time send from server if READ (3 or 5)
|
||||
|
||||
lda DRV.COMMAND
|
||||
dec 1-1=0 if read
|
||||
bne .6 go write
|
||||
|
||||
bne DRV.DO.CMD.W go write
|
||||
*--------------------------------------
|
||||
* Read block : Discard ProDOS time recieved from Server (4 bytes)
|
||||
|
||||
ldy #4 Read 4 bytes
|
||||
*--------------------------------------
|
||||
DRV.DO.CMD.R ldy #4 Read 4 bytes
|
||||
|
||||
.3 jsr DRV.SSCGet
|
||||
bcs .9
|
||||
.1 jsr DRV.SSCGet
|
||||
|
||||
eor DRV.CmdBuf.Sum
|
||||
sta DRV.CmdBuf.Sum
|
||||
dey
|
||||
bne .3
|
||||
bne .1
|
||||
|
||||
* recieve Header Sum and check
|
||||
|
||||
jsr DRV.SSCGet
|
||||
bcs .9
|
||||
eor DRV.CmdBuf.Sum
|
||||
bne .9
|
||||
bne DRV.DO.CMD.ERR
|
||||
|
||||
* tay Y=0 from dey/bne
|
||||
|
||||
.4 jsr DRV.SSCGet
|
||||
bcs .9
|
||||
.2 jsr DRV.SSCGet
|
||||
sta (DRV.BUFF),y
|
||||
iny
|
||||
bne .4
|
||||
bne .2
|
||||
|
||||
.5 jsr DRV.SSCGet
|
||||
bcs .9
|
||||
.3 jsr DRV.SSCGet
|
||||
sta (DRV.A1L),y
|
||||
iny
|
||||
bne .5
|
||||
bne .3
|
||||
|
||||
jsr DRV.BufCheckSum
|
||||
sta DRV.CmdBuf.Sum
|
||||
jsr DRV.SSCGet
|
||||
bcs .9
|
||||
|
||||
eor DRV.CmdBuf.Sum
|
||||
bne .9
|
||||
rts A=0,CC from bcs .9
|
||||
|
||||
* Write Block
|
||||
.6 ldy #0
|
||||
|
||||
.7 lda (DRV.BUFF),y
|
||||
jsr DRV.SSCSend
|
||||
bcs .9
|
||||
iny
|
||||
bne .7
|
||||
bne DRV.DO.CMD.ERR
|
||||
.9 rts A=0,CC from bcs .9
|
||||
|
||||
.8 lda (DRV.A1L),y
|
||||
DRV.DO.CMD.ERR sec
|
||||
DRV.DO.CMD.RTS rts
|
||||
*--------------------------------------
|
||||
* Write Block
|
||||
*--------------------------------------
|
||||
DRV.DO.CMD.W ldy #0
|
||||
|
||||
.1 lda (DRV.BUFF),y
|
||||
jsr DRV.SSCSend
|
||||
bcs .9
|
||||
iny
|
||||
bne .8
|
||||
bne .1
|
||||
|
||||
.2 lda (DRV.A1L),y
|
||||
jsr DRV.SSCSend
|
||||
iny
|
||||
bne .2
|
||||
|
||||
jsr DRV.BufCheckSum
|
||||
sta DRV.CmdBuf.Sum Save Block CheckSum for comparing later
|
||||
jsr DRV.SSCSend
|
||||
bcs .9
|
||||
|
||||
ldy #4 Read 5 bytes (echo from server)
|
||||
|
||||
.81 jsr DRV.SSCGet
|
||||
bcs .9
|
||||
.3 jsr DRV.SSCGet
|
||||
|
||||
eor DRV.CmdBuf.Sum,y Check 5 bytes (including block Sum)
|
||||
bne .9
|
||||
bne DRV.DO.CMD.ERR
|
||||
dey
|
||||
bpl .81
|
||||
|
||||
rts
|
||||
|
||||
.9
|
||||
DRV.CS sec
|
||||
bpl .3
|
||||
rts
|
||||
*--------------------------------------
|
||||
DRV.CmdBuf.Sum .BS 1 Reverse order for dey
|
||||
@ -389,37 +373,42 @@ DRV.BufCheckSum lda #0
|
||||
tay
|
||||
|
||||
.1 eor (DRV.BUFF),y
|
||||
eor (DRV.A2L),y
|
||||
eor (DRV.A1L),y
|
||||
iny
|
||||
bne .1
|
||||
sta DRV.CmdBuf.Sum
|
||||
rts
|
||||
*--------------------------------------
|
||||
DRV.SSCSend sta .2+1
|
||||
|
||||
.1 lda SSC.STATUS,x
|
||||
bit #SSC.STATUS.DCD+SSC.STATUS.DSR
|
||||
beq DRV.CS
|
||||
|
||||
beq DRV.IOERR
|
||||
|
||||
and #SSC.STATUS.TDRE Outgoing char?
|
||||
beq .1
|
||||
|
||||
.2 lda #$ff
|
||||
sta SSC.DATA,x
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
DRV.SSCGet
|
||||
.1 lda SSC.STATUS,x
|
||||
DRV.SSCGet lda SSC.STATUS,x
|
||||
bit #SSC.STATUS.DCD+SSC.STATUS.DSR
|
||||
beq DRV.CS
|
||||
beq DRV.IOERR
|
||||
|
||||
and #SSC.STATUS.RDRF incoming char?
|
||||
beq .1
|
||||
beq DRV.SSCGet
|
||||
|
||||
lda SSC.DATA,x
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
*--------------------------------------
|
||||
DRV.IOERR pla
|
||||
pla
|
||||
lda #MLI.ERR.IO
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
.EP
|
||||
*--------------------------------------
|
||||
.LIST ON
|
||||
|
@ -19,6 +19,64 @@ Returns argument count in the process command line.
|
||||
+ Y,A = PStr To Arg[A]
|
||||
+ CS : Out Of Bound
|
||||
|
||||
#FPutCAY
|
||||
Print A (char) to File
|
||||
|
||||
##In:
|
||||
+ A : char to print
|
||||
+ Y = hFILE
|
||||
|
||||
##Out:
|
||||
+ CC = success
|
||||
|
||||
#PutCA
|
||||
Print A (char) to StdOut
|
||||
|
||||
##In:
|
||||
+ A : char to print
|
||||
|
||||
##Out:
|
||||
+ CC = success
|
||||
|
||||
#FGetCA
|
||||
Get char from File
|
||||
|
||||
##In:
|
||||
+ A = hFILE
|
||||
|
||||
##Out:
|
||||
+ CC = success
|
||||
+ A = char
|
||||
|
||||
#GetC
|
||||
Get char from StdIn
|
||||
|
||||
##In:
|
||||
+ none.
|
||||
|
||||
##Out:
|
||||
+ CC = success
|
||||
+ A = char
|
||||
|
||||
#FPutCS
|
||||
Print String to FILE
|
||||
|
||||
##In:
|
||||
+ PUSHW : CPtr
|
||||
+ PUSHB : hFILE
|
||||
|
||||
##Out:
|
||||
+ CC = success
|
||||
|
||||
#PutCSYA
|
||||
Print String to StdOut
|
||||
|
||||
##In:
|
||||
+ Y,A : CPtr
|
||||
|
||||
##Out:
|
||||
+ CC = success
|
||||
|
||||
#SScanF
|
||||
Scan a PStr (in progress)
|
||||
|
||||
@ -70,27 +128,6 @@ Prints Pascal/C-Style String
|
||||
+ CC : success
|
||||
+ CS : I/O error from COut
|
||||
|
||||
#FPutCAY
|
||||
Print A (char) to File
|
||||
|
||||
##In:
|
||||
+ A : char to print
|
||||
+ Y = hFILE
|
||||
+ none.
|
||||
|
||||
##Out:
|
||||
+ CC = success
|
||||
|
||||
#PutCA
|
||||
Print A (char) to StdOut
|
||||
|
||||
##In:
|
||||
+ A : char to print
|
||||
+ none.
|
||||
|
||||
##Out:
|
||||
+ CC = success
|
||||
|
||||
#GetDevByIDA
|
||||
|
||||
##IN:
|
||||
@ -101,7 +138,7 @@ Print A (char) to StdOut
|
||||
+ Y,A = DEVSLOT
|
||||
+ note: X Unmodified
|
||||
|
||||
#GetDevIDByNameYA
|
||||
#GetDevByNameYA
|
||||
|
||||
##IN:
|
||||
+ Y,A = Ptr to device name (PStr)
|
||||
@ -111,7 +148,7 @@ Print A (char) to StdOut
|
||||
+ X = DEVID
|
||||
+ Y,A = DEVSLOT
|
||||
|
||||
#GetDevInfoA
|
||||
#GetDevStatusA
|
||||
|
||||
##IN:
|
||||
+ A = DevID
|
||||
@ -121,7 +158,7 @@ Print A (char) to StdOut
|
||||
+ Y,A = Ptr to S.DEVINFO
|
||||
|
||||
#MkNodYA
|
||||
return a S.FILE from a given Device
|
||||
return a S.FILE for a given Device NAME
|
||||
|
||||
##IN:
|
||||
+ Y,A=DevName
|
||||
@ -228,11 +265,11 @@ Open a file
|
||||
+ PUSHW = AUXTYPE
|
||||
+ PUSHB = TYPE
|
||||
+ PUSHB = MODE
|
||||
+ SYS.FOPEN.R : if R and exists -> ERROR
|
||||
+ SYS.FOPEN.W : if W and exists -> CREATE
|
||||
+ SYS.FOPEN.A : Append
|
||||
+ SYS.FOPEN.T : Open/Append in Text mode
|
||||
+ SYS.FOPEN.X : Create if not exists
|
||||
+ SYS.FOpen.R : if R and exists -> ERROR
|
||||
+ SYS.FOpen.W : if W and exists -> CREATE
|
||||
+ SYS.FOpen.A : Append
|
||||
+ SYS.FOpen.T : Open/Append in Text mode
|
||||
+ SYS.FOpen.X : Create if not exists
|
||||
+ PUSHW = PATH (PSTR)
|
||||
|
||||
##Out :
|
||||
@ -369,7 +406,7 @@ And return, if found, the full path to it.
|
||||
+ PUSHW = AUXTYPE (Handled by....
|
||||
+ PUSHB = TYPE ...
|
||||
+ PUSHB = MODE ...
|
||||
+ PUSHW = PATH ...FOPEN)
|
||||
+ PUSHW = PATH ...FOpen)
|
||||
|
||||
##Out:
|
||||
+ Y,A = File Length
|
||||
@ -383,7 +420,7 @@ And return, if found, the full path to it.
|
||||
+ PUSHW = AUXTYPE (Handled by....
|
||||
+ PUSHB = TYPE ...
|
||||
+ PUSHB = MODE ...
|
||||
+ PUSHW = PATH ...FOPEN)
|
||||
+ PUSHW = PATH ...FOpen)
|
||||
|
||||
#GetMem
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user