2000-10-12 21:02:50 +00:00
|
|
|
;
|
|
|
|
; Christian Groessler, October 2000
|
|
|
|
;
|
2000-10-20 21:59:05 +00:00
|
|
|
; this file provides the _dio_log_to_phys function
|
|
|
|
; (previously called _dio_snum_to_chs, so the filename)
|
2000-10-12 21:02:50 +00:00
|
|
|
;
|
|
|
|
; on the Atari this function is a dummy, it returns
|
|
|
|
; cylinder and head 0 and as sector the sectnum it got
|
|
|
|
;
|
2000-11-16 21:27:07 +00:00
|
|
|
; unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle,
|
|
|
|
; sectnum_t *sectnum, /* input */
|
|
|
|
; dio_phys_pos *physpos); /* output */
|
2000-10-20 21:59:05 +00:00
|
|
|
;
|
2000-11-16 21:27:07 +00:00
|
|
|
; dhandle_t - 16bit (ptr)
|
|
|
|
; sectnum_t - 16bit
|
2000-10-12 21:02:50 +00:00
|
|
|
;
|
|
|
|
|
2000-11-16 21:27:07 +00:00
|
|
|
.export _dio_log_to_phys
|
2000-10-12 21:02:50 +00:00
|
|
|
.include "atari.inc"
|
2000-10-20 21:59:05 +00:00
|
|
|
.importzp ptr1,ptr2,ptr3
|
|
|
|
.import popax,__oserror
|
2000-10-12 21:02:50 +00:00
|
|
|
|
2000-11-16 21:27:07 +00:00
|
|
|
.proc _dio_log_to_phys
|
2000-10-12 21:02:50 +00:00
|
|
|
|
|
|
|
sta ptr2
|
2000-10-20 21:59:05 +00:00
|
|
|
stx ptr2+1 ; pointer to output structure
|
|
|
|
|
2000-11-16 21:27:07 +00:00
|
|
|
jsr popax
|
|
|
|
sta ptr1
|
|
|
|
stx ptr1+1 ; save pointer to input data
|
|
|
|
|
2000-10-20 21:59:05 +00:00
|
|
|
jsr popax
|
|
|
|
sta ptr3
|
|
|
|
stx ptr3+1 ; pointer to handle
|
|
|
|
|
|
|
|
ldy #sst_flag
|
|
|
|
lda (ptr3),y
|
|
|
|
and #128
|
|
|
|
beq _inv_hand ; handle not open or invalid
|
|
|
|
|
2000-10-12 21:02:50 +00:00
|
|
|
lda #0
|
|
|
|
tay
|
2000-10-20 21:59:05 +00:00
|
|
|
tax
|
|
|
|
sta (ptr2),y ; head
|
2000-10-12 21:02:50 +00:00
|
|
|
iny
|
2000-10-20 21:59:05 +00:00
|
|
|
sta (ptr2),y ; track (low)
|
|
|
|
iny
|
|
|
|
sta (ptr2),y ; track (high)
|
|
|
|
iny
|
|
|
|
|
|
|
|
lda (ptr1,x)
|
2000-10-12 21:02:50 +00:00
|
|
|
sta (ptr2),y
|
|
|
|
iny
|
2000-10-20 21:59:05 +00:00
|
|
|
inc ptr1
|
|
|
|
bne _l1
|
|
|
|
inc ptr1+1
|
|
|
|
_l1: lda (ptr1,x)
|
2000-10-12 21:02:50 +00:00
|
|
|
sta (ptr2),y
|
|
|
|
|
|
|
|
txa
|
2000-10-20 21:59:05 +00:00
|
|
|
ret:
|
|
|
|
sta __oserror
|
|
|
|
rts ; return success
|
2000-10-12 21:02:50 +00:00
|
|
|
|
2000-10-20 21:59:05 +00:00
|
|
|
; invalid handle
|
2000-10-18 23:47:42 +00:00
|
|
|
|
2000-10-20 21:59:05 +00:00
|
|
|
_inv_hand:
|
|
|
|
ldx #0
|
|
|
|
lda #BADIOC
|
|
|
|
bne ret
|
2000-10-12 21:02:50 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|