2005-03-30 18:25:04 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 24.03.2005
|
|
|
|
;
|
|
|
|
; dhandle_t __fastcall__ dio_open (driveid_t drive_id);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _dio_open
|
2010-06-16 21:19:47 +00:00
|
|
|
.import return0, __dos_type
|
2005-03-30 18:25:04 +00:00
|
|
|
|
|
|
|
.include "errno.inc"
|
|
|
|
.include "mli.inc"
|
|
|
|
|
|
|
|
_dio_open:
|
2010-06-16 21:19:47 +00:00
|
|
|
; Check for ProDOS 8
|
|
|
|
ldx __dos_type
|
|
|
|
bne :+
|
|
|
|
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 :-
|
2010-07-17 19:11:51 +00:00
|
|
|
lda #$28 ; "No device connected"
|
2010-06-16 21:19:47 +00:00
|
|
|
|
|
|
|
; Return oserror
|
|
|
|
oserr: sta __oserror
|
|
|
|
jmp return0
|
2005-03-30 18:25:04 +00:00
|
|
|
|
|
|
|
; Return success
|
2010-06-16 21:19:47 +00:00
|
|
|
: ldx #$00
|
2005-03-30 18:25:04 +00:00
|
|
|
stx __oserror
|
|
|
|
rts
|