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