Added functions to learn about the unit numbers of the ProDOS 8 devices found.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4663 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
38
libsrc/apple2/drives.s
Normal file
38
libsrc/apple2/drives.s
Normal file
@@ -0,0 +1,38 @@
|
||||
;
|
||||
; Oliver Schmidt, 2010-05-24
|
||||
;
|
||||
; unsigned char drivecount (void);
|
||||
; unsigned char* drivelist (void);
|
||||
;
|
||||
|
||||
.export _drivecount, _drivelist
|
||||
.import __dos_type
|
||||
|
||||
.include "mli.inc"
|
||||
|
||||
_drivecount:
|
||||
ldx #$00
|
||||
|
||||
; Check for ProDOS 8
|
||||
lda __dos_type
|
||||
bne :+
|
||||
rts
|
||||
|
||||
; Number of on-line devices (minus 1)
|
||||
: ldy DEVCNT
|
||||
iny
|
||||
tya
|
||||
rts
|
||||
|
||||
_drivelist:
|
||||
ldx #$00
|
||||
|
||||
; Check for ProDOS 8
|
||||
lda __dos_type
|
||||
bne :+
|
||||
rts
|
||||
|
||||
; Up to 14 units may be active
|
||||
: lda #<DEVLST
|
||||
ldx #>DEVLST
|
||||
rts
|
||||
Reference in New Issue
Block a user