]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/siocall.s
setviewpage was never assembled
[cc65] / libsrc / atari / siocall.s
index 1e6981acc681c84e2f9298c36075ac6a94e8ad01..da8a62656730c64d4697f557fffa5a403248ab98 100644 (file)
@@ -6,12 +6,12 @@
 ; generic (e.g. transfer size is fixed), it's used
 ; to save space with _dio_read and _dio_write functions.
 ;
-; unsigned char __fastcall__ _sio_call(_dhandle_t handle,
-;                                     _sectnum_t sect_num,
+; unsigned char __fastcall__ _sio_call(dhandle_t handle,
+;                                     sectnum_t sect_num,
 ;                                     void *buffer,
 ;                                     unsigned int sio_val);
-; _dhandle_t - 16bit (ptr)
-; _sectnum_t - 16bit
+; 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