detect RAMFactor-style RAM disks

This commit is contained in:
Peter Ferrie 2017-07-01 17:16:12 -07:00
parent 24c0a9fa9d
commit e3445b08bf
3 changed files with 21 additions and 9 deletions

View File

@ -29,7 +29,7 @@ PC_SETEOF = $02
PRODOSMLI = $BF00 ; [callable] MLI entry point
!ct "lcase.ct"
RAMFileName !text "PASSPORT.IMG"
RAMFileName !text "PASSPORTTMP.DSK"
RAMFileName_e
; MLI error codes
@ -52,7 +52,6 @@ ERR_EOF = $4C
WriteTrackMLI
jsr SwapProDOS
lda gUsingRAMDisk
cmp #TRUE
beq +
jsr ReorderBuffer
+ lda #$81 ; 'write block' command
@ -92,7 +91,6 @@ WriteTrackMLI
sta mliparam+3
.writeloop
lda gUsingRAMDisk
cmp #TRUE
beq +
lda mlicmd
ldy #$03 ; parameter count
@ -114,7 +112,6 @@ WriteTrackMLI
php
pha
lda gUsingRAMDisk
cmp #TRUE
beq +
jsr ReorderBuffer
+ jsr SwapProDOS
@ -539,7 +536,6 @@ DeleteFile
!zone {
CreateRAMFile
lda gUsingRAMDisk
cmp #TRUE
bne .done
;existing file being reused?

View File

@ -482,8 +482,6 @@ nextsector
lda #s_passdemuf
bne .passprint ; always branches
.passcrack
lda gPatchCount
beq .passcrack0
lda gUsingRAMDisk
cmp #FALSE
beq .skipram
@ -491,6 +489,8 @@ nextsector
jsr PrintByID
jsr WriteRAMToDisk
.skipram
lda gPatchCount
beq .passcrack0
lda #s_passcrack
!byte $2C ; hide next LDA
.passcrack0
@ -608,7 +608,6 @@ WriteTrackNA ; entry point used by Special Delivery tracer
beq .write
lda #s_writeram ; only print "writing to" message once
ldx gUsingRAMDisk
cpx #TRUE
beq +
lda #s_writing ; only print "writing to" message once
+ jsr PrintByID

View File

@ -93,6 +93,7 @@ ScanForRAMDisk
lsr
lsr
lsr
sta .driverbase+1
lsr
tay
pla
@ -105,13 +106,29 @@ ScanForRAMDisk
jsr GetVolumeInfo
;watch for RAM disk type
;can't filter on device driver because RAMWorks
lda filetype
and #$0F
cmp #$0F
bne -
.driverbase
ldx #$d1
lda $BF11,x
sta .drivercode+2
and #$f0
cmp #$c0
bne +
;RAMFactor detection
;looks like a SmartPort device
.drivercode
lda $d100
cmp #$c9
bne -
+
;check free space
;need at least $118 blocks