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,
|
2013-05-09 11:56:54 +00:00
|
|
|
; dio_phys_pos *physpos, /* input */
|
|
|
|
; 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
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _dio_phys_to_log
|
2022-08-28 19:52:53 +00:00
|
|
|
.import popax,___oserror
|
2013-05-09 11:56:54 +00:00
|
|
|
.importzp ptr1,ptr2,ptr3
|
|
|
|
.include "atari.inc"
|
2000-10-12 21:02:24 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc _dio_phys_to_log
|
2000-10-12 21:02:24 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
sta ptr1
|
|
|
|
stx ptr1+1 ; pointer to result
|
2000-10-18 23:47:42 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr popax
|
|
|
|
sta ptr2
|
|
|
|
stx ptr2+1 ; pointer to input structure
|
2000-10-20 21:59:05 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr popax
|
|
|
|
sta ptr3
|
|
|
|
stx ptr3+1 ; pointer to handle
|
2000-10-20 21:59:05 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldy #sst_flag
|
|
|
|
lda (ptr3),y
|
|
|
|
and #128
|
|
|
|
beq _inv_hand ; handle not open or invalid
|
2000-10-18 23:47:42 +00:00
|
|
|
|
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
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldy #diopp_sector
|
|
|
|
lda (ptr2),y
|
|
|
|
tax
|
|
|
|
iny
|
|
|
|
lda (ptr2),y
|
|
|
|
ldy #1
|
|
|
|
sta (ptr1),y
|
|
|
|
dey
|
|
|
|
txa
|
|
|
|
sta (ptr1),y
|
2000-10-20 21:59:05 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldx #0
|
|
|
|
txa
|
2000-10-20 21:59:05 +00:00
|
|
|
ret:
|
2022-08-28 19:52:53 +00:00
|
|
|
sta ___oserror
|
2013-05-09 11:56:54 +00:00
|
|
|
rts ; return success
|
2000-10-20 21:59:05 +00:00
|
|
|
|
|
|
|
; invalid handle
|
|
|
|
|
|
|
|
_inv_hand:
|
2013-05-09 11:56:54 +00:00
|
|
|
ldx #0
|
|
|
|
lda #BADIOC
|
|
|
|
bne ret
|
2000-10-18 23:47:42 +00:00
|
|
|
|
2000-10-12 21:02:24 +00:00
|
|
|
.endproc
|
|
|
|
|