passport/src/slots.a

150 lines
2.8 KiB
Plaintext
Raw Normal View History

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
;-------------------------------
!zone {
2017-01-08 03:35:35 +00:00
ScanForDiskII
lda #$00
sta cmp1
ldx #$07
.fingerprint
2017-01-08 03:35:35 +00:00
txa
ora #$C0
sta cmp1+1
ldy #$01
lda (cmp1),y
cmp #$20
bne .next
2017-01-08 03:35:35 +00:00
ldy #$03
lda (cmp1),y
bne .next
2017-01-08 03:35:35 +00:00
ldy #$05
lda (cmp1),y
cmp #$03
bne .next
2017-01-08 03:35:35 +00:00
ldy #$FF
lda (cmp1),y
bne .next
2017-01-08 03:35:35 +00:00
tya
sta DiskIIArray-1,x
.next
2017-01-08 03:35:35 +00:00
dex
bne .fingerprint
2017-01-08 03:35:35 +00:00
rts
}
2017-01-08 03:35:35 +00:00
;-------------------------------
; NextSlot
;-------------------------------
!zone {
2017-01-08 03:35:35 +00:00
NextSlot
lda DRIVE
cmp #$31
bne .incslot
2017-01-08 03:35:35 +00:00
lda #$32
sta DRIVE
bne .done ; unconditional branch
.incslot
2017-01-08 03:35:35 +00:00
lda #$31
sta DRIVE
inc SLOT
lda SLOT
cmp #$38
bne .nowrap
2017-01-08 03:35:35 +00:00
lda #$31
sta SLOT
.nowrap
2017-01-08 03:35:35 +00:00
sec
sbc #$30
tax
lda DiskIIArray-1,x
beq .incslot
.done
2017-01-08 03:35:35 +00:00
lda SLOT
cmp #$36
bne .reallydone
2017-01-08 03:35:35 +00:00
lda #$32
sta DRIVE
.reallydone
2017-01-08 03:35:35 +00:00
rts
}
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
}