X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Fatari%2Fsiocall.s;h=da8a62656730c64d4697f557fffa5a403248ab98;hb=6657214a18d41ce76e9ea1bc8b67977ee13d3645;hp=1e6981acc681c84e2f9298c36075ac6a94e8ad01;hpb=b0e41e487dd2617c40f1290bec0e367620cd5088;p=cc65 diff --git a/libsrc/atari/siocall.s b/libsrc/atari/siocall.s index 1e6981acc..da8a62656 100644 --- a/libsrc/atari/siocall.s +++ b/libsrc/atari/siocall.s @@ -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) ; @@ -48,14 +48,26 @@ 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