1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00

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.
This commit is contained in:
Greg King 2015-08-24 02:53:47 -04:00
parent 83890e56eb
commit 8476360e9f

View File

@ -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