2017-01-08 03:35:35 +00:00
|
|
|
DiskIIArray
|
|
|
|
!byte 00,00,00,00,00,00,00
|
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; ScanForDiskII
|
|
|
|
; scan all slots for things that
|
|
|
|
; look like Disk II cards
|
|
|
|
;
|
|
|
|
; out: all registers clobbered
|
|
|
|
; all flags clobbered
|
|
|
|
; DiskIIArray filled with 00 or FF
|
|
|
|
;-------------------------------
|
2017-01-24 00:57:43 +00:00
|
|
|
!zone {
|
2017-01-08 03:35:35 +00:00
|
|
|
ScanForDiskII
|
|
|
|
lda #$00
|
|
|
|
sta cmp1
|
|
|
|
ldx #$07
|
2017-01-24 00:57:43 +00:00
|
|
|
.fingerprint
|
2017-01-08 03:35:35 +00:00
|
|
|
txa
|
|
|
|
ora #$C0
|
|
|
|
sta cmp1+1
|
|
|
|
ldy #$01
|
|
|
|
lda (cmp1),y
|
|
|
|
cmp #$20
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .next
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$03
|
|
|
|
lda (cmp1),y
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .next
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$05
|
|
|
|
lda (cmp1),y
|
|
|
|
cmp #$03
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .next
|
2017-01-08 03:35:35 +00:00
|
|
|
ldy #$FF
|
|
|
|
lda (cmp1),y
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .next
|
2017-01-08 03:35:35 +00:00
|
|
|
tya
|
|
|
|
sta DiskIIArray-1,x
|
2017-01-24 00:57:43 +00:00
|
|
|
.next
|
2017-01-08 03:35:35 +00:00
|
|
|
dex
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .fingerprint
|
2017-01-08 03:35:35 +00:00
|
|
|
rts
|
2017-01-24 00:57:43 +00:00
|
|
|
}
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; NextSlot
|
|
|
|
;-------------------------------
|
2017-01-24 00:57:43 +00:00
|
|
|
!zone {
|
2017-01-08 03:35:35 +00:00
|
|
|
NextSlot
|
|
|
|
lda DRIVE
|
|
|
|
cmp #$31
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .incslot
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$32
|
|
|
|
sta DRIVE
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .done ; unconditional branch
|
|
|
|
.incslot
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$31
|
|
|
|
sta DRIVE
|
|
|
|
inc SLOT
|
|
|
|
lda SLOT
|
|
|
|
cmp #$38
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .nowrap
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$31
|
|
|
|
sta SLOT
|
2017-01-24 00:57:43 +00:00
|
|
|
.nowrap
|
2017-01-08 03:35:35 +00:00
|
|
|
sec
|
|
|
|
sbc #$30
|
|
|
|
tax
|
|
|
|
lda DiskIIArray-1,x
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .incslot
|
|
|
|
.done
|
2017-01-08 03:35:35 +00:00
|
|
|
lda SLOT
|
|
|
|
cmp #$36
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .reallydone
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$32
|
|
|
|
sta DRIVE
|
2017-01-24 00:57:43 +00:00
|
|
|
.reallydone
|
2017-01-08 03:35:35 +00:00
|
|
|
rts
|
2017-01-24 00:57:43 +00:00
|
|
|
}
|
2017-05-16 16:14:20 +00:00
|
|
|
|
|
|
|
!zone {
|
|
|
|
ScanForRAMDisk
|
|
|
|
lda #$00
|
|
|
|
sta iunit
|
|
|
|
- lda iunit
|
|
|
|
clc
|
|
|
|
adc #$10
|
|
|
|
sta iunit
|
|
|
|
beq .done
|
|
|
|
cmp #$80
|
|
|
|
beq -
|
2017-06-23 03:50:39 +00:00
|
|
|
pha
|
|
|
|
and #$70
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
tay
|
|
|
|
pla
|
|
|
|
ldx DiskIIArray-1,y
|
|
|
|
bne -
|
2017-05-16 16:14:20 +00:00
|
|
|
jsr GetVolumeName
|
|
|
|
bcs -
|
2017-06-23 03:50:39 +00:00
|
|
|
lda OnlineReturn
|
|
|
|
beq -
|
|
|
|
jsr GetVolumeInfo
|
|
|
|
|
|
|
|
;watch for RAM disk type
|
|
|
|
|
|
|
|
lda filetype
|
|
|
|
and #$0F
|
|
|
|
cmp #$0F
|
|
|
|
bne -
|
|
|
|
|
2017-08-07 23:16:33 +00:00
|
|
|
;check for RAM[x] by name
|
2017-07-02 00:16:12 +00:00
|
|
|
|
2017-08-07 23:16:33 +00:00
|
|
|
ldy OnlineReturn
|
|
|
|
cpy #4
|
|
|
|
beq +
|
2017-08-13 16:07:16 +00:00
|
|
|
cpy #5
|
|
|
|
bne -
|
2017-08-07 23:16:33 +00:00
|
|
|
dey
|
|
|
|
+
|
|
|
|
-- lda SlashRAM-1,y
|
|
|
|
cmp VolumeName-1,y
|
2017-07-02 00:16:12 +00:00
|
|
|
bne -
|
2017-08-07 23:16:33 +00:00
|
|
|
dey
|
|
|
|
bne --
|
2017-07-02 00:16:12 +00:00
|
|
|
|
2017-06-23 03:50:39 +00:00
|
|
|
;check free space
|
|
|
|
;need at least $118 blocks
|
|
|
|
|
|
|
|
sec
|
|
|
|
lda auxtype
|
|
|
|
sbc blocks
|
|
|
|
tax
|
|
|
|
lda auxtype+1
|
|
|
|
sbc blocks+1
|
|
|
|
cmp #1
|
|
|
|
bcc -
|
|
|
|
bne +
|
|
|
|
cpx #$18
|
|
|
|
bcc -
|
|
|
|
+ lda #TRUE
|
|
|
|
sta gUsingRAMDisk
|
2017-05-16 16:14:20 +00:00
|
|
|
.done
|
2017-06-23 03:50:39 +00:00
|
|
|
rts
|
2017-08-07 23:16:33 +00:00
|
|
|
|
|
|
|
SlashRAM !byte $2F, $52, $41, $4D
|
2017-05-16 16:14:20 +00:00
|
|
|
}
|