2 ; Maciej 'YTM/Elysium' Witkowiak
4 ; based on Atari version by Christian Groessler
7 ; dhandle_t __fastcall__ dio_open (driveid_t drive_id);
8 ; unsigned char __fastcall__ dio_close (dhandle_t handle);
10 ; dio_open sets given device as current and initializes disk
11 ; dio_close does nothing special
13 .export _dio_open, _dio_close
14 .import __oserror, _OpenDisk
16 .include "../inc/dio.inc"
17 .include "../inc/jumptab.inc"
18 .include "../inc/geossym.inc"
19 .include "../inc/const.inc"
24 .res 4 * sst_size ; this is hardcoded
31 lda driveType,x ; check if there's a device
34 adc #8 ; normalize devnum
37 jsr _OpenDisk ; take care for errors there
41 asl a ; make index from drive id
46 sta sectsizetab+sst_sectsize,x
48 sta sectsizetab+sst_flag,x ; set flag that drive is "open"
50 sta sectsizetab+sst_sectsize+1,x
52 sta sectsizetab+sst_driveno,x
81 sta __oserror ; success