KMs & PMs Cleanup

This commit is contained in:
burniouf 2022-03-13 13:52:24 +01:00
parent 3e95bd27d7
commit cec2764d5c
26 changed files with 1637 additions and 1166 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -19,6 +19,7 @@ A2osX.QC.ROOT .BS 64
A2osX.QC.Start1 sei A2osX.QC.Start1 sei
ldx #$FF ldx #$FF
txs txs
cli cli
bit RROMBNK1 bit RROMBNK1
>LDYAI A2osX.QC >LDYAI A2osX.QC
@ -271,6 +272,6 @@ QC.FREE .EQ $1300-*
.EP .EP
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/A2OSX.S.QC SAVE usr/src/a2osx.s.qc
LOAD USR/SRC/A2OSX.S LOAD usr/src/a2osx.s
ASM ASM

View File

@ -17,15 +17,16 @@ NEW
TmpPtr1 .EQ $0 main & aux ZP TmpPtr1 .EQ $0 main & aux ZP
TmpPtr2 .EQ $2 main & aux ZP TmpPtr2 .EQ $2 main & aux ZP
*-------------------------------------- *--------------------------------------
A2osX.KMLOAD .EQ $2000 A2osX.PMLOAD .EQ $2000
A2osX.LOGOLOAD .EQ $4000 A2osX.LOGOLOAD .EQ $4000
A2osX.KMMAXLEN .EQ $6000 A2osX.PMMAXLEN .EQ $6000
A2osX.OpenBuff1 .EQ $8000 1024 Buffer for MLIOPEN01 A2osX.OpenBuff1 .EQ $8000 1024 Buffer for MLIOPEN01
A2osX.OpenBuff2 .EQ $8400 1024 Buffer for MLIOPEN02 A2osX.OpenBuff2 .EQ $8400 1024 Buffer for MLIOPEN02
A2osX.ReadBuff .EQ $8800 512 Buffer for MLIREAD01 A2osX.ReadBuff .EQ $8800 512 Buffer for MLIREAD01
Boot.Prefix .EQ $8A00 MLI.MAXPATH Boot.Prefix .EQ $8A00 MLI.MAXPATH
LOGO.Filename .EQ $8A80 MLI.MAXPATH Logo.Filename .EQ $8A80 MLI.MAXPATH
KM.Filename .EQ $8B00 MLI.MAXPATH Sys.Prefix .EQ $8B00 MLI.MAXPATH
PM.Filename .EQ $8B80 MLI.MAXPATH
MLIONLINE01BUF .EQ $8C00 256 MLIONLINE01BUF .EQ $8C00 256
*-------------------------------------- *--------------------------------------
* Kernel Stage 0 * Kernel Stage 0
@ -37,12 +38,14 @@ A2osX.Init0 >LDYAI $2000
>LDYAI $1000 >LDYAI $1000
>STYA TmpPtr2 >STYA TmpPtr2
ldx #$10 reloc $2000-$2FFF to $1000-$1FFF ldx /SYSTEM.END-$1F00
ldy #0 ldy #0
.1 lda (TmpPtr1),y .1 lda (TmpPtr1),y
sta (TmpPtr2),y sta (TmpPtr2),y
iny iny
bne .1 bne .1
inc TmpPtr1+1 inc TmpPtr1+1
inc TmpPtr2+1 inc TmpPtr2+1
dex dex
@ -76,6 +79,9 @@ A2osX.Init1.128 jsr MLI
ldx Boot.Prefix ldx Boot.Prefix
.1 lda Boot.Prefix,x .1 lda Boot.Prefix,x
sta Logo.Filename,x
sta Sys.Prefix,x
sta PM.Filename,x
sta A2osX.QC.B.BOOT,x sta A2osX.QC.B.BOOT,x
sta A2osX.QC.B.ROOT,x sta A2osX.QC.B.ROOT,x
dex dex
@ -140,15 +146,11 @@ A2osX.RamDrv >LDYAI MSG.RAMDRV
.8 jsr PrintFYA .8 jsr PrintFYA
*-------------------------------------- *--------------------------------------
A2osX.EnumKM >LDYAI MSG.KMENUM
jsr PrintFYA
jsr EnumKM
*--------------------------------------
A2osX.SetupQC lda RRAMWRAMBNK2 A2osX.SetupQC lda RRAMWRAMBNK2
lda RRAMWRAMBNK2 lda RRAMWRAMBNK2
ldx #0 ldx #0
.1 lda A2osX.QC.B.Start,x .1 lda A2osX.QC.B.Start,x Still at $2xxx !!! not moved to $1xxx
sta $D100,x sta $D100,x
lda A2osX.QC.B.Start+$100,x lda A2osX.QC.B.Start+$100,x
sta $D200,x sta $D200,x
@ -159,6 +161,10 @@ A2osX.SetupQC lda RRAMWRAMBNK2
lda RROMBNK1 lda RROMBNK1
*-------------------------------------- *--------------------------------------
A2osX.EnumPM >LDYAI MSG.PMENUM do this After SetupQC, a PM could override QC
jsr PrintFYA
jsr EnumPM
*--------------------------------------
A2osX.MLIQuit >LDYAI MSG.INIT0OK A2osX.MLIQuit >LDYAI MSG.INIT0OK
jsr PrintFYA jsr PrintFYA
>DEBUGOA >DEBUGOA
@ -174,23 +180,16 @@ A2osX.Screen80 lda #$8C Reset 80 col screen ($0C:HOME)
jsr $C300 jsr $C300
ldx Boot.Prefix ldx Boot.Prefix
.1 lda Boot.Prefix,x
sta LOGO.Filename,x
dex
bne .1
ldx Boot.Prefix
ldy #0 ldy #0
.2 inx .2 inx
iny iny
lda A2osX.LOGO,y lda A2osX.LOGO,y
sta LOGO.Filename,x sta Logo.Filename,x
cpy A2osX.LOGO cpy A2osX.LOGO
bne .2 bne .2
stx LOGO.Filename stx Logo.Filename
jsr MLI jsr MLI
.DA #MLIOPEN .DA #MLIOPEN
.DA MLIOPEN00 .DA MLIOPEN00
@ -387,34 +386,42 @@ DisableRamDRV php
sec sec
rts rts
*-------------------------------------- *--------------------------------------
EnumKM.EPB .EQ $0D EnumPM.EPB .EQ $0D
EnumKM.EL .EQ $27 EnumPM.EL .EQ $27
*-------------------------------------- *--------------------------------------
EnumKM ldx #0 EnumPM ldx #0
ldy Boot.Prefix ldy Boot.Prefix
.1 inx .1 inx
lda SYS,x lda SYS,x
sta Boot.Prefix+1,y sta Sys.Prefix+1,y
sta PM.Filename+1,y
iny iny
cpx SYS cpx SYS
bne .1 bne .1
sty Boot.Prefix sty Sys.Prefix
lda #Boot.Prefix sty PM.Filename
lda #Sys.Prefix
pha pha
lda /Boot.Prefix lda /Sys.Prefix
pha pha
>LDYAI MSG.KMSYSDIR >LDYAI MSG.PMSYSDIR
jsr PrintFYA jsr PrintFYA
jsr MLI
.DA #MLISETPREFIX
.DA MLISETPREFIX02
bcs .19
jsr MLI jsr MLI
.DA #MLIOPEN .DA #MLIOPEN
.DA MLIOPEN01 .DA MLIOPEN01
bcc .10 bcc .10
pha .19 pha
>LDYAI MSG.KMSYSDIR.KO >LDYAI MSG.PMSYSDIR.KO
jsr PrintFYA jsr PrintFYA
sec sec
rts rts
@ -428,13 +435,13 @@ EnumKM ldx #0
.DA MLIREAD01 .DA MLIREAD01
bcs .98 bcs .98
lda #EnumKM.EPB lda #EnumPM.EPB
sta EnumKM.EC sta EnumPM.EC
>LDYAI A2osX.ReadBuff+4 >LDYAI A2osX.ReadBuff+4
>STYA EnumKM.BPTR >STYA EnumPM.BPTR
.3 >LDYA EnumKM.BPTR .3 >LDYA EnumPM.BPTR
>STYA TmpPtr1 >STYA TmpPtr1
lda (TmpPtr1) lda (TmpPtr1)
@ -446,7 +453,7 @@ EnumKM ldx #0
lda (TmpPtr1) lda (TmpPtr1)
and #$0F and #$0F
cmp KM.PREFIX at least enough chars for KM.*? cmp PM. at least enough chars for PM.*?
bcc .5 no, skip bcc .5 no, skip
ldy #$10 file type ldy #$10 file type
@ -454,26 +461,26 @@ EnumKM ldx #0
cmp #$06 'BIN'? cmp #$06 'BIN'?
bne .5 skip bne .5 skip
ldy KM.PREFIX ldy PM.
.4 lda (TmpPtr1),y KM.* ? .4 lda (TmpPtr1),y PM.* ?
cmp KM.PREFIX,y cmp PM.,y
bne .5 bne .5
dey dey
bne .4 bne .4
jsr LoadKM jsr LoadPM
.5 lda EnumKM.BPTR .5 lda EnumPM.BPTR
clc clc
adc #EnumKM.EL adc #EnumPM.EL
sta EnumKM.BPTR sta EnumPM.BPTR
bcc .6 bcc .6
inc EnumKM.BPTR+1 inc EnumPM.BPTR+1
.6 dec EnumKM.EC .6 dec EnumPM.EC
bne .3 bne .3
bra .2 bra .2
@ -491,47 +498,46 @@ EnumKM ldx #0
.8 jsr MLI .8 jsr MLI
.DA #MLICLOSE .DA #MLICLOSE
.DA MLICLOSE01 .DA MLICLOSE01
rts bcs .99
*--------------------------------------
EnumKM.EC .BS 1
EnumKM.BPTR .BS 2
*--------------------------------------
LoadKM ldx Boot.Prefix
.1 lda Boot.Prefix,x jsr MLI
sta KM.Filename,x .DA #MLISETPREFIX
dex .DA MLISETPREFIX01
bne .1
.99 rts
ldy #$1c *--------------------------------------
EnumPM.EC .BS 1
EnumPM.BPTR .BS 2
*--------------------------------------
LoadPM ldy #$1c
lda (TmpPtr1),y lda (TmpPtr1),y
sta LoadKM.VERSION sta LoadPM.VERSION
iny iny
lda (TmpPtr1),y lda (TmpPtr1),y
sta LoadKM.MVERSION sta LoadPM.MVERSION
ldx Boot.Prefix ldx Sys.Prefix
lda (TmpPtr1) lda (TmpPtr1)
and #$0F and #$0F
tay tay
clc clc
adc Boot.Prefix adc sys.Prefix
sta KM.Filename sta PM.Filename
tax tax
.2 bit LoadKM.MVERSION .2 bit LoadPM.MVERSION
bpl .6 bpl .6
cpy #8 cpy #8
bcs .3 bcs .3
lda LoadKM.Bits,y lda LoadPM.Bits,y
bit LoadKM.MVERSION bit LoadPM.MVERSION
beq .6 beq .6
bra .4 bra .4
.3 lda LoadKM.Bits-8,y .3 lda LoadPM.Bits-8,y
bit LoadKM.VERSION bit LoadPM.VERSION
beq .6 beq .6
.4 lda (TmpPtr1),y .4 lda (TmpPtr1),y
@ -539,17 +545,17 @@ LoadKM ldx Boot.Prefix
.HS 2C BIT ABS .HS 2C BIT ABS
.6 lda (TmpPtr1),y .6 lda (TmpPtr1),y
sta KM.Filename,x sta PM.Filename,x
dex dex
dey dey
bne .2 bne .2
lda #KM.Filename lda #PM.Filename
pha pha
lda /KM.Filename lda /PM.Filename
pha pha
>LDYAI MSG.KMLOAD >LDYAI MSG.PMLOAD
jsr PrintFYA jsr PrintFYA
jsr MLI jsr MLI
@ -567,7 +573,7 @@ LoadKM ldx Boot.Prefix
bcs .98 bcs .98
jsr .9 jsr .9
jmp A2osX.KMLOAD jmp A2osX.PMLOAD
.98 pha .98 pha
jsr .9 jsr .9
@ -581,9 +587,9 @@ LoadKM ldx Boot.Prefix
.DA MLICLOSE02 .DA MLICLOSE02
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
LoadKM.VERSION .BS 1 LoadPM.VERSION .BS 1
LoadKM.MVERSION .BS 1 LoadPM.MVERSION .BS 1
LoadKM.Bits .HS 8040201008040201 LoadPM.Bits .HS 8040201008040201
*-------------------------------------- *--------------------------------------
.INB usr/src/shared/x.printf.s .INB usr/src/shared/x.printf.s
*-------------------------------------- *--------------------------------------
@ -599,26 +605,30 @@ MSG.CPU.KO .AZ "A2osX Requires At Least A 65C02 CPU.\n"
MSG.RAMDRV .AZ "Checking ProDOS RamDrive..." MSG.RAMDRV .AZ "Checking ProDOS RamDrive..."
MSG.RAMDRV.OK .AZ "Successfully Disabled.\n" MSG.RAMDRV.OK .AZ "Successfully Disabled.\n"
MSG.RAMDRV.KO0 .AZ "Not Detected.\n" MSG.RAMDRV.KO0 .AZ "Not Detected.\n"
MSG.RAMDRV.KO1 .AZ "Uninstall Failed !!!\n" MSG.RAMDRV.KO1 .AZ "Uninstall Failed.\n"
MSG.BOOTPREFIX .AZ "Boot Prefix:%S\n" MSG.BOOTPREFIX .AZ "Boot Prefix:%S\n"
MSG.KMENUM .AZ "Looking For Kernel Modules...\n" MSG.PMENUM .AZ "Looking For ProDOS Modules...\n"
MSG.KMSYSDIR .AZ "SYS dir is %S\n" MSG.PMSYSDIR .AZ "SYS dir is %S\n"
MSG.KMSYSDIR.KO .AZ "***Error : $%h\n" MSG.PMSYSDIR.KO .AZ "***Error : $%h\n"
MSG.KMLOAD .AZ "***Loading KM : %S\n" MSG.PMLOAD .AZ "***Loading PM : %S\n"
MSG.INIT0OK .AZ "A2osX[Stage0]:Complete.\n" MSG.INIT0OK .AZ "A2osX[Stage0]:Complete.\n"
*-------------------------------------- *--------------------------------------
MLIGETPREFIX01 .DA #1 MLIGETPREFIX01
MLISETPREFIX01 .DA #1
.DA Boot.Prefix .DA Boot.Prefix
*-------------------------------------- *--------------------------------------
MLISETPREFIX02 .DA #1
.DA Sys.Prefix
*--------------------------------------
MLIONLINE01 .DA #2 MLIONLINE01 .DA #2
* .DA #0 * .DA #0
.DA #$B0 S3D2 .DA #$B0 S3D2
.DA MLIONLINE01BUF .DA MLIONLINE01BUF
*-------------------------------------- *--------------------------------------
MLIOPEN00 .DA #3 For DIR listing MLIOPEN00 .DA #3 For DIR listing
.DA LOGO.Filename .DA Logo.Filename
.DA A2osX.OpenBuff1 .DA A2osX.OpenBuff1
.BS 1 .BS 1
MLIREAD00 .DA #4 MLIREAD00 .DA #4
@ -630,7 +640,7 @@ MLICLOSE00 .DA #1
.BS 1 .BS 1
*-------------------------------------- *--------------------------------------
MLIOPEN01 .DA #3 For DIR listing MLIOPEN01 .DA #3 For DIR listing
.DA Boot.Prefix .DA Sys.Prefix
.DA A2osX.OpenBuff1 .DA A2osX.OpenBuff1
.BS 1 .BS 1
MLIREAD01 .DA #4 MLIREAD01 .DA #4
@ -642,13 +652,13 @@ MLICLOSE01 .DA #1
.BS 1 .BS 1
*-------------------------------------- *--------------------------------------
MLIOPEN02 .DA #3 MLIOPEN02 .DA #3
.DA KM.Filename .DA PM.Filename
.DA A2osX.OpenBuff2 .DA A2osX.OpenBuff2
.BS 1 .BS 1
MLIREAD02 .DA #4 MLIREAD02 .DA #4
.BS 1 .BS 1
.DA A2osX.KMLOAD Load address for KMs .DA A2osX.PMLOAD Load address for PMs
.DA A2osX.KMMAXLEN Maxlen of KM .DA A2osX.PMMAXLEN Maxlen of PM
.BS 2 .BS 2
MLICLOSE02 .DA #1 MLICLOSE02 .DA #1
.BS 1 .BS 1
@ -661,7 +671,7 @@ MLIQUIT01 .DA #4
*-------------------------------------- *--------------------------------------
A2osX.LOGO >PSTR "A2osX.logo" A2osX.LOGO >PSTR "A2osX.logo"
SYS >PSTR "sys/" SYS >PSTR "sys/"
KM.PREFIX >PSTR "KM." PM. >PSTR "PM."
*-------------------------------------- *--------------------------------------
SCR.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0 SCR.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
SCR.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07 SCR.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07
@ -672,15 +682,16 @@ PALETTE.AUX .HS 00.01.02.03.04.05.06.07
.HS 08.09.0A.0B.0C.0D.0E.0F .HS 08.09.0A.0B.0C.0D.0E.0F
*-------------------------------------- *--------------------------------------
.EP .EP
.LIST ON
SYSTEM.END .EQ *
.LIST OFF
*-------------------------------------- *--------------------------------------
A2osX.QC.B.Start A2osX.QC.B.Start
A2osX.QC.B.BOOT .EQ *+4 A2osX.QC.B.BOOT .EQ *+4
A2osX.QC.B.ROOT .EQ *+4+64 A2osX.QC.B.ROOT .EQ *+4+64
.INB usr/src/a2osx.s.qc .INB usr/src/a2osx.s.qc
.LIST ON
SYSTEM.END .EQ *
.LIST OFF
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/A2OSX.S SAVE usr/src/a2osx.s
ASM ASM

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,10 @@
NEW NEW
AUTO 3,1 AUTO 3,1
*--------------------------------------
.LIST ON
BS.FREESPACE .EQ $B861-*
.BS BS.FREESPACE
.LIST OFF
*-------------------------------------- *--------------------------------------
BS.SYSIOVECTS .DA BS.IO.OUT BS.SYSIOVECTS .DA BS.IO.OUT
.DA BS.IO.IN .DA BS.IO.IN
@ -7,8 +12,8 @@ BS.SYSIOVECTS .DA BS.IO.OUT
.DA BS.IO.IN0 .DA BS.IO.IN0
.DA BS.IO.OUT.CAT .DA BS.IO.OUT.CAT
.DA BS.IO.IN0 .DA BS.IO.IN0
BS.VSYSO.LO .DA #$A7 BS.VSYSO.LO .DA #BS.VSYSO
BS.VSYSO.HI .DA #$9D BS.VSYSO.HI .DA /BS.VSYSO
BS.ParamLByte .DA #$A0 BS.ParamLByte .DA #$A0
.DA #$AC .DA #$AC
.DA #$AF .DA #$AF
@ -125,15 +130,15 @@ BS.KW.LEN .DA #$BF
.DA #$B5 .DA #$B5
.DA #$D8 .DA #$D8
BS.KW.TABLE .AS "BSAVERIFYBLOADELETEBYECATALOGOPENWRITEXECREATEFRESTORENAMEBRUNLOCKCHAIN#FLUSHREADPOSITIONOMONPR#PREFIXCLOSEAPPEND" BS.KW.TABLE .AS "BSAVERIFYBLOADELETEBYECATALOGOPENWRITEXECREATEFRESTORENAMEBRUNLOCKCHAIN#FLUSHREADPOSITIONOMONPR#PREFIXCLOSEAPPEND"
BS.KW.JMP .DA BS.JMP.XTRNADDR BS.KW.JMP .DA BS.JMP.XTRNADDR $00
.DA BS.KW.PR .DA BS.KW.PR
.DA BS.KW.IN .DA BS.KW.IN
.DA BS.KW.CAT .DA BS.KW.CAT
.DA BS.KW.01 .DA BS.KW.01
.DA BS.KW.BYE .DA BS.KW.BYE
.DA BS.KW.02 .DA BS.KW.RUN
.DA BS.KW.BRUN .DA BS.KW.BRUN
.DA BS.KW.EXEC .DA BS.KW.EXEC $10
.DA BS.KW.RESTORE .DA BS.KW.RESTORE
.DA BS.KW.LOCK .DA BS.KW.LOCK
.DA BS.KW.03 .DA BS.KW.03
@ -141,7 +146,7 @@ BS.KW.JMP .DA BS.JMP.XTRNADDR
.DA BS.KW.STORE .DA BS.KW.STORE
.DA BS.KW.BLOAD .DA BS.KW.BLOAD
.DA BS.KW.BSAVE .DA BS.KW.BSAVE
.DA BS.KW.X05 .DA BS.KW.X05 $20
.DA BS.KW.X06 .DA BS.KW.X06
.DA BS.KW.FLUSH .DA BS.KW.FLUSH
.DA BS.KW.X07 .DA BS.KW.X07
@ -149,7 +154,7 @@ BS.KW.JMP .DA BS.JMP.XTRNADDR
.DA BS.KW.X08 .DA BS.KW.X08
.DA BS.KW.X09 .DA BS.KW.X09
.DA BS.KW.CREATE .DA BS.KW.CREATE
.DA BS.KW.DELETE .DA BS.KW.DELETE $30
.DA BS.KW.PREFIX .DA BS.KW.PREFIX
.DA BS.KW.RENAME .DA BS.KW.RENAME
.DA BS.KW.UNLOCK .DA BS.KW.UNLOCK
@ -157,7 +162,7 @@ BS.KW.JMP .DA BS.JMP.XTRNADDR
.DA BS.KW.CATALOG .DA BS.KW.CATALOG
.DA BS.KW.LOAD .DA BS.KW.LOAD
.DA BS.KW.CLOSE .DA BS.KW.CLOSE
.DA BS.KW.APPEND .DA BS.KW.APPEND $40
BS.KW.PBITS .DA $8040 BS.KW.PBITS .DA $8040
.DA $8040 .DA $8040
.DA $0495 .DA $0495
@ -583,7 +588,7 @@ XBBB5 .BS 2
XBBB7 .BS 1 XBBB7 .BS 1
XBBB8 .BS 1 XBBB8 .BS 1
BS.IsIntCmdMTR ldy #$02 BS.IsIntCmdMTR ldy #$02
LBBBB lda BS.CMDBUF,y LBBBB lda BS.CMDBUF,y
cmp BS.MTR,y cmp BS.MTR,y
bne LBBCF bne LBBCF
dey dey

View File

@ -74,7 +74,7 @@ GP.GOSYSTEM sta GP.GOSYSTEM.C
stx BS.CALLX stx BS.CALLX
and #$1F and #$1F
tax tax
lda BS.ParamLByte,x lda BS.ParamLByte,x
sta GP.GOSYSTEM.P sta GP.GOSYSTEM.P
ldx BS.CALLX ldx BS.CALLX
jsr MLI jsr MLI
@ -93,7 +93,7 @@ LBE8D cmp BS.MLIERTBL,x
ldx #$13 ldx #$13
LBE97 lda BS.BIERRTBL,x LBE97 lda BS.BIERRTBL,x
ldx BS.CALLX ldx BS.CALLX
sec sec

View File

@ -7,53 +7,53 @@ LDR.SIG .DA $EEEE
LDR.STARTUP.LEN .DA #7 LDR.STARTUP.LEN .DA #7
LDR.STARTUP .AS "STARTUP" LDR.STARTUP .AS "STARTUP"
.BS MLI.MAXPATH-7 .BS MLI.MAXPATH-7
LDR.START1 lda #$9A LDR.START1 lda #$9A
sta Ptr2+1 sta Ptr2+1
lda #$24 lda #$24
sta Ptr1+1 sta Ptr1+1
lda #$00 lda #$00
sta Ptr1 sta Ptr1
sta Ptr2 sta Ptr2
ldx #$23 ldx #$23
tay tay
jsr LDR.MoveXpages jsr LDR.MoveXpages
ldx #$01 ldx #$01
lda #$BE lda #$BE
sta Ptr2+1 sta Ptr2+1
jsr LDR.MoveXpages jsr LDR.MoveXpages
lda #$15 lda #$15
jsr MON.COUT jsr MON.COUT
jsr MON.SETNORM jsr MON.SETNORM
jsr MON.INIT jsr MON.INIT
jsr MON.MON jsr MON.MON
ldx #$17 ldx #$17
lda #$00 lda #$00
L2076 sta MLI.MEMTABL,x L2076 sta MLI.MEMTABL,x
dex dex
bne L2076 bne L2076
lda #$CF lda #$CF
sta MLI.MEMTABL sta MLI.MEMTABL
lda #$3F lda #$3F
sta MLI.MEMTABL+19 sta MLI.MEMTABL+19
lda #$FF lda #$FF
sta MLI.MEMTABL+20 sta MLI.MEMTABL+20
sta MLI.MEMTABL+21 sta MLI.MEMTABL+21
sta MLI.MEMTABL+22 sta MLI.MEMTABL+22
lda #$C3 lda #$C3
sta MLI.MEMTABL+23 sta MLI.MEMTABL+23
lda AS.COLDBOOT lda AS.COLDBOOT
cmp #$4C cmp #$4C
bne L20B1 bne L20B1
lda MLI.MACHID lda MLI.MACHID
and #$20 and #$20
beq L20B1 beq L20B1
ldx #$03 ldx #$03
L20A6 lda LDR.CSWVECT,x L20A6 lda LDR.CSWVECT,x
sta ZP.CSW,x sta ZP.CSW,x
dex dex
bpl L20A6 bpl L20A6
@ -62,7 +62,7 @@ L20A6 lda LDR.CSWVECT,x
L20B1 ldx #$27 L20B1 ldx #$27
L20B3 lda LDR.UNABLE,x L20B3 lda LDR.UNABLE,x
sta $628,x sta $628,x
dex dex
bpl L20B3 bpl L20B3
@ -73,7 +73,7 @@ L20B3 lda LDR.UNABLE,x
L20C2 bmi L20C2 L20C2 bmi L20C2
LDR.MoveXpages dey LDR.MoveXpages dey
lda (Ptr1),y lda (Ptr1),y
sta (Ptr2),y sta (Ptr2),y
tya tya
bne LDR.MoveXpages bne LDR.MoveXpages
@ -88,11 +88,11 @@ L20D3 rts
LDR.CSW cmp #$DD LDR.CSW cmp #$DD
bne L20D3 bne L20D3
lda GP.OUTVECT0 lda GP.OUTVECT0
sta ZP.CSW sta ZP.CSW
lda GP.OUTVECT0+1 lda GP.OUTVECT0+1
sta ZP.CSW+1 sta ZP.CSW+1
lda MLI.DEVNUM lda MLI.DEVNUM
sta LDR.ONLINE.P.DEVNUM sta LDR.ONLINE.P.DEVNUM
ldx #$01 ldx #$01
asl asl
@ -109,14 +109,14 @@ L20EE stx GP.VDEFDRV
sta GP.VDEFSLT sta GP.VDEFSLT
ldx #$C1 ldx #$C1
ldy #$02 ldy #$02
lda MLI.SLTBYT lda MLI.SLTBYT
lsr lsr
L2102 lsr L2102 lsr
pha pha
bcc L2115 bcc L2115
lda #$00 lda #$00
sta GP.OUTVECT0,y sta GP.OUTVECT0,y
sta GP.INVECT0,y sta GP.INVECT0,y
txa txa
@ -129,11 +129,11 @@ L2115 iny
pla pla
bne L2102 bne L2102
lda #$96 lda #$96
sta AS.HIMEM+1 sta AS.HIMEM+1
sta AS.STRINGSTART+1 sta AS.STRINGSTART+1
sta GP.RSHIMEM sta GP.RSHIMEM
lda MLI.PFIXPTR lda MLI.PFIXPTR
beq L214E beq L214E
jsr MLI jsr MLI
@ -142,7 +142,7 @@ L2115 iny
bne L218B bne L218B
ldx MLI.PATHBUF ldx MLI.PATHBUF
lda #$2F lda #$2F
L2136 cmp MLI.PATHBUF,x L2136 cmp MLI.PATHBUF,x
bne L213E bne L213E
@ -152,7 +152,7 @@ L2136 cmp MLI.PATHBUF,x
L213E dex L213E dex
bne L2136 bne L2136
lda LDR.PFXLEN lda LDR.PFXLEN
cmp #$03 cmp #$03
bcs L216F bcs L216F
@ -165,14 +165,14 @@ L214E jsr MLI
.DA LDR.ONLINE.P .DA LDR.ONLINE.P
bne L218B bne L218B
lda MLI.PATHBUF+1 lda MLI.PATHBUF+1
and #$0F and #$0F
beq L218B beq L218B
tax tax
inx inx
stx MLI.PATHBUF stx MLI.PATHBUF
lda #$2F lda #$2F
sta MLI.PATHBUF+1 sta MLI.PATHBUF+1
jsr MLI jsr MLI
.DA #MLI.C.SETPREFIX .DA #MLI.C.SETPREFIX
@ -187,15 +187,15 @@ L216F jsr MLI
ldx LDR.STARTUP.LEN ldx LDR.STARTUP.LEN
stx LDR.STARTUP.LEN1 stx LDR.STARTUP.LEN1
L217D lda LDR.STARTUP.LEN,x L217D lda LDR.STARTUP.LEN,x
sta IO.LINEBUF,x sta IO.LINEBUF,x
dex dex
bne L217D bne L217D
lda #$AD lda #$AD
sta IO.LINEBUF sta IO.LINEBUF
L218B lda LDR.PFXLEN L218B lda LDR.PFXLEN
cmp #$03 cmp #$03
bcs L2198 bcs L2198
@ -203,52 +203,52 @@ L218B lda LDR.PFXLEN
.DA #MLI.C.SETPREFIX .DA #MLI.C.SETPREFIX
.DA LDR.GETSETPFX1.P .DA LDR.GETSETPFX1.P
L2198 lda LDR.STARTUP.LEN1 L2198 lda LDR.STARTUP.LEN1
bne L21C1 bne L21C1
jsr LDR.KSW jsr LDR.KSW
ldx #$1C ldx #$1C
L21A2 lda LDR.PRODOSBASIC,x L21A2 lda LDR.PRODOSBASIC,x
sta $400,x sta $400,x
dex dex
bpl L21A2 bpl L21A2
ldx #$1F ldx #$1F
L21AD lda LDR.COPYRIGHT,x L21AD lda LDR.COPYRIGHT,x
sta $480,x sta $480,x
dex dex
bpl L21AD bpl L21AD
lda #$8D lda #$8D
jsr MON.COUT1 jsr MON.COUT1
jsr MON.COUT1 jsr MON.COUT1
jsr MON.COUT1 jsr MON.COUT1
L21C1 ldx #$02 L21C1 ldx #$02
L21C3 lda LDR.JMP.GP.ENTRY,x L21C3 lda LDR.JMP.GP.ENTRY,x
sta DOS.WARMSTART,x sta DOS.WARMSTART,x
sta DOS.COLDSTART,x sta DOS.COLDSTART,x
sta MON.USRJMP,x sta MON.USRJMP,x
lda LDR.AMPERSANDJMP,x lda LDR.AMPERSANDJMP,x
sta MON.AMPERSANDJMP,x sta MON.AMPERSANDJMP,x
dex dex
bpl L21C3 bpl L21C3
lda LDR.BRKVECT lda LDR.BRKVECT
sta MON.BRKVECT sta MON.BRKVECT
lda LDR.BRKVECT+1 lda LDR.BRKVECT+1
sta MON.BRKVECT+1 sta MON.BRKVECT+1
lda LDR.POWERUP lda LDR.POWERUP
sta MON.POWERUP sta MON.POWERUP
lda LDR.POWERUP+1 lda LDR.POWERUP+1
sta MON.POWERUP+1 sta MON.POWERUP+1
eor #$A5 eor #$A5
sta MON.POWERUPBYTE sta MON.POWERUPBYTE
lda #$A5 lda #$A5
sta AS.TRCFLG sta AS.TRCFLG
lda BS.IVERSION lda BS.IVERSION
sta MLI.IVERSION sta MLI.IVERSION
LDR.JMP.GP.ENTRY LDR.JMP.GP.ENTRY
@ -260,13 +260,13 @@ LDR.POWERUP .DA GP.ENTRY
LDR.AMPERSANDJMP LDR.AMPERSANDJMP
jmp GP.DOSCMD jmp GP.DOSCMD
LDR.KSW lda GP.INVECT0 LDR.KSW lda GP.INVECT0
sta ZP.KSW sta ZP.KSW
lda GP.INVECT0+1 lda GP.INVECT0+1
sta ZP.KSW+1 sta ZP.KSW+1
ldx LDR.STARTUP.LEN ldx LDR.STARTUP.LEN
inx inx
lda #$8D lda #$8D
rts rts
LDR.CSWVECT .DA LDR.CSW LDR.CSWVECT .DA LDR.CSW
@ -279,11 +279,9 @@ LDR.GFINFO.P.PATHBUF
LDR.GETSETPFX1.P LDR.GETSETPFX1.P
.DA #1 .DA #1
LDR.GETSETPFX1.P.BUF .DA LDR.GETSETPFX1.SLASH
.DA LDR.GETSETPFX1.SLASHLEN
LDR.GETSETPFX1.SLASHLEN
.DA #1
LDR.GETSETPFX1.SLASH LDR.GETSETPFX1.SLASH
.DA #1
.AS "/" .AS "/"
LDR.STARTUP.LEN1 LDR.STARTUP.LEN1
.DA #0 .DA #0
@ -295,13 +293,12 @@ LDR.ONLINE.P.BUF
.DA MLI.PATHBUF+1 .DA MLI.PATHBUF+1
LDR.GETSETPFX2.P LDR.GETSETPFX2.P
.DA #1 .DA #1
LDR.GETSETPFX2.P.BUF
.DA MLI.PATHBUF .DA MLI.PATHBUF
LDR.PFXLEN .DA #0 LDR.PFXLEN .DA #0
LDR.UNABLE .AS -"*** UNABLE TO EXECUTE BASIC SYSTEM ***" LDR.UNABLE .AS -"*** UNABLE TO EXECUTE BASIC SYSTEM ***"
LDR.PRODOSBASIC .AS -" PRODOS BASIC 1.5 " LDR.PRODOSBASIC .AS -" PRODOS BASIC FX"
LDR.COPYRIGHT .AS -" COPYRIGHT APPLE 1983-92" LDR.COPYRIGHT .AS -" COPYRIGHT APPLE 1983-92"
.BS $2400-* .BS $2400-*
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -1,9 +1,36 @@
NEW NEW
AUTO 3,1 AUTO 3,1
.LIST OFF .LIST OFF
.OP 6502 .OP 65c02
.OR $2000 .OR $2000
.TF BASIC.FX,TSYS .TF BASIC.SYSTEM,TSYS
*--------------------------------------
.MA DEBUG
:1 bit $C000
bpl :1
sta $C010
.EM
*--------------------------------------
LOWERCASE .EQ 1
*--------------------------------------
CMDBITS0.PFIX .EQ $80 ;Prefix needs fetching, pathname optional
CMDBITS0.SLOT .EQ $40 ;No parameters to be processed
CMDBITS0.RRUN .EQ $20 ;Command only valid during program
CMDBITS0.FNOPT .EQ $10 ;Filename is optional
CMDBITS0.CRFLG .EQ $08 ;CREATE allowed
CMDBITS0.T .EQ $04 ;File type
CMDBITS0.FN2 .EQ $02 ;Filename '2' for RENAME
CMDBITS0.FN1 .EQ $01 ;Filename expected
CMDBITS1.AD .EQ $80 ;Address
CMDBITS1.B .EQ $40 ;Byte
CMDBITS1.E .EQ $20 ;End address
CMDBITS1.L .EQ $10 ;Length
CMDBITS1.LINE .EQ $08 ;'@' line number
CMDBITS1.SD .EQ $04 ;Slot and drive numbers
CMDBITS1.F .EQ $02 ;Field
CMDBITS1.R .EQ $01 ;Record
CMDBITS1.V .EQ $00 ;Volume number ignored
*-------------------------------------- *--------------------------------------
Ptr1 .EQ 0 Ptr1 .EQ 0
Ptr2 .EQ 2 Ptr2 .EQ 2

View File

@ -27,8 +27,9 @@ ILDR.ENUMPM .DO PM
jsr ILDR.EnumInit jsr ILDR.EnumInit
.1 ldx #S.FI.T.BIN .1 ldx #S.FI.T.BIN
ldy #ILDR.KMSFX ldy #ILDR.KMPFX
lda /ILDR.KMSFX lda /ILDR.KMPFX
clc prefix
jsr ILDR.EnumNext jsr ILDR.EnumNext
bcs .4 bcs .4
@ -65,6 +66,7 @@ ILDR.ENUMPM .DO PM
ldx #S.FI.T.SYS ldx #S.FI.T.SYS
ldy #ILDR.SYSTEMSFX ldy #ILDR.SYSTEMSFX
lda /ILDR.SYSTEMSFX lda /ILDR.SYSTEMSFX
sec suffix
jsr ILDR.EnumNext jsr ILDR.EnumNext
bcs .9 bcs .9
@ -151,11 +153,13 @@ ILDR.EnumInit.RTS
rts rts
*-------------------------------------- *--------------------------------------
* X = expected FileType * X = expected FileType
* Y,A = expected suffix * Y,A = expected prefix/suffix
*-------------------------------------- *--------------------------------------
ILDR.EnumNext stx ILDR.FT ILDR.EnumNext stx ILDR.FT
sty src sty src
sta src+1 sta src+1
ror ILDR.bPFXSFX
.1 inc ILDR.nFC .1 inc ILDR.nFC
bne .2 bne .2
@ -208,9 +212,12 @@ ILDR.EnumNext stx ILDR.FT
cmp ILDR.FT expected file type cmp ILDR.FT expected file type
bne .1 bne .1
lda (src) expected suffix len lda (src) expected prefix/suffix len
cmp pbuf cmp pbuf
bcs .1 filename LE suffix bcs .1 filename LE prefix/suffix
bit ILDR.bPFXSFX
bpl .12 go check prefix
tay tay
ldx pbuf ldx pbuf
@ -223,8 +230,20 @@ ILDR.EnumNext stx ILDR.FT
dex dex
dey dey
bne .11 bne .11
bra .15
.12 lda (src) expected prefix/suffix len
tay
ldy #$1D MIN_VERSION .13 lda pbuf,y
eor (src),y
asl
bne .1
dey
bne .13
.15 ldy #$1D MIN_VERSION
lda (idxl),y lda (idxl),y
bpl .10 no lowercase information bpl .10 no lowercase information
@ -335,8 +354,8 @@ ILDR.QUIT .DA #4 PARAM CNT
*-------------------------------------- *--------------------------------------
ILDR.ATINIT .DA #6 ILDR.ATINIT .DA #6
.AS "ATINIT" .AS "ATINIT"
ILDR.KMSFX .DA #3 ILDR.KMPFX .DA #3
.AS ".PM" .AS "PM."
ILDR.SYSTEMSFX .DA #7 ILDR.SYSTEMSFX .DA #7
.AS ".SYSTEM" .AS ".SYSTEM"
*-------------------------------------- *--------------------------------------
@ -348,6 +367,7 @@ ILDR.EL .BS 1
ILDR.nFC .BS 2 ILDR.nFC .BS 2
ILDR.FT .BS 1 ILDR.FT .BS 1
ILDR.EITB .BS 1 ILDR.EITB .BS 1
ILDR.bPFXSFX .BS 1
.ED .ED
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF .LIST OFF
.OP 65816 .OP 65816
.OR $2000 .OR $2000
.TF PRODOS.FX,TSYS .TF PRODOS,TSYS
*-------------------------------------- *--------------------------------------
READCAT .EQ 0 Boot Block read Catalog at $C00 READCAT .EQ 0 Boot Block read Catalog at $C00
ENHFILENAME .EQ 1 ENHFILENAME .EQ 1

View File

@ -299,6 +299,10 @@ CS.QUIT
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
*
*--------------------------------------
CS.DRV
*--------------------------------------
CS.END CS.END
*-------------------------------------- *--------------------------------------
* Initialized DATA * Initialized DATA

View File

@ -460,19 +460,18 @@ CPU.Init >PUSHWI MSG.CPU
>PUSHBI 1 >PUSHBI 1
>SYSCALL2 printf >SYSCALL2 printf
ldy #0
stz A2osX.CPUSPEED+1 stz A2osX.CPUSPEED+1
ldx A2osX.HZ
ldy #0
php php
sei sei
ldx A2osX.HWType lda A2osX.HWType
cpx #A2osX.HWType.IIc cmp #A2osX.HWType.IIc
beq CPU.Init2c beq CPU.Init2c
ldx A2osX.HZ
.1 bit VBL //e : Wait VBL high.... .1 bit VBL //e : Wait VBL high....
bpl .1 bpl .1
@ -489,8 +488,6 @@ CPU.Init >PUSHWI MSG.CPU
pla (4) pla (4)
pha (3) pha (3)
pla (4) pla (4)
pha (3)
pla (4)
iny iny
cpy #100 cpy #100
@ -507,21 +504,22 @@ CPU.Init >PUSHWI MSG.CPU
bra CPU.InitOK bra CPU.InitOK
*-------------------------------------- *--------------------------------------
CPU.Init2c sta CLRIOUDIS CPU.Init2c lda RDIOUDIS
pha
sta CLRIOUDIS
lda IO.IIC.RDVBLMSK lda IO.IIC.RDVBLMSK
pha Save VBLIRQ enable pha Save VBLIRQ enable
sta IO.IIC.ENVBL sta IO.IIC.ENVBL
lda IO.IIC.CLRVBLIRQ
ldx A2osX.HZ lda IO.IIC.CLRVBLIRQ
.1 bit VBL Wait VBL high.... .1 bit VBL Wait VBL high....
bpl .1 bpl .1
bit IO.IIC.CLRVBLIRQ clear //c IRQ bit IO.IIC.CLRVBLIRQ clear //c IRQ
.3 lda #40 .3 lda #60
.4 pha (3) .4 pha (3)
pla (4) pla (4)
@ -547,9 +545,14 @@ CPU.Init2c sta CLRIOUDIS
bne .3 bne .3
pla Disable VBLIRQ ? pla Disable VBLIRQ ?
bpl CPU.InitOk bpl .8
sta IO.IIC.DISVBL sta IO.IIC.DISVBL
.8 pla
bpl CPU.InitOk
sta SETIOUDIS
*-------------------------------------- *--------------------------------------
CPU.InitOk plp CPU.InitOk plp

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000
.TF sys/km/km.appletalk .TF sys/pm/pm.appletalk
*-------------------------------------- *--------------------------------------
.INB inc/macros.i .INB inc/macros.i
.INB inc/io.i .INB inc/io.i
@ -177,5 +177,5 @@ MLI.AT.FINaming .DA #0 Synchonous
.DA #%10000000 b7=1:Use AFP long Name, b6=0:Update ProDOS dev table .DA #%10000000 b7=1:Use AFP long Name, b6=0:Update ProDOS dev table
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.appletalk.s SAVE usr/src/sys/pm.appletalk.s
ASM ASM

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000
.TF sys/km/km.nsc .TF sys/pm/pm.nsc
*-------------------------------------- *--------------------------------------
.INB inc/macros.i .INB inc/macros.i
.INB inc/io.i .INB inc/io.i
@ -319,5 +319,5 @@ NSCDRV.SIZE .EQ *-NSCDRV.B.START
.FIN .FIN
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.nsc.s SAVE usr/src/sys/pm.nsc.s
ASM ASM

View File

@ -3,8 +3,7 @@ NEW
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000
.TF sys/km/km.ramworks .TF sys/pm/pm.ramworks
* .TF ramworks.pm
*-------------------------------------- *--------------------------------------
.INB inc/macros.i .INB inc/macros.i
.INB inc/io.i .INB inc/io.i
@ -793,5 +792,5 @@ RWDRVX.SIZE .EQ RWDRVX.B.END-RWDRVX.B.START
.FIN .FIN
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.ramworks.s SAVE usr/src/sys/pm.ramworks.s
ASM ASM

View File

@ -374,6 +374,6 @@ VEDRIVE.GetCharPtr1
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.vedrive.s.cf SAVE usr/src/sys/pm.vedrive.s.cf
LOAD usr/src/sys/km.vedrive.s LOAD usr/src/sys/pm.vedrive.s
ASM ASM

View File

@ -12,6 +12,6 @@ DRV.GS .EQ *
.EP .EP
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.vedrive.s.gs SAVE usr/src/sys/pm.vedrive.s.gs
LOAD usr/src/sys/km.vedrive.s LOAD usr/src/sys/pm.vedrive.s
ASM ASM

View File

@ -524,6 +524,6 @@ VEDRIVE.CheckARPFrame
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.vedrive.s.ip SAVE usr/src/sys/pm.vedrive.s.ip
LOAD usr/src/sys/km.vedrive.s LOAD usr/src/sys/pm.vedrive.s
ASM ASM

View File

@ -6,8 +6,7 @@ U1.Init lda CONF.SLOT
asl asl
asl asl
asl asl
sta DRV.U1+2 set DRV.U1.Slotn0 sta Slotn0
tax tax
lda /PP.ID lda /PP.ID
@ -47,7 +46,7 @@ U1.Init lda CONF.SLOT
>LDYAI VEDRIVE.NICOK >LDYAI VEDRIVE.NICOK
jsr PrintFYA jsr PrintFYA
ldx DRV.U1+2 ldx Slotn0
lda /PP.RxCTL lda /PP.RxCTL
sta PacketPagePTR+1,x sta PacketPagePTR+1,x
@ -104,7 +103,7 @@ U1.Init lda CONF.SLOT
U1.READ php U1.READ php
sei sei
ldx DRV.U1+2 ldx Slotn0
lda /PP.RxEvent lda /PP.RxEvent
sta PacketPagePTR+1,x sta PacketPagePTR+1,x
@ -129,7 +128,7 @@ U1.READ php
eor #$ff eor #$ff
sta ZPnCnt sta ZPnCnt
ldx DRV.U1+2 ldx Slotn0
lda ZPBufPtr+1 lda ZPBufPtr+1
pha pha
@ -174,7 +173,7 @@ U1.READWRITE.9 plp
U1.WRITE php U1.WRITE php
sei sei
ldx DRV.U1+2 ldx Slotn0
lda /PP.TxCMD.LID+PP.TxCMD.TxStartFULL lda /PP.TxCMD.LID+PP.TxCMD.TxStartFULL
sta TxCMD+1,x sta TxCMD+1,x
@ -201,7 +200,7 @@ U1.WRITE php
bit /PP.BusST.Rdy4TxNOW bit /PP.BusST.Rdy4TxNOW
beq U1.READWRITE.9 beq U1.READWRITE.9
ldx DRV.U1+2 ldx Slotn0
ldy #0 ldy #0
@ -237,12 +236,10 @@ U1.Name >PSTR "Uthernet V1"
*-------------------------------------- *--------------------------------------
DRV.U1 .EQ * DRV.U1 .EQ *
.PH $D400 .PH $D400
cld
ldx #$ff SELF MODIFIED
.EP .EP
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.vedrive.s.u1 SAVE usr/src/sys/pm.vedrive.s.u1
LOAD usr/src/sys/km.vedrive.s LOAD usr/src/sys/pm.vedrive.s
ASM ASM

View File

@ -8,9 +8,9 @@ U2.Init lda CONF.SLOT
asl asl
clc clc
adc #$88 adc #$88
sta DRV.U2+2 set DRV.U2.Slotn0 sta Slotn0
tax tax
lda #W5100.MR.RST lda #W5100.MR.RST
sta W5100.MR,x sta W5100.MR,x
@ -56,7 +56,7 @@ U2.Init lda CONF.SLOT
>LDYAI VEDRIVE.NICOK >LDYAI VEDRIVE.NICOK
jsr PrintFYA jsr PrintFYA
ldx DRV.U2+2 ldx Slotn0
lda #W5100.MR.PB+W5100.MR.AI+W5100.MR.IND lda #W5100.MR.PB+W5100.MR.AI+W5100.MR.IND
sta W5100.MR,x sta W5100.MR,x
@ -83,14 +83,13 @@ U2.Init lda CONF.SLOT
lda #W5100.AR.Sn.CR.OPEN lda #W5100.AR.Sn.CR.OPEN
sta W5100.DR,x sta W5100.DR,x
clc clc
rts rts
*-------------------------------------- *--------------------------------------
U2.Read php U2.Read php
sei sei
ldx DRV.U2+2 ldx Slotn0
>AR.SELECT S0.RX.RSR >AR.SELECT S0.RX.RSR
lda W5100.DR,x get the received size HI lda W5100.DR,x get the received size HI
@ -180,7 +179,7 @@ U2.READWRITE.9 plp
U2.Write php U2.Write php
sei sei
ldx DRV.U2+2 ldx Slotn0
lda ZPBufCnt lda ZPBufCnt
eor #$ff eor #$ff
@ -252,13 +251,181 @@ Offset .BS 2
TotalSize .BS 2 TotalSize .BS 2
*-------------------------------------- *--------------------------------------
DRV.U2 .EQ * DRV.U2 .EQ *
.PH $D400 .PH DRV.NIC.START
cld
ldx #$ff SELF MODIFIED DRV.U2.START jmp DRV.U2.Write
DRV.U2.Read php
sei
ldx DRV.START
>AR.SELECT S0.RX.RSR
lda W5100.DR,x get the received size HI
nop
nop
ora W5100.DR,x LO
bne .1
jmp DRV.U2.9
.1 >AR.SELECT S0.RX.RD
lda W5100.DR,x get the received ptr HI
sta Offset+1
ldy W5100.DR,x get the received ptr LO
sty Offset
and /RXTX.MASK
ora /RX.BASE
sta W5100.AR,x
tya
sta W5100.AR+1,x
lda W5100.DR,x get RX.Size HI (Frame size + 2)
sta TotalSize+1
lda W5100.DR,x get RX.Size LO
sta TotalSize
sec
sbc #2 MACRAW:strip 2 bytes Header from Size
sta ZPBufCnt
eor #$ff
sta ZPnCnt
lda TotalSize+1
sbc #0
sta ZPBufCnt
eor #$ff
sta ZPnCnt+1
lda ZPBufPtr+1
pha
ldy #0
.2 inc ZPnCnt
bne .3
inc ZPnCnt+1
beq .8
.3 lda W5100.DR,x
sta (ZPBufPtr),y
iny
bne .2
inc ZPBufPtr+1
bra .2
.8 >AR.SELECT S0.RX.RD
lda Offset
clc
adc TotalSize
pha save LO
lda Offset+1
adc TotalSize+1
sta W5100.DR,x write HI
pla
sta W5100.DR,x write LO
>AR.SELECT S0.CR
lda #W5100.AR.Sn.CR.RCVD
sta W5100.DR,x
pla
sta ZPBufPtr+1
plp
clc
rts
*--------------------------------------
DRV.U2.9 plp
sec
rts
*--------------------------------------
DRV.U2.Write php
sei
>STYA ZPBufCnt
eor #$ff
sta ZPnCnt+1
tya
eor #$ff
sta ZPnCnt
>LDYA DRV.OutBuf
>STYA ZPBufPtr
ldx DRV.START
>AR.SELECT S0.TX.FSR
lda W5100.DR,x get send size HI
nop
nop
ldy W5100.DR,x LO
cpy ZPBufCnt
sbc ZPBufCnt+1
bcc DRV.U2.9
>AR.SELECT S0.TX.WR
lda W5100.DR,x Get HI
nop
nop
ldy W5100.DR,x Get LO
and /RXTX.MASK
ora /TX.BASE
sta W5100.AR,x Write HI
sta Offset+1
tya
sta W5100.AR+1,x Write LO
sta Offset
ldy #0
.2 inc ZPnCnt
bne .3
inc ZPnCnt+1
beq .8
.3 lda (ZPBufPtr),y
sta W5100.DR,x
iny
bne .2
inc ZPBufPtr+1
bra .2
.8 >AR.SELECT S0.TX.WR
lda Offset
clc
adc ZPBufCnt
pha save LO
lda Offset+1
adc ZPBufCnt+1
sta W5100.DR,x write HI
pla
sta W5100.DR,x write LO
>AR.SELECT S0.CR
lda #W5100.AR.Sn.CR.SEND
sta W5100.DR,x
plp
clc
rts
.EP .EP
.LIST ON
DRV.U2.SIZE .EQ *-DRV.U2
.LIST OFF
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.vedrive.s.u2 SAVE usr/src/sys/pm.vedrive.s.u2
LOAD usr/src/sys/km.vedrive.s LOAD usr/src/sys/pm.vedrive.s
ASM ASM

View File

@ -3,8 +3,8 @@ NEW
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000
* .TF sys/km.vedrive * .TF sys/pm/pm.vedrive
.TF vedrive.pm .TF sys/pm.vedrive
*-------------------------------------- *--------------------------------------
.INB inc/macros.i .INB inc/macros.i
.INB inc/io.i .INB inc/io.i
@ -31,11 +31,12 @@ ZPCheckSum .EQ 14
timerS .EQ 16 timerS .EQ 16
timerC .EQ 17 timerC .EQ 17
bRemoteMac .EQ 18 bRemoteMac .EQ 18
Slotn0 .EQ 19
*-------------------------------------- *--------------------------------------
ADT.CMD.VSD .EQ $C5 "E": Virtual Drive Command Envelope ADT.CMD.VSD .EQ $C5 "E": Virtual Drive Command Envelope
ADT.CMD.PING .EQ $D9 "Y": PING ADT.CMD.PING .EQ $D9 "Y": PING
DRV.EntryPoint .EQ $BF41 DRV.EntryPoint .EQ $BF41
DRV.ADDR .EQ $D400 DRV.NIC.START .EQ $D500
*-------------------------------------- *--------------------------------------
CONF.FBUF .EQ $4000 CONF.FBUF .EQ $4000
CONF.LBUF .EQ $4400 CONF.LBUF .EQ $4400
@ -67,7 +68,6 @@ VEDRIVE.Init >LDYAI VEDRIVE.MSG0
rts rts
.3 jsr VEDRIVE.MACInit .3 jsr VEDRIVE.MACInit
lda CONF.ADDRESS lda CONF.ADDRESS
bne .4 bne .4
@ -111,7 +111,7 @@ VEDRIVE.Init >LDYAI VEDRIVE.MSG0
.7 >LDYAI VEDRIVE.SRVOK .7 >LDYAI VEDRIVE.SRVOK
jsr PrintFYA jsr PrintFYA
jsr VEDRIVE.SetSlot * jsr VEDRIVE.SetSlot
bcc .8 bcc .8
>LDYAI VEDRIVE.NOSLOT >LDYAI VEDRIVE.NOSLOT
@ -135,22 +135,20 @@ VEDRIVE.Init >LDYAI VEDRIVE.MSG0
rts rts
*-------------------------------------- *--------------------------------------
VEDRIVE.CheckDRV VEDRIVE.CheckDRV
bit RRAMWRAMBNK2 ldx #COPYRIGHT.LEN
bit RRAMWRAMBNK2
clc
lda $D400
eor #$D8 CLD
bne .8
lda $D401
eor #$A2 LDX #imm
bne .8
sec sec
.8 bit RROMBNK1 .1 lda DRV.EntryPoint-1,x
rts eor COPYRIGHT-1,x
bne .9
dex
bne .1
clc
.9 rts
*-------------------------------------- *--------------------------------------
VEDRIVE.Ping lda CONF.PORT VEDRIVE.Ping lda CONF.PORT
sta ADT.REQ.UDP.DST sta ADT.REQ.UDP.DST
@ -287,28 +285,93 @@ VEDRIVE.SetSlot ldx #2 Starts at Slot1
*-------------------------------------- *--------------------------------------
VEDRIVE.Install ldx #PATCH.SIZE VEDRIVE.Install ldx #PATCH.SIZE
.1 lda PATCH-1,x *.1 lda PATCH-1,x
sta DRV.EntryPoint-1,x * sta DRV.EntryPoint-1,x
dex * dex
bne .1 * bne .1
bit RRAMWRAMBNK2 bit RRAMWRAMBNK2
bit RRAMWRAMBNK2 bit RRAMWRAMBNK2
ldy #DRV.SIZE-1
.2 lda DRV,y
sta DRV.START,y
dey
bne .2
lda Slotn0
sta DRV.START
ldy #DRV.IP.SIZE-1
.3 lda DRV.IP,y
sta DRV.IP.START,y
dey
bne .3
ldx CONF.NIC
lda .10,x
sta ZPPtr1
lda .10+1,x
sta ZPPtr1+1
lda .20,x
eor #$ff
sta ZPnCnt
lda .20+1,x
eor #$ff
sta ZPnCnt+1
lda #DRV.NIC.START
sta ZPPtr2
lda /DRV.NIC.START
sta ZPPtr2+1
ldy #0
.4 inc ZPnCnt
bne .5
inc ZPnCnt+1
beq .6
.5 lda (ZPPtr1),y
sta (ZPPtr2),y
iny
bne .4
inc ZPPtr1+1
inc ZPPtr2+1
bra .4
.6 ldy #S.UDP
.7 lda ADT.REQ-1,y
sta DRV.OutBuf-1,y
dey
bne .7
bit RROMBNK1 bit RROMBNK1
clc clc
rts rts
*--------------------------------------
.10 .DA DRV.U2
.DA DRV.U2
.DA DRV.U2
*--------------------------------------
.20 .DA DRV.U2.SIZE
.DA DRV.U2.SIZE
.DA DRV.U2.SIZE
*-------------------------------------- *--------------------------------------
.INB usr/src/shared/x.printf.s .INB usr/src/shared/x.printf.s
*-------------------------------------- *--------------------------------------
* ProDOS $BE41->$BE4B Patch for switching to BANK2 (10 bytes) * ProDOS $BE41->$BE4B Patch for switching to BANK2 (10 bytes)
*-------------------------------------- *--------------------------------------
COPYRIGHT .AS "(C)APPLE "
COPYRIGHT.LEN .EQ *-COPYRIGHT
PATCH .PH DRV.EntryPoint PATCH .PH DRV.EntryPoint
bit RRAMWRAMBNK2 bit RRAMWRAMBNK2
jsr $D002 jsr $D002
@ -338,13 +401,18 @@ DRV.UNITNUM .EQ $43
DRV.BUFF .EQ $44 DRV.BUFF .EQ $44
DRV.BLKNUM .EQ $46 DRV.BLKNUM .EQ $46
*-------------------------------------- *--------------------------------------
DRV.FrmBuf .EQ $DA00 Frame Buffer = 1536 bytes DRV.Write .EQ DRV.NIC.START
DRV.FrmBuf.Env .EQ DRV.FrmBuf+S.UDP DRV.Read .EQ DRV.NIC.START+3
DRV.FrmBuf.Cmd .EQ DRV.FrmBuf+S.UDP+1 *--------------------------------------
DRV.FrmBuf.BlkL .EQ DRV.FrmBuf+S.UDP+2 DRV.OutBuf .EQ $D800-S.UDP-6 Frame Buffer = S.UDP+5+512+1 bytes
DRV.FrmBuf.BlkH .EQ DRV.FrmBuf+S.UDP+3 DRV.OutBuf.Env .EQ DRV.OutBuf+S.UDP
DRV.FrmBuf.Sum .EQ DRV.FrmBuf+S.UDP+4 DRV.OutBuf.Cmd .EQ DRV.OutBuf+S.UDP+1
DRV.FrmBuf.Data .EQ DRV.FrmBuf+S.UDP+5 DRV.OutBuf.BlkL .EQ DRV.OutBuf+S.UDP+2
DRV.OutBuf.BlkH .EQ DRV.OutBuf+S.UDP+3
DRV.OutBuf.Sum .EQ DRV.OutBuf+S.UDP+4
DRV.OutBuf.Data .EQ DRV.OutBuf+S.UDP+5
*--------------------------------------
DRV.InBuf .EQ $DA00 Frame Buffer = 1536 bytes
*-------------------------------------- *--------------------------------------
DRV .PH $D001 Main LC Bnk 2 $D001->$DFFF DRV .PH $D001 Main LC Bnk 2 $D001->$DFFF
@ -363,7 +431,7 @@ DRV.START .BS 1 SELF MODIFIED slot 0n
.1 cmp #3 .1 cmp #3
beq .8 Format .... beq .8 Format ....
* bcs DRV.DO.CMD.ERR more....IO error bcs DRV.DO.CMD.ERR more....IO error
ora #2 W=2,R=3 ora #2 W=2,R=3
ldy DRV.UNITNUM ldy DRV.UNITNUM
@ -371,16 +439,16 @@ DRV.START .BS 1 SELF MODIFIED slot 0n
adc #2 CC from bcs adc #2 CC from bcs
.2 sta DRV.FrmBuf.Cmd store cmd .2 sta DRV.OutBuf.Cmd store cmd
eor #ADT.CMD.VSD eor #ADT.CMD.VSD
eor DRV.BLKNUM eor DRV.BLKNUM
eor DRV.BLKNUM+1 eor DRV.BLKNUM+1
sta DRV.FrmBuf.Sum Compute & store CheckSum sta DRV.OutBuf.Sum Compute & store CheckSum
lda DRV.BLKNUM lda DRV.BLKNUM
sta DRV.FrmBuf.BlkL sta DRV.OutBuf.BlkL
lda DRV.BLKNUM+1 lda DRV.BLKNUM+1
sta DRV.FrmBuf.BlkH sta DRV.OutBuf.BlkH
*-------------------------------------- *--------------------------------------
lda DRV.COMMAND lda DRV.COMMAND
dec 1-1=0 if read dec 1-1=0 if read
@ -388,48 +456,12 @@ DRV.START .BS 1 SELF MODIFIED slot 0n
*-------------------------------------- *--------------------------------------
* Read block * Read block
*-------------------------------------- *--------------------------------------
DRV.DO.CMD.R ldy #3 Read Back and check 4 bytes DRV.DO.CMD.R ldy #S.UDP+5
lda /S.UDP+5
jsr DRV.Write
.1 eor DRV.FrmBuf.BlkH,y
bne DRV.DO.CMD.ERR
dey
bpl .1
ldy #4 Read 4 bytes DATE/TIME + 1 Byte Checksum
.2 eor DRV.FrmBuf.Sum
sta DRV.FrmBuf.Sum
dey
bpl .2
tay Last EOR was with Checksum, must be 0
bne DRV.DO.CMD.ERR
* Y=0 from TAY
stz DRV.FrmBuf.Sum
sec
.3 jsr $100
eor DRV.FrmBuf.Sum
sta DRV.FrmBuf.Sum
iny
bne .3
bcc .4
inc DRV.BUFF+1
clc
bcc .3
.4 dec DRV.BUFF+1
eor DRV.FrmBuf.Sum
bne DRV.DO.CMD.ERR
rts A=0,CC from bcc .4
*--------------------------------------
DRV.DO.CMD.ERR1
pla
pla
DRV.DO.CMD.ERR DRV.DO.CMD.ERR
lda #MLI.E.IO lda #MLI.E.IO
sec sec
@ -438,35 +470,9 @@ DRV.DO.CMD.ERR
* Write Block * Write Block
*-------------------------------------- *--------------------------------------
DRV.DO.CMD.W lda #$B1 lda (),y DRV.DO.CMD.W lda #$B1 lda (),y
sta $103 lda #MLI.E.IO
ldy #0
stz DRV.FrmBuf.Sum
sec sec
.1
eor DRV.FrmBuf.Sum
sta DRV.FrmBuf.Sum
iny
bne .1
bcc .2
inc DRV.BUFF+1
clc
bcc .1
.2 dec DRV.BUFF+1
* A = DRV.FrmBuf.Sum
* read back CMD
ldy #4 Read 5 bytes (echo from server)
.3
eor DRV.FrmBuf.Sum,y Check 5 bytes (including block Sum)
bne DRV.DO.CMD.ERR
dey
bpl .3
rts rts
*-------------------------------------- *--------------------------------------
DRV.RWBYTE bit RRAMWRAMBNK1 DRV.RWBYTE bit RRAMWRAMBNK1
@ -480,20 +486,174 @@ DRV.RWBYTE bit RRAMWRAMBNK1
DRV.SIZE .EQ *-DRV DRV.SIZE .EQ *-DRV
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
DRV.IP .PH $D400
DRV.IP.START ldy #S.IP.TOTAL.LENGTH+1
lda ZPBufCnt
sec
sbc #S.ETH.EII
sta (ZPBufPtr),y
dey
lda ZPBufCnt+1
sbc /S.ETH.EII
sta (ZPBufPtr),y
lda #0
ldy #S.IP.HDR.CHECKSUM
sta (ZPBufPtr),y
iny
sta (ZPBufPtr),y
stz ZPCheckSum RESET IP CHECKSUM
stz ZPCheckSum+1
clc
ldy #S.IP.V.IHL
ldx #10 10 words for IP Header
.1 lda (ZPBufPtr),y
adc ZPCheckSum
sta ZPCheckSum
iny
lda (ZPBufPtr),y
adc ZPCheckSum+1
sta ZPCheckSum+1
iny
dex
bne .1
ldy #S.IP.HDR.CHECKSUM
lda ZPCheckSum
adc #0
eor #$FF
sta (ZPBufPtr),y
iny
lda ZPCheckSum+1
adc #0
eor #$FF
sta (ZPBufPtr),y
rts
*--------------------------------------
clc
ldy #S.UDP.LENGTH+1
lda (ZPBufPtr),y
adc #S.IP.PROTOCOL.UDP
sta ZPCheckSum+1
dey
lda (ZPBufPtr),y
adc /S.IP.PROTOCOL.UDP (all zero)
sta ZPCheckSum
ldy #S.IP.SRC
ldx #4 4 words for SRC & DST IP
.2 lda (ZPBufPtr),y
adc ZPCheckSum
sta ZPCheckSum
iny
lda (ZPBufPtr),y
adc ZPCheckSum+1
sta ZPCheckSum+1
iny
dex
bne .2
ldy #S.UDP.LENGTH+1
lda (ZPBufPtr),y
eor #$ff
tax
dey
lda (ZPBufPtr),y
eor #$ff
ldy #S.UDP.CHECKSUM
phy Save Offset
pha Save !ByteCount.HI
lda #0 Reset Checksum
sta (ZPBufPtr),y
iny
sta (ZPBufPtr),y
>LDYA ZPBufPtr
>STYA ZPPtr1
ldy #S.IP
.3 inx
bne .4
pla
inc
beq .8
pha
.4 lda (ZPPtr1),y
adc ZPCheckSum
sta ZPCheckSum
iny
bne .5
inc ZPPtr1+1
.5 inx
bne .6
pla
inc
beq .7
pha
.6 lda (ZPPtr1),y
adc ZPCheckSum+1
sta ZPCheckSum+1
iny
bne .3
inc ZPPtr1+1
bra .3
.7 adc ZPCheckSum+1 A=0 from beq .7
sta ZPCheckSum+1
.8 ply
lda ZPCheckSum
adc #0 Don't forget to add last carry!!!
eor #$FF
sta (ZPBufPtr),y
iny
lda ZPCheckSum+1
adc #0 Don't forget to add last carry!!!
eor #$FF
sta (ZPBufPtr),y
rts
*--------------------------------------
.EP
*--------------------------------------
.LIST ON
DRV.IP.SIZE .EQ *-DRV.IP
.LIST OFF
*--------------------------------------
* CONTROL SECTION : * CONTROL SECTION :
*-------------------------------------- *--------------------------------------
.DO DRV.SIZE>255 .DO DRV.SIZE>255
* ERROR:DRV.SIZE too big ERROR:DRV.SIZE too big
.FIN .FIN
*-------------------------------------- *--------------------------------------
*-------------------------------------- *--------------------------------------
.INB usr/src/sys/km.vedrive.s.cf .INB usr/src/sys/pm.vedrive.s.cf
.INB usr/src/sys/km.vedrive.s.ip .INB usr/src/sys/pm.vedrive.s.ip
.INB usr/src/sys/km.vedrive.s.u1 .INB usr/src/sys/pm.vedrive.s.u1
.INB usr/src/sys/km.vedrive.s.u2 .INB usr/src/sys/pm.vedrive.s.u2
.INB usr/src/sys/km.vedrive.s.gs .INB usr/src/sys/pm.vedrive.s.gs
*-------------------------------------- *--------------------------------------
VEDRIVE.MSG0 .AZ "VEDRIVE (ADTPro Virtual Ethernet HD) Driver\n" VEDRIVE.MSG0 .AZ "VEDRIVE (ADTPro Virtual Ethernet HD) Driver\n"
VEDRIVE.DRVKO .AZ "VEDRIVE (Or other custom Driver) Already Installed.\n" VEDRIVE.DRVKO .AZ "VEDRIVE (Or other custom Driver) Already Installed.\n"
@ -693,5 +853,5 @@ ADT.REQ.END .EQ *
ADT.REQ.LEN .EQ *-ADT.REQ ADT.REQ.LEN .EQ *-ADT.REQ
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.vedrive.s SAVE usr/src/sys/pm.vedrive.s
ASM ASM

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000
.TF sys/km/km.vsdrive .TF sys/pm/pm.vsdrive
*-------------------------------------- *--------------------------------------
.INB inc/macros.i .INB inc/macros.i
.INB inc/io.i .INB inc/io.i
@ -618,5 +618,5 @@ DRV.SIZE .EQ *-DRV
.FIN .FIN
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/sys/km.vsdrive.s SAVE usr/src/sys/pm.vsdrive.s
ASM ASM