From 8476360e9f5f3737eb740e8faffdeece2e4847aa Mon Sep 17 00:00:00 2001 From: Greg King Date: Mon, 24 Aug 2015 02:53:47 -0400 Subject: [PATCH] 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. --- libsrc/geos-cbm/disk/dio_openclose.s | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 -- 2.39.5