I wasn't aware that the unit numbers in the ProDOS device list contain device type identifiers in the low nibble. So if we can't use the device list entries as-is we can as well present the high nibble as low nibble to the user thus providing more meaningful device numbers.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5852 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
;
|
||||
|
||||
.export _dio_open
|
||||
.import return0, __dos_type
|
||||
.import return0, __dos_type, isdevice
|
||||
|
||||
.include "errno.inc"
|
||||
.include "mli.inc"
|
||||
@@ -17,19 +17,22 @@ _dio_open:
|
||||
lda #$01 ; "Bad system call number"
|
||||
bne oserr ; Branch always
|
||||
|
||||
; Walk device list
|
||||
: ldx DEVCNT
|
||||
: cmp DEVLST,x
|
||||
beq :+ ; Found drive_id in device list
|
||||
dex
|
||||
bpl :-
|
||||
; Check for valid device
|
||||
: tax
|
||||
jsr isdevice
|
||||
beq :+
|
||||
lda #$28 ; "No device connected"
|
||||
|
||||
|
||||
; Return oserror
|
||||
oserr: sta __oserror
|
||||
jmp return0
|
||||
|
||||
; Return success
|
||||
: ldx #$00
|
||||
: txa
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
ldx #$00
|
||||
stx __oserror
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user