2 ; Christian Groessler, October 2000
4 ; This file provides the __dio_open and __dio_close functions
5 ; Since on the Atari no real open and close is necessary, they
6 ; do not much. The __dio_open sets the sector size of the
7 ; drive which is later used by the _dio_read and _dio_write
10 ; _dhandle_t __fastcall__ _dio_open (_driveid_t drive_id);
11 ; unsigned char __fastcall__ _dio_close (_dhandle_t handle);
14 .export __dio_open,__dio_close
24 .res NUMDRVS * sst_size
31 cmp #NUMDRVS ; valid drive id?
34 asl a ; make index from drive id
37 lda #128 ; currently hardcoded (until I get an 815 :-)
38 sta sectsizetab+sst_sectsize,x
39 sta sectsizetab+sst_flag,x ; set flag that drive is "open"
41 sta sectsizetab+sst_sectsize+1,x
42 sta __oserror ; success
44 sta sectsizetab+sst_driveno,x
46 ; sta sectsizetab+sst_id+1,x
59 lda #NONDEV ; non-existent device
76 sta __oserror ; success