]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/siocall.s
Marked files to be excluded from build.
[cc65] / libsrc / atari / siocall.s
index d0d1b132c868ee52bd1e8b0743baf161362b6d1f..eea3f040ab0cca2adcc5784b2ef3d8461628c93d 100644 (file)
@@ -7,11 +7,10 @@
 ; to save space with _dio_read and _dio_write functions.
 ;
 ; unsigned char __fastcall__ _sio_call(dhandle_t handle,
-;                                     sectnum_t sect_num,
+;                                     unsigned sect_num,
 ;                                     void *buffer,
-;                                     unsigned int sio_val);
+;                                     unsigned sio_val);
 ; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
 ; sio_val is (sio_command | sio_direction << 8)
 ;
 
        adc     #1
        sta     DUNIT           ; unit number (d1,d2,d3,...)
 
-       ldy     #sst_sectsize
+       lda     DAUX2           ; high byte sector #
+       bne     _realsz
+       lda     DAUX1
+       cmp     #4              ; sectors 1 to 3 are special (always 128 bytes)
+       bcs     _realsz
+
+       lda     #$80
+       sta     DBYTLO
+       asl     a
+       sta     DBYTHI
+       beq     _cont
+
+_realsz:ldy    #sst_sectsize
        lda     (ptr1),y
        sta     DBYTLO
        iny
        lda     (ptr1),y
        sta     DBYTHI
 
-       lda     #DISKID         ; SIO bus ID of diskette drive
+_cont: lda     #DISKID         ; SIO bus ID of diskette drive
        sta     DDEVIC
        lda     #15
        sta     DTIMLO          ; value got from DOS source