2012-09-09 13:38:32 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 2012-09-04
|
|
|
|
;
|
|
|
|
; unsigned char getfirstdevice (void);
|
|
|
|
; unsigned char __fastcall__ getnextdevice (unsigned char device);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _getfirstdevice
|
|
|
|
.export _getnextdevice
|
2012-10-15 21:59:51 +00:00
|
|
|
.import __dos_type, isdevice
|
2012-09-09 13:38:32 +00:00
|
|
|
|
|
|
|
.include "zeropage.inc"
|
|
|
|
|
|
|
|
_getfirstdevice:
|
|
|
|
lda #$FF
|
|
|
|
; Fall through
|
|
|
|
|
|
|
|
_getnextdevice:
|
2012-10-15 21:59:51 +00:00
|
|
|
tax
|
|
|
|
next: inx
|
2018-09-02 21:06:27 +00:00
|
|
|
cpx #$FF ; INVALID_DEVICE
|
2012-09-09 13:38:32 +00:00
|
|
|
beq done
|
|
|
|
|
|
|
|
; Check for ProDOS 8
|
2012-10-15 21:59:51 +00:00
|
|
|
lda __dos_type
|
2012-09-09 13:38:32 +00:00
|
|
|
beq next
|
|
|
|
|
2012-10-15 21:59:51 +00:00
|
|
|
; Check for valid device
|
|
|
|
jsr isdevice
|
|
|
|
bne next
|
2012-09-09 13:38:32 +00:00
|
|
|
|
2012-10-15 21:59:51 +00:00
|
|
|
done: txa
|
|
|
|
ldx #$00
|
2012-09-09 13:38:32 +00:00
|
|
|
rts
|