2001-07-03 20:24:28 +00:00
|
|
|
;
|
|
|
|
; Maciej 'YTM/Elysium' Witkowiak
|
|
|
|
; 2.7.2001
|
|
|
|
;
|
|
|
|
; this function is used by dio_read and dio_write to fix parameters (secnum)
|
2001-07-13 15:58:12 +00:00
|
|
|
; this function calls SetDevice so that more than one drive can be used at once
|
2001-07-03 20:24:28 +00:00
|
|
|
|
2012-02-07 22:37:13 +00:00
|
|
|
.import popax,pushax,_dio_log_to_phys
|
|
|
|
.importzp ptr1
|
|
|
|
.export dio_params,dio_secnum
|
|
|
|
|
|
|
|
.include "geossym.inc"
|
|
|
|
.include "jumptab.inc"
|
|
|
|
.include "dio.inc"
|
2001-07-03 20:24:28 +00:00
|
|
|
|
|
|
|
.bss
|
2012-02-07 22:37:13 +00:00
|
|
|
|
|
|
|
dio_secnum:
|
|
|
|
.res 2
|
2001-07-03 20:24:28 +00:00
|
|
|
|
|
|
|
.code
|
|
|
|
|
2012-02-07 22:37:13 +00:00
|
|
|
dio_params:
|
2001-07-03 20:24:28 +00:00
|
|
|
sta r4L
|
|
|
|
stx r4H
|
|
|
|
|
|
|
|
jsr popax
|
|
|
|
sta dio_secnum
|
2012-03-08 18:59:41 +00:00
|
|
|
stx dio_secnum+1
|
2001-07-13 15:58:12 +00:00
|
|
|
|
|
|
|
jsr popax ; get 3rd parameter
|
2001-07-14 21:15:02 +00:00
|
|
|
pha ; save it
|
|
|
|
txa
|
|
|
|
pha
|
2001-07-13 15:58:12 +00:00
|
|
|
jsr pushax ; put it back
|
2001-07-14 21:15:02 +00:00
|
|
|
pla ; restore it
|
|
|
|
sta ptr1+1
|
|
|
|
pla
|
2001-07-13 15:58:12 +00:00
|
|
|
sta ptr1
|
|
|
|
ldy #sst_driveno
|
|
|
|
lda (ptr1),y
|
|
|
|
clc
|
|
|
|
adc #8
|
|
|
|
jsr SetDevice ; setup device, load driver
|
|
|
|
|
2001-07-03 20:24:28 +00:00
|
|
|
lda #<dio_secnum
|
|
|
|
ldx #>dio_secnum
|
|
|
|
jsr pushax
|
|
|
|
|
|
|
|
lda #<r1L
|
|
|
|
ldx #>r1H
|
|
|
|
jmp _dio_log_to_phys
|