From: Greg King Date: Mon, 24 Aug 2015 06:53:47 +0000 (-0400) Subject: Fixed bugs in geos-cbm's dio_open(). X-Git-Tag: V2.17~15^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8476360e9f5f3737eb740e8faffdeece2e4847aa;p=cc65 Fixed bugs in geos-cbm's dio_open(). * Trying to open an unused drive would leave a byte on the hardware stack. * Too high device numbers weren't caught. --- diff --git a/libsrc/geos-cbm/disk/dio_openclose.s b/libsrc/geos-cbm/disk/dio_openclose.s index ec5aa8795..72e3e32e9 100644 --- a/libsrc/geos-cbm/disk/dio_openclose.s +++ b/libsrc/geos-cbm/disk/dio_openclose.s @@ -1,8 +1,8 @@ ; -; Maciej 'YTM/Elysium' Witkowiak +; 2001-07-02, Maciej 'YTM/Elysium' Witkowiak +; 2015-08-24, Greg King ; ; based on Atari version by Christian Groessler -; 2.7.2001 ; ; dhandle_t __fastcall__ dio_open (unsigned char device); ; unsigned char __fastcall__ dio_close (dhandle_t handle); @@ -27,11 +27,13 @@ sectsizetab: .code _dio_open: - pha + cmp #4 + bcs _inv_drive tax lda driveType,x ; check if there's a device beq _inv_drive txa + pha clc adc #8 ; normalize devnum sta curDevice