passport/src/slots.a

106 lines
2.0 KiB
Plaintext
Raw Normal View History

2017-01-07 22:35:35 -05: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-07 22:35:35 -05:00
ScanForDiskII
lda #$00
sta cmp1
ldx #$07
.fingerprint
2017-01-07 22:35:35 -05:00
txa
ora #$C0
sta cmp1+1
ldy #$01
lda (cmp1),y
cmp #$20
bne .next
2017-01-07 22:35:35 -05:00
ldy #$03
lda (cmp1),y
bne .next
2017-01-07 22:35:35 -05:00
ldy #$05
lda (cmp1),y
cmp #$03
bne .next
2017-01-07 22:35:35 -05:00
ldy #$FF
lda (cmp1),y
bne .next
2017-01-07 22:35:35 -05:00
tya
sta DiskIIArray-1,x
.next
2017-01-07 22:35:35 -05:00
dex
bne .fingerprint
2017-01-07 22:35:35 -05:00
rts
}
2017-01-07 22:35:35 -05:00
;-------------------------------
; NextSlot
;-------------------------------
!zone {
2017-01-07 22:35:35 -05:00
NextSlot
lda DRIVE
cmp #$31
bne .incslot
2017-01-07 22:35:35 -05:00
lda #$32
sta DRIVE
bne .done ; unconditional branch
.incslot
2017-01-07 22:35:35 -05:00
lda #$31
sta DRIVE
inc SLOT
lda SLOT
cmp #$38
bne .nowrap
2017-01-07 22:35:35 -05:00
lda #$31
sta SLOT
.nowrap
2017-01-07 22:35:35 -05:00
sec
sbc #$30
tax
lda DiskIIArray-1,x
beq .incslot
.done
2017-01-07 22:35:35 -05:00
lda SLOT
cmp #$36
bne .reallydone
2017-01-07 22:35:35 -05:00
lda #$32
sta DRIVE
.reallydone
2017-01-07 22:35:35 -05:00
rts
}
2017-05-16 12:14:20 -04:00
!zone {
ScanForRAMDisk
rts
lda #$00
sta $0800
sta $0801
lda #$00
sta iunit
- lda iunit
clc
adc #$10
sta iunit
beq .done
cmp #$80
beq -
jsr GetVolumeName
bcs -
lda #<VolumeName
sta $0800
lda #>VolumeName
sta $0801
.done
jmp $ff59
}