X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Fatari%2Fdio_stc.s;h=52b3af4a610d36ca3d2e5bd0ff1caca5bc0b1bd3;hb=6cd1b57c06263c1ca4913e9ada1f2c67010c0cb1;hp=fbb518f0b478c4250da4d54dde2336deafa6697d;hpb=7eae69826413e575bfc720a336052a60c8c07577;p=cc65 diff --git a/libsrc/atari/dio_stc.s b/libsrc/atari/dio_stc.s index fbb518f0b..52b3af4a6 100644 --- a/libsrc/atari/dio_stc.s +++ b/libsrc/atari/dio_stc.s @@ -7,68 +7,66 @@ ; on the Atari this function is a dummy, it returns ; cylinder and head 0 and as sector the sectnum it got ; -; unsigned char __fastcall__ _dio_log_to_phys(_dhandle_t handle, -; _dio_phys_pos *physpos, /* output */ -; _sectnum_t *sectnum); /* input */ +; unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle, +; unsigned *sectnum, /* input */ +; dio_phys_pos *physpos); /* output */ ; -; _dhandle_t - 16bit (ptr) -; _sectnum_t - 16bit +; dhandle_t - 16bit (ptr) ; - .export __dio_log_to_phys - .include "atari.inc" - .importzp ptr1,ptr2,ptr3 - .import popax,__oserror + .export _dio_log_to_phys + .include "atari.inc" + .importzp ptr1,ptr2,ptr3 + .import popax,__oserror -.proc __dio_log_to_phys +.proc _dio_log_to_phys - sta ptr1 - stx ptr1+1 ; save pointer to input data + sta ptr2 + stx ptr2+1 ; pointer to output structure - jsr popax - sta ptr2 - stx ptr2+1 ; pointer to output structure + jsr popax + sta ptr1 + stx ptr1+1 ; save pointer to input data - jsr popax - sta ptr3 - stx ptr3+1 ; pointer to handle + 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 + ldy #sst_flag + lda (ptr3),y + and #128 + beq _inv_hand ; handle not open or invalid - lda #0 - tay - tax - sta (ptr2),y ; head - iny - sta (ptr2),y ; track (low) - iny - sta (ptr2),y ; track (high) - iny + lda #0 + tay + tax + sta (ptr2),y ; head + iny + sta (ptr2),y ; track (low) + iny + sta (ptr2),y ; track (high) + iny - lda (ptr1,x) - sta (ptr2),y - iny - inc ptr1 - bne _l1 - inc ptr1+1 -_l1: lda (ptr1,x) - sta (ptr2),y + lda (ptr1,x) + sta (ptr2),y + iny + inc ptr1 + bne _l1 + inc ptr1+1 +_l1: lda (ptr1,x) + sta (ptr2),y - ldx #0 - txa + txa ret: - sta __oserror - rts ; return success + sta __oserror + rts ; return success ; invalid handle _inv_hand: - ldx #0 - lda #BADIOC - bne ret + ldx #0 + lda #BADIOC + bne ret .endproc