mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-07 13:29:56 +00:00
Kernel 0.94+
This commit is contained in:
parent
ad54cc162e
commit
43d989f537
Binary file not shown.
Binary file not shown.
@ -73,6 +73,7 @@ CS.RUN
|
||||
lda (ZPPtr1)
|
||||
cmp #'-'
|
||||
bne .2
|
||||
|
||||
jsr CS.RUN.CheckOpt
|
||||
bcc .1
|
||||
|
||||
@ -105,6 +106,7 @@ CS.RUN
|
||||
|
||||
.4 bit bSkip1
|
||||
bmi .5
|
||||
|
||||
jsr CS.RUN.SEEK
|
||||
bcs .9
|
||||
sec
|
||||
@ -124,6 +126,7 @@ CS.RUN
|
||||
|
||||
.7 lda hFile2
|
||||
beq .99
|
||||
|
||||
lda hFile1
|
||||
beq .99
|
||||
|
||||
@ -145,13 +148,16 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
|
||||
lda (pPS),y
|
||||
>SYSCALL FEOF
|
||||
bcs .9 IO error
|
||||
|
||||
tay
|
||||
bne .1 no char
|
||||
|
||||
>SYSCALL GetChar
|
||||
bcs .9 IO error
|
||||
|
||||
cmp #$03 Ctrl-C
|
||||
beq .9 Abort....
|
||||
|
||||
cmp #$13 Ctrl-S
|
||||
bne .1
|
||||
|
||||
@ -159,47 +165,65 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
|
||||
eor #$ff
|
||||
sta bPause
|
||||
bne CS.RUN.LOOP
|
||||
|
||||
.1 lda bPause
|
||||
bne CS.RUN.LOOP Pause...
|
||||
|
||||
jsr CS.RUN.READ1
|
||||
bcc .2
|
||||
|
||||
cmp #MLI.E.EOF
|
||||
bne .9
|
||||
|
||||
bra .99
|
||||
|
||||
.2 >STYA BufCnt
|
||||
jsr CS.RUN.READ2
|
||||
bcc .20
|
||||
|
||||
cmp #MLI.E.EOF
|
||||
bne .9
|
||||
|
||||
bra .99
|
||||
|
||||
.20 cpy BufCnt
|
||||
pha
|
||||
sbc BufCnt+1
|
||||
pla
|
||||
bcc .3
|
||||
|
||||
>STYA BufCnt
|
||||
|
||||
.3 ldy #0
|
||||
|
||||
.4 lda (ZPBufPtr1),y
|
||||
cmp (ZPBufPtr2),y
|
||||
beq .8
|
||||
|
||||
lda #$E0
|
||||
sta bDiff
|
||||
|
||||
bit bVerbose
|
||||
bpl .5
|
||||
|
||||
jsr CS.RUN.Print
|
||||
bcs .9
|
||||
|
||||
.5 bit bAll
|
||||
bpl .99
|
||||
|
||||
.8 iny
|
||||
cpy BufCnt
|
||||
bne .4
|
||||
|
||||
inc Offset
|
||||
bne CS.RUN.LOOP
|
||||
|
||||
inc Offset+1
|
||||
bra CS.RUN.LOOP
|
||||
|
||||
.99 lda bDiff
|
||||
|
||||
.9 sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -217,12 +241,14 @@ CS.RUN.SEEK >LDYA ZPPtr1
|
||||
>PULLL SeekOfs
|
||||
lda bSkip1
|
||||
bmi .1
|
||||
|
||||
>PUSHBI SEEK.SET
|
||||
>PUSHL SeekOfs
|
||||
lda hFile1
|
||||
|
||||
>SYSCALL FSeek
|
||||
bcs .9
|
||||
|
||||
.1 >PUSHBI SEEK.SET
|
||||
>PUSHL SeekOfs
|
||||
lda hFile2
|
||||
@ -258,18 +284,24 @@ CS.RUN.Print phy
|
||||
*--------------------------------------
|
||||
CS.QUIT lda hFile2
|
||||
beq .1
|
||||
|
||||
>SYSCALL FClose
|
||||
|
||||
.1 lda hFile1
|
||||
beq .2
|
||||
|
||||
>SYSCALL FClose
|
||||
|
||||
.2 lda hBuf2
|
||||
beq .3
|
||||
|
||||
>SYSCALL FreeMem
|
||||
|
||||
.3 lda hBuf1
|
||||
beq .8
|
||||
|
||||
>SYSCALL FreeMem
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -283,6 +315,7 @@ CS.RUN.CheckOpt ldy #1
|
||||
|
||||
.2 cmp OptionList,y
|
||||
beq .3
|
||||
|
||||
dey
|
||||
bpl .2
|
||||
|
||||
|
@ -126,9 +126,11 @@ D2MoveHead.SEI lda MoveFrom
|
||||
* sta .4+1
|
||||
* sta .5+1
|
||||
|
||||
sta IO.D2.Ph0On,x
|
||||
lda IO.D2.Ph0On,x
|
||||
*.4 lda IO.D2.RData SELF MODIFIED
|
||||
sta IO.D2.Ph0On,y
|
||||
nop
|
||||
nop
|
||||
lda IO.D2.Ph0On,y
|
||||
*.5 lda IO.D2.RData SELF MODIFIED
|
||||
|
||||
lda #IO.D2.SeekTimeF
|
||||
@ -140,10 +142,12 @@ D2MoveHead.SEI lda MoveFrom
|
||||
|
||||
jsr D2.Wait25600usec
|
||||
|
||||
.8 sta IO.D2.Ph0Off,x
|
||||
.8 pha
|
||||
lda IO.D2.Ph0Off,x
|
||||
nop
|
||||
nop
|
||||
sta IO.D2.Ph0Off,y
|
||||
lda IO.D2.Ph0Off,y
|
||||
pla
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # D2TrkRead16s
|
||||
@ -207,18 +211,18 @@ D2TrkWrite16s >PULLW ZPPtr1
|
||||
ora Slotn0
|
||||
tay
|
||||
|
||||
sta IO.D2.Ph0On,x
|
||||
lda IO.D2.Ph0On,x
|
||||
stx PhX
|
||||
sta IO.D2.Ph0On,y
|
||||
lda IO.D2.Ph0On,y
|
||||
sty PhY
|
||||
|
||||
* lda #5
|
||||
* lda #10
|
||||
* jsr D2.Wait100usecA
|
||||
|
||||
* ldx PhX
|
||||
* sta IO.D2.Ph0Off,x
|
||||
* lda IO.D2.Ph0Off,x
|
||||
* ldy PhY
|
||||
* sta IO.D2.Ph0Off,y
|
||||
* lda IO.D2.Ph0Off,y
|
||||
|
||||
stz SectNum
|
||||
|
||||
@ -263,11 +267,12 @@ D2TrkWrite16s >PULLW ZPPtr1
|
||||
sta (ZPPtr2)
|
||||
|
||||
ldx PhX
|
||||
sta IO.D2.Ph0Off,x
|
||||
lda IO.D2.Ph0Off,x
|
||||
ldy PhY
|
||||
sta IO.D2.Ph0Off,y
|
||||
lda IO.D2.Ph0Off,y
|
||||
|
||||
* jsr D2.Wait25600usec
|
||||
jsr D2.Wait25600usec
|
||||
jsr D2.Wait25600usec
|
||||
|
||||
jsr D2WriteTrackPtr2
|
||||
php
|
||||
|
@ -191,13 +191,13 @@ XRW.TrackSelect lda #2
|
||||
sta XRW.RecalibrateCnt
|
||||
sta XRW.BadSeek
|
||||
|
||||
lda XRW.ReqTrack
|
||||
jsr XRW.SEEK2T
|
||||
* lda XRW.ReqTrack
|
||||
* jsr XRW.SEEK2T
|
||||
|
||||
lda #5
|
||||
jsr XRW.Wait100usecA
|
||||
* lda #5
|
||||
* jsr XRW.Wait100usecA
|
||||
|
||||
jsr XRW.SEEKOFF
|
||||
* jsr XRW.SEEKOFF
|
||||
|
||||
.1 stz XRW.RetryCnt
|
||||
|
||||
@ -309,13 +309,14 @@ XRW.ReadAddr ldy #$FC
|
||||
tay if final checksum non-zero,
|
||||
bne .99 (2) then error.
|
||||
|
||||
clc (2)
|
||||
|
||||
.9 lda IO.D2.RData,x (4)
|
||||
bpl .9 (2)
|
||||
|
||||
eor #$DE (2)
|
||||
bne .99 (2)
|
||||
|
||||
clc (2)
|
||||
rts (6)
|
||||
|
||||
.99 sec
|
||||
@ -387,10 +388,12 @@ XRW.Seek ldx XRW.UnitIndex
|
||||
|
||||
jsr XRW.Wait25600usec
|
||||
|
||||
XRW.SEEKOFF sta IO.D2.Ph0Off,x
|
||||
XRW.SEEKOFF pha
|
||||
lda IO.D2.Ph0Off,x
|
||||
nop
|
||||
nop
|
||||
sta IO.D2.Ph0Off,y
|
||||
lda IO.D2.Ph0Off,y
|
||||
pla
|
||||
rts
|
||||
*--------------------------------------
|
||||
XRW.SEEK2T ldx XRW.UnitIndex
|
||||
@ -413,9 +416,11 @@ XRW.SEEK2QT2 and #6
|
||||
* sta .1+1
|
||||
* sta .2+1
|
||||
|
||||
sta IO.D2.Ph0On,x
|
||||
lda IO.D2.Ph0On,x
|
||||
*.1 lda IO.D2.RData SELF MODIFIED
|
||||
sta IO.D2.Ph0On,y
|
||||
nop
|
||||
nop
|
||||
lda IO.D2.Ph0On,y
|
||||
*.2 lda IO.D2.RData SELF MODIFIED
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -555,7 +560,14 @@ L596F ldy #$FF index to last byte of data to write.
|
||||
XRW.SectorIO bit XRW.bWrite
|
||||
bpl .1
|
||||
|
||||
lda XRW.ReqTrack
|
||||
jsr XRW.SEEK2T
|
||||
phx
|
||||
phy
|
||||
jsr XRW.PreNibble
|
||||
ply
|
||||
plx
|
||||
jsr XRW.SEEKOFF
|
||||
|
||||
.1 stz XRW.RetryCnt
|
||||
|
||||
@ -595,9 +607,6 @@ XRW.Write bit IO.D2.ReadProt,x (4) PREWRITE MODE
|
||||
lda #$FF (2)
|
||||
nop (2)
|
||||
|
||||
nop (2)
|
||||
nop (2)
|
||||
|
||||
sta IO.D2.WriteMode,x (5) goto write mode
|
||||
ora IO.D2.WShift,x (4)
|
||||
|
||||
@ -734,6 +743,10 @@ wrefd5 ldx #$60 (2) restore slot. warning: modified by prenib
|
||||
lda #$FF (2)
|
||||
jsr wnibl (6+9,6) write turn off byte.
|
||||
|
||||
jsr XRW.Write.RTS (12)
|
||||
jsr XRW.Write.RTS (12)
|
||||
nop (2)
|
||||
|
||||
XRW.ReadMode lda IO.D2.ReadMode,x (4) out of write mode
|
||||
lda IO.D2.WShift,x (4) to read mode.
|
||||
|
||||
|
@ -307,7 +307,7 @@ OPEN.1 php
|
||||
.DO SSCIRQ=1
|
||||
lda #SSC.CTL.CLKINT+SSC.CTL.B9600+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP
|
||||
sta SSC.CTL-$8F,x
|
||||
lda #SSC.CMD.TEIRQ+SSC.CMD.TE+SSC.CMD.DTR
|
||||
lda #SSC.CMD.TEIRQ+SSC.CMD.DTR
|
||||
sta SSC.CMD-$8F,x
|
||||
|
||||
stz INBUF.HEAD
|
||||
@ -350,6 +350,7 @@ READ php
|
||||
|
||||
stz ZPCount2
|
||||
stz ZPCount2+1
|
||||
|
||||
.10 inc ZPCount
|
||||
bne .11
|
||||
|
||||
@ -451,12 +452,12 @@ WRITE php
|
||||
beq .5 not empty, queue char
|
||||
|
||||
lda (ZPBufPtr) yes, write directly to ACIA
|
||||
sta SSC.DATA-$8F,x
|
||||
inc ZPBufPtr
|
||||
bne .4
|
||||
bne .2
|
||||
|
||||
inc ZPBufPtr+1
|
||||
|
||||
.4 sta SSC.DATA-$8F,x
|
||||
bra .2
|
||||
|
||||
.5 lda OUTBUF.HEAD
|
||||
@ -468,11 +469,11 @@ WRITE php
|
||||
|
||||
sta OUTBUF.HEAD
|
||||
lda (ZPBufPtr)
|
||||
sta OUTBUF,y
|
||||
inc ZPBufPtr
|
||||
bne .7
|
||||
bne .2
|
||||
|
||||
inc ZPBufPtr+1
|
||||
.7 sta OUTBUF,y
|
||||
bra .2
|
||||
|
||||
.ELSE
|
||||
@ -484,12 +485,12 @@ WRITE php
|
||||
beq .4
|
||||
|
||||
lda (ZPBufPtr)
|
||||
sta SSC.DATA-$8F,x
|
||||
inc ZPBufPtr
|
||||
bne .5
|
||||
bne .2
|
||||
|
||||
inc ZPBufPtr+1
|
||||
|
||||
.5 sta SSC.DATA-$8F,x
|
||||
bra .2
|
||||
.FIN
|
||||
|
||||
|
@ -826,9 +826,9 @@ DevMgrInit.VSD ldy #VSD.PATCH.SIZE-1
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
VSD.PATCH sta RRAMWRAMBNK2
|
||||
VSD.PATCH bit RRAMWRAMBNK2
|
||||
jsr $D001
|
||||
sta RRAMWRAMBNK1
|
||||
bit RRAMWRAMBNK1
|
||||
rts
|
||||
VSD.PATCH.SIZE .EQ *-VSD.PATCH
|
||||
*--------------------------------------
|
||||
@ -884,7 +884,7 @@ IrqMgrInit >LDYAI MSG.IRQ
|
||||
beq .2
|
||||
|
||||
jsr IrqMgrInit.TClock
|
||||
bcs .2
|
||||
bcs .3
|
||||
|
||||
lda #"C"
|
||||
sta IRQ.Mode
|
||||
@ -898,8 +898,19 @@ IrqMgrInit >LDYAI MSG.IRQ
|
||||
>LDYAI MSG.IRQ.CLOCK
|
||||
bra .8
|
||||
|
||||
.2 jsr IrqMgrInit.Mouse
|
||||
bcs .3
|
||||
.2 php
|
||||
sei
|
||||
sta CLRPAGE2
|
||||
lda #$60
|
||||
sta $5fa
|
||||
sta $5fb
|
||||
|
||||
stz $4FF //c ROM FF
|
||||
stz $4FC //c ROM 1,2,3,4,5
|
||||
plp
|
||||
|
||||
.3 jsr IrqMgrInit.Mouse
|
||||
bcs .7
|
||||
|
||||
lda #"V"
|
||||
sta IRQ.Mode
|
||||
@ -913,7 +924,7 @@ IrqMgrInit >LDYAI MSG.IRQ
|
||||
>LDYAI MSG.IRQ.MOUSE
|
||||
bra .8
|
||||
|
||||
.3 jsr IrqMgrInit.HZ2Tick
|
||||
.7 jsr IrqMgrInit.HZ2Tick
|
||||
|
||||
lda #"P"
|
||||
sta IRQ.Mode
|
||||
|
@ -5,11 +5,11 @@ NEW
|
||||
.OR $2000
|
||||
.TF sys/km.ramworks
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/MONITOR.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB inc/macros.i
|
||||
.INB inc/io.i
|
||||
.INB inc/monitor.i
|
||||
.INB inc/mli.i
|
||||
.INB inc/mli.e.i
|
||||
*--------------------------------------
|
||||
TmpPtr1 .EQ $0
|
||||
TmpPtr2 .EQ $2
|
||||
@ -53,7 +53,7 @@ RW.Init >LDYAI RW.MSG
|
||||
|
||||
tya
|
||||
inc + 1 page AUX mem
|
||||
|
||||
|
||||
pha Total page detected
|
||||
|
||||
lsr divide by 4 to compute KB size
|
||||
@ -82,7 +82,7 @@ RW.Init >LDYAI RW.MSG
|
||||
|
||||
>LDYAI RW.MSG.KO3
|
||||
bra .9
|
||||
|
||||
|
||||
.3 >LDYAI RW.MSG.OK3
|
||||
|
||||
.9 jsr PrintFYA
|
||||
@ -114,14 +114,14 @@ RW.Detect2 php
|
||||
bpl .1
|
||||
|
||||
lda #0
|
||||
|
||||
|
||||
.2 sta RWBankSelect
|
||||
*--------------------------------------
|
||||
* Added after David Finnigan from macgui.com testing sessions
|
||||
*
|
||||
*
|
||||
pha
|
||||
pla
|
||||
*
|
||||
*
|
||||
* to address possibly a timing issue with Accelerators
|
||||
*--------------------------------------
|
||||
sta 0
|
||||
@ -130,16 +130,16 @@ RW.Detect2 php
|
||||
eor #$FF
|
||||
inc
|
||||
bpl .2
|
||||
|
||||
|
||||
ldx #0
|
||||
|
||||
|
||||
.3 stx RWBankSelect
|
||||
*--------------------------------------
|
||||
* Added after David Finnigan from macgui.com testing sessions
|
||||
*
|
||||
*
|
||||
pha
|
||||
pla
|
||||
*
|
||||
*
|
||||
* to address possibly a timing issue with Accelerators
|
||||
*--------------------------------------
|
||||
lda 0
|
||||
@ -147,13 +147,13 @@ RW.Detect2 php
|
||||
eor #$ff
|
||||
cmp 1
|
||||
bne .4
|
||||
|
||||
|
||||
inx
|
||||
|
||||
cpy #127
|
||||
bne .3
|
||||
|
||||
.4 ldy #127 X = detected page count
|
||||
.4 ldy #127 X = detected page count
|
||||
|
||||
.6 sty RWBankSelect
|
||||
|
||||
@ -169,10 +169,10 @@ RW.Detect2 php
|
||||
|
||||
txa PGCNT > 0 ?
|
||||
beq .9
|
||||
|
||||
|
||||
dec minus 1 for AUX mem
|
||||
beq .9
|
||||
|
||||
|
||||
sta RW.PGCNT PGCNT = last detected page
|
||||
|
||||
clc
|
||||
@ -183,7 +183,7 @@ RW.Detect2 php
|
||||
*--------------------------------------
|
||||
RW.Install lda RRAMWRAMBNK1
|
||||
lda RRAMWRAMBNK1
|
||||
|
||||
|
||||
ldx #RWDRV.SIZE
|
||||
|
||||
.1 lda RWDRV.B.START-1,x
|
||||
@ -276,14 +276,14 @@ RW.Format jsr RW.BLOCK.SET00
|
||||
beq .3
|
||||
inx
|
||||
.3 stx RW.BITMAPCNT store TOTAL bitmap block needed
|
||||
|
||||
|
||||
.4 lda RW.FBITMAPCNT
|
||||
beq .49
|
||||
dec RW.FBITMAPCNT
|
||||
jsr RW.BLOCK.SETFF
|
||||
|
||||
bra .5
|
||||
|
||||
|
||||
.49 jsr RW.BLOCK.SET00
|
||||
lda RW.PGCNT
|
||||
and #$1F compute incomplete bitmap block
|
||||
@ -293,20 +293,26 @@ RW.Format jsr RW.BLOCK.SET00
|
||||
asl times 16 for byte count
|
||||
tay
|
||||
lda #$FF
|
||||
bcc .42 first half of block only
|
||||
bcc .42 first half of block only
|
||||
|
||||
ldx #0
|
||||
.40 sta RW.BLOCK,x
|
||||
inx
|
||||
bne .40
|
||||
|
||||
cpy #0
|
||||
beq .5
|
||||
|
||||
.41 sta RW.BLOCK+$ff,y
|
||||
dey
|
||||
bne .41
|
||||
|
||||
bra .5
|
||||
|
||||
.42 sta RW.BLOCK-1,y
|
||||
dey
|
||||
bne .42
|
||||
|
||||
.5 inc RW.MLIWRITEBLOCK.BLK
|
||||
lda RW.MLIWRITEBLOCK.BLK
|
||||
cmp #4 Are we writing first volume bitmap ?
|
||||
@ -314,38 +320,49 @@ RW.Format jsr RW.BLOCK.SET00
|
||||
|
||||
* lda #$CF Mark Block 0 & 1 free, 2,3 used (vol hdr)
|
||||
lda #$0F
|
||||
sta RW.BLOCK
|
||||
sta RW.BLOCK
|
||||
|
||||
ldy #0
|
||||
lda #$8 Start a BLOCK 4 (%00001000)
|
||||
ldx RW.BITMAPCNT
|
||||
|
||||
.62 pha
|
||||
eor RW.BLOCK,y Mark bitmap blocks as "used"
|
||||
sta RW.BLOCK,y
|
||||
pla
|
||||
dex
|
||||
beq .63
|
||||
|
||||
lsr
|
||||
bne .62
|
||||
|
||||
lda #$80
|
||||
iny
|
||||
bra .62
|
||||
|
||||
.63 jsr MLI Write Block 4,5...
|
||||
.DA #MLIWRITEBLOCK
|
||||
.DA RW.MLIWRITEBLOCK
|
||||
bcs .9
|
||||
|
||||
dec RW.BITMAPCNT another bitmap block needed ?
|
||||
bne .4
|
||||
|
||||
clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
RW.BLOCK.SETFF lda #$FF
|
||||
bra RW.BLOCK.SET
|
||||
.HS 2C BIT ABS
|
||||
|
||||
RW.BLOCK.SET00 lda #$00
|
||||
RW.BLOCK.SET ldx #0
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 sta RW.BLOCK,x
|
||||
sta RW.BLOCK+$100,x
|
||||
inx
|
||||
bne .1
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
RW.MLIWRITEBLOCK
|
||||
@ -372,7 +389,7 @@ RW.BLOCK2.CT .BS 4 Creation time
|
||||
RW.BLOCK2.TB .BS 2 Total Blocks
|
||||
RW.BLOCK2.END .EQ *
|
||||
*--------------------------------------
|
||||
.INB USR/SRC/SHARED/X.PRINTF.S
|
||||
.INB usr/src/shared/x.printf.s
|
||||
*--------------------------------------
|
||||
RW.MSG .AZ "RAMWorks (I,II,III,z-Ram) Driver For A2osX\n"
|
||||
RW.MSG.OK .AZ "/RAM3 Device Already Installed.\n"
|
||||
@ -386,21 +403,19 @@ RW.MSG.KO3 .AZ "RamWorks Drive Format Error.\n"
|
||||
* Driver for Ramworks in main LC
|
||||
* $FF00 -> $FF9A (Inclusive)
|
||||
* $FF58 MUST BE $60 (RTS)
|
||||
* DO NOT trash DRV.COMMAND...DRV.BLKNUM as ProDOS
|
||||
* DO NOT trash DRV.COMMAND...DRV.BLKNUM as ProDOS
|
||||
* reuses it after Block operation
|
||||
* A1,A2 are used by Disk II Driver,
|
||||
* A1,A2 are used by Disk II Driver,
|
||||
* so we use it safely as Tmp Ptr
|
||||
*--------------------------------------
|
||||
DRV.A2L .EQ $3E
|
||||
DRV.A2H .EQ $3F
|
||||
DRV.COMMAND .EQ $42
|
||||
DRV.BUFF .EQ $44
|
||||
DRV.BLKNUM .EQ $46
|
||||
DRV.BUFF .EQ $44
|
||||
DRV.BLKNUM .EQ $46
|
||||
*--------------------------------------
|
||||
RWDRV.B.START .PH $FF00
|
||||
RWDRV.START
|
||||
* cld ProDOS will check that byte!!!
|
||||
ldy DRV.COMMAND 0 = Status ?
|
||||
RWDRV.START ldy DRV.COMMAND 0 = Status ?
|
||||
beq RMDRV.CMDSTATUS
|
||||
|
||||
cpy #3
|
||||
@ -418,7 +433,9 @@ RWDRV.START
|
||||
|
||||
php Disable IRQ as no vector set in RW Banks
|
||||
sei
|
||||
|
||||
|
||||
sta CLR80STORE make sure SETREADAUX/SETWRITEAUX effective everywhere
|
||||
|
||||
txa Get Back DRV.BLKNUM
|
||||
asl compute PAGE = blocknumLO *2
|
||||
pha
|
||||
@ -435,7 +452,6 @@ RWDRV.START
|
||||
* X=Page($02 -> $BF),A=Bank,Y=CMD
|
||||
*--------------------------------------
|
||||
sta RWBankSelect Select RAMWorks Bank
|
||||
sta CLR80STORE make sure SETREADAUX/SETWRITEAUX effective everywhere
|
||||
|
||||
inx second 256 bytes first
|
||||
stx DRV.A2H Use DRV.A1L/H for RAM PTR
|
||||
@ -492,7 +508,7 @@ RWDRV.IOERR lda #MLI.E.IO Carry already set
|
||||
* X=Page(0/1 or LC),A=Bank
|
||||
*--------------------------------------
|
||||
RWDRV.GOAUX pha save BANK
|
||||
sta SETWRITEAUX
|
||||
sta SETWRITEAUX
|
||||
|
||||
ldy #RWDRVX.XM.SIZE Backup begining of $300 to generate move code
|
||||
|
||||
@ -522,7 +538,7 @@ RWDRV.SIZE .EQ RWDRV.B.END-RWDRV.B.START
|
||||
* $0200 -> $02FF TMP buffer for PAGE copy
|
||||
* $0300 -> $03FD (Inclusive)
|
||||
* do not trash $03FE-$03FF (IRQ Vector)
|
||||
* X=Page(0/1 or LC),A=Bank
|
||||
* X=Page(0/1 or LC),A=Bank
|
||||
*--------------------------------------
|
||||
RMDRVX.TMP .EQ $200
|
||||
RWDRV.XM.RUN .EQ $300
|
||||
@ -530,6 +546,8 @@ RWDRV.XM.RUN .EQ $300
|
||||
RWDRVX.B.START
|
||||
.PH $0300
|
||||
RWDRVX.START sta RWDRVX.XM.BANK+1 setup BANK
|
||||
ldy #RRAMWRAMBNK1
|
||||
|
||||
txa
|
||||
beq .1 page 0/1, no need to check BANK
|
||||
|
||||
@ -538,20 +556,26 @@ RWDRVX.START sta RWDRVX.XM.BANK+1 setup BANK
|
||||
|
||||
ora #$10 Remap $C0 page to $D0 BNK2
|
||||
|
||||
.1 ror RWDRVX.XM.RWLC+1 Save Carry to select proper RW bank later
|
||||
ldy #RRAMWRAMBNK2
|
||||
|
||||
.1 sty RWDRVX.XM.RWLC+1 Save to select proper RW bank later
|
||||
|
||||
ldy DRV.BUFF
|
||||
ldx DRV.BUFF+1
|
||||
|
||||
lsr DRV.COMMAND DRV.COMMAND: 1=READ,2=WRITE
|
||||
bcc .2 CC=WRITE, CS=READ
|
||||
|
||||
stz RWDRVX.XM.SRC+1 READ from src LO = 0
|
||||
sta RWDRVX.XM.SRC+2 READ from src HI = PAGE
|
||||
|
||||
sty RWDRVX.XM.DST+1 WRITE to DRV.BUFF
|
||||
stx RWDRVX.XM.DST+2
|
||||
bra .3
|
||||
|
||||
.2 sty RWDRVX.XM.SRC+1 READ from DRV.BUFF
|
||||
stx RWDRVX.XM.SRC+2
|
||||
|
||||
stz RWDRVX.XM.DST+1 WRITE to dst LO = 0
|
||||
sta RWDRVX.XM.DST+2 WRITE to dst HI = PAGE
|
||||
|
||||
@ -568,7 +592,7 @@ RWDRVX.START sta RWDRVX.XM.BANK+1 setup BANK
|
||||
*--------------------------------------
|
||||
* Called form Main LC after RWDRVX.XM execution
|
||||
*--------------------------------------
|
||||
RWDRVX.RESTORE ldy #RWDRVX.XM.SIZE Now, restore begining of $300
|
||||
RWDRVX.RESTORE ldy #RWDRVX.XM.SIZE Now, restore begining of $300
|
||||
|
||||
.1 lda RWDRVX.XM.SAVE-1,y
|
||||
sta RWDRV.XM.RUN-1,y
|
||||
@ -585,11 +609,11 @@ RWDRVX.RESTORE ldy #RWDRVX.XM.SIZE Now, restore begining of $300
|
||||
RWDRVX.XM.START ldy #2 2 pages to copy
|
||||
|
||||
RWDRVX.XM.COPY sta CLRALTZP
|
||||
|
||||
|
||||
jsr RWDRV.XM.RUN+RWDRVX.XM.SRCLC-RWDRVX.XM.START
|
||||
sta $C000,x select proper Main/Aux ZP/LC
|
||||
sta RWBankSelect
|
||||
|
||||
|
||||
ldx #0
|
||||
|
||||
RWDRVX.XM.SRC lda $FFFF,x
|
||||
@ -598,11 +622,11 @@ RWDRVX.XM.SRC lda $FFFF,x
|
||||
bne RWDRVX.XM.SRC
|
||||
|
||||
sta CLRALTZP
|
||||
|
||||
|
||||
jsr RWDRV.XM.RUN+RWDRVX.XM.DSTLC-RWDRVX.XM.START
|
||||
sta $C000,x select proper Main/Aux ZP/LC
|
||||
sta RWBankSelect
|
||||
|
||||
|
||||
ldx #0
|
||||
|
||||
RWDRVX.XM.2 lda RMDRVX.TMP,x
|
||||
@ -614,33 +638,32 @@ RWDRVX.XM.DST sta $FFFF,x
|
||||
inc RWDRV.XM.RUN+RWDRVX.XM.DST+2-RWDRVX.XM.START
|
||||
dey
|
||||
bne RWDRVX.XM.COPY
|
||||
|
||||
|
||||
sta CLRALTZP
|
||||
stz RWBankSelect
|
||||
*--------------------------------------
|
||||
RWDRVX.XM.MNLC bit RRAMWRAMBNK1 ProDOS always uses LCBANK1
|
||||
* bit RRAMWRAMBNK1
|
||||
|
||||
|
||||
lda #0
|
||||
|
||||
|
||||
ldx #CLRALTZP
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
RWDRVX.XM.SRCLC bcc RWDRVX.XM.MNLC CC=WRITE,CS=READ?
|
||||
.HS 2C BIT ABS
|
||||
RWDRVX.XM.DSTLC bcs RWDRVX.XM.MNLC CC=WRITE,CS=READ?
|
||||
RWDRVX.XM.DSTLC bcs RWDRVX.XM.MNLC CC=WRITE,CS=READ?
|
||||
*--------------------------------------
|
||||
RWDRVX.XM.RWLC lda #$FF
|
||||
bmi RWDRVX.XM.BANK
|
||||
RWDRVX.XM.RWLC ldx #$FF
|
||||
|
||||
bit RRAMWRAMBNK2
|
||||
* bit RRAMWRAMBNK2
|
||||
* bit $C000,x
|
||||
bit $C000,x
|
||||
|
||||
RWDRVX.XM.BANK lda #$FF
|
||||
|
||||
|
||||
ldx #SETALTZP
|
||||
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
.LIST ON
|
||||
@ -668,5 +691,5 @@ RWDRVX.SIZE .EQ RWDRVX.B.END-RWDRVX.B.START
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/SYS/KM.RAMWORKS.S
|
||||
SAVE usr/src/sys/km.ramworks.s
|
||||
ASM
|
||||
|
@ -111,13 +111,10 @@ SSC.Detect stz TmpPtr1
|
||||
adc #$8F
|
||||
tax X=SlotN0
|
||||
stz SSC.RESET-$8F,x
|
||||
jsr VSDRIVE.Wait
|
||||
lda #SSC.CTL.CLKINT+SSC.CTL.B115200+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP
|
||||
sta SSC.CTL-$8F,x
|
||||
jsr VSDRIVE.Wait
|
||||
lda #SSC.CMD.RIRQDIS+SSC.CMD.TE+SSC.CMD.DTR
|
||||
sta SSC.CMD-$8F,x
|
||||
jsr VSDRIVE.Wait
|
||||
|
||||
lda TmpPtr1+1 A=Slot Cn, X=n0
|
||||
|
||||
@ -191,7 +188,6 @@ VSDRIVE.Ping ldx DRV+1 DRV.Slotn0
|
||||
and #SSC.STATUS.RDRF incoming char?
|
||||
bne .6
|
||||
|
||||
* jsr VSDRIVE.Wait
|
||||
jsr VSDRIVE.IncTimer
|
||||
bne .5
|
||||
|
||||
@ -218,13 +214,6 @@ VSDRIVE.IncTimer
|
||||
inc VSDRIVE.Ping.TO+1
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
VSDRIVE.Wait lda #0
|
||||
|
||||
.1 dec
|
||||
bne .1
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
VSDRIVE.CMDS .HS C6.00.00.03
|
||||
.DA #ADT.CMD.VSD
|
||||
* C6=C5 eor 03 eor 00 eor 00
|
||||
@ -322,9 +311,9 @@ VSDRIVE.OK .AZ "VSDRIVE Driver Successfully Installed.\n"
|
||||
REGULAR .AS "(C)APPLE "
|
||||
REGULAR.SIZE .EQ *-REGULAR
|
||||
PATCH .PH DRV.EntryPoint
|
||||
sta RRAMWRAMBNK2
|
||||
bit RRAMWRAMBNK2
|
||||
jsr $D001
|
||||
sta RRAMWRAMBNK1
|
||||
bit RRAMWRAMBNK1
|
||||
rts
|
||||
.EP
|
||||
PATCH.SIZE .EQ *-PATCH
|
||||
@ -353,6 +342,9 @@ DRV.BLKNUM .EQ $46
|
||||
DRV .PH $D001 Main LC Bnk 2 $D001->$DFFF
|
||||
|
||||
DRV.START ldx #$ff Self Modified
|
||||
|
||||
bit RRAMWRAMBNK2
|
||||
|
||||
lda DRV.COMMAND S=0,R=1,W=2,F=3
|
||||
bne .1
|
||||
|
||||
@ -401,9 +393,9 @@ DRV.START ldx #$ff Self Modified
|
||||
dey
|
||||
bpl .3
|
||||
|
||||
ldy #8
|
||||
ldy #DRV.102.LEN-1
|
||||
|
||||
.5 lda DRV.READWRITE,y
|
||||
.5 lda DRV.102,y
|
||||
sta $102,y
|
||||
dey
|
||||
bpl .5
|
||||
@ -530,10 +522,11 @@ DRV.SSCGet lda SSC.STATUS-$8F,x
|
||||
lda SSC.DATA-$8F,x
|
||||
rts
|
||||
*--------------------------------------
|
||||
DRV.READWRITE bit RRAMWRAMBNK1
|
||||
DRV.102 bit RRAMWRAMBNK1
|
||||
sta (DRV.BUFF),y
|
||||
bit RRAMWRAMBNK2
|
||||
rts
|
||||
DRV.102.LEN .EQ *-DRV.102
|
||||
*--------------------------------------
|
||||
DRV.CmdBuf.Sum .BS 1 Reverse order for dey
|
||||
DRV.CmdBuf.BlkH .BS 1
|
||||
|
Loading…
Reference in New Issue
Block a user