2000-10-12 21:02:24 +00:00
|
|
|
;
|
|
|
|
; Christian Groessler, October 2000
|
|
|
|
;
|
|
|
|
; this file provides the _dio_chs_to_snum function
|
|
|
|
;
|
|
|
|
; on the Atari this function is a dummy, it ignores
|
|
|
|
; cylinder and head 0 and returns as sector number the
|
|
|
|
; sector number it got
|
|
|
|
;
|
2000-10-18 23:47:42 +00:00
|
|
|
; _sectnum_t __fastcall__ _dio_chs_to_snum(_dhandle_t handle,
|
|
|
|
; unsigned int cyl,
|
|
|
|
; unsigned int head,
|
|
|
|
; unsigned int sector);
|
|
|
|
; _dhandle_t - 16bit (ptr)
|
2000-10-12 21:02:24 +00:00
|
|
|
; _sectnum_t - 16bit
|
|
|
|
;
|
|
|
|
|
|
|
|
.export __dio_chs_to_snum
|
2000-10-18 23:47:42 +00:00
|
|
|
.import addsp4,popax
|
|
|
|
.importzp ptr1
|
2000-10-12 21:02:24 +00:00
|
|
|
.include "atari.inc"
|
|
|
|
|
|
|
|
.proc __dio_chs_to_snum
|
|
|
|
|
|
|
|
pha ; save sector value
|
|
|
|
txa
|
|
|
|
pha
|
|
|
|
jsr addsp4 ; ignore other parameters
|
2000-10-18 23:47:42 +00:00
|
|
|
|
|
|
|
jsr popax
|
|
|
|
sta ptr1
|
|
|
|
stx ptr1+1
|
|
|
|
ldy #sst_flag
|
|
|
|
lda (ptr1),y
|
|
|
|
and #128
|
|
|
|
beq _inv_hand ; handle not open or invalid
|
|
|
|
|
2000-10-12 21:02:24 +00:00
|
|
|
pla
|
|
|
|
tay
|
|
|
|
pla
|
|
|
|
rts
|
|
|
|
|
2000-10-18 23:47:42 +00:00
|
|
|
_inv_hand:
|
|
|
|
pla
|
|
|
|
pla
|
|
|
|
ldx #255
|
|
|
|
txa
|
|
|
|
rts
|
|
|
|
|
2000-10-12 21:02:24 +00:00
|
|
|
.endproc
|
|
|
|
|