X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Fgeos-cbm%2Fdisk%2Fdio_openclose.s;h=ec5aa87956b5f80f4154beca746b147fcf9cadc0;hb=85885001b133e2dc320b6f6459259afa69784ca8;hp=fc0fcecf2c28a71f110d8e57d51a9ed2605086d2;hpb=44fd1082ae807a0b6b4046c65914e20a7e27101c;p=cc65 diff --git a/libsrc/geos-cbm/disk/dio_openclose.s b/libsrc/geos-cbm/disk/dio_openclose.s index fc0fcecf2..ec5aa8795 100644 --- a/libsrc/geos-cbm/disk/dio_openclose.s +++ b/libsrc/geos-cbm/disk/dio_openclose.s @@ -10,74 +10,74 @@ ; dio_open sets given device as current and initializes disk ; dio_close does nothing special - .export _dio_open, _dio_close - .import __oserror, _OpenDisk - .importzp ptr1, tmp1 + .export _dio_open, _dio_close + .import __oserror, _OpenDisk + .importzp ptr1, tmp1 - .include "dio.inc" + .include "dio.inc" .include "jumptab.inc" .include "geossym.inc" - .include "const.inc" + .include "const.inc" .bss sectsizetab: - .res 4 * sst_size ; this is hardcoded + .res 4 * sst_size ; this is hardcoded .code _dio_open: - pha - tax - lda driveType,x ; check if there's a device - beq _inv_drive - txa - clc - adc #8 ; normalize devnum - sta curDevice - jsr SetDevice - jsr _OpenDisk ; take care for errors there + pha + tax + lda driveType,x ; check if there's a device + beq _inv_drive + txa + clc + adc #8 ; normalize devnum + sta curDevice + jsr SetDevice + jsr _OpenDisk ; take care for errors there - pla - tay ; drive # - asl a ; make index from drive id - asl a - tax - - lda #0 - sta sectsizetab+sst_sectsize,x - lda #128 - sta sectsizetab+sst_flag,x ; set flag that drive is "open" - lda #1 - sta sectsizetab+sst_sectsize+1,x - tya - sta sectsizetab+sst_driveno,x - - stx tmp1 - lda #sectsizetab - adc #0 - tax - lda tmp1 + pla + tay ; drive # + asl a ; make index from drive id + asl a + tax + + lda #0 + sta sectsizetab+sst_sectsize,x + lda #128 + sta sectsizetab+sst_flag,x ; set flag that drive is "open" + lda #1 + sta sectsizetab+sst_sectsize+1,x + tya + sta sectsizetab+sst_driveno,x + + stx tmp1 + lda #sectsizetab + adc #0 + tax + lda tmp1 - rts + rts _inv_drive: - lda #DEV_NOT_FOUND - sta __oserror - lda #0 - tax - rts + lda #DEV_NOT_FOUND + sta __oserror + lda #0 + tax + rts _dio_close: - sta ptr1 - stx ptr1+1 - lda #0 - ldy #sst_flag - sta (ptr1),y - sta __oserror ; success - tax - rts ; return no error + sta ptr1 + stx ptr1+1 + lda #0 + ldy #sst_flag + sta (ptr1),y + sta __oserror ; success + tax + rts ; return no error